tdd-green
Enforces the TDD Green phase by guiding minimal code changes to pass failing tests without adding unrequested functionality.
Install
mkdir -p .claude/skills/tdd-green && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/16590" && unzip -o skill.zip -d .claude/skills/tdd-green && rm skill.zipInstalls to .claude/skills/tdd-green
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Guides the implementation of the simplest code to pass the current failing test. Enforces minimal change, no test edits, and commit discipline. Loads detailed rules from asset files.Key capabilities
- →Write the simplest code to make the failing test pass
- →Do not modify tests in this phase
- →No refactoring or generalization
- →Commit after tests pass
- →Check whether the RED test compiles
- →Judge the next GREEN move before editing production code
How it works
The skill guides the implementation of minimal code to pass a failing test, ensuring no test modifications, refactoring, or generalization occurs during this phase.
Inputs & outputs
When to use tdd-green
- →Write minimal code for a failing test
- →Implement structural stubs to fix compilation failures
- →Maintain TDD workflow integrity
- →Apply project code style patterns
About this skill
TDD Green Phase Skill
Purpose
- Write the simplest code to make the failing test pass
- Do not modify tests in this phase
- No refactoring or generalization
- Commit after tests pass
Inputs
- Failing test id
- Skill and asset references
- Project code style patterns from
.github/instructions/tdd-patterns.instructions.md - Canonical GREEN style guide placeholder at
.github/skills/tdd-green/assets/project-code-style-patterns.md
Outputs
- Changed production files
- Test pass summary
Steps
- Load
.github/skills/tdd-green/assets/project-code-style-patterns.mdfirst, then load core asset files for minimal implementation, anti-patterns, and commit discipline - Check whether the RED test compiles.
- If the test references missing production symbols (types, methods, fields), the only allowed edit is the smallest possible compile-only stub — no behavior.
- Run the narrow test again. It must now compile and fail at runtime/assertion level before proceeding.
- This is the distinction between structural red (compile failure) and behavioral red (assertion failure). Both are RED; behavior must not be added until you are at behavioral red.
- Judge the next GREEN move before editing production code.
- Ask whether the change is the dumbest possible thing that makes only the current test pass.
- If the change also solves untested cases, tries to generalize, or looks like the feature instead of the slice, it is too broad.
- Prefer a constant, hardcoded branch, or the narrowest exact-case behavior the current test demands.
- Do not move from behavioral red into generalized implementation just because the change is small.
- Write minimal code to pass the test
- Use
tdd-test-runwith atest_run_requestcontract whose expected result is a passing narrow check for the protected test or slice - If the observed result does not match the expected GREEN outcome, revert only the scoped production changes and return to the preceding GREEN decision point
- Run the broader validation required by project policy through
tdd-test-runbefore reporting GREEN complete - Return contract output
Completion Checks
- Only minimal code added
- All tests pass
- No test or refactor changes
When not to use it
- →When modifying tests
- →When refactoring or generalizing code
- →When not in the TDD green phase
Limitations
- →Only minimal code added
How it compares
This skill enforces a strict TDD green phase workflow, focusing solely on passing the current test with minimal changes, which is distinct from broader development or refactoring tasks.
Compared to similar skills
tdd-green side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| tdd-green (this skill) | 0 | 3mo | No flags | Beginner |
| tdd-workflow | 6 | 4mo | Review | Intermediate |
| qlty-check | 5 | 7mo | Review | Beginner |
| superpowers-tdd | 5 | 7mo | No flags | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
tdd-workflow
affaan-m
在编写新功能、修复错误或重构代码时使用此技能。强制执行测试驱动开发,包含单元测试、集成测试和端到端测试,覆盖率超过80%。
qlty-check
parcadei
Code quality checks, formatting, and metrics via qlty CLI
superpowers-tdd
anthonylee991
Applies tests-first discipline (red/green/refactor) and adds regression tests for bugs. Use when implementing features, fixing bugs, or refactoring.
solid
ramziddin
Use this skill when writing code, implementing features, refactoring, planning architecture, designing systems, reviewing code, or debugging. This skill transforms junior-level code into senior-engineer quality software through SOLID principles, TDD, clean code practices, and professional software design.
bunit-test-migration
FritzAndFriends
Migrate bUnit test files from deprecated beta API (1.0.0-beta-10) to bUnit 2.x stable API. Use this when working on .razor test files in BlazorWebFormsComponents.Test that contain old patterns like TestComponentBase, Fixture, or SnapshotTest.
code-refactor
luongnv89
Systematic code refactoring based on Martin Fowler's methodology. Use when users ask to refactor code, improve code structure, reduce technical debt, clean up legacy code, eliminate code smells, or improve code maintainability. This skill guides through a phased approach with research, planning, and safe incremental implementation.