tdd

tdd is a command for Claude Code from kumaran-is/claude-code-onboarding. It costs 0 tokens per session (688 once invoked), scanned A, original, MIT.

A command that guides development using Test-Driven Development (TDD): write a failing test, implement the smallest change that passes it, then improve the code.

In plain words
What is it for?
Use it when adding features, fixing bugs, or reviewing test quality across supported test frameworks.
Why use it?
It helps prevent untested behavior and catches missing edge cases before a feature or fix is finished.

Command for Claude Code

Written for Claude Code: installed under .claude/. Also seen: reads .claude/ paths.

Good fit Use it when adding features, fixing bugs, or reviewing test quality across supported test frameworks.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/kumaran-is/claude-code-onboarding/tdd
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.

Clone the repo
git clone --depth 1 https://github.com/kumaran-is/claude-code-onboarding

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/commands/kumaran-is/claude-code-onboarding/tdd.svg)](https://agentmods.dev/commands/kumaran-is/claude-code-onboarding/tdd)
Your own site
<a href="https://agentmods.dev/commands/kumaran-is/claude-code-onboarding/tdd"><img src="https://agentmods.dev/badge/commands/kumaran-is/claude-code-onboarding/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 688 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00000 $0.00688
Opus 5 $0.00000 $0.00344
Sonnet 5 $0.00000 $0.00138
Haiku 4.5 $0.00000 $0.00069

Measured 4d ago against content hash 060792dd2273, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, 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/commands/tdd.md · 71 lines

How it starts

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

/tdd — Test-Driven Development Mode

Invokes the tdd-guide agent to enforce Red-Green-Refactor methodology on the current task.

When to Use

  • Implementing a new feature: write tests first
  • Adding a bug fix: write a reproducing test first, then fix
  • Reviewing test quality: check coverage + edge case completeness

Behavior

When /tdd is invoked, the tdd-guide agent:

  1. Identifies the feature/behavior to be tested
  2. Writes the failing test (RED) — the test must fail before any implementation
  3. Writes minimum implementation (GREEN) — just enough to pass
  4. Refactors (REFACTOR) — clean up without changing behavior
  5. Verifies coverage — runs coverage report, flags gaps

DO / DON'T

DO DON'T
Write test before implementation Write implementation then retrofit tests
Test behavior, not implementation Test private methods or internal state
Use real stack test runner (JUnit5/pytest/Vitest/flutter_test) Mock everything including the thing being tested
Cover all 8 edge case categories Only test the happy path
Run tests 3x to confirm no flakiness Ship after a single green run

Coverage Requirements

  • Minimum: 80% line coverage
  • Critical code (auth, crypto, payments, data migrations): 100%
  • Files below threshold are listed and must be addressed before marking feature done

Error Cases

Situation Response
Test runner binary not found (mvnw, flutter, pytest, npm) Report "BUILD TOOL NOT FOUND — install [tool] or run from project root"
Test passes immediately without implementation (RED phase fails) "⚠️ Test did not fail first — diagnose before proceeding. The behavior may already exist or the test assertion is wrong."
Refactor-only task (no new behavior) Skip RED phase — run existing tests before and after. No new tests required.
Config/rename change Run existing tests only — no new tests required per first-principles.md

Read the full file on GitHub · 71 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 · 71 lines · 0 tokens per session scan A 060792dd2273

Subscribe to this mod's changes

tdd is a command published in the GitHub repository kumaran-is/claude-code-onboarding (35 stars, last pushed 2mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 688 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.