tools/ai/claude/config/skills/tdd/SKILL.md
Used when user wants to build features or fix bugs using TDD or red-green-refactor loop.
npx skillsauth add pixelastic/oroshi tddInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Build features and fix bugs using the red-green-refactor loop: write a failing test first, write minimal code to pass it, then refactor.
Use Behavioral tests for behavioral testing, and Scaffolding tests for structural architecture.
Apply the London School of TDD for mocking. Each unit is tested in isolation by mocking its immediate collaborators.
Goal: Agree on interface, behaviors to test, and test strategy before writing any code.
Exit criterion: User has approved the plan and test strategy is declared (scaffold/behavioral and what to mock).
When exploring the codebase, use the project's domain glossary so that test names and interface vocabulary match the project's language.
Apply the pivot question for each test:
"If I rewrote the internals from scratch while keeping the same public API, would this test still pass?"
Ask yourself "What should the public interface look like? Which behaviors are most important to test?"
You can't test everything. Confirm with the user exactly which behaviors matter most. Focus testing effort on critical paths and complex logic, not every possible edge case.
Goal: Prove the test infrastructure works with one failing test and one minimal implementation.
Exit criterion: One test is RED, then GREEN — the path works end-to-end.
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 passes
This is your tracer bullet — proves the path works end-to-end.
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:
Correct approach: Vertical slices via tracer bullets. One test → one implementation → repeat.
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
...
Goal: Cover all planned behaviors one test at a time.
Exit criterion: All planned behaviors have a passing test, no speculative features added.
For each remaining behavior:
RED: Write next test → fails
GREEN: Minimal code to pass → passes
Rules:
zsh-writer, js-writer, etc.) if it existsGoal: Improve the design without changing behavior.
Exit criterion: No duplication, clean names, all tests still green.
After all tests pass, look for refactor candidates:
Never refactor while RED. Get to GREEN first.
| Rationalization | Reality |
|---|---|
| "Private methods shouldn't be tested directly" | private controls API visibility, not testability. Complex logic deserves a test regardless of exposure. |
| "Mocking internal collaborators couples tests to implementation" | Mocking immediate collaborators is isolation, not coupling. Coupling is reaching inside your collaborator. |
| "Testing at the public interface is always enough" | No. Complex private helpers should also be tested.
| "I'll write the test after to go faster" | Tests-after prove nothing. Delete the code. Start with RED. |
| "I should write all tests first, then implement" | That's horizontal slicing. It produces tests of imagined behavior. Do vertical tracer bullets instead. |
zsh-writer, js-writer, etc)tools
Turn the current conversation context into a PRD and publish it to the project issue tracker. Use when user wants to create a PRD from the current context.
tools
Break a plan, spec, or PRD into independently-grabbable issues using tracer-bullet vertical slices. Use when user wants to convert a plan into issues, create implementation tickets, or break down work into issues.
documentation
Use when user says "sidequest" or "handoff" — compact conversation context into a document for a fresh agent to pick up.
development
Use when the user wants to nail down domain terms, resolve terminology ambiguities, or build a shared language for a module or repo. Drills vocabulary one question at a time and writes to the project GLOSSARY.md.