tdd

A test-first development workflow known as TDD, or test-driven development. It requires writing a failing test, adding the smallest code that passes it, and then cleaning up while keeping tests green.

In plain words
What is it for?
Use it when adding features, fixing bugs, or refactoring production code that needs automated tests.
Why use it?
It makes each new line of production code answer a demonstrated requirement and catches mistakes before implementation is treated as finished.

Skill for Claude CodeCodex

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 skills/fusengine/agents/tdd
Any agent
npx skills add fusengine/agents --skill tdd
Clone the repo
git clone --depth 1 https://github.com/fusengine/agents

Made for: Claude Code, Codex.

Per session 33 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 726 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.00033 $0.00726
Opus 5 $0.00016 $0.00363
Sonnet 5 $0.00007 $0.00145
Haiku 4.5 $0.00003 $0.00073

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

plugins/ai-pilot/skills/tdd/SKILL.md · 81 lines

How it starts

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

It never skips a VERIFY step -- a test that passes on first run proves nothing and must be investigated, not accepted.

TDD Skill

Write the test first. Watch it fail. Write minimal code to pass.

The Iron Law

No production code without a failing test first.

Every line of production code must be justified by a test that failed without it. No exceptions. No shortcuts. No "I'll test after."


Agent Workflow

1. DETECT  -> Identify stack, test framework, existing test patterns
2. RED     -> Write ONE failing test for the next behavior
3. VERIFY  -> Run test, confirm it fails for the EXPECTED reason
   IF the test fails for a DIFFERENT reason (syntax error, wrong import, missing fixture) → fix the test itself and re-run. Do NOT proceed to GREEN until the failure matches the intended behavior.
4. GREEN   -> Write the SIMPLEST code that makes the test pass
5. VERIFY  -> Run tests, confirm ALL pass (new + existing)
6. REFACTOR -> Clean up while keeping all tests green
7. REPEAT  -> Next behavior = next failing test

CRITICAL: Never skip VERIFY steps. A test that passes on first run proves nothing.


RED-GREEN-REFACTOR Cycle

See references/red-green-refactor.md for the detailed cycle with rules and verification steps.


Reference Guide

Topic Reference
Full RED-GREEN-REFACTOR cycle red-green-refactor.md
Common mistakes and red flags anti-patterns.md
Per-stack test commands stack-commands.md

Read the full file on GitHub · 81 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 · 81 lines · 33 tokens per session scan A 9868b22627b6

Subscribe to this mod's changes

tdd is a skill published in the GitHub repository fusengine/agents (25 stars, last pushed 29d ago), licensed MIT. It adds 33 tokens to every session and 726 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.