Gate 4: Shape
Acceptance: whoever owns the product decision, with a technical reviewer for high-risk changes, recorded with record 4 --accepted-by "who" (SKILL.md, Acceptance).
Conditions
- 4.1model
Acceptance criteria are testable assertions
Each starts with a subject and a verifiable verb; no "should be intuitive"
- 4.2script
Out-of-scope list is non-empty
An empty out-of-scope list means the scope was never bounded. On the change track
SPEC.mdalso has**Touches:**(below) - 4.3script
Every flow has error and empty states
Per flow, both states enumerated
- 4.4model
Tracking plan measures the Phase 2 metric
Named events map to the success metric. Skipped on the change track, which has no phase 2 metric
- 4.5script
Accessibility floor stated
Keyboard path, contrast target, focus order
- 4.6script
Model output has an eval dataset
Existing JSON/JSONL cases (
id,input,expected, optionaljudge, booleanmust_pass) or Markdown case table (# / Input / Expected / Judge / Must pass). Full ≥20, lite ≥10 valid unique cases, threshold 0–100, named judge, at least one must-pass case. Prose counts and unsupported formats fail - 4.7script
Constraint conflicts stated, each with who decides
A
## Conflictssection exists, stating either the conflicts betweenPRODUCT.mdandTECH.mdconstraints or that none were found. Every conflict row names who decides - 4.8script
The stack was decided with a person
## Stacklists every layer the work touches as inherited, decided or not needed; every decided row names who decided it; every linked ADR exists indecisions/;## What we chosesummarizes the choices for the person accepting - 4.9script
The look was chosen from rendered versions
SPEC.md→ Design →## Visual directionshows at least 3 versions on a new product in full mode, 2 on the feature track or in lite mode, each version file exists and holds a design (a real image, or HTML with visible content; a 0-byte file fails);**Chosen:**,**Chosen by:**(a person),**Design kit:**and the tokens are filled. Wherever two or more versions are needed,**References:**lists real screens studied before rendering (files that hold a screen, ordoctags): 3 on a new product in full mode, 2 otherwise; and the versions table has anAvoidscolumn naming, per version, the generic default it steers away from. Or**Visual direction:** not applicable, {reason}when there is no interface. On the change track one version is enough, or**Visual direction:** inherited, {reason}when no screen changes its composition - 4.10script
The domain was modeled with a person
SPEC.md→ Design →## Domain model: an Entities table; a### Transitions: {entity}table naming who for every entity with a lifecycle;### Invariants; a### Datatable;**Rules decided by:**a person, quoting their words; a referenced prototype file holds visible content. Or**Domain model:** not applicable, {reason}when nothing changes state or shape - 4.11script
The impact on what exists is handled
SPEC.md→## Impact on what existshas a row for existing data, contracts (APIs, webhooks, exports, integrations), tracking events, permissions and current users, each with its handling ("nothing to do" with the reason counts). On the change track only the areas it touches, and current users. Or**Impact on what exists:** not applicable, {reason}when nothing exists yet - 4.12script
What a machine cannot check is written down
SPEC.md→## Quality bartable (Area / Criteria / Not applicable because) with a row for permissions, personal data and performance. Each row cites acceptance criteria that exist, or gives the reason it does not apply. Accessibility, end-to-end, dependencies and secrets are not here: they are automatic checks (5.10) - 4.13script
Someone from the ICP saw it before the build (product track)
SPEC.md→## Real userscites at least oneinterview,docordatatag: one session where a person from the ICP walked the problem, the concept or the clickable prototype. A plan to talk to users fails; the tag on a field line (Willingness to pay, Channel result) does not count as the session. Skipped on the spike, change and feature tracks - 4.14script
Money before the build (product track, for sale)
**Willingness to pay:**in the spec cites aninterview,docordatatag: what a person from the ICP did when shown the price (a pre-order, a letter of intent, a click on a price, a price accepted in the real-user session). An opinion about the price ("said they would pay") fails: the line names an act (pre-ordered, paid, signed, clicked, accepted).## Stackhas a payments row, inherited or decided: how the product takes money and who handles tax and invoices. Skipped whenPRODUCT.mdsays not for sale and on the other tracks - 4.15model
No scale work before PMF
Model-judged at
ideaandpre-PMF: nothing in the spec is optimization, enterprise control or infrastructure for load nobody has. The six scale defaults of 4.18 are not scale work. Skipped after PMF - 4.16script
The agent's behavior is designed (model output)
SPEC.md→## Agent behavior(agent-design): an autonomy table (Action / Autonomy / Why / Criterion) where every action isdoes,proposes,asksornever, and everyasksrow cites an acceptance criterion that exists;**Hand-off:**;**Degradation:**;**Latency budget:**with a number;### Injection surfaces(Surface / What could arrive / Mitigation / Eval case), each row with a mitigation and an eval case that is must-pass in the 4.6 dataset. Skipped without model output - 4.17script
The first day is designed (product track)
SPEC.md→ Design →## Flowshas### First day, from the first visit to the first useful outcome; the spec's**Activation:**cites an acceptance criterion that exists and names an event from the tracking plan. Skipped on the other tracks - 4.18script
The system was designed before the code
SPEC.md→## Architecture(system-design):### Components(Component / Responsibility / Owns / Talks to), each with a responsibility and what it talks to;### Contracts;### External callswhere every call has a timeout in seconds, a retry rule, its idempotency and what the user sees when it fails, or "none";### Scale defaultswith a row each for owner key on every row, paginated lists, indexed queries, idempotent writes, slow work off the request and reversible migrations, each with how or why not;**Capacity:**with numbers. Or**Architecture:** not applicable, {reason}when there is no server, no stored data and no input from other people - 4.19script
Who could break it, and the test that shows they cannot
SPEC.md→## Threat model:**Boundaries:**and a table (Boundary / Threat / Mitigation / Criterion) with a row for another user's or customer's data, untrusted input, abuse and secrets; every row has a mitigation and cites an acceptance criterion that exists, or "not applicable, {reason}". Or**Threat model:** not applicable, {reason} - 4.20script
Every flow is drawn, and every lifecycle
SPEC.md→ Design →## Flows: each### {flow}has a fencedmermaidblock that is aflowchart(orgraph) with at least two arrows, and a decision node wherever its steps table lists branches. Each entity with a lifecycle in## Domain modelhas amermaidstateDiagramunder its### Transitions: {entity}table, holding every state the table names. The diagram and the table say the same thing; the table stays the record the build reads. In lite mode a warning - 4.21script
Every message the product sends is designed
SPEC.md→ Design →## Messages: a table (Message / Trigger / Recipient / Channel / Text / Opt-out / Preview) where every row has all seven, the text is real words rather than a placeholder, and every preview file named holds content. Or**Messages:** none, {reason}when the product sends nothing outside its screens - 4.22script
The tests chosen before the build were read against their lines
Product track:
SPEC.md→**Channel result:**cites an interview, doc or data tag, and its number is not below the stop line of the phase 3**Channel test:**. Any track whose bet chosetest first:BRIEF.md→ Bet →## Cheapest testhas**Result:**with a tag, not below**Stop below:**. Under the line the gate holds: kill (record 4 --kill), change the bet, or waive 4.22 with the person's reason. Skipped when no test came before the build - 4.23script
The code is designed to last
SPEC.md→## Maintainabilityhas Structure: (the modules this work adds or changes, with their paths in backticks, againstTECH.md→ Map, or not applicable with why), Simple to change: (what is likely to change and the one place it lives) and Dependencies: (each new library or service and why, or none new). Phase 5 reviews the diff against it (5.19)
Details
Read when running gate 4. E.1, E.2 and the procedure in SKILL.md apply too. Acceptance: whoever owns the product decision, with a technical reviewer for high-risk changes, recorded with record 4 --accepted-by "who" (SKILL.md, Acceptance).
Attested (the script checks the citation and its file, not the event): 4.13, 4.14, 4.22.
Build track. 4.4 maps the tracking plan to BRIEF.md → Request → Done when: (a log line per run is a tracking plan). 4.9 needs one version (the prototype version picked at the solution stop counts), or the look inherited or not applicable with its reason for a tool with no screen. 4.20 passes or fails as in full mode: the flows and journeys are where build work is designed. The rules (4.10), the stack and the trade-offs are drafted on their recommendations and put to the person in the build stop, so one answer can be quoted in each. 4.13, 4.14 and 4.17 are skipped. The threat model holds: a tool often holds credentials and client data.
Change track. SPEC.md → **Touches:** lists what the change touches, comma-separated, each explained in parentheses: interface, copy, data, personal data, permissions, money, messages, contracts, stack, or none of these. The change always owes 4.1, 4.2 and 4.11; the rest applies by what it touches: interface 4.3, 4.5, 4.9, 4.20; data 4.10, 4.18; personal data or permissions 4.12, 4.19; money 4.7, 4.12, 4.19; messages 4.21; contracts 4.18; stack 4.8. Everything else is skipped and says why. Without **Touches:** every condition runs and 4.2 fails.
Script-decided: 4.2, 4.3, 4.5, 4.6, 4.7, 4.8, 4.9, 4.10, 4.11, 4.12, 4.13, 4.14, 4.16, 4.17, 4.18, 4.19, 4.20, 4.21, 4.22. Model-judged: 4.1, 4.4, 4.15. The emitted checked_by split is authoritative.
skills/gate-checks/references/gate-4-shape.mdView on GitHub