tdd

tdd is a skill for Claude Code, Codex from harness-mini/harness-mini. It costs 47 tokens per session (548 once invoked), scanned A, original, MIT.

A test-first coding workflow based on TDD, or test-driven development: write a failing test, make it pass with the smallest code change, then clean up the code.

In plain words
What is it for?
Use it when implementing issues or features with acceptance criteria, working through one small red-to-green-to-refactor cycle for each criterion.
Why use it?
It prevents untested behavior and keeps each requirement tied to a test that first failed for the expected reason.

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

Made for: Claude Code, Codex.

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/harness-mini/harness-mini/tdd.svg)](https://agentmods.dev/skills/harness-mini/harness-mini/tdd)
Your own site
<a href="https://agentmods.dev/skills/harness-mini/harness-mini/tdd"><img src="https://agentmods.dev/badge/skills/harness-mini/harness-mini/tdd.svg" alt="Measured on agentmods" height="20"></a>
Per session 47 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 548 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.00047 $0.00548
Opus 5 $0.00023 $0.00274
Sonnet 5 $0.00009 $0.00110
Haiku 4.5 $0.00005 $0.00055

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

.claude/skills/tdd/SKILL.md · 41 lines

How it starts

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

Red → Green → Refactor. No step skipped, ever.

The loop (one issue)

  1. RED — write the smallest failing test that expresses the next bit of the issue's required behavior. Run it. Confirm it fails for the right reason.
  2. GREEN — write the minimum code to pass. No more. Run the test; confirm green. Resist building ahead of the test.
  3. REFACTOR — only now, and only under green: clean up via the refactor skill (one named move at a time), re-running tests after each. Apply clean-code standards.
  4. Repeat until the issue's "done" condition holds — see the per-criterion rule below. "Done" is every acceptance criterion has its own test, gone red→green, not "the tests I happened to write are green."

Rules

  • Never write production code without a failing test first.
  • Never refactor while any test is red — green is the safety net.
  • One red→green cycle per acceptance criterion. When the issue/spec enumerates N criteria, each gets its own failing test first — even if code written for an earlier criterion already happens to satisfy it. A criterion with no test that went red is not done; it's untested behavior that passed by luck.
  • Keep each cycle tiny: a cycle that needs a checkpoint mid-way was too big.
  • Trace transitions: bin/trace.sh generator implement test result=red|green.

Discipline against false completion

A passing test you wrote is only as honest as the assertion. Prefer behavior the evaluator can independently verify (run the app, hit the endpoint) over self-referential assertions. The generator does not declare the issue "done" — it hands a green slice to the evaluator.

The "it generalized" trap. A clean implementation often satisfies criteria you never tested — e.g. one regex passing all five of a slug spec after a single test. Behavior-correct, coverage-blind: a later regression on the untested criteria sails through. Lock each criterion in with its own red→green cycle so the safety net has no holes. (This is exactly what the first real Cursor dogfood surfaced — see #29.)

Read the full file on GitHub · 41 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. 5d ago First seen · 41 lines · 47 tokens per session scan A 56906530ce39

Subscribe to this mod's changes

tdd is a skill published in the GitHub repository harness-mini/harness-mini (2 stars, last pushed 24d ago), licensed MIT. It adds 47 tokens to every session and 548 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.

Related

Other skills, from other repositories