handbook: Skill for Claude Code

.claude/skills/tdd/SKILL.md

tdd is a skill for Claude Code from nicograef/handbook. It costs 51 tokens per session (410 once invoked), scanned A, original, MIT.

A test-first development workflow called TDD, or test-driven development, that repeats a red test, a working implementation, and a refactor.

In plain words
What is it for?
Use it to develop features or fix bugs one behavior at a time with tests written before the corresponding implementation.
Why use it?
It connects each code change to a stated behavior and helps catch regressions as the feature is built.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

This is nicograef/handbook's own configuration. It tells Claude Code how to work on handbook itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything handbook configures →

Part of the handbook plugin — 23 skills, 1 agent, 1 hook shipped together

Reuse

Borrowing it

Nothing to install: this file belongs to nicograef/handbook. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/nicograef/handbook/main/.claude/skills/tdd/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/nicograef/handbook

Made for: Claude Code.

Or install handbook, the plugin that ships this one along with the rest of its 23 skills, 1 agent, 1 hook.

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/nicograef/handbook/tdd.svg)](https://agentmods.dev/skills/nicograef/handbook/tdd)
Your own site
<a href="https://agentmods.dev/skills/nicograef/handbook/tdd"><img src="https://agentmods.dev/badge/skills/nicograef/handbook/tdd.svg" alt="Measured on agentmods" height="20"></a>
Per session 51 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 410 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.00051 $0.00410
Opus 5 $0.00026 $0.00205
Sonnet 5 $0.00010 $0.00082
Haiku 4.5 $0.00005 $0.00041

Measured 2d ago against content hash fe62690b6f10, 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 2d 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.

.claude/skills/tdd/SKILL.md · 46 lines

What it actually says

Test-Driven Development

See anti-patterns.md for worked examples of implementation-coupled tests and mocking.md for mocking guidelines.

Workflow

1. Planning

Confirm the interface and the behaviors to test with the user. Apply the deep-module checklist (write-prd/SKILL.md step 5). List behaviors, not implementation steps, and get approval before coding.

You can't test everything. Ask what the interface should look like, and which behaviors matter most. Focus on critical paths and complex logic, not every edge case.

2. Tracer Bullet

Write ONE test that confirms ONE thing about the system:

RED:    Write test for first behavior → test fails
VERIFY: Confirm it fails for the EXPECTED reason (missing feature, not a
        typo or syntax error)
GREEN:  Write minimal code to pass → test passes
VERIFY: Confirm it passes AND all other tests still pass, with clean output

3. Refactor

After all tests pass, look for refactor candidates and run tests after each refactor step. Never refactor while RED — get to GREEN first.

Constraints

  • One test at a time; write only enough code to pass the current test.
  • Don't anticipate future tests or add speculative features.
  • Test observable behavior through public interfaces — never private methods or internal collaborators.
  • Get user approval on the behavior list before writing code.

Quality

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. 2d ago Changed · -57 lines fe62690b6f10
  2. 6d ago First seen · 103 lines · 51 tokens per session scan A ecdfb1aa7af9

Subscribe to this mod's changes

tdd is a skill published in the GitHub repository nicograef/handbook (2 stars, last pushed 3d ago), licensed MIT. It adds 51 tokens to every session and 410 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-08-31.