tdd-green-phase

Guide minimal code implementation to satisfy a failing unit test.

Updated Feb 16, 2026
One-click install
npx skills add https://github.com/Thedougler/agent-template --skill tdd-green-phase-thedougler
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd-green-phase
Source: https://github.com/Thedougler/agent-template/tree/main/.github/skills/tdd-green-phase
Command: npx skills add https://github.com/Thedougler/agent-template --skill tdd-green-phase-thedougler

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill guides developers through the critical "green" phase of Test-Driven Development, ensuring they write the absolute minimum code required to make a failing test pass, preventing over-engineering.

Core Features & Use Cases

  • Minimal Implementation: Focuses solely on satisfying the current failing test.
  • Strategic Guidance: Helps decide between "obvious implementation" and "faking it" based on test coverage and logic clarity.
  • Use Case: When you've just written a new test that fails, use this Skill to write the simplest possible code to get that test to pass before moving on.

Quick Start

Use the tdd-green-phase skill to write the minimal code to make the current failing test pass.

Frequently Asked Questions about tdd-green-phase

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

FAQPage Schema
How do I write the minimal code to pass a failing unit test in TDD?

To write the minimal code for a failing unit test in TDD, focus solely on satisfying the current test's assertions to prevent over-engineering. You decide between using an 'obvious implementation' or 'faking it til you make it' based on logic clarity.

What is the difference between obvious implementation and faking it in test-driven development?

In test-driven development, 'obvious implementation' means writing the direct, correct logic immediately, while 'faking it' means returning hardcoded values to pass the test before generalizing. The choice depends on your confidence in the solution's clarity and coverage.

How do I avoid over-implementation when writing code test-first?

To avoid over-implementation when writing code test-first, restrict your coding strictly to the assertions in the current failing test. Do not add extra parameters, error handling, or features until a subsequent failing test explicitly demands them.

Does TDD green phase guidance work with async patterns for FastAPI and SQLAlchemy?

Yes, TDD green phase guidance supports async patterns for FastAPI and SQLAlchemy. It provides expert strategies for implementing minimal async code to satisfy failing tests without over-engineering the asynchronous database or API logic.

When should I use triangulation to make a failing test pass?

Use triangulation to make a failing test pass when the general algorithm or logic is not immediately obvious. By writing a second test with different inputs, you force the implementation to generalize beyond the hardcoded values used in the initial fake implementation.

What are the classicist vs mockist tradeoffs when implementing code to satisfy a unit test?

When implementing code to satisfy a unit test, classicist tradeoffs involve testing real object interactions and state, while mockist tradeoffs focus on verifying specific method calls and collaboration patterns, impacting how you write the minimal passing logic.