tdd

tdd is a skill for Claude Code, Codex from harness-mini/harness-mini. It costs 47 tokens per session (711 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

Written for no agent in particular: nothing here depends on one.

Good fit Use it when implementing issues or features with acceptance criteria, working through one small red-to-green-to-refactor cycle for each criterion.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/harness-mini/harness-mini/tdd
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.

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/github.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/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

Your own site · 80×15
<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="Reviewed on agentmods" width="80" 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 711 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.00047 $0.00711
Opus 5.5 $0.00019 $0.00284
Sonnet 5.5 $0.00009 $0.00142
Haiku 4.5 $0.00005 $0.00071

Measured 4d ago against content hash 938f49f9b28e, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 4d 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/tdd/SKILL.md · 50 lines

How it starts

The opening of the file, as written. The whole thing — 50 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. Cite the runner's assertion name (or the exact failing line). Do not paraphrase the failure.
  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.
  • On red, cite the runner's assertion name or the exact failing line. A paraphrased "it failed for the right reason" does not count.
  • 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.
  • Run the narrowest selection in the loop. Where the repo's runner supports groups, each red→green turn runs only the group(s) containing the new test (tests/run.sh <group>; pick groups with tests/affected.sh <ref> or tests/run.sh --list). The full suite belongs to the gates — checkpoint last-green, evaluate, release — and CI, never to the inner loop.
  • Trace transitions: "$HOME/.harness-mini/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 a later run can decide (the command, the assertion name, a file or JSON fact) over self-referential assertions. The generator does not declare the issue "done" — it reports that evidence. A separate evaluator runs once per plan, not after this slice.

Read the full file on GitHub · 50 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. 4d ago Changed · +4 lines 938f49f9b28e
  2. 18d ago Changed · +5 lines 9840982ecbe1
  3. 24d ago Changed f1bc021461a3
  4. 3mo 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 (7 stars, last pushed yesterday), licensed MIT. It adds 47 tokens to every session and 711 once invoked, about $0.0002 per session on Opus 5.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

tdd compared with skills from other repositories

tdd next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
tddharness-mini/harness-miniSkill7yesterdayMITA47Claude Code, Codex
test-driven-developmentaddyosmani/agent-skillsSkill122k7d agoMITA118Claude Code
skillshare-implement-featurerunkids/skillshareSkill3.5kyesterdayMITA114Claude Code
Vibe Coding MasteryLeoYeAI/openclaw-master-skillsSkill2.2k9d agoMITA61Claude Code, Codex
tddbacknotprop/pstackSkill5.6ktodayMITA52Claude Code, Codex, Cursor
user-story-writermohitagw15856/pm-claude-skillsSkill1.6ktodayMITA79Claude Code, Codex
tdddevcxl/mattpocock-skills-zhSkill568todayMITA39Claude Code, Codex