skills/test-driven-development/SKILL.md
Use when implementing any feature or bugfix, before writing implementation code
npx skillsauth add kienbui1995/magic-powers test-driven-developmentInstall 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.
Write the test first. Watch it fail. Write minimal code to pass.
Core principle: If you didn't watch the test fail, you don't know if it tests the right thing.
Violating the letter of the rules is violating the spirit of the rules.
Always: New features, bug fixes, refactoring, behavior changes.
Exceptions (ask your human partner): Throwaway prototypes, generated code, configuration files.
Thinking "skip TDD just this once"? Stop. That's rationalization.
NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST
Write code before the test? Delete it. Start over. No exceptions.
Write one minimal test showing what should happen.
Wrong failure: Syntax error, import error, wrong assertion → fix the test first. Right failure: Feature not implemented yet → proceed to GREEN.
Write the MINIMUM code to make the failing test pass.
With all tests green, improve code quality:
Good tests are:
Test the contract, not the implementation:
❌ assert mock.called_with(specific_internal_args)
✅ assert result == expected_output
| Excuse | Reality | |--------|---------| | "I'll write tests after" | You won't. And they'll test implementation, not behavior. | | "This is too simple to test" | Simple code has the sneakiest bugs. | | "I know this works" | Prove it. Write the test. | | "Tests slow me down" | Debugging without tests slows you down more. | | "Just this one function" | One function becomes ten. Start right. |
content-media
Use when designing for XR (AR/VR/MR), choosing interaction modes, or adapting 2D UI patterns for spatial computing
testing
Use when creating new skills, editing existing skills, or verifying skills work before deployment
development
Use when you have a spec or requirements for a multi-step task, before touching code
development
Use when executing a structured workflow — select and run a feature, bugfix, refactor, research, or incident template with correct agent and model assignments per phase.