try-works/recursive-mode/recursive-tdd
Claude Code and agent skill by try-works/recursive-mode
- community
Checking that the SKILL.md file is still in the repository.
Use when implementing any code in recursive-mode Phase 3. Enforces strict RED-GREEN-REFACTOR discipline with The Iron Law - no production code without a failing test first. Trigger phrases: "implement this", "add feature", "fix bug", "write a failing test", "TDD".
Install
npx vskill@latest install try-works/recursive-mode/recursive-tddSKILL.md
recursive-tdd
Overview
Test-Driven Development is mandatory for all recursive-mode implementation work. This skill ensures test-first discipline is followed rigorously and recorded in a way recursive-mode tooling can verify.
Core Principle: If you didn't watch the test fail, you don't know if it tests the right thing.
The Iron Law for recursive-mode:
Trigger examples
Implement Phase 3 for run '<run-id>'Add a failing regression test first, then fix the bugI already wrote the code; now add tests(should trigger TDD reset guidance)Follow RED-GREEN-REFACTOR for this change
When to Use
Always in Phase 3 (Implementation):
- New features
- Bug fixes
- Refactoring
- Behavior changes
Default rule:
- Not for "simple" changes
- Not when "under pressure"
- Not because "tests after achieve same goals"
Explicit exception path only:
- If strict RED-first flow is genuinely infeasible, declare
TDD Mode: pragmaticin the Phase 3 artifact - Record a concrete exception reason
- Record compensating validation evidence under
/.recursive/run/<run-id>/evidence/ - Treat this as an explicit deviation, not a silent shortcut
RED-GREEN-REFACTOR Cycle
RED - Write Failing Test
Write one minimal test showing what should happen.
Requirements:
- One behavior per test
- Clear, descriptive name
- Test real code (no mocks unless unavoidable)
- Clear assertion showing expected outcome
<Good>
</Good>
<Bad>
</Bad>
Verify RED - Watch It Fail
MANDATORY. Never skip.
Confirm:
- Test fails (not errors)
- Failure message is expected
- Fails because feature missing (not typos)
Record in Phase 3 artifact:
GREEN - Minimal Code
Write simplest code to pass the test.
Rules:
- Just enough to pass
- No additional features
- No "while I'm here" improvements
- No refactoring yet
<Good>
</Good>
<Bad>
</Bad>
Record in Phase 3 artifact:
REFACTOR - Clean Up
After green only:
- Remove duplication
- Improve names
- Extract helpers
- Keep tests green
Never add behavior during refactor.
Record in Phase 3 artifact:
Common Process Shortcuts (STOP)
| Excuse | Reality | |
|---|---|---|
| "This is just a simple fix, no test needed" | Simple code breaks. Test takes 30 seconds. | |
| "I'll test after confirming the fix works" | Tests passing immediately prove nothing. You never saw it catch the bug. | |
| "Tests after achieve same goals" | Tests-after = "what does this do?" Tests-first = "what should this do?" | |
| "I already manually tested it" | Ad-hoc != systematic. No record, can't re-run, no regression protection. | |
| "Deleting working code is wasteful" | Sunk cost fallacy. Keeping unverified code is technical debt. | |
| "TDD is dogmatic, I'm being pragmatic" | TDD IS pragmatic. Finds bugs before commit, enables refactoring. | |
| "I'll keep the code as reference" | You'll adapt it. That's testing after. Delete means delete. | |
| "Test hard = design unclear" | Listen to the test. Hard to test = hard to use. Simplify design. | |
| "I need to explore first" | Fine. Throw away exploration, start TDD fresh. | |
| "This is different because..." | It's not. The rules don't have exceptions. |
Red Flags - STOP and Start Over
If you encounter any of these, DELETE CODE and restart with TDD:
- [X] Code written before test
- [X] Test passes immediately (not testing what you think)
- [X] "I'll add tests later"
- [X] "This is too simple to test"
- [X] "I know what I'm doing, I don't need the ritual"
- [X] Can't explain why test failed (or didn't fail)
- [X] Test testing mock behavior, not real behavior
- [X] Multiple behaviors in one test ("and" in test name)
Integration with recursive-mode Phase 3
Routing Awareness
If TDD execution uses delegated review, test audit, or bounded routed implementation help, re-read:
/.recursive/config/recursive-router.json/.recursive/config/recursive-router-discovered.json
immediately before choosing the delegated CLI/model, and use the routed policy or explicit fallback rather than ad hoc model selection.
Phase 3 Artifact TDD Section
Every Phase 3 artifact must include:
If strict mode cannot be followed, the artifact must include:
Phase 3 Coverage Gate Addition
Phase 3 Approval Gate Addition
Bug Fix TDD Procedure
- Add Regression Test First
- Write test that reproduces the bug
- Run test, confirm it fails with expected error
- Document failure in Phase 3 artifact
- Implement Minimal Fix
- Fix only what's needed to make test pass
- Run test, confirm it passes
- Document fix in Phase 3 artifact
- Verify No Regressions
- Run full test suite
- Confirm nothing else broke
- Document in Phase 3 artifact
- Lock Phase 3
- TDD Mode is declared
- TDD Compliance: PASS
- Approval: PASS
- Status: LOCKED
Example: Complete Phase 3 TDD Section
$ npm test test/forms/validation.test.ts FAIL: Expected 'Email is required', got undefined
$ npm test test/utils/array.test.ts FAIL: TypeError: Cannot read property 'map' of undefined
References
- REQUIRED: Follow this skill for all Phase 3 implementation work
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/recursive-tdd/SKILL.md
Popularity
- Repository stars
- 119
- Repository forks
- 9
- 7-day trend score
- 24
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/try-works/recursive-mode/recursive-tdd)