Skip to Content
MeowKit
Skills

mk:build-fix

Triages build, compile and type errors by language and fixability, applies minimal fixes, and retries up to three times.

Source.claude/skills/build-fix/SKILL.md
Ownertesting
Runtimeclaude-code
Riskmedium

mk:build-fix takes a failing build, detects the language from the error output, classifies each error by how safely it can be fixed, applies a minimal fix and confirms the build with mk:verify. Use it when npm run build, tsc, go build, cargo build, python -m build or a type check just failed. It sits in Phase 3 (Build) and hands off to Phase 4 (Review) once the build is green.

When not to use it

If you needUse
A runtime error or general bug fixedmk:fix
The root cause of a deeper or architectural problemmk:investigate

Usage

/mk:build-fix [error output or file path]

Pass the error output or a file path. With neither, the skill runs the failing build command itself and captures the output.

What it does

  1. Capture the error output.

  2. Detect the language. The first matching pattern wins.

    PatternLanguageReference
    error TS\d{4}:TypeScriptreferences/typescript-errors.md
    SyntaxError:, ModuleNotFoundError:, IndentationError:Pythonreferences/python-errors.md
    cannot find package, undefined: , syntax error nearGoreferences/general-errors.md
    error[E\d{4}]Rustreferences/general-errors.md
    Anything elseUnknownreferences/general-errors.md
  3. Classify the error.

    ClassExamplesAction
    auto-fixableTS1005 missing semicolon, TS2307 cannot find module, missing importsApply the fix
    suggest-with-confidenceTS2322 type mismatch, TS2345 argument mismatchExplain briefly, then apply
    report-onlyCircular dependency, architectural mismatch, runtime errorsDescribe the cause and stop without editing
  4. Apply the smallest change that resolves the error. Never use TypeScript any as the fix. Use unknown with a type guard or correct the type.

  5. Verify with mk:verify, or the project's build command if verify is unavailable.

  6. If the build still fails, re-classify and try a different approach. After 3 failed attempts, escalate with all three error outputs, each attempted fix and why it failed, the suspected root cause and next steps. The counter resets when you switch to a different error.

The reference files list codes with fix patterns. The TypeScript one has a lookup by symptom that is faster than the full catalogue.

Gotchas

  • A stale .tsbuildinfo can hide errors. Delete it and run rm -rf dist .tsbuildinfo && tsc --noEmit before calling the build clean, since a cold build shows errors an incremental one skips.
  • Packages such as esbuild, sharp and @swc/core ship OS-specific binaries. Run npm ci fresh inside the container and never share node_modules across platforms.
  • Resolve peer dependency warnings before treating the build as clean, because they can hide real version mismatches.
  • Circular imports pass tsc but can break Vite or webpack bundles. Run madge --circular src/ during triage.

On this page