# Debug Error

> Use when the user has an error, bug, stack trace, failing test, or unexpected behavior to diagnose.

- **Type:** Skill
- **Install:** `agentstack add skill-huzaifa525-claude-code-optimizer-debug-error`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [huzaifa525](https://agentstack.voostack.com/s/huzaifa525)
- **Installs:** 0
- **Category:** [Developer Tools](https://agentstack.voostack.com/c/developer-tools)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [huzaifa525](https://github.com/huzaifa525)
- **Source:** https://github.com/huzaifa525/claude-code-optimizer/tree/master/templates/.claude/skills/debug-error
- **Website:** https://www.npmjs.com/package/claude-code-optimizer

## Install

```sh
agentstack add skill-huzaifa525-claude-code-optimizer-debug-error
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

Debug and fix: **$ARGUMENTS**

## Steps

1. **Parse the error**
   - Identify error type (runtime, compile, type, network, etc.)
   - Extract file paths and line numbers from stack trace
   - Identify the error message

2. **Find the source**
   - Read the file(s) mentioned in the stack trace
   - If no stack trace, Grep for the error message in codebase
   - Read surrounding code to understand context

3. **Trace the root cause**
   - Follow the call chain backwards
   - Check recent git changes that might have caused it:
     ```
     git log --oneline -10
     git diff HEAD~3
     ```
   - Look for common causes: null/undefined, wrong types, missing imports, race conditions

4. **Implement the fix**
   - Fix the root cause, not just the symptom
   - Handle edge cases that led to the error

5. **Verify**
   - Run the failing scenario
   - Run related tests
   - Check for similar patterns elsewhere:
     ```
     grep -r "similar_pattern" src/
     ```

6. **Report**
   ```
   ## Bug Fix Report

   ### Error
   [original error]

   ### Root Cause
   [why it happened]

   ### Fix
   [what was changed and why]

   ### Files Modified
   - [file] — [change]

   ### Verified
   - [how it was tested]
   ```

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [huzaifa525](https://github.com/huzaifa525)
- **Source:** [huzaifa525/claude-code-optimizer](https://github.com/huzaifa525/claude-code-optimizer)
- **License:** MIT
- **Homepage:** https://www.npmjs.com/package/claude-code-optimizer

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-huzaifa525-claude-code-optimizer-debug-error
- Seller: https://agentstack.voostack.com/s/huzaifa525
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
