/build-fix
Incrementally fix build and type errors with minimal, safe changes.
> /plugin marketplace add loulanyue/awesome-claude-notes > /plugin install awesome-claude-notes@awesome-claude-notes
How it fires
How this command gets triggered: by you, by Claude, or both.
- Fires itselfClaude auto-loads it when your prompt matches the work.
- You can call itInvoke it directly when you want it.
- Slash command
/build-fix
Context preview
What this command does when you run it.
Incrementally fix build and type errors with minimal, safe changes.
Command definition
build-fix.mddescription: "Incrementally fix build and type errors with minimal, safe changes."
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 5. **Move to next** — Continue with remaining errors
Step 4: Guardrails
Stop and ask the user if:
- A fix introduces **more errors than it resolves**
- The **same error persists after 3 attempts** (likely a deeper issue)
- The fix requires **architectural changes** (not just a build fix)
- Build errors stem from **missing dependencies** (need `npm install`, `cargo add`, etc.)
Step 5: Summary
Show results:
- Errors fixed (with file paths)
- Errors remaining (if any)
- New errors introduced (should be zero)
- Suggested next steps for unresolved issues
Recovery Strategies
| Situation | Action | |-----------|--------| | Missing module/import | Check if package is installed; suggest install command | | Type mismatch | Read both type definitions; fix the narrower type | | Circular dependency | Identify cycle with import graph; suggest extraction | | Version conflict | Check `package.json` / `Cargo.toml` for version constraints | | Build tool misconfiguration | Read config file; compare with working defaults |
Fix one error at a time for safety. Prefer minimal diffs over refactoring.
Navigation
- [Command → Agent / Skill Map](../docs/COMMAND-AGENT-MAP.md)
- [Agents index](../AGENTS.md)
- [Contexts directory](../contexts)
- [Contributing guide](../CONTRIBUTING.md)
Read more
description: "Incrementally fix build and type errors with minimal, safe changes."
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 5. **Move to next** — Continue with remaining errors
Step 4: Guardrails
Stop and ask the user if:
- A fix introduces **more errors than it resolves**
- The **same error persists after 3 attempts** (likely a deeper issue)
- The fix requires **architectural changes** (not just a build fix)
- Build errors stem from **missing dependencies** (need `npm install`, `cargo add`, etc.)
Step 5: Summary
Show results:
- Errors fixed (with file paths)
- Errors remaining (if any)
- New errors introduced (should be zero)
- Suggested next steps for unresolved issues
Recovery Strategies
| Situation | Action | |-----------|--------| | Missing module/import | Check if package is installed; suggest install command | | Type mismatch | Read both type definitions; fix the narrower type | | Circular dependency | Identify cycle with import graph; suggest extraction | | Version conflict | Check `package.json` / `Cargo.toml` for version constraints | | Build tool misconfiguration | Read config file; compare with working defaults |
Fix one error at a time for safety. Prefer minimal diffs over refactoring.
Navigation
- [Command → Agent / Skill Map](../docs/COMMAND-AGENT-MAP.md)
- [Agents index](../AGENTS.md)
- [Contexts directory](../contexts)
- [Contributing guide](../CONTRIBUTING.md)
Community-maintained distribution of reusable AI coding agents, commands, skills, hooks, and cross-harness workflows.
Repo: loulanyue/awesome-claude-notes
Other commands on awesome-claude-notes.
- /aside
Answer a quick side question without interrupting or losing context from the current task. Resume work automatically after answering.
Open command - /checkpoint
Create or verify a checkpoint in your workflow.
Open command - /claw
Start NanoClaw v2 — ECC's persistent, zero-dependency REPL with model routing, skill hot-load, branching, compaction, export, and metrics.
Open command - /code-review
Comprehensive security and quality review of uncommitted changes:
Open command - /context-budget
Analyze context window usage across agents, skills, MCP servers, and rules to find optimization opportunities. Helps reduce token overhead and avoid performance warnings.
Open command - /cpp-build
Fix C++ build errors, CMake issues, and linker problems incrementally. Invokes the cpp-build-resolver agent for minimal, surgical fixes.
Open command

