Skip to main content
command CX Codex

build-fix · sangrokjung — Claude Code command: what it does, how to install

build-fix runs npm or pnpm builds, parses compiler errors, and fixes them incrementally. It verifies every edit with a fresh build run.

MIT ★ 880 updated 2026-09-03

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/commands/build-fix.md
Open on GitHub

What build-fix does

The command triggers npm run build or pnpm build, captures compiler output, and groups errors by file. For each issue, the assistant inspects surrounding code context and applies a targeted fix. Then it rebuilds immediately.

Edits happen one issue at a time. If a fix triggers new compiler errors or fails to resolve the same problem after 3 attempts, execution halts automatically. This prevents destructive modification loops. At the end, the assistant outputs a summary of resolved and remaining issues.

This skill runs inline without persisting data to agent memory. If you need learned memory across sessions, run the build-error-resolver agent directly instead. Execution requires tool permissions for file inspection and Bash commands for npm, pnpm, or npx.

What it helps with

  • resolve TypeScript compilation errors one by one
  • verify code edits automatically with fresh build runs
  • group compiler diagnostics by affected file
  • halt automated fixes when an error persists after 3 attempts

Example prompts for the agent

  • /build-fix
  • Run /build-fix to clean up TypeScript errors in this package
  • Check the pnpm build output and fix the remaining type failures step by step

How to install build-fix

Manually: put the files in place

.claude/commands/build-fix.md

Call it with /build-fix. For all projects use ~/.claude/commands/

Questions about build-fix

How to install build-fix in Claude Code?

Add the command file to .claude/commands/build-fix.md in your project repository.

What does the build-fix command do?

It runs your build script using npm or pnpm, reviews error output, and applies fixes one error at a time. A fresh build runs after each change to verify the fix.

When does build-fix stop automatically?

It halts if a change creates new errors, if the same issue persists after 3 attempts, or when paused manually.

Source text

build-fix.md · MIT
---
description: 빌드 에러를 자동으로 분석하고 수정합니다.
allowed-tools: Read, Edit, Glob, Grep, Bash(npm:*), Bash(pnpm:*), Bash(npx:*)
---

> 참고: 이 스킬은 build-error-resolver 에이전트를 호출하지 않고 인라인 실행됩니다. 에이전트의 memory 학습이 필요하면 Agent 도구로 build-error-resolver를 직접 호출하세요.

# Build and Fix

Incrementally fix TypeScript and build errors:

1. Run build: npm run build or pnpm build

2. Parse error output:
   - Group by file
   - Sort by severity

3. For each error:
   - Show error context (5 lines before/after)
   - Explain the issue
   - Propose fix
   - Apply fix
   - Re-run build
   - Verify error resolved

4. Stop if:
   - Fix introduces new errors
   - Same error persists after 3 attempts
   - User requests pause

5. Show summary:
   - Errors fixed
   - Errors remaining
   - New errors introduced

Fix one error at a time for safety!

© sangrokjung · MIT · sangrokjung/claude-forge

Similar slash commands

All slash commands for Programming languages →

build-fix by other authors comes first.

build-fix Affaan Mustafa build-fix fixes TypeScript and build failures one at a time, rerunning the build after each change. Useful when the error list needs a controlled pass. CX Codex +1 ★ 6,739repo stars build-error-resolver Affaan Mustafa The build-error-resolver subagent diagnoses build and TypeScript failures, then applies small fixes without architectural changes. Use it when a build or type check breaks. CX Codex ★ 6,739repo stars migrate-to-deno denoland migrate-to-deno guides the transition of Node.js, npm, Yarn, pnpm, or Bun projects to Deno 2.9+. Covers lockfile generation, permission tuning, and command mapping. CX Codex +1 125installs bun-package-manager secondsky Bun package manager reference for commands, monorepos, and pnpm migrations. It guides agents on installation flags and lockfile conversions. CX Codex +1 463installs aube-package-manager reason-machines aube-package-manager is a skill for Claude Code that explains aube workflows in Node.js projects, including dependencies, workspaces, CI, and migration from pnpm. CX Codex +1 399installs npm-git-install akillness npm-git-install picks a safe delivery path for a Node package coming from a branch, commit, fork or private repo. Useful when the question is whether to pull from Git at all. CX Codex +1 351installs audit-and-reduce-dependencies grafana audit-and-reduce-dependencies shrinks JavaScript dependency footprint in pnpm projects and cleans up lockfiles while preserving workspace layouts. Best for trimming node_modules in Grafana plugins. CX Codex +1 3,200installs

From the same set44

The whole set →

Project sponsors

Companies that keep this analytics open