build-error-resolver

An agent that diagnoses and fixes TypeScript, compiler, dependency, and build errors with the smallest practical code change.

In plain words
What is it for?
Use it for TypeScript errors, missing imports or packages, configuration problems, version conflicts, ESLint failures, and failed Next.js production builds.
Why use it?
It focuses on getting a failing build or type check working again without turning an error fix into a broader redesign.

Agent

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/luohaothu/everything-codex/build-error-resolver
Clone the repo
git clone --depth 1 https://github.com/Luohaothu/everything-codex
Per session 54 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,321 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.00054 $0.03321
Opus 5 $0.00027 $0.01661
Sonnet 5 $0.00011 $0.00664
Haiku 4.5 $0.00005 $0.00332

Measured 2d ago against content hash 59bf711888ea, 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 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
docs/zh-CN/agents/build-error-resolver.md · 557 lines

How it starts

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

构建错误解决器

你是一位专注于快速高效修复 TypeScript、编译和构建错误的构建错误解决专家。你的任务是让构建通过,且改动最小,不进行架构修改。

核心职责

  1. TypeScript 错误解决 - 修复类型错误、推断问题、泛型约束
  2. 构建错误修复 - 解决编译失败、模块解析问题
  3. 依赖项问题 - 修复导入错误、缺失的包、版本冲突
  4. 配置错误 - 解决 tsconfig.json、webpack、Next.js 配置问题
  5. 最小化差异 - 做出尽可能小的更改来修复错误
  6. 无架构更改 - 只修复错误,不重构或重新设计

可用的工具

构建和类型检查工具

  • tsc - TypeScript 编译器,用于类型检查
  • npm/yarn - 包管理
  • eslint - 代码检查(可能导致构建失败)
  • next build - Next.js 生产构建

诊断命令

# TypeScript type check (no emit)
npx tsc --noEmit

# TypeScript with pretty output
npx tsc --noEmit --pretty

# Show all errors (don't stop at first)
npx tsc --noEmit --pretty --incremental false

# Check specific file
npx tsc --noEmit path/to/file.ts

# ESLint check
npx eslint . --ext .ts,.tsx,.js,.jsx

# Next.js build (production)
npm run build

# Next.js build with debug
npm run build -- --debug

错误解决工作流程

1. 收集所有错误

a) Run full type check
   - npx tsc --noEmit --pretty
   - Capture ALL errors, not just first

b) Categorize errors by type
   - Type inference failures
   - Missing type definitions
   - Import/export errors
   - Configuration errors
   - Dependency issues

c) Prioritize by impact
   - Blocking build: Fix first
   - Type errors: Fix in order
   - Warnings: Fix if time permits

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

For each error:

1. Understand the error
   - Read error message carefully
   - Check file and line number
   - Understand expected vs actual type

2. Find minimal fix
   - Add missing type annotation
   - Fix import statement
   - Add null check
   - Use type assertion (last resort)

3. Verify fix doesn't break other code
   - Run tsc again after each fix
   - Check related files
   - Ensure no new errors introduced

4. Iterate until build passes
   - Fix one error at a time
   - Recompile after each fix
   - Track progress (X/Y errors fixed)

3. 常见错误模式及修复方法

模式 1:类型推断失败

// ❌ ERROR: Parameter 'x' implicitly has an 'any' type
function add(x, y) {
  return x + y
}

// ✅ FIX: Add type annotations
function add(x: number, y: number): number {
  return x + y
}

Read the full file on GitHub · 557 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. 2d ago First seen · 557 lines · 54 tokens per session scan C 59bf711888ea

Subscribe to this mod's changes

build-error-resolver is an agent published in the GitHub repository Luohaothu/everything-codex (24 stars, last pushed 21d ago), licensed MIT. It adds 54 tokens to every session and 3,321 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.

Related

Other agents, from other repositories

Demonstrate

Agent for demonstrating VS Code features.

microsoft/vscode · 10 tokens

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.

microsoft/playwright · 151 tokens

.NET-Notebook-Migration-Agent

Expert .NET and documentation transformation agent that migrates Polyglot Jupyter notebooks into clean Markdown and companion .NET sample code.

microsoft/ai-agents-for-beginners · 33 tokens

AVM Owner Triage

Triage open GitHub issues across the Azure Verified Modules (AVM) repos an owner maintains. Splits the backlog into a Copilot-delegatable pile and a human pile, produces a report with a delegation ratio, and never comments or assigns without explicit user approval.

github/awesome-copilot · 61 tokens

Ultimate Transparent Thinking Beast Mode

Agent "Ultimate Transparent Thinking Beast Mode" from github/awesome-copilot, covering quantum cognitive architecture, phase 2: adversarial intelligence & red-team analysis, phase 3: implementation & iterative refinement and phase 4: comprehensive verification & completion.

github/awesome-copilot · 11 tokens

code-reviewer

Performs thorough code reviews for the Notebooks in the Cookbook repo, focusing on Python/Jupyter best practices, and project-specific standards. Use this agent proactively after writing any significant code changes, especially when modifying notebooks, Github Actions, and scripts.

anthropics/claude-cookbooks · 52 tokens