一键导入
consolidate-branches
Consolidate multiple PR branches onto a target branch using jj multi-parent rebase with intelligent AI-powered conflict resolution
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Consolidate multiple PR branches onto a target branch using jj multi-parent rebase with intelligent AI-powered conflict resolution
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when finishing a task that changed code, config, scripts, prompts, or documentation. Runs the final build/test/lint/review loop, fixes reasonable issues, and reports remaining findings or skipped checks before the final answer.
Use when managing project dependencies with Devbox. Devbox is the preferred dependency manager for new projects - covers package installation, environment variables, and shell configuration.
Use when checking Docker image versions or working with container registries. Skopeo is the required tool for registry queries - never parse Docker Hub web pages.
Use when working with Elm projects. Requires running elm-test and elm-review for quality assurance.
Use when working with version control. jj (Jujutsu) is the preferred VCS - never use git commands directly when jj can do the job. Covers mental model, workflows, and Nix integration.
Use when working with NixOS configurations, Home Manager setups, Nix flakes, services, or troubleshooting Nix builds. Covers creating new configurations, modifying existing ones, adding packages, setting up services, writing modules, and debugging build failures.
| name | consolidate-branches |
| description | Consolidate multiple PR branches onto a target branch using jj multi-parent rebase with intelligent AI-powered conflict resolution |
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: