Show HN: Boffin – AI 编程代理的资深工程师层
Show HN: Boffin – Staff-engineer layer for AI coding agents

原始链接: https://github.com/MicSm/boffin

**Boffin** 是一个 AI 编码代理的控制层,旨在防止“过度编辑”——即代理将小修复变成不必要的大规模重写。与应用全局规则的静态 `AGENTS.md` 文件不同,Boffin 仅引导与当前编辑文件相关的架构约束,并强制执行与更改规模相匹配的验证。 通过在编辑前后介入,Boffin 确保代理遵循同步/异步边界、维护状态所有权并避免不必要的范围蔓延。它不是一个代码检查器或沙盒,而是一个架构指南,强制代理通过已验证的结果来证明其更改的合理性。 **主要功能:** * **动态路由:** 提供特定于上下文的约束,而非“一刀切”的提示词。 * **比例验证:** 要求与代码更改复杂度相匹配的检查。 * **可移植且可信:** 通过 npm 发布为已签名、版本化的 markdown 包,兼容 Cursor、Claude Code、Codex 和 OpenCode。 * **性能表现:** 通过案例研究(如 DuckDB、FastAPI)证明可实现精确、已验证的重构。 Boffin 让 AI 代理保持专注,确保“代价高昂的细节”在演变成整个代码库的问题之前得到正确处理。

**Boffin** 是一个全新的“资深工程师”控制层,旨在通过防止 AI 编码代理过度设计变更来提升其表现。作者指出,当代理被要求进行简单的修复时,往往会执行过多且不必要的重构。 Boffin 通过在编辑前立即向代理的上下文中注入特定的架构约束来解决这一问题,迫使其根据这些规则验证结果。与静态的 `AGENTS.md` 文件不同,此过程是针对所修改的特定文件进行的。在 DuckDB、FastAPI 和 LangChain 等代码库上的初步测试表明,Boffin 显著提高了 AI 生成代码的精确度。 该工具兼容 Cursor、Claude Code 和 OpenCode 等代理,并可通过 `npx boffinit` 启动。尽管作者强调了其现实效用,但 Hacker News 上的初步反馈强调,仍需更广泛的评估套件来证明该工具的长期可靠性和一致性。
相关文章

原文

Boffin (npm: boffinit) is a staff-engineer control layer for AI coding agents: it feeds the agent the architectural constraints for the exact file it is editing and makes it verify the result -- DuckDB case study: a guided refactor landed at +17 / -17 lines with 2,104 assertions passing.

You ask for a 15-line fix; the agent comes back with a 500-line renovation. Boffin gives the agent the architectural constraints that apply to the file it is about to touch, then makes it verify the result.

It is not another AGENTS.md and not a prompt pack. Those formats usually ship one static instructions block for the whole repository; Boffin routes only the constraints relevant to the current edit. Powered by ParselFire Core.

Boffin, a staff-engineer control layer for AI coding agents, reviewing an AI-generated diff before a load-bearing wall is removed

  • Not a static repo-wide rules file (AGENTS.md-style one block for everything)
  • Not a prompt pack or system-prompt trick
  • Not a linter or CI gate -- it acts before and after the edit
  • Not a speed tool -- the frame is review-safety
  • Selects the constraints relevant to the edit in front of the agent
  • Requires verification proportional to the change
  • Ships for Cursor, Claude Code, Codex, and OpenCode from one npm package
  • Delivers signed portable packs powered by ParselFire Core

How it differs (honest comparison)

Static rules file (AGENTS.md) Boffin
Delivery Usually one static block for the whole repo Constraints routed to the current edit
Verification None required by the format Required, proportional to the change
Evidence Usually none Recorded case studies with numbers

The public case studies record these guided refactors on real open-source code:

  • DuckDB: +17 / -17; 2,104 assertions across 8 test files passed; distinct continuation and recovery paths were preserved.
  • FastAPI: +16 / -33; 49 tests passed; no public API change.
  • LangChain: the sync/async boundary was preserved; 4 tests passed.

These are reproducible case studies, not a controlled A/B benchmark.

Boffin requires Node.js 18 or newer.

Run from your project:

Run these inside Claude Code:

/plugin marketplace add MicSm/boffin
/plugin install boffin@boffin

Run these from a terminal:

codex plugin marketplace add MicSm/boffin
codex plugin add boffin@boffin

Codex does not trust plugin hooks automatically. Run /hooks once inside Codex to review and trust Boffin's hooks; until then the plugin's skills work but the automatic per-session activation stays off.

Run from your project:

Then open the project in OpenCode. Always-on guidance lands via opencode.json -> .boffin/AGENTS.md. On demand: /boffin, /boffin-review, or the boffin / boffin-review skills.

Install details, commands, and troubleshooting: OpenCode delivery.

Want the machinery? Read how ParselFire Core works.

What Boffin is fussy about

Similar code is not always the same code. Boffin gives the agent a reason to stop before it merges a real special case, blurs a sync/async boundary, moves state away from its owner, or turns a focused task into a tour of the codebase.

  • For a focused change, it keeps the requested scope small and asks for the narrowest check that proves the edit.
  • For an open-ended refactor or review, it requires a read-only audit first, followed by one verified finding at a time.
  • When cleanup conflicts with an earlier correctness rule, correctness wins.

The point is not to make the agent timid. It is to make the expensive details explicit before they become an interesting afternoon.

How is Boffin different from AGENTS.md?

AGENTS.md is usually one static instructions file for the whole repository. Boffin routes only the architectural constraints relevant to the file the agent is about to edit, then requires a check proportional to the change.

Where do the constraints come from?

Every rule ships in this repository as readable, versioned markdown under packs/, and the packs are GPG-signed. Nothing is hidden at install time: open any pack and read every rule before trusting it. At edit time Boffin selects which of those rules apply to the file being touched. See how ParselFire Core works for the routing map.

Why does my coding agent turn small fixes into huge rewrites?

You ask for a small fix; the agent comes back with a renovation. Boffin injects the load-bearing constraints for the current file before the edit and forces verification afterward.

What do lite, full, and max change?

They tune cleanup ambition, not correctness:

  • lite keeps cleanup pressure low and favors the smallest useful change.
  • full is the balanced default.
  • max applies the strongest cleanup pressure when the task justifies it.

On plugin hosts, select a profile with /boffin lite, /boffin full, or /boffin max. There is no off profile.

Do profiles change the safety floor?

No. Every profile keeps the same early correctness stages and rejection rules, including trust-boundary validation, data-loss prevention, security, and accessibility requirements.

Is Boffin a command sandbox or security tool?

No. Boffin does not isolate processes, filter shell commands, or restrict filesystem or network access. It guides architectural decisions in generated code. Use command sandboxes and security controls for their own job; Boffin has a different job.

How do I uninstall the Cursor or OpenCode integration?

npx boffinit cursor uninstall
npx boffinit opencode uninstall

Each uninstaller removes that host's managed files only. Shared .boffin/packs and .boffin/VERSION stay if the other host is still installed. Unrelated project files are left alone.

Does Boffin replace tests or code review?

No. It tells the agent which contracts deserve attention and requires external checks, but your repository's tests and review process remain authoritative.

Portable adapters cover hosts that read AGENTS.md, CLAUDE.md, workspace rules, or repository instructions. See host delivery and adapters for the technical map.

Boffin is available under the MIT License. See credits.

联系我们 contact @ memedata.com