stack-pull-requests

Plans and manages stacked pull requests with dependent branch lineage on GitHub.

Updated May 18, 2024
One-click install
npx skills add https://github.com/joshhornby/dotfiles --skill stack-pull-requests-joshhornby
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: stack-pull-requests
Source: https://github.com/joshhornby/dotfiles/tree/main/.claude/skills/stack-pull-requests
Command: npx skills add https://github.com/joshhornby/dotfiles --skill stack-pull-requests-joshhornby

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Large implementation changes are hard to review as one pull request, yet splitting them naively creates broken intermediate states, lost tests, and merge chaos. This Skill decides whether planned vertical work should ship as independent PRs or as an ordered stack, then governs building, reviewing, rebasing, and merging that stack safely. ## Core Features & Use Cases - Stack vs. independent PR decision: Applies explicit gates and two counterfactual tests (trunk and flow lineage) to choose the right delivery topology and records the decision in one sentence. - Stack design and delivery plan: Draws the lineage graph, routes verification by boundary type, checks CI topology (native GitHub stacks vs. unlinked chains, merge queues, merge_group), and produces a Delivery Shape table with a whole-stack gate checklist. - Bottom-up build, review, and merge: Builds each boundary from a known-good parent, keeps fixes in the owning lower branch with cascading rebases, and merges via gh stack merge or manual bottom-up order. - Use Case: A sign-in feature spanning a dormant migration, a repository adapter, and the credential path is too large for one review. The Skill splits it into a three-PR stack where each layer is verified, deployable or dormant, and merged in dependency order. ## Quick Start Ask the assistant to use the stack-pull-requests skill to decide whether your planned implementation slices should ship as independent PRs or a stacked sequence, and to produce the delivery plan.

Frequently Asked Questions about stack-pull-requests

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I split a large pull request into stacked PRs on GitHub?

First confirm each proposed boundary is a coherent, known-good change with its own tests, then create branches in dependency order where each upper PR targets the branch below it. Build and review bottom-up, and merge lower PRs before upper ones or use gh stack merge for native stacks.

When should I use stacked pull requests instead of independent PRs?

Use a stack only when slices have hard dependencies or deliberate flow lineage where upper work starts before lower review completes, and the review benefit outweighs rebase and CI cascade costs. If slices can target trunk and merge in any order, prefer independent PRs.

Does GitHub support stacked pull requests natively?

GitHub's native stacked-PR support and the gh stack CLI extension are limited-preview features that may not be enabled for your repository. Verify current documentation, repository access, and gh stack --help before relying on preview-specific commands.

How do I handle review feedback on a lower PR in a stack?

Make the fix on the branch that owns the change, test it there, then rebase or restack every branch above it and rerun affected checks. Never add an upstack workaround for a downstack defect.

What are the risks of stacked pull requests?

Every lower-branch change forces rebases, pushes, rechecks, and possible lost approvals on all upper branches, and CI runs multiply across the stack. Stacks also fail when intermediate states are unsafe to merge or when boundaries split tests away from the behavior they protect.