tdd

tdd is a skill for Claude Code, Codex 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 CodeCodex

Part of the handoff plugin — 15 skills, 3 hooks 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/abdurrafay2004/handoff/tdd
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, Codex.

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.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.svg" alt="Measured on agentmods" 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. 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.00041 $0.01392
Opus 5 $0.00020 $0.00696
Sonnet 5 $0.00008 $0.00278
Haiku 4.5 $0.00004 $0.00139

Measured 5d ago against content hash 94a25c26b5ab, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, 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 5d 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. 5d 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 1mo ago), licensed MIT. It adds 41 tokens to every session and 1,392 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-31.

Related

Other skills, from other repositories

building

Implementation skill for writing production code with TDD. Covers the RED-GREEN-REFACTOR cycle, false-RED detection, vertical slicing, scope escalation, test process discipline, and code generation patterns. Loaded by component-builder and bug-investigator.

romiluz13/cc10x · 53 tokens

checkpoint

Write the current working state (task, decisions, files touched, open problems, next steps) to .amber/STATE.md so it survives compaction and session restarts. Use when the user asks to checkpoint/save state, before risky long operations, when context feels heavy, or before ending a work session.

yanfeid/claude-amber · 62 tokens

focus

Declare a focus contract for the current task to keep context lean — scopes which files/dirs are in play, bans out-of-scope exploration, and routes broad searches to subagents. Use when starting a task, when the user says "focus on X", or when the session is drifting across unrelated parts of the codebase.

yanfeid/claude-amber · 66 tokens

diet

Audit what is eating the context window in this project (CLAUDE.md size, MCP servers, rules that should be skills) and produce a concrete slimming plan with estimated token savings. Use when the user complains about context filling up fast, frequent compaction, or asks to optimize/reduce context usage.

yanfeid/claude-amber · 61 tokens

resume

Reload saved working state from .amber/ (STATE.md, FOCUS.md, checkpoint.md) and continue the previous task. Use when the user says resume/continue where we left off, or at the start of a session in a project that has an .amber directory.

yanfeid/claude-amber · 55 tokens

plan

基于 spec.md 生成 TDD 驱动的里程碑实施计划。当用户说"生成计划""制定计划""plan""拆分任务""规划里程碑"时使用此技能。分析规格说明,拆分为里程碑,输出到 milestones.json,投影生成 plan.md 供人工审阅。.

IronRookieCoder/auto-pilot · 72 tokens