
Tdd Red Green Refactor
This enforces strict test-driven development for TypeScript projects by requiring you to write one failing test, make it pass with minimal code, then refactor. It blocks "horizontal splurging" where you write multiple tests at once, forcing a tight Red-Green-Refactor loop for each tiny feature increment. Use it when you need disciplined, verifiable progress on new features or bug fixes and want to prevent the AI from guessing or building ahead of your tests. The real value is in the backpressure: TypeScript's type system plus mandatory test failures create guardrails that keep implementations honest and incremental rather than speculative.
- skills.sh installs
- 732
- GitHub stars
- 28.8K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add google-labs-code/design.md --skill tdd-red-green-refactor --agent claude-codeInstalls into .claude/skills of the current project.
Files
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.
- Minimal Implementation: Write the simplest code that satisfies the test. Do not build for the future; focus strictly on the current "Red" test.
- Run Tests: Execute the suite. All tests must be Green.
- Evidence: The transition from Red to Green is the "Proof of Work" for the developer.
Sponsors
Details
- Repository
- github.com/google-labs-code/design.md
- Categories
- Testing & QA, Code Review & Quality, Automation & Workflows, Design & UI/UX
- First seen
- Jun 3, 2026