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.
git clone --depth 1 https://github.com/zhukunpenglinyutong/ai-maxnpx agentmods add agents/zhukunpenglinyutong/ai-max/build-error-resolverWrote 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.
[](https://agentmods.dev/agents/zhukunpenglinyutong/ai-max/build-error-resolver)<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.
<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>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.
| Model | Per session | Once 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 |
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 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、编译和构建错误。你的使命是以最小的改动让构建通过,不做架构修改。
核心职责
- TypeScript 错误解决 - 修复类型错误、推断问题、泛型约束
- 构建错误修复 - 解决编译失败、模块解析问题
- 依赖问题 - 修复导入错误、缺失包、版本冲突
- 配置错误 - 解决 tsconfig.json、webpack、Next.js 配置问题
- 最小差异 - 做最小的改动来修复错误
- 不做架构改动 - 只修复错误,不重构或重设计
可用工具
构建和类型检查工具
- 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
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.
- 10d ago First seen · 533 lines · 55 tokens per session scan C 4b17284cf870
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.
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.
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.
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.
cli-expert
PROACTIVELY activate for CLI tool development, npm binary issues, command-line argument parsing, cross-platform CLI compatibility, and monorepo CLI detection problems.
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.
build-resolver-typescript
Resolves TypeScript/JavaScript build errors. Use when tsc, webpack, vite, esbuild, or other TS/JS build tools fail.