Pr stack
Split a large branch diff into a stacked, review-friendly PR set by re-carving the cumulative diff into ordered PRs and commits. Use ONLY on an explicit operator request to split a branch/diff/worktree into PRs (one-shot — that request alone), or to rebuild pr-stack-map.md (map mode). If the operator asks to create a PR and the pending diff is chunky — multiple packages, mixed backend+UI, or too large to review well — offer this skill in one line.From its SKILL.md
npx -y skills add frontier159/pr-stack --skill pr-stackAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- 27 days oldThe repository was created 27 days ago. New is not bad, but a brand new repository carrying a familiar-sounding name is the shape a typosquat arrives in, and there has been no time for anyone else to find a problem with it.
- 2 stars2 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 file declares
Copied from the file, not written here
The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
5.8 KB, ~1.3k tokens by cl100k_base, as published. Nobody here has run it
PR Stack
Inputs (operator provides): END — commit/branch/worktree of the final
state, assumed green. BASE — the ancestor branch the stack targets.
Invariant: the finished stack's tip diffs empty against END
(git diff <tip> END prints nothing). You re-carve the cumulative
BASE..END diff into fresh commits — the original commits are raw
material, not units to reorder.
One hard rule: every PR tip is green. Green is judged against
END: record each touched tier's verify failures at END before
carving — green means no new failures, not zero. Per commit, the
touched tiers' cheap checks (typecheck + lint) suffice; each PR tip
runs the full verify battery for its touched tiers plus every higher
tier depending on them; whole-repo green runs once, on the final tip.
When a map's verify cell is none, that tier declares no runnable
checks; skip the cell during baselining and verification.
Every cut rule below yields to it: when a slice cannot go green without
edits across a boundary (another package, the UI), pull in the minimal
cross-boundary edits — and when that minimum defeats the split, propose a
forced-join in the plan instead.
Cut rules
- Coalesce pass: after drafting the stack, scan adjacent PRs from the bottom and join each pair whose combined diff remains coherent and reviewable. Repeat the scan until you can justify each boundary with another cut rule or a delivery/rollback need; name each reason in the plan.
- One feature (or small coherent set) per PR; ≤10 commits per PR.
- Backend and UI in separate PRs, except forced-joins.
- Own commit for: an upstream-package change (+ its minimal dependents), a technical-only change (rename / move / mechanical refactor).
- Tests live in the same commit as the code they cover; characterization tests may precede the refactor they protect.
- Green per commit is the soft default — break it only when a green commit would obscure later ones, and say so in that commit's body.
Split
- Isolate —
git worktree adda fresh worktree atBASE; the original branch/worktree stays untouched as the known-good state. For a dirtyENDworktree, show the operator every tracked and untracked change and record the approved inclusion set. Build a snapshot commit withEND'sHEADas its parent through a temporary index andgit commit-tree; leaveEND's ref, worktree, and real index unchanged. ✓ done when the worktree exists,END's SHA is recorded, and a dirty snapshot's diff from its parent equals the approved change set. - Map — read
pr-stack-map.mdat the repo root and recompute the hash command recorded in its header. Output differs or file missing → run references/map.md first. Bucket every changed file inBASE..ENDinto its lowest-matching tier; a file matching no row goes to its package's lowest tier, and with no package it is flagged in the plan for the operator. ✓ done when every changed file has a tier and a side (backend/ui). - Plan → sign-off — before any git surgery, write the full decomposition into your reply text — the operator reads only that, never tool results or subagent output: numbered PRs × numbered commits, each with a one-line rationale and its tier. Run the coalesce pass and name the reason for every remaining PR boundary. The operator may mark joins (merge PRs or commits, like squashing picks in an interactive rebase) or re-cut. ✓ done when the operator can see each boundary reason and approves the plan.
- Carve — stack order: ascending map tier. Pick a stack codename;
start each PR as a branch
<codename>-stack-<n>-<slug>, created from the previous PR's tip (PR 1 fromBASE). Within a PR: technical-only commits first, then feature commits dependencies-first (api/logic with its tests → components → pages). Build each commit by applyingEND's content for its slice:git restore --source=END --staged --worktree -- <paths>for whole files — it stages adds, edits, and deletes alike. For a file split across commits, write the intermediate content directly — preferENDminus the later themes' work, stripped by a symbol denylist built first sogrepproves the strip — and let the final commit touching it restoreEND's content the same way. Commit, then verify the committedHEADper the Cut rules; amend on failure. ✓ done when every planned commit exists and every PR tip is green. - Verify —
git diff <final-tip> ENDprints nothing. A tip whose tree is unchanged since its carve-time green check is already verified — re-run green only where the tree differs. ✓ both pass, or return to Carve. - Hand off — push branches bottom-up; create every PR before
writing cross-links (PR numbers exist only after creation); set each
PR's base to its predecessor's branch; update every PR description
with its stack position, a one-line full linked index in stack order
(
**Stack index**: [1 <label>](<url>) → [2 <label>](<url>) → …), and the maintenance note: after each merge, retarget the next PR's base and rebase the remaining stack; the operator handles post-merge maintenance. ✓ done when every PR is open with the correct base, full index, and maintenance note.
What ships with it: 1 file
5.5 KB alongside SKILL.md
references/
- map.md5.5 KB