tdd

tdd is a skill for Claude Code from Guild-Agents/guild. It costs 29 tokens per session (1,073 once invoked), scanned A, original, MIT.

A Test-Driven Development (TDD) skill: a method of writing a failing test before implementation, then making it pass with minimal code and improving the result. It applies the red-green-refactor cycle to features, fixes, refactoring, and behaviour changes.

In plain words
What is it for?
Use it before implementing a feature, bug fix, refactor, or behaviour change when you want to write tests first and proceed through failing, passing, and cleanup stages.
Why use it?
It helps ensure tests describe the intended behaviour instead of merely confirming code that already exists. The required failing test provides evidence that the new test can detect the missing behaviour.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter.

Part of the guild plugin — 8 skills, 6 agents, 1 hook shipped together

Good fit Use it before implementing a feature, bug fix, refactor, or behaviour change when you want to write tests first and proceed through failing, passing, and cleanup stages.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/guild-agents/guild/tdd
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.

Any agent
npx skills add Guild-Agents/guild --skill tdd
Clone the repo
git clone --depth 1 https://github.com/Guild-Agents/guild

Made for: Claude Code.

Or install guild, the plugin that ships this one along with the rest of its 8 skills, 6 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/guild-agents/guild/tdd/github.svg)](https://agentmods.dev/skills/guild-agents/guild/tdd)
Your own site
<a href="https://agentmods.dev/skills/guild-agents/guild/tdd"><img src="https://agentmods.dev/badge/skills/guild-agents/guild/tdd/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for tdd

Your own site · 80×15
<a href="https://agentmods.dev/skills/guild-agents/guild/tdd"><img src="https://agentmods.dev/badge/skills/guild-agents/guild/tdd.svg" alt="Reviewed on agentmods" width="80" 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 1,073 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.01073
Opus 5.5 $0.00012 $0.00429
Sonnet 5.5 $0.00006 $0.00215
Haiku 4.5 $0.00003 $0.00107

Measured 1mo ago against content hash 77ed8c676b86, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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 · 160 lines

How it starts

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

Test-Driven Development (TDD)

Write the test first. Watch it fail. Write minimal code to pass.

Core principle: If you didn't watch the test fail, you don't know if it tests the right thing.

Usage

/tdd

Invoke this skill before implementing any feature or bugfix. It establishes the discipline for your implementation session.

When to use

  • New features
  • Bug fixes
  • Refactoring
  • Behavior changes

Exceptions (ask the user): throwaway prototypes, generated code, configuration files.

The Iron Law

NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST

Write code before the test? Delete it. Start over.

  • Don't keep it as "reference"
  • Don't "adapt" it while writing tests
  • Don't look at it
  • Delete means delete

Red-Green-Refactor

RED - Write Failing Test

Write one minimal test showing what should happen.

Requirements:

  • One behavior per test
  • Clear name that describes behavior
  • Real code (no mocks unless unavoidable)

Run the test. Confirm:

  • Test fails (not errors)
  • Failure message is expected
  • Fails because feature missing (not typos)

Test passes? You're testing existing behavior. Fix the test.

GREEN - Minimal Code

Write the simplest code to pass the test.

Don't add features, refactor other code, or "improve" beyond the test.

Run the test. Confirm:

  • Test passes
  • Other tests still pass
  • Output pristine (no errors, warnings)

Test fails? Fix code, not test.

REFACTOR - Clean Up

After green only:

  • Remove duplication
  • Improve names
  • Extract helpers

Keep tests green. Don't add behavior.

Repeat

Next failing test for next behavior.

Good Tests

Quality Good Bad
Minimal One thing. "and" in name? Split it. test('validates email and domain and whitespace')
Clear Name describes behavior test('test1')
Shows intent Demonstrates desired API Obscures what code should do

Read the full file on GitHub · 160 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. 1mo ago First seen · 160 lines · 29 tokens per session scan A 77ed8c676b86

Subscribe to this mod's changes

tdd is a skill published in the GitHub repository Guild-Agents/guild (4 stars, last pushed 3mo ago), licensed MIT. It adds 29 tokens to every session and 1,073 once invoked, about $0.0001 per session on Opus 5.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

implement

Implement a technical design by decomposing it into dependency-ordered vertical slices, executing each with TDD red-green, reviewing each via an isolated sub-agent, and persisting progress to a state file so work survives session restarts. Use when the user has a tech design (doc or settled conversation) and says…

open-octo/octo-agent · 97 tokens

ralphctl-test-driven-development

Execute-phase skill — drive changes with the red-green-refactor loop; write the failing test before the code that makes it pass; for bug fixes, this is the reproduction test itself. Use for any logic change, bug fix, or behavioural modification; for the full root-cause triage pipeline around an unexpected failure, see…

lukas-grigis/ralphctl · 82 tokens

atomic-tdd

Test-first discipline. Auto-triggers on "let's implement X", "add feature Y", "fix bug Z", "write a test for", "implement", "build out", and similar pre-code-change phrases. Iron rule: failing test exists before production code. Skip only for pure docs/config changes with an explicit "skipped because:" note. Explicit…

damusix/atomic-claude · 142 tokens

ensemble-implement-trd

Complete TRD implementation using git-town workflow with ensemble-orchestrator delegation and TDD methodology (Codex skill for /ensemble:implement-trd).

FortiumPartners/ensemble · 36 tokens

ensemble-full-implement-trd

This command implements a complete Technical Requirements Document (TRD) using modern git-town feature branch workflow. It creates a feature branch and delegates to ensemble-orchestrator which routes to tech-lead-orchestrator for structured TDD-based development including planning, implementation, testing, and quality…

FortiumPartners/ensemble · 65 tokens

implement-is-odd

Implement isOdd following test-driven development.

zernie/vigiles · 12 tokens