test-driven-development

test-driven-development is a skill for Claude Code from brunob54/superpowers-orchestrator. It costs 65 tokens per session (1,206 once invoked), scanned A, original, MIT.

A development method in which you write a failing automated test before writing the code that should pass it. TDD means test-driven development.

In plain words
What is it for?
It guides feature work and bug fixes through small red, green, and refactor steps: prove the behavior is missing, implement the minimum fix, then improve the code while keeping tests passing.
Why use it?
It catches missing behavior early and creates a test that protects the change from breaking later. The failing test also confirms that the new behavior was not already present.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the superpowers-orchestrator plugin — 28 skills, 2 agents, 6 hooks shipped together

Good fit It guides feature work and bug fixes through small red, green, and refactor steps: prove the behavior is missing, implement the minimum fix, then improve the code while keeping tests passing.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/brunob54/superpowers-orchestrator/test-driven-development
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/brunob54/superpowers-orchestrator/test-driven-development
Any agent
npx skills add brunob54/superpowers-orchestrator --skill test-driven-development
Clone the repo
git clone --depth 1 https://github.com/brunob54/superpowers-orchestrator

Made for: Claude Code.

Or install superpowers-orchestrator, the plugin that ships this one along with the rest of its 28 skills, 2 agents, 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 test-driven-development

README.md
[![agentmods](https://agentmods.dev/badge/skills/brunob54/superpowers-orchestrator/test-driven-development.svg)](https://agentmods.dev/skills/brunob54/superpowers-orchestrator/test-driven-development)
Your own site
<a href="https://agentmods.dev/skills/brunob54/superpowers-orchestrator/test-driven-development"><img src="https://agentmods.dev/badge/skills/brunob54/superpowers-orchestrator/test-driven-development.svg" alt="Measured on agentmods" height="20"></a>
Per session 65 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,206 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.00065 $0.01206
Opus 5 $0.00032 $0.00603
Sonnet 5 $0.00013 $0.00241
Haiku 4.5 $0.00006 $0.00121

Measured 6d ago against content hash 7916db355eff, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

test-driven-development 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 6d 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/test-driven-development/SKILL.md · 116 lines

How it starts

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

Test-Driven Development

Write failing tests first. Then write minimal code to pass.

Iron Law

No production code before a failing test proves the behavior is missing.

If code was written first, delete it and restart from a test. No exceptions.

This is the hardest rule to follow and the most important. Every rationalization to skip it leads to untested behavior that breaks later.

Cycle

  1. RED: Write one small failing test for one behavior.
  2. VERIFY RED: Run the test. Confirm it fails for the expected reason (not a syntax error or import issue).
  3. GREEN: Write the minimum production code to make the test pass. Nothing more.
  4. VERIFY GREEN: Run the target test and relevant broader tests. Confirm pass.
  5. REFACTOR: Improve structure without changing behavior. Tests must stay green.

Repeat per behavior. Never skip VERIFY steps.

Test Infrastructure Check

Before writing the first test, verify the project has a test runner:

  1. Check for test config: jest.config.*, vitest.config.*, pytest.ini, pyproject.toml [tool.pytest], go.mod, Cargo.toml, .rspec, phpunit.xml
  2. Check for test script: npm test, yarn test, make test, or equivalent
  3. If no test infrastructure exists:
    • Ask the user: "No test runner detected. Should I set up [recommended runner for this language/framework]?"
    • If yes: install and configure the minimal test runner. Write one smoke test to confirm it works.
    • If no: note that TDD requires a test runner and proceed only if the user provides an alternative.

Do not skip this step — a "failing test" that fails because the runner doesn't exist teaches nothing.

Right vs Wrong

Wrong — code first:

1. Write the handler function
2. Write tests to verify it works
3. All tests pass on first run ← this means the tests prove nothing

Right — test first:

1. Write test: POST /users returns 201 with valid body
2. Run test → FAILS (handler doesn't exist yet) ← good
3. Write minimal handler to return 201
4. Run test → PASSES ← test proved the behavior was missing, now it works
5. Refactor handler if needed, tests stay green

Read the full file on GitHub · 116 lines

Files

What ships with it

1 file 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. 6d ago First seen · 116 lines · 65 tokens per session scan A 7916db355eff

Subscribe to this mod's changes

test-driven-development is a skill published in the GitHub repository brunob54/superpowers-orchestrator (3 stars, last pushed 4d ago), licensed MIT. It adds 65 tokens to every session and 1,206 once invoked, about $0.0003 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

testing-principles

Language-agnostic testing principles including TDD, test quality, coverage standards, and test design patterns. Use when writing tests, designing test strategies, or reviewing test quality.

shinpr/claude-code-workflows · 40 tokens

auto-loop

TDD-based autonomous development loop with checkpoint recovery and observability changelog.

claude-world/director-mode-lite · 17 tokens

workflow

Run the complete 5-step development workflow: focus problem → prevent over-development → test-first (TDD) → document → smart commit. Use when starting a new feature, or when the user runs /workflow or asks for the full development flow.

claude-world/director-mode-lite · 52 tokens

test-first

Drive one feature through a strict TDD Red-Green-Refactor cycle with checklists for each phase. Use when implementing new functionality test-first, or when the user runs /test-first.

claude-world/director-mode-lite · 42 tokens

specify-incremental

Decompose a single-feature specification into a linear, phase-by-phase implementation plan. Use this for medium-complexity work — single feature, one or two components — where transparent human-in-the-loop phase review is preferred over factory automation.

rsmdt/the-startup · 53 tokens

building

Implementation skill for writing production code with TDD. Covers the RED-GREEN-REFACTOR cycle, false-RED detection, vertical slicing, scope escalation, test process discipline, and code generation patterns. Loaded by component-builder and bug-investigator.

romiluz13/cc10x · 53 tokens