test-driven-development

test-driven-development is a skill for Claude Code from johnku2011/boilerplates-with-ai-skills. It costs 41 tokens per session (723 once invoked), scanned A, original, MIT.

A software-development method that writes a test for a behavior before writing the code that implements it. It repeats three steps: make the test fail, make it pass with minimal code, then improve the code.

In plain words
What is it for?
Use it when adding features, fixing bugs, or changing behavior. It guides small test-and-code cycles and running the project’s npm test command.
Why use it?
It helps catch incorrect behavior early and prevents changes from being considered complete while the test suite is failing.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions AGENTS.md.

Good fit Use it when adding features, fixing bugs, or changing behavior. It guides small test-and-code cycles and running the project’s npm test command.

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

Made for: Claude Code.

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/johnku2011/boilerplates-with-ai-skills/test-driven-development/github.svg)](https://agentmods.dev/skills/johnku2011/boilerplates-with-ai-skills/test-driven-development)
Your own site
<a href="https://agentmods.dev/skills/johnku2011/boilerplates-with-ai-skills/test-driven-development"><img src="https://agentmods.dev/badge/skills/johnku2011/boilerplates-with-ai-skills/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/johnku2011/boilerplates-with-ai-skills/test-driven-development"><img src="https://agentmods.dev/badge/skills/johnku2011/boilerplates-with-ai-skills/test-driven-development.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 41 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 723 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00041 $0.00723
Opus 5 $0.00020 $0.00362
Sonnet 5 $0.00008 $0.00145
Haiku 4.5 $0.00004 $0.00072

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

shared/skills/test-driven-development/SKILL.md · 96 lines

How it starts

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

Test-Driven Development

Overview

Write a failing test before production code. Keep each cycle small and verify with this project's test command (see AGENTS.md).

Core principle: If you did not watch the test fail, you do not know if it tests the right thing.

Iron law: No production code without a failing test first.

When to Use

Always:

  • New features
  • Bug fixes
  • Behavior changes

Exceptions (ask your human partner):

  • Throwaway prototypes
  • Generated code
  • Pure configuration with no runtime behavior

Red-Green-Refactor

  1. RED — Write one minimal test for one behavior. Run it; confirm it fails for the expected reason (missing feature, not a typo).
  2. GREEN — Write the smallest code that passes. Run the full suite.
  3. REFACTOR — Clean up while staying green. Do not add behavior.
  4. Repeat for the next increment.

Guidelines

  • Prefer many small tests over one large test.
  • Test observable behavior (HTTP status/body, CLI output, return values), not private implementation details.
  • Run npm test after every change; do not claim completion on a red suite.
  • Keep tests deterministic: no wall-clock timing, network, or ordering flakes.
  • For UI or native screens, unit-test pure logic under src/; verify layout on a simulator only when the change is visual.
  • Use real code in tests; mock only at unavoidable boundaries.

Verification Checklist

Before marking work complete:

  • Every new function or route has a test
  • Watched each new test fail before implementing
  • Failure was due to missing behavior, not setup errors
  • Wrote minimal code to pass each test
  • Full test suite passes
  • No new warnings in test output

If you cannot check every box, you skipped TDD — start over.

Bug Fixes

  1. Write a failing test that reproduces the bug.
  2. Fix with minimal code.
  3. Keep the test — it prevents regression.

Never fix bugs without a test.

Common Rationalizations

Excuse Reality
"Too simple to test" Simple code breaks. A test takes seconds.
"I'll test after" Tests that pass immediately prove nothing.
"Already manually tested" Manual checks are not repeatable in CI.
"Deleting code is wasteful" Unverified code is debt. Delete and rewrite with TDD.

Read the full file on GitHub · 96 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. 10d ago First seen · 96 lines · 41 tokens per session scan A 09198990dece

Subscribe to this mod's changes

test-driven-development is a skill published in the GitHub repository johnku2011/boilerplates-with-ai-skills (240 stars, last pushed 16d ago), licensed MIT. It adds 41 tokens to every session and 723 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-08-30.