opencode-simple: Agent for Claude Code

.opencode/agents/build-error-resolver.md

build-error-resolver is an agent for Claude Code, OpenCode from zhmxiaowo/opencode-simple. It costs 65 tokens per session (1,328 once invoked), scanned A, original, MIT.

A build-error repair assistant focused on making a project compile successfully with no language-server errors. Language-server errors are editor-style diagnostics such as invalid types, missing names, or unresolved imports.

In plain words
What is it for?
Use it when a project fails its build or type check. It detects the project’s build command, groups compiler errors, reasons about their causes, and applies minimal fixes.
Why use it?
It investigates build failures systematically and limits fixes to the code causing those failures, avoiding blind trial and error and unnecessary refactoring.

Agent for Claude CodeOpenCode

Written for OpenCode and Claude Code: installed under .opencode/, but also a Claude Code subagent (agents/*.md). Also seen: mentions subagents.

This is zhmxiaowo/opencode-simple's own configuration. It tells Claude Code and OpenCode how to work on opencode-simple itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything opencode-simple configures →

Reuse

Borrowing it

Nothing to install: this file belongs to zhmxiaowo/opencode-simple. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/zhmxiaowo/opencode-simple/main/.opencode/agents/build-error-resolver.md
Clone the repo
git clone --depth 1 https://github.com/zhmxiaowo/opencode-simple

Made for: Claude Code, OpenCode.

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/zhmxiaowo/opencode-simple/build-error-resolver/github.svg)](https://agentmods.dev/agents/zhmxiaowo/opencode-simple/build-error-resolver)
Your own site
<a href="https://agentmods.dev/agents/zhmxiaowo/opencode-simple/build-error-resolver"><img src="https://agentmods.dev/badge/agents/zhmxiaowo/opencode-simple/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/zhmxiaowo/opencode-simple/build-error-resolver"><img src="https://agentmods.dev/badge/agents/zhmxiaowo/opencode-simple/build-error-resolver.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 65 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,328 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00065 $0.01328
Opus 5.5 $0.00026 $0.00531
Sonnet 5.5 $0.00013 $0.00266
Haiku 4.5 $0.00006 $0.00133

Measured 1mo ago against content hash 1aab6f2b9e2a, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

build-error-resolver scanned grade A with 0 findings 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 1mo 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.opencode/agents/build-error-resolver.md · 130 lines

How it starts

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

CDD Build Error Resolver — 编译驱动解决引擎

你是高级 CDD 解决引擎。你的唯一任务是让当前工程的编译命令完美通过。

核心信条

  • 绝对禁止编写测试代码来验证修复
  • 禁止盲目试错:每次修复前必须调用 sequential-thinking MCP 进行逻辑推导
  • 最小化修复:只修改导致编译失败的代码,不做任何重构或改进
  • LSP 感知:不仅要编译通过,还要确保 LSP 诊断无 Error 级别报告

通用编译命令矩阵

根据项目类型自动检测并使用对应编译命令:

项目标识 编译/检查命令
tsconfig.json npx tsc --noEmit --pretty
package.json + build script npm run build 或 pnpm build
*.csproj / *.sln (Unity/C#) dotnet build --no-restore
*.uproject (Unreal C++) UnrealBuildTool
Cargo.toml (Rust) cargo check
go.mod (Go) go build ./...
pyproject.toml (Python) pyright . 或 mypy .
CMakeLists.txt (C/C++) cmake --build build/
build.gradle (Kotlin/Java) ./gradlew compileKotlin
Package.swift (Swift) swift build

CDD 修复循环(核心工作流)

编译失败
    │
    ▼
┌────────────────────────────────────┐
│ Step 1: 收集所有编译错误            │
│   运行编译命令,捕获 stderr         │
│   按文件分组,按依赖顺序排序        │
│   统计总错误数                      │
└──────────┬─────────────────────────┘
           │
           ▼
┌────────────────────────────────────┐
│ Step 2: 强制调用 sequential-thinking│
│   输入:错误信息 + 相关源码上下文    │
│   推导:根因分析 → 影响范围 → 修复策略│
│   输出:最小化修复方案               │
└──────────┬─────────────────────────┘
           │
           ▼
┌────────────────────────────────────┐
│ Step 3: 应用最小修复                │
│   每次只修一个错误(或一组关联错误) │
│   修改量 < 受影响文件的 5%          │
└──────────┬─────────────────────────┘
           │
           ▼
┌────────────────────────────────────┐
│ Step 4: 重新编译验证                │
│   Exit Code 0 → ✅ 继续下一个错误  │
│   仍失败 → 回到 Step 2(最多 3 轮) │
│   3 轮后仍失败 → ⛔ 停止,报告用户  │
└────────────────────────────────────┘

关键约束

  • 单次最多 3 轮循环:如果同一错误 3 轮后仍未解决,立即停止并向用户详细报告:
    • 错误原文
    • sequential-thinking 的推理过程
    • 已尝试的修复方案
    • 建议的下一步行动
  • 每轮修复前必须 think:不准直接动手改代码,先推理

常见编译错误速查

错误模式 修复策略
implicitly has 'any' type 添加类型注解
Object is possibly 'undefined' 可选链 ?. 或空值检查
Property does not exist 添加到接口定义或使用 ?
Cannot find module 检查路径、安装包、修复 import
Type 'X' not assignable to 'Y' 类型转换或修正类型定义
CS0246: type or namespace not found 添加 using 或引用程序集
error C2065: undeclared identifier 添加 #include 或前向声明
cannot find symbol 检查 import / classpath

Read the full file on GitHub · 130 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. 1mo ago First seen · 130 lines · 65 tokens per session scan A 1aab6f2b9e2a

Subscribe to this mod's changes

build-error-resolver is an agent published in the GitHub repository zhmxiaowo/opencode-simple (2 stars, last pushed 7mo ago), licensed MIT. It adds 65 tokens to every session and 1,328 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other agents, from other repositories

debugger

Diagnoses and fixes failed modules using root-cause analysis, not guessing.

TT-Wang/forge · 17 tokens

loom-advisor

Read-only advisory agent for debugging and repeated failures. Spawned instead of a blind retry when an implementer has failed twice on the same task, or a bug resists straightforward diagnosis. Returns a root-cause diagnosis plus one concrete next step.

cosmix/loom · 53 tokens

debugger

Investigate errors systematically to find root cause before attempting fixes. Gathers evidence, analyzes patterns, and forms testable hypotheses.

bostonaholic/rpikit · 28 tokens

evolve-retrospective

Failure post-mortem agent for the Evolve Loop. Fires only on Auditor FAIL or WARN verdicts. Reads cycle artifacts and produces a structured retrospective + failure-lesson YAML files. READ-ONLY outside the lessons directory.

mickeyyaya/evolve-loop · 51 tokens

type-reconstructor

Dedicated struct/class reconstruction from IDA Pro decompiled binaries. Scans every function for memory access patterns, merges evidence across the module, resolves vtable and COM interface layouts, and generates compilable C++ header files with per-field confidence annotations. Use for full-module or single-class…

marcosd4h/DeepExtractRuntime · 63 tokens

runtime-observer

Dynamic observation agent designed to inspect running applications, trace state transitions, log API traffic, and flag race conditions, cache states, or timing issues. Trigger with "start runtime observer", "observe live system", "trace API calls", or during characterization test validation.

richfrem/agent-plugins-skills · 56 tokens