Docs › Skills › test-driven-development

test-driven-development

Drives development with tests. Use when implementing any logic, fixing any bug,

141 lines guide: ANTI-PATTERNS guide: BROWSER-TESTING guide: PROVE-IT guide: TDD-CYCLE guide: TEST-PYRAMID guide: WRITING-TESTS

Overview

Test-driven development enforces a RED-GREEN-REFACTOR cycle: write a failing test first, then implement the minimal code to make it pass, then clean up. For bug fixes, the Prove-It Pattern reproduces the bug with a test before any fix is attempted — tests are treated as proof, not afterthoughts.

Use this skill when implementing new logic, fixing bugs, modifying existing functionality, or adding edge case handling. The skill provides a decision tree for choosing between unit tests (~80%), integration tests (~15%), and end-to-end tests (~5%), along with guides on writing good tests, browser testing, and anti-patterns to avoid.

The output is a suite of passing tests alongside modified source code, with every behavior change proven by a test-first cycle and every bug fix accompanied by a regression test.