error-resolver

davila7/claude-code-templates · updated Apr 8, 2026

MDX-style export adds YAML metadata + attribution linking explainx.ai and this canonical listing URL.

$npx skills add https://github.com/davila7/claude-code-templates --skill error-resolver
0 commentsdiscussion
summary

A first-principle approach to diagnosing and resolving errors across all languages and frameworks.

skill.md

Error Resolver

A first-principle approach to diagnosing and resolving errors across all languages and frameworks.

Core Philosophy

The 5-step Error Resolution Process:

1. CLASSIFY  ->  2. PARSE  ->  3. MATCH  ->  4. ANALYZE  ->  5. RESOLVE
     |              |             |             |              |
  What type?    Extract key    Known       Root cause      Fix +
               information    pattern?     analysis       Prevent

Quick Start

When you encounter an error:

  1. Paste the full error (including stack trace if available)
  2. Provide context (what were you trying to do?)
  3. Share relevant code (the file/function involved)

Error Classification Framework

Primary Categories

Category Indicators Common Causes
Syntax Parse error, Unexpected token Typos, missing brackets, invalid syntax
Type TypeError, type mismatch Wrong data type, null/undefined access
Reference ReferenceError, NameError Undefined variable, scope issues
Runtime RuntimeError, Exception Logic errors, invalid operations
Network ECONNREFUSED, timeout, 4xx/5xx Connection issues, wrong URL, server down
Permission EACCES, PermissionError File/directory access, sudo needed
Dependency ModuleNotFound, Cannot find module Missing package, version mismatch
Configuration Config error, env missing Wrong settings, missing env vars
Database Connection refused, query error DB down, wrong credentials, bad query
Memory OOM, heap out of memory Memory leak, large data processing

Secondary Attributes

  • Severity: Fatal / Error / Warning / Info
  • Scope: Build-time / Runtime / Test-time
  • Origin: User code / Framework / Third-party / System

Analysis Workflow

Step 1: Classify

Identify the error category by examining:

  • Error name/code (e.g., ENOENT, TypeError)
  • Error message keywords
  • Where it occurred (compile, runtime, test)

Step 2: Parse

Extract key information:

- Error code: [specific code if any]
- File path: [where the error originated]
- Line number: [exact line if available]
- Function/method: [context of the error]
- Variable/value: [what was involved]
- Stack trace depth: [how deep is the call stack]

Step 3: Match Patterns

Check against known error patterns:

  • See patterns/ directory for language-specific patterns
  • Match error signatures to known solutions
  • Check replay history for previous solutions

Step 4: Root Cause Analysis

Apply the 5 Whys technique:

Error: Cannot read property 'name' of undefined
  Why 1? -> user object is undefined
  Why 2? -> API call returned null
  Why 3? -> User ID doesn't exist in database
  Why 4? -> ID was from stale cache
  Why 5? -> Cache invalidation not implemented

Root Cause: Missing cache invalidation logic

Step 5: Resolve

Generate actionable solution:

  1. Immediate fix - Get it working now
  2. Proper fix - The right way to solve it
  3. Prevention - How to avoid in the future

Output Format

When resolving an error, provide:

## Error Diagnosis

**Classification**: [Category] / [Severity] / [Scope]

**Error Signature**:
- Code: [error code]
- Type: [error type]
- Location: [file:line]

## Root Cause

[Explanation of why this error occurred]

**Contributing Factors**:
1. [Factor 1]
2. [Factor 2]

## Solution

### Immediate Fix
[Quick steps to resolve]

### Code Change
[Specific code to add/modify]

### Verification
[How to verify the fix works]

## Prevention

[How to prevent this error in the future]

## Replay Tag

[Unique identifier for this solution - for future reference]

Replay System

The replay system records successful solutions for future reference.

Recording a Solution

After resolving an error, record it:

# Create solution record in project
mkdir -p .claude/error-solutions

# Solution file format: [error-type]-[hash].yaml

Solution Record Format

# .claude/error-solutions/[error-signature].yaml
id: "nodejs-module-not-found-express"
created: "2024-01-15T10:30:00Z"
updated: "2024-01-20T14:22:00Z"

error:
  type: "dependency"
  category: "ModuleNotFound"
  language: "nodejs"
  pattern: "Cannot find module 'express'"
  context: "npm project, missing dependency"

diagnosis:
  root_cause: "Package not installed or node_modules corrupted"
  factors:
    - "Missing npm install after git clone"
    - "Corrupted node_modules directory"
    - "Package not in package.json"

solution:
  immediate:
    - "Run: npm install express"
  proper:
    - "Check package.json has express listed"
    - "Run: rm -rf node_modules && npm install"
  code_change: null

