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
- 1Agree the seams
Before any test, the agent proposes the public boundaries to test, notes what each catches and misses, and asks you to confirm.
- 2Red
It writes one failing test at a confirmed seam.
- 3Green
It writes only enough code to make that test pass, with no speculative features.
- 4Repeat 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-officialCodexUpdates at startup.
codex plugin marketplace add mattpocock/skills
codex plugin add mattpocock-skills@mattpocockGitHub 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@mattpocockGemini 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/productivityCursor, 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
/diagnosing-bugsA gated debugging loop for hard bugsWorks through hard bugs and slowdowns in gated steps, starting from a reproducible failure.Read the guide →/grill-with-docsPlan interviews that build a project glossaryInterviews you about a plan and records agreed terms and decisions as glossary and ADRs.Read the guide →
Also in this pack
/ask-mattSuggests which skill or workflow in the pack fits your current situation.↗/domain-modelingBuilds and maintains the project's glossary and architecture decision records during design talks.↗/implement-specImplements a whole spec on one branch, running subagents across ready tickets.↗/improve-codebase-architectureScans the codebase for simplification opportunities and presents them as a visual HTML report.↗/prWrites a pull request body with a summary, evidence it works and merge risk.↗/prototypeBuilds a throwaway prototype to answer one design or UI question quickly.↗/researchAnswers a question from primary sources and saves cited findings as Markdown in the repo.↗/retroReviews a finished coding session and suggests improvements to the agent's environment.↗/setup-matt-pocock-skillsConfigures a repo once with its issue tracker, triage labels and doc locations.↗/to-specTurns what you already discussed into a spec on your issue tracker.↗/to-ticketsSplits a plan or spec into small tickets that state what blocks what.↗/triageMoves issues and outside PRs through triage states and writes agent-ready briefs.↗
Summary by trendhub. The skill itself lives in mattpocock/skills/skills/engineering/tdd by Matt Pocock (MIT); read the full, current text there.