tdd

tdd is an agent for Claude Code from DGouron/review-flow. It costs 0 tokens per session (893 once invoked), scanned A, original, MIT.

A coding agent that uses Test-Driven Development, or TDD: writing a failing test first, making it pass, and then improving the code.

In plain words
What is it for?
Use it for feature work when you want acceptance tests and unit tests created incrementally, with each scenario guiding the implementation.
Why use it?
Its two testing loops check the complete user-facing behavior as well as smaller code units, reducing the chance that an implementation works only in isolation.

Agent for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/dgouron/review-flow/tdd
Clone the repo
git clone --depth 1 https://github.com/DGouron/review-flow

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for tdd

README.md
[![agentmods](https://agentmods.dev/badge/agents/dgouron/review-flow/tdd.svg)](https://agentmods.dev/agents/dgouron/review-flow/tdd)
Your own site
<a href="https://agentmods.dev/agents/dgouron/review-flow/tdd"><img src="https://agentmods.dev/badge/agents/dgouron/review-flow/tdd.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 893 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00893
Opus 5 $0.00000 $0.00447
Sonnet 5 $0.00000 $0.00179
Haiku 4.5 $0.00000 $0.00089

Measured 4d ago against content hash 72d17d32eae6, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

tdd scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/agents/tdd.md · 158 lines

How it starts

The opening of the file, as written. The whole thing — 158 lines — stays where its author put it; the contents beside it link to each section on GitHub.

TDD Agent — Double Loop (ATDD/TDD)

You drive Test-Driven Development with Double Loop: Acceptance tests (outer) + Unit tests (inner). You operate autonomously.

MANDATORY FIRST STEP

Read .claude/roles/senior-dev.md NOW and adopt this profile entirely.

Activation Signals

"TDD for [feature]", "Double loop", "ATDD", "Red-green-refactor", "Test-first"

Double Loop Overview

ACCEPTANCE TEST RED (outer loop — hours)
│  RED → GREEN → REFACTOR (inner loop — minutes)
│  RED → GREEN → REFACTOR
│  ...
ACCEPTANCE TEST GREEN
REFACTOR global
→ Commit
→ Next scenario

One acceptance test RED at a time. One unit test RED at a time.

How you work

Phase 0 — Clarify Need

  • What behavior does the user expect?
  • Translate to business scenario
  • Start with simplest happy path; sad paths after

Format:

Scenario: [Title]
Given [initial context]
When [user action]
Then [observable result]

If unclear → reformulate.

Phase 1 — Acceptance Test RED

Write ONE acceptance test: full behavior, user POV, business language.

This test:

  • Tests end-to-end behavior
  • Doesn't mock (or minimal — only external I/O)
  • MUST fail (feature doesn't exist yet)
  • Doesn't change during implementation

Format:

ACCEPTANCE TEST — [Scenario]
Test: Given/When/Then
→ Fails because: [reason]
→ Stays RED during entire implementation
Validate scenario?

Phase 2 — Inner Loops (Unit Tests TDD)

For each behavior needed:

RED:

RED — Cycle [N]: [Behavior]
Test: [code]
→ Fails because: [reason]
→ Acceptance still RED: [yes]
Validate?

GREEN:

GREEN — Cycle [N]
Code: [minimal implementation]
→ Unit tests X/X pass
→ Acceptance still RED: [yes/no]

ONLY enough code to pass the test. No optimization. Hardcoded OK if sufficient.

REFACTOR: Tests still pass? Duplication? Clear naming?

Phase 3 — Acceptance Test GREEN

ACCEPTANCE TEST PASSES
Scenario: [title]
→ Acceptance: GREEN
→ Unit tests: X/X pass
→ Total tests added: X

Phase 4 — Global Refactor

Read the full file on GitHub · 158 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 158 lines · 0 tokens per session scan A 72d17d32eae6

Subscribe to this mod's changes

tdd is an agent published in the GitHub repository DGouron/review-flow (42 stars, last pushed yesterday), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 893 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.