Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .claude/skills/create-java-pr/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ Derive the branch name from the changes being made. Use `feat/`, `fix/`, `ref/`,

**For stacked PRs:** For the first PR in a new stack, first create and push the collection branch (see `.cursor/rules/pr.mdc` ยง "Creating the Collection Branch"), then branch the PR off it. For subsequent PRs, branch off the previous stack branch. Use the naming conventions from `.cursor/rules/pr.mdc` ยง "Branch Naming".

**CRITICAL: Never merge, fast-forward, or push commits into the collection branch.** It stays at its initial position until the user merges stack PRs through GitHub. Updating it will auto-merge and destroy the entire PR stack.

## Step 2: Format Code and Regenerate API Files

```bash
Expand Down Expand Up @@ -111,14 +113,15 @@ Fill in each section based on the changes being PR'd. Check any checklist items
- Pass `--base <previous-stack-branch>` so the PR targets the previous branch (first PR in a stack targets the collection branch).
- Use the stacked PR title format: `<type>(<scope>): [<Topic> <N>] <Subject>` (see `.cursor/rules/pr.mdc` ยง "PR Title Naming").
- 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).
- 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.

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

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

Skip this step for standalone PRs.

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".
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".

## Step 6: Update Changelog

Expand Down
18 changes: 15 additions & 3 deletions .cursor/rules/pr.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ git push -u origin HEAD
gh pr create --base main --draft --title "<type>(<scope>): <Topic>" --body "Collection PR for the <Topic> stack. Squash-merge this once all stack PRs are merged."
```

**CRITICAL: Do NOT manually update the collection branch.** Never merge, fast-forward, or push stack branch commits into the collection branch. The collection branch stays at its initial position (the empty commit on `main`) until the user merges individual stack PRs into it one by one through GitHub. If you fast-forward the collection branch to include stack commits, GitHub will auto-merge and delete all stack PR branches, destroying the entire stack.

### Creating a New Stacked PR

1. Start from the tip of the previous stack branch (or the collection branch for the first PR).
Expand All @@ -197,7 +199,7 @@ gh pr create --base main --draft --title "<type>(<scope>): <Topic>" --body "Coll

### Stack List in PR Description

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.
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.

Format:

Expand All @@ -213,6 +215,14 @@ Format:

No status column โ€” GitHub already shows that. The `---` separates the stack list from the rest of the PR description.

**Merge method reminder:** On stack PRs (not the collection branch PR), add the following line at the very end of the PR description:

```markdown
> โš ๏ธ **Merge this PR using a merge commit** (not squash). Only the collection branch is squash-merged into main.
```

This does not apply to standalone PRs or the collection branch PR.

To update the PR description, use `--body-file` to avoid shell quoting issues with special characters in the body:

```bash
Expand All @@ -237,12 +247,12 @@ Once all stack PRs are merged into the collection branch, the collection PR is *

### Syncing the Stack

When a base PR changes (e.g. after addressing review feedback on PR 1), merge the changes forward through the stack:
When a base PR changes (e.g. after addressing review feedback on PR 1), merge the changes forward through the stack **between adjacent stack PR branches only**:

```bash
# On the branch for PR 2
git checkout feat/scope-attributes-logger
git merge feat/scope-attributes
git merge feat/scope-attributes-api
git push

# On the branch for PR 3
Expand All @@ -251,4 +261,6 @@ git merge feat/scope-attributes-logger
git push
```

**Never merge into the collection branch.** Syncing only happens between stack PR branches. The collection branch is untouched until the user merges PRs through GitHub.

Prefer merge over rebase โ€” it preserves commit history, doesn't invalidate existing review comments, and avoids the need for force-pushing. Only rebase if explicitly requested.
Loading