← Back to list

tdd-failure-recovery
by rubrical-studios
GitHub CLI extension for project management, sub-issue hierarchies, and batch operations
⭐ 1🍴 0📅 Jan 25, 2026
SKILL.md
name: tdd-failure-recovery description: Guide experienced developers through TDD failure scenarios and recovery procedures when tests behave unexpectedly license: Complete terms in LICENSE.txt
TDD Failure Recovery
Version: {{VERSION}}
When to Use
- RED phase test passes unexpectedly (should fail)
- GREEN phase test still fails (should pass)
- REFACTOR phase breaks tests (should stay green)
- Tests behave unpredictably or inconsistently
Scenario 1: RED Phase Test Passes Unexpectedly
Possible causes:
- Feature already exists
- Test is too permissive
- Test setup incorrect
Recovery:
- Add intentional failure to verify test can fail
- Check for existing implementation
- Review test logic
- Revise test and verify it fails
- Resume TDD cycle
Scenario 2: GREEN Phase Test Still Fails
Possible causes:
- Implementation incomplete
- Implementation has bugs
- Test expectations misunderstood
Recovery:
- Read failure message carefully
- Verify implementation code
- Check test requirements
- Revise implementation
- Run full test suite
- Resume TDD cycle
Scenario 3: REFACTOR Phase Breaks Tests
Possible causes:
- Behavioral change introduced
- Breaking change in API
- Incomplete refactoring
- Test dependency on implementation
Recovery:
- IMMEDIATE ROLLBACK
- Analyze what broke
- Decide: Skip, smaller refactoring, or fix test
Critical principle:
TESTS MUST STAY GREEN
If refactoring breaks tests -> ROLLBACK
Do not proceed with broken tests
Scenario 4: Rollback Procedure
- Identify changes to undo
- Restore previous code version
- Verify file state matches pre-change
- Run full test suite
- Verify all tests GREEN
Scenario 5: Inconsistent Test Results
Possible causes:
- Test order dependency
- Timing issues
- External dependencies
- Random data in tests
Recovery:
- Run failing test alone
- Check test isolation
- Fix with proper setup/teardown
- Verify consistency
Diagnostic Flowchart
Test failed unexpectedly -> What phase?
RED: Should fail but passes -> Test invalid, revise test
GREEN: Should pass but fails -> Implementation incomplete, revise impl
REFACTOR: Should stay green but fails -> ROLLBACK immediately
Prevention Strategies
- Verify Each Phase - Never assume, always run tests
- Clear Communication - Report exact results
- Maintain Green State - Tests green except during RED phase
Common Recovery Patterns
| Pattern | Situation | Action |
|---|---|---|
| Reset | Confused state | Rollback to last green |
| Minimal Fix | Small issue | Targeted correction |
| Skip | Risk > reward | Defer to later |
| Divide and Conquer | Large change broke | Break into smaller changes |
Resources
resources/failure-diagnostic-flowchart.mdresources/recovery-procedures.mdresources/test-isolation-guide.md
End of TDD Failure Recovery Skill
Score
Total Score
65/100
Based on repository quality metrics
✓SKILL.md
SKILL.mdファイルが含まれている
+20
✓LICENSE
ライセンスが設定されている
+10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
✓最近の活動
1ヶ月以内に更新
+10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
✓タグ
1つ以上のタグが設定されている
+5
Reviews
💬
Reviews coming soon


