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.