tdd

tdd is a skill for Claude Code from poshan0126/dotclaude. It costs 29 tokens per session (738 once invoked), scanned A, original, MIT.

A Test-Driven Development workflow: write a test that fails, write the smallest code that passes it, then clean up the code without changing its behavior.

In plain words
What is it for?
Use it to build features one behavior at a time, starting with tests that describe the expected result.
Why use it?
It turns a feature into small, checked steps and helps catch regressions as the implementation grows.

Skill for Claude Code

Written for Claude Code: disable-model-invocation in frontmatter.

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

Made for: Claude Code.

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/poshan0126/dotclaude/tdd.svg)](https://agentmods.dev/skills/poshan0126/dotclaude/tdd)
Your own site
<a href="https://agentmods.dev/skills/poshan0126/dotclaude/tdd"><img src="https://agentmods.dev/badge/skills/poshan0126/dotclaude/tdd.svg" alt="Measured on agentmods" height="20"></a>
Per session 29 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 738 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.00029 $0.00738
Opus 5 $0.00015 $0.00369
Sonnet 5 $0.00006 $0.00148
Haiku 4.5 $0.00003 $0.00074

Measured 6d ago against content hash 8b549eac62d4, 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 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.

skills/tdd/SKILL.md · 71 lines

How it starts

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

Build the following using strict Test-Driven Development:

Feature: $ARGUMENTS

The TDD Cycle

Repeat this cycle for each behavior. Never skip steps.

Red: Write a Failing Test

  1. Write ONE test for the smallest next behavior (not the whole feature)
  2. The test must:
    • Describe the behavior in its name: should return 0 for empty cart
    • Use Arrange-Act-Assert structure
    • Assert specific values, not vague truths
  3. Run the test. It MUST fail. If it passes, either:
    • The behavior already exists (skip to the next behavior)
    • The test is wrong (it's not testing what you think. Fix it)
  4. Verify the failure message makes sense. It should tell you what's missing

Green: Write the Minimum Code to Pass

  1. Write the simplest, most obvious code that makes the failing test pass
  2. Don't generalize. Don't make it elegant. Don't handle cases the test doesn't cover.
  3. Hardcoding is fine if only one test exists for that path. The next test will force generalization
  4. Run the test. It MUST pass. If it doesn't, fix the code (not the test. The test defined the behavior)
  5. Run ALL tests. Nothing previously passing should break.

Refactor: Clean Up Without Changing Behavior

  1. Look for: duplication, unclear names, functions doing too much, magic values
  2. Make ONE improvement at a time
  3. Run ALL tests after each change. If anything breaks, undo immediately.
  4. Stop refactoring when the code is clean enough. Don't gold-plate

Choosing What to Test Next

Work from simple to complex:

  1. Degenerate cases. Null input, empty collection, zero
  2. Happy path. The simplest valid input
  3. Variations. Different valid inputs that exercise different branches
  4. Edge cases. Boundary values, max sizes, special characters
  5. Error cases. Invalid input, failures, exceptions
  6. Integration. How this connects to the rest of the system

Each test should require a small code change. If you need to write more than ~10 lines of production code to pass a test, the test is too big. Split it.

Read the full file on GitHub · 71 lines

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 · 71 lines · 29 tokens per session scan A 8b549eac62d4

Subscribe to this mod's changes

tdd is a skill published in the GitHub repository poshan0126/dotclaude (860 stars, last pushed 9d ago), licensed MIT. It adds 29 tokens to every session and 738 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.