/tandem:close-phasefrom tandem
Close out a whole phase after an execution-strategist chat / execute-batch run finishes — gate on every phase story being done, compile a phase retrospective, capture follow-ups, update the board, then run a gated merge to main. Use when the user asks to close a phase, wrap up a phase, run a phase retro, or wants to wrap up and integrate a finished chat/phase whose stories are already done.
Ships in tandem. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Operate as PM hat. close-phase is the phase-level analogue of close-out-story: where
close-out-story is the per-story Definition-of-Done gate, this is its per-phase counterpart —
invoked after an execution-strategist chat / execute-batch run finishes, to wrap a whole
phase up safely and integrate it.
Opener counterpart:
start-phaseis the opener this skill closes against.start-phaseopens a phase — it cuts the phase branchphase/<phase-id>offmainper the shared phase-branch convention (recorded in40-Decisions/, ADR-0045);close-phasecloses that same phase — it merges that branch back tomain(Steps 6–7). Both skills obey the one branch convention, so the branch the opener creates is exactly the one the closer merges.
It runs in a fixed order, each step gated on the one before it:
done, or abort and list the gaps.MONITOR.md, regenerate the dashboard.main — integrate only when the merge gate passes; never force-merge.Dry-run-until-gated. Steps 3–5 only read and append artefacts; the merge step is hard-gated and never force-merges (see "Integration"). If the done-gate fails, the skill stops and reports — it never partially wraps up an incomplete phase.
Take an explicit phase / chat / epic target from the user — never infer which phase to close from ambient state. Accepted targets:
CHAT-02) from an EXECUTION-STRATEGY-*.json
sidecar — resolve to the stories[] listed under that chat / phase;EPIC-NN (or a single FEAT-NN.M) — resolve the set of stories belonging to that
epic / feature by globbing 32-Stories/EPIC-NN/....Resolve the set of stories in the target phase before doing anything else, then echo the resolved list (id + status) back to the user so the scope is explicit and reviewable. If the target is ambiguous, missing, or resolves to zero stories, stop and ask for a concrete phase / chat / epic — do not guess which stories are in scope.
done)Verify every resolved phase story is status: done. This is a hard gate:
done → proceed to the retrospective (Step 3).done → abort and list the not-done stories (each id + its current
status), so the operator knows exactly which stories still block the close. Do not compile
a retro, capture follow-ups, update the board, or merge for an incomplete phase.This mirrors close-out-story's gate-then-act discipline at the phase level: the gate is
non-negotiable, and the abort-and-list path is the load-bearing behaviour — a half-closed phase
is worse than an un-closed one.
Once the done-gate passes, compile a phase retrospective — derived from the phase's own
artefacts (its stories, their paired testplans, and the 34-Bugs/ + 40-Decisions/ filed
during the phase), never invented from memory. Three derived parts, plus one recalled part
(Step 3a):
done stories and the PASS results of their paired
testplans (the TCs that verify each story). One line per story: what it delivered.34-Bugs/), ADRs created (40-Decisions/), and the execution lanes used (the
serial / parallel lanes from the execution-strategist strategy this phase ran under).Because every part is sourced from the phase artefacts — the stories' and testplans' statuses
and results, the bugs and ADRs filed in the phase — the retro is reproducible and auditable, not a
subjective recollection. This is phase-cadence, distinct from the time-cadence retros
(weekly-monitor / monthly-retro): it closes one phase, not a calendar window.
The three parts above reconstruct the phase from the paper trail it left behind. The retro ledger holds what the run observed at the time — the friction, the kit signals, the estimate-vs-actual calls each close-out recorded as it happened. Recall it rather than re-deriving it:
node _00-Project-Management/93-Scripts/retro-report.js --phase <phase-id>
Paste what it returns, verbatim, as a ## Recalled from the retro ledger section of the phase
report. It is generated by 93-Scripts/retro-report.js, the one aggregator the phase retro,
monthly-retro and reflect all share — so none of the three re-implements the join.
AUGMENT, NEVER REPLACE. The recalled section sits alongside the three derived parts; it
does not stand in for any of them. This is easy to state and easy to violate under editing
pressure, because deleting a derived section makes the report shorter and the recalled section
looks like it covers the same ground. It does not: the derived parts say what the artefacts
record, the recalled part says what the run noticed. A phase report missing either half is
incomplete, and 93-Scripts/tests/close-phase-retro.test.js :: augments-not-replaces fails on
exactly that.
A phase with no ledger records is normal, not a warning. The output says
No retro records for this phase. and the rest of the report is unaffected. Paste that sentence
as returned — do not leave the section blank (a blank section reads as an omission, or worse as a
measured zero), and do not fall back to another phase's records. Every phase closed before
EPIC-26 has no records at all, so this is the common case for a while and must read as ordinary
output.
A malformed or unreadable ledger degrades the same way. retro-report.js skips a bad line,
counts it, and reports the count in the trailing provenance comment. Do not add a second error
path here — the tolerance already lives in the aggregator, and duplicating it is how two
components start disagreeing about what "the ledger is broken" means.
Before touching the board, sweep the phase for loose ends and capture them so nothing surfaced during the work is lost:
11-Backlog/BACKLOG-NNNN-<slug>.md, from
91-Templates/BACKLOG.template.md). This mirrors reflect / refine-backlog: a follow-up that
isn't filed is a follow-up that's lost.40-Decisions/ADR-NNNN-<slug>.md) as a backstop, so the phase's
decisions are all on record before the phase closes.Write the phase up and refresh the live board:
41-Reports/phases/PHASE-<phase-id>-<YYYY-MM-DD>.md (the home is fixed by a recorded ADR — see
"Recorded decisions" below). Both halves go in the same document: the derived parts first, the
recalled section after them, each under its own heading so a reader can tell which is which.42-Monitor/MONITOR.md: a phase summary plus a one-line revision-history
entry dated today.npm run pm:dash so 42-Monitor/DASHBOARD.html reflects the
closed phase.--merge, which Steps 6/6a/7 have not decided yet at this point. See "Retro ledger line" after
Step 7.The skill's name + phase-granularity and the phase-report home are settled once in an ADR
(40-Decisions/), not re-litigated each phase. The home choice is 41-Reports/phases/PHASE-* (the
phase report is a generated execution artefact alongside EXECUTION-STRATEGY-*), rather than
14-Retros/ (reserved for the time-cadence weekly/monthly retros).
main (gated)The integration step runs after the wrap-up — the retro, follow-up capture, and board update
(Steps 3–5) all happen first; only then does the phase merge to main.
Before evaluating the merge gate, detect whether the phase branch has already been merged
to main — the real order of events sometimes runs ahead of the board (this kit hit exactly this:
a phase branch was fast-forwarded into main in git while the board still said "merge pending").
Probe true ancestry, not a clean working tree:
git merge-base --is-ancestor phase/<phase-id> main && echo "ALREADY-MERGED" || echo "NOT-MERGED"
git merge-base --is-ancestor phase/<phase-id> main exits 0 — the phase
branch tip is reachable from main): route to the retro-only path. Steps 2–5 (done-gate,
retrospective, follow-up capture, board + MONITOR + dashboard) still run in full; only the
merge itself (Step 6 gate + Step 7 mechanism) is skipped and marked already-integrated in the
phase report and the MONITOR revision-history line (e.g. "merge: already-integrated — phase branch
is an ancestor of main"). Nothing is force-merged or re-merged; the retro + board update are the
whole job.--is-ancestor exits non-zero): the normal path — fall through to the
merge gate (below) and Step 7.Gate on true ancestry, never on a clean tree. --is-ancestor is true only when the phase
branch tip is fully reachable from main; a partially-merged branch (some commits in main,
tip not yet) returns non-zero and therefore takes the normal merge path — a partial merge must
not be mistaken for a complete one. A clean working tree alone says nothing about whether the
phase was integrated, so it is not the signal used here.
On the not-merged (normal) path, before anything reaches main, a hard merge gate must
pass — all four items:
done — re-confirm the Step-2 gate still holds for every story in the phase.npm run pm:lint green — the PM artefacts validate.PROJECT-CONTEXT.md's quality
commands (scoped to the area the phase changed).git status --porcelain is empty (no uncommitted changes).If any gate item is unmet, the skill refuses to merge and reports which item failed — it does not proceed. A blocked merge names the failing gate item so the operator knows exactly what to fix; it never merges a phase that hasn't cleared all four.
Dashboard note (ADR-0082). In a consumer repo the generated DASHBOARD.html is
gitignored by pm:install policy, so this merge can never fail unlinking it. The kit repo
itself still tracks its live dashboard (deliberate exception) — if a merge conflict lands on
it there, regenerate with npm run pm:dash rather than hand-resolving the diff.
Once the merge gate (Step 6) passes, integrate via one of two mechanisms — never a force-merge:
phase/<phase-id> — the branch start-phase cut off main per the shared convention,
ADR-0045) to main and surface the PR command / link for the operator to review and merge.main is allowed,
but only once the Step-6 gate has passed.In both cases the skill surfaces the PR / merge command or link rather than force-merging — it
never force-merges and never bypasses the gate. No gh CLI is assumed: surface a
copy-pasteable command or link; don't hard-call a host API. The PR-vs-gated-direct default and the
gate composition are recorded in an ADR (40-Decisions/) so the integration path is settled once.
10-Inbox/APPROVALS.md)A merge to main is a manual, gated approval — when the operator confirms it (the gated
direct merge, or merging the surfaced PR), append a one-line approval entry to
10-Inbox/APPROVALS.md so the sign-off survives beyond the chat transcript (audit + handover).
The same applies on the already-integrated retro-only path (Step 6a): record that the close was
confirmed even though no fresh merge ran. Append (newest at the bottom):
- <ISO 8601 timestamp> — <what was approved> — by: <who> — gated: <artefact / command>
e.g. - 2026-06-06T15:55:00+01:00 — merge phase/p1-outcome-contract to main — by: operator — gated: close-phase Step 7 (gated direct merge).
10-Inbox/ is not a linted artefact folder, so the
entry must keep the file valid plain markdown.10-Inbox/APPROVALS.md does not exist yet, create it (header + the convention
documented at the top of that file) and append the first entry. See the file for the full
convention.Append the phase-level line now — not at Step 5 — because --merge is only knowable once
Steps 6/6a/7 have settled how the phase actually integrated. Always exits 0 and never blocks the
close; skip silently if the script is absent.
node _00-Project-Management/93-Scripts/retro-capture.js --level phase --id <EPIC-NN> --phase <EPIC-NN> [--chats <n>] [--stories <n>] [--merge <pr|direct|already-integrated>] [--friction "…"] [--artefact-gap <ID>] [--kit-signal "…"]
--id takes the epic form EPIC-NN, or the feature form FEAT-NN.M when the phase is
feature-scoped — never the chat id, even when Step 1 resolved the phase target from a chat. A
phase line sharing an id with a chat line would collide on the documented join key (ADR-0109),
where story and chat ids are expected to be 1:1 against usage-log.jsonl.--phase repeats that same id, so the phase's own line is picked up by a
retro-report.js --phase <id> rollup alongside the item and chat lines it summarises.--merge records how the phase actually integrated, including the already-integrated
retro-only path from Step 6a — so the rollup can tell a real merge from a no-op close. Use the
enum values verbatim; any other word refuses the whole record.--chats — chats the strategist planned for this phase. Omit when the phase was not
strategist-planned and therefore has no chats to count; do not substitute 1.--stories — items that reached done in this phase, i.e. the Step 2 done-gate's count.close-out-story.npm run pm:dash).A closed phase means the active frame's work is done. Always reset:
node _00-Project-Management/93-Scripts/mode.js set neutral --by auto-neutral --session <session_id>
Announce it: "Phase closed — Tandem mode reset to Neutral." This is also how dual
returns to Neutral. Use the session ID from the session context.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub data-ai-xyz/tandem --plugin tandem32 skills in this plugin
/autopilotDrive the whole plan end-to-end unattended by chaining start-phase, each chat's execute-batch (subagent-per-batch), and close-phase across one or more phases — with checkpoint/resume, fail-halt guardrails, model tiering, and a usage-governor seam; use when the operator invokes /tandem:autopilot or asks to run the plan autonomously, hands-free, or unattended./close-out-storyClose out a STORY through the Definition of Done gate. Use when the testplan is fully PASS, when the user asks to close a story, to finish a story, to mark a story done, or to run the DoD check. Runs the DoD checklist, flips status to done, updates MONITOR, regenerates the dashboard./coreCore PM Operating Kit rules — closed-set status enum, frontmatter timestamps, Story-Testplan pairing, DoR/DoD gates, hat protocol, ADR-on-the-spot, bug-auto-raise. Use when working anywhere under _00-Project-Management/, when creating or modifying any artefact (epic/feature/story/testplan/bug/ADR), or when uncertain about the project's PM conventions./critiqueAdvisory artefact quality review for planning artefacts (Epic, Feature, Story, Testplan). Use when the user asks to critique, review quality, check a planning artefact, audit a story or epic, or run a pre-refinement quality pass. Detects artefact type and runs the matching check set. Never rewrites the file./curate-toolkitRank installed AI tools (Skills, Agents, Commands, Plugins) by fit for this project and write relevance overlays under _00-Project-Management/97-AI-Reference/. Reads PROJECT-CONTEXT.md (project type / tech stack) plus the installed inventory and ranks each item HIGH / MED / LOW with a one-line rationale keyed to project type. Use when the user wants to rank or audit which installed tools are relevant vs. off-stack, or invokes /tandem:curate-toolkit./documentAuthor the project's default markdown documentation set from accumulated PM knowledge. Use when the user asks to generate the project documentation set, write project documentation, or invokes /tandem:document. Reads PROJECT-CONTEXT.md, epics/features/stories, ADRs, and the codebase — then authors one markdown file per doc into the documentation/ folder. Authors markdown only; HTML rendering is a separate step.