ruvnet/ruflo/tdd-repair
Claude Code and agent skill by ruvnet/ruflo
- community
Checking that the SKILL.md file is still in the repository.
Test-Driven Repair: given a failing test, spawn a bounded headless `claude -p` (Read/Edit/Bash only, --max-budget-usd capped) that makes the test pass without modifying it. Use when a failing test should drive the fix to the code under test.
Install
npx vskill@latest install ruvnet/ruflo/tdd-repairSKILL.md
The same SKILL.md was published earlier as ruvnet/ruflo/tdd-repair.
Surfaces the Test-Driven Repair loop as a ruflo skill. Use when you have a failing test and want the source-under-test fixed automatically, with the test's pass/fail as the verification gate (no LLM-as-judge).
When to use
- Failing CI test from a recent commit — point this at the test file, get a verified fix (or a clear "couldn't repair within budget" receipt).
- Local TDD workflow — write the failing test first (
tdd-workflowskill), then runtdd-repairto drive the green. - Regression triage — a previously-green test went red; before opening an issue, spend ~$1 to see if the fix is trivial.
When NOT to use
- No failing test exists. Conformant mode (
--no-test-oracle) is scoped for a follow-up ADR — needs MCTS over repro generation. For now, write a failing test first. - Architectural changes. This skill is for tactical "make red green" fixes. Cross-module refactors that incidentally break tests should be done by a human or a swarm.
- Untrusted code. The headless
claude -pruns with--allowedTools Read,Edit,Bash— no MCP, no network, no arbitrary file writes — but Bash can still read and write the filesystem and reach the network, so allowing it is not a sandbox. Don't point this at code you wouldn'tgit checkout .after, and run it on a clean git tree.
Algorithm
Implementation: `scripts/tdd-repair/tdd-repair.mjs`.
- Pre-flight verify — run the test command. If it already passes, exit 2 (
test-already-passes). Repairing a green test is either a no-op or a--test-commandtypo. - Spawn `claude -p` with a focused prompt:
- Failing test file path (read-only intent)
- Test command (run only)
- Hard constraint: do NOT modify the test
- Hard constraint: do NOT add new dependencies
- `--allowedTools Read,Edit,Bash` restricts capability. `--max-budget-usd` caps cost per attempt. `--permission-mode acceptEdits` auto-accepts file edits within the allowed set.
- Re-run the test to verify. The test's exit code IS the fitness function — no separate sandbox / LLM-as-judge.
- If green: emit
success: true+ per-attempt usage. If red after `--max-attempts`: emitsuccess: false+ receipts. Either way, the workspace is left asclaude -pmodified it (caller cangit diffto review).
Output shape
Exit codes
| Code | Meaning | |
|---|---|---|
| 0 | Test green after repair (success) | |
| 1 | Test still red after --max-attempts | |
| 2 | Config error (test file missing, test already passes, --no-test-oracle unsupported, etc.) | |
| 3 | Claude CLI exited non-zero (infrastructure failure) | |
| 99 | Reserved for safety tripwire (per ADR-153) |
Safety posture
| Layer | Mechanism | |
|---|---|---|
| Cost cap | --max-budget-usd default $5, divided across --max-attempts. Hard ceiling — claude exits when reached. | |
| Capability cap | --allowedTools Read,Edit,Bash — no MCP tools. Bash can still write files and use the network, so this narrows the tool set, it is not a sandbox. | |
| Scope cap | The prompt forbids adding dependencies. The test file is enforced, not just requested: if an attempt changes it, the original bytes are restored and the attempt is scored failed (reason: test-file-modified). | |
| Confirmation gate | --confirm REQUIRED — without it, returns dry-run plan (mirrors harness-evolve / harness-mint convention). | |
| Hard timeout | 15 min total wall-clock; per-attempt budget of timeoutMs / maxAttempts. | |
| Pre-flight | Refuses to run if the test already passes (catches --test-command typos). |
Inspiration
Modeled on the Test-Driven Repair mode from agent-harness-generator/packages/darwin-mode ADR-175. Key design difference: instead of wrapping metaharness-darwin evolve (population-based search), we drive a single claude -p invocation. Rationale:
- The test command IS the fitness function — no need for variant scoring
claude -pis already in our stack — no new optional dep- Bounded cost / capability are first-class flags
- Resumable via
--session-idif iteration is needed
Conformant mode (no test, write own repro via MCTS) is deferred to a future ADR.
Example
Cost ladder
| Tier | Model | Per-attempt typical | Use when | |
|---|---|---|---|---|
| 1 | Haiku | $0.02 – $0.20 | First try — most "make red green" bugs are tactical | |
| 2 | Sonnet | $0.30 – $2.00 | Haiku failed, or the bug has multi-file scope | |
| 3 | Opus | $1.50 – $8.00 | Sonnet failed — architectural reasoning required (rarely worth it for a single failing test) |
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingplugins/ruflo-testgen/skills/tdd-repair/SKILL.md
Popularity
- Repository stars
- 67,355
- Repository forks
- 8,058
- 7-day trend score
- 56
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/ruvnet/ruflo/tdd-repair)