A test-driven development loop for Claude Code: specify, plan, review, implement, verify, with independent review agents that catch design bugs before coding and correctness bugs before commit.
/spec Clarify WHAT to build (user stories, acceptance criteria)
↓
/implement Plan HOW to build it (chunks, dependencies, tracker)
↓
review-plan Independent agent validates the plan (8-point review)
↓
/implement Implement with TDD (failing test → code → pass)
↓
review-impl Independent agent verifies implementation matches plan
+
red-team Independent agent hunts bugs + cleanups in the diff
/implement handles both planning and implementation. The three
review agents run in isolated context, they didn’t write the plan or
code, so they evaluate honestly.
review-impl
checks conformance, does the code match the plan? red-team
checks correctness, is the diff wrong or wasteful, regardless of
the plan? A bug that faithfully implements a flawed plan is caught
only by red-team; a correct-but-off-spec change only by
review-impl.red-team
surfaces candidate defects freely (conservative reviewers
under-report), then runs a verify pass that keeps only
CONFIRMED/PLAUSIBLE findings and drops the rest, trading a noisier
find phase for higher recall without shipping the false positives.| Piece | Type | Invocation | Purpose |
|---|---|---|---|
| spec | Skill | /spec <feature> |
User stories, acceptance criteria, edge cases |
| implement | Skill | /implement <feature> |
Chunk decomposition, JSON tracker, per-chunk red-green-refactor, 8-point quality gate |
| review-plan | Agent | auto (Phase 2.5) | 8-point plan review in fresh context |
| review-impl | Agent | auto (Phase 6) | Verifies implementation matches plan |
| red-team | Agent | auto (Phase 6) / manual | Adversarial diff review, bugs + cleanup |
red-team agentred-team is the plugin’s bug-and-cleanup reviewer. It reads the diff
in a fresh context and runs a two-family review:
CLAUDE.md /
PROJECT.md at runtime and only flags rules it can quote.It then verifies each candidate (recall-biased: PLAUSIBLE by default, REFUTED only when the code proves it) and sweeps once more for gaps the first pass missed.
It takes a mode:
| Mode | What it does |
|---|---|
bugs |
correctness angles only, then verify + sweep |
cleanup |
quality angles only, the tidy pass; can apply fixes |
both (default) |
everything |
Use the red-team agent in mode: both to review the changed files
Use the red-team agent in mode: cleanup to tidy the changed files
red-team reads no project assumptions of its own, it discovers
standards from the project’s CLAUDE.md / PROJECT.md each run, so
the same agent works across projects.
Copy skills/ and agents/ into your project’s .claude/ directory,
or install as a Claude Code plugin.
Then give the loop project context. There are two PROJECT.md
templates, each skill reads the one in its own directory:
skills/implement/PROJECT.md, build/test/lint commands, architecture
rules, standards, and blindspots. Read by /implement and red-team.skills/spec/PROJECT.md, domain context, architecture overview, and
domain-specific concerns. Read by /spec.Fill in both (each is a template of YOUR_*_HERE placeholders). The
fastest start is to copy the closest example from
skills/implement/project-configs/
and skills/spec/project-configs/,
ready-made configs for Node/TypeScript, Python, Rust, and
Android/Kotlin. Both skills run fine with no PROJECT.md (generic
defaults apply), just with less project-specific insight.
Installing as a plugin? Your filled-in PROJECT.md belongs in your
own project, not in the read-only plugin directory.
Apache-2.0. See LICENSE.