soa-closeout-stacklisted
Install: claude install-skill cesarnml/codogotchi
# Closeout Stack
Merge a completed stacked delivery phase onto the configured `closeoutBranch`
after the developer approves all PRs. Before running any command below, read
`closeoutBranch` from `orchestrator.config.json` in the repo root (or
`.son-of-anton/orchestrator.config.json`'s default if the consumer repo has no
override — both default to `main` when the key is absent) and set it as
`$CLOSEOUT_BRANCH` for the rest of this session. Every command below uses that
variable — substitute the actual configured value, which is `main` unless the
repo's config says otherwise.
## Primary Path
```bash
git checkout "$CLOSEOUT_BRANCH"
bun run closeout-stack --plan <plan-path>
```
Processes each ticket in stack order via `git merge --squash` (3-way, robust against parent patches). For each ticket: fetch + reset local `$CLOSEOUT_BRANCH` to `origin/$CLOSEOUT_BRANCH`, squash-merge the ticket branch, commit with PR title, push to `origin/$CLOSEOUT_BRANCH`, close PR, delete remote branch. Produces one squash commit per ticket on `$CLOSEOUT_BRANCH` when squash succeeds.
If `merge --squash` hits conflicts (common after earlier tickets were squash-merged so SHAs diverge from the stacked branches), `closeout-stack` resets to `origin/$CLOSEOUT_BRANCH`, reads the PR's commits via `gh pr view --json commits`, and lands them in order with `git cherry-pick` (merge commits use `-m 1`). When a picked commit is already fully present on `$CLOSEOUT_BRANCH` (empty patch), it runs `git cherry-pick -