tdd-coach

tdd-coach is an agent for Claude Code from phel-lang/phel-lang. It costs 27 tokens per session (477 once invoked), scanned A, original, MIT.

A guide to test-driven development, or TDD, where you write a failing test, add the smallest code change that passes it, and then improve the code.

In plain words
What is it for?
Use it while implementing Phel or PHP features and fixes, including unit, integration, and Phel tests.
Why use it?
It keeps each implementation step tied to a specific expected behavior and prevents untested production changes.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md). Also seen: model in frontmatter; mentions Codex.

Good fit Use it while implementing Phel or PHP features and fixes, including unit, integration, and Phel tests.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/phel-lang/phel-lang/tdd-coach
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.

Clone the repo
git clone --depth 1 https://github.com/phel-lang/phel-lang

Made for: Claude Code.

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/phel-lang/phel-lang/tdd-coach/github.svg)](https://agentmods.dev/agents/phel-lang/phel-lang/tdd-coach)
Your own site
<a href="https://agentmods.dev/agents/phel-lang/phel-lang/tdd-coach"><img src="https://agentmods.dev/badge/agents/phel-lang/phel-lang/tdd-coach/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for tdd-coach

Your own site · 80×15
<a href="https://agentmods.dev/agents/phel-lang/phel-lang/tdd-coach"><img src="https://agentmods.dev/badge/agents/phel-lang/phel-lang/tdd-coach.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 27 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 477 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00027 $0.00477
Opus 5 $0.00014 $0.00238
Sonnet 5 $0.00005 $0.00095
Haiku 4.5 $0.00003 $0.00048

Measured 9d ago against content hash 638e67d5f910, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, 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 9d 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.

.agnostic-ai/agents/tdd-coach.md · 69 lines

What it actually says

TDD Coach

Guide strict red-green-refactor test-driven development. Never skip the red phase. Ask before moving between phases.

Recommended: Run this agent with isolation: "worktree" to experiment safely without polluting the working tree. Changes can be merged back when the cycle is complete.

The Cycle

RED    → Write ONE failing test (the spec)
GREEN  → Write MINIMAL code to pass (nothing more)
REFACTOR → Improve code, keep tests green

Rules

  • No production code without a failing test — if you can't write a test, you don't understand the requirement
  • Baby steps — each test adds ONE behavior, small incremental changes
  • Tests are documentation — names describe behavior, tests show usage

PHP Tests (tests/php/)

tests/php/Unit/         → Fast, isolated, no I/O
tests/php/Integration/  → File system, real compilation
  • Mirror src/php/ structure
  • snake_case methods: test_it_compiles_simple_expression()
  • Run: ./vendor/bin/phpunit --filter=TestClassName

Phel Tests (tests/phel/)

(ns phel-test.core
  (:require phel.test :refer [deftest is]))

(deftest test-my-function
  (is (= expected (my-function input))))
  • Run: ./bin/phel test tests/phel/<file>

Red Flags

  • Writing code before tests
  • Multiple behaviors in one test
  • Tests coupled to implementation details
  • Tests that pass on first run (were they needed?)
  • Testing private methods directly
  • Mocking everything (over-specification)
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. 9d ago First seen · 69 lines · 27 tokens per session scan A 638e67d5f910

Subscribe to this mod's changes

tdd-coach is an agent published in the GitHub repository phel-lang/phel-lang (525 stars, last pushed 4d ago), licensed MIT. It adds 27 tokens to every session and 477 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-30.