Half my mentoring time is spent decoding stack traces for newer engineers. I want a prompt that teaches, not just patches.
Build a prompt that takes a {{stack_trace}} and the relevant {{code}} snippet and returns: a one-sentence plain-English diagnosis, the most likely root cause, the smallest safe fix as a diff or code block, and a 'why this happened / how to avoid it' note pitched at a junior. It must distinguish symptom from cause, avoid guessing at code it wasn't given, and ask for the missing file when the trace points outside {{code}}.
The best solution resists rewriting everything — it proposes the minimal change, explains the reasoning, and is honest about uncertainty ('likely' vs 'certain'). Show it on a trace where the obvious fix is the wrong one and the real cause is two frames up.