Stack Trace Analyzer

Interprets error stack traces to pinpoint root cause, explain what went wrong, and suggest fixes.

8 stars

Best use case

Stack Trace Analyzer is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Interprets error stack traces to pinpoint root cause, explain what went wrong, and suggest fixes.

Teams using Stack Trace Analyzer should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/stack-trace-analyzer/SKILL.md --create-dirs "https://raw.githubusercontent.com/Notysoty/openagentskills/main/skills/stack-trace-analyzer/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/stack-trace-analyzer/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How Stack Trace Analyzer Compares

Feature / AgentStack Trace AnalyzerStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Interprets error stack traces to pinpoint root cause, explain what went wrong, and suggest fixes.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Stack Trace Analyzer

## What this skill does

This skill directs the agent to read a stack trace, identify which frame is the true origin of the bug (not just where the error was thrown), explain what each relevant frame means in plain English, diagnose the root cause, and propose 2–3 concrete fixes ranked by likelihood. It works with JavaScript, TypeScript, Python, Java, Go, Rust, and most other common stack trace formats.

Use this when you have a crash report, a CI failure, or a wall of red text in your terminal and you want to understand it fast.

## How to use

### Claude Code / Cline

Copy this file to `.agents/skills/stack-trace-analyzer/SKILL.md` in your project root.

Then paste the stack trace and ask:
- *"Analyze this stack trace using the Stack Trace Analyzer skill."*
- *"Use the Stack Trace Analyzer skill — what went wrong and how do I fix it?"*

Include any relevant context: the action that triggered the error, environment details (Node version, browser, OS), and any recent code changes.

### Cursor

Add the "Prompt / Instructions" section below to your `.cursorrules` file. Then paste the stack trace into the chat.

### Codex

Paste the full stack trace and the relevant source files into the chat, then include the instructions below. Codex benefits from seeing the actual source code so it can match line numbers to real code.

## The Prompt / Instructions for the Agent

When given a stack trace, follow these steps:

1. **Identify the language and runtime** from the trace format (Node.js, Python, JVM, Go panic, Rust panic, browser, etc.). Note the runtime version if visible.

2. **Parse the error header.** Extract:
   - Error type (e.g., `TypeError`, `NullPointerException`, `panic`, `KeyError`)
   - Error message (the human-readable description)
   - Any error codes or HTTP status codes present

3. **Walk the stack frames top-to-bottom.** For each frame that belongs to application code (not a framework or standard library):
   - State what the function does in plain English
   - Note the file path and line number
   - Explain why that frame is on the call stack (what called it)

4. **Distinguish surface error from root cause.** The top frame is often just where the error was *detected*, not where it *originated*. Look deeper:
   - Find the first frame in user-owned code that passed invalid data or made a wrong assumption
   - Check for null/undefined propagation — where was the value supposed to be set?
   - Check for async/promise chain breaks
   - Check for type mismatches introduced by parsing or deserialization

5. **State the root cause** in one clear sentence. Then explain the chain of events that led to it (2–4 sentences).

6. **Suggest 2–3 fixes**, ordered from most likely to least likely:
   - Each fix must be concrete: name the file, function, and line number if possible
   - Explain what the fix does and why it solves the root cause
   - Note any trade-offs or edge cases the fix introduces

7. **Flag anything unusual**, such as:
   - Async errors that swallowed earlier exceptions
   - Framework internals that obscure the real caller
   - Minified or transpiled frames where source maps are missing

8. **Output format:**

```
## Error Summary
**Type:** [ErrorType]
**Message:** [Full error message]
**Runtime:** [Language/runtime/version]

## Frame Analysis
1. `[file:line]` — [What this function does and why it's on the stack]
2. `[file:line]` — ...
...

## Root Cause
[One sentence identifying the true origin of the bug.]

[2–4 sentences explaining the chain of events.]

## Suggested Fixes

### Fix 1 (Most Likely) — [Title]
[Concrete description of the change, with file/function/line reference.]

### Fix 2 — [Title]
[...]

### Fix 3 — [Title]
[...]

## Additional Notes
[Any warnings about obscured frames, missing source maps, async issues, etc.]
```

