tdd-red-green-refactor
Installation
SKILL.md
Red-Green-Refactor (TDD) Skill: TypeScript Edition
This skill implements a structural framework for AI-assisted programming to ensure every line of code is verifiable, typed, and purposeful.
The Three-Phase Cycle
Phase 1: Red (Establish Failure)
You must prove the feature does not exist and that your test is valid.
- Write One Test: Create a single test case (e.g., in Vitest or Jest) for the next small piece of behavior.
- Execute & Fail: Run the test. It must fail.
- Verify: Ensure the failure is related to the missing logic (e.g.,
ReferenceError: add is not defined) and not a configuration error.
Phase 2: Green (Minimal Pass)
Make the test pass as quickly and simply as possible.