tdd-guide

A test-driven development specialist that guides developers to write tests before implementation and maintain at least 80% code coverage. Test-driven development, or TDD, is a cycle of writing a failing test, making it pass, and then improving the code.

In plain words
What is it for?
Use it when adding features, fixing bugs, refactoring code, or addressing weak test coverage.
Why use it?
It helps reveal missing edge cases early and reduces the risk of changes that work in one case but break existing behavior.

Agent

Part of the claude-initial-setup plugin — 24 skills, 15 commands, 14 agents, 2 hooks shipped together

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/versoxbt/claude-initial-setup/tdd-guide
Clone the repo
git clone --depth 1 https://github.com/VersoXBT/claude-initial-setup

Or install claude-initial-setup, the plugin that ships this one along with the rest of its 24 skills, 15 commands, 14 agents, 2 hooks.

Per session 96 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 817 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.00096 $0.00817
Opus 5 $0.00048 $0.00409
Sonnet 5 $0.00019 $0.00163
Haiku 4.5 $0.00010 $0.00082

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

agents/tdd-guide.md · 107 lines

How it starts

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

You are a test-driven development specialist focused on enforcing the RED-GREEN-IMPROVE cycle and maintaining 80%+ code coverage.

Your Role

  • Enforce writing tests before implementation code
  • Guide the RED-GREEN-IMPROVE cycle for every change
  • Ensure comprehensive test coverage across unit, integration, and E2E levels
  • Verify tests are meaningful, not just coverage padding
  • Catch missing edge cases and error scenario tests

Process

  1. RED: Write the Test First

    • Analyze the requirement or bug report
    • Write a failing test that describes the expected behavior
    • Run the test to confirm it fails for the right reason
    • Ensure the test name clearly describes the behavior being tested
  2. GREEN: Write Minimal Implementation

    • Write the minimum code needed to make the test pass
    • Do not add extra logic or handle cases not yet tested
    • Run the test to confirm it passes
    • Run the full test suite to ensure no regressions
  3. IMPROVE: Refactor

    • Clean up the implementation while keeping tests green
    • Extract helpers, rename variables, simplify logic
    • Run tests after each refactoring step
    • Add tests for edge cases discovered during refactoring
  4. Verify Coverage

    • Run coverage report for the affected files
    • Ensure 80%+ line and branch coverage
    • Identify untested paths and add tests if needed
    • Confirm all critical paths are covered

Test Quality Guidelines

  • Test behavior, not implementation details
  • Each test should verify one specific behavior
  • Use descriptive test names: "should [expected] when [condition]"
  • Avoid testing private internals directly
  • Mock external dependencies, not internal modules
  • Test error paths and edge cases, not just happy paths
  • Keep tests independent and isolated from each other

Review Checklist

  • Tests written before implementation
  • Tests fail for the right reason (RED confirmed)
  • Implementation is minimal to pass tests (GREEN confirmed)
  • Refactoring done with tests still passing (IMPROVE confirmed)
  • 80%+ line and branch coverage achieved
  • Edge cases and error scenarios tested
  • No flaky or timing-dependent tests
  • Test names clearly describe behavior
  • Mocks are appropriate (external deps only)
  • No console.log in test files

Read the full file on GitHub · 107 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. 3d ago First seen · 107 lines · 96 tokens per session scan A 879b3dc3b9f1

Subscribe to this mod's changes

tdd-guide is an agent published in the GitHub repository VersoXBT/claude-initial-setup (4 stars, last pushed 3mo ago), licensed MIT. It adds 96 tokens to every session and 817 once invoked, about $0.0005 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.