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.
npx agentmods add agents/cfrs2005/claude-init/build-error-resolvergit clone --depth 1 https://github.com/cfrs2005/claude-initWhat 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 | $0.00060 | $0.03616 |
| Opus 5 | $0.00030 | $0.01808 |
| Sonnet 5 | $0.00012 | $0.00723 |
| Haiku 4.5 | $0.00006 | $0.00362 |
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 2d 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 Copies of this mod
1 near-identical copy found in the catalogue:
- build-error-resolver — 86% identical, 224 lines differ
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 配置问题
- 最小化 Diff - 用尽可能小的变更修复错误
- 无架构变更 - 仅修复错误,不重构或重新设计
可用工具
构建与类型检查工具
- 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. 理解错误
- 仔细阅读错误信息
- 检查文件和行号
- 理解预期类型 vs 实际类型
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 路径是否正确
{
"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.
- 2d ago First seen · 533 lines · 60 tokens per session scan C 69d4ff387b51
build-error-resolver is an agent published in the GitHub repository cfrs2005/claude-init (1,364 stars, last pushed 5mo ago), licensed MIT. It adds 60 tokens to every session and 3,616 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
Demonstrate
Agent for demonstrating VS Code features.
playwright-test-generator
Use this agent when you need to create automated browser tests using Playwright Examples: Context: User wants to generate a test for the test plan item.
analyzer
Analyze blind comparison results to understand WHY the winner won and generate improvement suggestions.
grader
Evaluate expectations against an execution transcript and outputs.
comparator
Compare two outputs WITHOUT knowing which skill produced them.
.NET-Notebook-Migration-Agent
Expert .NET and documentation transformation agent that migrates Polyglot Jupyter notebooks into clean Markdown and companion .NET sample code.