tdd
Skill1 starsChanged 5 months agoMITView on GitHub
Apply practical, language-agnostic test-driven development when implementing observable behavior, reproducing and fixing bugs, or changing untested code where executable examples can guide the design. Use a small List → Red → Green → Refactor loop, with regression-first, characterization-first, refactoring, and spike-then-test variants. Do not use strict TDD for visual-only styling, exploratory work before behavior is understood, mechanical migrations, or documentation-only changes unless tests clarify a real contract or risk.
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 repository9 other files it gives its agents.
- AGENTS.mdAGENTS.md
- agent-memorySkill
- agent-skill-designSkill
- alignment-interviewSkill
- complexity-reviewSkill
- design-deep-modulesSkill
- project-development-docsSkill
- right-size-engineeringSkill
- to-ticketsSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
34 rules. 0 are common, 34 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 186 edited versions we read keep these.
34
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 14
Treat this as a design discipline, not merely a requirement to write tests first.
- Distinctive: line 20
Behavior change: Use the full List → Red → Green → Refactor loop.
- Distinctive: line 24
Exploration: Run the smallest useful spike when an SDK, algorithm, or external behavior is unknown.
- Distinctive: line 29
Before starting a cycle:
- Distinctive: line 33
Run the narrowest relevant existing tests to establish a known baseline.
- Distinctive: line 34
Create or infer a short test list of observable behaviors, including important boundaries and failures.
- Distinctive: line 37
Do not introduce a new test framework when the repository already provides a practical one.
- Distinctive: line 39
If the baseline is already failing, separate pre-existing failures from failures introduced by the change.
- Distinctive: line 41
Write test-list items as behavior:
- Distinctive: line 49
Do not write implementation tasks such as “add an if statement,” “use a regex,” or “mock the service.” Add discoveries to the list instead …
- Distinctive: line 55
Write one focused executable example with one primary reason to fail.
- Distinctive: line 65
Run the narrowest relevant command and inspect the failure.
- Distinctive: line 67
If the test passes immediately, do not force a Red by damaging working code.
- Distinctive: line 75
keep the change local and straightforward
- Distinctive: line 76
avoid unrelated cleanup and speculative options
- Distinctive: line 78
add only scaffolding required to reach the tested behavior
- Distinctive: line 79
run the focused test, then relevant nearby tests
- Distinctive: line 87
Use the Green state to:
- Distinctive: line 94
delete premature or obsolete abstractions
- Distinctive: line 96
Do not change observable behavior during Refactor.
- Distinctive: line 108
Do not code every imagined case in advance.
- Distinctive: line 114
Use unit tests for pure rules, parsing, validation, formatting, and state transitions.
- Distinctive: line 115
Use integration tests for persistence semantics, transactions, serialization, file systems, framework wiring, and external adapters.
- Distinctive: line 116
Use component tests for rendered UI behavior and interaction state.
- Distinctive: line 117
Use end-to-end tests sparingly for critical flows or contracts that lower levels cannot establish confidently.
- Distinctive: line 119
Avoid duplicating the same assertion at every level unless the risk justifies it.
- Distinctive: line 121
Test observable outcomes such as returned values, errors, persisted state, emitted events, rendered behavior, and meaningful side effects.
- Distinctive: line 123
Use mocks, fakes, or stubs at slow, unstable, nondeterministic, destructive, or externally controlled boundaries.
- Distinctive: line 125
Keep tests repeatable and independent.
- Distinctive: line 127
Use precise assertions by default.
- Distinctive: line 131
When a practical automated test cannot be written or run:
- Distinctive: line 135
Keep the production change as small as possible.
- Distinctive: line 139
Do not silently skip, disable, weaken, or rewrite an effective test merely to obtain Green.
- Distinctive: line 150
no temporary special case violates the known contract
“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
Implement software through short feedback loops that make each behavior and design decision observable.
List → Red → Green → Refactor → RepeatTreat this as a design discipline, not merely a requirement to write tests first. Preserve the user's requested workflow and apply the strongest test-driven feedback that fits the task.
Choose the Operating Mode
Choose the mode before editing production code.
- Behavior change: Use the full List → Red → Green → Refactor loop.
- Bug fix: Reproduce the reported failure with a regression test, then make the smallest fix.
- Untested existing code: Capture relevant current behavior with a characterization test, then add a failing test for the desired change.
- Pure refactoring: Establish relevant Green coverage and refactor in small steps. Do not manufacture a failing test when observable behavior must not change.
- Exploration: Run the smallest useful spike when an SDK, algorithm, or external behavior is unknown. Keep or discard the spike deliberately, then test the stable behavior before treating production work as complete.
- Non-behavioral work: Skip strict TDD for visual-only styling, mechanical migrations, generated output, and documentation-only changes unless an executable check protects a real contract or risk.
Prepare
Before starting a cycle:
- Identify the target behavior and useful observation boundary.
- Inspect nearby code and tests for the established framework, naming, fixtures, doubles, and commands.
- Run the narrowest relevant existing tests to establish a known baseline.
- Create or infer a short test list of observable behaviors, including important boundaries and failures.
- Choose the smallest next example that will clarify the contract or force useful generalization.
Do not introduce a new test framework when the repository already provides a practical one.
If the baseline is already failing, separate pre-existing failures from failures introduced by the change. Continue only when the relevant behavior can still be isolated and verified; never report a pre-existing failure as a new Red or Green result.
Write test-list items as behavior:
- accepts a valid identifier
- rejects an empty identifier with a stable error code
- preserves metadata when updating a recordDo not write implementation tasks such as “add an if statement,” “use a regex,” or “mock the service.” Add discoveries to the list instead of expanding the current cycle.
Run the Cycle
Red: Prove the Behavior Is Missing
Write one focused executable example with one primary reason to fail. Multiple assertions are acceptable when they describe one coherent observable result.
Prefer tests with:
- a specification-like name
- minimal relevant setup
- explicit input and expected outcome
- assertions on public behavior or meaningful side effects
- failure output that explains the unmet contract
Run the narrowest relevant command and inspect the failure. Proceed only when it fails because the behavior is missing or wrong, not because of syntax, imports, setup, fixtures, or an assertion that never ran.
If the test passes immediately, do not force a Red by damaging working code. Determine whether the test is weak, the behavior already exists, or the reproduction conditions are incomplete. Strengthen the test, mark the behavior complete, or investigate the missing precondition as appropriate.
Green: Satisfy the Current Contract
Make the smallest honest production change that satisfies the current example and preserves established behavior.
During Green:
- keep the change local and straightforward
- avoid unrelated cleanup and speculative options
- tolerate temporary duplication when it keeps the step small
- add only scaffolding required to reach the tested behavior
- run the focused test, then relevant nearby tests
A narrow hardcoded implementation may be used as a temporary TDD step when the current example intentionally leaves the general rule unknown. Add the next example that forces generalization. Do not finish with a hardcoded special case when the known contract is broader.
Refactor: Improve Structure While Green
Improve production and test code only while the relevant tests pass.
Use the Green state to:
- clarify names and boundaries
- remove meaningful duplication
- simplify branching and state
- separate decisions from effects
- improve test readability and setup
- delete premature or obsolete abstractions
Do not change observable behavior during Refactor. If a behavior change becomes necessary, return to the test list and begin a new Red cycle.
Repeat Deliberately
Mark the completed item, record new discoveries, and choose the next example. Prefer this progression when it teaches the design something useful:
- regression for a reported bug
- simplest representative behavior
- a second example that defeats a special-case implementation
- important boundary or failure
- state transition or integration edge
Do not code every imagined case in advance. Stop when the requested contract is implemented, material risks have proportionate coverage, and remaining gaps are explicit.
Choose the Test Boundary
Choose the narrowest boundary that observes the real behavior with fast, stable, maintainable feedback. Do not default mechanically to the smallest function or to end-to-end testing.
- Use unit tests for pure rules, parsing, validation, formatting, and state transitions.
- Use integration tests for persistence semantics, transactions, serialization, file systems, framework wiring, and external adapters.
- Use component tests for rendered UI behavior and interaction state.
- Use end-to-end tests sparingly for critical flows or contracts that lower levels cannot establish confidently.
Avoid duplicating the same assertion at every level unless the risk justifies it.
Test observable outcomes such as returned values, errors, persisted state, emitted events, rendered behavior, and meaningful side effects. Avoid private methods, incidental call order, internal structure, and intermediate values unless that interaction is itself the contract.
Use mocks, fakes, or stubs at slow, unstable, nondeterministic, destructive, or externally controlled boundaries. Prefer real collaborators when they are fast and reliable. Excessive internal mocking usually signals the wrong observation boundary or a dependency that should be made explicit.
Keep tests repeatable and independent. Control relevant clocks, randomness, identifiers, time zones, environment, shared state, network access, and concurrency. Introduce the smallest seam needed for control; do not begin with a broad rewrite merely to make code testable.
Use precise assertions by default. Keep snapshots small and intentional. Use coverage to find unexamined risk, not as a substitute for meaningful behavioral evidence.
Handle Verification Limits
When a practical automated test cannot be written or run:
- Explain the concrete limitation.
- Perform the strongest available deterministic check.
- Keep the production change as small as possible.
- Provide the exact test or command that should be run later when known.
- Report the remaining verification gap without presenting the work as fully proven.
Do not silently skip, disable, weaken, or rewrite an effective test merely to obtain Green. Change a test's expectation only when the intended contract changed.
Completion Contract
Finish only when:
- the requested observable behavior is implemented
- bug fixes have regression coverage when practical
- relevant focused tests pass
- broader checks have been run in proportion to the affected boundary and risk
- refactoring has preserved Green
- no temporary special case violates the known contract
- deferred cases and verification gaps are explicit
Report concisely:
- the behavior implemented, fixed, or preserved
- the tests added or changed
- the commands run and their results
- any intentionally deferred case, remaining risk, or untested area
The goal is not maximal test count or coverage. Use small executable examples to reach a correct, maintainable change with credible evidence.
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.

