Checks whether a BuilderOS phase may advance: conditions the script decides, judgments left to the model, overrides with reasons, a person's acceptance. Use when a phase is about to advance, a gate needs checking, or readiness is unclear.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Gate Checks?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/mariomile-gate-checks)
---
name: gate-checks
description: "Checks whether a BuilderOS phase may advance: conditions the script decides, judgments left to the model, overrides with reasons, a person's acceptance. Use when a phase is about to advance, a gate needs checking, or readiness is unclear."
---
# Gate Checks
Every lifecycle phase ends at a gate that checks artifact structure, evidence and decisions. Pass every required condition, advance. Fail one, stop and say which: a gate holds whatever the argument. This skill inspects an active lifecycle initiative; a standalone review returns findings and leaves lifecycle state as it is.
Read `evidence-ledger` when tag counting or source provenance needs clarifying, and `pressure-testing` for a material open branch that evidence and delegated judgment leave unsettled.
## The Conditions
Read `current_phase` from `state.json`, then read only the conditions file for that gate: [0 Frame](references/gate-0-frame.md), [1 Discover](references/gate-1-discover.md), [2 Define](references/gate-2-define.md), [3 Ideate](references/gate-3-ideate.md), [4 Shape](references/gate-4-shape.md), [5 Build](references/gate-5-build.md), [6 Ship](references/gate-6-ship.md), [7 Learn](references/gate-7-learn.md), [C Coverage](references/coverage-check.md) on the feature track, [M Mandate](references/mandate-check.md) on the change track, or [N Need](references/need-check.md) on the build track. Each holds the condition table (id, condition, check), which conditions the script decides, and the phase's recording flags. Read [lite mode](references/lite-mode.md) when `state.json` sets `mode: "lite"`.
E.1 and E.2 run on every gate, including the coverage check (against `PRODUCT.md` and the request) and the mandate check, E.3 to E.5 on every initiative gate.
| # | Condition | Check |
|---|-----------|-------|
| E.1 | Every source tag points at something | Each `interview`, `doc` and `data` tag in the artifact has its file in `evidence/` per the schema, Evidence Files; each `code` tag names a file that exists |
| E.2 | No provisional work is left | No `**Provisional:**` marker outside code fences, in the artifact or (phase 4) `SPEC.md` → Design: drafted-ahead work is kept, marker removed, when the person's answer confirmed it, deleted otherwise (`pressure-testing`, Working Ahead) |
| E.3 | Each document stays readable | Each part the gate reads is within its word cap (schema, Documents) |
| E.4 | The thread is written | `BRIEF.md` or `CHANGE.md` opens with `**Building:**` and `**Why:**`; one file per phase warns |
| E.5 | The intent is written | Under the thread: `**For:**`, `**Done when:**`, `**Not:**` (`pressure-testing`, intent round); fails at an initiative's first gate, warns later |
## Who Checks
A gate checked by the model that wrote the artifact is a gate checked on trust, so `state.json` records who decided each condition in `gate.checked_by`.
- **Script-decided** conditions are structure and arithmetic: a word list, a tag count, an enum, a date comparison, a table with no empty cell. Where commands run, `node scripts/bos.mjs gate {N}` decides them and prints one line per condition. Relay that result as decided; the model judges the `judge` lines alone.
- **Model-judged** conditions need meaning: whether an assumption is falsifiable, whether two options are mechanically distinct. The script lists them as `judge`, with whatever structural precheck it could run, and the model decides them.
Where commands cannot run, the model checks every condition and records all of them under `model`: same conditions, weaker provenance, and the record says so. E.1 and E.2 are script-decided; each conditions file states its own split, and the emitted `checked_by` split is authoritative.
- **Attested** conditions rest on a fact outside the repository: a session with a user, a payment, a person who tried the build. The script checks the citation and its file, never the event. Each conditions file lists them; say so when relaying them.
**Recording the result.** Where commands run, the result reaches `state.json` only through `node scripts/bos.mjs record {N} --judged "{id}=pass|fail,..."`: the script re-runs its own conditions, takes the model's verdict on the `judge` ones, and writes the phase status, `checked_at`, `checked_by`, the failed conditions and the history event, then advances, closes or holds the phase and regenerates the roadmap. A gate result written into `state.json` by hand where the script can run is a claim, not a record, exactly like a completion marker. Phases 1, 6 and 7 take phase-specific flags (verdict, review date, re-entry), stated in their conditions files. The record also stores the script's version and the skipped conditions, so a later release can tell "not applicable then" from "not there yet". Verdict/enum contradictions cannot be overridden.
## Debt After a Release
Each record carries the BuilderOS version that wrote it and the conditions it skipped. A release that adds conditions leaves earlier passed gates passed; the briefing and `bos.mjs doctor` list the conditions in force now that the record did not check and the artifact does not meet. That is debt: meet it when the work next touches that phase, or name it at phase 7. The phase stays passed.
## Acceptance
A gate says an artifact is complete, not that a person has read it and agrees. BuilderOS records both, separately.
Phases 0, 4 and 6 each need a person's acceptance, and the build plan inside phase 5 needs its owner's `**Accepted:**` line before any code. Who accepts and where it is recorded is in that gate's conditions file.
**Rules.** Acceptance comes from the person's own words: ask, then record what they said, quoted. A standing instruction counts when it named the scope ("proceed through the build without stopping"), quoted with its date. The script refuses to pass phases 0, 4 and 6 without `--accepted-by`; a failed gate records no acceptance.
## Decisions
The choices a phase turns on belong to a person, and each gate checks a `**Chosen by:**` naming the person who chose, from their answer: the assumption phase 1 tests (0.5), what a discovery verdict means for the work (1.6), the opportunity and its target (2.8), the bet (3.6), the look (4.9), the rollout (6.13), and keep, iterate or kill (7.7). The agent does the analysis and recommends in a `pressure-testing` round; "go with the recommendations" is a valid answer and is quoted as such. A standing instruction that named the scope counts, quoted with its date, exactly as for acceptance.
**The person's words.** Where the host runs the BuilderOS message hook, each message the person writes is appended to `.builderos/person-log.jsonl`, which only the hook writes. Every person field (Chosen by, Accepted, Tried by, Rules decided by, Authorized by, `--accepted-by`, a kill, jump or override reason) quotes their words in quotation marks; a quote they never wrote fails. Without the log the field passes, marked unverified.
## Refusal Protocol
When a condition fails, the agent produces exactly this and holds the phase:
```markdown
## GATE {N} FAILED
**Failed condition:** {the condition, verbatim}
**Found:** {what the artifact actually contains}
**Satisfied by:** {what would make it pass}
**Cheapest path:** {the least expensive way to get there, with a time estimate}
Remaining conditions: {passed}/{total}
```
A phase advances on a pass or a logged override, nothing in between. When a test came back under its stop line, the honest outcome may be to stop: offer the kill next to the override.
## Override and Kill
An override waives conditions by name, each with the person's reason: `record {N} --judged ... --override "reason"` waives a single failure; several need `--waive 4.22,5.8`, and conditions left unnamed still fail. The record keeps `overridden`, the reason, the failed and waived conditions; the briefing shows them until a later cycle meets them, and phase 7 reads them. The entry checks cannot be overridden.
`record {N} --kill "reason"` ends the initiative at phases 0 to 6, with the person's words; phase 7 kills through its verdict. Moves the process asks for have their commands: `resume {slug}`, `reframe --reason` (a new cycle from phase 0), `jump {N} --reason` (back reopens phases; forward records the jumped phases as overridden).
## Entry Checks and Spike Stop
Each runs once, at initialization, on the request, in place of the early gates:
- **Coverage** (`feature`), gates 0 and 1: [coverage-check.md](references/coverage-check.md). A failure makes a `product`.
- **Mandate** (`change`), gates 0 to 3: [mandate-check.md](references/mandate-check.md). A failure makes a `feature`.
- **Need** (`build`), gates 0 to 2: [need-check.md](references/need-check.md). A failure makes a `product`.
A `spike` ends at gate 1, `answered` and `closed`: [gate-1-discover.md](references/gate-1-discover.md), Spike Stop.
## Watch for
| Do | Instead of |
|---|---|
| Check each condition against the text | Passing because the artifact "feels complete" |
| Relay the script's verdict; judge only the `judge` lines | Re-judging what the script decided, the author grading its own work |
| Write `evidence/P3.md`, or rewrite the claim as an assumption | `[interview:P3]` with nothing behind it |
| Ask, and record only what the person said | `--accepted-by` filled in because the gate passed |
## Capability Requirements
| Capability | Use | Floor |
|---|---|---|
| `files.read` | Inspect active state, artifacts and raw evidence | Ask for the missing artifact; no gate result without inspection |
| `files.write` | Record authorized lifecycle state | Return the gate result and concrete persistence gap |
| `shell.exec` | Run the bundled gate script and explicitly authorized checks | Model checks with all conditions marked model-judged; execution evidence remains unverified |
## Procedure
1. **Read the gate.** Resolve the active initiative and phase; read its artifact, its gate's conditions file and the raw evidence the conditions touch. For a standalone review, return findings and stop here. Done when you can list every condition of this gate.
2. **Run the script's checks** where commands run (`node scripts/bos.mjs gate {N}`). Gate inspection runs the gate's own checks; a project check runs only when the person authorized that command (capturing a run: [gate 5](references/gate-5-build.md)), with failures and raw logs kept as they came. Done when every script-decided condition has its line.
3. **Judge the `judge` conditions** against the evidence, and surface unavailable evidence, failed runs and incomplete observation windows. Done when every `judge` line has pass or fail with its reason.
4. **Close what can be closed.** Fix authorized local gaps and repeat the affected checks. A real failure gets the refusal protocol; an explicit override keeps the failed conditions and its reason. Done when every condition passes, or the refusal or override is written.
5. **Record through the script** with consistent phase-specific verdicts and dates and, at phases 0, 4 and 6, the person who accepted. Done when `record` succeeded and `state.json` shows the result.
## Output Contract
`## GATE {N} PASSED` only after recording succeeds; `## GATE {N} FAILED` in the refusal format with the failed conditions; `## REVIEW DEFERRED` for a deferred phase 7, which holds the phase.