tdd

tdd is a skill for Claude Code from epicsagas/epic-harness. It costs 35 tokens per session (850 once invoked), scanned A, original, Apache-2.0.

A software development method that requires a failing test before production code, then follows a Red–Green–Refactor cycle: write a failing test, make it pass, and clean up the code.

In plain words
What is it for?
Use it when adding features or fixing bugs, with tests describing the expected behavior before implementation.
Why use it?
It reduces the risk of implementing the wrong behavior and helps catch regressions while changing code.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions subagents.

Part of the epic plugin — 27 skills, 6 hooks shipped together

Good fit Use it when adding features or fixing bugs, with tests describing the expected behavior before implementation.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/epicsagas/epic-harness/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 epicsagas/epic-harness --skill tdd
Clone the repo
git clone --depth 1 https://github.com/epicsagas/epic-harness

Made for: Claude Code.

Or install epic, the plugin that ships this one along with the rest of its 27 skills, 6 hooks.

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/epicsagas/epic-harness/tdd.svg)](https://agentmods.dev/skills/epicsagas/epic-harness/tdd)
Your own site
<a href="https://agentmods.dev/skills/epicsagas/epic-harness/tdd"><img src="https://agentmods.dev/badge/skills/epicsagas/epic-harness/tdd.svg" alt="Measured on agentmods" height="20"></a>
Per session 35 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 850 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.00035 $0.00850
Opus 5 $0.00017 $0.00425
Sonnet 5 $0.00007 $0.00170
Haiku 4.5 $0.00003 $0.00085

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

How it starts

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

TDD — Test-Driven Development

Iron Law

NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST. Violating the letter of this process is violating the spirit of this process.

Process

Red → Green → Refactor

  1. Red: Write a failing test that describes the desired behavior

    • Test name should read like a spec: it("returns 401 when token is expired") (reason: the test name IS your specification — it must communicate intent to future readers)
    • Run the test — confirm it fails for the right reason (reason: a test that fails for the wrong reason gives false confidence)
  2. Green: Write the minimum code to make the test pass

    • Do not write more than needed — because premature optimization is the root of all evil; make it work first
    • Do not optimize yet — because optimization without a passing test is speculation, not engineering
    • Run the test — confirm it passes (reason: a passing test is the only proof the code works)
  3. Refactor: Clean up without changing behavior

    • Extract duplicates, rename for clarity, simplify — because readability matters more than cleverness
    • Run tests again — must still pass (reason: refactoring without re-running tests is just renaming bugs)

Cycle

Repeat for each behavior. One test, one behavior, one cycle — because scope creep in a single test cycle leads to unverified code.

When to Trigger

  • /go subagents: always — because autonomous agents without TDD produce unverified code
  • New function or method being written
  • Bug fix (write regression test first — because a bug that happened once will happen again without a guard)

Anti-Rationalization

Excuse Rebuttal What to do instead
"This is too simple for tests" Simple code still breaks. The Beyonce Rule applies: if you liked it, you should have put a test on it. Write the test anyway — it takes 30 seconds and catches edge cases.
"I'll write tests after" That's documentation, not specification. Tests written after confirm what you built; tests written before define what you should build. Write the test first. If you can't describe the behavior, you don't understand the requirement.
"Tests slow me down" 15 minutes of TDD saves hours of debugging regression bugs later. Time the cycle — Red-Green-Refactor is usually faster than debug-after-deploy.
"I'll just test manually" Manual tests don't catch regressions. Automate it once, save hours forever. Write an automated test that runs on every commit.
"The types guarantee correctness" Types check shape, not logic. add(a,b) can still return a-b. Write a test that verifies the actual business rule, not just the type signature.
"I need to see the API shape first" Spike freely, then delete and rebuild test-first. A throwaway spike is research, not implementation. Spike, discard, then TDD the real implementation from what you learned.

Read the full file on GitHub · 65 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. 7d ago First seen · 65 lines · 35 tokens per session scan A d67e81436b05

Subscribe to this mod's changes

tdd is a skill published in the GitHub repository epicsagas/epic-harness (18 stars, last pushed 2d ago), licensed Apache-2.0. It adds 35 tokens to every session and 850 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.

Related

Other skills, from other repositories

test-writer

Writes tests that fail before a fix and pass after it.

rysh-ai/rysh-cli-code · 16 tokens

tdd

Test-driven development — write the failing test first, then the code. Triggers on TDD, test first, write tests, test-driven.

AyushParkara/syntra · 32 tokens

taiyi-dev

A software-development stage that implements planned tasks using test-driven development, or TDD: write a failing test, make it pass, then improve the code. It checks the task plan, dependencies, file boundaries, and required completion evidence.

Dong90/oh-my-taiyiforge · 21 tokens

tdd-cycle

Execute full TDD red-green-refactor cycle with validation gates. Use when saying "TDD cycle", "test-driven development", or "full TDD workflow".

anton-abyzov/specweave · 33 tokens

atomic-tdd

Test-first discipline. Auto-triggers on "let's implement X", "add feature Y", "fix bug Z", "write a test for", "implement", "build out", and similar pre-code-change phrases. Iron rule: failing test exists before production code. Skip only for pure docs/config changes with an explicit "skipped because:" note. Explicit…

damusix/atomic-claude · 142 tokens

ralphctl-test-driven-development

Execute-phase skill — write the failing test before the code that makes it pass; for bug fixes, this is the reproduction test itself. Use for any logic change, bug fix, or behavioural modification; for the full root-cause triage pipeline around an unexpected failure, see ralphctl-debugging-and-error-recovery.

lukas-grigis/ralphctl · 72 tokens