Stack Trace Analyzer
Skill9 starsChanged 8 months agoMITView on GitHub
Interprets error stack traces to pinpoint root cause, explain what went wrong, and suggest fixes.
In this repository61 other files it gives its agents.
- Accessibility Audit HelperSkill
- Agent Context File WriterSkill
- Agent Evaluation Framework BuilderSkill
- AI Feature Spec WriterSkill
- API Documentation GeneratorSkill
- REST API Endpoint DesignerSkill
- Architecture ExplainerSkill
- Article RepurposerSkill
- Auth Flow PlannerSkill
- Blog Outline GeneratorSkill
- Breaking Change DetectorSkill
- Bug Root Cause AnalyzerSkill
- Caching Strategy AdvisorSkill
- Changelog CuratorSkill
- Code Review ChecklistSkill
- Database Schema ReviewerSkill
- Docker Compose GeneratorSkill
- Documentation Gap FinderSkill
- Edge Case DiscoverySkill
- Error Log SummarizerSkill
- FAQ GeneratorSkill
- Flaky Test AnalyzerSkill
- Form UX OptimizerSkill
- Git Commit WriterSkill
- Hallucination Risk ReviewerSkill
- Hybrid Search ArchitectSkill
- Incident Postmortem WriterSkill
- Issue to PR PlannerSkill
- Landing Page Copy ImproverSkill
- LangGraph State Machine DesignerSkill
- LLM Cost OptimizerSkill
- LLM Tracing and Observability SetupSkill
- MCP Integration AssistantSkill
- MCP Server BuilderSkill
- Migration Guide WriterSkill
- Newsletter Summary WriterSkill
- Observability ChecklistSkill
- Playwright Test BuilderSkill
- PR Description WriterSkill
- Prompt Injection Defense AuditorSkill
- Prompt RefinerSkill
- Prompt Version Control WorkflowSkill
- RAG Chunking Strategy AdvisorSkill
- RAG Workflow PlannerSkill
- React Component ReviewerSkill
- README WriterSkill
- Refactor PlannerSkill
- Release Notes GeneratorSkill
- Responsive Layout ReviewerSkill
- SDK Quickstart WriterSkill
- SEO Content OptimizerSkill
- SEO Metadata GeneratorSkill
- Social Post Thread WriterSkill
- Sprint Summary GeneratorSkill
- SQL Query OptimizerSkill
- Technical Blog Post WriterSkill
- Tech Debt AuditorSkill
- Troubleshooting Guide BuilderSkill
- Unit Test ImproverSkill
- Unit Test WriterSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 5 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 18
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.
- Very specific: line 34
Add the "Prompt / Instructions" section below to your .cursorrules file.
- Distinctive: line 42
When given a stack trace, follow these steps:
- Distinctive: line 58
Check for null/undefined propagation — where was the value supposed to be set?
- Distinctive: line 59
Check for async/promise chain breaks
- Distinctive: line 60
Check for type mismatches introduced by parsing or deserialization
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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:
- 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.
- 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
- Error type (e.g.,
- 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)
- 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
- State the root cause in one clear sentence. Then explain the chain of events that led to it (2–4 sentences).
- 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
- 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
- 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
src/utils/format.ts:23—formatUserDisplaytried to read theundefined.src/components/UserCard.tsx:41—UserCardcalledformatUserDisplaywith auserprop that wasundefinedat render time.- React internals — these frames are React mounting the component; not relevant to the bug.
Root Cause
UserCardis being rendered before itsuserprop is populated — likely because data is still loading from an async source when the component first mounts.The
userprop arrives asundefinedon the first render,formatUserDisplaydoes not guard against this, and accessingundefinedthrows immediately.Suggested Fixes
Fix 1 (Most Likely) — Add a loading guard in UserCard
In
src/components/UserCard.tsx, returnnullor a skeleton UI whenuseris 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, addif (!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
UserCardis used and confirm the parent component does not render it until the data fetch is complete. Adding auser &&check at the call site prevents the component from mounting with undefined data.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

