Skip to content
Skills Library
Programming · Automation

stacked-prs

/stacked-prs

This skill should be used when working with stacked or dependent pull requests — resolving topology, retargeting and rebasing after a parent lands, splitting an oversized branch, and force-push safety.

Repository
claude ↗
Licence
MIT
Last repository change
22.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 22.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

This skill should be used when working with stacked or dependent pull requests — resolving topology, retargeting and rebasing after a parent lands, splitting an oversized branch, and force-push safety.

Original author description

This skill should be used when working with stacked or dependent pull requests — resolving topology, retargeting and rebasing after a parent lands, splitting an oversized branch, and force-push safety.

How it works

  1. Topology comes from base branches
  2. After a parent lands
  3. Force-push safety
  4. Deleting the parent branch
  5. Splitting a branch
  6. Landing order
  7. Recovering a merged designated branch
  8. See also
Original SKILL.md headings · 88 lines, 518 words
SKILL.md preview
---
name: stacked-prs
description: This skill should be used when working with stacked or dependent pull requests — resolving topology, retargeting and rebasing after a parent lands, splitting an oversized branch, and force-push safety.
version: 1.0.0
trigger_phrases: [stacked PR, PR stack, dependent PRs, rebase stack, retarget base, split branch]
categories: [github, pull-request, git, delivery]
author: github-orchestrator
created: 2026-08-11
updated: 2026-08-11
---

# Stacked PRs

## Topology comes from base branches

PR *B* is a child of PR *A* when `B.base.ref == A.head.ref`. Never infer the
stack from titles, labels, or description conventions — those drift, base
branches do not.

Halt and report on:

- **Cycles** — two PRs based on each other's heads.
- **Orphans** — the base branch no longer exists, usually because a parent
  merged and its branch was deleted while a grandchild still pointed at it.
- **Cross-stack dependencies** — PR X logically needs PR Y, but Y is not X's
  ancestor. This cannot be expressed in base branches; record it as a
  landing-order constraint instead.

## After a parent lands

GitHub auto-retargets **direct children only**. Deeper stacks need explicit
handling, in this order:

```
1. retarget every descendant's base → the merged PR's base
2. rebase descendant heads onto the new base
3. push --force-with-lease
4. wait for CI to re-run before touching the next level
```

Doing (2) before (1) rebases onto a branch about to be deleted. Skipping (4)
stacks a rebase on top of an unverified rebase, and when it breaks you cannot
tell which one did it.

## Force-push safety

**`--force-with-lease`, always. Never plain `--force`.**

If the lease fails, someone else pushed to that branch. Stop and report — do not
retry with `--force`. That is the operation that destroys a colleague's work.

Never force-push a protected branch under any circumstance.

## Deleting the parent branch

Check for descendants **before** deleting a merged parent's branch. Deleting it
out from under a stack orphans everything above it, and recovering requires
manually retargeting each one.

## Splitting a branch

Seams, in preference order:

| Seam | Why it works |
| --- | --- |
| Data → service → API → UI | Each layer's tests run without the layer above |
| Additive → cutover → cleanup | The risky moment is isolated to a one-line flip |
| Pure refactor → behavior change | A reviewer can verify the refactor changed nothing |
| New module → call sites | The module lands with its tests before anything depends on it |
| Dependency bump → adaptation | Separates "the upgrade broke it" from "our change broke it" |

Every slice must **independently build and pass tests**. Verify this per slice
before opening its PR — discovering it during the merge train is expensive.

## Landing order

Land the PR whose descendants need the least rebasing. Land in-place edits
**before** renames of the same file: a rename over an edited file is cheap, an
edit over a moved file is a delete/modify conflict.

## Recovering a merged designated branch

A merged PR is finished; it cannot track new work. Restart the branch from the
latest default branch, keeping the name:

```bash
git fetch origin <default>
git checkout -B <branch> origin/<default>
```

If the branch carries unmerged commits beyond the merged history, keep them —
rebase them onto the new base rather than discarding them.

## See also

- `merge-queue` — queue interaction
- `pr-craft` — size budgets and splitting rationale

Versions

RepositoryScoreLicence
This page · TheLobbi/claude100MIT
NathanColosimo/skills100MIT
paperwingio/paperwing100Apache-2.0
mathews-tom/armory100MIT
dgalarza/claude-code-workflows100MIT
bengous/claude-code-plugins100MIT
Beakpoint-Insights/roost100MIT
rafreid/keryx100MIT
qabbout/stacked-prs-skill95MIT

Database snapshot: 13.11.2026 · package version 7d2241454b16 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 95stacked-pr-rebase
    Rebase stacked PRs after parent PR is merged, preserving only your commits. Use when the user asks to "rebase my PR after parent merged", "update stacked PR", "fix PR after dependency merged", "cherry-pick my commits to new base", "sync stacked PR", or when a PR contains commits…
  • 100pg-merging-stacked-prs
    Use when landing a stack of dependent GitHub PRs (A ← B ← C, where each bases on the one below) onto the trunk, merging a PR whose base is another open PR's branch, or whenever a request mentions "stacked PRs", "PR stack", "dependent PRs", or merging several related PRs in…
  • 100dsh-merging-stacked-prs
    Use when landing a stack of dependent GitHub PRs (A ← B ← C, where each bases on the one below) onto master, merging a PR whose base is another open PR's branch, or whenever a request mentions "stacked PRs", "PR stack", "dependent PRs", or merging several related PRs in…
  • 100dsh-merging-stacked-prs
    Use when landing a stack of dependent GitHub PRs (A ← B ← C, where each bases on the one below) onto master, merging a PR whose base is another open PR's branch, or whenever a request mentions "stacked PRs", "PR stack", "dependent PRs", or merging several related PRs in…
  • 95gh-stack
    Manage stacked branches and pull requests with the gh-stack GitHub CLI extension. Use when the user wants to create, push, rebase, sync, navigate, or view stacks of dependent PRs. Triggers on tasks involving stacked diffs, dependent pull requests, branch chains, or incremental code review workflows.
  • 95gh-stack
    Manage stacked branches and pull requests with the gh-stack GitHub CLI extension. Use when the user wants to create, push, rebase, sync, navigate, or view stacks of dependent PRs. Triggers on tasks involving stacked diffs, dependent pull requests, branch chains, or incremental code review workflows.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.