From playbooks-virtuoso
Provides systematic debugging methodology using reproduce-investigate-hypothesize-fix-prevent workflow and root cause analysis for bugs, test failures, flaky behavior, production errors, performance degradation, integration failures.
npx claudepluginhub krzysztofsurdy/code-virtuoso --plugin playbooks-virtuosoThis skill is limited to using the following tools:
Systematic methodology for finding and fixing bugs. Prioritizes root cause analysis over symptom treatment, evidence over intuition, and prevention over recurrence.
Enforces systematic root cause analysis for bugs, test failures, unexpected behavior, and regressions via five-phase workflow: Understand, Reproduce, Isolate, Fix, Verify.
Executes hypothesis-driven debugging workflow: triage and reproduce bugs, investigate with evidence, analyze root causes, fix and verify, then report. For 'fix this bug' or debug requests.
Runs structured bug investigation: reproduce issue, trace root cause, test hypotheses, apply TDD fixes via sub-agent, escalate after failures. Use /cdebug when stuck on bugs.
Share bugs, ideas, or general feedback.
Systematic methodology for finding and fixing bugs. Prioritizes root cause analysis over symptom treatment, evidence over intuition, and prevention over recurrence.
No fix without root cause. Never apply a fix until you can explain WHY the bug exists, not just WHERE it manifests. Symptom-level fixes create new bugs.
Establish a reliable reproduction before investigating.
Output: Documented reproduction steps, minimal test case
If you cannot reproduce: Document what you tried, check environment differences, add instrumentation and wait for next occurrence. Do not proceed to Phase 2 on guesswork — unreproducible bugs get logged, not "fixed."
Gather evidence systematically. Do NOT form hypotheses yet — this phase is about observation, not explanation.
git log --since="2 weeks ago", git bisect)Production vs development debugging:
Output: Evidence log (what you found, where, timestamps), affected component map
Form competing hypotheses ranked by evidence strength.
Example hypothesis table:
| # | Hypothesis | Category | Evidence | Testability | Test Plan |
|---|---|---|---|---|---|
| 1 | Cache returns stale data after update | State | Log shows old value 2s after write | Easy | Bypass cache and compare |
| 2 | Race condition between two workers | Race condition | Intermittent, high load correlation | Medium | Add locking, stress test |
| 3 | Upstream API returns unexpected format | Integration | No evidence yet | Easy | Log raw response |
Output: Ranked hypothesis list with evidence and test plan
Validate one hypothesis at a time. Single-variable changes only.
Red flags (return to Phase 2 immediately):
Output: Confirmed root cause with evidence chain
Implement the fix at the source, not at the symptom.
Fix principles:
Output: Fix with regression test, clean test suite
Ensure this class of bug cannot recur.
Output: Prevention measures, post-mortem (if significant)
Different bug types need different investigation approaches. See bug categories reference for the full guide.
| Category | First Move | Key Technique |
|---|---|---|
| Logic error | Read the code, trace conditions | Rubber duck walkthrough, truth tables |
| Data issue | Inspect actual vs expected data at each boundary | Boundary logging, data flow trace |
| State/race condition | Add timestamps to all state mutations | Sequence diagram, concurrency analysis |
| Integration failure | Check API contract compliance | Request/response logging, contract tests |
| Performance | Profile before guessing | Profiler, flame graphs, query analysis |
| Environment | Compare working vs broken env | Differential analysis, config audit |
| Intermittent/flaky | Increase observability first | Statistical logging, stress testing |
Stop debugging and escalate when:
Escalate to:
| Situation | Escalate To |
|---|---|
| Design or architecture issues | Architect |
| Cannot reproduce, need more info | QA team |
| Scope, priority, or trade-off questions | PM / Product Owner |
| Dependency or infrastructure issues | Platform / DevOps team |
| Security implications discovered | Security team immediately |
This debugging workflow connects to broader team processes:
| Phase | Team Integration |
|---|---|
| Reproduce | QA provides bug reports with reproduction steps; request more detail if insufficient |
| Investigate | Architect can help map component dependencies and blast radius |
| Fix | Code review by a peer before merge — a second pair of eyes catches fix-induced regressions |
| Prevent | Post-mortem shared with the team; action items tracked in the backlog |
When using other code-virtuoso skills:
| Situation | Recommended Skill |
|---|---|
| Bug fix reveals design problems | Install design-patterns-virtuoso from krzysztofsurdy/code-virtuoso |
| Fix involves refactoring | Install refactoring-virtuoso from krzysztofsurdy/code-virtuoso |
| SOLID violation is root cause | Install solid-virtuoso from krzysztofsurdy/code-virtuoso |
| PR for the fix | Use pr-message-writer from krzysztofsurdy/code-virtuoso |
Before marking a bug fix done:
No fix without root cause. This is the iron law. If you cannot explain why the bug exists, you are not done investigating.
Reproduce first. Do not investigate what you cannot reproduce. If reproduction fails, add observability and wait.
Single-variable testing. Change one thing at a time during hypothesis testing. Changing multiple variables makes results uninterpretable.
Evidence over intuition. Log your evidence. "I think it might be X" is not a hypothesis — "Log line Y shows value Z when it should show W" is.
Test before and after. A fix without a regression test is a fix that will break again.
Escalate without ego. Knowing when to stop and ask for help is a skill, not a weakness. See the escalation criteria above.
Document for the next person. The next person debugging this area might be you in six months. Leave the codebase more observable than you found it.
Never debug production by modifying production. Read-only investigation. Fixes go through the normal deployment pipeline.
Scope discipline. Fix the bug. Only the bug. Other improvements are separate tickets.
Share what you learn. Every significant bug is a learning opportunity for the team. Post-mortems are not blame — they are institutional memory.