tdd-review

tdd-review is a command for Claude Code from wbern/agent-instructions. It costs 13 tokens per session (940 once invoked), scanned A, original, MIT.

A review of automated tests that checks whether they are reliable, focused, and easy to maintain, using common testing principles and development practices.

In plain words
What is it for?
Use it to review all tests in a project, one test file, or a directory, including files named with common test patterns.
Why use it?
It helps reveal tests that are slow, unclear, duplicated, or too dependent on implementation details, so test failures are more useful.

Command 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 commands/wbern/agent-instructions/tdd-review
Clone the repo
git clone --depth 1 https://github.com/wbern/agent-instructions

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-review

README.md
[![agentmods](https://agentmods.dev/badge/commands/wbern/agent-instructions/tdd-review.svg)](https://agentmods.dev/commands/wbern/agent-instructions/tdd-review)
Your own site
<a href="https://agentmods.dev/commands/wbern/agent-instructions/tdd-review"><img src="https://agentmods.dev/badge/commands/wbern/agent-instructions/tdd-review.svg" alt="Measured on agentmods" height="20"></a>
Per session 13 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 940 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.00013 $0.00940
Opus 5 $0.00006 $0.00470
Sonnet 5 $0.00003 $0.00188
Haiku 4.5 $0.00001 $0.00094

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

Security

Grade A, and why

tdd-review 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/commands/tdd-review.md · 122 lines

How it starts

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

General Guidelines

Output Style

  • Never explicitly mention TDD in code, comments, commits, PRs, or issues
  • Write natural, descriptive code without meta-commentary about the development process
  • The code should speak for itself - TDD is the process, not the product

Beads is available for task tracking. Use mcp__beads__* tools to manage issues (the user interacts via bd commands).

Plan File Restriction

NEVER create, read, or update plan.md files. Claude Code's internal planning files are disabled for this project. Use other methods to track implementation progress (e.g., comments, todo lists, or external tools).

(If there was no info above, fallback to:

  1. Context of the conversation, if there's an immediate thing
  2. bd ready to see what to work on next and start from there)

Test Quality Review

Analyze test files against FIRST principles and TDD best practices.

Phase 1: Scope

Input Action
No argument Find all test files in project
File path Analyze specific test file
Directory Analyze tests in directory

Detect test files using common patterns: *.test.*, *.spec.*, *.stories.*, __tests__/**

Also check for framework-specific patterns based on the project's languages and tools (e.g., *_test.go, *_test.py, Test*.java, *.feature for BDD).

Phase 2: Analysis

For each test file, check against these criteria:

Quality Criteria

FIRST Principles
Principle What to Check
Fast Tests complete quickly, no I/O, no network calls, no sleep()/setTimeout delays
Independent No shared mutable state, no execution order dependencies between tests
Repeatable No Date.now(), no Math.random() without seeding, no external service dependencies
Self-validating Meaningful assertions that verify behavior, no manual verification needed
TDD Anti-patterns
Anti-pattern Detection Signals
The Liar expect(true).toBe(true), empty test bodies, tests with no assertions
Excessive Setup >20 lines of arrange code, >5 mocks, deep nested object construction
The One >5 assertions testing unrelated behaviors in a single test
The Peeping Tom Testing private methods, asserting on internal state, tests that break on any refactor
The Slow Poke Real database/network calls, file I/O, hard-coded timeouts

Read the full file on GitHub · 122 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 · 122 lines · 13 tokens per session scan A 909bbfc92a71

Subscribe to this mod's changes

tdd-review is a command published in the GitHub repository wbern/agent-instructions (168 stars, last pushed 3mo ago), licensed MIT. It adds 13 tokens to every session and 940 once invoked, about $0.0001 per session on Opus 5. 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.