Skip to content

Test-First Development

Guides an agent through red-green test-first coding at pre-agreed test seams.

Stars
40,512
Licence
MIT
Files
1 file

What it does

When installed, this skill tells the agent to write one failing test at a time, confirm it fails for the expected reason, then write the smallest code change that makes it pass. It requires that the places to test (seams) are agreed with the user before any tests are written, that expected values come from a spec or documented example rather than from the code itself, and that test doubles are only used at the correct boundary. It also asks the agent to report which seams were used and any gaps where nothing testable fits.

Great for

  • Developers who want disciplined test-first coding on a feature or bug fix
  • Teams that already define test boundaries and want an agent to follow them
  • Anyone reproducing a bug with a failing test before attempting a fix

Skip it if

  • Quick prototypes or exploratory scripts where formal test discipline is not wanted, since the loop adds overhead
  • Projects with no agreed test seams: the skill will stop and ask rather than proceed, which may frustrate a casual request
  • Refactoring work, which the skill explicitly excludes from the red-green loop

Try asking

  • “Use TDD to add a discount calculation to the checkout module, one failing test at a time”
  • “Reproduce this bug with a failing test first, then fix it”
  • “Propose test seams for the billing service and say what each one catches and misses”
  • “Implement the user-login validation using red-green steps against the spec in docs/auth.md”
Step-by-step guide: how to use Test-First DevelopmentInstall, first run, examples, tips and FAQs

Install in 3 steps

  1. 1

    Download the skill

    The ZIP contains the 1 original files, the MIT licence and an attribution note.

    tdd.zip
  2. 2

    Add it to your agent

    Claude Code (all projects)

    mkdir -p ~/.claude/skills && unzip tdd.zip -d ~/.claude/skills/

    Claude Code / Agent SDK (this project only)

    mkdir -p .claude/skills && unzip tdd.zip -d .claude/skills/

    Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.

  3. 3

    Ask for the task

    No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.

Get better results

  • Agree the test seams with the agent before the first test is written, and point it to a spec or worked examples for expected values.
  • Expect the agent to stop and report if no approved seam fits the behavior; treat that as a useful finding about the code's testability.
  • The skill refers to other pipeline stages (C2, architecture-survey, refit, repair worker) that may not exist in your setup; outside that pipeline, describe the seams in your own words.

What's inside

  • SKILL.md

Redistributed unmodified from Yeachan-Heo/oh-my-claudecode under the MIT licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.