Verify with gates
Before I look at a ticket, machines look at it. This is the checks’ seat of the pull request: everything a machine can check, a machine checks.
The gate ladder
Section titled “The gate ladder”Anthropic’s best practices describe four ways to make a check gate the agent’s stop, in their order:
- “In one prompt: ask Claude to run the check and iterate in the same message.” (source: Anthropic: Best practices for Claude Code)
- “Across a session: set the check as a /goal condition. A separate evaluator re-checks it after every turn” (source: Anthropic: Best practices for Claude Code), so that “completion is decided by a fresh model rather than the one doing the work” (source: Anthropic: /goal).
- “As a deterministic gate: a Stop hook runs your check as a script and blocks the turn from ending until it passes.” (source: Anthropic: Best practices for Claude Code)
- “By a second opinion: a verification subagent or a dynamic workflow that checks its own findings has a fresh model try to refute the result, so the agent doing the work isn’t the one grading it.” (source: Anthropic: Best practices for Claude Code)
“Each step trades setup for attention.” (source: Anthropic: Best practices for Claude Code) This site’s checks sit on three rungs and outside the session. On the first, the brief every ticket starts from, which tells the agent to run the gates and give their numbers. On the third, the Stop hook of The minimal setup, the type check and the unit tests in a script whose exit code 2 blocks the action and sends the script’s error output to Claude (source: Anthropic: Hooks guide). On the fourth, mattpocock-skills:code-review, two sub-agents in their own contexts, described below. The gates, the checks that block a change until they pass, are the hook and what runs outside the session: a git hook checks every commit against the confidentiality list, and CI runs the type check, the unit tests, the build, the browser tests, Lighthouse and the confidentiality check on every pull request. Among the browser tests, axe looks for WCAG 2.2 AA violations on every page in both themes, and the chrome’s tests hold the standard’s numbers: targets of “at least 24 by 24 CSS pixels” (source: W3C: Understanding Target Size (Minimum)), a switch track at “a contrast ratio of at least 3:1” (source: W3C: Understanding Non-text Contrast), a focused control “not entirely hidden” (source: W3C: Understanding Focus Not Obscured (Minimum)) under the header.
The two code reviews
Section titled “The two code reviews”Two commands share a name and do different jobs; I name them in full. Claude Code’s own /code-review “looks for correctness bugs” (source: Anthropic: Code review) in the branch’s changes and “runs as a background subagent with its own context window” (source: Anthropic: Code review); you “pass an effort level to trade coverage for confidence” (source: Anthropic: Code review). The plugin’s mattpocock-skills:code-review reviews the diff from a fixed point on two axes, Standards and Spec, and never blends them, because “a blended verdict lets the passing axis hide the failing one” (source: Matt Pocock: code-review). It does not review uncommitted work (source: Matt Pocock: code-review), so the commit comes first.
Findings are not verdicts. “A reviewer prompted to find gaps will usually report some, even when the work is sound, because that is what it was asked to do” (source: Anthropic: Best practices for Claude Code), and the plugin’s own page warns: “do not run it in a loop until it comes back clean, because it never will” (source: Matt Pocock: code-review). I act on the findings with “a cited rule behind them” (source: Matt Pocock: code-review) or a reproducible bug, and stop.
The design detector and the audit
Section titled “The design detector and the audit”For UI files, Impeccable adds checks that advise: its detector, which can “scan for known design problems without starting an AI conversation” (source: Impeccable: Detector), and its hooks, which run it as “focused feedback after edits, followed by a broader check when the agent finishes its turn” (source: Impeccable: Hooks). Neither the Stop hook nor CI runs the detector, so it is a check, not a gate. I ask for zero new detector findings on the changed files.
The design passes then scale with the size: a retouch gets polish; a new surface gets critique, then polish, then audit. “A critique reviews the design; it does not automatically apply every proposed fix” (source: Impeccable: Improve a design), and “before shipping, use audit for accessibility, performance, and responsive issues” (source: Impeccable: Improve a design). And whatever comes back clean: “a clean report is useful evidence; it does not replace using the result” (source: Impeccable: How it works).
The screenshot budget
Section titled “The screenshot budget”A 1920 by 1080 screenshot costs 2691 visual tokens (source: Anthropic: Vision) on current models, because an image is billed at “⌈width / 28⌉ × ⌈height / 28⌉ visual tokens” (source: Anthropic: Vision). So one verification pass gets at most two rounds of at most six screenshots, cropped to what changed: desktop and mobile, dark and light, read for defects, not opinions.
A subagent’s output is a hypothesis
Section titled “A subagent’s output is a hypothesis”Every rung above the first hands the check to another model, and what comes back is not evidence yet: “sub-agent output is a hypothesis, not evidence” (source: Matt Pocock: code-review). The separation is still worth it, because “agents reliably skew positive when grading their own work” (source: Anthropic: Harness design for long-running application development) and “separating the agent doing the work from the agent judging it proves to be a strong lever” (source: Anthropic: Harness design for long-running application development). So a finding goes back to the builder to confirm or refute with a test or a run, and the gates decide; Judge the pull request reads what survives.
The routine
Section titled “The routine”- When
- The agent claims the ticket is done, before you read anything it wrote.
- What you type
- Nothing for the gates: the Stop hook runs when the agent stops, and CI runs on the pull request. Then
/code-reviewfor bugs and/mattpocock-skills:code-reviewfor the standards and the spec, each in a fresh context. - What it produces
- Gate outputs with their numbers, screenshots within the budget, and two lists of findings.
- What proves it
- The Stop hook let the agent stop; CI is green on the pull request; every finding was confirmed or refuted by a test or a run, not by another opinion.
Sources
Section titled “Sources”- Anthropic: Best practices for Claude Code code.claude.com
- Anthropic: /goal code.claude.com
- Anthropic: Hooks guide code.claude.com
- W3C: Understanding Target Size (Minimum) w3.org
- W3C: Understanding Non-text Contrast w3.org
- W3C: Understanding Focus Not Obscured (Minimum) w3.org
- Anthropic: Code review code.claude.com
- Matt Pocock: code-review aihero.dev
- Impeccable: Detector impeccable.style
- Impeccable: Hooks impeccable.style
- Impeccable: Improve a design impeccable.style
- Impeccable: How it works impeccable.style
- Anthropic: Vision platform.claude.com
- Anthropic: Harness design for long-running application development anthropic.com