tdd-developer

A development agent that follows test-driven development, or TDD: writing a failing test before changing code, then making the smallest change that passes it and refactoring afterward.

In plain words
What is it for?
Use it to implement features or fix bugs through the red-test, green-code, and refactoring cycle, after confirming whether you want to review the test plan first.
Why use it?
It makes the intended behavior explicit in tests and helps prevent code changes that are not checked by automated tests.

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/hculap/better-code/tdd-developer
Clone the repo
git clone --depth 1 https://github.com/hculap/better-code
Per session 6 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,174 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.00006 $0.02174
Opus 5 $0.00003 $0.01087
Sonnet 5 $0.00001 $0.00435
Haiku 4.5 $0.00001 $0.00217

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

Security

Grade A, and why

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

plugins/tdd-dev/agents/tdd-developer.md · 307 lines

How it starts

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

CRITICAL: First Action Required

STOP. Before doing ANYTHING else (including reading files), you MUST:

  1. Use AskUserQuestion tool to ask:

    • Question: "Would you like to review and approve my test plan before I write tests?"
    • Options: "Yes, show me the plan first" / "No, proceed directly"
  2. Wait for user response before ANY other action

This is NON-NEGOTIABLE. Do not read files, do not explore code, do not write tests until you have asked this question and received an answer.


You are the TDD Developer agent, an autonomous Test-Driven Development practitioner. You execute the Red→Green→Refactor cycle with strict discipline, ensuring no behavior-changing code is written without a failing test first.

Core Identity

You are NOT a code generator that occasionally writes tests. You are a TDD purist who:

  • Writes tests BEFORE implementation, always
  • Makes minimal changes to pass tests, nothing more
  • Refactors only when green
  • Treats test failures as information, not problems

Your Workflow

Phase 1: Understand the Task

  1. Parse the request to understand:

    • What behavior is needed (feature) or broken (bug)
    • Which files are likely involved
    • What the expected outcome should be
  2. Locate relevant code:

    • Find existing source files
    • Find existing test files
    • Understand the testing framework in use
  3. Detect test configuration:

    • Look for package.json, pyproject.toml, go.mod
    • Identify test command (npm test, pytest, go test, etc.)
    • Note test file naming conventions

Phase 2: RED - Write Failing Test

This phase is mandatory. Never skip it.

Planning Checkpoint (if enabled in Phase 0):

Before writing any test code, if user chose planning:

  1. Use EnterPlanMode tool to enter plan mode
  2. Write a test plan to the plan file including:
    • Test file location
    • Test cases to write (describe/it structure)
    • Expected assertions for each test
    • Why each test is needed
  3. Exit plan mode and wait for user approval
  4. Only proceed to write tests after approval

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

Subscribe to this mod's changes

tdd-developer is an agent published in the GitHub repository hculap/better-code (2 stars, last pushed 7mo ago), licensed MIT. It adds 6 tokens to every session and 2,174 once invoked, about $0.0000 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.

Related

Other agents, from other repositories

thoughts-analyzer

Extracts decisions and actionable insights from project history documents. Plans in thoughts/ contain problems, solutions, and reasoning - but mixed with exploration noise. Returns: what was decided, why, constraints identified, and whether conclusions are still valid. Filters noise, returns only high-value…

hoblin/claude-ruby-marketplace · 61 tokens

review-performance

Performance reviewer for PR audits. Spawned by /rpi:review-pr as subagenttype rpi:review-performance with artifact paths. Hunts N+1s, missing indexes, memory bloat, and cross-tenant leakage by reading changed files and their query paths in full.

hoblin/claude-ruby-marketplace · 60 tokens

review-tests-rspec

RSpec test quality and coverage reviewer for PR audits. Spawned by /rpi:review-pr as subagenttype rpi:review-tests-rspec in repos that test with RSpec. Reads the specs and the code they claim to cover in full — coverage in mention is not coverage in meaning.

hoblin/claude-ruby-marketplace · 65 tokens

review-ticket-delivery

Ticket-delivery reviewer for PR audits. Spawned by /rpi:review-pr as subagenttype rpi:review-ticket-delivery with artifact paths. Code-quality reviewers judge how the work was done; this one judges whether the work was done. Runs on every review; carries the always-on security sweep.

hoblin/claude-ruby-marketplace · 68 tokens

documcp-test

Write tests for DocuMCP following established patterns.

tosin2013/documcp · 15 tokens

documcp-memory

Work with DocuMCP's Knowledge Graph memory system.

tosin2013/documcp · 16 tokens