green-phase

Write minimal code to pass failing tests with REQ-* and BR-* annotations.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/foolishimp/ai_sdlc_method --skill green-phase
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: green-phase
Source: https://github.com/foolishimp/ai_sdlc_method/tree/main/plugins/code-skills/skills/tdd/green-phase
Command: npx skills add https://github.com/foolishimp/ai_sdlc_method --skill green-phase

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pytest.

What problem does it solve?

In Test-Driven Development (TDD), developers often struggle to write just enough code to pass failing tests without over-engineering or introducing unnecessary complexity.

Core Features & Use Cases

  • Minimal Implementation: Guides the AI to write the simplest possible code to make previously failing tests (from red-phase) pass.
  • TDD Workflow Integration: A core, automated component of the RED → GREEN → REFACTOR cycle, ensuring disciplined development.
  • Requirement Traceability: Tags implemented code with REQ-* and BR-* keys, maintaining clear linkage to requirements.
  • Use Case: After writing failing tests for a new user login feature, invoke this skill to generate the minimal Python code required to make those tests pass, focusing solely on functionality.

Quick Start

Implement minimal Python code in 'src/auth/login.py' to make the failing tests for REQ-ID 'UserLogin' pass.

Frequently Asked Questions about green-phase

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

FAQPage Schema
How do I write minimal code to make failing tests pass in TDD?

Write minimal code to make failing tests pass by implementing only the simplest solution needed to satisfy test requirements. The green phase focuses on functionality without over-engineering, enabling refactoring in the next cycle.

What's the difference between the red phase and green phase in Test-Driven Development?

The red phase writes failing tests; the green phase writes minimal code to make those tests pass. Together they form the first two steps of the RED → GREEN → REFACTOR cycle that drives disciplined development.

How do I track requirements when implementing code to pass tests?

Tag implemented code with REQ-* and BR-* identifiers to maintain clear linkage between your code changes and the requirements or bug fixes they address, ensuring traceability throughout development.

Can I use this approach with pytest for Python projects?

Yes, this skill integrates with pytest to review failing tests and generate minimal Python code to make them pass, supporting the complete TDD workflow with requirement traceability.

Why should I avoid over-engineering during the green phase?

Writing minimal code during green phase keeps your implementation focused on meeting test requirements only. Over-engineering introduces unnecessary complexity that refactoring would later need to remove, slowing the development cycle.