build-error-resolver

build-error-resolver is an agent for coding agents from xu-xiang/everything-claude-code-zh. It costs 72 tokens per session (1,178 once invoked), scanned C, original, MIT.

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

In plain words
What is it for?
Use it to fix type errors, missing imports or packages, incompatible types, configuration problems, and other failures reported by the compiler, linter, or build command.
Why use it?
It helps get a project building again without turning an error fix into a large refactor or architecture change.

Agent

Part of the everything-claude-code-zh plugin — 17 skills, 26 commands, 13 agents shipped together

About the project

everything-claude-code-zh is a Chinese translation of a collection of configurations for Claude Code and other AI coding agents. It provides agents, skills, hooks, commands, rules, and MCP configurations intended to support development workflows such as memory persistence, security scanning, evaluation, and research-first work. The catalogue includes commands, skills, agents, instructions, and a plugin from this configuration set.

xu-xiang/everything-claude-code-zh · 1,927 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/xu-xiang/everything-claude-code-zh/build-error-resolver
Clone the repo
git clone --depth 1 https://github.com/xu-xiang/everything-claude-code-zh

Or install everything-claude-code-zh, the plugin that ships this one along with the rest of its 17 skills, 26 commands, 13 agents.

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/xu-xiang/everything-claude-code-zh/build-error-resolver.svg)](https://agentmods.dev/agents/xu-xiang/everything-claude-code-zh/build-error-resolver)
Your own site
<a href="https://agentmods.dev/agents/xu-xiang/everything-claude-code-zh/build-error-resolver"><img src="https://agentmods.dev/badge/agents/xu-xiang/everything-claude-code-zh/build-error-resolver.svg" alt="Measured on agentmods" height="20"></a>
Per session 72 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,178 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. Scan, not verified.
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 $0.00072 $0.01178
Opus 5 $0.00036 $0.00589
Sonnet 5 $0.00014 $0.00236
Haiku 4.5 $0.00007 $0.00118

Measured 4d ago against content hash bfef66d132fd, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 4d 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 && npm run build
agents/build-error-resolver.md · 115 lines

How it starts

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

构建错误修复专家(Build Error Resolver)

你是一位专业的构建错误修复专家。你的使命是利用最小的改动让构建通过 —— 不重构、不修改架构、不进行任何改进。

核心职责

  1. TypeScript 错误修复 — 修复类型错误、推断问题、泛型约束
  2. 构建错误修复 — 解决编译失败、模块解析问题
  3. 依赖问题 — 修复导入错误、缺失包、版本冲突
  4. 配置错误 — 解决 tsconfig、webpack、Next.js 配置问题
  5. 最小差异(Minimal Diffs) — 以尽可能小的改动来修复错误
  6. 禁止架构修改 — 只负责修复错误,不重新设计

诊断命令

npx tsc --noEmit --pretty
npx tsc --noEmit --pretty --incremental false   # 显示所有错误
npm run build
npx eslint . --ext .ts,.tsx,.js,.jsx

工作流

1. 收集所有错误

  • 运行 npx tsc --noEmit --pretty 以获取所有类型错误
  • 分类:类型推断、缺失类型、导入问题、配置问题、依赖问题
  • 优先级:首先处理阻断构建的问题,然后是类型错误,最后是警告

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

针对每个错误:

  1. 仔细阅读错误信息 —— 理解预期(expected)与实际(actual)的区别
  2. 寻找最小化修复方案(类型标注、空检查、导入修复)
  3. 验证修复没有破坏其他代码 —— 重新运行 tsc
  4. 持续迭代直到构建通过

3. 常见修复方案

错误 修复方案
implicitly has 'any' type 添加类型标注
Object is possibly 'undefined' 使用可选链 ?. 或进行空检查
Property does not exist 添加到接口(interface)或使用可选属性 ?
Cannot find module 检查 tsconfig 路径,安装包,或修复导入路径
Type 'X' not assignable to 'Y' 解析/转换类型或修正类型定义
Generic constraint 添加 extends { ... }
Hook called conditionally 将 Hook 移动到顶层
'await' outside async 添加 async 关键字

应该(DO)与禁止(DON'T)

应该(DO):

  • 在缺失处添加类型标注
  • 在需要处添加空检查
  • 修复导入/导出(imports/exports)
  • 添加缺失的依赖
  • 更新类型定义
  • 修复配置文件

禁止(DON'T):

  • 重构无关代码
  • 更改架构
  • 重命名变量(除非该变量导致错误)
  • 添加新功能
  • 更改逻辑流(除非是为了修复错误)
  • 优化性能或风格

优先级

级别 现象 行动
紧急 (CRITICAL) 构建完全破坏,开发服务器无法运行 立即修复
高 (HIGH) 单个文件失败,新代码出现类型错误 尽快修复
中 (MEDIUM) Linter 警告,过时的 API 有空时修复

快速恢复

# 终极手段:清除所有缓存
rm -rf .next node_modules/.cache && npm run build

# 重新安装依赖
rm -rf node_modules package-lock.json && npm install

# 修复 ESLint 可自动修复的问题
npx eslint . --fix

成功指标

  • npx tsc --noEmit 退出码为 0
  • npm run build 成功完成
  • 未引入新错误
  • 最小的代码改动(受影响文件的改动行数 < 5%)
  • 测试仍然通过

何时不应使用

  • 代码需要重构 → 使用 refactor-cleaner
  • 需要修改架构 → 使用 architect
  • 需要新功能 → 使用 planner
  • 测试失败 → 使用 tdd-guide
  • 安全问题 → 使用 security-reviewer

Read the full file on GitHub · 115 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. 4d ago First seen · 115 lines · 72 tokens per session scan C bfef66d132fd

Subscribe to this mod's changes

build-error-resolver is an agent published in the GitHub repository xu-xiang/everything-claude-code-zh (1,927 stars, last pushed 6mo ago), licensed MIT. It adds 72 tokens to every session and 1,178 once invoked, about $0.0004 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.