$npx -y skills add omnigentx/jarvis --skill debugging-strategiesSystematic debugging framework. Use when a developer agent needs to find the root cause of a bug, debug performance issues, or analyse a production failure.
| 1 | # SYSTEMATIC DEBUGGING |
| 2 | |
| 3 | ## 4-phase process |
| 4 | |
| 5 | ### Phase 1: REPRODUCE |
| 6 | - Confirm the bug exists. |
| 7 | - Record the exact steps to reproduce. |
| 8 | - Capture: error message, stack trace, logs. |
| 9 | |
| 10 | ### Phase 2: HYPOTHESIZE |
| 11 | - Read the error message carefully — it usually contains a clue. |
| 12 | - List 2–3 of the most likely hypotheses. |
| 13 | - Rank them by likelihood. |
| 14 | |
| 15 | ### Phase 3: TEST |
| 16 | - Test the highest-likelihood hypothesis FIRST. |
| 17 | - Binary search: split the code in half, test each half. |
| 18 | - Add temporary logging at suspect points. |
| 19 | - DO NOT change code before you understand the root cause. |
| 20 | |
| 21 | ### Phase 4: FIX & VERIFY |
| 22 | - Fix the root cause, NOT the symptom. |
| 23 | - Write a test that reproduces the bug BEFORE the fix. |
| 24 | - Verify the fix: the new test must pass. |
| 25 | - Remove temporary logging. |
| 26 | |
| 27 | ## Decision tree |
| 28 | |
| 29 | ``` |
| 30 | What kind of bug? |
| 31 | ├── Runtime error → Read the stack trace; locate the failing line. |
| 32 | ├── Logic error → Add print/log at input and output points. |
| 33 | ├── Performance → Profile: measure time spent per phase. |
| 34 | ├── Intermittent → Look for race conditions; check timing. |
| 35 | └── Hard to reproduce → Add defensive logging. |
| 36 | ``` |
| 37 | |
| 38 | ## ❌ Anti-patterns |
| 39 | - Guess → patch random code → hope it works. |
| 40 | - Fix the symptom → root cause stays → bug returns. |
| 41 | - Skip writing a test → same bug recurs after a future refactor. |
| 42 | |
| 43 | ## ✅ Standard |
| 44 | - Reproduce → Hypothesis → Test → Fix → Verify → Commit with test. |