tdd

tdd is a skill for Claude Code, Cursor from emaraschio/cursor-commands. It costs 68 tokens per session (1,366 once invoked), scanned A, original, MIT.

A test-driven development guide for building software through a repeating cycle: agree on one behavior, write a failing test, then add the smallest code change that makes it pass. TDD means using tests to specify behavior before implementing it.

In plain words
What is it for?
Use it for red-green-refactor sessions when the user can approve each behavior and test before the next one is added.
Why use it?
It turns vague requirements into executable examples and keeps each implementation change focused and verifiable.

Skill for Claude CodeCursor

Written for Claude Code and Cursor: user-invocable in frontmatter, but also installed under .cursor/.

Good fit Use it for red-green-refactor sessions when the user can approve each behavior and test before the next one is added.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/emaraschio/cursor-commands/tdd
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 emaraschio/cursor-commands --skill tdd
Clone the repo
git clone --depth 1 https://github.com/emaraschio/cursor-commands

Made for: Claude Code, Cursor.

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/emaraschio/cursor-commands/tdd/github.svg)](https://agentmods.dev/skills/emaraschio/cursor-commands/tdd)
Your own site
<a href="https://agentmods.dev/skills/emaraschio/cursor-commands/tdd"><img src="https://agentmods.dev/badge/skills/emaraschio/cursor-commands/tdd/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 tdd

Your own site · 80×15
<a href="https://agentmods.dev/skills/emaraschio/cursor-commands/tdd"><img src="https://agentmods.dev/badge/skills/emaraschio/cursor-commands/tdd.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 68 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,366 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.00068 $0.01366
Opus 5 $0.00034 $0.00683
Sonnet 5 $0.00014 $0.00273
Haiku 4.5 $0.00007 $0.00137

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

.cursor/skill-contracts/tdd/SKILL.md · 129 lines

How it starts

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

Test-driven development

Role

You guide a specify → encode → fulfill session (Canon TDD): turn agreed specifications into executable tests one at a time, then write only enough production code to make the current failure go away. The user approves each test and each behavior commit. You do not batch-write tests or ship with a dirty test suite.

When to use

Use when the user invokes /tdd with a draft behavior specification. For broad test coverage without the red-green loop, use write-unit-tests. For full feature delivery from a requirement, use requirement-to-implementation. For fixing a broken suite without new behavior, use run-all-tests-and-fix.

Initial specification

Take the initial specification from the user's message (draft scenarios, examples, or file references). If missing, ask one focused question before proceeding.

Specify-encode-fulfill

At session level:

  1. Specify: agree what to build as concrete scenarios.
  2. Encode: turn each scenario into one automated test (executable specification).
  3. Fulfill: write production code so the current test passes.

At fine grain (repeat until the specification list is empty):

  1. Maintain a numbered specification list for this session.
  2. Encode exactly one test per cycle: one list item as a failing automated test.
  3. Fulfill with code just barely enough to make that failure go away, no speculative coding.
  4. Commit the behavior change before any refactor; never mix behavior changes with refactoring in one commit.
  5. Optionally refactor after the behavior commit, with user approval.
  6. Return to step 2 for the next list item.

Reference: Canon TDD (Kent Beck).

Clarifying specifications

Before writing tests:

  1. Repeat the specifications in your own words (scenario form: under scenario A, X happens; under scenario B, Y happens).
  2. Ask the user to confirm or correct.
  3. If confirmed, proceed; otherwise revise and repeat from step 1.

Read the full file on GitHub · 129 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 · 129 lines · 68 tokens per session scan A 8665bb825e11

Subscribe to this mod's changes

tdd is a skill published in the GitHub repository emaraschio/cursor-commands (9 stars, last pushed 1mo ago), licensed MIT. It adds 68 tokens to every session and 1,366 once invoked, about $0.0003 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.