agentsclimarketplace

Rebase pr chain

Skill paultyng/skill-issue/skills/rebase-pr-chain

Personal Claude Code / Cursor agent skills, rules, and config

Install
npx -y skills add paultyng/skill-issue --skill rebase-pr-chain

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 9 stars9 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

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.

SKILL.md

2.4 KB, as published. Nobody here has run it

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,headRefName

Build 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:

  1. List conflicting files: git diff --name-only --diff-filter=U
  2. 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.
  3. After resolving: git add <file> then git rebase --continue
  4. 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-lease

3. Verify Chain Mergeability

After all PRs are rebased, verify each is mergeable:

gh pr view <number> --json mergeable,mergeStateStatus

If GitHub still reports conflicts (recomputation delay), wait a few seconds and re-check once.

4. Report

Present a summary table:

PRBranchStatus
#33feature-aMergeable
#34feature-bMergeable
#35feature-cConflict (escalated)

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.