Understand a confusing error message and troubleshoot step by step
A ready-to-use “Programming” AI prompt template, designed and tested with GitHub Copilot. Replace the (bracketed) parts below with your own needs.
Prompt template
I hit an error running code and can't quite understand it — as a senior engineer, walk me through figuring it out and fixing it step by step. What I'm doing: (e.g., running a Python script / starting a project) Language or framework and version: (if known) Full error message: (paste the whole thing, including the traceback) Relevant code snippet: (paste the part that might be failing) What I've tried: (if any) Please: 1. Explain in plain language what this error is actually saying and the most likely cause 2. List 2-3 most likely problem spots, ranked by likelihood 3. Give me concrete fix steps and the corrected code 4. Teach me how to read this kind of error myself next time and how to narrow it down Constraint: confirm the cause before giving a fix, don't just hack at it; state uncertain parts clearly.
How to use this prompt
- Copy the whole prompt above and paste it into GitHub Copilot or ChatGPT / Claude / Gemini.
- Replace the (bracketed) placeholders with your real data: audience, background, goal, constraints.
- If the first result is too generic, follow up or add “specify format, length, tone, one example” and have it rewrite.
Recommended tool: GitHub Copilot — GitHub Copilot: The AI coding assistant born from a partnership between GitHub and OpenAI.