| name | stack-cli |
|---|---|
| description | Use for the `stack` GitHub CLI for stacked PRs and landing orchestration. Covers graph setup, stacked-PR workflows, landing branches, verification, superseded PR handling, closeout, and queue handoff for the real merge target. |
Use this skill to operate stack safely: make the graph explicit, then choose how it lands.
There are two supported paths:
- standard stacked PR flow: each tracked branch lands as its own PR
- landing workflow: one composed landing branch and landing PR become the real merge target
If you are starting from existing PRs, first make the graph explicit, then continue with one of those two paths.
- Prefer
stack statusfirst when repo state is unclear. - Treat stack metadata as the source of truth; use
syncto refresh GitHub-backed state. - Preview before mutating when possible.
- Stop on ambiguity. Do not guess parentage, merge bases, repair actions, or the real merge target when the CLI surfaces a manual-review case.
- Prefer preview over
--yesunless the user wants unattended execution. - Use ordinary
gitandgharoundstack; do not invent a parallel hosted workflow.
- Setup
init: initialize repo metadatacreate <branch>: create a tracked branchtrack <branch> --parent <parent>: adopt an existing local branchadopt pr <number> --parent <parent>: adopt an existing PR head- Health and repair
status: graph, PR, verification, and landing healthsync [--apply]: refresh PR state and apply clean repairsrestack [branch] | --all: rebase tracked branches onto parentscontinue: resume an interrupted restackabort: abandon an interrupted restackmove <branch> --parent <parent>: change a branch parent- Standard PR flow
submit [branch] | --all: push tracked branches and create or update PRs- Landing workflow
compose <name>: create a landing branchverify add <branch>: attach verification evidenceverify list <branch>: inspect verification recordssupersede --landing <branch> --prs ...: mark original PRs as supersededcloseout <landing-branch> [--apply]: plan or apply post-merge closure work- Queue handoff
queue <branch>: hand off the real merge target
Typical flow:
stack init --trunk main --remote originstack create feature/basestack create feature/childstack statusstack restackwhen a parent movedstack submit --allstack queue feature/basestack syncafter merges
Typical flow:
stack init --trunk main --remote originstack adopt pr 353 --parent mainstack adopt pr 354 --parent pr/353stack statusstack syncstack move,stack restack, andstack submituntil the graph matches intent
Do not ask stack to infer the dependency graph. The operator still chooses the parent chain.
Once the graph is explicit, continue with Standard stacked-PR workflow or Landing workflow.
Typical flow:
- make the graph explicit with the setup flow above
stack compose discovery-core --from pr/353 --to pr/364 --ticket LNHACK-66 --ticket LNHACK-74 --open-prstack verify add stack/discovery-core --type sim --run-id run-123 --passedstack supersede --landing stack/discovery-core --prs 353,354,363,364 --close-after-mergestack queue stack/discovery-corestack closeout stack/discovery-corestack closeout stack/discovery-core --applyafter the landing PR merges
Important operator rules:
- use explicit
--ticketflags during compose; closeout no longer guesses tickets from branch names - keep verification on the landing branch, not only in chat or in a PR body
- Queue only the real merge target: the bottom tracked PR in standard flow, or the landing PR in landing workflow.
- Prefer
submitbeforequeue. - If queue reports stale remote or stale PR head state, rerun
submit. - If verification exists, queue requires the latest verification to pass and still match the current head.
- inspect with
stack status - refresh with
stack sync - apply only clean repairs if they are obvious and supported
- restack, resubmit, or recompose only after the graph is consistent again
If a restack stops mid-flight:
- use
stack continuefrom the same worktree after resolving conflicts - use
stack abortif you need to clear the operation journal and recover instead
queueis for a healthy trunk-bound PR or recorded landing PR, not for any arbitrary branch in the graph- when a landing batch exists, original source PRs are traceability-only; if queue redirects you to the landing PR, trust that
- if a PR is closed, merged, draft, or on the wrong base, repair that before queue handoff
On machines with multiple gh accounts, pin GH_TOKEN; do not rely on the active account:
gh auth switch -u roodboi
TOKEN="$(gh auth token)"
GH_TOKEN="$TOKEN" scripts/sandbox/seed-fixtures.sh- Do not bypass stack metadata with direct remote mutations unless the user explicitly wants a manual repair step.
- Do not override the CLI’s manual-review cases with guesses.
- Do not treat
stack tuias an edit surface; it is read-only.