fix(skill): Detect stacked PR context from branch#5223
Open
fix(skill): Detect stacked PR context from branch#5223
Conversation
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>
Contributor
Semver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. This PR will not appear in the changelog. 🤖 This preview updates automatically when you update the PR. |
Sentry Build Distribution
|
Check for downstream PRs even when the current branch already has a PR targeting main/master. This prevents collection branches in a stacked PR flow from being misclassified as standalone PR context. Co-Authored-By: Claude <noreply@anthropic.com>
When downstream PRs are found for a branch, classify the result as an existing stack flow instead of an undefined "stack base context". Clarify that the next PR in an existing stack can target either the previous stack PR branch or the collection branch, so all detection outcomes map to actionable PR types. Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
…nches The decision tree in create-java-pr Step 0 had a gap: when a non-main branch has no existing PR and no downstream PRs target it, no outcome was specified. This is the most common case (fresh feature branch). Add explicit fallback to standalone PR context, matching the behavior of the parallel branch where a PR exists with base main and no downstream PRs. Co-Authored-By: Claude <noreply@anthropic.com>
lbloder
approved these changes
Mar 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

📜 Description
Improve the local
create-java-prskill so it determines whether to run in standalone or stacked PR mode from git context.The skill now checks the current branch and existing PR relationships to infer stack context, instead of relying on manual prompting.
💡 Motivation and Context
When the workflow starts on
main, it should default to a normal PR againstmainand not accidentally assume stacked PR behavior.This change makes that default explicit and still allows stacked mode when the user asks for it.
💚 How did you test it?
./gradlew spotlessApply apiDumpsuccessfully (using JDK 17 locally)📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
#skip-changelog