TDD

Test-driven development with behavior-focused tests, clear seams, and small red-green-refactor steps.

TDD is the individual tdd skill from Matt Pocock’s public [mattpocock/skills](https://github.com/mattpocock/skills) collection. Its official product page is [skills.sh/mattpocock/skills/tdd](https://skills.sh/mattpocock/skills/tdd), and its exact source lives at skills/engineering/tdd/SKILL.md in that repository. The skill is not a testing library and does not run tests itself. Instead, it gives a coding agent rules and vocabulary for planning tests before implementation, writing them, and treating them as a durable part of the codebase. Its core is the red-green cycle: first state a meaningful failing test, then write only enough production code to make that exact test pass, then move to the next small step.

Tests describe observable behavior

The source requires tests at public interfaces rather than against private methods or internal collaboration. A good test reads like a specification of a capability, such as a user being able to check out with a valid cart. The underlying class structure can later change without forcing the test to change with it. That guards against tests which merely narrate the current implementation. The skill specifically warns against mocks that replace internal collaborators, database queries used as a detour around the actual interface, and assertions whose expected value is recalculated with the same logic as the production code. Expected values should come from an independent requirement, a known-good example, or the domain specification.

Agree seams before testing

In the skill’s terminology, a seam is the public boundary where behavior can be observed from outside. Before writing a test, the team should decide which seams are in scope and which are not. That avoids both indiscriminately testing every detail and later arguments about whether a test should exercise the database, an HTTP endpoint, a command-line interface, or another public API. If the repository contains CONTEXT.md or architecture decisions, the skill says to read them first so test names and vocabulary match the domain. That preparation is useful, but it does not replace a shared decision about the paths that matter most.

Work vertically, not horizontally

The skill rejects horizontal work: writing a batch of tests first and building all the implementation afterward easily creates tests for an imagined structure. Instead, it recommends vertical tracer bullets: one behavior, one test, one minimal implementation, then the next thing learned. This limits the size of each change and reveals whether a test really responds to a behavior change. Refactoring is also deliberately separated: it belongs in a review stage after verified changes, not as extra work inside the red-green portion of the cycle.

Installation, provenance, and limits

For an individual installation, the product page gives this command:

Code
npx skills add https://github.com/mattpocock/skills --skill tdd

For Claude Code, the repository names claude plugins install mattpocock-skills as the official plugin route. Before running either path, teams should inspect the current repository content and their own agent configuration; a skill influences how an agent approaches work, but it does not replace domain acceptance or a complete testing strategy. The repository is MIT licensed. Its 254,735 GitHub stars were recorded on 2026-09-07 for the repository as a whole, not for this individual TDD skill. Stars are a point-in-time popularity signal, not evidence of quality, security, or suitability for a particular project.

Who this skill fits

TDD fits teams and individual developers who do not want agents to implement features or bug fixes immediately, but instead want verifiable changes at clear public boundaries. It is particularly useful for domain-rich code, integration points, and changes that should remain protected through refactors. It is less suitable as a replacement for exploratory prototyping, manual UX review, or deciding what the product requirement ought to be. In those situations the skill can still provide structure, but domain clarification and human review remain necessary.

Installation instructions

The TDD skill provides working rules for a coding agent; it does not replace a test runner or domain acceptance. The official detail page at [skills.sh/mattpocock/skills/tdd](https://skills.sh/mattpocock/skills/tdd) describes the individual skill. Its complete source is available in the [mattpocock/skills repository](https://github.com/mattpocock/skills), specifically at skills/engineering/tdd/SKILL.md.

Step 1: Install the individual skill

The product page gives this command for the individual skill:

Code
npx skills add https://github.com/mattpocock/skills --skill tdd

It installs only tdd from the collection. Before running it, the team should check which project directory the selected tool writes to and read the current source. That keeps the instructions the agent will receive traceable.

Step 2: Use the Claude Code plugin

For Claude Code, the repository names this official plugin route:

Code
claude plugins install mattpocock-skills

This route concerns the plugin package rather than only the individual installation. Reload Claude Code or the relevant session after installing if the client does not recognize new skills immediately. The right path depends on whether a project needs only TDD or a broader collection of skills.

Step 3: Agree before the first test

The skill asks teams to agree public test boundaries, its “seams,” before the first test. Record whether a feature is tested through an HTTP response, CLI, UI, or public class API. Read available CONTEXT.md files and architecture decisions so test names use the domain’s language. Then begin with one observable behavior and an expected result from the specification, not a check of private methods.

Work through red and green

First watch the test fail for the expected reason. Then implement only the minimum that makes it pass. Repeat that small vertical step for the next behavior instead of writing a broad suite for an assumed architecture first. Refactoring and review follow verified changes. Every change should rerun the project’s usual test command.

Free
Provider
Matt Pocock
License
MIT
Last reviewed
07.09.2026

Repository and documentation

Categories

Compatible with

Claude Code