Skip to content
Skill

TDD

Guides the agent through test-first red-green-refactor development with vertical slices

TDD is an open-source agent skill for developer tools. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

Scripts
None
Platforms
Claude Code, Codex, Cursor
GitHub stars
326K
Last commit
License
MIT
Listing updated

Similar skills

About TDD

This skill sets out the reference rules for test-driven development: what a good test looks like, where tests should sit relative to the public interface, and which anti-patterns to avoid. It asks the agent to agree on the seams under test with the user before writing any test, so testing effort goes to critical paths and complex logic.

The workflow works in vertical slices, one test, one minimal implementation, then repeat, with each test acting as a tracer bullet that informs the next cycle. The agent is told to read a project GLOSSARY.md when present so test names match domain language, and to respect ADRs in the area being changed. Supporting files cover test examples and mocking guidelines, and the skill points to a separate code-review skill for refactoring.

The skill is written as instructions only, with no scripts. It assumes a codebase where the agent can read and write tests and may call a companion codebase-design skill for interface vocabulary.

When your agent uses it

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

From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.

What it can access

From a static check of its 4 files (7 KB) on GitHub on 17 November 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.

Check another skill before you install it.

Install

Copy the skill folder to ~/.claude/skills/tdd to use it in all your projects:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/mattpocock/skills.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/tdd &&
cp -R "$tmp/skills/engineering/tdd" ~/.claude/skills/tdd &&
rm -rf "$tmp"

For one project only, put the folder in .claude/skills/tdd inside it instead.

Claude Code docs on skills

Copy the skill folder to ~/.agents/skills/tdd to use it in every repository:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/mattpocock/skills.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/tdd &&
cp -R "$tmp/skills/engineering/tdd" ~/.agents/skills/tdd &&
rm -rf "$tmp"

For one repository only, put the folder in .agents/skills/tdd inside it instead.

Codex docs on skills

Copy the skill folder to ~/.cursor/skills/tdd to use it in every project:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/mattpocock/skills.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/tdd &&
cp -R "$tmp/skills/engineering/tdd" ~/.cursor/skills/tdd &&
rm -rf "$tmp"

For one project only, put the folder in .cursor/skills/tdd inside it instead.

Cursor docs on skills

Run in a terminal (add --scope workspace to install it for the current workspace only):

gemini skills install https://github.com/mattpocock/skills.git --path skills/engineering/tdd

Or copy the folder to ~/.gemini/skills/tdd yourself.

Gemini CLI docs on skills

For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/tdd:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/mattpocock/skills.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/tdd &&
cp -R "$tmp/skills/engineering/tdd" ~/.copilot/skills/tdd &&
rm -rf "$tmp"

For one project only, put the folder in .github/skills/tdd inside it instead.

VS Code docs on skills

Get the folder:

git clone --depth 1 https://github.com/mattpocock/skills.git

Then copy skills/skills/engineering/tdd into your agent's skills folder as tdd. Agents that support SKILL.md read one folder per skill.

The SKILL.md format

What it does

Test-first loop
Guides writing a failing test before the minimal code needed to make it pass.
Seam agreement
Requires confirming the public boundaries under test with the user before writing tests.
Vertical slicing
Favors one test and one implementation at a time over writing all tests up front.
Anti-pattern checks
Flags implementation-coupled and tautological tests so they can be avoided during the loop.
Domain vocabulary alignment
Asks the agent to use a project glossary and respect architecture decision records.
Mocking and test examples
Points to reference files with examples of good tests and mocking guidelines.

Good for

  • Build a new feature test-first in my existing codebase
  • Fix this bug by writing a failing test before changing the code
  • Plan which seams to cover with tests before we start coding
  • Write integration tests for the checkout flow
  • Review my tests for ones that break on refactors without behavior changes

TDD FAQ

When does TDD trigger?

It triggers when the user wants to build features or fix bugs test-first, mentions red-green-refactor, or asks for integration tests.

Does TDD run any scripts or need special tools?

No scripts are included and no allowed tools are set. It works from instructions and reference files alone.

Does TDD cover refactoring?

No. Refactoring is excluded from the red-green loop and is left to the code-review skill.

What does TDD ask the agent to read first?

It asks the agent to read GLOSSARY.md if it exists and to respect ADRs in the area being touched.

How do I install TDD in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/tdd to use it in all your projects, or to .claude/skills/tdd in one project.

Does TDD run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

Which AI agents can use TDD?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

What are the best alternatives to TDD?

The closest alternatives to TDD are TDD loop, TDD, Mt build, Cpp testing and Django TDD.

Where this comes from

  • Description: from the skill's own SKILL.md.

More from mattpocock/skills

  1. Gives the agent a structured template for writing pull request bodies

    • Open source
    • 326K GitHub stars
    • Developer tools
  2. Recommends which skill or flow in Matt Pocock's engineering set fits your situation

    • Open source
    • 326K GitHub stars
    • Developer tools
  3. Reviews a branch or PR in two parallel passes: repo coding standards and match to the spec

    • Open source
    • 326K GitHub stars
    • Developer tools
  4. Teaches a deep-module vocabulary for designing interfaces, seams and testable code

    • Open source
    • 326K GitHub stars
    • Design and media
  5. Runs a six-phase debugging loop that begins by building a fast pass-fail signal

    • Open source
    • 326K GitHub stars
    • Developer tools
  6. Maintains a project glossary and architecture decision records while a design is discussed

    • Open source
    • 326K GitHub stars
    • Developer tools