greglas75/zuvo/debug
Claude Code and agent skill by greglas75/zuvo
- community
Checking that the SKILL.md file is still in the repository.
Systematic bug investigation with a five-phase framework: reproduce, narrow, diagnose, fix, verify. Supports automated regression bisect via --regression flag. Produces a structured debug report with root cause analysis, regression test, and CQ/Q self-evaluations.
Install
npx vskill@latest install greglas75/zuvo/debugSKILL.md
The same SKILL.md was published earlier as greglas75/zuvo/debug.
zuvo:debug — Structured Bug Investigation
A disciplined five-phase process for turning a bug report, error message, or unexpected behavior into a confirmed root cause, verified fix, and permanent regression test.
Scope: Any bug, error, or unexpected behavior that needs investigation. Out of scope: Code quality sweeps (use zuvo:code-audit), general review (use zuvo:review), performance problems without a specific bug (use zuvo:performance-audit).
Argument Parsing
Parse $ARGUMENTS to determine the starting phase:
| Input | Starting point | |
|---|---|---|
| _(empty)_ | Ask the user: "Describe the issue. Share the error message, stack trace, or explain what is happening." | |
| Error message or stack trace | Phase 1.5 (Minimal Reproduction) -- verify the error is reproducible before narrowing | |
| Code snippet or file reference | Phase 3 (Diagnose) -- read the code, trace the execution path | |
| Description like "why does X" or "X is broken" | Phase 1 (Reproduce) -- gather context before proceeding | |
--regression flag, or words like "bisect", "regression", "this used to work" | Phase R (Regression Bisect) -- automated git bisect to find the breaking commit |
Environment Compatibility
Dispatch follows ../../shared/includes/execution-policy.md through env-compat. Reuse existing authorization within that policy; session restrictions take precedence. Run each required gate and report its actual independence or an unmet requirement.
Read ../../shared/includes/env-compat.md for agent dispatch patterns, path resolution, and progress tracking across all supported platforms.
CodeSift Integration
Read ../../shared/includes/codesift-setup.md for the full initialization sequence.
Key tools for debugging:
| Phase | Task | CodeSift tool | Fallback | |
|---|---|---|---|---|
| 2 | Identify recent symbol-level changes | changed_symbols(repo, since="HEAD~5") | git log --oneline + git diff | |
| 2 | Compact change summary | diff_outline(repo, since="HEAD~5") | git diff --stat | |
| 2 | Blast radius of recent changes | impact_analysis(repo, since="HEAD~5", depth=2) | Grep for imports of changed files | |
| 3 | Trace callers/callees of buggy function | trace_call_chain(repo, symbol_name, direction, depth=3) | Repeated Grep for function name | |
| 3 | Understand buggy function with imports and siblings | get_context_bundle(repo, symbol_name) | Read the entire file | |
| 3 | Find where an error is thrown | search_text(repo, query="error message", regex=true) | Grep | |
| 3 | Read multiple functions along the call path | get_symbols(repo, symbol_ids=[...]) | Multiple Read calls | |
| 3 | File structure around the bug | get_file_outline(repo, file_path) | Read the file | |
| Any | Batch 3+ lookups | codebase_retrieval(repo, queries=[...]) | Sequential Grep/Read |
Mandatory File Loading
PHASE 0 — Bootstrap (always, before reading error/file)
This is the ONLY file loaded before reading the error report or target file.
PHASE 0.5 — Classify (read error/file, determine bug category)
After CodeSift setup, read the error, stack trace, or target file. Classify bug category:
- logic: wrong output, off-by-one, condition error, missing branch
- async: race condition, unhandled rejection, deadlock, timeout
- data: wrong query, missing join, constraint violation, data corruption
- integration: API contract mismatch, version incompatibility, env config error
- test-failure: existing test broke, flaky test, test infrastructure issue
Print: [CLASSIFIED] Bug category: {logic|async|data|integration|test-failure}
PHASE 1 — Conditional Load (based on bug category)
| Include | logic | async | data | integration | test-failure | |
|---|---|---|---|---|---|---|
../../rules/cq-patterns.md | Full | CQ15,CQ21 focus | CQ6,7,9 focus | CQ8,CQ19 focus | SKIP | |
../../rules/cq-checklist.md | Full | CQ15,CQ21 focus | CQ6,7,9 focus | CQ8,CQ19 focus | SKIP | |
../../rules/testing.md | SKIP | SKIP | SKIP | SKIP | Full |
Print loaded files:
Optional Files (loaded if available)
DEFERRED — Load at completion
If PHASE 0 file missing: Run self-evaluation using the embedded minimal checklist below. Note "DEGRADED — codesift-setup.md unavailable" in the debug report.
Minimal checklist (fallback only):
- Error path tested? (Q7)
- All branches exercised? (Q11)
- Test imports real production code? (Q13)
- Assertions verify values, not just shape? (Q15)
- Expected values from spec, not copied from implementation? (Q17)
- Boundary validation present? (CQ3)
- Auth guard paired with query filter? (CQ4)
- Infrastructure errors handled with timeout? (CQ8)
- No duplicated logic blocks? (CQ14)
Framework: Five Phases
Phase 0: Knowledge Prime
Run the knowledge prime protocol from knowledge-prime.md:
Known gotchas from prior sessions may directly identify the root cause.
Phase 1: Reproduce
Establish a clear, reproducible failure. Gather from the user if not provided:
- Expected behavior: What should happen?
- Actual behavior: What happens instead?
- Reproduction steps: Exact sequence to trigger the bug
- Scope: Does it happen always, intermittently, for all users, or under specific conditions?
- Timeline: When did it start? Was there a recent deploy, config change, or dependency update?
If reproduction is inconsistent, flag as a potential race condition, environment-dependent issue, or test-order dependency.
Phase 1.5: Minimal Reproduction
A stack trace proves an error occurred at some point. It does not prove the error is reproducible right now. Before narrowing:
- Run the failing test or hit the failing endpoint. Can you trigger the same error?
- If yes: Proceed to Phase 2 with confirmed reproduction.
- If no: The trace may be from a different state (stale data, previous deploy, changed config). Go back to Phase 1: gather expected vs actual, steps, scope.
- If intermittent: Run 3 times to confirm flakiness, then proceed with a flaky flag.
Skip this phase only when the failure is self-evident (type error visible in code, compilation failure).
Phase 2: Narrow
2.0 Baseline Check
Before changing anything, determine whether this is a new regression or a pre-existing problem.
- Run existing tests for the affected area. Are any already failing?
- Check recent commits to the affected files:
git log --oneline -10 -- [affected-files] - If CodeSift is available:
changed_symbols(repo, since="HEAD~5")to see symbol-level changes near the bug.diff_outline(repo, since="HEAD~5")for a compact summary. - Record the current test state as a baseline.
Output:
2.1 Reduce the Search Space
Work through these in order, stopping when the failure point is identified:
- Error message and stack trace -- Read the full trace, not just the last line. The root cause is usually earlier in the chain.
- Logs around the failure time -- What happened immediately before the error?
- Recent changes -- Commits, deploys, dependency updates, config changes in the relevant window.
- Environment comparison -- If it works in one environment but not another, find the difference.
- Binary search -- If the code path is long, identify the midpoint and determine whether the bug is upstream or downstream.
Phase 3: Diagnose
Trace the execution path from input to failure.
- Entry point -- Where does the triggering action enter the system?
- Trace forward -- Follow data through each function and service until the point of failure. If CodeSift is available, use
trace_call_chain(repo, symbol_name, direction="callees", depth=3)from the entry point. Useget_context_bundle(repo, symbol_name)to understand the buggy function with its imports and neighbors. - Form hypotheses (max 3) -- List 2-3 possible root causes, ordered by likelihood.
- Test each hypothesis -- For each: what evidence would confirm or rule it out? Gather that evidence. If 2 hypotheses fail, pivot: re-read the code path from scratch, add logging, or widen the search scope. Do not keep guessing in the same direction.
- Root cause -- Identify the specific line, condition, or assumption that fails. Distinguish root cause from symptoms.
Error-Type Playbooks
| Error type | Most common root causes | |
|---|---|---|
undefined or null | Missing null guard, wrong property key, async timing issue | |
| Wrong value | Off-by-one, unit mismatch, stale cached data | |
| Permission denied | Auth context not propagated, RBAC misconfigured, missing query filter | |
| Timeout | N+1 query, missing database index, unbounded loop | |
| Flaky / intermittent | Race condition, shared global state, test-order dependency | |
| Works in dev, fails in prod | Missing env variable, production data edge case, timezone difference |
Stack-Specific Diagnostic Sequences
API / Backend:
- Reproduce with curl or the test runner against the endpoint
- Check request validation -- does the schema reject the input, or does it let bad data through?
- Check auth context at the point of failure
- Check the database query -- does it return expected data? Run EXPLAIN for slow queries.
- Check error handling -- does the catch block swallow, transform, or propagate correctly?
Frontend / UI:
- Check browser console for errors, network tab for failed requests
- Determine if API data is correct -- if yes, the bug is in rendering or state management
- Trace component prop flow to the failing component
- Check event handlers -- does the user action trigger the expected dispatch or callback?
- Check SSR hydration mismatch if applicable
Database / Performance:
- Identify the slow or failing query from logs or ORM debug mode
- Run EXPLAIN ANALYZE -- missing index? full table scan? cartesian join?
- Check for N+1 patterns (same query executed in a loop)
- Check connection pool exhaustion or timeout settings
- Check if dataset size has grown beyond what the query handles efficiently
Async / Flaky:
- Run the failing test 5 times. How often does it fail?
- Check for shared mutable state between tests (globals, singletons, database rows)
- Check timing assumptions (setTimeout, sleep, waitFor with insufficient duration)
- Check execution-order dependency (does the test rely on another test running first?)
- Check resource cleanup (ports, connections, file handles released properly?)
Phase 4: Fix and Verify
4.1 Implement the Fix
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 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
- 8
- 7-day trend score
- 11
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/greglas75/zuvo/debug)