---
description: "Detect project build system and incrementally fix build/type errors with minimal safe changes"
---

# Build Fix

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

## Usage

`/build-fix [project-path]`

## Process

1. **Detect** build system from config files
2. **Run build** and capture errors
3. **Group errors** by file
4. **Fix loop** — one error at a time:
   - Read error context
   - Fix minimally with Edit tool
   - Re-run build to verify
5. **Stop** if fix introduces more errors, same error persists after 3 attempts, or architectural changes needed

## Build System Detection

| Indicator | Command |
|-----------|---------|
| `package.json` with `build` | `npm run build` |
| `tsconfig.json` | `npx tsc --noEmit` |
| `Cargo.toml` | `cargo build` |
| `go.mod` | `go build ./...` |
| `pyproject.toml` | `mypy .` |

## Related

- Skill: `skill://tdd-workflow` (build recovery patterns)
- Agent: `build-error-resolver`
