tdd
Skill1 starsChanged 4 months agoMITView on GitHub
Test-driven development with vertical slices. Enforces behavior-focused tests through public interfaces, one red-green-refactor cycle at a time. Use when writing tests, adding test coverage, or building features test-first.
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 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.
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
jaydubya818Skillfigure-it-out
Use when novel or multi-phase work needs an auditable workflow and no narrower playbook fits.
Also in 54 projects that use this
jaydubya818Skillprinciple-laziness-protocol
Apply when a refactor is adding wrappers or abstractions instead of simplifying.
Also in 45 projects that use this
- +2 more from The-Vibe-Company
- +5 more from jaydubya818
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 repository19 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- antipattern-detectorSkill
- architecture-reviewSkill
- assumption-challengerSkill
- cavemanSkill
- clipSkill
- code-reviewerSkill
- diagnoseSkill
- feature-writerSkill
- gemini-advisorSkill
- gemini-reviewerSkill
- grill-meSkill
- image-generatorSkill
- issue-creatorSkill
- paper-bananaSkill
- pr-writerSkill
- publishSkill
- teach-meSkill
- validatorSkill
The file
We split this skill into the rules it gives an agent
10 rules. 0 are common, 10 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 186 edited versions we read keep these.
10
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 11
Write tests that verify behavior through public interfaces, not implementation details.
- Distinctive: line 32
Write ONE test that describes ONE behavior through the public interface.
- Distinctive: line 45
Write the minimum code that makes the test pass.
- Distinctive: line 49
No generalization beyond what this single test demands
- Distinctive: line 50
If you're writing code no test requires, stop
- Distinctive: line 73
WRONG: Write all tests first, then all implementations.
- Distinctive: line 156
When all identified behaviors have passing tests:
- Distinctive: line 158
Run the full test suite — confirm nothing else broke
- Distinctive: line 160
Check coverage of the new code — are there untested paths that represent real behaviors?
- Distinctive: line 161
If the project has a linter or type checker, run those too
“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 — Vertical-Slice Test-Driven Development
Write tests that verify behavior through public interfaces, not implementation details. One red-green-refactor cycle at a time. Never horizontal slicing.
Core Principle
Tests describe WHAT the system does, not HOW it does it. Code can change entirely; tests should not break unless behavior changes.
Before Starting
- Read CLAUDE.md and existing test files to understand the project's test patterns, frameworks, and conventions
- Identify the behavior — What user-visible or caller-visible behavior are we building or changing?
- Confirm the interface — What public API, endpoint, or function signature will callers use?
- Check for existing tests — Understand what's already covered so you don't duplicate
The Vertical Slice Loop
For each behavior, execute ONE complete cycle before starting the next:
RED — Write a Failing Test
Write ONE test that describes ONE behavior through the public interface.
Good test checklist:
- Describes behavior, not implementation ("user can checkout with valid cart")
- Uses only the public interface — no reaching into private state
- Would survive an internal refactor without changes
- Reads like a specification a non-engineer could understand
- Has a clear, behavior-describing name
Run the test. Confirm it fails. Confirm it fails for the RIGHT reason (missing behavior, not a syntax error or import issue).
GREEN — Minimal Code to Pass
Write the minimum code that makes the test pass. No more.
- No speculative features
- No "while I'm here" cleanup
- No generalization beyond what this single test demands
- If you're writing code no test requires, stop
Run the test. Confirm it passes.
REFACTOR — Clean Up Under Green Tests
With all tests passing, improve the code:
- Extract duplication
- Improve names
- Simplify logic
- Deepen modules (concentrate complexity behind smaller interfaces)
Run all tests after each refactoring step. Never refactor on red.
Then Repeat
Pick the next behavior. Write the next failing test. Continue.
Anti-Patterns to Avoid
Horizontal Slicing (the biggest one)
WRONG: Write all tests first, then all implementations.
RED: test1, test2, test3, test4, test5
GREEN: impl1, impl2, impl3, impl4, impl5RIGHT: One complete vertical slice at a time.
RED->GREEN->REFACTOR: test1->impl1->cleanup
RED->GREEN->REFACTOR: test2->impl2->cleanup
RED->GREEN->REFACTOR: test3->impl3->cleanupHorizontal slicing fails because you're predicting what the implementation will need before you've written it. Tests end up testing imagined behavior, not actual behavior. The implementation then contorts to satisfy the tests instead of the tests documenting what the implementation does.
Implementation-Coupled Tests
The diagnostic: 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.
Symptoms:
- Mocking internal collaborators instead of using real ones
- Spying on private methods to confirm they were called
- Reaching into private state (
obj._items,obj.internal) - Asserting on intermediate data structures
- Tests that break when you change HOW but not WHAT
Example — brittle vs. durable:
// BAD: Coupled to implementation
test("checkout", () => {
const cart = new Cart();
cart._items.push({ id: 1, price: 10 });
const spy = jest.spyOn(cart, "_calculateTax");
cart.checkout();
expect(spy).toHaveBeenCalled();
});
// GOOD: Tests behavior through public interface
test("user can checkout with valid cart", () => {
const cart = new Cart();
cart.add({ id: 1, price: 10 });
const receipt = cart.checkout();
expect(receipt.total).toBe(11);
});Over-Mocking
Mock at boundaries (external APIs, third-party services), not between your own modules. If you're mocking a class you own, ask whether you can use the real thing instead. If you can't, ask whether the interface between the two is too coupled.
When to mock:
- External HTTP APIs (use recorded fixtures or a test server)
- Time-dependent behavior (use a clock abstraction)
- Non-deterministic inputs (use seeded randomness)
When NOT to mock:
- Your own database (use a test database or in-memory equivalent)
- Your own internal modules (use the real implementation)
- Anything where the mock's behavior can diverge from production
Test Naming
A test name should read as a behavior specification:
Good: user can checkout with valid cart, returns error when email is invalid, expires session after 30 minutes of inactivity
Bad: test_checkout_handler, testValidation, it should work
The test file is documentation. Someone reading only the test names should understand what the system does.
Ending the Cycle
When all identified behaviors have passing tests:
- Run the full test suite — confirm nothing else broke
- Review the test names — do they read as a specification?
- Check coverage of the new code — are there untested paths that represent real behaviors?
- If the project has a linter or type checker, run those too
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.