verification:
  - "Run the application again"
  - "Check express is in node_modules"

prevention:
  - "Add npm install to project setup docs"
  - "Use npm ci in CI/CD pipelines"

metadata:
  occurrences: 5
  last_resolved: "2024-01-20T14:22:00Z"
  success_rate: 1.0
  tags: ["nodejs", "npm", "dependency"]

Replay Lookup

When encountering an error:

  1. Generate error signature from the error message
  2. Search .claude/error-solutions/ for matching patterns
  3. If found, apply the recorded solution
  4. If new, proceed with full analysis and record the solution

Error Signature Generation

signature = hash(
  error_type +
  error_code +
  normalized_message +  # remove specific values
  language +
  framework
)

Example transformations:

  • Cannot find module 'express' -> Cannot find module '{module}'
  • TypeError: Cannot read property 'name' of undefined -> TypeError: Cannot read property '{prop}' of undefined

Debug Commands

Useful commands during debugging:

Node.js

# Verbose error output
NODE_DEBUG=* node app.js

# Memory debugging
node --inspect app.js

# Check installed packages
npm ls [package-name]

# Verify package.json
npm ls --depth=0

Python

# Debug mode
python -m pdb script.py

# Check installed packages
pip show [package-name]
pip list

General

# Check file permissions
ls -la [file]

# Check port usage
lsof -i :[port]
netstat -an | grep [port]

# Check environment variables
env | grep [VAR_NAME]
printenv [VAR_NAME]

# Check disk space
df -h

# Check memory
free -m  # Linux
vm_stat  # macOS

Common Debugging Patterns

Pattern 1: Binary Search

When the error location is unclear:

  1. Comment out half the code
  2. If error persists, it's in the remaining half
  3. Repeat until you find the exact line

Pattern 2: Minimal Reproduction

Create the smallest code that reproduces the error:

  1. Start with empty file
  2. Add code piece by piece
  3. Stop when error appears
  4. That's your minimal repro case

Pattern 3: Rubber Duck Debugging

Explain the problem out loud (or to Claude):

  1. What should happen?
  2. What actually happens?
  3. What changed recently?
  4. What assumptions am I making?

Pattern 4: Git Bisect

Find which commit introduced the bug:

git bisect start
git bisect bad  # current commit is bad
git bisect good [last-known-good-commit]
# Git will checkout commits for you to test
git bisect good/bad  # mark each as good or bad
git bisect reset  # when done

Reference Files

  • patterns/ - Language-specific error patterns

    • nodejs.md - Node.js common errors
    • python.md - Python common errors
    • react.md - React/Next.js errors
    • database.md - Database errors
    • docker.md - Docker/container errors
    • git.md - Git errors
    • network.md - Network/API errors
  • analysis/ - Analysis methodologies

    • stack-trace.md - Stack trace parsing guide
    • root-cause.md - Root cause analysis techniques
  • replay/ - Replay system

    • solution-template.yaml - Template for recording solutions
how to use error-resolver

How to use error-resolver on Cursor

AI-first code editor with Composer

1

Prerequisites

Before installing skills in Cursor, ensure your development environment meets these requirements:

  • Cursor installed and configured on your development machine
  • Node.js version 16.0+ with npm package manager (verify with node --version)
  • Active project directory or workspace where you want to add error-resolver
2

Execute installation command

Execute the skills CLI command in your project's root directory to begin installation:

$npx skills add https://github.com/davila7/claude-code-templates --skill error-resolver

The skills CLI fetches error-resolver from GitHub repository davila7/claude-code-templates and configures it for Cursor.

3

Select Cursor when prompted

The CLI will show a list of available agents. Use arrow keys to navigate and space to select Cursor:

◆ Which agents do you want to install to?
│ ── Universal (.agents/skills) ── always included ────
│ • Amp
│ • Antigravity
│ • Cline
│ • Codex
│ ●Cursor(selected)
│ • Cursor
│ • Windsurf
4

Verify installation

Confirm successful installation by checking the skill directory location:

.cursor/skills/error-resolver

Reload or restart Cursor to activate error-resolver. Access the skill through slash commands (e.g., /error-resolver) or your agent's skill management interface.

Security & Verification Notice

We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.

Skills execute code in your development environment. Always verify the publisher's identity, review recent commits, and test in isolated environments before production deployment.

List & Monetize Your Skill

Submit your Claude Code skill and start earning

GET_STARTED →

Use Cases

User Story & Requirements Generation

Create detailed user stories, acceptance criteria, and feature specs

Example

Generate user stories for 'password reset feature' with acceptance criteria, edge cases, and test scenarios

