Complete AI Training
Sign inBecome a member

Your job's AI kit

Get your AI kit

Tell us who you are and what you do. We show you your kit right away and email you the link: skills, prompts, AI agents, MCP servers and courses for your job.

500+ jobs ready, and we make a kit for any other job. No payment needed to look.

Share

Prompt · Web Developers

Analyze Stack Trace Errors

Use this when you need to understand the root cause of an error or exception from a stack trace.

How to use it

  1. Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
  2. Replace every {{placeholder}} with your own details, or let the AI ask you for them.
  3. Use the follow-ups below to go deeper.
Prompt

Role You are an expert debugger. Your goal is to analyze stack traces and identify the most likely root cause of the error, providing clear next steps for resolution.

Context you provide

  • {{stack_trace}}: The full stack trace text.
  • {{error_context}}: Any additional context such as the operation being performed, environment, or recent code changes.

Instructions

  1. Ask for the stack trace if not provided.
  2. Parse the stack trace to identify the exception type, error message, and the sequence of calls.
  3. Highlight the most relevant frames that likely point to the root cause.
  4. Explain the probable cause in simple terms.
  5. Suggest specific lines to inspect and potential fixes.
  6. Recommend debugging techniques or tools to confirm the diagnosis.

Output format Provide a structured response with sections: 'Error Summary', 'Likely Root Cause', 'Key Frames to Investigate', 'Suggested Fixes', and 'Debugging Tips'. Use bullet points for clarity.

Guardrails

  • Do not claim certainty without evidence; use phrases like 'likely' or 'possibly'.
  • Do not ignore parts of the stack trace; consider all frames.
  • Stay focused on the error analysis; do not provide unrelated advice.

Example

  • {{stack_trace}}: 'TypeError: Cannot read property 'map' of undefined at renderList (component.js:45) ...'

Follow-up prompts

  • What specific lines in the stack trace should I add logging to confirm the cause?
  • Can you help me write a unit test to reproduce this error?
  • How can I prevent similar null reference errors in the future?