tdd

tdd is a skill for Claude Code, Codex from int2t05/engineering-skills. It costs 93 tokens per session (1,172 once invoked), scanned A, original, MIT.

A test-first development workflow that writes a failing test before the code, then makes it pass and improves the design.

In plain words
What is it for?
Use it when adding features, fixing bugs, or changing existing behavior. It guides work through small, complete slices of functionality.
Why use it?
It catches misunderstandings and bugs early by proving that a test can detect the missing behavior before implementation begins.

Skill for Claude CodeCodex

Written for Claude Code and Codex: ${CLAUDE_PLUGIN_ROOT} variable, but also agents/openai.yaml present.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the engineering-skills plugin — 48 skills, 1 agent, 1 hook shipped together

Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add int2t05/engineering-skills
Claude Code
/plugin install engineering-skills

Made for: Claude Code, Codex.

Or install engineering-skills, the plugin that ships this one along with the rest of its 48 skills, 1 agent, 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

README.md
[![agentmods](https://agentmods.dev/badge/skills/int2t05/engineering-skills/tdd.svg)](https://agentmods.dev/skills/int2t05/engineering-skills/tdd)
Your own site
<a href="https://agentmods.dev/skills/int2t05/engineering-skills/tdd"><img src="https://agentmods.dev/badge/skills/int2t05/engineering-skills/tdd.svg" alt="Measured on agentmods" height="20"></a>
Per session 93 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,172 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.00093 $0.01172
Opus 5 $0.00046 $0.00586
Sonnet 5 $0.00019 $0.00234
Haiku 4.5 $0.00009 $0.00117

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

skills/06-test/tdd/SKILL.md · 106 lines

How it starts

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

Test-Driven Development

Write the failing test first. Watch it fail. Write minimal code to pass. Refactor. A test that passes immediately proves nothing — you never saw it catch a bug.

Iron law: No production code without a failing test first. If you wrote code before the test, delete it and start over. "Keep as reference" is testing-after in disguise — delete means delete.

When to use

  • Implementing any new feature or behavior
  • Fixing a bug (reproduce it with a test first — the Prove-It Pattern)
  • Refactoring or changing existing behavior
  • Triggers on "tdd", "test-driven", "red green refactor", "测试驱动开发", "红绿重构", "测试驱动"

Not for: generating tests for already-written code (use test-generation); have a spec and want slice-by-slice feature implementation (use implement — it drives TDD within each slice).

Exceptions (confirm with the user): throwaway prototypes, generated code, pure configuration changes with no behavioral impact — for these, confirm with the user before skipping TDD rather than defaulting either way.

Steps

0. Discover the stack first

The cycle is universal; the commands are not. Before the first test, find how this repo tests: read package.json / pyproject.toml / Cargo.toml / pom.xml / go.mod, check for ./gradlew, Makefile, CI workflows, and existing test-file naming. Never assume npm test — use the repo's own command for every RED, GREEN, and final verification.

1. RED — write one failing test

One behavior, one test, one vertical slice (tracer bullet that responds to what the last cycle taught you). Write the test you wish existed — it describes the desired API, not the implementation. Name it as a specification ("rejects empty email", not "test1").

Agree the seam (public interface under test) before writing. No test at an unconfirmed seam — agreeing seams up front puts testing effort on critical paths instead of every edge case. Use real code over mocks; if you must double a dependency, use the simplest double that works (Real > Fake > Stub > Mock — see references/test-strategy.md). Mocks isolate boundaries, not the thing being tested.

Read the full file on GitHub · 106 lines

Files

What ships with it

5 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. 5d ago First seen · 106 lines · 93 tokens per session scan A f95aea52dee9

Subscribe to this mod's changes

tdd is a skill published in the GitHub repository int2t05/engineering-skills (3 stars, last pushed 4d ago), licensed MIT. It adds 93 tokens to every session and 1,172 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.

Related

Other skills, from other repositories

tdd

This skill should be used when the user asks to "add a feature using TDD", "fix a bug with TDD", "do TDD", "red-green-refactor", "write a failing test first", "use test-driven development", "start TDD", "test first approach", "TDD loop", "TDD cycle", or mentions TDD workflow, baby steps, guessing game, or…

t1/tdder · 102 tokens

wave-execution-framework-v2

Use when executing multi-wave engineering work needing strict TDD, bug-capture/fix split, quality gates, and orchestrated teams with per-agent Opus-advisor / Sonnet-executor model routing.

Harshvardhan86/claude-wave-plugin · 48 tokens

legacy-code-expert

Use this agent when you need to safely modify legacy code that lacks tests. It applies Michael Feathers' dependency-breaking techniques from "Working Effectively with Legacy Code" to identify seams, plan characterization tests, and recommend safe transformation paths.

jikig-ai/soleur · 52 tokens

sonarqube

Levantar SonarQube con Docker, analizar el código y proponer mejoras. También: análisis estático, deuda técnica, code smells, cobertura, calidad automatizada.

686f6c61/alfred-dev · 39 tokens

silver:bugfix

This skill should be used for SB-orchestrated bug investigation and fix: triage → path A/B/C → plan → TDD regression test → execute → review → verify → ship.

alo-exp/silver-bullet · 43 tokens

bugfix

Fixing bugs using a test-first disciplined loop. Use when a bug is reported or discovered and needs a verified fix with minimal blast radius.

rmzi/portable-dev-system · 28 tokens