test-driven-development

test-driven-development is a skill for Claude Code from KhaledSaeed18/dotclaude. It costs 69 tokens per session (1,477 once invoked), scanned A, original, MIT.

A test-first way to build features or fix bugs. TDD means writing a test that fails, adding the smallest code that makes it pass, and then cleaning up the code.

In plain words
What is it for?
Use it for new behaviour, bug fixes, and other code changes in any programming language or test runner. It tests public boundaries rather than private implementation details.
Why use it?
It confirms that a test can actually catch the missing behaviour before the implementation is written.

Skill for Claude Code

Written for Claude Code: a Claude Code plugin manifest.

Part of the engineering plugin — 22 skills, 2 commands, 7 agents shipped together

Good fit Use it for new behaviour, bug fixes, and other code changes in any programming language or test runner. It tests public boundaries rather than private implementation details.

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

Any agent
npx skills add KhaledSaeed18/dotclaude --skill test-driven-development
Clone the repo
git clone --depth 1 https://github.com/KhaledSaeed18/dotclaude

Made for: Claude Code.

Or install engineering, the plugin that ships this one along with the rest of its 22 skills, 2 commands, 7 agents.

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/khaledsaeed18/dotclaude/test-driven-development/github.svg)](https://agentmods.dev/skills/khaledsaeed18/dotclaude/test-driven-development)
Your own site
<a href="https://agentmods.dev/skills/khaledsaeed18/dotclaude/test-driven-development"><img src="https://agentmods.dev/badge/skills/khaledsaeed18/dotclaude/test-driven-development/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 test-driven-development

Your own site · 80×15
<a href="https://agentmods.dev/skills/khaledsaeed18/dotclaude/test-driven-development"><img src="https://agentmods.dev/badge/skills/khaledsaeed18/dotclaude/test-driven-development.svg" alt="Reviewed on agentmods" width="80" 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 1,477 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.00069 $0.01477
Opus 5.5 $0.00028 $0.00591
Sonnet 5.5 $0.00014 $0.00295
Haiku 4.5 $0.00007 $0.00148

Measured 28d ago against content hash cff04a4e4e82, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 28d 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.

.claude-plugin/plugins/engineering/skills/test-driven-development/SKILL.md · 86 lines

How it starts

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

Write the test before the code, watch it fail, then write only enough code to make it pass. The point of seeing it fail first is simple: a test you never watched fail might be testing nothing. Tests written after the fact pass immediately, and a test that has only ever passed proves nothing about whether it would catch the bug.

The one rule

No production code without a failing test that demands it. If you wrote the implementation first, the honest move is to delete it and start from the test: not keep it "as reference" and reconstruct it, which is just testing-after wearing a costume. Implement fresh from what the test asks for.

Exceptions worth asking the user about: throwaway prototypes, generated code, pure config. Everything else (features, bugfixes, behaviour changes) goes test-first. The thought "I'll skip TDD just this once" is the rationalisation this skill exists to catch.

Where the test goes: seams

A seam is the public boundary you test at: the interface where behaviour is observable without reaching inside. Tests live at seams, never against internals: code behind the seam can be rewritten entirely and the tests shouldn't care. The tell that you've tested inside the seam is a test that breaks on a refactor even though behaviour didn't change.

You can't test everything, so decide the seams before writing any test: name the public interface under test and, when the choice isn't obvious, confirm it with the user ("what's the public interface here, and which paths matter most?"). Agreed seams put the testing effort on critical paths and complex logic instead of spraying assertions over every private helper.

The cycle: red → green → refactor

Red: write one failing test

Write a single test for one behaviour, with a name that describes that behaviour. Exercise the real code, not a mock of it: a test that asserts a mock was called tests the mock, not your logic. Mock only what you genuinely can't run (network, clock, filesystem) and only when unavoidable.

Read the full file on GitHub · 86 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. 28d ago Changed · +4 lines cff04a4e4e82
  2. 1mo ago First seen · 82 lines · 69 tokens per session scan A dee0cd68a792

Subscribe to this mod's changes

test-driven-development is a skill published in the GitHub repository KhaledSaeed18/dotclaude (5 stars, last pushed 6d ago), licensed MIT. It adds 69 tokens to every session and 1,477 once invoked, about $0.0003 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

Other skills, from other repositories

python-testing

Expert in Python testing with pytest and test-driven development.

Mindrally/skills · 13 tokens

developing-features-tdd

Build a new feature using strict test-driven development — UNDERSTAND → DESIGN → RED → VERIFY RED → GREEN → VERIFY GREEN → REFACTOR → VALIDATE → REPEAT. Use when building a new feature with TDD, when the user says "TDD this", "tests first", "red green refactor", or asks for feature work that needs to be verifiable…

Cristhianzl/claude-skills-czl · 106 tokens

fixing-bugs

Fix a bug using strict TDD — UNDERSTAND → REPRODUCE (RED) → VERIFY RED → FIX → VERIFY GREEN → VALIDATE → REFACTOR. Use when the user reports a bug, asks to fix something, mentions a Sentry/error/regression, or pastes a stack trace. Bugs require a failing test that proves the bug existed before any code change. For…

Cristhianzl/claude-skills-czl · 105 tokens

tdd

A test-driven development workflow, where a test is written and shown to fail before the smallest implementation is added, then the code is improved. TDD is a way to use tests to guide software changes.

BlueprintOS/analysis-to-delivery · 49 tokens

tdd

Apply when adding new behavior or fixing a bug. Red-green-refactor cycle, test-first discipline, when TDD doesn't pay.

sordi-ai/skill-everything · 29 tokens

agent-evaluation

Use when testing skills, commands, or agents for quality. Use after creating new skills, before deploying agents, or when debugging inconsistent agent behavior. Triggers on "evaluate", "test quality", "is this skill working", or QA of AI workflows.

guia-matthieu/clawfu-skills · 55 tokens