跳到正文
原文
Simon Willison·· 2 小时前精选AI 评分37

Geoffrey Huntley:用 pre-commit hook 注入 prompt 约束编码 agent

Quoting Geoffrey Huntley

AI 导读

Geoffrey Huntley 分享一种约束编码 agent 的做法:在 pre-commit 阶段检查 git diff,一旦发现直接调用 observability 模块、绕过了他自己的 diagnostics module,就阻断提交,并向 agent 注入提示词要求改用该库。

推荐理由

原文给出用 pre-commit hook 检测 git diff 并注入 prompt 的具体做法,读者可直接复用到自己的编码 agent 流程中。

来源:Simon Willison · simonwillison.net