Consolidate multiple PR branches onto a target branch using jj multi-parent rebase with intelligent AI-powered conflict resolution
npx claudepluginhub ohare93/claude-setup --plugin jmo-development-toolsThis skill uses the workspace's default tool permissions.
**Announce at start**: "I'm using the consolidate-branches skill to merge your PR branches."
Creates isolated Git worktrees for feature branches with prioritized directory selection, gitignore safety checks, auto project setup for Node/Python/Rust/Go, and baseline verification.
Executes implementation plans in current session by dispatching fresh subagents per independent task, with two-stage reviews: spec compliance then code quality.
Dispatches parallel agents to independently tackle 2+ tasks like separate test failures or subsystems without shared state or dependencies.
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: