test-driven-development

test-driven-development is a skill for Claude Code from shennawardana23/skillme. It costs 90 tokens per session (1,145 once invoked), scanned A, original, Apache-2.0.

A test-first development workflow that writes a failing test before the code, then makes it pass and cleans up the result. For bug fixes, it first creates a test that reproduces the problem.

In plain words
What is it for?
Use it when adding behavior, fixing bugs, or proving that a change works. It applies to Go, TypeScript, PHP, and other languages.
Why use it?
It prevents code changes from being accepted without evidence that they solve the intended problem. It also helps catch tests that pass immediately because they check the wrong behavior.

Skill for Claude Code

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

Part of the skillme plugin — 148 skills, 2 commands shipped together

Good fit Use it when adding behavior, fixing bugs, or proving that a change works. It applies to Go, TypeScript, PHP, and other languages.

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

Made for: Claude Code.

Or install skillme, the plugin that ships this one along with the rest of its 148 skills, 2 commands.

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/shennawardana23/skillme/test-driven-development/github.svg)](https://agentmods.dev/skills/shennawardana23/skillme/test-driven-development)
Your own site
<a href="https://agentmods.dev/skills/shennawardana23/skillme/test-driven-development"><img src="https://agentmods.dev/badge/skills/shennawardana23/skillme/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/shennawardana23/skillme/test-driven-development"><img src="https://agentmods.dev/badge/skills/shennawardana23/skillme/test-driven-development.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 90 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,145 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.00090 $0.01145
Opus 5.5 $0.00036 $0.00458
Sonnet 5.5 $0.00018 $0.00229
Haiku 4.5 $0.00009 $0.00114

Measured 1mo ago against content hash 6aaeacfd759b, 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 1mo 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 · 103 lines

How it starts

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

Test-Driven Development

Write a failing test before writing the code that makes it pass. For bug fixes, reproduce the bug with a test before attempting a fix. A test that passes on its first run proves nothing — it may be testing the wrong thing.

The cycle

  1. RED — write a test for behavior that doesn't exist yet. Run it. It must fail. If it passes immediately, the test is wrong, not the code.
  2. GREEN — write the minimum code to pass. Don't add behavior the test doesn't require.
  3. REFACTOR — clean up with tests green. Re-run tests after every step.

The Prove-It Pattern (bug fixes)

Do not edit the implementation until a reproduction test exists and its failure has been shown. This applies even to a one-line fix that looks obviously correct — the reproduction test is what proves the bug was real and what proves the fix addresses it, not the author's confidence in the diagnosis. Sequence, every time:

  1. Write a test that reproduces the reported bug.
  2. Run it and show that it fails, with the failure output.
  3. Only then change the implementation.
  4. Re-run the same test and show it now passes.
// Bug report: "CompleteTask doesn't set CompletedAt"
func TestCompleteTask_SetsCompletedAt(t *testing.T) {
	task := createTask(t, "test")
	completed, err := completeTask(task.ID)
	if err != nil {
		t.Fatalf("completeTask: %v", err)
	}
	if completed.CompletedAt.IsZero() {
		t.Fatal("CompletedAt was not set") // fails first — confirms the bug
	}
}

Go specifics

  • Use table-driven tests for multiple input variations — one t.Run subtest per case, named for the behavior, not "case 1".
  • Call t.Parallel() inside the subtest closure, and be aware that the common table-driven footgun is capturing the loop variable by reference across a range in Go versions before 1.22; if this repo's go.mod targets Go < 1.22, shadow the loop variable (tt := tt) before calling t.Parallel(), or Go 1.22+'s per-iteration loop variable semantics make it unnecessary.
  • Prefer the standard library's testing package and testify/require for fatal assertions; reserve testify/assert for checks that should continue after failure to surface multiple problems in one run.

Read the full file on GitHub · 103 lines

Files

What ships with it

2 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. 1mo ago First seen · 103 lines · 90 tokens per session scan A 6aaeacfd759b

Subscribe to this mod's changes

test-driven-development is a skill published in the GitHub repository shennawardana23/skillme (3 stars, last pushed 14d ago), licensed Apache-2.0. It adds 90 tokens to every session and 1,145 once invoked, about $0.0004 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-09-03.

Related

Other skills, from other repositories

test-driven-development

Use when implementing any feature or bugfix, before writing implementation code.

obra/superpowers · 17 tokens

tdd

Enforces strict RED-GREEN-REFACTOR test-driven development — one failing test at a time, minimal code to pass, then refactor against an inline quality checklist and a test-provenance check (provenance runs it alone). Triggers on "tdd", "write tests", "test driven", "red green refactor", "/tdd".

mthines/agent-skills · 78 tokens

ui-animation

A test-first development method that requires a failing test before production code is written. TDD, or test-driven development, repeats a cycle of writing a test, making it pass, and then improving the code.

sutchan/Agent-Skills-Hub · 15 tokens

test-driven-development

A strict test-first method for implementing software changes: write a failing test, confirm that it fails, add the smallest code that passes, and then improve the code. TDD means test-driven development.

sutchan/Agent-Skills-Hub · 23 tokens

writing-plans

A guide for writing detailed implementation plans before changing code. It breaks a specification into small tasks, files to inspect or edit, and ways to test the result; TDD means writing tests before or alongside the code they check.

sutchan/Agent-Skills-Hub · 22 tokens

issue-driven-development

Use for any development work - the master 13-step coding process that orchestrates all other skills, ensuring GitHub issue tracking, proper branching, TDD, code review, and CI verification.

troykelly/claude-skills · 42 tokens