test-driven-development

test-driven-development is a skill for Claude Code, Codex from axiomantic/spellbook. It costs 69 tokens per session (4,804 once invoked), scanned A, original, MIT.

A test-first development method in which a failing test is written before the code that should make it pass. TDD means test-driven development.

In plain words
What is it for?
It helps create a failing test, implement the smallest change needed to pass it, and record evidence from both test runs.
Why use it?
It clarifies the required behavior before implementation and proves that the test can detect the missing behavior.

Skill for Claude CodeCodex

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

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/axiomantic/spellbook/test-driven-development
Any agent
npx skills add axiomantic/spellbook --skill test-driven-development
Clone the repo
git clone --depth 1 https://github.com/axiomantic/spellbook

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 test-driven-development

README.md
[![agentmods](https://agentmods.dev/badge/skills/axiomantic/spellbook/test-driven-development.svg)](https://agentmods.dev/skills/axiomantic/spellbook/test-driven-development)
Your own site
<a href="https://agentmods.dev/skills/axiomantic/spellbook/test-driven-development"><img src="https://agentmods.dev/badge/skills/axiomantic/spellbook/test-driven-development.svg" alt="Measured on agentmods" height="20"></a>
Per session 69 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,804 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.00069 $0.04804
Opus 5 $0.00034 $0.02402
Sonnet 5 $0.00014 $0.00961
Haiku 4.5 $0.00007 $0.00480

Measured 2d ago against content hash 334e2028ab4a, 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 2d 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 · 487 lines

How it starts

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

Test-Driven Development

Invariant Principles

  1. Failure Proves Testing - Test passing immediately proves nothing. Only watching failure proves test detects what it claims.
  2. Order Creates Trust - Tests-first answer "what should this do?" Tests-after answer "what does this do?" Fundamentally different questions.
  3. Minimal Sufficiency - Write exactly enough code to pass. YAGNI violations compound into untested complexity.
  4. Deletion Over Adaptation - Code written before tests is contaminated. Keeping "as reference" means testing after. Delete means delete.

Violating the letter of the rules is violating the spirit of the rules.

Inputs

Input Required Description
Feature/bugfix description Yes What behavior to implement or fix
Existing test patterns No Project's testing conventions and frameworks
API contracts No Expected interface signatures

Outputs

Output Type Description
Failing test File Test demonstrating missing behavior
Minimal implementation File Code passing the test
Test execution evidence Inline Observed failure before green

When to Use

Always: new features, bug fixes, refactoring, behavior changes.

Exceptions (ask human partner; no human available? default: apply TDD):

  • Throwaway prototypes
  • Generated code
  • Configuration files

Thinking "skip TDD just this once"? Stop. That's rationalization.

The Iron Law

NO PRODUCTION CODE WITHOUT FAILING TEST FIRST

Code before test? Delete. Start over. No "reference," no "adapting," no looking at it.

Reasoning Schema

Read the full file on GitHub · 487 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. 2d ago First seen · 487 lines · 69 tokens per session scan A 334e2028ab4a

Subscribe to this mod's changes

test-driven-development is a skill published in the GitHub repository axiomantic/spellbook (10 stars, last pushed 2d ago), licensed MIT. It adds 69 tokens to every session and 4,804 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-09-03.