tdd

tdd is a command for coding agents from VersoXBT/claude-initial-setup. It costs 10 tokens per session (481 once invoked), scanned A, original, MIT.

A command that starts a test-driven development workflow for a feature or bug fix. TDD means writing a failing test first, adding the smallest implementation that passes it, and then refactoring.

In plain words
What is it for?
Use it to define expected behavior, add edge-case tests, run the test suite, implement only what is needed, and refactor safely.
Why use it?
It gives a clear order for changing code and checks that tests fail for the expected reason before implementation begins.

Command

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 commands/versoxbt/claude-initial-setup/tdd
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.

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/versoxbt/claude-initial-setup/tdd.svg)](https://agentmods.dev/commands/versoxbt/claude-initial-setup/tdd)
Your own site
<a href="https://agentmods.dev/commands/versoxbt/claude-initial-setup/tdd"><img src="https://agentmods.dev/badge/commands/versoxbt/claude-initial-setup/tdd.svg" alt="Measured on agentmods" height="20"></a>
Per session 10 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 481 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.00010 $0.00481
Opus 5 $0.00005 $0.00241
Sonnet 5 $0.00002 $0.00096
Haiku 4.5 $0.00001 $0.00048

Measured 3d ago against content hash e7689653f822, 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 · 61 lines

How it starts

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

Test-Driven Development

Follow the RED-GREEN-REFACTOR cycle to implement a feature or bug fix with tests written first.

Steps

  1. Identify the feature or fix to implement. Clarify requirements and expected behavior before writing any code.

  2. Write a failing test (RED phase):

    • Create or update the test file for the target module.
    • Write a test that describes the expected behavior.
    • Include edge cases: null inputs, empty collections, boundary values.
    • Do not write any implementation code yet.
  3. Run the test suite and verify the new test fails:

    • Use the project's test runner (jest, vitest, pytest, go test, etc.).
    • Confirm the failure is for the expected reason (not a syntax error or import issue).
    • If the test passes without implementation, the test is not testing new behavior — revise it.
    npm test
    pytest --cov
    go test -cover ./...
    
  4. Write minimal implementation (GREEN phase):

    • Write only enough code to make the failing test pass.
    • Do not add extra features, optimizations, or abstractions.
    • Use immutable patterns — never mutate inputs.
  5. Run the test suite again and verify the test passes:

    • All new tests must pass.
    • All existing tests must still pass.
    • If any test fails, fix the implementation (not the test, unless the test is wrong).
  6. Refactor (IMPROVE phase):

    • Clean up the implementation while keeping all tests green.
    • Extract helpers if there is duplication.
    • Improve naming and readability.
    • Run tests after every change to ensure nothing breaks.
  7. Check coverage:

    • Run tests with coverage reporting enabled.
    • Verify the new code has at least 80% coverage.
    • Add additional tests if coverage is below threshold.

If Tests Fail Unexpectedly

  • Read the error message carefully before changing code.
  • Check test isolation — tests should not depend on each other.
  • Verify mocks and stubs are set up correctly.
  • Fix the root cause, not the symptom.

Read the full file on GitHub · 61 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 · 61 lines · 10 tokens per session scan A e7689653f822

Subscribe to this mod's changes

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