Simon Willison·· 1 天前AI 评分47
引用 Geoffrey Huntley:用 pre-commit hook 提醒智能体使用诊断库
Quoting Geoffrey Huntley
AI 导读
Geoffrey Huntley建议设置 pre-commit hook,检查 git diff 中绕过诊断库、直接调用 observability 模块的代码,并在提交失败时提示智能体改用诊断库。他称这样一来效果“十分出色”。
正文
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.
来源:Simon Willison · simonwillison.net