build-error-resolver

build-error-resolver is an agent for Claude Code from zhukunpenglinyutong/ai-max. It costs 55 tokens per session (3,571 once invoked), scanned C, original, MIT.

A coding agent for fixing TypeScript, compilation, dependency, and build-configuration errors. TypeScript is a programming language that checks types before code runs, while a build turns source code into a runnable application.

In plain words
What is it for?
It helps diagnose and fix type errors, broken imports, missing packages, version conflicts, and configuration problems in tools such as TypeScript, ESLint, Next.js, and webpack.
Why use it?
It focuses on getting a failed build or type check working again with the smallest necessary code changes. It avoids refactoring or redesigning the application.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md). Also seen: model in frontmatter.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is import { formatDate } from '../lib/utils'.

Good fit It helps diagnose and fix type errors, broken imports, missing packages, version conflicts, and configuration problems in tools such as TypeScript, ESLint, Next.js, and webpack.

Compare 6 agents from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/zhukunpenglinyutong/ai-max
agentmods
npx agentmods add agents/zhukunpenglinyutong/ai-max/build-error-resolver

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for build-error-resolver

README.md
[![agentmods](https://agentmods.dev/badge/agents/zhukunpenglinyutong/ai-max/build-error-resolver/github.svg)](https://agentmods.dev/agents/zhukunpenglinyutong/ai-max/build-error-resolver)
Your own site
<a href="https://agentmods.dev/agents/zhukunpenglinyutong/ai-max/build-error-resolver"><img src="https://agentmods.dev/badge/agents/zhukunpenglinyutong/ai-max/build-error-resolver/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for build-error-resolver

Your own site · 80×15
<a href="https://agentmods.dev/agents/zhukunpenglinyutong/ai-max/build-error-resolver"><img src="https://agentmods.dev/badge/agents/zhukunpenglinyutong/ai-max/build-error-resolver.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 55 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,571 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00055 $0.03571
Opus 5 $0.00028 $0.01785
Sonnet 5 $0.00011 $0.00714
Haiku 4.5 $0.00006 $0.00357

Measured 10d ago against content hash 4b17284cf870, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade C, and why

build-error-resolver scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

rm -rf .next node_modules/.cache
agents/build-error-resolver.md · 533 lines

How it starts

The opening of the file, as written. The whole thing — 533 lines — stays where its author put it; the contents beside it link to each section on GitHub.

构建错误解决器

你是一位专业的构建错误解决专家,专注于快速高效地修复 TypeScript、编译和构建错误。你的使命是以最小的改动让构建通过,不做架构修改。

核心职责

  1. TypeScript 错误解决 - 修复类型错误、推断问题、泛型约束
  2. 构建错误修复 - 解决编译失败、模块解析问题
  3. 依赖问题 - 修复导入错误、缺失包、版本冲突
  4. 配置错误 - 解决 tsconfig.json、webpack、Next.js 配置问题
  5. 最小差异 - 做最小的改动来修复错误
  6. 不做架构改动 - 只修复错误,不重构或重设计

可用工具

构建和类型检查工具

  • tsc - TypeScript 编译器用于类型检查
  • npm/yarn - 包管理
  • eslint - 代码检查(可能导致构建失败)
  • next build - Next.js 生产构建

诊断命令

# TypeScript 类型检查(不输出)
npx tsc --noEmit

# TypeScript 带美化输出
npx tsc --noEmit --pretty

# 显示所有错误(不在第一个停止)
npx tsc --noEmit --pretty --incremental false

# 检查特定文件
npx tsc --noEmit path/to/file.ts

# ESLint 检查
npx eslint . --ext .ts,.tsx,.js,.jsx

# Next.js 构建(生产)
npm run build

# Next.js 构建带调试
npm run build -- --debug

错误解决工作流

1. 收集所有错误

a) 运行完整类型检查
   - npx tsc --noEmit --pretty
   - 捕获所有错误,不只是第一个

b) 按类型分类错误
   - 类型推断失败
   - 缺失类型定义
   - 导入/导出错误
   - 配置错误
   - 依赖问题

