tdd
Skill3 starsChanged 4 months agoMITView on GitHub
Use when implementing any feature or bugfix, before writing implementation code — red-green-refactor loop, one vertical slice at a time. Triggers on "tdd", "test-driven", "red green refactor", "测试驱动开发", "红绿重构", "测试驱动". Not for spec-driven slice implementation (use implement — it drives TDD within each slice) or generating tests for existing code (use test-generation).
193 other projects use a version of this.
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 · 0
None found.
Wrote their own version · 193
- 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
183 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 repository49 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- brainstormSkill
- oss-strategySkill
- specSkill
- researchSkill
- api-designSkill
- architectureSkill
- codebase-designSkill
- design-researchSkill
- domain-modelingSkill
- frontend-designSkill
- imagegenSkill
- image-to-codeSkill
- prompt-engineeringSkill
- prototypeSkill
- schema-designSkill
- auth-implementationSkill
- breakdownSkill
- context-engineeringSkill
- error-handlingSkill
- i18nSkill
- implementSkill
- multi-agent-orchestrationSkill
- cost-optimizationSkill
- performanceSkill
- refactoringSkill
- simplifySkill
- api-testingSkill
- e2e-testingSkill
- load-testingSkill
- test-generationSkill
- a11y-reviewSkill
- code-reviewSkill
- debuggingSkill
- lintingSkill
- security-reviewSkill
- ci-cdSkill
- deprecation-migrationSkill
- git-workflowSkill
- oss-polishSkill
- shippingSkill
- documentation-auditSkill
- handoffSkill
- incident-responseSkill
- observabilitySkill
- purity-auditSkill
- skill-authoringSkill
- using-skillsSkill
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 177 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 8
Write the failing test first.
- Distinctive: line 11
Iron law: No production code without a failing test first.
- Distinctive: line 53
Run the focused test command.
- Distinctive: line 68
Run the focused test command, then the full suite.
- Distinctive: line 71
No other tests broke (if they did, fix now — don't skip)
- Distinctive: line 76
Only while green: extract helpers, improve names, remove duplication.
- Distinctive: line 82
Commit the test and implementation together as one vertical slice.
- Distinctive: line 87
Don't start by fixing. Write a test that reproduces the bug (RED confirms it exists), then fix (GREEN proves the fix works).
“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
Write the failing test first. Watch it fail. Write minimal code to pass. Refactor. A test that passes immediately proves nothing — you never saw it catch a bug.
Iron law: No production code without a failing test first. If you wrote code before the test, delete it and start over. "Keep as reference" is testing-after in disguise — delete means delete.
When to use
- Implementing any new feature or behavior
- Fixing a bug (reproduce it with a test first — the Prove-It Pattern)
- Refactoring or changing existing behavior
- Triggers on "tdd", "test-driven", "red green refactor", "测试驱动开发", "红绿重构", "测试驱动"
Not for: generating tests for already-written code (use test-generation); have a spec and want slice-by-slice feature implementation (use implement — it drives TDD within each slice).
Exceptions (confirm with the user): throwaway prototypes, generated code, pure configuration changes with no behavioral impact — for these, confirm with the user before skipping TDD rather than defaulting either way.
Steps
0. Discover the stack first
The cycle is universal; the commands are not. Before the first test, find how
this repo tests: read package.json / pyproject.toml / Cargo.toml /
pom.xml / go.mod, check for ./gradlew, Makefile, CI workflows, and
existing test-file naming. Never assume npm test — use the repo's own command
for every RED, GREEN, and final verification.
1. RED — write one failing test
One behavior, one test, one vertical slice (tracer bullet that responds to what the last cycle taught you). Write the test you wish existed — it describes the desired API, not the implementation. Name it as a specification ("rejects empty email", not "test1").
Agree the seam (public interface under test) before writing. No test at an unconfirmed seam — agreeing seams up front puts testing effort on critical paths instead of every edge case. Use real code over mocks; if you must double a dependency, use the simplest double that works (Real > Fake > Stub > Mock — see references/test-strategy.md). Mocks isolate boundaries, not the thing being tested.
2. Verify RED — watch it fail
Run the focused test command. Confirm:
- It fails (not errors — errors mean fix the setup and re-run)
- It fails for the right reason (feature missing, not a typo)
- A test that passes immediately means you're testing existing behavior — fix the test
3. GREEN — write minimal code
The simplest code that passes the test. No speculative features, no
"flexibility", no refactoring adjacent code. YAGNI. Don't add test-only methods
(destroy(), reset()) to production classes — put cleanup in test utilities.
4. Verify GREEN — watch it pass
Run the focused test command, then the full suite. Confirm:
- The new test passes
- No other tests broke (if they did, fix now — don't skip)
- Output is pristine (no warnings, no skipped tests)
5. REFACTOR — clean up
Only while green: extract helpers, improve names, remove duplication. Run tests after every refactor step. Don't add behavior. Refactoring belongs to the review stage, not the red → green implementation cycle.
6. Commit
Commit the test and implementation together as one vertical slice. Then start the next failing test.
Bug fixes — the Prove-It Pattern
Don't start by fixing. Write a test that reproduces the bug (RED confirms it exists), then fix (GREEN proves the fix works). The test stays as a regression guard. Never fix a bug without a reproduction test.
Verify
- Every new behavior has a test that failed first
- Full suite passes with the repo's own test command
- Bug fixes include a reproduction test that failed before the fix
- Test names describe behavior, not implementation
- No tests skipped or disabled; no test-only methods in production code
References
- ${CLAUDE_PLUGIN_ROOT}/references/engineering-principles.md — discipline every skill shares
- references/test-strategy.md — test pyramid, test-double hierarchy (Real > Fake > Stub > Mock), DAMP over DRY
- references/testing-anti-patterns.md — mock misuse, test-only methods, partial mocks, gate functions
- references/mocking.md — when to mock, designing for mockability
- references/good-tests.md — good vs bad test examples, tautological tests
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.

