Consolidate multiple PR branches onto a target branch using jj multi-parent rebase with intelligent AI-powered conflict resolution
/plugin marketplace add ohare93/claude-setup/plugin install ohare93-jmo-development-tools@ohare93/claude-setupThis skill inherits all available tools. When active, it can use any tool Claude has access to.
Announce at start: "I'm using the consolidate-branches skill to merge your PR branches."
This skill consolidates multiple PR branches onto a target branch using jj's multi-parent rebase with intelligent conflict resolution. The primary use case is when you have multiple feature branches with expected conflicts that need to be merged together.
Key principle: Understand the intent behind each branch's changes and intelligently combine them, not just mechanically merge.
Discover all branches that might need consolidation:
jj git fetch to sync with remoteJJ_CONFIG= jj log -r "trunk()..@ | trunk() | @.."
Output: Present a clear list of discovered branches to the user.
Let the user choose what to consolidate:
Use AskUserQuestion tool with:
Validate selections:
Show confirmation summary:
Consolidating branches [branch-a, branch-b, branch-c] onto main
Ask: "Ready to proceed with consolidation?"
Before merging, understand each branch's intent:
For each selected branch:
Read commit messages:
jj log -r <branch>
Examine changes:
jj diff -r <branch>
Categorize the changes:
Document intent for later conflict resolution
Output: Create a mental model of what each branch is trying to accomplish.
Perform the multi-parent rebase:
Create new working commit on target:
jj new <target-branch>
Multi-parent rebase to combine all branches:
jj rebase -r @ -d <branch1> -d <branch2> -d <branch3> ...
Check the result:
This is the core value of the skill.
When conflicts occur:
Identify conflicting files:
For each conflicting file:
a. Show conflict context:
b. Analyze intent:
c. Propose resolution:
d. Apply resolution:
e. Document resolution:
Present resolutions to user:
Iterate if needed:
Key Guidelines:
Verify all changes from all branches are present:
Code presence check for each branch:
jj diff -r <branch>
Generate summary report:
jj diff -r <target-branch>..@
Sanity checks:
Leave the workspace ready for user review:
Summary message:
Branch consolidation complete!
Consolidated branches: [list]
Total commits: [count]
Conflicts resolved: [count]
The changes are ready for your review.
Next steps guidance:
jj diff"jj commit -m 'your message'"Don't auto-commit: User maintains full control
The consolidation is successful if:
This skill should be used when the user asks about libraries, frameworks, API references, or needs code examples. Activates for setup questions, code generation involving libraries, or mentions of specific frameworks like React, Vue, Next.js, Prisma, Supabase, etc.
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.