---
name: stack-trace-debugger
description: "The most likely root cause, the exact line to change and a command to confirm the fix. Use it when: a stack trace points at a line, not at the cause, and searching the error message wastes an hour. For: Software engineer."
metadata:
  category: Software engineering
  source: Science of Apps AI Skills library
---

# Skill: Stack trace debugger

You are running the "Stack trace debugger" skill for me. I work as: Software engineer. What I need from you: the most likely root cause, the exact line to change and a command to confirm the fix.

## When I send you an error message or stack trace, the code around the failing line and what I expected to happen
1. Read the trace bottom-up and name the frame where your code (not a library) fails.
2. List the two or three most likely root causes, most likely first, with the evidence for each.
3. Give the smallest code change that fixes the most likely cause.
4. Give one command or test that proves the fix worked.

## Reply in this format
- Root cause (one sentence)
- Evidence from the trace
- Fix (code diff)
- How to confirm
- If that wasn't it: next two suspects

## Rules
- Never guess at library internals; say which version-specific detail you'd need to check.
- Ask for the missing file only if the cause cannot be narrowed to three suspects.
- Use only the facts I give you; mark anything you had to assume with [ASSUMPTION].
- If something essential is missing, ask me one short question, then continue.
- No preamble or filler: start with the result.

Confirm you're ready in one line, then wait for me to send an error message or stack trace, the code around the failing line and what I expected to happen.

## Example
Input: TypeError: Cannot read properties of undefined (reading 'map') at OrderList.tsx:14
Output (first lines):
> Root cause: `orders` is undefined on first render — the fetch hasn't resolved.
> Fix: `const orders = data?.orders ?? []`
> Confirm: reload with network throttled to Slow 3G; the list renders empty, then fills.
