tdd

tdd is a skill for Claude Code from mthines/agent-skills. It costs 157 tokens per session (2,178 once invoked), scanned A, original, MIT.

A Test-Driven Development workflow, where a failing test is written first, minimal code is added to pass it, and the code is then improved. TDD is a way to develop software by using tests to define expected behavior.

In plain words
What is it for?
Use it to add features one behavior at a time, write tests for existing code, and verify tests during the red-green-refactor cycle.
Why use it?
It keeps implementation focused on observable behavior and checks that tests are meaningful rather than tailored to the code.

Skill for Claude Code

Written for Claude Code: disable-model-invocation in frontmatter.

Part of the mthines-agent-skills plugin — 54 skills, 4 agents 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/mthines/agent-skills/tdd
Any agent
npx skills add mthines/agent-skills --skill tdd
Clone the repo
git clone --depth 1 https://github.com/mthines/agent-skills

Made for: Claude Code.

Or install mthines-agent-skills, the plugin that ships this one along with the rest of its 54 skills, 4 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 tdd

README.md
[![agentmods](https://agentmods.dev/badge/skills/mthines/agent-skills/tdd.svg)](https://agentmods.dev/skills/mthines/agent-skills/tdd)
Your own site
<a href="https://agentmods.dev/skills/mthines/agent-skills/tdd"><img src="https://agentmods.dev/badge/skills/mthines/agent-skills/tdd.svg" alt="Measured on agentmods" height="20"></a>
Per session 157 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,178 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.00157 $0.02178
Opus 5 $0.00078 $0.01089
Sonnet 5 $0.00031 $0.00436
Haiku 4.5 $0.00016 $0.00218

Measured 6d ago against content hash e7e7def06faf, 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 6d 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/quality/tdd/SKILL.md · 170 lines

How it starts

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

Test-Driven Development

Enforce strict RED-GREEN-REFACTOR discipline. One test at a time. Tests describe WHAT the system does, never HOW.


Input

Check $ARGUMENTS for the feature or behavior description.

  • If $ARGUMENTS contains a feature description, use it directly.
  • If $ARGUMENTS contains "after" (e.g., /tdd after), run in Test-After Mode — write tests for existing code. See rules/test-after.md.
  • If $ARGUMENTS is empty, ask the user what behavior they want to implement or test.

Step 0: Discover Project Test Setup

Before writing any tests:

  1. Find existing tests — glob for **/*.test.*, **/*.spec.*, **/*_test.*, **/test_*.*, **/tests/** to identify the test framework, naming conventions, and directory structure.
  2. Find the test runner — check package.json scripts, Makefile, pyproject.toml, Cargo.toml, go.mod, or similar for the test command.
  3. Adopt existing patterns — match the project's test style exactly: same imports, same assertion library, same file naming, same directory placement. Never introduce a new test framework or pattern.
  4. Identify the run command — store it mentally as TEST_CMD for use throughout the cycle. If you can run a single test file or test case, prefer that over the full suite.

If no tests exist yet, ask the user which framework to use before proceeding.


Step 1: Prioritize by Business Criticality

Before diving into implementation, identify what matters most:

  1. Core user flows first — what are the primary actions users perform? Test those before edge cases.
  2. Ask if unclear — if the feature has multiple behaviors, ask the user to rank them or list the critical paths.
  3. Build a test list — write a numbered list of behaviors to test, ordered by importance. Each item should be a single, specific behavior (not "test the login flow" but "reject login with expired password").

Present the test list to the user for confirmation before starting the cycle.

Read the full file on GitHub · 170 lines

Files

What ships with it

4 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. 6d ago First seen · 170 lines · 157 tokens per session scan A e7e7def06faf

Subscribe to this mod's changes

tdd is a skill published in the GitHub repository mthines/agent-skills (12 stars, last pushed yesterday), licensed MIT. It adds 157 tokens to every session and 2,178 once invoked, about $0.0008 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-31.

Related

Other skills, from other repositories

laravel-tdd

Drives Laravel feature development with Pest or PHPUnit — factories, RefreshDatabase, fakes for queues/mail/notifications, Sanctum auth, and Inertia assertions. Use when writing or fixing a Laravel controller, Eloquent model, policy, job, or notification, when the project uses Pest/PHPUnit, or when asked to test an…

shennawardana23/skillme · 78 tokens

php-codeigniter-tdd

Drives CodeIgniter 4 test development — CIUnitTestCase, DatabaseTestTrait's migrate/refresh/seed lifecycle, the dedicated tests database group, and FeatureTestTrait for HTTP-level assertions. Use when writing or fixing a CodeIgniter 4 test, when a test touches the database, or when a test suite is unexpectedly slow or…

shennawardana23/skillme · 87 tokens

test-driven-development

Drives development with tests written before implementation code, in Go, TypeScript, PHP, or any language. Use when implementing new logic or behavior, fixing a reported bug (write the reproduction test first), modifying existing functionality, or when asked to "add a test," "TDD this," or "prove this works." Use even…

shennawardana23/skillme · 90 tokens

test-driven-development

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

obra/superpowers · 17 tokens

test-driven-development

Drives development with tests. Use when implementing any logic, fixing any bug, or changing any behavior. Use when you need to prove that code works, when a bug report arrives, or when you're about to modify existing functionality.

addyosmani/agent-skills · 50 tokens

ego-browser

Skill "ego-browser" from citrolabs/ego-lite, covering ego-browser, quick start, common helpers, task spaces and control handoff.

citrolabs/ego-lite · 210 tokens