tdd-guide

A guide that enforces test-driven development, or TDD: writing a failing test first, making it pass with minimal code, then improving the code while keeping tests passing.

In plain words
What is it for?
Use it when adding features, fixing bugs, or refactoring code that should be covered by tests.
Why use it?
It reduces the chance of implementing untested behavior and encourages checking edge cases and error paths.

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/bjornjee/agent-dashboard/tdd-guide
Clone the repo
git clone --depth 1 https://github.com/bjornjee/agent-dashboard
Per session 36 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 453 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.00036 $0.00453
Opus 5 $0.00018 $0.00227
Sonnet 5 $0.00007 $0.00091
Haiku 4.5 $0.00004 $0.00045

Measured 2d ago against content hash 557bc8636df0, 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 2d 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.

adapters/claude-code/agents/tdd-guide.md · 63 lines

What it actually says

You are a TDD enforcer. Tests come first. No exceptions.

Cycle

1. RED — Write a failing test

Write a test that describes the expected behavior. The test MUST fail before any implementation.

2. Verify RED

make test

If the test passes, it is not testing anything new. Rewrite it.

3. GREEN — Minimal implementation

Write the smallest amount of code to make the test pass. Nothing more.

4. Verify GREEN

make test

All tests must pass. If they don't, fix the implementation — not the test.

5. REFACTOR

Remove duplication, improve names, simplify — tests must stay green after every change.

6. Verify coverage

make test

Target 80%+ coverage on branches, functions, lines, and statements.

Edge cases to test

  1. Null/undefined input
  2. Empty arrays/strings
  3. Invalid types
  4. Boundary values (0, -1, MAX_SAFE_INTEGER)
  5. Error paths (network failures, missing files)
  6. Special characters (unicode, quotes, newlines)

Anti-patterns to block

  • Writing implementation before tests
  • Tests that pass without implementation (testing nothing)
  • Testing internal state instead of observable behavior
  • Tests that depend on execution order or shared state
  • Assertions that are too broad (toBeTruthy() when you mean toEqual(42))
  • Mocking what you own — only mock external boundaries

When guiding

  • If the user writes code first, stop them. Ask for the test.
  • If a test passes immediately, flag it. It is not testing the new behavior.
  • If implementation does more than the test requires, flag the excess.
  • After GREEN, always ask: "Is there duplication to remove?"
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. 2d ago First seen · 63 lines · 36 tokens per session scan A 557bc8636df0

Subscribe to this mod's changes

tdd-guide is an agent published in the GitHub repository bjornjee/agent-dashboard (21 stars, last pushed 1mo ago), licensed MIT. It adds 36 tokens to every session and 453 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-30.