tdd
Skill4 starsChanged 5 months agoMITView on GitHub
Use when building any T3 feature or bugfix, recommended for T2 on the affected path — write the failing test before the implementation, one behavior at a time, through public interfaces.
193 other projects use a version of this, 36 of them edited.
Adopted by
Most recently taken up by
- mattpocock/skillstheir own version, first seen Oct 8, 2026
- rafaelob/pragmatic-agent-skillstheir own version, first seen Oct 5, 2026
- AlexisBalayre/claude-code-configtheir own version, first seen Oct 5, 2026
- KroxiDev/engineering-skillstheir own version, first seen Oct 5, 2026
- gaia-react/gaiatheir own version, first seen Oct 5, 2026
- uzairansaruzi/p3-stacktheir own version, first seen Oct 5, 2026
Used with
Projects with it also use make-bot-ui, Poteto Mode and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
eryzerzSkillmake-bot-ui
Use when building a custom UI (page, dashboard, buttons) that should wake a Grok Bot over a webhook, when the user must provide a webhook sender key, or when exposing that UI on Tailscale.
Also in 8 projects that use this
jtarorehSkillPoteto Mode
poteto's agent style for concise, detailed responses, deliberate subagents, unslopped prose, simple code, and verified work. Use for poteto, /poteto-mode, or requests to work in this style.
Also in 5 projects that use this
risadamsSkillwhich-skill
Router over this pack's skills and flows. Ask it "which skill fits X" when you don't remember what's available.
Also in 7 projects that use this
TheOnlyFusionCubeSkillprinciple-attack-the-premise
Inventory who actually owns or exhibits the imbalance, then challenge the shared premise before writing another patch. Use when two or more fixes that share one premise have failed the same gate.
Also in 11 projects that use this
TheOnlyFusionCubeSkillprinciple-test-behavior-not-implementation
Call the system the way its consumer does and assert meaningful observable output; avoid mocks or assertions that only mirror internal calls. Use when when writing or evaluating tests.
Also in 11 projects that use this
shreyT19Skillprinciple-laziness-protocol
Apply when refactoring, evaluating diff size, or tempted to add abstractions, layers, or signal threading. Bias toward deletion and the smallest change that solves the problem.
Also in 22 projects that use this
Other versions193 projects use a version of this.
Word for word · 0
None found.
Edited · 36
- truffle-ai/dexto★ 65023% same
- amazingloft999-droid/mattpocock-skills★ 42222% same
- brianlovin/agent-config★ 37523% same
- ninehills/skills★ 28023% same
- alex-on-ai/WebReaper★ 14922% same
- aurorasoft2/Matt_Pocock_Skills★ 13322% same
- VisualxIntelligence/mattpocok-skills★ 5522% same
- javimosch/supercli★ 5422% same
- xopcai/xopc★ 3722% same
- VoDaiLocz/kilo-kit-mcp★ 2722% same
26 more not listed
Wrote their own version · 157
- mattpocock/skills★ 335ksame name
- Yeachan-Heo/oh-my-claudecode★ 40ksame name
- open-metadata/OpenMetadata★ 15ksame name
- vinvcn/mattpocock-skills-zh-CN★ 4.6ksame name
- parcadei/Continuous-Claude-v3★ 3.9ksame name
- rohitg00/pro-workflow★ 2.9ksame name
- crbnos/carbon★ 2.7ksame name
- codeaholicguy/ai-devkit★ 1.6ksame name
- backnotprop/pstack★ 991same name
- kdlbs/kandev★ 899same name
147 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository15 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- architectureSkill
- briefSkill
- browser-qaSkill
- debugSkill
- delegateSkill
- designSkill
- grill-meSkill
- learnSkill
- planSkill
- securitySkill
- setupSkill
- shipSkill
- verify-doneSkill
- workflowSkill
The file
We split this skill into the rules it gives an agent
6 rules. 0 are common, 4 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 177 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 31
Core proof: if you didn't watch the test fail, you don't know it tests the right thing.
- Very specific: line 53
Read the nearest CONTEXT.md / .handoff/context/ so test names match the project's domain language.
- Very specific: line 60
Look for deep-module opportunities — small interface, deep implementation (see design).
- Distinctive: line 66
Write ONE test confirming ONE thing about the system.
- Distinctive: line 75
Don't anticipate future tests.
- Distinctive: line 76
Verify RED is mandatory: If the new test passes immediately, it's testing existing behavior — fix the test.
“Common” is measured: kept by at least 6 in 10 of the 177 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
TDD
Part of the Build phase — see the workflow skill for tiers and sequencing.
Tier rule: mandatory for T3 (money, auth, user data, migrations); recommended for T2 on the affected path; skipped for T1 (copy/styling). Within its tier, the discipline is absolute: no production code without a failing test first. Bug fixes always get a failing test reproducing the bug, at any tier — a fix without a test doesn't stick.
Philosophy
Tests verify behavior through public interfaces, not implementation details. Code can change entirely; tests shouldn't.
Good tests are integration-style: they exercise real code paths through public APIs and read like a specification — "user can checkout with valid cart" tells you exactly what capability exists. They survive refactors because they don't care about internal structure.
Bad tests are coupled to implementation: they mock internal collaborators, test private methods, or verify through side channels (querying the database directly instead of using the interface). The warning sign: the test breaks when you refactor but behavior hasn't changed.
Core proof: if you didn't watch the test fail, you don't know it tests the right thing. A test written after the code passes immediately — and passing immediately proves nothing.
Anti-pattern: horizontal slices
Do not write all tests first, then all implementation. Bulk-written tests test imagined behavior — the shape of data structures rather than user-facing behavior — and become insensitive to real changes.
WRONG (horizontal): RED: test1..test5 → GREEN: impl1..impl5
RIGHT (vertical): test1→impl1, test2→impl2, test3→impl3 ...Vertical slices via tracer bullets: one test → one implementation → repeat. Each test responds to what the previous cycle taught you.
Workflow
1. Plan the behaviors
Read the nearest CONTEXT.md / .handoff/context/ so test names match the
project's domain language. Then, before any code:
- Confirm with the user what interface changes are needed.
- Confirm which behaviors to test — you can't test everything; focus on critical paths and complex logic, not every edge case. (This is the PM decision: which failures are expensive?)
- Look for deep-module opportunities — small interface, deep implementation
(see
design). - List behaviors, not implementation steps.
2. Tracer bullet
Write ONE test confirming ONE thing about the system. Watch it fail. Write minimal code to pass. This proves the path works end-to-end.
3. Incremental loop
For each remaining behavior: RED → verify it fails for the right reason → GREEN → verify it passes → next.
- One test at a time; only enough code to pass the current test.
- Don't anticipate future tests; no speculative features.
- Verify RED is mandatory. If the new test passes immediately, it's testing existing behavior — fix the test. If it errors (rather than fails), fix the error until it fails correctly.
- Verify GREEN completely: the new test passes, all other tests still pass, output pristine. Test fails → fix the code, not the test.
4. Refactor (only on green)
Extract duplication, improve names, deepen modules (move complexity behind simple interfaces). Run tests after each refactor step. Never refactor while RED. Don't add behavior.
Good vs bad tests
// ✅ Clear name, real behavior, one thing
test('retries failed operations 3 times', async () => {
let attempts = 0;
const operation = () => {
attempts++;
if (attempts < 3) throw new Error('fail');
return 'success';
};
const result = await retryOperation(operation);
expect(result).toBe('success');
expect(attempts).toBe(3);
});
// ❌ Vague name, tests the mock, not the code
test('retry works', async () => {
const mock = jest.fn()
.mockRejectedValueOnce(new Error())
.mockResolvedValueOnce('success');
await retryOperation(mock);
expect(mock).toHaveBeenCalledTimes(2);
});- One behavior per test; "and" in the name means split it.
- Real code over mocks — mock only what's unavoidable (network, clock, true
externals). If you must mock everything, the code is too coupled: inject
dependencies instead. Boundary rules and mock-friendly interface design:
references/mocking.md. - Testing mock behavior instead of real behavior is the classic false positive: the suite goes green while the product is broken.
Per-cycle checklist
[ ] Test describes behavior, not implementation
[ ] Test uses the public interface only
[ ] Test would survive an internal refactor
[ ] Watched it fail, for the expected reason
[ ] Minimal code to pass; nothing speculative
[ ] All tests green, output pristineCommon rationalizations
| Excuse | Reality |
| "Too simple to test" | Simple code breaks. The test takes 30 seconds. |
| "I'll test after" | Tests passing immediately prove nothing. |
| "Already manually tested" | Ad-hoc ≠ systematic. No record, can't re-run. |
| "Deleting X hours is wasteful" | Sunk cost. Keeping unverified code is debt. |
| "Test is hard to write" | Listen to it: hard to test = hard to use. Simplify the interface. |
| "TDD will slow me down" | Test-first is faster than debugging after. |
When stuck
| Problem | Solution |
| Don't know how to test it | Write the wished-for API; write the assertion first. |
| Test too complicated | The design is too complicated. Simplify the interface. |
| Must mock everything | Code too coupled — inject dependencies. |
| Test setup huge | Extract helpers; still complex → simplify the design. |
Adapted from mattpocock-skills (MIT, © 2026 Matt Pocock) and superpowers (MIT, © 2025 Jesse Vincent); see ATTRIBUTION.md.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

