跳到正文
Simon Willison·· 4 小时前AI 评分67

Geoffrey Huntley:用 pre-commit hook 约束 Agent 编码而非依赖 AGENTS.md

Quoting Geoffrey Huntley

AI 导读

Simon Willison 引述 Geoffrey Huntley 的观点:如果 Agent 不使用他的 diagnostics 库,仅靠检查和更新 AGENTS.md 仍会有偏差和漂移。

正文 · 原文

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