You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update the create-java-pr skill to infer standalone vs stacked PR mode\nfrom git branch and existing PR relationships.\n\nWhen running on main/master, default to standalone PR mode and only\nenter stack mode when explicitly requested by the user.\n\nCo-Authored-By: Claude <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: .claude/skills/create-java-pr/SKILL.md
+33-6Lines changed: 33 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,15 +9,42 @@ Prepare local changes and create a pull request for the sentry-java repo.
9
9
10
10
**Required reading:** Before proceeding, read `.cursor/rules/pr.mdc` for the full PR and stacked PR workflow details. That file is the source of truth for PR conventions, stack comment format, branch naming, and merge strategy.
11
11
12
-
## Step 0: Determine PR Type
12
+
## Step 0: Determine PR Type From Git Branch Context
13
13
14
-
Ask the user (or infer from context) whether this is:
14
+
Infer PR type from the current branch before asking the user.
15
15
16
-
-**Standalone PR** — a regular PR targeting `main`. Follow Steps 1–6 as written.
17
-
-**First PR of a new stack** — ask for a topic name (e.g. "Global Attributes"). Create a collection branch from `main`, then branch the first PR off it. The first PR targets the collection branch.
18
-
-**Next PR in an existing stack** — identify the previous stack branch and topic. This PR targets the previous stack branch.
16
+
1. Get current branch:
19
17
20
-
If the user mentions "stack", "stacked PR", or provides a topic name with a number (e.g. `[Topic 2]`), treat it as a stacked PR. See `.cursor/rules/pr.mdc` § "Stacked PRs" for full details.
18
+
```bash
19
+
git branch --show-current
20
+
```
21
+
22
+
2. Apply these rules:
23
+
24
+
-**If branch is `main` or `master`**: default to a **standalone PR**.
25
+
- Do **not** assume stack mode from `main`.
26
+
- Only use stack mode if the user explicitly asks for a stacked PR.
27
+
-**If branch is not `main`/`master`**:
28
+
- Check whether that branch already has a PR and what its base is:
- **First PR of a new stack** — create collection branch from `main`, then first PR off it.
45
+
- **Next PR in an existing stack** — target previous stack branch.
46
+
47
+
If the user explicitly says "stack", "stacked PR", or provides numbered stack titles (e.g. `[Topic 2]`), honor that even if branch heuristics are inconclusive.
0 commit comments