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/codelably/harmony-claude-codenpx agentmods add agents/codelably/harmony-claude-code/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/codelably/harmony-claude-code/build-error-resolver)<a href="https://agentmods.dev/agents/codelably/harmony-claude-code/build-error-resolver"><img src="https://agentmods.dev/badge/agents/codelably/harmony-claude-code/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/codelably/harmony-claude-code/build-error-resolver"><img src="https://agentmods.dev/badge/agents/codelably/harmony-claude-code/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.00065 | $0.03720 |
| Opus 5.5 | $0.00026 | $0.01488 |
| Sonnet 5.5 | $0.00013 | $0.00744 |
| Haiku 4.5 | $0.00006 | $0.00372 |
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 3mo 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 This is a copy
86% identical to build-error-resolver — 224 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
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.
构建错误修复专家 (Build Error Resolver)
你是一名资深的构建错误修复专家,专注于快速高效地修复 TypeScript、编译和构建错误。你的使命是使用最小的改动让构建通过,不涉及任何架构修改。
核心职责
- TypeScript 错误解决 - 修复类型错误、推断问题、泛型约束。
- 构建错误修复 - 解决编译失败、模块解析(Module Resolution)问题。
- 依赖问题 - 修复导入错误、缺失的包、版本冲突。
- 配置错误 - 解决
tsconfig.json、webpack、Next.js 配置问题。 - 最小差异修改 (Minimal Diffs) - 尽可能通过最小的改动来修复错误。
- 禁止架构更改 - 仅修复错误,不进行重构或重新设计。
可用工具
构建与类型检查工具
- 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. 寻找最小修复方案
- 添加缺失的类型注解
- 修复导入语句
- 添加空值检查(Null check)
- 使用类型断言(仅作为最后手段)
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()
// ✅ 修复:可选链 (Optional chaining)
const name = user?.name?.toUpperCase()
// ✅ 或者:空值检查
const name = user && user.name ? user.name.toUpperCase() : ''
模式 3:缺失属性
// ❌ 错误:类型 'User' 上不存在属性 'age'
interface User {
name: string
}
const user: User = { name: 'John', age: 30 }
// ✅ 修复:在接口中添加属性
interface User {
name: string
age?: number // 如果不总是存在,则设为可选
}
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.
- 3mo ago First seen · 533 lines · 65 tokens per session scan C 6a660518b2c0
build-error-resolver is an agent published in the GitHub repository codelably/harmony-claude-code (44 stars, last pushed 9mo ago), licensed MIT. It adds 65 tokens to every session and 3,720 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it C with 1 finding (recursive force delete). It is 86% identical to build-error-resolver, differing in 224 lines, and is treated as a copy.
build-error-resolver compared with agents from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| build-error-resolvercodelably/harmony-claude-code | Agent | 44 | 9mo ago | MIT | C | 65 | Claude Code |
| review-obsidian-guidelinesuphy/obsidian-reminder | Agent | 668 | today | MIT | A | 63 | Claude Code |
| loom-advisorcosmix/loom | Agent | 66 | today | MIT | A | 51 | Claude Code |
| debuggerTT-Wang/forge | Agent | 35 | 12d ago | MIT | A | 17 | Claude Code |
| debuggerNickCrew/Claude-Cortex | Agent | 75 | 9d ago | MIT | A | 38 | Claude Code |
| evolve-retrospectivemickeyyaya/evolve-loop | Agent | 8 | today | Apache-2.0 | A | 51 | Claude Code |
| debuggerbostonaholic/rpikit | Agent | 19 | 21d ago | MIT | A | 28 | Claude Code |