Skip to main content
build-fix parses your TypeScript or JavaScript build log and surgically patches source files to fix the errors. Zero config, zero dependencies.

GitHub

nometria/build-fix-agents

PyPI

build-fix on PyPI

Install

pip install build-fix

Usage

# Scan current directory and apply fixes (verifies with npm run build)
build-fix .

# Provide a captured build log for more accurate fixes
npm run build 2>&1 | tee build.log
build-fix . --log build.log

# Dry run — show planned patches without applying
build-fix . --dry-run

# Limit to a specific number of fix passes
build-fix . --max-passes 3

What it fixes

Error typeExample
Missing type annotationsParameter 'x' implicitly has an 'any' type
Undefined variablesCannot find name 'foo'
Wrong import pathsCannot find module './utils'
Type mismatchesType 'string' is not assignable to type 'number'
Missing return typesFunction lacks ending return statement
Unused variables (strict mode)'x' is declared but its value is never read
Property does not existProperty 'foo' does not exist on type 'Bar'

How it works

  1. Parse — reads the build log and extracts error locations (file, line, message)
  2. Read context — loads the relevant source file sections
  3. Patch — LLM generates the minimal fix for each error
  4. Verify — re-runs npm run build to confirm errors are resolved
  5. Repeat — iterates up to --max-passes times until the build is clean
Particularly useful for vibe-coded apps where the AI builder generated TypeScript with any types or missing imports that cause CI failures after migration.

Requirements

  • OPENAI_API_KEY or ANTHROPIC_API_KEY set in environment
  • Node.js project with a build script in package.json