# Debug

> >-

- **Type:** Skill
- **Install:** `agentstack add skill-kriscard-skills-debug`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [kriscard](https://agentstack.voostack.com/s/kriscard)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [kriscard](https://github.com/kriscard)
- **Source:** https://github.com/kriscard/Skills/tree/main/skills/dev/debug

## Install

```sh
agentstack add skill-kriscard-skills-debug
```

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

## About

# Debug

Systematic root-cause analysis — reproduce, isolate, hypothesize, fix, verify.

## Process

1. **Read the error** — full message, stack trace, error code. Don't skip this.
2. **Reproduce reliably** — minimal steps before touching any code.
3. **Isolate** — binary search via `git bisect`, comment blocks, or minimal repro.
4. **Hypothesize** — one specific theory. Don't change multiple things at once.
5. **Test hypothesis** — add logging, use debugger, modify code.
6. **Apply minimal fix** — smallest change that addresses root cause, not symptoms.
7. **Verify** — confirm fix works and no regressions.

## Diagnosis Checklist

**Start here before touching code:**

- [ ] Read the full error message — it often tells you exactly what's wrong
- [ ] Check recent changes: `git log --oneline -10` / `git diff HEAD~1`
- [ ] Check logs around time of failure
- [ ] Verify environment matches expected (versions, env vars, config)
- [ ] Could this be a race condition or timing issue?
- [ ] Is this intermittent or consistent?

**Reproduction:**

```bash
# Find the commit that introduced it
git bisect start
git bisect bad HEAD
git bisect good 
```

**Strategic logging:**

```typescript
// Entry/exit with parameters — temporary, remove after fix
console.log('[debug] functionName called', { param1, param2 });
// ...
console.log('[debug] functionName result', { result });
```

## Anti-Patterns

- Don't make random changes hoping something fixes it — form a hypothesis first
- Don't fix symptoms without understanding root cause
- Don't debug in production without safeguards
- Don't leave debug logs or breakpoints in committed code
- Don't trust your mental model — read the actual code

## Output

```
## Root Cause
[What actually caused the issue]

## Evidence
- [Log excerpt / stack trace / variable state]

## Fix
`file:line`
```diff
- broken code
+ fixed code
```

**Why this fixes it:** [reasoning]

## Prevention
- [Recommendation to avoid recurrence]
```

## Source & license

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

- **Author:** [kriscard](https://github.com/kriscard)
- **Source:** [kriscard/Skills](https://github.com/kriscard/Skills)
- **License:** MIT

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-kriscard-skills-debug
- Seller: https://agentstack.voostack.com/s/kriscard
- 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%.
