tdd
Skill16 starsChanged 7 months agoMITView on GitHub
Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests. Don't use to backfill tests on existing code (/fortify) or diagnose an unknown bug (/diagnose).
193 other projects use a version of this, 83 of them edited.
Adopted by
Most recently taken up by
- mattpocock/skillsedited, first seen Oct 8, 2026
- rafaelob/pragmatic-agent-skillstheir own version, first seen Oct 5, 2026
- AlexisBalayre/claude-code-configedited, 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 · 83
- mattpocock/skills★ 335k31% same
- crbnos/carbon★ 2.7k32% same
- truffle-ai/dexto★ 65070% same
- nodetool-ai/nodetool★ 55124% same
- mxyhi/ok-skills★ 49232% same
- aws/graph-explorer★ 48432% same
- amazingloft999-droid/mattpocock-skills★ 42269% same
- brianlovin/agent-config★ 37570% same
- bighadj22/codflow★ 33832% same
- ninehills/skills★ 28078% same
73 more not listed
Wrote their own version · 110
- 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
- codeaholicguy/ai-devkit★ 1.6ksame name
- backnotprop/pstack★ 991same name
- kdlbs/kandev★ 899same name
- codewithmukesh/dotnet-claude-kit★ 750same name
- stevesolun/ctx★ 588same name
100 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 repository38 other files it gives its agents.
- AGENTS.mdAGENTS.md
- a11y-auditSkill
- architecture-auditSkill
- buildSkill
- codebase-designSkill
- code-reviewSkill
- commitSkill
- create-adrSkill
- create-pull-requestSkill
- create-skillSkill
- deps-auditSkill
- diagnoseSkill
- domain-modelingSkill
- e2eSkill
- explain-codeSkill
- fortifySkill
- frontend-ui-engineeringSkill
- grill-meSkill
- handoffSkill
- hardenSkill
- i18nSkill
- perf-auditSkill
- planSkill
- prose-fixSkill
- prototypeSkill
- researchSkill
- reviewSkill
- reviseSkill
- safe-repoSkill
- shipSkill
- source-drivenSkill
- specSkill
- teachSkill
- testSkill
- triage-reviewSkill
- validate-codeSkill
- visual-reviewSkill
- visual-validateSkill
The file
We split this skill into the rules it gives an agent
8 rules. 0 are common, 6 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 177 edited versions we read keep these.
6
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
- Very specific: line 66
When exploring the codebase, read CONTEXT.md (if it exists) so that test names and interface vocabulary match the project's domain …
- Distinctive: line 70
Ask: "What's the public interface, and which seams should we test?"
- Distinctive: line 74
Before writing any code:
- Distinctive: line 86
Write ONE test that confirms ONE thing about the system:
- Distinctive: line 107
Only enough code to pass current test
- Distinctive: line 108
Don't anticipate future tests
- Distinctive: line 109
Keep tests focused on observable behavior
- Very specific: line 113
Only once GREEN — never while RED.
“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
Test-Driven Development
Philosophy
Core principle: Tests should 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. They describe what the system does, not how it does it. A good test reads like a specification - "user can checkout with valid cart" tells you exactly what capability exists. These tests 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 external means (like querying a database directly instead of using the interface). The warning sign: your test breaks when you refactor, but behavior hasn't changed. If you rename an internal function and tests fail, those tests were testing implementation, not behavior.
See tests.md for examples and mocking.md for mocking guidelines.
Anti-Pattern: Horizontal Slices
DO NOT write all tests first, then all implementation. This is "horizontal slicing" - treating RED as "write all tests" and GREEN as "write all code."
This produces crap tests:
- Tests written in bulk test imagined behavior, not actual behavior
- You end up testing the shape of things (data structures, function signatures) rather than user-facing behavior
- Tests become insensitive to real changes - they pass when behavior breaks, fail when behavior is fine
- You outrun your headlights, committing to test structure before understanding the implementation
Correct approach: Vertical slices via tracer bullets. One test → one implementation → repeat. Each test responds to what you learned from the previous cycle. Because you just wrote the code, you know exactly what behavior matters and how to verify it.
WRONG (horizontal):
RED: test1, test2, test3, test4, test5
GREEN: impl1, impl2, impl3, impl4, impl5
RIGHT (vertical):
RED→GREEN: test1→impl1
RED→GREEN: test2→impl2
RED→GREEN: test3→impl3
...Anti-Pattern: Tautological Tests
The assertion recomputes the expected value the same way the code does — expect(add(a, b)).toBe(a + b), a snapshot derived by hand via the same logic, a constant asserted equal to itself. The test passes by construction and can never disagree with the code.
Expected values must come from an independent source of truth: a known-good literal, a worked example, the spec. See tests.md for an example.
Workflow
0. Discover the stack
The TDD cycle is universal; the commands are not. Before the first test, discover how this repository tests and use its commands for every RED and GREEN:
- Build system:
package.json,pyproject.toml,go.mod,Cargo.toml,Makefile - Checked-in wrappers first:
./gradlew,./mvnw,make test, repo scripts — never a globally installed tool the repo doesn't use - The focused-single-test command vs the full-suite command — run focused during the loop, full suite once before completion
- Where tests live, how they're named, what patterns neighboring tests follow
- CI workflows show the commands that actually gate merges
Never assume npm test.
1. Planning
When exploring the codebase, read CONTEXT.md (if it exists) so that test names and interface vocabulary match the project's domain language, and respect ADRs in the area you're touching.
A seam is the public boundary you test at: the interface where you observe behavior without reaching inside. Before writing any test, write down the seams under test and confirm them with the user:
Ask: "What's the public interface, and which seams should we test?"
No test is written at an unconfirmed seam.
Before writing any code:
- Confirm the seams under test with the user
- Confirm with user which behaviors to test (prioritize)
- Identify opportunities for deep modules (small interface, deep implementation) — run the
/codebase-designskill for the vocabulary and the testability checks - List the behaviors to test (not implementation steps)
- Get user approval on the plan
You can't test everything. Agreeing the seams up front is how testing effort lands on critical paths and complex logic, not every possible edge case.
2. Tracer Bullet
Write ONE test that confirms ONE thing about the system:
RED: Write test for first behavior → test fails
GREEN: Write minimal code to pass → test passesThis is your tracer bullet - proves the path works end-to-end.
3. Incremental Loop
For each remaining behavior:
RED: Write next test → fails
GREEN: Minimal code to pass → passesRules:
- One test at a time
- Only enough code to pass current test
- Don't anticipate future tests
- Keep tests focused on observable behavior
4. Refactor
Only once GREEN — never while RED. Extract duplication, deepen modules (/codebase-design for the vocabulary), and ask what the new code reveals about existing code. Run tests after each step.
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.

