## Definition The **Builder–Critic pattern** (sometimes "generator–discriminator" or "evaluator–optimizer") pairs a Builder agent that produces a diff with a Critic agent that reviews it against a spec. The Critic can demand revisions before the work reaches the human. ## Flow ``` [Builder] → diff v1 → [Critic] │ ├── pass → [Human] └── fail → back to [Builder] with reasons ``` ## Critic Prompt — Properties That Make It Work - **Rigorous, slightly adversarial** tone. - Per acceptance criterion: locate the code, identify at least one input where it might fail, confirm or report unsatisfied with `file:line` evidence. - Verdict format ends with `PASS` or `NEEDS_REVISION`. - Bias toward `NEEDS_REVISION` when in doubt — the human still decides. ## Failure Modes - **Sycophantic critic.** A vaguely-prompted critic produces "looks good to me." Always demand `file:line` evidence for any `PASS`. - **Infinite loop.** Builder produces v2, Critic flags new issues, repeat. Cap revisions at 3 and require human input on the 4th cycle. Agents agreeing for the wrong reasons is worse than them disagreeing. ## Independence is the Property The critic must not have seen the builder's intermediate reasoning. Pass it the diff and the spec, nothing else. In Claude Code, this means a **fresh sub-agent invocation**, not a continuation of the builder's session — see [[Verifier Independence]]. ## Cost Shape The Builder + Critic costs roughly 2× a single-agent run. Reserve for changes whose blast radius justifies the spend. ## Related - [[Specialized Agent]] - [[Sequential Pipeline]] - [[Verifier Independence]] - [[Building Effective AI Agents]]