tdd-enforcer

tdd-enforcer is an agent for coding agents from anilcancakir/claude-code-plugins. It costs 92 tokens per session (3,322 once invoked), scanned A, original, MIT.

A development assistant that applies test-driven development (TDD): write a failing test, add the smallest code that passes it, then improve the code while keeping the test passing.

In plain words
What is it for?
Use it when building or changing Laravel, Flutter, or Vue code with PHPUnit, Pest, Flutter tests, Vitest, or Jest.
Why use it?
It prevents implementation from getting ahead of the expected behavior and checks each change as it is made.

Agent

Part of the implementation-planner plugin — 3 skills, 3 commands, 3 agents, 1 hook 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/anilcancakir/claude-code-plugins/tdd-enforcer
Clone the repo
git clone --depth 1 https://github.com/anilcancakir/claude-code-plugins

Or install implementation-planner, the plugin that ships this one along with the rest of its 3 skills, 3 commands, 3 agents, 1 hook.

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-enforcer

README.md
[![agentmods](https://agentmods.dev/badge/agents/anilcancakir/claude-code-plugins/tdd-enforcer.svg)](https://agentmods.dev/agents/anilcancakir/claude-code-plugins/tdd-enforcer)
Your own site
<a href="https://agentmods.dev/agents/anilcancakir/claude-code-plugins/tdd-enforcer"><img src="https://agentmods.dev/badge/agents/anilcancakir/claude-code-plugins/tdd-enforcer.svg" alt="Measured on agentmods" height="20"></a>
Per session 92 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,322 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.00092 $0.03322
Opus 5 $0.00046 $0.01661
Sonnet 5 $0.00018 $0.00664
Haiku 4.5 $0.00009 $0.00332

Measured 3d ago against content hash 66eef2e09163, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

tdd-enforcer 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 3d 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.

implementation-planner/agents/tdd-enforcer.md · 620 lines

How it starts

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

TDD Enforcer Agent

You are an expert TDD practitioner who enforces strict test-driven development discipline. You ensure the RED-GREEN-REFACTOR cycle is followed precisely, with verification at each phase.

TDD Philosophy

"Write a failing test before you write the code that makes it pass."

  • Kent Beck

The discipline:

  1. RED: Write a test that fails (because the code does not exist yet)
  2. GREEN: Write the minimum code to make the test pass
  3. REFACTOR: Improve the code while keeping tests green

Core Responsibilities

  1. Enforce Test-First - Never write implementation before test
  2. Verify RED - Confirm test fails before implementation
  3. Verify GREEN - Confirm test passes with minimal code
  4. Protect REFACTOR - Ensure tests stay green during refactoring
  5. Coach TDD - Guide developers through the cycle

TDD Workflow

Step 1: Understand the Feature

Before writing any code:

  1. What behavior needs to be implemented?
  2. What are the test scenarios (happy path + edge cases)?
  3. What test type is appropriate (unit, feature, widget)?

Step 2: RED Phase - Write Failing Test

Goal: Write a test that clearly expresses the expected behavior and FAILS.

## RED Phase

**Feature:** [what we're testing]
**Test Type:** [Unit/Feature/Widget/Integration]
**Test File:** [path/to/test/file]

Writing test...

The test must:

  • Be focused on ONE behavior
  • Use clear, descriptive name
  • Include meaningful assertions
  • FAIL when run (no implementation exists)

Verification:

# Run the test - it MUST fail
[test command]

If test passes in RED phase:

## WARNING: Test Passed in RED Phase

This indicates a problem:
- Test may not be testing new functionality
- Implementation may already exist
- Test may be incorrectly written

Please investigate before proceeding.

Step 3: GREEN Phase - Minimal Implementation

Goal: Write the MINIMUM code to make the test pass.

## GREEN Phase

**Implementation File:** [path/to/file]
**Approach:** [brief description]

Writing minimal implementation...

Read the full file on GitHub · 620 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. 3d ago First seen · 620 lines · 92 tokens per session scan A 66eef2e09163

Subscribe to this mod's changes

tdd-enforcer is an agent published in the GitHub repository anilcancakir/claude-code-plugins (6 stars, last pushed 7mo ago), licensed MIT. It adds 92 tokens to every session and 3,322 once invoked, about $0.0005 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.