What problem does it solve?
When a test fails in CI or during local TDD work, someone must manually diagnose and fix the source code. This Skill automates that loop: it spawns a bounded headless claude -p process that edits the source until the failing test passes, without ever modifying the test itself.
Core Features & Use Cases
- Test-Driven Repair Loop: Runs the failing test, spawns a constrained Claude process (Read/Edit/Bash only), then re-runs the test as the verification gate — no LLM-as-judge needed.
- Bounded Cost and Capability: Caps spend with
--max-budget-usd, restricts tools with --allowedTools Read,Edit,Bash, and requires --confirm before making any changes (dry-run plan otherwise).
- Structured Receipts: Emits JSON output with per-attempt usage, cost totals, before/after test status, and distinct exit codes for success, failure, config errors, and infrastructure issues.
- Use Case: A previously-green regression test went red after a commit. Point the Skill at the test file with a $5 budget and Haiku model; get back either a verified fix to review via
git diff or a clear "couldn't repair within budget" receipt.
Quick Start
Run the tdd-repair script with --repo, --test, and --test-command pointing at your failing test, adding --confirm to actually apply the repair.