Skip to content

Commit b1045ed

Browse files
adinauerclaude
andauthored
docs: Improve stacked PR workflow for collection branch and merge method (#5178)
* docs: Add collection branch safety warnings to PR workflow Add explicit warnings to pr.mdc and create-java-pr skill that the collection branch must never be manually merged or fast-forwarded. Updating it causes GitHub to auto-merge all stack PRs and delete their branches, destroying the entire stack. Co-Authored-By: Claude <noreply@anthropic.com> * docs: Include collection branch PR in stack list updates The stack list update instructions only mentioned "all PRs in the stack" which was ambiguous — it could be read as excluding the collection branch PR. Now both pr.mdc and the create-java-pr skill explicitly call out that the collection branch PR must also be updated with the stack list. Co-Authored-By: Claude <noreply@anthropic.com> * docs: Add merge commit reminder to stack PR descriptions Stack PRs must be merged with merge commits, not squash. Add a reminder to the PR description so reviewers/mergers pick the right method. This only applies to stack PRs — not standalone PRs or the collection branch PR. Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 6a6b6c6 commit b1045ed

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,15 @@ Fill in each section based on the changes being PR'd. Check any checklist items
113113
- Pass `--base <previous-stack-branch>` so the PR targets the previous branch (first PR in a stack targets the collection branch).
114114
- Use the stacked PR title format: `<type>(<scope>): [<Topic> <N>] <Subject>` (see `.cursor/rules/pr.mdc` § "PR Title Naming").
115115
- Include the stack list at the top of the PR body, before the `## :scroll: Description` section (see `.cursor/rules/pr.mdc` § "Stack List in PR Description" for the format).
116+
- Add a merge method reminder at the very end of the PR body (see `.cursor/rules/pr.mdc` § "Stack List in PR Description" for the exact text). This only applies to stack PRs, not the collection branch PR.
116117

117118
Then continue to Step 5.5 (stacked PRs only) or Step 6.
118119

119120
## Step 5.5: Update Stack List on All PRs (stacked PRs only)
120121

121122
Skip this step for standalone PRs.
122123

123-
After creating the PR, update the PR description on **every other PR in the stack** so all PRs have the same up-to-date stack list. Follow the format and commands in `.cursor/rules/pr.mdc` § "Stack List in PR Description".
124+
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 `.cursor/rules/pr.mdc` § "Stack List in PR Description".
124125

125126
## Step 6: Update Changelog
126127

.cursor/rules/pr.mdc

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ gh pr create --base main --draft --title "<type>(<scope>): <Topic>" --body "Coll
199199

200200
### Stack List in PR Description
201201

202-
Every PR in the stack must have a stack list **at the top of its description** (before the `## :scroll: Description` section). When a new PR is added, update the description on **all** PRs in the stack.
202+
Every PR in the stack — **including the collection branch PR** — must have a stack list **at the top of its description** (before the `## :scroll: Description` section). When a new PR is added, update the description on **all** PRs in the stack and on the collection branch PR.
203203

204204
Format:
205205

@@ -215,6 +215,14 @@ Format:
215215

216216
No status column — GitHub already shows that. The `---` separates the stack list from the rest of the PR description.
217217

218+
**Merge method reminder:** On stack PRs (not the collection branch PR), add the following line at the very end of the PR description:
219+
220+
```markdown
221+
> ⚠️ **Merge this PR using a merge commit** (not squash). Only the collection branch is squash-merged into main.
222+
```
223+
224+
This does not apply to standalone PRs or the collection branch PR.
225+
218226
To update the PR description, use `--body-file` to avoid shell quoting issues with special characters in the body:
219227

220228
```bash

0 commit comments

Comments
 (0)