skills/systematic-debugging/SKILL.md
4-phase debugging process (Reproduce → Root-Cause Trace → Defense-in-Depth Fix → Verify) for reliable issue resolution. Use this skill whenever investigating a bug, diagnosing unexpected behavior, debugging test failures, troubleshooting production incidents, or when something "worked yesterday but doesn't today". If you find yourself changing code hoping the bug disappears without understanding why, stop and use this skill instead.
npx skillsauth add maestria-co/ai-playbook systematic-debuggingInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Replace ad-hoc debugging with a structured 4-phase process: Reproduce → Root-Cause Trace → Defense-in-Depth Fix → Verify. This prevents the most common debugging failures: fixing symptoms instead of causes, and not verifying the fix actually works.
Goal: Create a reliable, minimal reproduction of the bug.
Goal: Find the actual cause, not just the symptom.
# Find the commit that introduced the bug
git bisect start
git bisect bad # current commit is broken
git bisect good <hash> # this commit was working
# Test each commit git bisect provides
Start from the symptom and trace backwards through the code:
When the code path is unclear:
// Temporary debugging — remove before committing
console.log('[DEBUG] value at checkpoint:', JSON.stringify(value));
Add logs at key decision points, not everywhere. Log the values, not just "reached here."
Before proceeding, confirm:
Goal: Fix the root cause and add safeguards against recurrence.
.context/standards.md)| Anti-Pattern | Why It's Bad | Do This Instead | | ------------------------------------------------ | -------------------------------------- | ---------------------------------------- | | Shotgun fix (change many things, hope one works) | Can't verify which change helped | Change one thing at a time | | Workaround without root fix | Bug will resurface in a different form | Fix the root cause | | Fix + large refactor | Mixes concerns, hard to review | Fix first, refactor in a separate commit | | Suppressing the error | Hides the symptom, cause remains | Fix the cause, let errors surface |
Goal: Prove the fix works and prevent regression.
## Bug Fix Verification
- Reproduction test: ✅ [paste test command and output]
- Regression test: ✅ [paste test name and result]
- Full suite: ✅ [paste summary - X passed, 0 failed]
- Build: ✅ [paste build output summary]
After fixing, consider:
.context/standards.md or API docs)?For bugs in production, add urgency constraints:
common-constraints escalation rule: 3 failed attempts → stop and reportdevelopment
Writes and runs a test suite for a piece of code, covering happy path, edge cases, error cases, and security cases. Use when: implementation is complete and needs test coverage, a bug needs a reproduction test and fix validation, or code needs coverage before a refactor. Do not use when: the code under test is not yet implemented, or the spec is still unclear.
testing
Use when creating a new skill, editing an existing skill, or helping a user author a skill for this system. Covers structure, discoverability, quality, and discipline hardening.
development
Evidence-based verification process to run before marking any task complete. Use this skill every time you're about to report that work is done — for features, bug fixes, refactoring, or any code change. This catches the most common failure mode: declaring "done" without proof. If you're finishing up and about to tell the user the task is complete, run this checklist first.
development
Teaches agents how to discover, select, and invoke skills from the skill library. Use this skill whenever you're uncertain which skill applies to a task, when composing multiple skills for complex work, or when you need to understand what skills are available. This is your go-to when facing an ambiguous task and need to figure out the right approach before diving into implementation.