tdd

tdd is a skill for Claude Code, Codex from jakubsuplicki/codument. It costs 23 tokens per session (336 once invoked), scanned A, original, Apache-2.0.

A guide to test-driven development, or TDD: writing a test that describes one expected behavior, making it pass, then improving the code while keeping the test passing.

In plain words
What is it for?
Use it when implementing a planned change or fixing a bug, with unit tests, integration tests, command-line checks, browser tests, or a focused reproduction script.
Why use it?
It creates a fast feedback loop and checks behavior through the same public interfaces that users or other code rely on.

Skill for Claude CodeCodex

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/jakubsuplicki/codument/tdd
Any agent
npx skills add jakubsuplicki/codument --skill tdd
Clone the repo
git clone --depth 1 https://github.com/jakubsuplicki/codument

Made for: Claude Code, Codex.

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/jakubsuplicki/codument/tdd.svg)](https://agentmods.dev/skills/jakubsuplicki/codument/tdd)
Your own site
<a href="https://agentmods.dev/skills/jakubsuplicki/codument/tdd"><img src="https://agentmods.dev/badge/skills/jakubsuplicki/codument/tdd.svg" alt="Measured on agentmods" height="20"></a>
Per session 23 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 336 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 $0.00023 $0.00336
Opus 5 $0.00012 $0.00168
Sonnet 5 $0.00005 $0.00067
Haiku 4.5 $0.00002 $0.00034

Measured 5d ago against content hash 121de0703b9f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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.

.agents/skills/tdd/SKILL.md · 43 lines

What it actually says

Test-Driven Development

Use this when implementing a planned step or fixing a bug. The principle is feedback first: build the fastest reliable loop that proves the behavior.

Workflow

  1. Read the approved plan step and its mapped docs.
  2. Identify the public interface or user-observable behavior to verify.
  3. Choose the strongest practical feedback loop:
    • Unit test for pure logic
    • Integration test for module boundaries
    • CLI invocation for command behavior
    • Browser or UI harness for interface behavior
    • Repro script for a bug when a proper test seam does not exist yet
  4. Prefer red-green-refactor:
    • Red: write one failing behavior test
    • Green: add the smallest code change that passes it
    • Refactor: improve structure only while tests are green
  5. Repeat one behavior at a time.
  6. Update docs and registry when behavior or source ownership changes.

Test Quality

Good tests verify behavior through public interfaces. They should survive internal refactors.

Avoid tests that:

  • Assert private implementation details
  • Mock internal collaborators when a real boundary is cheap enough
  • Encode imagined future behavior before the current slice teaches you what matters
  • Pass while the user-visible behavior is broken

Rules

  • Do not write all tests first and then all implementation.
  • Do not refactor while red.
  • Do not add speculative behavior for later steps.
  • If no correct test seam exists, document that finding and use the best available feedback loop.
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 · 43 lines · 23 tokens per session scan A 121de0703b9f

Subscribe to this mod's changes

tdd is a skill published in the GitHub repository jakubsuplicki/codument (47 stars, last pushed 14d ago), licensed Apache-2.0. It adds 23 tokens to every session and 336 once invoked, about $0.0001 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-30.

Related

Other skills, from other repositories

tdd-cycle

Execute full TDD red-green-refactor cycle with validation gates. Use when saying "TDD cycle", "test-driven development", or "full TDD workflow".

anton-abyzov/specweave · 33 tokens

tdd

Drive a change through a red-green-refactor loop - failing test first, minimal code to pass, then clean up. Use when implementing a feature or fixing a bug where correctness matters and a test can pin the behavior. Says "TDD", "test first", "red green refactor", "write the test first".

rohitg00/pro-workflow · 68 tokens

test-guide

Test-writing guide for Backend.AI — propose success/exception/edge scenarios first, refine them with the user, then implement while reporting per-scenario verification status. Covers fixtures, withtables, mock repositories, pants test, optional TDD cadence.

lablup/backend.ai · 53 tokens

lfe-tdd

Red-green-refactor quality pass on code the Builder just wrote. Use in the Builder sub-pipeline after lfe-builder completes implementation.

StChiotis/Library-First-Engineering · 32 tokens

init-pipeline

Infrastructure skill for scaffolding pipeline enforcement into a project. Sets up Claude Code hooks (TDD classification gate, git guardrails, optional quality gate), pre-commit hooks (detects existing tools, defaults to Lefthook + Biome + pnpm if none found). Run when setting up a project for pipeline work, and again…

chrislacey89/skills · 105 tokens

triage-issue

Invoked helper skill for deep bug diagnosis, usually delegated from /qa when a reported issue needs root-cause analysis and a TDD fix plan before implementation. Use when the cause is unclear, the bug is a regression, or the user explicitly wants diagnosis. Not for lightweight QA intake (use /qa) or already-clear…

chrislacey89/skills · 77 tokens