Skip to content

Commit c37c75b

Browse files
runningcodeclaude
andcommitted
ref(skill): Defer to the shared Sentry skills in create-java-pr
Branch naming, commit format, and PR title format now come from create-branch, commit, and pr-writer instead of local copies that had already drifted (the commit types lacked revert). Add #skip-changelog to the first PR body instead of editing it afterwards, and write PR bodies to per-branch or per-PR files. The shared /tmp/pr-body.md outlives sessions and once opened a PR with another PR's body. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 314f6aa commit c37c75b

1 file changed

Lines changed: 12 additions & 35 deletions

File tree

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

Lines changed: 12 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,7 @@ If the user explicitly says "stack", "stacked PR", or provides numbered stack ti
5555

5656
## Step 1: Ensure Feature Branch
5757

58-
```bash
59-
git branch --show-current
60-
```
61-
62-
If on `main` or `master`, create and switch to a new branch:
63-
64-
```bash
65-
git checkout -b <type>/<short-description>
66-
```
67-
68-
Derive the branch name from the changes being made. Use `feat/`, `fix/`, `ref/`, etc. matching the commit type conventions.
58+
If on `main` or `master`, invoke the `sentry-skills:create-branch` skill.
6959

7060
**For stacked PRs:** For the first PR in a new stack, first create and push the collection branch (see `references/stacked-prs.md` § "Why a Collection Branch"), then branch the PR off it. For subsequent PRs, branch off the previous stack branch. Give every branch in the stack a shared prefix naming the feature, with a descriptive suffix per PR.
7161

@@ -89,13 +79,7 @@ Check for uncommitted changes:
8979
git status --porcelain
9080
```
9181
92-
If there are uncommitted changes, invoke the `sentry-skills:commit` skill to stage and commit them following [Sentry commit message conventions](https://develop.sentry.dev/engineering-practices/commit-messages/):
93-
94-
```
95-
<type>(<scope>): <subject>
96-
```
97-
98-
Allowed types: `feat`, `fix`, `ref`, `chore`, `docs`, `test`, `perf`, `build`, `ci`, `style`, `meta`, `license`
82+
If there are uncommitted changes, invoke the `sentry-skills:commit` skill to stage and commit them.
9983
10084
**Important:** When staging, ignore changes that are only relevant for local testing and should not be part of the PR. Common examples:
10185
@@ -128,22 +112,19 @@ default body shape — it is the single source of truth for the sections and che
128112
reproduce it from memory. Fill in each section based on the changes being PR'd, drop the HTML
129113
comment hints, and check any checklist items that apply.
130114
131-
**PR title format** — same as the commit subject (Step 3):
132-
133-
```
134-
<type>(<scope>): <Subject>
135-
```
115+
Write the body to `/tmp/pr-body-<branch>.md`, with each `/` in the branch name replaced by `-`, not
116+
to pr-writer's `/tmp/pr-body.md`: that file outlives sessions and can still hold another PR's body.
117+
Run `gh pr create` only after the write succeeds.
136118
137-
Examples:
138-
- `feat(core): Add structured logging support`
139-
- `fix(android): Prevent crash on API 21 when registering receiver`
119+
If the change needs no changelog entry (see Step 6), make `#skip-changelog` the last line of the
120+
body to disable the changelog CI check.
140121
141122
**For stacked PRs:**
142123
143124
- Pass `--base <previous-stack-branch>` so the PR targets the previous branch (first PR in a stack targets the collection branch).
144125
- Use the stacked PR title format: `<type>(<scope>): [<Topic> <N>] <Subject>` (see `references/stacked-prs.md` § "PR Title Naming").
145126
- Include the stack list at the top of the PR body, before the `## :scroll: Description` section (see `references/stacked-prs.md` § "Stack List in PR Description" for the format).
146-
- Add a merge method reminder at the very end of the PR body (see `references/stacked-prs.md` § "Stack List in PR Description" for the exact text). This only applies to stack PRs, not the collection branch PR.
127+
- Add a merge method reminder at the end of the PR body, above any `#skip-changelog` (see `references/stacked-prs.md` § "Stack List in PR Description" for the exact text). This only applies to stack PRs, not the collection branch PR.
147128
148129
Then continue to Step 5.5 (stacked PRs only) or Step 6.
149130
@@ -157,7 +138,8 @@ Edit each body using the procedure in § "Editing PR Descriptions" below.
157138
158139
## Step 6: Update Changelog
159140
160-
First, determine whether a changelog entry is needed. **Skip this step** (and go straight to "No changelog needed" below) if the changes are not user-facing, for example:
141+
Decide whether a changelog entry is needed before Step 5, which adds `#skip-changelog` to the PR
142+
body when it is not. **Skip this step** if the changes are not user-facing, for example:
161143
162144
- Test-only changes (new tests, test refactors, test fixtures)
163145
- CI/CD or build configuration changes
@@ -203,16 +185,11 @@ git commit -m "changelog"
203185
git push
204186
```
205187
206-
### No changelog needed
207-
208-
If no changelog entry is needed, append `#skip-changelog` to the end of the PR description to disable
209-
the changelog CI check, using the procedure in § "Editing PR Descriptions" below.
210-
211188
## Editing PR Descriptions
212189
213190
Do not use shell redirects (`>`, `>>`), pipes (`|`), or compound commands (`&&`, `||`). These create
214191
compound shell expressions that won't match permission patterns. Instead:
215192

216193
1. Read the body with `gh pr view <PR_NUMBER> --json body --jq '.body'` (output is returned directly)
217-
2. Use the `Write` tool to save it to `/tmp/pr-body.md`, and the `Edit` tool to modify it
218-
3. Update with `gh pr edit <PR_NUMBER> --body-file /tmp/pr-body.md`
194+
2. Use the `Write` tool to save it to `/tmp/pr-body-<PR_NUMBER>.md`, and the `Edit` tool to modify it
195+
3. Once the write succeeds, update with `gh pr edit <PR_NUMBER> --body-file /tmp/pr-body-<PR_NUMBER>.md`

0 commit comments

Comments
 (0)