TDD Green Phase
Testing & Qualitytdd-green-phaseTDD Green Phase is an Agent Skill for testing & quality published in the majiayu000/claude-skill-registry repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
Guide experienced developers through GREEN phase of TDD cycle - writing minimal implementation to pass failing tests
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Inspect the Agent Skill at https://github.com/majiayu000/claude-skill-registry/blob/HEAD/skills/development/tdd-green-phase-rubrical-studios-gh-pmu/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/tdd-green-phase, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
TDD GREEN Phase
Version: 0.19.0 Source: Skills/tdd-green-phase/SKILL.md
Guide through GREEN phase: implementing minimum code to make failing test pass.
When to Use
- RED phase test verified as failing
- Proceeding autonomously after RED phase
- Moving from RED to GREEN in TDD cycle
Objective
Write the minimum code to make the test pass.
Correct: Implements exactly what test requires, simplest solution Incorrect: Over-engineers, adds untested features, premature optimization
Workflow
Step 1: Understand Test Requirements
- What behavior is expected?
- What inputs/outputs?
- What edge cases covered?
Step 2: Plan Minimal Implementation Avoid: Features not in test, abstractions not needed, premature optimization
Step 3: Implement (Single Code Block)
TASK: [Description]
STEP 1: Open implementation file
STEP 2: Navigate to location
STEP 3: Add/modify implementation code
STEP 4: Context about choices
STEP 5: Save file
STEP 6: Run test command
STEP 7: Verify test PASSES
STEP 8: Report: Did test pass?
Step 4: Verify Success
- Test executed without errors
- Test passed (green)
- No other tests broke
- Implementation is minimal
Step 5: Analyze
- Passes → Proceed autonomously to REFACTOR phase
- Still fails → Revise implementation
- Other tests fail → Fix regressions first
Principles
- YAGNI: Implement only what test requires
- Simplest Thing: Hard-coded values acceptable if test passes
- Let Tests Drive Design: Test tells you the interface
- Hard-Code First: Generalize when more tests require it
Implementation Strategies
- Fake It: Return expected value (temporary)
- Obvious Implementation: Straightforward solution
- Triangulation: Multiple tests force generalization
Anti-Patterns
- Feature creep (adding untested features)
- Optimization before profiling
- Copy-paste without understanding
Checklist
- Target test now PASSES
- Implementation is minimal
- No regressions (full suite green)
- Ready to proceed to REFACTOR phase
End of TDD GREEN Phase Skill