{"enrichment":{"faq":[{"a":"test-driven-development teaches the red-green-refactor cycle as the core TDD workflow. Red: write a failing test and verify it fails for the right reason. Green: implement just enough code to pass the test. Refactor: improve the code while keeping tests passing. This cycle repeats for every feature, bug fix, and refactoring task, ensuring no production code is written without a failing test first.","q":"What is the red-green-refactor cycle in test-driven development?"},{"a":"In test-driven-development, writing tests first means authoring test cases before any implementation code exists. Start by defining what behavior you want\u2014write a test that describes it. Run the test and watch it fail (red phase). Then write minimal code to make it pass (green phase). This test-first approach ensures your code is testable, focused, and directly addresses real requirements.","q":"How do you write tests first in test-driven development?"},{"a":"test-driven-development follows an iron law: no production code without a failing test first. Always write a failing test, verify it fails for the right reason, then implement code to pass it. This discipline ensures every line of production code is driven by a real test requirement and prevents writing untested or unnecessary code.","q":"What does test-driven-development say about failing tests before code?"},{"a":"test-driven-development applies TDD for bug fixes by writing a failing test that reproduces the bug, then fixing the code to pass that test. This approach captures the bug as a test case, prevents regression, and ensures the fix is verified. The same red-green-refactor cycle applies: failing test, minimal fix, then refactor if needed.","q":"How does test-driven-development help with bug fixes?"},{"a":"test-driven-development teaches you to avoid common TDD mistakes and testing anti-patterns. By following the discipline of writing failing tests first and implementing only enough code to pass them, you prevent brittle tests, over-engineered code, untested paths, and false confidence. The methodology keeps you focused on real behavior verification rather than test coverage theater.","q":"What testing anti-patterns does test-driven-development help you avoid?"},{"a":"test-driven-development enables safe refactoring through test coverage. Once you have a comprehensive test suite from following the red-green-refactor cycle, you can refactor code with confidence\u2014your tests verify that behavior remains correct. The skill teaches refactoring as the final phase of TDD, where you improve code quality while maintaining all passing tests.","q":"Can you refactor safely with test-driven-development?"}],"shadow_tags":["red-green-refactor","test-first-coding","minimal-implementation","verification-cycle","behavior-validation","regression-prevention","code-quality-discipline","feature-development","bug-reproduction"],"summary_rewrite":"This skill teaches the red-green-refactor cycle: write a failing test, verify it fails for the right reason, implement just enough code to pass, then refactor. Follow the iron law\u2014no production code without a failing test first\u2014and use this approach for all features, bug fixes, and refactoring work."},"files":[{"bytes":6841,"path":".claude/skills/test-driven-development/SKILL.md","sha256":"a07c69881472592c24ff665b78a201e94ea60b3ac9749fb23f755c5dbe28a920","url":"https://skillfed.io/files/ShaftHQ/SHAFT_ENGINE/test-driven-development/945f2484/SKILL.md"}],"id":"ShaftHQ/SHAFT_ENGINE/test-driven-development","links":{"html":"https://skillfed.io/ShaftHQ/SHAFT_ENGINE/test-driven-development","md":"https://skillfed.io/ShaftHQ/SHAFT_ENGINE/test-driven-development.md","repo":"https://github.com/ShaftHQ/SHAFT_ENGINE"},"meta":{"agents_supported":["claude-code"],"first_seen":"2026-07-28","forks":152,"language":"Java","last_updated":"2026-07-27","license":"MIT","name":"test-driven-development","publisher":"ShaftHQ","stars":404},"relations":{"similar":[{"id":"jnMetaCode/superpowers-zh/test-driven-development"},{"id":"rpamis/comet/test-driven-development"},{"id":"ryan-yuuu/crypto-trading-arena/test-driven-development"},{"id":"Wide-Moat/open-computer-use/test-driven-development"},{"id":"xenitV1/claude-code-maestro/tdd-mastery"},{"id":"family3253/skill/superpowers-test-driven-development"},{"id":"getcrew44/crew44/test-driven-development"},{"id":"beita6969/ScienceClaw/test-driven-development"},{"id":"bartstc/vite-ts-react-template/test-driven-development"},{"id":"Ibrahim-3d/orchestrator-supaconductor/test-driven-development"}]},"slug":{"owner":"ShaftHQ","repo":"SHAFT_ENGINE","skill":"test-driven-development"},"version":"945f2484"}