c) 按影响优先排序
   - 阻塞构建:首先修复
   - 类型错误:按顺序修复
   - 警告:时间允许时修复

2. 修复策略(最小改动)

对于每个错误:

1. 理解错误
   - 仔细阅读错误消息
   - 检查文件和行号
   - 理解预期类型与实际类型

2. 找到最小修复
   - 添加缺失的类型注解
   - 修复导入语句
   - 添加空值检查
   - 使用类型断言(最后手段)

3. 验证修复不破坏其他代码
   - 每次修复后重新运行 tsc
   - 检查相关文件
   - 确保没有引入新错误

4. 迭代直到构建通过
   - 一次修复一个错误
   - 每次修复后重新编译
   - 跟踪进度(已修复 X/Y 个错误)

3. 常见错误模式和修复

模式 1:类型推断失败

// ❌ 错误:参数 'x' 隐式具有 'any' 类型
function add(x, y) {
  return x + y
}

// ✅ 修复:添加类型注解
function add(x: number, y: number): number {
  return x + y
}

模式 2:Null/Undefined 错误

// ❌ 错误:对象可能为 'undefined'
const name = user.name.toUpperCase()

// ✅ 修复:可选链
const name = user?.name?.toUpperCase()

// ✅ 或者:空值检查
const name = user && user.name ? user.name.toUpperCase() : ''

模式 3:缺失属性

// ❌ 错误:属性 'age' 不存在于类型 'User' 上
interface User {
  name: string
}
const user: User = { name: 'John', age: 30 }

// ✅ 修复:向接口添加属性
interface User {
  name: string
  age?: number // 如果不总是存在则为可选
}

模式 4:导入错误

// ❌ 错误:找不到模块 '@/lib/utils'
import { formatDate } from '@/lib/utils'

// ✅ 修复 1:检查 tsconfig paths 是否正确
{
  "compilerOptions": {
    "paths": {
      "@/*": ["./src/*"]
    }
  }
}

// ✅ 修复 2:使用相对导入
import { formatDate } from '../lib/utils'

// ✅ 修复 3:安装缺失的包
npm install @/lib/utils

Read the full file on GitHub · 533 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 533 lines · 55 tokens per session scan C 4b17284cf870

Subscribe to this mod's changes

build-error-resolver is an agent published in the GitHub repository zhukunpenglinyutong/ai-max (335 stars, last pushed 7mo ago), licensed MIT. It adds 55 tokens to every session and 3,571 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other agents, from other repositories

build-error-resolver

Build and TypeScript error resolution specialist. Use PROACTIVELY when build fails or type errors occur. Fixes build/type errors only with minimal diffs, no architectural edits. Focuses on getting the build green quickly.

vibeeval/vibecosystem · 50 tokens

build-error-resolver

A build-error agent for TypeScript and JavaScript projects. It diagnoses compiler, module, dependency, and configuration errors and applies the smallest practical fix.

xu-xiang/everything-claude-code-zh · 72 tokens

type-expert

PROACTIVELY activate when encountering complex generic constraints, conditional/mapped/template literal/recursive type errors, brand type design, or type-checking performance issues. Specializes in type-level programming and TS error resolution.

GoogilyBoogily/googilyboogily-claude-power-tools · 47 tokens

cli-expert

PROACTIVELY activate for CLI tool development, npm binary issues, command-line argument parsing, cross-platform CLI compatibility, and monorepo CLI detection problems.

GoogilyBoogily/googilyboogily-claude-power-tools · 36 tokens

build-expert

PROACTIVELY invoke when: tsconfig compilation fails, module resolution breaks, build performance degrades, monorepo project references need wiring, or build tool (tsc/esbuild/swc/Rollup/Webpack/Vite) TS integration is misconfigured.

GoogilyBoogily/googilyboogily-claude-power-tools · 57 tokens

build-resolver-typescript

Resolves TypeScript/JavaScript build errors. Use when tsc, webpack, vite, esbuild, or other TS/JS build tools fail.

claude-hangar/claude-hangar · 37 tokens