# TDD

> TDD is an open-source agent skill for developer tools. Guides the agent through test-first red-green-refactor development with vertical slices. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/mattpocock/skills/tree/main/skills/engineering/tdd
- **Repository:** https://github.com/mattpocock/skills
- **GitHub stars:** 326,295
- **License:** MIT
- **Skill name:** tdd
- **Collection:** https://github.com/mattpocock/skills
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-11-30

## About

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.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/mattpocock/skills/tree/HEAD/skills/engineering/tdd)
- [License: MIT](https://github.com/mattpocock/skills/tree/HEAD/skills/engineering/tdd)

## Features

- **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

## Install

### Claude Code

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

```sh
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.

### Codex

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

```sh
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.

### Cursor

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

```sh
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.

### Gemini CLI

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

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

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

### VS Code

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

```sh
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.

### Other agents

Get the folder:

```sh
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.

## 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.

## Alternatives

- [TDD loop](https://ai-powered.com/skills/tdd-loop): TDD loop is an open-source agent skill for developer tools.
- [TDD](https://ai-powered.com/skills/tdd-michael-denyer): TDD is an open-source agent skill for developer tools.
- [Mt build](https://ai-powered.com/skills/mt-build): Mt build is an open-source agent skill for developer tools.
- [Cpp testing](https://ai-powered.com/skills/cpp-testing): Cpp testing is an open-source agent skill for developer tools.
- [Django TDD](https://ai-powered.com/skills/django-tdd): Django TDD is an open-source agent skill for developer tools.
- [Testing strategy](https://ai-powered.com/skills/testing-strategy): Testing strategy is an open-source agent skill for developer tools.
- [Prd v07 implementation loop](https://ai-powered.com/skills/prd-v07-implementation-loop): Prd v07 implementation loop is an open-source agent skill for developer tools.
- [Develop](https://ai-powered.com/skills/develop): Develop is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/tdd
