phase-gate
Close a phase the way a reviewer would: verify the phase's written acceptance checklist
item by item against named evidence artifacts, then update the record everywhere it lives.
A phase closes on evidence, not on recollection — and one open item means it does not close.
When to use
- A phase, milestone, or gate from the project plan (
{{phase_plan}}) appears complete and
the user wants formal closure.
When NOT to use
- Mid-phase "is this sub-task done?" — that is an execution-turn question against the
current TODO buffer.
- "Where are we / what's next" — dispatch the
session-historian agent.
- Declaring partial victory — there is no partial closure (see Rules).
The ritual (strict order — no step skipped, no step reordered)
- Load the contract. Read the phase's acceptance checklist from
{{phase_plan}} (and
its gate registry row, if the plan keeps one). This written checklist — never memory —
is what gets verified.
- Verify each item with evidence. For every checklist item, name the artifact that
proves it: fresh gate-test output, an
{{evidence_dir}}/<name>_<date>/ run directory
with its meta file, a decision entry, an executed notebook or committed figure. An item
without an artifact is OPEN — the phase does not close. Run {{gate_command}} fresh
as part of this step; a red gate blocks closure regardless of checklist state.
- Decision sweep. Every decision this phase owed (check the plan's decision queue, if
any) must exist in
{{decision_log}} with a real number — assigned at write time, never
reserved in advance.
- Build-log entry. Invoke the
build-log skill (phase-completion bar applies). The
entry links every evidence artifact from step 2.
- Layer-sync audit scoped to the phase. Drift found → fix in a separate approved turn
per that skill's rules, then re-run the audit before closing.
- Update the status surfaces. Mark the phase ✅ on the plan's status board, and rewrite
the TODO buffer to the next phase's sub-tasks — the buffer is ephemeral; completed-phase
content is deleted, not accumulated.
- Regenerate derived views (project wiki, dashboards, generated indexes), if the
project keeps any. Derived views are never hand-edited: wrong content means a
source-layer fix first, then regeneration.
- User sign-off. Present the closure summary — checklist verdicts, evidence links,
decision/build-log diffs — and get explicit approval before committing. Gate
decisions with branches (pass/drop calls, representative-point choices) are the user's
call, never auto-resolved.
Output format
## Phase closure — <phase name> / <gate id>
| Acceptance criterion | Evidence | Status |
|---|---|---|
| ... | {{evidence_dir}}/<run>/ or build-log NN or D<n> | ✅ / ❌ OPEN |
**Gate test**: <N> tests green (summary of fresh output)
**Decisions**: D<n>, ... | **Build log**: NN_topic.md | **Layer sync**: ✅/⚠
**Verdict**: CLOSED / BLOCKED — <open items>
Rules
- One OPEN item = no closure. Pre-declared off-ramps written into the plan (e.g. "if
the result window is empty, branch to X") are legitimate closures; silent scope-shrinking
is not.
- Evidence means versioned evidence. "It ran and the output looked fine" without an
{{evidence_dir}} run directory is a dark run — treat the item as OPEN
(see evidence-convention).
- Never soften a negative result to pass a gate. An infeasibility, a null effect, or a
hardness finding — rigorously recorded — is a valid closure artifact; record it
verbatim and close on it (see
negative-results-ledger).
- Commits happen after sign-off, following the project's git workflow.
- Fresh runs only. Cached test output, yesterday's logs, or "it passed last week" do
not satisfy step 2.
Configuration
{{phase_plan}} — the plan document holding phase tables + acceptance checklists.
{{gate_command}} — the named correctness gate (see correctness-gate).
{{decision_log}}, {{build_log_dir}}, {{evidence_dir}} — the record surfaces.
Provenance & maintenance
Generalized from the gate-closure ritual of a working computational-research repository
(checklist-with-evidence verification, decision sweep, build-log + sync audit coupling,
sign-off-before-commit); see the pack's examples/ directory for the worked exemplar
mapping. The eight-step order and rules 1–3 are verified practice; step 7 applies only if
the project keeps derived views (labeled optional by construction).
Re-verify in your project:
{{gate_command}} — must be green before any closure claim.
grep -n "OPEN\|⬜\|🟡" <status board> — anything still open on the board contradicts a
closure claim.
ls -t {{evidence_dir}} | head -3 — the runs cited as evidence actually exist and are
recent.
1---2name: phase-gate3description: Use when closing a project phase or milestone gate — the user believes the phase's acceptance criteria are met and wants it closed formally, with evidence verified item by item. Runs the closure ritual in strict order and blocks on any open item. Trigger phrases: "close the phase", "close the gate", "is the phase done", "phase-gate check", "milestone closure", "can we call this phase complete".4---56# phase-gate78Close a phase the way a reviewer would: verify the phase's *written* acceptance checklist9item by item against named evidence artifacts, then update the record everywhere it lives.10A phase closes on evidence, not on recollection — and one open item means it does not close.1112## When to use1314- A phase, milestone, or gate from the project plan (`{{phase_plan}}`) appears complete and15 the user wants formal closure.1617## When NOT to use1819- Mid-phase "is this sub-task done?" — that is an execution-turn question against the20 current TODO buffer.21- "Where are we / what's next" — dispatch the `session-historian` agent.22- Declaring partial victory — there is no partial closure (see Rules).2324## The ritual (strict order — no step skipped, no step reordered)25261. **Load the contract.** Read the phase's acceptance checklist from `{{phase_plan}}` (and27 its gate registry row, if the plan keeps one). *This written checklist — never memory —28 is what gets verified.*292. **Verify each item with evidence.** For every checklist item, name the artifact that30 proves it: fresh gate-test output, an `{{evidence_dir}}/<name>_<date>/` run directory31 with its meta file, a decision entry, an executed notebook or committed figure. An item32 without an artifact is **OPEN** — the phase does not close. Run `{{gate_command}}` fresh33 as part of this step; a red gate blocks closure regardless of checklist state.343. **Decision sweep.** Every decision this phase owed (check the plan's decision queue, if35 any) must exist in `{{decision_log}}` with a real number — assigned at write time, never36 reserved in advance.374. **Build-log entry.** Invoke the `build-log` skill (phase-completion bar applies). The38 entry links every evidence artifact from step 2.395. **Layer-sync audit** scoped to the phase. Drift found → fix in a separate approved turn40 per that skill's rules, then re-run the audit before closing.416. **Update the status surfaces.** Mark the phase ✅ on the plan's status board, and rewrite42 the TODO buffer to the *next* phase's sub-tasks — the buffer is ephemeral; completed-phase43 content is deleted, not accumulated.447. **Regenerate derived views** (project wiki, dashboards, generated indexes), if the45 project keeps any. Derived views are never hand-edited: wrong content means a46 source-layer fix first, then regeneration.478. **User sign-off.** Present the closure summary — checklist verdicts, evidence links,48 decision/build-log diffs — and get explicit approval **before committing**. Gate49 decisions with branches (pass/drop calls, representative-point choices) are the user's50 call, never auto-resolved.5152## Output format5354```55## Phase closure — <phase name> / <gate id>5657| Acceptance criterion | Evidence | Status |58|---|---|---|59| ... | {{evidence_dir}}/<run>/ or build-log NN or D<n> | ✅ / ❌ OPEN |6061**Gate test**: <N> tests green (summary of fresh output)62**Decisions**: D<n>, ... | **Build log**: NN_topic.md | **Layer sync**: ✅/⚠63**Verdict**: CLOSED / BLOCKED — <open items>64```6566## Rules67681. **One OPEN item = no closure.** Pre-declared off-ramps written into the plan (e.g. "if69 the result window is empty, branch to X") are legitimate closures; silent scope-shrinking70 is not.712. **Evidence means versioned evidence.** "It ran and the output looked fine" without an72 `{{evidence_dir}}` run directory is a dark run — treat the item as OPEN73 (see `evidence-convention`).743. **Never soften a negative result to pass a gate.** An infeasibility, a null effect, or a75 hardness finding — rigorously recorded — is a *valid closure artifact*; record it76 verbatim and close on it (see `negative-results-ledger`).774. **Commits happen after sign-off**, following the project's git workflow.785. **Fresh runs only.** Cached test output, yesterday's logs, or "it passed last week" do79 not satisfy step 2.8081## Configuration8283- `{{phase_plan}}` — the plan document holding phase tables + acceptance checklists.84- `{{gate_command}}` — the named correctness gate (see `correctness-gate`).85- `{{decision_log}}`, `{{build_log_dir}}`, `{{evidence_dir}}` — the record surfaces.8687## Provenance & maintenance8889Generalized from the gate-closure ritual of a working computational-research repository90(checklist-with-evidence verification, decision sweep, build-log + sync audit coupling,91sign-off-before-commit); see the pack's `examples/` directory for the worked exemplar92mapping. The eight-step order and rules 1–3 are verified practice; step 7 applies only if93the project keeps derived views (labeled optional by construction).9495Re-verify in your project:9697- `{{gate_command}}` — must be green before any closure claim.98- `grep -n "OPEN\|⬜\|🟡" <status board>` — anything still open on the board contradicts a99 closure claim.100- `ls -t {{evidence_dir}} | head -3` — the runs cited as evidence actually exist and are101 recent.