| name | review-tdd-green |
| description | Review a GitHub PR that implements a module against a pre-existing test suite. Use when asked to "review this impl PR", "review this green PR", "is this the best implementation?", or "did the tests catch everything?". Also triggers when an [IMPL] PR link is shared. The core questions: is this the simplest correct implementation, does it actually match the spec (not just the tests), and what did the tests fail to catch?
|
| argument-hint | GitHub PR URL (e.g. https://github.com/owner/repo/pull/123) |
Review a TDD Green-Phase PR
An [IMPL] PR makes a pre-existing failing test suite pass. The review job goes beyond
"tests pass" to ask three questions:
- Is this the best implementation? Simplest correct code that satisfies the spec —
no over-engineering, no under-engineering.
- Is it spec-correct? Tests are necessary but not sufficient. An implementation
can pass every test and still miss a spec requirement.
- What did the tests not catch? Tests were written before implementation. Now that
the implementation exists, gaps are visible that weren't before.
When to Use
- When an
[IMPL] PR (or any green-phase PR) is opened for review
- When asked "is this the right implementation?" on a code PR with existing tests
- As a pre-merge gate before the retro
Process
Step 1 — Gather inputs
Collect in parallel:
- PR diff —
GET /pull/{n}/files for the full implementation diff
- Test file — the existing test file this PR makes green (from the paired [TEST] PR
or the repo directly)
- Linked issue — the
[IMPL] issue, for key behaviors, out-of-scope list, and
pipeline context
- Spec section — the SPEC.md section(s) cited in the issue
- CLAUDE.md — for code standards, failure handling conventions, and logging requirements
Step 2 — Verify the baseline
Confirm:
- All tests in the paired test file pass
make check passes (lint + typecheck + full suite)
- No tests were modified (the test file is the contract — modifications require
explicit justification)
Step 3 — Apply the checklist
Work through the five categories below. Flag every gap found.
Step 4 — Post a comment
If gaps exist, post a gh pr comment <n> with:
- A numbered list of gaps
- For each gap: a one-sentence description of what's wrong and why it matters,
plus a concrete suggestion (code snippet or spec reference)
- Do NOT write "looks good" if even one gap was found
If no gaps exist, say so explicitly and state why you're confident (which spec
requirements you verified and how).
Checklist
1. Simplicity and over-engineering
The implementation should be the simplest code that correctly satisfies the spec.
2. Spec correctness — beyond the tests
Tests were written before implementation. They can't test what wasn't anticipated.
3. Code standards compliance
Standards the agent should follow from CLAUDE.md — tests don't enforce these.
4. What the tests didn't catch
Now that the implementation exists, look for coverage gaps that are visible in hindsight.
5. Test file integrity
The test file is the contract — verify it wasn't touched.
Posting the Review
Use this shell invocation to post a comment (avoids glob expansion issues):
gh pr comment <number> --body $'## Review\n\n...'
Use $'...' quoting. Avoid bare ** or * patterns at the shell level —
they will glob-expand and cause the command to fail with "no matches found".
Each gap should follow this format:
### N. <Gap title>
<One sentence: what's wrong, which spec requirement or standard it violates.>
**Fix:**
[code snippet or specific change needed]
Severity Levels
Not all gaps are equal. Categorize each finding:
| Severity | Meaning | Example |
|---|
[BLOCKING] | Must fix before merge | Missing failure handling, weakened test assertion |
[CONCERN] | Should fix — will cause problems | Missing required log fields, no type annotation |
[SUGGESTION] | Consider fixing | Unnecessary abstraction, minor style issue |
Post blocking findings prominently. Don't bury them in a list of suggestions.
Project Overlays
Load a project-specific overlay when reviewing PRs for a known codebase.
The overlay adds module-specific invariants and known recurring failure classes.