test-driven-development

test-driven-development is a skill for Claude Code from boparaiamrit/skills-by-amrit. It costs 43 tokens per session (1,869 once invoked), scanned A, original, MIT.

A development method called test-driven development, or TDD, in which you write a failing test, add the smallest code that passes it, and then improve the code. The cycle is commonly called red, green, refactor.

In plain words
What is it for?
Use it for new features, bug fixes, refactors, and other behaviour changes where automated tests can describe the expected result.
Why use it?
It makes the expected behaviour explicit before implementation and helps catch regressions as the code changes. It also discourages writing untested production code first.

Skill for Claude Code

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

Part of the skills-by-amrit plugin — 33 skills, 34 commands, 9 agents shipped together

Good fit Use it for new features, bug fixes, refactors, and other behaviour changes where automated tests can describe the expected result.

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

Made for: Claude Code.

Or install skills-by-amrit, the plugin that ships this one along with the rest of its 33 skills, 34 commands, 9 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/boparaiamrit/skills-by-amrit/test-driven-development/github.svg)](https://agentmods.dev/skills/boparaiamrit/skills-by-amrit/test-driven-development)
Your own site
<a href="https://agentmods.dev/skills/boparaiamrit/skills-by-amrit/test-driven-development"><img src="https://agentmods.dev/badge/skills/boparaiamrit/skills-by-amrit/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/boparaiamrit/skills-by-amrit/test-driven-development"><img src="https://agentmods.dev/badge/skills/boparaiamrit/skills-by-amrit/test-driven-development.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 43 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,869 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.00043 $0.01869
Opus 5 $0.00022 $0.00934
Sonnet 5 $0.00009 $0.00374
Haiku 4.5 $0.00004 $0.00187

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

How it starts

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

Test-Driven Development (TDD)

Overview

Write the test first. Watch it fail. Write minimal code to pass. Refactor. Repeat.

Core principle: If you didn't watch the test fail, you don't know if it tests the right thing.

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

The Iron Law

NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST

Wrote 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.

When to Use

Always:

  • New features
  • Bug fixes
  • Refactoring
  • Behavior changes

Exceptions (confirm with human partner):

  • Throwaway prototypes
  • Generated code (migrations, scaffolds)
  • Configuration files
  • Static assets

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

When NOT to Use

  • Writing documentation (use writing-documentation)
  • Configuration changes with no behavioral impact
  • Evaluating approaches (use brainstorming first, then TDD the chosen approach)
  • CSS-only styling changes (visual verification, not testable behavior)

Anti-Shortcut Rules

YOU CANNOT:
- Write production code first "to understand the problem" — the test IS how you understand it
- Write multiple tests before any implementation — one test, one implementation cycle
- Skip the RED phase — if you didn't see it fail, you don't know what it tests
- Accept a test that passes without implementation — the test is wrong
- Modify a test to make it pass — the implementation must satisfy the test
- Refactor while tests are RED — GREEN first, then refactor
- Write tests that test implementation details — test BEHAVIOR
- Skip the REFACTOR phase — "it works" is not the end, "it's clean" is

Common Rationalizations

Excuse Reality
"I'll write tests after" You won't. And if you do, they'll test your implementation, not requirements
"It's too simple to test" If it's too simple to test, it's too simple to get wrong. So write the test
"Tests slow me down" Tests slow you down NOW. Bugs slow you down MORE later
"I need to see the code first" TDD IS how you see the code — one test at a time
"The framework handles this" Does it? Prove it with a test
"It works, I checked manually" Manual checking doesn't prevent regressions
"I'll just write a few tests at the end" Post-hoc tests verify implementation, not behavior. They're testing the code you wrote, not the code you need
"This test is too hard to write" If it's too hard to test, the design is wrong. Simplify the interface

Read the full file on GitHub · 223 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. 8d ago First seen · 223 lines · 43 tokens per session scan A ff67d0cd618d

Subscribe to this mod's changes

test-driven-development is a skill published in the GitHub repository boparaiamrit/skills-by-amrit (5 stars, last pushed 5mo ago), licensed MIT. It adds 43 tokens to every session and 1,869 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.