tdd-green-strategy

Guides TDD Green-phase implementation using triangulation, fake-it, and obvious implementation strategies.

Updated Jun 24, 2026
One-click install
npx skills add https://github.com/Hakkadaikon/hymme --skill tdd-green-strategy-hakkadaikon
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd-green-strategy
Source: https://github.com/Hakkadaikon/hymme/tree/main/skills/tdd-green-strategy
Command: npx skills add https://github.com/Hakkadaikon/hymme --skill tdd-green-strategy-hakkadaikon

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When practicing test-driven development, developers often struggle with how to write the code that turns a failing test green: hardcoding a return value that never gets generalized, or jumping to a full implementation without enough confidence. This Skill provides concrete strategies for the Green phase so each red test is resolved deliberately. ## Core Features & Use Cases - Triangulation: Add second and third test examples from different equivalence classes to force a hardcoded fake implementation into a generalized one. - Fake It vs Obvious Implementation: Choose between writing a constant-returning placeholder or the real implementation directly, based on your confidence level. - Completion Checklists: Verify no hardcoded returns remain, each added example covers a distinct equivalence class, and no redundant tests were added (YAGNI). - Use Case: While implementing an add function test-first, you pass the first test with return 3, then use triangulation with a second example from a different equivalence class to drive out the generalized implementation, with TypeScript/vitest examples guiding each step. ## Quick Start Ask the AI to apply the tdd-green-strategy skill to decide how to make your current failing test green using triangulation, fake it, or obvious implementation.

Frequently Asked Questions about tdd-green-strategy

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I use triangulation in TDD?

Triangulation means adding a second test example from a different equivalence class after passing the first test with a hardcoded value. The constant return can no longer satisfy both tests, forcing you to generalize the implementation into real logic.

What is the difference between fake it and obvious implementation in TDD?

Fake it means passing the test with a hardcoded constant first, then generalizing later via triangulation. Obvious implementation means writing the real solution directly when you are confident. Choose based on your confidence level, defaulting to fake it when unsure.

When should I not use triangulation?

Skip triangulation when the generalization path is already obvious; writing the real implementation directly is enough. Mechanically adding a second example in that case only produces redundant tests, violating YAGNI.

Why does my TDD green phase leave hardcoded return values?

This happens when you fake the implementation but forget to follow up with triangulation. Add a second test from a different equivalence class so the constant can no longer pass, forcing generalization before marking the item complete.

Does this TDD strategy work with vitest and TypeScript?

Yes, the strategies are demonstrated with TypeScript examples using vitest's describe, it, and expect APIs. The techniques themselves are language-agnostic and apply to any test framework supporting the Red-Green-Refactor cycle.