Skip to content

Test-Driven Development

Guides an agent through red-green-refactor, writing tests test-first at agreed seams.

Stars
309,658
Licence
MIT
Files
4 files

What it does

When installed, the agent follows a strict test-first loop when you build features or fix bugs: it writes a failing test, then the minimum code to make it pass, one small slice at a time. It also checks that tests target public behavior rather than internal details, avoids tests that just repeat the code's logic, and asks you to agree on the test boundaries (seams) before writing any tests. Think of it as a disciplined testing coach that the agent consults during coding.

Great for

  • Developers who want features or bug fixes built test-first
  • Teams wanting tests that survive refactoring and read like specifications
  • Anyone whose project uses a GLOSSARY.md or ADRs and wants test names to match domain language

Skip it if

  • Quick throwaway scripts or prototypes where the overhead of agreeing seams and writing tests first outweighs the benefit
  • Projects with no test runner set up, since the loop depends on running tests

Try asking

  • “Use TDD to add a checkout discount feature, red-green-refactor style”
  • “Fix this login bug test-first: write a failing test before changing code”
  • “Write integration tests for the order service at the public API seams”
Step-by-step guide: how to use Test-Driven DevelopmentInstall, first run, examples, tips and FAQs

Install in 3 steps

  1. 1

    Download the skill

    The ZIP contains the 4 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

  • Confirm the seams you want tested before asking the agent to write code, since it is designed to wait for your agreement.
  • Point it at your GLOSSARY.md and ADRs so test vocabulary matches your project.
  • Expect it to reference other skills (codebase-design, code-review) that must also be installed for those steps to work.

What's inside

  • agents/openai.yaml
  • mocking.md
  • SKILL.md
  • tests.md

Redistributed unmodified from mattpocock/skills 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.