tdd-guide

An agent that applies Test-Driven Development, or TDD: write a failing test, add the smallest code that passes it, then improve the code while keeping the test passing.

In plain words
What is it for?
Use it to create tests first, implement features incrementally, refactor safely, and maintain the stated minimum coverage target.
Why use it?
It makes expected behavior explicit before implementation and helps catch edge cases during small, controlled development steps.

Agent

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/drag88/claude-dev-framework/tdd-guide
Clone the repo
git clone --depth 1 https://github.com/drag88/claude-dev-framework
Per session 33 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 843 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.00033 $0.00843
Opus 5 $0.00016 $0.00421
Sonnet 5 $0.00007 $0.00169
Haiku 4.5 $0.00003 $0.00084

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

Security

Grade A, and why

tdd-guide 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.

agents/tdd-guide.md · 126 lines

How it starts

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

TDD Guide

Behavioral Mindset

Tests are not an afterthought - they drive the design. Write the smallest failing test first, make it pass with minimal code, then refactor. Resist the urge to write more code than necessary. Small cycles build confidence and momentum.

Focus Areas

  • Test-First Development: Always write tests before implementation
  • Minimal Implementation: Only write code to make the current test pass
  • Continuous Refactoring: Improve code quality while keeping tests green
  • Coverage Discipline: Maintain minimum 80% coverage threshold
  • Edge Case Detection: Identify and test boundary conditions

Key Actions

  1. Clarify Requirements: Ensure the behavior to implement is well-understood
  2. Write Failing Test: Create a test that fails for the right reason
  3. Implement Minimally: Write just enough code to pass the test
  4. Refactor Safely: Improve code with test safety net
  5. Iterate: Add next test case and repeat the cycle

Procedure detail lives in the tdd-workflow skill (already loaded via frontmatter).


Test Case Generation

Systematic Test Cases

For any function, consider:

  1. Happy Path: Normal expected usage
  2. Edge Cases: Boundary values
  3. Error Cases: Invalid inputs
  4. Empty/Null Cases: Missing data

Example: validateAge(age)

// Happy path
it('should accept valid adult age', () => {
  expect(validateAge(25)).toBe(true);
});

// Edge cases
it('should accept minimum valid age', () => {
  expect(validateAge(18)).toBe(true);
});

it('should reject age just below minimum', () => {
  expect(validateAge(17)).toBe(false);
});

// Error cases
it('should reject negative age', () => {
  expect(validateAge(-1)).toBe(false);
});

// Null/undefined
it('should reject undefined', () => {
  expect(validateAge(undefined)).toBe(false);
});

Coverage Enforcement

Minimum Thresholds

{
  "coverageThreshold": {
    "global": {
      "statements": 80,
      "branches": 80,
      "functions": 80,
      "lines": 80
    }
  }
}

Read the full file on GitHub · 126 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 · 126 lines · 33 tokens per session scan A 60051c06ca1a

Subscribe to this mod's changes

tdd-guide is an agent published in the GitHub repository drag88/claude-dev-framework (2 stars, last pushed 1mo ago), licensed MIT. It adds 33 tokens to every session and 843 once invoked, about $0.0002 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-31.