Skip to content

Commit 1882d93

Browse files
runningcodeclaude
andauthored
ref(skill): Defer to the shared Sentry skills in create-java-pr (#6621)
* fix(skill): Use pr-writer in the create-java-pr skill getsentry/skills renamed create-pr to pr-writer and then removed the old name, so Step 5 called a skill that no longer exists. Keep the repo PR template as the body structure over pr-writer's default shape, as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * 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> * ref(skill): Pass the per-branch body file to gh pr create Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * ref(skill): Align the stacked PR reference with Step 5 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent fdae88c commit 1882d93

2 files changed

Lines changed: 23 additions & 40 deletions

File tree

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

Lines changed: 20 additions & 38 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
@@ -121,28 +105,30 @@ If the push fails due to diverged history, ask the user how to proceed rather th
121105
122106
## Step 5: Create PR
123107
124-
Invoke the `sentry-skills:create-pr` skill to create a draft PR.
108+
Invoke the `sentry-skills:pr-writer` skill to create a draft PR.
125109
126-
Read `.github/pull_request_template.md` and use it as the PR body structure — it is the single source
127-
of truth for the sections and checklist, so never reproduce it from memory. Fill in each section based
128-
on the changes being PR'd, drop the HTML comment hints, and check any checklist items that apply.
110+
Read `.github/pull_request_template.md` and use it as the PR body structure instead of pr-writer's
111+
default body shape — it is the single source of truth for the sections and checklist, so never
112+
reproduce it from memory. Fill in each section based on the changes being PR'd, drop the HTML
113+
comment hints, and check any checklist items that apply.
129114
130-
**PR title format** — same as the commit subject (Step 3):
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+
Only after the write succeeds, pass that file to `gh pr create` in place of pr-writer's:
131118

132-
```
133-
<type>(<scope>): <Subject>
119+
```bash
120+
gh pr create --draft --title '<title>' --body-file /tmp/pr-body-<branch>.md
134121
```
135122

136-
Examples:
137-
- `feat(core): Add structured logging support`
138-
- `fix(android): Prevent crash on API 21 when registering receiver`
123+
If the change needs no changelog entry (see Step 6), make `#skip-changelog` the last line of the
124+
body to disable the changelog CI check.
139125

140126
**For stacked PRs:**
141127

142128
- Pass `--base <previous-stack-branch>` so the PR targets the previous branch (first PR in a stack targets the collection branch).
143129
- Use the stacked PR title format: `<type>(<scope>): [<Topic> <N>] <Subject>` (see `references/stacked-prs.md` § "PR Title Naming").
144130
- 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).
145-
- 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.
131+
- 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.
146132

147133
Then continue to Step 5.5 (stacked PRs only) or Step 6.
148134

@@ -156,7 +142,8 @@ Edit each body using the procedure in § "Editing PR Descriptions" below.
156142

157143
## Step 6: Update Changelog
158144

159-
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:
145+
Decide whether a changelog entry is needed before Step 5, which adds `#skip-changelog` to the PR
146+
body when it is not. **Skip this step** if the changes are not user-facing, for example:
160147

161148
- Test-only changes (new tests, test refactors, test fixtures)
162149
- CI/CD or build configuration changes
@@ -190,7 +177,7 @@ Create the subsection under `## Unreleased` if it does not already exist.
190177
- <Short description of the change> ([#<PR_NUMBER>](https://github.com/getsentry/sentry-java/pull/<PR_NUMBER>))
191178
```
192179
193-
Use the PR number returned by `sentry-skills:create-pr`. Match the style of existing entries — sentence case, ending with the PR link, no trailing period.
180+
Use the number of the PR created in Step 5. Match the style of existing entries — sentence case, ending with the PR link, no trailing period.
194181
195182
#### Commit and push
196183
@@ -202,16 +189,11 @@ git commit -m "changelog"
202189
git push
203190
```
204191
205-
### No changelog needed
206-
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.
209-
210192
## Editing PR Descriptions
211193
212194
Do not use shell redirects (`>`, `>>`), pipes (`|`), or compound commands (`&&`, `||`). These create
213195
compound shell expressions that won't match permission patterns. Instead:
214196
215197
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`
198+
2. Use the `Write` tool to save it to `/tmp/pr-body-<PR_NUMBER>.md`, and the `Edit` tool to modify it
199+
3. Once the write succeeds, update with `gh pr edit <PR_NUMBER> --body-file /tmp/pr-body-<PR_NUMBER>.md`

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ git commit --allow-empty -m "collection: <topic>"
2626

2727
Push it and open its PR against `main` right away — it is the PR the whole stack is eventually
2828
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.
29+
(`<type>(<scope>): <Topic>`, no `[<Topic> <N>]` bracket) and no merge method reminder. Create it
30+
with the `gh pr create` command and per-branch body file from `SKILL.md` § "Step 5: Create PR".
3031

3132
## Rules That Will Destroy a Stack If Broken
3233

@@ -76,7 +77,7 @@ off any PR body rather than guessing from branch names, which may use different
7677
No status column — GitHub already shows that. The `---` separates the stack list from the rest of
7778
the description.
7879

79-
**Merge method reminder:** on stack PRs (not the collection branch PR), end the description with:
80+
**Merge method reminder:** on stack PRs (not the collection branch PR), end the description, above any `#skip-changelog`, with:
8081

8182
```markdown
8283
> ⚠️ **Merge this PR using a merge commit** (not squash). Only the collection branch is squash-merged into main.

0 commit comments

Comments
 (0)