Skills Prompts

Popular categories

Agent skill · Skills for Real Engineers

/tdd Test-driven development for coding agents

The tdd skill makes a coding agent work test-first: it writes one failing test, adds just enough code to pass it, and repeats in thin slices. Tests are placed only at public seams you have approved, so they describe behavior and keep passing when the internals are refactored.

Works with

  • Claude Code
  • Codex
  • GitHub Copilot
  • Gemini CLI
  • Cursor, OpenCode, Windsurf, Amp and others

Used forTesting and TDD

When to use it

  • You are building a feature or fixing a bug and want each step proven by a test.
  • Your agent keeps writing code that looks right but fails at runtime.
  • You want integration tests at a module's public edges rather than tests of private details.

How it works

  1. 1
    Agree the seams

    Before any test, the agent proposes the public boundaries to test, notes what each catches and misses, and asks you to confirm.

  2. 2
    Red

    It writes one failing test at a confirmed seam.

  3. 3
    Green

    It writes only enough code to make that test pass, with no speculative features.

  4. 4
    Repeat in vertical slices

    One test and one implementation per cycle; refactoring is left to the review stage.

What it steers the agent away from

  • Tests that mock internals and break on every refactor
  • Tautological tests that compute the expected value the same way the code does
  • Writing all tests up front and all implementation afterwards

Install this skill

It installs with the Skills for Real Engineers pack.

Claude CodeInstalled as a plugin that updates itself by default.
claude plugin install mattpocock-skills@claude-plugins-official
CodexUpdates at startup.
codex plugin marketplace add mattpocock/skills
codex plugin add mattpocock-skills@mattpocock
GitHub CopilotWorks in the CLI and VS Code; the README also shows a one-time settings.json entry to enable auto-update.
copilot plugin marketplace add mattpocock/skills
copilot plugin install mattpocock-skills@mattpocock
Gemini CLIRe-run both commands to update.
gemini skills install https://github.com/mattpocock/skills.git --path skills/engineering
gemini skills install https://github.com/mattpocock/skills.git --path skills/productivity
Cursor, OpenCode, Windsurf, Amp and othersCopies editable files into your project; update with npx skills@latest update. Use either this or a plugin per agent, not both.
npx skills@latest add mattpocock/skills -a <agent>

Commands come from the author’s README; check it for changes before you run them.

Questions

Does the tdd skill only work with TypeScript?

No. It describes a way of working rather than a framework, so it applies to any language that has a test runner.

Will the agent refactor during the loop?

No. The skill keeps refactoring out of the red-green cycle and leaves it to the code-review stage.

More guides from Skills for Real Engineers

Also in this pack

All 39 skills →

Summary by trendhub. The skill itself lives in mattpocock/skills/skills/engineering/tdd by Matt Pocock (MIT); read the full, current text there.