Give Gemini the error, the reproduction, and the relevant code, then ask for the most likely root cause, a minimal fix, and how to confirm it — before touching anything else.
提示词
Here is a bug. Symptom: [SYMPTOM]. Reproduction: [STEPS]. Relevant code: [CODE/FILES]. Identify the most likely root cause with reasoning, propose the minimal fix, and tell me how to confirm it works. Do not suggest unrelated refactors. If you are unsure, list what to check next.
替换变量
[SYMPTOM]Exact error text or wrong behaviour.
[STEPS]How to reproduce.
[CODE/FILES]The smallest slice that contains the bug.
该用哪个模型
- Gemini 3.1 Pro — Root-cause reasoning over multiple files is stronger on Pro.
示例输入
- [SYMPTOM] = "TypeError: cannot read property id of undefined on checkout".
示例输出
我们只发布来自真实模型运行的示例输出。此模板尚未经过正式测试,因此不显示输出。请用上方的输入自行运行。
为何这一结构有效
- Anchoring on reproduction keeps the model from guessing in the dark.
- Banning unrelated refactors keeps the diff small and reviewable.
常见失败与修复
It guesses without the real code.
修复:Paste the actual failing function and stack trace.
已知局限
- Confirm the fix by reproducing the bug first, then re-running.