build-fix
Detect the project build system and incrementally fix build/type errors with minimal safe changes.
- Kind
- Prompt
- Works with
- Claude Code, Codex
- Source
- affaan-m/ECC @ d3b8a3e90890
- Path
- commands/build-fix.md
- License
- MIT
- Jobs
- Debugging
InstallCopy it from the source repository, or sign in and let the assistant adapt it for your project.
# Build and Fix Incrementally fix build and type errors with minimal, safe changes. ## Step 1: Detect Build System Identify the project's build tool and run the build: | Indicator | Build Command | |-----------|---------------| | `package.json` with `build` script | `npm run build` or `pnpm build` | | `tsconfig.json` (TypeScript only) | `npx tsc --noEmit` | | `Cargo.toml` | `cargo build 2>&1` | | `pom.xml` | `mvn compile` | | `build.gradle` | `./gradlew compileJava` | | `go.mod` | `go build ./...` | | `pyproject.toml` | `python -m compileall -q .` or `mypy .` | ## Step 2: Parse and Group Errors 1. Run the build command and capture stderr 2. Group errors by file path 3. Sort by dependency order (fix imports/types before logic errors) 4. Count total errors for progress tracking ## Step 3: Fix Loop (One Error at a Time) For each error: 1. **Read the file** — Use Read tool to see error context (10 lines around the error) 2. **Diagnose** — Identify root cause (missing import, wrong type, syntax error) 3. **Fix minimally** — Use Edit tool for the smallest change that resolves the error 4. **Re-run build** — Verify the error is gone and no new errors introduced …