dev-tdd

dev-tdd is a command for Claude Code from christopherlouet/claude-base. It costs 0 tokens per session (567 once invoked), scanned A, original, MIT.

A test-first development process called TDD: write a failing test, add the smallest implementation that passes, then clean up the code.

In plain words
What is it for?
Use it to build features, generate tests for existing code, set up test tooling, and organize testing, coverage, mocks, and CI.
Why use it?
It gives you a repeatable way to define expected behavior before implementation and catch edge cases and regressions.

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/christopherlouet/claude-base/dev-tdd
Clone the repo
git clone --depth 1 https://github.com/christopherlouet/claude-base

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 dev-tdd

README.md
[![agentmods](https://agentmods.dev/badge/commands/christopherlouet/claude-base/dev-tdd.svg)](https://agentmods.dev/commands/christopherlouet/claude-base/dev-tdd)
Your own site
<a href="https://agentmods.dev/commands/christopherlouet/claude-base/dev-tdd"><img src="https://agentmods.dev/badge/commands/christopherlouet/claude-base/dev-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 567 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.00567
Opus 5 $0.00000 $0.00283
Sonnet 5 $0.00000 $0.00113
Haiku 4.5 $0.00000 $0.00057

Measured yesterday against content hash 0554aa6c9501, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

dev-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 yesterday.

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/dev/dev-tdd.md · 59 lines

How it starts

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

Agent DEV-TDD

Implements a feature by following the TDD (Test-Driven Development) cycle.

Context

$ARGUMENTS

Goal

Develop robust code by writing tests BEFORE the implementation. TDD guarantees complete test coverage and emergent design.

This command is the single entry point for the test lifecycle. Besides the test-first cycle, it also: generates an exhaustive test suite for existing code (nominal, edge, error, boundary — AAA structure) and sets up the test infrastructure (framework, coverage thresholds, MSW mocks, npm scripts, CI). Use the dev-tdd skill for the detailed methodology of all three.

TDD Cycle

RED (test fails) → GREEN (minimal code) → REFACTOR (clean up) → repeat

Expected output

  1. Tests first: Complete test file (nominal cases, edge cases, errors)
  2. Implementation: Minimal code that makes the tests pass
  3. Refactoring: Clean, readable, SOLID code
  4. Separate commits: test(scope)feat(scope)refactor(scope)

Other modes

  • Generate tests for existing code: analyze public functions/branches/side-effects, generate nominal + edge (null/undefined/""/[]/{}/0/-1/MAX_INT) + error + boundary cases in AAA structure with descriptive names; target coverage >80% (critical 90%+, utils 80%+, UI 70%+). No mocks except external deps; independent, order-free tests.
  • Set up test infrastructure: pick the framework for the stack (Vitest for JS/TS, Pytest for Python, go test for Go), configure coverage thresholds, MSW for API mocks (preferred over manual mocks), npm scripts (test, test:watch, test:coverage, test:ci), and the CI workflow.
Before Usage
/work:work-plan Plan before coding
/work:work-explore Understand the code/context
After Usage
/qa:qa-review Review the tests / code
/ops:ops-ci Wire coverage into CI/CD
/work:work-commit Commit cleanly

IMPORTANT: Never write the code before the tests.

Read the full file on GitHub · 59 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. yesterday First seen · 59 lines · 0 tokens per session scan A 0554aa6c9501

Subscribe to this mod's changes

dev-tdd is a command published in the GitHub repository christopherlouet/claude-base (5 stars, last pushed yesterday), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 567 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-09-03.