gate
Step 7 of the pipeline (WORKFLOW.md). The number one reinforcement from the scouting.
Turns "tests are green" from a declarative wish into a proven fact. "Done" becomes
structural, not a claim.
When
After code (implementation done), before review. Also, on a smaller scale, before any sentence that says
something works, is fixed or is finished (§8).
Steps
- For every
{ passes: false } line in test-results.json, produce evidence: test
output, a recorded run of the journey, or a log; then read it.
- A guard refuses to write
passes: true until the matching evidence has been read. You cannot declare
yourself passing without observing. Where the runtime can enforce this, a pre-write hook does
(the scripts and per-repo wiring are in hooks/); where it cannot, the same
rule is kept by the evaluator in step 3 refusing any line whose evidence is not in the read log. "Exists" isn't
enough, the evidence has to have been opened.
- Run the clean-context evaluator: an agent with no write access, which didn't watch
the build, examines the diff + the evidence and returns
PASS or NEEDS_WORK + findings.
NEEDS_WORK → the findings become the prompt for the next code pass, and the loop re-runs steps 1-3
until PASS or the attempt cap. The exit condition is exactly the evaluator's verdict, so this is a
goal-based loop with a bound, not a manual relaunch.
- Gate on the artefact, not the exit code. For anything that is not a test runner (a migration, a
build, a deploy, an export, a script that calls an API),
rc=0 is not a success. Open the output: a
200 whose body carries an errors[] is a failure, a log line saying "0 rows processed" is a finding,
and a command that printed nothing proves nothing happened as much as nothing went wrong. An instrument
that reads zero because it was not attached is not a measured zero; say which of the two you have.
- Never invent a datum to fill a hole. A default is not data:
return [] on an error fabricates an
empty result, 0 for a failed measurement fabricates a measurement. Fail loudly, or return a value that
carries its own absence. A value shown only as an illustration is labelled as one, and the test is
whether the reader can see that it was not measured.
- A journey that can run is driven as an inventory of controls (
skills/qa-exploratory-testing §5); if
nothing can run, say so and verify by reading the code, never by writing PASS.
The sections below are read when their trigger is met, not all at once. A section read is a section
that has to be applied.
| § |
Covers |
Read it when |
File |
| 8 |
The law of proof: which command proves which claim, the four proof states, reuse and stop |
you are about to say that something passes, is fixed, is done, or to accept a worker's "done" |
08-claims-and-proof.md |
| 9 |
The verification loop: build, types, lint, tests, diff sweep, one report per phase |
the evaluator step is next, or the change is about to leave your hands |
09-verification-loop.md |
| 10 |
Excuses and red flags |
you notice yourself reasoning about why a check can be skipped |
10-excuses-and-red-flags.md |
| 11 |
Two independent evaluators |
the change ships without a human reading it, or its failure is expensive and hard to undo |
11-double-evaluation.md |
| 12 |
In-flight doubt: triggers, artefact and contract without the claim, four-class reconciliation, stop signals, second model |
a decision is non-trivial and about to stand, before the change exists in full |
12-in-flight-doubt.md |
Output / checkpoint
verified: every line passes: true, each backed by evidence that was read, evaluator PASS.
Guardrails
- No claim of success without fresh evidence from a command run in this turn. The law of the block, and
the reason for every step above.
- Exit code 0 and a populated file are claims, not evidence (step 5), and a fallback value is never evidence (step 6).
- The agent cannot validate itself: validation comes from the guard (evidence) + the evaluator (clean
context). No homemade layer where the runtime already offers the loop or the hook: invoke it, don't
reimplement it.
- Never lower a threshold, drop a case or skip a check to turn the verdict green (
skills/tdd).
Adaptation
The block is written for any agent runtime. In Claude Code the guard of step 2 is a PreToolUse hook, the
evaluator of step 3 is a subagent without Write/Edit, and the loop of step 4 is native /goal.
Origin
Market long-running agent patterns (default-FAIL hook + fresh-context evaluator), rewritten
our way. The iteration itself is the runtime's own goal loop, not a block.
§8 rewritten from the verification-before-completion skill of superpowers (MIT) and the verify-and-stop
skill of caveman (Apache-2.0, no text copied); §9 from the verification-loop skill of ECC (MIT); §11 from
the santa-method skill of ECC (MIT); all read 2026-10-02. §10 is predicted, not recorded (see the file).
§12 rewritten from the doubt-driven-development skill of addyosmani/agent-skills (MIT, Copyright (c) 2025 Addy Osmani, LICENSE read 2026-10-21), read 2026-10-20, no text copied. Not taken: its claim that nested subagents cannot exist (our own measurement shows they can, and return fabricated results, skills/dispatch-parallel), its fixed three-cycle cap (we ask for a stated cap), and its tool-specific command lines. Point 9 is its doubt-theatre signal; points 10 and 13 are ours. Status 🟡, never dogfooded; the second-model rules are unverified against any installed tool.
1---2name: gate3description: "Use when the code is written, before the review, mechanical lock: declaring a criterion \"passing\" without evidence is forbidden, a clean-context evaluator decides, and no claim of success is made without a command that proves it."4metadata:5 source: https://skillmd.com/skills/techmefr/gate6---78# gate910Step 7 of the pipeline (`WORKFLOW.md`). **The number one reinforcement from the scouting.**11Turns "tests are green" from a declarative wish into a **proven fact**. "Done" becomes12structural, not a claim.1314## When15After `code` (implementation done), before `review`. Also, on a smaller scale, before any sentence that says16something works, is fixed or is finished (§8).1718## Steps191. For every `{ passes: false }` line in `test-results.json`, **produce evidence**: test20 output, a recorded run of the journey, or a log; then **read** it.212. **A guard refuses to write `passes: true` until the matching evidence has been read.** You cannot declare22 yourself passing without observing. Where the runtime can enforce this, a pre-write hook does23 (the scripts and per-repo wiring are in [`hooks/`](../../hooks/README.md)); where it cannot, the same24 rule is kept by the evaluator in step 3 refusing any line whose evidence is not in the read log. "Exists" isn't25 enough, the evidence has to have been opened.263. Run the **clean-context evaluator**: an agent **with no write access**, which didn't watch27 the build, examines the diff + the evidence and returns `PASS` or `NEEDS_WORK` + findings.284. `NEEDS_WORK` → the findings become the prompt for the next `code` pass, and the loop re-runs steps 1-329 until `PASS` or the attempt cap. The exit condition is exactly the evaluator's verdict, so this is a30 goal-based loop with a bound, not a manual relaunch.315. **Gate on the artefact, not the exit code.** For anything that is not a test runner (a migration, a32 build, a deploy, an export, a script that calls an API), `rc=0` is not a success. Open the output: a33 `200` whose body carries an `errors[]` is a failure, a log line saying "0 rows processed" is a finding,34 and a command that printed nothing proves nothing happened as much as nothing went wrong. An instrument35 that reads zero because it was not attached is not a measured zero; say which of the two you have.366. **Never invent a datum to fill a hole.** A default is not data: `return []` on an error fabricates an37 empty result, `0` for a failed measurement fabricates a measurement. Fail loudly, or return a value that38 carries its own absence. A value shown only as an illustration is labelled as one, and the test is39 whether the reader can see that it was not measured.407. A journey that can run is driven as an inventory of controls (`skills/qa-exploratory-testing` §5); if41 nothing can run, say so and verify by reading the code, never by writing PASS.4243The sections below are read **when their trigger is met**, not all at once. A section read is a section44that has to be applied.4546| § | Covers | Read it when | File |47|---|---|---|---|48| 8 | The law of proof: which command proves which claim, the four proof states, reuse and stop | you are about to say that something passes, is fixed, is done, or to accept a worker's "done" | [`08-claims-and-proof.md`](./references/08-claims-and-proof.md) |49| 9 | The verification loop: build, types, lint, tests, diff sweep, one report per phase | the evaluator step is next, or the change is about to leave your hands | [`09-verification-loop.md`](./references/09-verification-loop.md) |50| 10 | Excuses and red flags | you notice yourself reasoning about why a check can be skipped | [`10-excuses-and-red-flags.md`](./references/10-excuses-and-red-flags.md) |51| 11 | Two independent evaluators | the change ships without a human reading it, or its failure is expensive and hard to undo | [`11-double-evaluation.md`](./references/11-double-evaluation.md) |52| 12 | In-flight doubt: triggers, artefact and contract without the claim, four-class reconciliation, stop signals, second model | a decision is non-trivial and about to stand, before the change exists in full | [`12-in-flight-doubt.md`](./references/12-in-flight-doubt.md) |5354## Output / checkpoint55`verified`: every line `passes: true`, each backed by evidence that was read, evaluator `PASS`.5657## Guardrails58- **No claim of success without fresh evidence from a command run in this turn.** The law of the block, and59 the reason for every step above.60- **Exit code 0 and a populated file are claims, not evidence** (step 5), and a fallback value is never evidence (step 6).61- The agent **cannot validate itself**: validation comes from the guard (evidence) + the evaluator (clean62 context). No homemade layer where the runtime already offers the loop or the hook: invoke it, don't63 reimplement it.64- Never lower a threshold, drop a case or skip a check to turn the verdict green (`skills/tdd`).6566## Adaptation67The block is written for any agent runtime. In Claude Code the guard of step 2 is a `PreToolUse` hook, the68evaluator of step 3 is a subagent without `Write`/`Edit`, and the loop of step 4 is native `/goal`.6970## Origin71Market long-running agent patterns (default-FAIL hook + fresh-context evaluator), rewritten72our way. The iteration itself is the runtime's own goal loop, not a block.7374§8 rewritten from the `verification-before-completion` skill of `superpowers` (MIT) and the `verify-and-stop`75skill of `caveman` (Apache-2.0, no text copied); §9 from the `verification-loop` skill of `ECC` (MIT); §11 from76the `santa-method` skill of `ECC` (MIT); all read 2026-10-02. §10 is predicted, not recorded (see the file).7778§12 rewritten from the doubt-driven-development skill of addyosmani/agent-skills (MIT, Copyright (c) 2025 Addy Osmani, `LICENSE` read 2026-10-21), read 2026-10-20, no text copied. Not taken: its claim that nested subagents cannot exist (our own measurement shows they can, and return fabricated results, `skills/dispatch-parallel`), its fixed three-cycle cap (we ask for a stated cap), and its tool-specific command lines. Point 9 is its doubt-theatre signal; points 10 and 13 are ours. Status 🟡, never dogfooded; the second-model rules are unverified against any installed tool.