tdd

tdd is a skill for Claude Code from AbdurRafay2004/handoff. It costs 41 tokens per session (1,392 once invoked), scanned A, original, MIT.

A test-first development guide for building features and fixing bugs. TDD means writing a test that describes the expected behavior before writing the code.

In plain words
What is it for?
Writing a failing test before each behavior change, reproducing bugs with tests, and checking features through public interfaces.
Why use it?
It helps catch regressions and confirms that tests check what users can do, rather than relying on internal implementation details.

Skill for Claude Code

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

Part of the handoff plugin — 15 skills, 3 hooks shipped together

Good fit Writing a failing test before each behavior change, reproducing bugs with tests, and checking features through public interfaces.

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

Made for: Claude Code.

Or install handoff, the plugin that ships this one along with the rest of its 15 skills, 3 hooks.

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/abdurrafay2004/handoff/tdd/github.svg)](https://agentmods.dev/skills/abdurrafay2004/handoff/tdd)
Your own site
<a href="https://agentmods.dev/skills/abdurrafay2004/handoff/tdd"><img src="https://agentmods.dev/badge/skills/abdurrafay2004/handoff/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/abdurrafay2004/handoff/tdd"><img src="https://agentmods.dev/badge/skills/abdurrafay2004/handoff/tdd.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 1,392 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.00041 $0.01392
Opus 5.5 $0.00016 $0.00557
Sonnet 5.5 $0.00008 $0.00278
Haiku 4.5 $0.00004 $0.00139

Measured 1mo ago against content hash 94a25c26b5ab, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 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/tdd/SKILL.md · 154 lines

How it starts

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

TDD

Part of the Build phase — see the workflow skill for tiers and sequencing.

Tier rule: mandatory for T3 (money, auth, user data, migrations); recommended for T2 on the affected path; skipped for T1 (copy/styling). Within its tier, the discipline is absolute: no production code without a failing test first. Bug fixes always get a failing test reproducing the bug, at any tier — a fix without a test doesn't stick.

Philosophy

Tests verify behavior through public interfaces, not implementation details. Code can change entirely; tests shouldn't.

Good tests are integration-style: they exercise real code paths through public APIs and read like a specification — "user can checkout with valid cart" tells you exactly what capability exists. They survive refactors because they don't care about internal structure.

Bad tests are coupled to implementation: they mock internal collaborators, test private methods, or verify through side channels (querying the database directly instead of using the interface). The warning sign: the test breaks when you refactor but behavior hasn't changed.

Core proof: if you didn't watch the test fail, you don't know it tests the right thing. A test written after the code passes immediately — and passing immediately proves nothing.

Anti-pattern: horizontal slices

Do not write all tests first, then all implementation. Bulk-written tests test imagined behavior — the shape of data structures rather than user-facing behavior — and become insensitive to real changes.

WRONG (horizontal):  RED: test1..test5  →  GREEN: impl1..impl5
RIGHT (vertical):    test1→impl1, test2→impl2, test3→impl3 ...

Vertical slices via tracer bullets: one test → one implementation → repeat. Each test responds to what the previous cycle taught you.

Workflow

1. Plan the behaviors

Read the nearest CONTEXT.md / .handoff/context/ so test names match the project's domain language. Then, before any code:

Read the full file on GitHub · 154 lines

Files

What ships with it

1 file 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 · 154 lines · 41 tokens per session scan A 94a25c26b5ab

Subscribe to this mod's changes

tdd is a skill published in the GitHub repository AbdurRafay2004/handoff (4 stars, last pushed 12d ago), licensed MIT. It adds 41 tokens to every session and 1,392 once invoked, about $0.0002 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-08-31.