Skip to content

Reviewing what the agent built

An agent that satisfied the prompt has passed one test: its output matches what it was told. That check is necessary and not sufficient. The prompt, the spec, and the tests were all written inside the same understanding of the problem, and every artifact derived from that understanding inherits its errors. What follows is what to look at after the tests are green.

The code-review skill reviews the diff between a fixed point you name and the current head along two axes, each in its own sub-agent so that neither influences the other.

  • Standards: does the code follow the repository’s documented coding standards? On top of whatever the repository documents, the skill applies a baseline of Fowler’s code smells (mysterious name, duplicated code, feature envy, data clumps, primitive obsession, repeated switches, shotgun surgery, divergent change, speculative generality, message chains, middle man, refused bequest). A documented standard overrides the baseline, and every smell is reported as a judgment call, never as a violation.
  • Spec: does the code implement the originating issue or spec? The spec is found from issue references in the commit messages, a path you pass, or a spec file under docs/, specs/, or .scratch/. The sub-agent reports requirements that are missing or partial, behavior that was not asked for, and requirements that appear implemented but look wrong.

The two reports are presented side by side, not merged or reranked. A change can pass one axis and fail the other, and a combined report would let one hide the other.

Neither axis asks whether the spec was right. Standards checks the code against the repository; Spec checks the code against the request. The context-fit check asks what building this implementation revealed about the request’s assumptions, categories, purposes, or setting. It is the only review question permitted to conclude that the spec was wrong, and its answer is a reason to revise the spec’s premises, not a bug to file. The situation page It does exactly what was asked and it is still wrong shows where it fits in the loop.

Work through these after the two-axis report, in order.

Does the diff match the spec’s intent, not only its words? Read the problem statement and the user stories, not only the implementation decisions. An agent can satisfy every listed story and miss the one the requester assumed was obvious. Ask what the requester would do with the result on the first day.

Did the agent invent vocabulary? Every skill reads GLOSSARY.md before exploring and uses its terms rather than synonyms. A name in the diff that is not in the glossary means either that the agent is inventing language the project does not use or that the glossary has a gap. Either calls for a domain-modeling pass before merge.

Did it contradict an ADR? The domain-doc rules require a skill to report any output that contradicts an existing decision record rather than override it silently. Check that the agent did so, and check the ADRs in the area yourself. A contradiction the agent did not notice is the more common case.

Did it touch seams it should not? The spec names the seams at which the feature is tested, chosen as high and as few as possible. A diff that adds tests or entry points at new seams has changed the design without a decision. Use the codebase-design vocabulary to say which seam and why it matters.

Are the tests worth keeping? The tdd skill names three anti-patterns. Implementation-coupled tests replace internal collaborators with stand-ins or verify through a side channel, and break on refactors that change no behavior. Tautological tests recompute the expected value the way the code does and cannot disagree with it. Horizontal slicing writes all the tests first against imagined behavior. Delete or rewrite tests that match any of the three. A green suite of such tests is not evidence.

Did it silently narrow scope? The Spec axis reports missing requirements, but an agent can also reinterpret a hard requirement as an easier one, and the tests will agree with the reinterpretation. Compare the acceptance criteria against what the code does on the unhappy paths, not only the demonstrated one.

What did building it reveal about the request? This is the third axis. Look for places where the agent asked a question, made and noted an assumption, or chose between two readings of a term. Each is evidence about the request. A plain defect goes back to the build; a category, purpose, or method problem goes back to the glossary, the ADRs, or the destination.

The skill takes the fixed point as its argument and asks for one if it is missing. The third axis has to be asked for, because the skill does not ask it:

/code-review against main, then answer one more question: what did building this reveal about the request's assumptions, categories, or purposes that the spec did not know?

Treat the answer as input to the next grilling, not as a finding to fix in this diff.

When the change goes up as a pull request, the agent writes the body with the pr skill. It has three parts. The summary is the smallest visual that makes the change clear: pseudocode, a call tree, a file tree, a diagram, or a diff. The evidence shows the change working, before and after. The merge-danger call says whether the change is a one-way or a two-way door and names its blast radius. Review the body as well as the diff. A summary visual that does not match the diff means the agent’s account of its own change is wrong. A two-way door call on a schema migration or a public interface is a judgment to challenge before merge, not a formality.

A review catches a mistake once. Retro asks why the environment let it happen. Run at the end of a session, it sorts each recurring finding. A mechanical violation, such as a banned API or an import shape, becomes a deterministic check: a lint rule, a pre-commit hook, or a CI job. A judgment call becomes a line in the coding standards that code-review’s Standards axis reads. The division follows the two agents’ loads. The implementer carries the exploration and debugging, so the reviewer, who receives only a diff, is the one to enforce standards.

The two sub-agents run in parallel and report independently, so their findings can conflict. The Standards report may flag a helper as a middle man that the Spec report treats as a required seam, or one report may read a spec line differently from the other. The skill does not reconcile them. Read each report in its own terms, decide the conflict yourself, and record the decision where it belongs: a standards conflict as a note in the repository’s standards file, a spec conflict as a revision to the spec or an ADR.

A sub-agent’s findings are limited to what its prompt contained. The Standards sub-agent sees the diff and the smell baseline, not the conversation. The Spec sub-agent sees the spec and the diff, not the ADRs written since. When a finding surprises you, check what the sub-agent could not see before acting on it.