Claude · OpenAI GPT · Gemini
程式碼除錯與重構.
先重現相同的間歇性 API 錯誤
三個示例都處理同一個問題,不先假設是 race condition,也不把普通網頁對話寫成具有 repository 讀寫能力。此頁沒有附測試專案或 stack trace。
內容審校
共同需求
TypeScript Next.js 專案的 /api/comments 偶爾回 500;先確認可讀材料與重現步驟,再提最小範圍修正,以回歸測試和 typecheck 驗證。
01
Claude
官方版本文件已核對 · Fable 5.1 / Opus 5.5 / Sonnet 5.5 / Haiku 5.5 · 來源查核
撰寫方式
先說清楚目標、可用材料及允許修改的範圍。
英文提示詞示例
In the supplied TypeScript Next.js project, investigate intermittent HTTP 500 responses from /api/comments. Start by listing the files, stack traces and reproduction evidence you can actually access. Do not assume a root cause. Propose the smallest fix within the comments module, explain alternatives and wait if a required scope decision is missing. Preserve unrelated changes. Do not change authentication, sessions, billing, credits or dependencies. If the environment supports edits and execution, implement the agreed fix and run the relevant regression test and typecheck. Otherwise provide a reviewable patch and commands to run. Report exact changes, commands, exit codes and remaining uncertainty. Never describe unrun tests or unavailable files as checked.設定與使用
依實際 Claude 介面或開發工具提供材料。網頁對話與可讀寫 repository 的代理環境具有不同權限。
要留意
- 確認使用環境真的能讀到需要的檔案。
- 要求回報執行證據,未跑的測試不得寫成通過。
02
OpenAI GPT
官方版本文件已核對 · GPT-6 Astra / GPT-6.1 Sol / GPT-6 Luna · 來源查核
撰寫方式
明確列出可用材料、交付格式與缺資料時的處理方式。
英文提示詞示例
In the supplied TypeScript Next.js project, investigate intermittent HTTP 500 responses from /api/comments. Start by listing the files, stack traces and reproduction evidence you can actually access. Do not assume a root cause. Propose the smallest fix within the comments module, explain alternatives and wait if a required scope decision is missing. Preserve unrelated changes. Do not change authentication, sessions, billing, credits or dependencies. If the environment supports edits and execution, implement the agreed fix and run the relevant regression test and typecheck. Otherwise provide a reviewable patch and commands to run. Report exact changes, commands, exit codes and remaining uncertainty. Never describe unrun tests or unavailable files as checked.設定與使用
在實際使用的 OpenAI 產品中選擇可用模型及工具。API 模型清單不代表 ChatGPT 帳號具有同名模型或所有功能。
要留意
- 沒有提供的附件或來源不能當成已讀。
- 文字回覆不等於已搜尋、修改檔案或執行測試。
03
Gemini
官方版本文件已核對 · 3.8 Flash / 3.5 Flash-Lite · 來源查核
撰寫方式
先建立材料清單,標示可見範圍,再要求有依據的分析。
英文提示詞示例
In the supplied TypeScript Next.js project, investigate intermittent HTTP 500 responses from /api/comments. Start by listing the files, stack traces and reproduction evidence you can actually access. Do not assume a root cause. Propose the smallest fix within the comments module, explain alternatives and wait if a required scope decision is missing. Preserve unrelated changes. Do not change authentication, sessions, billing, credits or dependencies. If the environment supports edits and execution, implement the agreed fix and run the relevant regression test and typecheck. Otherwise provide a reviewable patch and commands to run. Report exact changes, commands, exit codes and remaining uncertainty. Never describe unrun tests or unavailable files as checked.設定與使用
確認目前介面可接受的檔案與模型限制,分批提供必要材料;不要假定整個 repository 已上傳或完整讀取。
要留意
- 可接受的輸入大小不代表每個事實都被正確引用。
- 回覆中的引用與修改建議仍需逐項核對。
複製不會送出生成。請先到目標平台確認模型、模式與可用功能。
拿到結果後檢查
- 根因有可重現證據,不是由提示詞預設答案。
- diff 僅含允許範圍,保留他人未提交修改。
- 測試名稱、命令與退出碼有記錄;未執行項目清楚列出。
選擇與驗收
先確認你使用的環境能讀寫哪些檔案、能否執行測試,再挑工作方式。評估修補的依據是實際 diff 與執行證據。