tdd

tdd is a skill for Claude Code from aneja5/forge-skills. It costs 56 tokens per session (1,801 once invoked), scanned A, original, MIT.

A test-first workflow for implementing a feature or fixing a bug. It writes one failing test, adds the smallest code that makes it pass, and then improves the code structure.

In plain words
What is it for?
Use it for behavior changes that need tests before merging, including feature work and bug fixes.
Why use it?
It proves behavior before implementation details become fixed and helps prevent changes from silently breaking later.

Skill for Claude Code

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

Part of the forge-skills plugin — 42 skills, 36 commands, 13 agents, 1 hook 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/aneja5/forge-skills/tdd
Any agent
npx skills add aneja5/forge-skills --skill tdd
Clone the repo
git clone --depth 1 https://github.com/aneja5/forge-skills

Made for: Claude Code.

Or install forge-skills, the plugin that ships this one along with the rest of its 42 skills, 36 commands, 13 agents, 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/aneja5/forge-skills/tdd.svg)](https://agentmods.dev/skills/aneja5/forge-skills/tdd)
Your own site
<a href="https://agentmods.dev/skills/aneja5/forge-skills/tdd"><img src="https://agentmods.dev/badge/skills/aneja5/forge-skills/tdd.svg" alt="Measured on agentmods" height="20"></a>
Per session 56 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,801 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.00056 $0.01801
Opus 5 $0.00028 $0.00901
Sonnet 5 $0.00011 $0.00360
Haiku 4.5 $0.00006 $0.00180

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

skills/tdd/SKILL.md · 157 lines

How it starts

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

Test-Driven Development

Overview

Tests verify behavior through public interfaces, not implementation details. One failing test → minimum code to pass → repeat. Never write all tests first. See tests.md for examples and mocking.md for mocking guidelines.

When to Use

  • Implementing a task from .forge/tasks.yaml that needs test-first discipline
  • Any feature or bug fix where behavior must be proven before merging
  • User explicitly asks for TDD or red-green-refactor

When NOT to Use

  • Writing tests retroactively for already-working code — that's a different activity
  • Exploratory spike to understand a problem space — spike first, then TDD the result
  • Config changes with no behavioral assertions possible

Common Rationalizations

Thought Reality
"I'll write tests after the implementation works" Then you test implementation shape, not behavior
"Writing all tests first is TDD" That's horizontal slicing — produces brittle tests
"This behavior is obvious, no test needed" Obvious behaviors are the ones that silently break
"I need to mock my own modules to test this" Your interface boundaries need rethinking
"The test is too hard to write" The interface is too hard to use — fix the interface

Red Flags

  • Test names describe HOW not WHAT ("calls paymentService.process")
  • Test mocks internal collaborators owned by the same codebase
  • Test breaks on refactor when behavior didn't change
  • All tests written before any implementation ("horizontal slicing")
  • Test verifies through side effects or database state instead of interface
  • .forge/testing-strategy.md exists but was not read before writing the first test (its per-module coverage decisions override TDD defaults)

Precedence with testing-strategy

If .forge/testing-strategy.md exists, read it first. It is the authoritative source for per-module test policy. TDD's default is "every behavior gets a test"; the strategy may carve exceptions:

Read the full file on GitHub · 157 lines

Files

What ships with it

5 files 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 First seen · 157 lines · 56 tokens per session scan A bc6f9666a4f2

Subscribe to this mod's changes

tdd is a skill published in the GitHub repository aneja5/forge-skills (3 stars, last pushed 3mo ago), licensed MIT. It adds 56 tokens to every session and 1,801 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-09-03.

Related

Other skills, from other repositories

tdd

Use when implementing features or bug fixes test-first.

Kripu77/software-factory · 13 tokens

link-ticket-to-session

Link the current Claude Code session to a ticket (Linear, Jira, GitHub Issues, or GitHub Pull Requests) and cache its title/status in karma. Use when the user explicitly asks to link, attach, associate, or connect this session to a ticket, issue, or PR — e.g. "/link-ticket-to-session ABC-123", "link this session to…

JayantDevkar/claude-code-karma · 91 tokens

auto-loop

TDD-based autonomous development loop with checkpoint recovery and observability changelog.

claude-world/director-mode-lite · 17 tokens

workflow

Run the complete 5-step development workflow: focus problem → prevent over-development → test-first (TDD) → document → smart commit. Use when starting a new feature, or when the user runs /workflow or asks for the full development flow.

claude-world/director-mode-lite · 52 tokens

test-first

Drive one feature through a strict TDD Red-Green-Refactor cycle with checklists for each phase. Use when implementing new functionality test-first, or when the user runs /test-first.

claude-world/director-mode-lite · 42 tokens

test-audit

Audit test suites for T1-T4 violations using AST analysis, mock detection, and multi-stage synthesis. Invoke when user asks to audit tests, check test quality, find mock violations, review test effectiveness, or inspect test suites for over-mocking. Triggers automatic rewrites when quality gates fail.

QBall-Inc/the-bulwark · 0 tokens