返回全部动态

Geoffrey Huntley:用 pre-commit hook 约束 AI 代理使用诊断库

原标题:Quoting Geoffrey Huntley

Simon Willison's Weblog观点质量 60

AI 摘要

Geoffrey Huntley 提出一种约束 AI 编码代理的方法:当代理绕过诊断库直接调用可观测性模块时,通过 pre-commit hook 检查 git diff 并让提交失败,同时注入提示要求代理使用诊断库。他认为这样能显著提升代理表现,并主张不应再手写代码。

以上摘要由 AI 生成,可能存在误差。事实请以原文为准。

正文节选

13th October 2026 If the agent isn't using my diagnostics library, I could introspect and update AGENTS.md, but there's still a delta, and it'll drift. Instead, I write a pre-commit hook that checks the git diff for direct calls to observability modules that bypass my diagnostics module. Boom: fail the commit, inject a prompt telling the agent to use the diagnostics library. All of a sudden it's ten out of ten. — Geoffrey Huntley, nobody should type code by hand anymore. here's what's left. Rece


发布时间:2026-10-13 21:32
抓取时间:2026-10-13 21:52
来源机构:Simon Willison
阅读原文simonwillison.net