stack-merge
Installation
SKILL.md
Stack Merge
Land an entire Graphite downstack into main in one admin-bypass fast-forward push, then close every in-scope PR explicitly. No per-PR CI gates, no merge commits on main, no gh pr merge per PR. PRs end up in Closed state (not MERGED) unless their base was already main, but their commits are in main's history.
This skill replaces Graphite's merge queue — use when you want the outcome Graphite's queue produces (linear history, all PRs merged) but without waiting for the queue. Requires admin bypass on main branch protection.
When NOT to use
- User wants normal single-PR merge → use
gh pr merge. - User isn't a repo admin → push will reject (tell them to use Graphite's queue).
- Stack tip has failing CI and user cares → queue would refuse; pause here too.
Preconditions (verify at start; bail early)
- Admin/bypass on main:
gh api repos/rivet-dev/rivet/branches/main/protection— check user is inbypass_pull_request_allowances.users[]or has repo admin. If not, stop. - Graphite initialized:
gt lssucceeds. - Clean working tree:
git status --shortempty. In-flight rebase/merge state must be resolved first. - Worktree sanity:
git worktree list— prune anyprunableentries withgit worktree prune. Stale worktrees break rebases with "already checked out at" errors. See references/gotchas.md.