Reduce spec writing time by 50%, ensure comprehensive coverage

Competitive Analysis

Research competitors, compare features, identify gaps

Example

Analyze 5 competitor products, create feature comparison matrix, suggest differentiation opportunities

Complete competitive research in 2 hours instead of 2 days

Roadmap Prioritization

Evaluate features using frameworks (RICE, ICE, Kano) and create prioritized backlogs

Example

Score 20 feature ideas using RICE framework, generate prioritized roadmap with rationale

Make data-driven prioritization decisions faster

Stakeholder Communication

Draft PRDs, status updates, and stakeholder presentations

Example

Create executive summary of Q3 roadmap, monthly progress report, feature launch announcement

Save 3-5 hours/week on communication overhead

Implementation Guide

Prerequisites

  • Claude Desktop or compatible AI client
  • Access to product documentation and roadmap tools (Jira, Notion, etc.)
  • Understanding of product management frameworks (RICE, Jobs-to-be-Done, etc.)
  • Stakeholder contact information and communication channels

Time Estimate

30-60 minutes to see productivity improvements

Installation Steps

  1. 1.Install product management skill
  2. 2.Start with user story generation for known feature
  3. 3.Progress to competitive analysis: research 2-3 competitors
  4. 4.Use for roadmap prioritization: apply RICE/ICE scoring
  5. 5.Draft stakeholder communications and refine based on feedback
  6. 6.Build template library for recurring PM tasks
  7. 7.Share effective prompts with product team

Common Pitfalls

  • Not validating competitive research—verify facts before sharing
  • Accepting user stories without involving engineering team
  • Over-relying on frameworks without qualitative judgment
  • Not customizing outputs to company culture and communication style
  • Skipping stakeholder validation of generated requirements

Best Practices

✓ Do

  • +Validate research and competitive analysis with real data
  • +Collaborate with engineering when generating technical requirements
  • +Customize frameworks and templates to your company context
  • +Use skill for first drafts, refine with stakeholder input
  • +Document successful prompt patterns for PM tasks
  • +Combine AI efficiency with human judgment and intuition

✗ Don't

  • Don't publish competitive analysis without fact-checking
  • Don't finalize user stories without engineering review
  • Don't make prioritization decisions solely on AI scoring
  • Don't skip customer validation of generated requirements
  • Don't ignore company-specific context and culture

💡 Pro Tips

  • Provide context: company goals, constraints, customer feedback
  • Ask for alternatives: 'Show 3 ways to prioritize this roadmap'
  • Request stakeholder-specific formatting: 'Executive summary vs. engineering spec'
  • Use skill for 70% generation + 30% customization to company needs

When to Use This

✓ Use When

Use for user story writing, competitive research, roadmap prioritization, stakeholder communication, and PRD drafting. Best for reducing repetitive documentation and research work.

✗ Avoid When

Avoid for strategic product vision (requires deep customer empathy), pricing decisions (needs market and financial expertise), or when face-to-face customer discovery is more valuable than speed.

Learning Path

  1. 1Basic: user stories, feature specs, status updates
  2. 2Intermediate: competitive analysis, prioritization frameworks, PRDs
  3. 3Advanced: product strategy, go-to-market planning, OKR setting
  4. 4Expert: product vision, market positioning, business model innovation

Discussion

Product Hunt–style comments (not star reviews)
  • No comments yet — start the thread.
general reviews

Ratings

4.736 reviews
  • Advait Reddy· Dec 24, 2024

    We added error-resolver from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.

  • Pratham Ware· Dec 16, 2024

    Registry listing for error-resolver matched our evaluation — installs cleanly and behaves as described in the markdown.

  • Anaya Rao· Dec 8, 2024

    Solid pick for teams standardizing on skills: error-resolver is focused, and the summary matches what you get after install.

  • Mei Haddad· Dec 4, 2024

    Keeps context tight: error-resolver is the kind of skill you can hand to a new teammate without a long onboarding doc.

  • Advait Flores· Nov 27, 2024

    error-resolver has been reliable in day-to-day use. Documentation quality is above average for community skills.

  • Luis Malhotra· Nov 23, 2024

    I recommend error-resolver for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.

  • Lucas Malhotra· Nov 15, 2024

    Useful defaults in error-resolver — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.

  • Advait Harris· Nov 11, 2024

    error-resolver fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.

  • Sakshi Patil· Nov 7, 2024

    error-resolver reduced setup friction for our internal harness; good balance of opinion and flexibility.

  • Chaitanya Patil· Oct 26, 2024

    I recommend error-resolver for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.

showing 1-10 of 36

1 / 4