Skip to main content

/build-fix Command

Incrementally fix build and type errors with minimal, safe changes.

What This Command Does

  1. Detect Build System - Identify project type and build command
  2. Parse and Group Errors - Group by file, sort by dependency order
  3. Fix Loop - Fix one error at a time, verify after each
  4. Summary - Report errors fixed, remaining, and new errors

Supported Build Systems

Fix Strategy

  1. Build errors first - Code must compile
  2. Vet warnings second - Fix suspicious constructs
  3. Lint warnings third - Style and best practices
  4. One fix at a time - Verify each change
  5. Minimal changes - Don’t refactor, just fix

Fix Loop Process

For each error:
  1. Read the file - See error context (10 lines around error)
  2. Diagnose - Identify root cause
  3. Fix minimally - Smallest change that resolves error
  4. Re-run build - Verify error is gone
  5. Move to next - Continue with remaining errors

Command Syntax

No arguments required - automatically detects build system and fixes errors.

Example Session

Common Errors Fixed

Stop Conditions

The command stops and asks for help if:
  • Same error persists after 3 attempts
  • Fix introduces more errors than it resolves
  • Requires architectural changes (not just a build fix)
  • Missing external dependencies need installation

Integration with Other Commands

  • Use after making code changes
  • Use before running tests with /verify
  • Language-specific: /go-build for Go projects
  • Agent: agents/build-error-resolver.md
  • Commands: /go-build, /verify, /tdd