Prompt file imported from SemiAnalysisAI/InferenceX-app (
.claude/commands/fix.md). Copyright stays with the author.
Incrementally fix build and type errors with minimal, safe changes.
Announce at start: "Fixing build errors — one at a time, smallest possible changes."
Step 1: Identify Errors
Run all checks and capture errors:
bun run typecheck 2>&1
bun run lint 2>&1
If both pass, run the full build:
bun run build 2>&1
If everything passes, announce "All checks pass — nothing to fix." and stop.
Step 2: Parse and Prioritize
- Group errors by file path
- Sort by dependency order (fix imports/types before logic errors)
- Count total errors for progress tracking
- Announce: "Found N errors across M files. Fixing one at a time."
Step 3: Fix Loop
For each error:
- Read the file — see 10 lines of context around the error
- Diagnose — identify root cause (missing import, wrong type, syntax error)
- Fix minimally — smallest change that resolves the error. No refactoring, no "while I'm here" improvements.
- Re-run the failing check — verify the error is gone
- Check for regressions — confirm no new errors were introduced
- Move to next
Step 4: Guardrails — STOP and ask the user if:
- A fix introduces more errors than it resolves
- The same error persists after 3 attempts
- The fix requires architectural changes or touching >3 files
- Errors stem from missing dependencies (need
bun install)
Step 5: Summary
Report: errors fixed (with file paths), errors remaining (if any), and confirm no regressions.
