Skip to content

Commit df66579

Browse files
runningcodeclaude
andcommitted
docs(agents): Fix defects found by dry-running the PR skill
Ran fresh agents through "create a PR" and "create a stacked PR" against the deduped docs, stopping each before the first mutating action. Both paths loaded the intended files, but four defects surfaced: - SKILL.md named stacked-prs.md the source of truth for branch naming, which that file never covered. Corrected to title naming; the branch rule stays in Step 1, where the branch is created. - Four passages referenced the collection branch PR, but no step ever opened it. Added next to the branch creation, with its title and merge-reminder exceptions. - The PR-description editing rule was stated three times and had already drifted. It now lives once in SKILL.md, which both the standalone and stacked paths read, and stacked-prs.md points back to it. - AGENTS.md rule 7 told agents to propose but not execute a commit while the create-java-pr skill commits, pushes, and opens the PR, leaving two terminal states for one request. Scoped rule 7 to implementation work. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 2b6e3a3 commit df66579

3 files changed

Lines changed: 19 additions & 19 deletions

File tree

.claude/skills/create-java-pr/SKILL.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ description: Create a pull request in sentry-java. Use when asked to "create pr"
88
Prepare local changes and create a pull request for the sentry-java repo.
99

1010
**For stacked PRs:** read `references/stacked-prs.md` before proceeding. It is the source of truth for
11-
stack structure, branch and title naming, stack list format, and merge strategy.
11+
stack structure, title naming, stack list format, and merge strategy.
1212

1313
## Step 0: Determine PR Type From Git Branch Context
1414

@@ -152,11 +152,7 @@ Skip this step for standalone PRs.
152152
153153
After creating the PR, update the PR description on **every other PR in the stack — including the collection branch PR** — so all PRs have the same up-to-date stack list. Follow the format and commands in `references/stacked-prs.md` § "Stack List in PR Description".
154154
155-
**Important:** When updating PR bodies, never use shell redirects (`>`, `>>`) or pipes (`|`) or compound commands (`&&`). These create compound shell expressions that won't match permission patterns. Instead:
156-
- Use `gh pr view <NUMBER> --json body --jq '.body'` to get the body (output returned directly)
157-
- Use the `Write` tool to save it to a temp file
158-
- Use the `Edit` tool to modify the temp file
159-
- Use `gh pr edit <NUMBER> --body-file /tmp/pr-body.md` to update
155+
Edit each body using the procedure in § "Editing PR Descriptions" below.
160156
161157
## Step 6: Update Changelog
162158
@@ -208,8 +204,14 @@ git push
208204
209205
### No changelog needed
210206
211-
If no changelog entry is needed, add `#skip-changelog` to the PR description to disable the changelog CI check:
207+
If no changelog entry is needed, append `#skip-changelog` to the end of the PR description to disable
208+
the changelog CI check, using the procedure in § "Editing PR Descriptions" below.
212209
213-
1. Get the current body: `gh pr view <PR_NUMBER> --json body --jq '.body'`
214-
2. Use the `Write` tool to save the output to `/tmp/pr-body.md`, appending `\n#skip-changelog\n` at the end
215-
3. Update: `gh pr edit <PR_NUMBER> --body-file /tmp/pr-body.md`
210+
## Editing PR Descriptions
211+
212+
Do not use shell redirects (`>`, `>>`), pipes (`|`), or compound commands (`&&`, `||`). These create
213+
compound shell expressions that won't match permission patterns. Instead:
214+
215+
1. Read the body with `gh pr view <PR_NUMBER> --json body --jq '.body'` (output is returned directly)
216+
2. Use the `Write` tool to save it to `/tmp/pr-body.md`, and the `Edit` tool to modify it
217+
3. Update with `gh pr edit <PR_NUMBER> --body-file /tmp/pr-body.md`

.claude/skills/create-java-pr/references/stacked-prs.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ Create it with an empty commit, so GitHub allows opening a PR:
2424
git commit --allow-empty -m "collection: <topic>"
2525
```
2626

27+
Push it and open its PR against `main` right away — it is the PR the whole stack is eventually
28+
squash-merged through, and it carries the stack list like every other PR. Give it a plain title
29+
(`<type>(<scope>): <Topic>`, no `[<Topic> <N>]` bracket) and no merge method reminder.
30+
2731
## Rules That Will Destroy a Stack If Broken
2832

2933
**Never update the collection branch yourself.** Never merge, fast-forward, or push stack branch
@@ -78,11 +82,5 @@ the description.
7882
> ⚠️ **Merge this PR using a merge commit** (not squash). Only the collection branch is squash-merged into main.
7983
```
8084

81-
## Editing PR Descriptions
82-
83-
Do not use shell redirects (`>`, `>>`), pipes (`|`), or compound commands (`&&`, `||`). These create
84-
compound shell expressions that won't match permission patterns. Instead:
85-
86-
1. Read the body with `gh pr view <PR_NUMBER> --json body --jq '.body'` (output is returned directly)
87-
2. Use the `Write` tool to save it to `/tmp/pr-body.md`, and the `Edit` tool to modify it
88-
3. Update with `gh pr edit <PR_NUMBER> --body-file /tmp/pr-body.md`
85+
Updating every PR's stack list means editing several descriptions — follow the procedure in
86+
`SKILL.md` § "Editing PR Descriptions".

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ make systemTest
9898
4. **High-level communication**: Give high-level explanations of changes made, not step-by-step descriptions
9999
5. **Simplicity first**: Make every task and code change as simple as possible. Avoid massive or complex changes. Impact as little code as possible.
100100
6. **Format and regenerate**: Once done, format code and regenerate .api files: `./gradlew spotlessApply apiDump`
101-
7. **Propose commit**: As final step, git stage relevant files and propose (but not execute) a single git commit command
101+
7. **Propose commit**: As final step, git stage relevant files and propose (but not execute) a single git commit command. This applies to implementation work; when the task is to open a PR, the `create-java-pr` skill takes over from here and does commit, push, and open it.
102102

103103
## Repository Skills
104104

0 commit comments

Comments
 (0)