tdd

tdd is a skill for Claude Code from softspark/ai-toolkit. It costs 33 tokens per session (1,357 once invoked), scanned A, original, Apache-2.0.

A test-first development workflow built around writing a failing test, making it pass, and then improving the code. TDD, or test-driven development, uses tests to describe expected behaviour before implementation.

In plain words
What is it for?
Use it when adding features or fixing behaviour through small vertical slices, with tests written before production code.
Why use it?
It keeps implementation tied to observable behaviour and helps prevent code that works only through its internal details.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the ai-toolkit plugin — 113 skills, 44 agents, 14 hooks shipped together

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

Made for: Claude Code.

Or install ai-toolkit, the plugin that ships this one along with the rest of its 113 skills, 44 agents, 14 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/softspark/ai-toolkit/tdd.svg)](https://agentmods.dev/skills/softspark/ai-toolkit/tdd)
Your own site
<a href="https://agentmods.dev/skills/softspark/ai-toolkit/tdd"><img src="https://agentmods.dev/badge/skills/softspark/ai-toolkit/tdd.svg" alt="Measured on agentmods" height="20"></a>
Per session 33 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,357 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.00033 $0.01357
Opus 5 $0.00016 $0.00678
Sonnet 5 $0.00007 $0.00271
Haiku 4.5 $0.00003 $0.00136

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

app/skills/tdd/SKILL.md · 181 lines

How it starts

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

Test-Driven Development

$ARGUMENTS

Build features using strict RED → GREEN → REFACTOR cycles with vertical slices.

Usage

/tdd [feature or behavior to implement]

The Iron Law

NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST

Write code before the test? Delete it. Start over.

No exceptions:

  • Don't keep it as "reference"
  • Don't "adapt" it while writing tests
  • Don't look at it
  • Delete means delete

Implement fresh from tests. Period.

Violating the letter of this rule is violating the spirit of this rule.

Philosophy

Core principle: Tests verify behavior through public interfaces, not implementation details. Code can change entirely; tests shouldn't.

Good tests: Integration-style, exercise real code paths through public APIs. Describe what the system does, not how. Read like specifications. Survive refactors.

Bad tests: Coupled to implementation. Mock internal collaborators, test private methods, verify through external means. Warning sign: test breaks on refactor but behavior is unchanged.

See reference/tests.md for examples, reference/mocking.md for mocking guidelines.

Anti-Pattern: Horizontal Slices

DO NOT write all tests first, then all implementation.

WRONG (horizontal):
  RED:   test1, test2, test3, test4, test5
  GREEN: impl1, impl2, impl3, impl4, impl5

RIGHT (vertical):
  RED→GREEN: test1→impl1
  RED→GREEN: test2→impl2
  RED→GREEN: test3→impl3

Tests written in bulk test imagined behavior. Vertical slices let each test respond to what you learned from the previous cycle.

Workflow

1. Planning

Before writing any code:

  • Confirm with user what interface changes are needed
  • Confirm which behaviors to test (prioritize — you can't test everything)
  • Identify opportunities for deep modules
  • Design interfaces for testability
  • List behaviors to test (not implementation steps)
  • Get user approval

Read the full file on GitHub · 181 lines

Files

What ships with it

5 files 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 · 181 lines · 33 tokens per session scan A a5f986af6215

Subscribe to this mod's changes

tdd is a skill published in the GitHub repository softspark/ai-toolkit (170 stars, last pushed yesterday), licensed Apache-2.0. It adds 33 tokens to every session and 1,357 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-09-03.