shennawardana23/skillme/debug
Claude Code and agent skill by shennawardana23/skillme
- community
Checking that the SKILL.md file is still in the repository.
Runs a tight four-phase loop — reproduce, isolate, diagnose, fix — to root-cause a single bug with evidence, not guesses. Use when given a specific error message, stack trace, or unexpected behavior for one bug and need a fast, mechanical session (reproduce → isolate → diagnose → fix → prevention). For broader failure-class triage across tests/builds/incidents, or a stop-the-line policy, use debugging-and-error-recovery instead.
Install
npx vskill@latest install shennawardana23/skillme/debugSKILL.md
The same SKILL.md was published earlier as shennawardana23/skillme/debug.
Debug
Iron law
Do not guess. Do not apply a fix until you understand the root cause. Every fix must follow from evidence. "It might be X" is not sufficient — "evidence Y proves it is X" is.
Phase 1: reproduce
Establish a minimal reproduction before doing anything else:
- What exact input or action triggers the issue?
- What is the expected outcome? What is the actual outcome (exact error message, full stack trace)?
- Is it deterministic or intermittent?
- When did it start? What changed?
If you cannot reproduce it, you cannot fix it with confidence.
Phase 2: isolate
Narrow down the location:
- Binary search — which layer does the failure originate in?
- Remove variables — disable features, mock dependencies one at a time.
- Check inputs — is the problem in the data, not the code?
- Check environment — does it fail in prod but not dev, and why specifically?
For Go: check whether go test -race reveals it; add log.Printf("[DEBUG] state=%v", state) at layer boundaries; use dlv (Delve) for interactive stepping when a print-based binary search stalls.
Phase 3: diagnose
Identify the root cause with evidence: trace the execution path from input to failure; check every assumption (types, nil-ness, ordering, timing); for panics, read the stack trace top-to-bottom — the root cause is usually the deepest frame, not the one at the top where the panic surfaced.
Phase 4: fix
- Fix the root cause, not a symptom.
- Write a test that would have caught this bug — it should fail without the fix and pass with it.
- Check whether the same bug pattern exists in similar code elsewhere in the codebase.
- Update documentation if the behavior was wrong but previously undocumented as correct.
Common Go patterns
| Symptom | Likely cause | Check | |
|---|---|---|---|
| nil pointer dereference | Unguarded pointer use | Add a nil check before dereference | |
| goroutine leak | Missing stop signal | Add a context.Context or done channel | |
| data race | Concurrent map/slice mutation | Add a mutex, or use sync.Map | |
context deadline exceeded | Missing timeout propagation | Pass ctx into every blocking call on the path | |
| unexpected log output | Wrong logger instance | Check which logger got wired at construction | |
| test flakiness | Time-dependent assertion | Use an eventually/poll pattern instead of a fixed sleep |
Output format
Gotchas
- A stack trace's top frame is where the failure surfaced, not necessarily where it originated — for a nil pointer dereference three calls deep, the panic frame tells you where the nil was used, not where it should have been set; walk down to the frame where the value was supposed to be populated.
- "It's intermittent" is often a state or ordering bug wearing a random-looking disguise — before concluding something is truly non-deterministic, check for shared package-level state, map iteration order (Go deliberately randomizes it), or test execution order dependence, which produce results that look random but are fully deterministic given the hidden variable.
- A fix that makes the reported symptom disappear without a new failing-then-passing test is unverified, even if it looks obviously correct — a regression test written after confirming the fix, not derived from staring at the diff, is the only way to know the reproduction case is actually gone.
- Adding a nil-check or a
recover()around a panic without asking why the value was nil in the first place converts a loud, visible bug into a silent one — that is a symptom fix, not a root-cause fix, even though Phase 4 was nominally followed.
Real-world grounding
The context deadline exceeded row above is one of the most common real-world Go production symptoms precisely because a missing ctx parameter on one function several calls deep compiles fine and passes unit tests that don't exercise real network latency — the bug only appears under load, which is why Phase 2's "check environment: prod vs dev" step exists as a named phase rather than an afterthought.
Verification
- [ ] The bug reproduces reliably before any fix is attempted
- [ ] The root cause is stated as a single sentence backed by cited evidence, not a hypothesis
- [ ] A regression test exists that fails without the fix and passes with it
- [ ] Similar code elsewhere was checked for the same bug pattern
- [ ] The fix addresses the cause, not just the symptom that was reported
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/debug/SKILL.md
Popularity
- Repository stars
- 2
- 7-day trend score
- 5
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/shennawardana23/skillme/debug)