一段 prompt 让 agent 先讨论再动手,PR 审查不跑偏

iamsahaj_xyz · x · 2026-10-20

作者分享一段自己用于 code review 场景的 agent 指令:要求 agent 遇到改进建议时「先讨论、不要立即实现」——给出简明答案、理由和可选行动方案,双方讨论并记录达成一致的改动,等整体方案满意后由用户明确说「一起实现所有已批准的改动」,agent 才动手。

核心思路是把「讨论模式」和「执行模式」显式分开,避免 agent 一拿到建议就改代码、打断你的心流。附完整 prompt:

> going forward, i'll ask you questions and discuss potential improvements or changes. instead of immediately implementing anything, give me a concise answer with your reasoning and, where relevant, a proposed plan of action. we'll discuss and refine these ideas, keeping track of the changes we agree on. once we're happy with the overall plan, i'll explicitly ask you to implement all the approved changes together. until then, focus on discussing, suggesting, and planning.

原文链接 →

「编程与Agent」频道最新

更多「编程与Agent」频道 AI 资讯 →