tdd
Skill4 starsChanged 14 days agoMITView on GitHub
When a bug can be caught by an inexpensive local test, write that narrow failing test before the fix, check that it fails because of the bug, then fix the code and watch the test pass. Use on /tdd, "write a failing test first", "add a regression test", or when a bug has an obvious inexpensive test location.
194 other projects use a version of this.
Adopted by
Most recently taken up by
- ishandutta2007/Awesome-Claude-Skillstheir own version, first seen Nov 8, 2026
- trpc/trpctheir own version, first seen Nov 8, 2026
- wowyuarm/dsh-agent-teamtheir own version, first seen Nov 8, 2026
- Contexera/dsh-agent-teamtheir own version, first seen Nov 8, 2026
- Dimon94/dveritytheir own version, first seen Nov 8, 2026
- Dimon94/skillstheir own version, first seen Nov 8, 2026
Used with
Projects with it also use capture-learning-tools, design-frontend-dev and 3 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.
The-Vibe-CompanySkillcapture-learning-tools
Turn technical conversations, bugs, CI failures, review comments,
Also in 5 projects that use this
The-Vibe-CompanySkilldesign-frontend-dev
Clean Impeccable frontend design skill. Use when the user wants to
Also in 5 projects that use this
tristanphvnSkillketchup-video
Catch the user up like /keel:ketchup, with a short silent video of slides for what happened and the waiting calls as text under it. Use for /keel:ketchup-video.
Also in 14 projects that use this
- +2 more from The-Vibe-Company
Other versions194 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 194
- mattpocock/skills★ 309ksame name
- trpc/trpc★ 41ksame name
- Yeachan-Heo/oh-my-claude-sisyphus★ 41ksame name
- Yeachan-Heo/oh-my-claudecode★ 41ksame name
- QuivrHQ/quivr★ 40ksame name
- The-Vibe-Company/quivr★ 40ksame name
- ccusage/ccusage★ 19ksame name
- ryoppippi/ccusage★ 19ksame name
- MODSetter/SurfSense★ 17ksame name
- GreyDGL/PentestGPT★ 16ksame name
184 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 repository61 other files it gives its agents.
- architectSkill
- arenaSkill
- automate-meSkill
- benchmark-checklistSkill
- blast-radiusSkill
- broSkill
- catch-upSkill
- catch-up-videoSkill
- correctSkill
- create-formal-verification-skillSkill
- create-verification-skillSkill
- figure-it-outSkill
- howSkill
- interrogateSkill
- in-your-own-wordsSkill
- maintain-formal-verification-skillSkill
- maintain-verification-skillSkill
- make-bot-uiSkill
- no-commentsSkill
- principle-attack-the-premiseSkill
- principle-boundary-disciplineSkill
- principle-build-the-leverSkill
- principle-encode-lessons-in-structureSkill
- principle-exhaust-the-design-spaceSkill
- principle-experience-firstSkill
- principle-explain-the-numberSkill
- principle-fix-root-causesSkill
- principle-foundational-thinkingSkill
- principle-guard-the-context-windowSkill
- principle-laziness-protocolSkill
- principle-make-operations-idempotentSkill
- principle-migrate-callers-then-delete-legacy-apisSkill
- principle-minimize-reader-loadSkill
- principle-model-the-domainSkill
- principle-never-block-on-the-humanSkill
- principle-outcome-oriented-executionSkill
- principle-prove-it-worksSkill
- principle-redesign-from-first-principlesSkill
- principle-separate-before-serializing-shared-stateSkill
- principle-sequence-verifiable-unitsSkill
- principle-subtract-before-you-addSkill
- principle-test-behavior-not-implementationSkill
- principle-treat-input-as-untrustedSkill
- principle-type-system-disciplineSkill
- recallSkill
- reflectSkill
- security-reviewSkill
- setup-endostackSkill
- sharpenSkill
- show-me-your-workSkill
- statechartSkill
- swarmSkill
- tarique-helpSkill
- tarique-modeSkill
- teachSkill
- technical-writingSkill
- threat-modelSkill
- try-endostackSkill
- typescript-best-practicesSkill
- unslopSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
8 rules. 0 are common, 8 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 186 edited versions we read keep these.
8
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
No new test is better than a harmful one.
- Distinctive: line 25
Pin the defect: Write down the expected behavior, the observed behavior, the code path involved, and the smallest input that reproduces it.
- Distinctive: line 26
Pick the tightest check: Use the test style the codebase already uses near that path: unit, component, integration, or a regression suite.
- Distinctive: line 38
Never edit a test so it agrees with wrong code.
- Distinctive: line 39
Never loosen an existing assertion unless the intended behavior really changed.
- Distinctive: line 40
Keep the new test about this defect.
- Distinctive: line 42
If the bug hints at a family of related failures, land the narrow regression test first.
- Distinctive: line 50
if you could not show a failure first, the reason, and which nearest check you used in its place.
“Common” is measured: kept by at least 6 in 10 of the 186 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
Turn the defect into a failing test, watch it fail for the reason you expect, change the code, and watch the same test pass. Do this only when a narrow local test is cheap. When it is not, run the nearest executable check instead of forcing a bad test.
When to skip writing a test
No new test is better than a harmful one. Skip the test, and go to the fallback below, when the test would:
- mainly assert on mocks rather than on behavior;
- pin today's internal structure, so any refactor breaks it;
- depend on timing, ordering, or shared state unrelated to the bug;
- need heavy infrastructure (a full cluster, a seeded production copy) for a small fix;
- be thrown away as soon as the fix is shown.
Also skip it when the path to a test is unclear, slow, or integration-heavy and the user did not ask for one.
Procedure
- Pin the defect. Write down the expected behavior, the observed behavior, the code path involved, and the smallest input that reproduces it.
- Pick the tightest check. Use the test style the codebase already uses near that path: unit, component, integration, or a regression suite. If nothing reasonable exists, do not build new test infrastructure. Go to the fallback.
- Write the smallest test that would have caught this bug. Assert what a user of the code should get, not how the code currently computes it. If the bug involves untrusted input (a request body, a file name, a header), make the test feed the hostile value the bug allowed, so the test also documents the attack.
- Run it against the unchanged code. It must fail, and the failure message must point at the defect. A pass means the test does not reproduce the bug. A failure for some other reason (a missing import, a fixture error) means the test is wrong. Fix the test before you touch production code.
- Make the smallest code change that produces the intended behavior and keeps neighboring contracts intact.
- Run the test again. It must pass. Run the surrounding suite too, so you know the fix broke nothing nearby.
Fallback when no practical test exists
Run the closest executable check you can and record it. Options include a short purpose-built script, a shell command that reproduces the symptom, a scripted browser session, a snapshot comparison, an assertion on log output, or a narrow integration run. The same rule applies: observe it showing the bug before the change and showing the fix after.
Guardrails
- Never edit a test so it agrees with wrong code.
- Never loosen an existing assertion unless the intended behavior really changed. If it did, record why in the test or the commit message.
- Keep the new test about this defect. No fixture rewrites, no unrelated coverage.
- For a flaky or intermittent bug, remove the nondeterminism from the test where you can (fixed seeds, fake clocks, a single worker) and say which signal the test pins.
- If the bug hints at a family of related failures, land the narrow regression test first. Propose broader coverage as a separate follow-up.
Report
End with evidence:
- the test or check that failed before the change, and its failure output;
- the run where it passed after the change, plus any neighboring suites you ran;
- if you could not show a failure first, the reason, and which nearest check you used in its place.
Related
The typescript-best-practices skill (../typescript-best-practices/SKILL.md) prefers running real code over mocks. The benchmark-checklist skill (../benchmark-checklist/SKILL.md) applies the same evidence discipline to performance claims.
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.

