tdd

A command for test-driven development, or TDD: write a failing test, add the smallest code that passes it, then improve the code while keeping the tests passing. It follows the RED-GREEN-REFACTOR cycle and is opt-in.

In plain words
What is it for?
Use it to scaffold an interface, cover normal and edge cases, verify tests fail for the right reason, implement only what is needed, and refactor safely.
Why use it?
It makes expected behavior explicit before implementation and uses tests to check that later refactoring does not break it.

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/vrennat/developersdevelopers/tdd
Clone the repo
git clone --depth 1 https://github.com/vrennat/developersDevelopers
Per session 31 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 362 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.00031 $0.00362
Opus 5 $0.00015 $0.00181
Sonnet 5 $0.00006 $0.00072
Haiku 4.5 $0.00003 $0.00036

Measured yesterday against content hash 755391d1dfe6, 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 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.

commands/tdd.md · 34 lines

What it actually says

/tdd

Test-driven development loop. RED -> GREEN -> REFACTOR.

Opt-in only. The plugin does NOT auto-enforce TDD on every implementation. Use this when you want the discipline.

Procedure

  1. SCAFFOLD: define the interface. Types, function signature, throw Not implemented. Commit.
  2. RED: write the failing test(s). Cover happy path, edge cases (empty/null/max), error conditions. Run tests; verify they FAIL for the right reason.
  3. GREEN: write the minimum code to pass. No gold-plating. Run tests; verify PASS.
  4. REFACTOR: improve naming, extract helpers, reduce complexity. Run tests after each change; must stay green.
  5. REPEAT: next behavior or scenario, back to RED.

Commit after each phase that produces working state (after GREEN, after REFACTOR). Don't commit RED — the test is failing.

Rules

  • Test FIRST. No exceptions in this command.
  • Verify the test fails before implementing. A test that "passes" before you implement is testing the wrong thing.
  • Refactor only when green. Tests are your safety net.
  • Test behavior, not implementation. Don't mock everything; prefer integration tests where reasonable.

When NOT to use

  • Quick spike or throwaway script: just write it.
  • Exploring a library: write a scratch file, no tests needed.
  • Bug fix where reproduction is the test: regression test then fix is fine, but you don't need the full RED-GREEN-REFACTOR ceremony.
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 · 34 lines · 31 tokens per session scan A 755391d1dfe6

Subscribe to this mod's changes

tdd is a command published in the GitHub repository vrennat/developersDevelopers (2 stars, last pushed 1mo ago), licensed MIT. It adds 31 tokens to every session and 362 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.