1. Habit
  2. Skills
  3. TDD skill
Matt Pocock · 1.1M installsAI Hero · ex-Vercel · Total TypeScript

TDD skill
Runs by itself, when you start a feature.

Features built test-first, one small step at a time.

Install the TDD skill and make it a habit: follow https://gethabit.dev/skills/mattpocock/tdd.md

  1. 1Copy
  2. 2Paste into Claude Code, Codex or Cursor
  3. 3It runs by itself

1.1M installs300K starsMIT licenceSource on GitHub ↗

TDD

by Matt Pocock · 1.1M installs

The skill

Teaches your agent to write a test first, then the code.

Only when you ask.

Fewer bugs

Features built test-first, one small step at a time. Fewer bugs and safer changes.

↻ Runs by itselfwhen you start a feature

How the habit works.
You don't have to.

Three questionsWhen does it start? How does it check its work? What does it remember?

One run, step by step.
Then it stops.

Stop ruleStops after 5 slices per run or 2 failed tries to turn one test green.

  1. 01

    Read the domain

    Your agent reads GLOSSARY.md if it exists and respects ADRs in the area.

  2. 02

    Agree the seams

    It proposes the public seams to test, each with what it catches and misses, and you confirm.

  3. 03

    Check the interface

    When the interface shape is unclear, it calls the codebase design skill for the vocabulary.

  4. 04

    Red

    It writes one failing test at a confirmed seam.

  5. 05

    Green

    It writes only enough code to make that test pass.

  6. 06

    Next slice

    It marks the slice done on the board and starts the next one.

  7. 07

    Hand to review

    Refactoring waits for the review stage with the code review skill.

What it may do.
Nothing more.

Safe by defaultIt writes only in its own folder and asks you before anything goes out.

Is it for you?
Use it when it fits.

Quick checkRead both lists. If the left one sounds like you, the TDD skill helps.

Use it when

  • ✓ You build a feature test-first
  • ✓ You fix a bug with a test
  • ✓ You want integration tests

Skip it when

  • – You only prototype
  • – The project has no test runner

Questions

TDD skill, answered.

Why confirm seams first?

The skill writes no test at a seam you have not agreed, so effort lands on the paths that matter.

Does it refactor?

No. Refactoring is left out of the red to green cycle and handed to the code review skill.

What tests does it avoid?

Tests tied to internals, tests that recompute the expected value, and writing all tests before any code.

How do I install the TDD skill?

Copy the prompt at the top into your agent. It installs the skill from mattpocock/skills and sets up the habit. Or run npx skills add mattpocock/skills --skill tdd.

Is the TDD skill free?

Yes. It is published under MIT. Habit is free too.

TDD. Now as a habit.

Install the TDD skill and make it a habit: follow https://gethabit.dev/skills/mattpocock/tdd.md

  • Free
  • No account
  • Undo in one line

All Matt Pocock skills →More code skills →

Works in

  • Claude Code
  • Codex
  • Cursor
  • ChatGPT
  • Claude app

Made by Matt Pocock, published under MIT. Habit links to the original and never changes it. Is this your skill?

Copying didn't work here. Select the line and copy it by hand.