rebase-pr-chain
Skill8 starsChanged 3 months agoMITView on GitHub
Rebase a chain of dependent pull requests sequentially, fixing conflicts along the way. Use when the user asks to rebase a PR chain, fix conflicts on multiple chained PRs, or mentions sequential/stacked PRs that need updating.
- Deletes or force-pushes
- Commits and pushes
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 7 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 20
If the user provides explicit PR numbers (e.g.
- Distinctive: line 33
Verify the working tree is clean.
- Distinctive: line 41
If the rebase completes cleanly, skip to step (d).
- Distinctive: line 45
Follow the same conflict resolution strategy as fix-pr-conflict:
- Very specific: line 52
After resolving: git add <file> then git rebase --continue
- Distinctive: line 57
Run verification per verify-when-complete.
- Distinctive: line 67
After all PRs are rebased, verify each is mergeable:
- Distinctive: line 73
If GitHub still reports conflicts (recomputation delay), wait a few seconds and re-check once.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Rebase PR Chain
Rebase a chain of dependent PRs so they are all up-to-date and mergeable.
1. Identify the Chain
Accept PR numbers from the user, or detect the chain automatically:
gh pr list --state open --json number,baseRefName,headRefNameBuild the dependency graph: each PR's baseRefName points to the branch of the PR it depends on. Sort topologically (base branch first).
If the user provides explicit PR numbers (e.g. "33, 34, 35, 36, 37"), use that order directly.
2. Rebase Each PR
For each PR in the chain (starting from the one closest to the trunk):
a. Fetch and checkout
git fetch origin <baseRefName> <headRefName>
git checkout <headRefName>Verify the working tree is clean.
b. Rebase
git rebase origin/<baseRefName>If the rebase completes cleanly, skip to step (d).
c. Resolve Conflicts
Follow the same conflict resolution strategy as fix-pr-conflict:
- List conflicting files:
git diff --name-only --diff-filter=U - For each file, understand both sides and classify:
- Mechanical: independent changes to nearby lines. Keep both.
- Semantic: incompatible changes to the same logic. Resolve if the outcome is clear.
- Ambiguous: design decisions or unclear intent. Abort the rebase (
git rebase --abort) and escalate to the user with a description of the conflict.
- After resolving:
git add <file>thengit rebase --continue - Repeat until the rebase completes or escalation is needed.
d. Verify
Run verification per verify-when-complete. Fix any issues from bad conflict resolution. If errors are unrelated, note them.
e. Force push
git push --force-with-lease3. Verify Chain Mergeability
After all PRs are rebased, verify each is mergeable:
gh pr view <number> --json mergeable,mergeStateStatusIf GitHub still reports conflicts (recomputation delay), wait a few seconds and re-check once.
4. Report
Present a summary table:
| PR | Branch | Status |
| #33 | feature-a | Mergeable |
| #34 | feature-b | Mergeable |
| #35 | feature-c | Conflict (escalated) |
In this repository38 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- active-readSkill
- active-reviewSkill
- analyze-knowledgeSkill
- audit-accomplishmentsSkill
- audit-historySkill
- bisectSkill
- ci-debug-loopSkill
- create-decision-documentSkill
- create-jira-itemSkill
- create-prSkill
- create-ruleSkill
- create-skillSkill
- discover-patternsSkill
- evaluate-dependencySkill
- fix-pr-conflictSkill
- implement-planSkill
- match-voiceSkill
- push-and-watchSkill
- review-allSkill
- review-api-compatSkill
- review-ciSkill
- review-codeSkill
- review-coverageSkill
- review-databaseSkill
- review-documentationSkill
- review-infrastructureSkill
- review-observabilitySkill
- review-performanceSkill
- review-planSkill
- review-reliabilitySkill
- review-securitySkill
- review-trajectorySkill
- set-session-contextSkill
- ship-itSkill
- simplify-proseSkill
- start-daySkill
- verify-when-completeSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

