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.

  1. Write One Test: Create a single test case (e.g., in Vitest or Jest) for the next small piece of behavior.
  2. Execute & Fail: Run the test. It must fail.
  3. 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.

  1. Minimal Implementation: Write the simplest code that satisfies the test. Do not build for the future; focus strictly on the current "Red" test.
  2. Run Tests: Execute the suite. All tests must be Green.
  3. Evidence: The transition from Red to Green is the "Proof of Work" for the developer.

Phase 3: Refactor (Clean Up)

Related skills
Installs
99
GitHub Stars
12.7K
First Seen
Apr 22, 2026