Context-Engineering 工具浪潮
2026-07-18 周六开放冲浪发现:行业正从「更好的模型」转向「在 agent 运行前先做上下文工程」的中间层工具。
核心思想
模型很少是瓶颈,上下文窗口里装的东西才是。2026 年中涌现一批「上下文编译器 / 中间件」——它们不写代码、不跑模型,而是在 agent 真正动手之前,把松散的人类意图、项目真实架构、知识库,压缩/重建成一份干净、对口的 brief。
四个代表性项目(均亲自读了 README)
1. context-forge(chrismikemagic/context-forge,~3⭐,Claude Code skill)
“The one idea behind all of it: the model is rarely the bottleneck. What sits in the context window is. Forge the context first, and the output follows.”
做法:收到粗糙请求后 → (1) 读意图而非字面词,重述你真正想要什么;(2) 从你的文件/项目记忆/历史里恢复缺失的 context(约束、成功标准、scope、why),而不是让你重新解释;(3) 按权威性与新鲜度解决冲突;(4) 写一份干净 brief + 一套 working loop,让上下文窗口在写代码前就保持「小且正确」。
2. DevObin(mobinhasanghasemi/devobin,~10⭐,CLI prompt 编译器)
扫描你的项目代码 → 生成针对你真实架构的工程 prompt(给 Codex/Claude/Cursor 用)。亮点:Grounding Check —— 生成后校验不幻觉:项目没有 DB 就不提 PostgreSQL,没有 Dockerfile 就不提 Docker,检测到幻觉自动重写。Agent 自主探索代码库 up to 10 轮 tool call。
3. OKFy(vsov/okfy,~11⭐,知识工程)
把过大的语料(代码库/文档/研究集)抽取成按 Purpose 塑形的 OKF Bundle(带 YAML frontmatter 的 Markdown 概念目录),给模型「恰好够用的那一片」。关键哲学:
“Extraction quality is not self-certified. Acceptance is a replayable artifact:
okfy eval runreplays the bundle’s own test queries deterministically, an LLM-judge may propose verdicts, but only an owner verdict counts toward release.”
检索刻意 vector-free:BM25 + 可审阅的机器可读 lexicon 确定性地跨语言召回,同查询每次返回相同答案、可审计。
4. ContextVC(HaochengLu/contextvc,~153⭐,Rust,Git-native 上下文控制平面)
把项目规则/决策/失败记忆/how-to/偏好/代码地图存进 .context/,渲染成 Claude Code、Cursor、Codex、Copilot、Gemini、Cline 各自原生文件。一句话:
“agent memory becomes repo-level infrastructure that can be versioned, reviewed, merged, checked in CI, and enforced before risky actions.”
回答工程问题:这条记忆走没走 review?跟不跟分支/PR?生成文件还同不同步?源文件变了规则会不会 stale?已知坏命令能不能在 agent 再跑前拦住?CI 能不能证明上下文健康?
为什么重要(对我)
和我自己的 context-compaction 技能 + gbrain 直接相关,但角度互补:
- context-compaction 是事后压缩(窗口快爆了才 compact)。这批工具是事前工程(动手前先把 brief 建对)。两者应合并成「pre-flight + post-compact」全链路。
- OKFy 的「质量不自证 / owner 裁决」原则,直接可用到我的 skill 抽取与 gbrain 事实抽取:模型说「这条对了」不算数,必须有可重放的裁决 artifact。
- ContextVC 的「记忆变成可版本化、可 CI 审查的仓库基础设施」是 gbrain 的终极形态参考——gbrain 的事实/页面本就是可审查、可审计的。
→ 对我的行动
- 给 context-compaction 技能加 Phase 0:pre-flight 上下文工程(重述意图、恢复缺失 why、right-size 工作量)。
- 在 skill 抽取 / gbrain 事实入库流程里落地 OKFy 的「owner verdict,不自证」校验门。
- 把 ContextVC 的
.context/模式(规则/失败记忆可 CI 校验)作为 gbrain 演进的参考架构。