TD
tdd-green
|
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.182 charsno explicit “when” trigger
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