tdd

A Test-Driven Development (TDD) workflow that writes tests before the code, checks that they fail, then implements and refines the change.

In plain words
What is it for?
Use it to develop features from requirements, cover edge cases, run the project's test commands, and refactor while tests remain passing.
Why use it?
It helps catch incorrect assumptions early and keeps implementation tied to expected behavior.

Command

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/cassler/awesome-claude-code-setup/tdd
Clone the repo
git clone --depth 1 https://github.com/cassler/awesome-claude-code-setup
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 425 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.00425
Opus 5 $0.00000 $0.00212
Sonnet 5 $0.00000 $0.00085
Haiku 4.5 $0.00000 $0.00042

Measured 3d ago against content hash 84f6257b2f45, 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 3d 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.

commands/tdd.md · 62 lines

What it actually says

Test-Driven Development (TDD) Workflow

I'll help you implement changes using Test-Driven Development. This is an Anthropic-favorite workflow that ensures high-quality, well-tested code.

TDD Process Overview

I'll follow these steps strictly:

  1. Write failing tests first - Based on your requirements
  2. Verify tests fail - Confirm we're testing the right thing
  3. Implement minimal code - Just enough to make tests pass
  4. Refactor if needed - Improve code while keeping tests green

Your Requirements

Please provide:

  1. What feature/change do you want?

    • Describe the expected behavior
    • Include any edge cases to handle
  2. Test examples (optional but helpful):

    • Input/output pairs
    • Error scenarios
    • Performance requirements
  3. Test framework preferences:

    • Which testing framework does your project use?
    • Any specific test patterns to follow?

Important Notes

  • I will NOT write any implementation code until tests are written and failing
  • I will NOT modify tests once we start implementation (unless there's a bug in the test itself)
  • I will use your project's test commands to run tests efficiently
  • I'll identify the appropriate test command from your project setup

Process I'll Follow

Phase 1: Test Creation

# 1. Analyze existing test structure
chs find-file "*.test.*"
chs find-file "*.spec.*"

# 2. Write comprehensive tests
# 3. Run tests and confirm they fail

Phase 2: Implementation

# 1. Write minimal implementation
# 2. Run tests repeatedly until all pass
# 3. Avoid overfitting to specific test cases

Phase 3: Verification

# 1. Run full test suite
# 2. Check test coverage if available
# 3. Commit when all tests pass

Let's begin! What would you like to implement using TDD?

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. 3d ago First seen · 62 lines · 0 tokens per session scan A 84f6257b2f45

Subscribe to this mod's changes

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