Refactor API to use dependency injection

Refactor src/api/ to use dependency injection, keep all existing tests passing, add tests for the new DI container, and output completion promise when done.

prompt
→ Claude Code
/ralph-loop "Refactor src/api/ to use dependency injection. Keep all existing tests passing. Add tests for new DI container. Output <promise>COMPLETE</promise> when done and all tests pass." --max-iterations 20
claude-code

Source: larsderidder ↗graded B · 85/100 — how grades work →

More refactoring loops

Refactor auth module, pass tests

Loop/goalGitHubB

Refactor the authentication module iteratively until all tests pass, stopping after ten attempts.

prompt
→ Claude Code
/goal "Refactor auth module until all tests pass" --max-iterations 10
refactoringlow risk

Migrate an API import by import

Loop/goalXB

Sweep a codebase from a legacy API to its v2 replacement with tests and typecheck as the safety net, capped at 30 turns.

prompt
→ Claude Code
/goal every file importing from `./legacy-api` now imports from `./v2-api`, all tests pass, and `npm run typecheck` is clean — stop after 30 turns

Repair React issues in small batches

Baseline the scan, fix a small batch of real errors or warnings, and verify each change improves it without regressions.

prompt
→ Claude Code
Run `pnpm exec react-doctor . --verbose --yes --offline --fail-on none` to record the baseline, then rerun with `--fail-on error`. Fix at most five genuine findings, run the same scan and relevant project checks, and keep only verified improvements. Clear errors before high-confidence warnings. Stop when clean, blocked, approval is required, a finding is false-positive, or another pass makes no measurable progress. Finish with baseline and final results, retained fixes, reverted attempts, checks, and remaining findings.