PlugWiki

tdd Skill for Claude: Build Features and Fix Bugs Test-First

Makes your assistant build features and fix bugs test-first, one failing test at a time, with tests that survive refactors.

Installs
1.2M
on skills.sh
Stars
309.2K
on GitHub
Files
3
besides SKILL.md
Updated
Nov 2026
last repo commit

tdd runs the red-green loop and sets rules for tests worth keeping. Before it writes any test, it asks you to confirm the seams, the public boundaries where behavior is checked. Then it works in vertical slices: one failing test, the minimum code to pass it, repeat.

It triggers when you ask for test-first work, mention red-green-refactor or want integration tests. It bundles no scripts, and it reads GLOSSARY.md and ADRs if your repo has them. Refactoring is left out of the loop on purpose and belongs to a review step.

Good for

  • Developers who want features built test-first with an assistant
  • Anyone fixing a bug and wanting a failing test written before the fix
  • Teams tired of tests that break whenever internals change

Install tdd

Claude Code

  1. 1

    Copy this prompt.

    Install the tdd skill in Claude Code. Run this command:
    
    npx skills add https://github.com/mattpocock/skills --skill tdd
    
    Then check that it loaded and tell me how to use it.
  2. 2

    Paste it into Claude Code. It shows the change and asks before running it.

Requires Node.js.

From its listing on skills.sh. Source.

What's in the skill

When it loads

Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.

Sections in SKILL.md

  1. What a good test is
  2. Seams: where tests go
  3. Anti-patterns
  4. Rules of the loop

Key facts

License
MIT
Last commit
Nov 1, 2026
Files it bundles
SKILL.md, tests.md, mocking.md and a Codex agents/openai.yaml (no scripts)
Needs
Nothing required; codebase-design and code-review skills are referenced
Starts
When you ask for test-first work, or by name
skills.sh audits
Gen Agent Trust Hub pass, Socket pass, Snyk pass

What it includes

  • Tests check behavior through public interfaces, not internals

    A good test reads like a spec, such as "user can checkout with valid cart", and survives refactors. Examples are in tests.md.

    Good tests

  • Agrees the public boundaries to test with you before any test is written

    It proposes each seam with a note on what it catches and misses. No test is written at an unconfirmed seam.

    Read · Seams

  • Names implementation-coupled, tautological and horizontal-slice tests

    Tautological tests recompute the expected value the way the code does. Expected values must come from an independent source.

    Anti-patterns

  • One test, one implementation, repeat

    Each test responds to what the last cycle taught, instead of writing all tests first.

    Write · Vertical slices

  • Write the failing test first, then only enough code to pass

    No speculative features and no refactoring inside the loop.

    Write · Red before green

  • Rules for when mocks are acceptable

    In mocking.md, loaded when tests need doubles.

    Read · Mocking guide

From the official docs

Questions

What does the tdd skill do?

It makes the assistant develop test-first. It confirms what to test with you, writes one failing test, writes just enough code to pass, and repeats. It also sets rules against bad tests: implementation-coupled, tautological and written-all-up-front.

How do I install tdd?

Use the install box above. The skill works on its own. It mentions codebase-design and code-review skills, which are in the same repo and improve results when installed.

Do I have to call it, or does it run on its own?

It can run on its own, because its description tells the assistant to use it for test-first requests and mentions of red-green-refactor. You can also call it by name.

Which test frameworks does it support?

The SKILL.md names none. It sets rules for tests and the loop, and the assistant uses whatever framework your project already has.

Does it do the refactor step?

No. The skill leaves refactoring out of the red-green loop and hands it to a separate review stage.

Is tdd safe?

Yes. It is plain text with no scripts and all three skills.sh audits pass. It does cause the assistant to write test and source files in your project, so review the diffs.

Information

updated Nov 2, 2026

Folder
skills/engineering/tdd

mattpocock/skillsskills.sh

Sources

Docs, issue trackers and discussions this page is built from.

Show all 2
  1. tdd SKILL.md · github.com
  2. tdd on skills.sh · skills.sh

Updated Nov 2, 2026.