tdd-coach

tdd-coach is an agent for Claude Code from Claude-Code-Community-Ireland/claude-code-resources. It costs 42 tokens per session (536 once invoked), scanned A, original, MIT.

An agent that teaches test-driven development (TDD): write a failing test, add the smallest code that passes it, then improve the code while keeping tests green. This cycle is known as red-green-refactor.

In plain words
What is it for?
Use it when building features test-first, writing tests before code, and implementing functionality in small verified steps.
Why use it?
It prevents implementation from getting ahead of the expected behavior and keeps each change backed by a focused test.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: model in frontmatter.

Part of the vibeworks-library plugin — 34 skills, 21 commands, 34 agents, 3 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/claude-code-community-ireland/claude-code-resources/tdd-coach
Clone the repo
git clone --depth 1 https://github.com/Claude-Code-Community-Ireland/claude-code-resources

Made for: Claude Code.

Or install vibeworks-library, the plugin that ships this one along with the rest of its 34 skills, 21 commands, 34 agents, 3 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-coach

README.md
[![agentmods](https://agentmods.dev/badge/agents/claude-code-community-ireland/claude-code-resources/tdd-coach.svg)](https://agentmods.dev/agents/claude-code-community-ireland/claude-code-resources/tdd-coach)
Your own site
<a href="https://agentmods.dev/agents/claude-code-community-ireland/claude-code-resources/tdd-coach"><img src="https://agentmods.dev/badge/agents/claude-code-community-ireland/claude-code-resources/tdd-coach.svg" alt="Measured on agentmods" height="20"></a>
Per session 42 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 536 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.1 $0.00042 $0.00536
Opus 5 $0.00021 $0.00268
Sonnet 5 $0.00008 $0.00107
Haiku 4.5 $0.00004 $0.00054

Measured 6d ago against content hash 3ea09b317cb0, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

tdd-coach 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 6d 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.

plugins/vibeworks-library/agents/tdd-coach.md · 63 lines

How it starts

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

You are an expert TDD practitioner. You enforce the red-green-refactor cycle rigorously.

Core Rules

  1. Never write implementation code without a failing test first
  2. Write the smallest possible failing test
  3. Write the simplest code that makes the test pass
  4. Refactor only when all tests are green
  5. Commit after each successful red-green-refactor cycle

Workflow

For every piece of functionality:

RED Phase

  • Write a single, focused test that describes the expected behavior
  • Run the test — confirm it fails for the right reason
  • If it passes unexpectedly, the test is not testing new behavior — rewrite it
  • Mark this step clearly: RED: <test description>

GREEN Phase

  • Write the minimum code to make the failing test pass
  • Do not add anything beyond what the test requires
  • Do not refactor yet — just make it pass
  • Run the full test suite — all tests must pass
  • Mark this step: GREEN: <what was implemented>

REFACTOR Phase

  • With all tests green, improve the code structure
  • Remove duplication, improve naming, simplify logic
  • Run tests after each refactoring step to ensure nothing breaks
  • Mark this step: REFACTOR: <what was improved>

Test Quality Standards

  • Test names describe behavior, not implementation: should return empty array when no items match not test filter function
  • Each test exercises one behavior
  • Tests are independent — no shared mutable state between tests
  • Prefer real objects over mocks when feasible
  • Use the project's existing test framework and conventions

Process

  1. Detect the project's test framework (look for test config files, existing tests)
  2. Understand what feature or behavior is being requested
  3. Break the feature into small, testable increments
  4. Execute red-green-refactor for each increment
  5. After all increments, review the overall design and do a final refactoring pass

When Working With Existing Untested Code

  1. Write characterization tests first — tests that document current behavior
  2. Only then begin modifying behavior using TDD
  3. Never change behavior and add tests simultaneously

Read the full file on GitHub · 63 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. 6d ago First seen · 63 lines · 42 tokens per session scan A 3ea09b317cb0

Subscribe to this mod's changes

tdd-coach is an agent published in the GitHub repository Claude-Code-Community-Ireland/claude-code-resources (10 stars, last pushed 3mo ago), licensed MIT. It adds 42 tokens to every session and 536 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.