## Example

**Input to Agent:**
> "Use the Stack Trace Analyzer skill on this error:
>
> ```
> TypeError: Cannot read properties of undefined (reading 'email')
>     at formatUserDisplay (src/utils/format.ts:23:18)
>     at UserCard (src/components/UserCard.tsx:41:12)
>     at renderWithHooks (node_modules/react-dom/cjs/react-dom.development.js:14985:18)
>     at mountIndeterminateComponent (node_modules/react-dom/cjs/react-dom.development.js:17811:13)
>     at beginWork (node_modules/react-dom/cjs/react-dom.development.js:19049:16)
> ```"

**Output from Agent:**
> ## Error Summary
> **Type:** TypeError
> **Message:** Cannot read properties of undefined (reading 'email')
> **Runtime:** Browser / React (react-dom development build)
>
> ## Frame Analysis
> 1. `src/utils/format.ts:23` — `formatUserDisplay` tried to read the `.email` property, but the value passed to it was `undefined`.
> 2. `src/components/UserCard.tsx:41` — `UserCard` called `formatUserDisplay` with a `user` prop that was `undefined` at render time.
> 3. React internals — these frames are React mounting the component; not relevant to the bug.
>
> ## Root Cause
> `UserCard` is being rendered before its `user` prop is populated — likely because data is still loading from an async source when the component first mounts.
>
> The `user` prop arrives as `undefined` on the first render, `formatUserDisplay` does not guard against this, and accessing `.email` on `undefined` throws immediately.
>
> ## Suggested Fixes
>
> ### Fix 1 (Most Likely) — Add a loading guard in UserCard
> In `src/components/UserCard.tsx`, return `null` or a skeleton UI when `user` is falsy: `if (!user) return <Skeleton />`. This prevents the component from trying to render before data is ready.
>
> ### Fix 2 — Add a null guard in formatUserDisplay
> In `src/utils/format.ts:23`, add `if (!user?.email) return ''` before accessing the property. This makes the utility defensive and prevents crashes from any caller.
>
> ### Fix 3 — Ensure the parent always passes a defined user
> Trace where `UserCard` is used and confirm the parent component does not render it until the data fetch is complete. Adding a `user &&` check at the call site prevents the component from mounting with undefined data.

Related Skills

Flaky Test Analyzer

8
from Notysoty/openagentskills

Diagnoses why tests pass inconsistently and suggests fixes for timing, ordering, and state isolation issues.

Bug Root Cause Analyzer

8
from Notysoty/openagentskills

Systematically diagnoses bugs by tracing execution flow and identifying root causes vs symptoms.

Unit Test Writer

8
from Notysoty/openagentskills

Generates comprehensive unit tests for any function or module with edge cases.

Unit Test Improver

8
from Notysoty/openagentskills

Reviews existing unit tests for gaps, weak assertions, and missing edge cases, then rewrites them to be more robust.

Troubleshooting Guide Builder

8
from Notysoty/openagentskills

Builds a structured troubleshooting guide with symptom → cause → fix format for any tool or system.

Tech Debt Auditor

8
from Notysoty/openagentskills

Identifies and prioritizes technical debt in a codebase with an effort/impact matrix.

Technical Blog Post Writer

8
from Notysoty/openagentskills

Writes engaging, accurate technical blog posts targeted at developer audiences.

SQL Query Optimizer

8
from Notysoty/openagentskills

Reviews SQL queries for performance issues and rewrites them with optimized execution plans.

Sprint Summary Generator

8
from Notysoty/openagentskills

Converts a list of completed tickets or commits into a clear sprint summary for stakeholders.

Social Post Thread Writer

8
from Notysoty/openagentskills

Converts a blog post, idea, or document into an engaging Twitter/X or LinkedIn thread with hooks and CTAs.

SEO Metadata Generator

8
from Notysoty/openagentskills

Generates optimized title tags, meta descriptions, Open Graph tags, and structured data for any web page.

SEO Content Optimizer

8
from Notysoty/openagentskills

Analyzes and rewrites content to maximize search engine visibility without sounding robotic.