rebase-pr-chain

rebase-pr-chain is a skill for Claude Code, Codex from paultyng/skill-issue. It costs 54 tokens per session (639 once invoked), scanned A, original, MIT.

A workflow for updating several dependent pull requests in order by replaying each branch on top of the branch it depends on. This arrangement is often called a stacked or chained pull-request series.

In plain words
What is it for?
Use it to rebase a chain of pull requests, identify their branch relationships, update each one sequentially, and resolve conflicts between their changes.
Why use it?
It keeps related pull requests current and helps handle conflicts caused by changes in earlier branches. It also checks the dependency order so branches are updated from the base upward.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to rebase a chain of pull requests, identify their branch relationships, update each one sequentially, and resolve conflicts between their changes.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/paultyng/skill-issue/rebase-pr-chain
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add paultyng/skill-issue --skill rebase-pr-chain
Clone the repo
git clone --depth 1 https://github.com/paultyng/skill-issue

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for rebase-pr-chain

README.md
[![agentmods](https://agentmods.dev/badge/skills/paultyng/skill-issue/rebase-pr-chain.svg)](https://agentmods.dev/skills/paultyng/skill-issue/rebase-pr-chain)
Your own site
<a href="https://agentmods.dev/skills/paultyng/skill-issue/rebase-pr-chain"><img src="https://agentmods.dev/badge/skills/paultyng/skill-issue/rebase-pr-chain.svg" alt="Measured on agentmods" height="20"></a>
Per session 54 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 639 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00054 $0.00639
Opus 5 $0.00027 $0.00319
Sonnet 5 $0.00011 $0.00128
Haiku 4.5 $0.00005 $0.00064

Measured 8d ago against content hash d7d2edcf083c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

rebase-pr-chain scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/rebase-pr-chain/SKILL.md · 84 lines

How it starts

The opening of the file, as written. The whole thing — 84 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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.

Read the full file on GitHub · 84 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 84 lines · 54 tokens per session scan A d7d2edcf083c

Subscribe to this mod's changes

rebase-pr-chain is a skill published in the GitHub repository paultyng/skill-issue (9 stars, last pushed 28d ago), licensed MIT. It adds 54 tokens to every session and 639 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.