[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M74P43C4G02GAEWAAP4QAXS2":3,"skill-same:01M74P43C4G02GAEWAAP4QAXS2":61},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":41,"commitSha":42,"skillDirectory":43,"forksCount":13,"repositoryHtmlUrl":44,"repositoryHomepageUrl":6,"ownerHtmlUrl":45,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":46,"install":47,"resources":60},"01M74P43C4G02GAEWAAP4QAXS2","systematic-debugging",null,"4-phase root cause debugging: understand bugs before fixing.","LyrikNilpferd71\u002FHermes-Backup","LyrikNilpferd71","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F187173780?v=4","01M727S8GPB77P0S9ECRRMZT58","01M727S8HF63B0MD53F496MK1V",0,"MIT","https:\u002F\u002Fgithub.com\u002FLyrikNilpferd71\u002FHermes-Backup\u002Fblob\u002Fmain\u002Fsnapshots\u002F2026-08-23T14-00-52+0200\u002Fskills\u002Fsoftware-development\u002Fsystematic-debugging\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: systematic-debugging\ndescription: \"4-phase root cause debugging: understand bugs before fixing.\"\nversion: 1.1.0\nauthor: Hermes Agent (adapted from obra\u002Fsuperpowers)\nlicense: MIT\nplatforms: [linux, macos, windows]\nmetadata:\n  hermes:\n    tags: [debugging, troubleshooting, problem-solving, root-cause, investigation]\n    related_skills: [test-driven-development, plan, subagent-driven-development]\n---\n\n# Systematic Debugging\n\n## Overview\n\nRandom fixes waste time and create new bugs. Quick patches mask underlying issues.\n\n**Core principle:** ALWAYS find root cause before attempting fixes. Symptom fixes are failure.\n\n**Violating the letter of this process is violating the spirit of debugging.**\n\n## The Iron Law\n\n```\nNO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST\n```\n\nIf you haven't completed Phase 1, you cannot propose fixes.\n\n## The Feedback Loop Rule\n\nThe feedback loop is the debugging work. Before reading code to build a theory, create or identify a **tight** command that can go red on the user's exact symptom and green when the bug is fixed. A tight loop is fast, deterministic, agent-runnable, and specific enough to catch this bug — not merely \"doesn't crash\".\n\nWhen a clean repro is hard, spend disproportionate effort building the loop. Guessing without a red-capable loop is the failure mode this skill exists to prevent.\n\n## When to Use\n\nUse for ANY technical issue:\n- Test failures\n- Bugs in production\n- Unexpected behavior\n- Performance problems\n- Build failures\n- Integration issues\n\n**Use this ESPECIALLY when:**\n- Under time pressure (emergencies make guessing tempting)\n- \"Just one quick fix\" seems obvious\n- You've already tried multiple fixes\n- Previous fix didn't work\n- You don't fully understand the issue\n\n**Don't skip when:**\n- Issue seems simple (simple bugs have root causes too)\n- You're in a hurry (rushing guarantees rework)\n- Someone wants it fixed NOW (systematic is faster than thrashing)\n\n## The Four Phases\n\nYou MUST complete each phase before proceeding to the next.\n\n---\n\n## Phase 1: Root Cause Investigation\n\n**BEFORE attempting ANY fix:**\n\n### 1. Read Error Messages Carefully\n\n- Don't skip past errors or warnings\n- They often contain the exact solution\n- Read stack traces completely\n- Note line numbers, file paths, error codes\n\n**Action:** Use `read_file` on the relevant source files. Use `search_files` to find the error string in the codebase.\n\n### 2. Build a Tight Feedback Loop\n\n- Can you trigger the user's exact symptom with one command?\n- Does the command fail for this bug and only pass once the bug is fixed?\n- Is it fast enough to run repeatedly?\n- Is it deterministic? For flaky bugs, can you raise the reproduction rate high enough to debug?\n- If not reproducible → gather more data, don't guess.\n\n**Ways to construct a loop — try in roughly this order:**\n\n1. **Failing test** at the seam that reaches the bug: unit, integration, or end-to-end.\n2. **HTTP script \u002F curl** against a running dev server.\n3. **CLI invocation** with fixture input, diffing stdout\u002Fstderr against expected output.\n4. **Headless browser script** (Playwright\u002FPuppeteer) asserting on DOM, console, or network.\n5. **Replay a captured trace**: HAR, request payload, event log, queue message, or webhook body.\n6. **Throwaway harness** that boots the smallest useful slice of the system and calls the failing path.\n7. **Property \u002F fuzz loop** when the bug is intermittent wrong output over a broad input space.\n8. **Bisection harness** suitable for `git bisect run` when the bug appeared between two known states.\n9. **Differential loop** comparing old vs new version, two configs, two providers, or two datasets.\n10. **Human-in-the-loop script** only as a last resort: script the human steps and capture their result so the loop stays structured.\n\n**Tighten the loop once it exists:**\n\n- Make it faster: cache setup, narrow scope, skip unrelated initialization.\n- Make the signal sharper: assert the exact symptom, not generic success.\n- Make it more deterministic: pin time, seed randomness, isolate filesystem, freeze network.\n\nFor non-deterministic bugs, the immediate goal is a higher reproduction rate, not perfection. Run the trigger 100x, parallelize, add stress, narrow timing windows, or inject sleeps. A 50% flake is debuggable; a 1% flake usually is not.\n\n**Action:** Use the `terminal` tool to run the tight loop:\n\n```bash\n# Run a specific failing test\npytest tests\u002Ftest_module.py::test_name -v\n\n# Or run a scripted repro\npython scripts\u002Frepro_bug.py\n\n# Or run a high-repetition flaky repro\nfor i in {1..100}; do pytest tests\u002Ftest_flake.py::test_name -q || break; done\n```\n\n### 3. Check Recent Changes\n\n- What changed that could cause this?\n- Git diff, recent commits\n- New dependencies, config changes\n\n**Action:**\n\n```bash\n# Recent commits\ngit log --oneline -10\n\n# Uncommitted changes\ngit diff\n\n# Changes in specific file\ngit log -p --follow src\u002Fproblematic_file.py | head -100\n```\n\n### 4. Gather Evidence in Multi-Component Systems\n\n**WHEN system has multiple components (API → service → database, CI → build → deploy):**\n\n**BEFORE proposing fixes, add diagnostic instrumentation:**\n\nFor EACH component boundary:\n- Log what data enters the component\n- Log what data exits the component\n- Verify environment\u002Fconfig propagation\n- Check state at each layer\n\nRun once to gather evidence showing WHERE it breaks.\nTHEN analyze evidence to identify the failing component.\nTHEN investigate that specific component.\n\n### 5. Trace Data Flow\n\n**WHEN error is deep in the call stack:**\n\n- Where does the bad value originate?\n- What called this function with the bad value?\n- Keep tracing upstream until you find the source\n- Fix at the source, not at the symptom\n\n**Action:** Use `search_files` to trace references:\n\n```python\n# Find where the function is called\nsearch_files(\"function_name(\", path=\"src\u002F\", file_glob=\"*.py\")\n\n# Find where the variable is set\nsearch_files(\"variable_name\\\\s*=\", path=\"src\u002F\", file_glob=\"*.py\")\n```\n\n### Phase 1 Completion Checklist\n\n- [ ] Error messages fully read and understood\n- [ ] A tight loop command exists and has been run at least once\n- [ ] Loop is red-capable: it asserts the user's exact symptom, not a nearby failure\n- [ ] Loop is deterministic, or a flaky bug has a high enough reproduction rate to debug\n- [ ] Recent changes identified and reviewed\n- [ ] Evidence gathered (logs, state, data flow)\n- [ ] Problem isolated to specific component\u002Fcode\n- [ ] Root cause hypotheses can be stated and tested\n\n**STOP:** Do not proceed to Phase 2 until you understand WHY it's happening.\n\n---\n\n## Phase 2: Pattern Analysis\n\n**Find the pattern before fixing:**\n\n### 0. Minimize the Reproduction\n\nOnce the loop is red, shrink the repro to the smallest scenario that still goes red. Cut inputs, callers, config, data, and steps **one at a time**, re-running the loop after each cut. Keep only what is load-bearing for the failure.\n\nDone when removing any remaining element makes the loop go green. A minimal repro narrows the hypothesis space and often becomes the cleanest regression test.\n\n### 1. Find Working Examples\n\n- Locate similar working code in the same codebase\n- What works that's similar to what's broken?\n\n**Action:** Use `search_files` to find comparable patterns:\n\n```python\nsearch_files(\"similar_pattern\", path=\"src\u002F\", file_glob=\"*.py\")\n```\n\n### 2. Compare Against References\n\n- If implementing a pattern, read the reference implementation COMPLETELY\n- Don't skim — read every line\n- Understand the pattern fully before applying\n\n### 3. Identify Differences\n\n- What's different between working and broken?\n- List every difference, however small\n- Don't assume \"that can't matter\"\n\n### 4. Understand Dependencies\n\n- What other components does this need?\n- What settings, config, environment?\n- What assumptions does it make?\n\n---\n\n## Phase 3: Hypothesis and Testing\n\n**Scientific method:**\n\n### 1. Form Ranked Falsifiable Hypotheses\n\n- Generate 3–5 plausible hypotheses before testing any single one.\n- Rank them by likelihood and cheapness to falsify.\n- State the prediction each hypothesis makes: \"If X is the cause, then changing or observing Y should make Z happen.\"\n- Discard or sharpen any hypothesis that does not make a testable prediction.\n\nIf the user is present, show the ranked list before testing. They may have domain knowledge that instantly re-ranks it. If the user is AFK, proceed with your ranking.\n\n### 2. Test Minimally\n\n- Test the highest-ranked hypothesis with the smallest possible probe.\n- Change one variable at a time.\n- Don't fix multiple things at once.\n- Prefer debugger\u002FREPL inspection when available; one breakpoint beats ten logs.\n- If you add logs, tag every temporary line with a unique prefix such as `[DEBUG-a4f2]` so cleanup is a single search.\n\n### 3. Verify Before Continuing\n\n- Did it work? → Phase 4\n- Didn't work? → Form NEW hypothesis\n- DON'T add more fixes on top\n\n### 4. When You Don't Know\n\n- Say \"I don't understand X\"\n- Don't pretend to know\n- Ask the user for help\n- Research more\n\n---\n\n## Phase 4: Implementation\n\n**Fix the root cause, not the symptom:**\n\n### 1. Create Failing Test Case\n\n- Simplest possible reproduction\n- Automated test if possible\n- MUST have before fixing\n- Use the `test-driven-development` skill\n\n### 2. Implement Single Fix\n\n- Address the root cause identified\n- ONE change at a time\n- No \"while I'm here\" improvements\n- No bundled refactoring\n\n### 3. Verify Fix\n\n```bash\n# Run the specific regression test\npytest tests\u002Ftest_module.py::test_regression -v\n\n# Run full suite — no regressions\npytest tests\u002F -q\n```\n\n### 4. If Fix Doesn't Work — The Rule of Three\n\n- **STOP.**\n- Count: How many fixes have you tried?\n- If \u003C 3: Return to Phase 1, re-analyze with new information\n- **If ≥ 3: STOP and question the architecture (step 5 below)**\n- DON'T attempt Fix #4 without architectural discussion\n\n### 5. If 3+ Fixes Failed: Question Architecture\n\n**Pattern indicating an architectural problem:**\n- Each fix reveals new shared state\u002Fcoupling in a different place\n- Fixes require \"massive refactoring\" to implement\n- Each fix creates new symptoms elsewhere\n\n**STOP and question fundamentals:**\n- Is this pattern fundamentally sound?\n- Are we \"sticking with it through sheer inertia\"?\n- Should we refactor the architecture vs. continue fixing symptoms?\n\n**Discuss with the user before attempting more fixes.**\n\nThis is NOT a failed hypothesis — this is a wrong architecture.\n\n---\n\n## Red Flags — STOP and Follow Process\n\nIf you catch yourself thinking:\n- \"Quick fix for now, investigate later\"\n- \"Just try changing X and see if it works\"\n- \"Add multiple changes, run tests\"\n- \"Skip the test, I'll manually verify\"\n- \"It's probably X, let me fix that\"\n- \"I don't fully understand but this might work\"\n- \"Pattern says X but I'll adapt it differently\"\n- \"Here are the main problems: [lists fixes without investigation]\"\n- Proposing solutions before tracing data flow\n- **\"One more fix attempt\" (when already tried 2+)**\n- **Each fix reveals a new problem in a different place**\n\n**ALL of these mean: STOP. Return to Phase 1.**\n\n**If 3+ fixes failed:** Question the architecture (Phase 4 step 5).\n\n## Common Rationalizations\n\n| Excuse | Reality |\n|--------|---------|\n| \"Issue is simple, don't need process\" | Simple issues have root causes too. Process is fast for simple bugs. |\n| \"Emergency, no time for process\" | Systematic debugging is FASTER than guess-and-check thrashing. |\n| \"Just try this first, then investigate\" | First fix sets the pattern. Do it right from the start. |\n| \"I'll write test after confirming fix works\" | Untested fixes don't stick. Test first proves it. |\n| \"Multiple fixes at once saves time\" | Can't isolate what worked. Causes new bugs. |\n| \"Reference too long, I'll adapt the pattern\" | Partial understanding guarantees bugs. Read it completely. |\n| \"I see the problem, let me fix it\" | Seeing symptoms ≠ understanding root cause. |\n| \"One more fix attempt\" (after 2+ failures) | 3+ failures = architectural problem. Question the pattern, don't fix again. |\n\n## Quick Reference\n\n| Phase | Key Activities | Success Criteria |\n|-------|---------------|------------------|\n| **1. Root Cause** | Read errors, reproduce, check changes, gather evidence, trace data flow | Understand WHAT and WHY |\n| **2. Pattern** | Find working examples, compare, identify differences | Know what's different |\n| **3. Hypothesis** | Form theory, test minimally, one variable at a time | Confirmed or new hypothesis |\n| **4. Implementation** | Create regression test, fix root cause, verify | Bug resolved, all tests pass |\n\n## Hermes Agent Integration\n\n### Investigation Tools\n\nUse these Hermes tools during Phase 1:\n\n- **`search_files`** — Find error strings, trace function calls, locate patterns\n- **`read_file`** — Read source code with line numbers for precise analysis\n- **`terminal`** — Run tests, check git history, reproduce bugs\n- **`web_search`\u002F`web_extract`** — Research error messages, library docs\n\n### With delegate_task\n\nFor complex multi-component debugging, dispatch investigation subagents:\n\n```python\ndelegate_task(\n    goal=\"Investigate why [specific test\u002Fbehavior] fails\",\n    context=\"\"\"\n    Follow systematic-debugging skill:\n    1. Read the error message carefully\n    2. Reproduce the issue\n    3. Trace the data flow to find root cause\n    4. Report findings — do NOT fix yet\n\n    Error: [paste full error]\n    File: [path to failing code]\n    Test command: [exact command]\n    \"\"\",\n    toolsets=['terminal', 'file']\n)\n```\n\n### With test-driven-development\n\nWhen fixing bugs:\n1. Write a test that reproduces the bug (RED)\n2. Debug systematically to find root cause\n3. Fix the root cause (GREEN)\n4. The test proves the fix and prevents regression\n\n## Real-World Impact\n\nFrom debugging sessions:\n- Systematic approach: 15-30 minutes to fix\n- Random fixes approach: 2-3 hours of thrashing\n- First-time fix rate: 95% vs 40%\n- New bugs introduced: Near zero vs common\n\n**No shortcuts. No guessing. Systematic always wins.**\n","# Systematic Debugging\n\n## Overview\n\nRandom fixes waste time and create new bugs. Quick patches mask underlying issues.\n\n**Core principle:** ALWAYS find root cause before attempting fixes. Symptom fixes are failure.\n\n**Violating the letter of this process is violating the spirit of debugging.**\n\n## The Iron Law\n\n```\nNO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST\n```\n\nIf you haven't completed Phase 1, you cannot propose fixes.\n\n## The Feedback Loop Rule\n\nThe feedback loop is the debugging work. Before reading code to build a theory, create or identify a **tight** command that can go red on the user's exact symptom and green when the bug is fixed. A tight loop is fast, deterministic, agent-runnable, and specific enough to catch this bug — not merely \"doesn't crash\".\n\nWhen a clean repro is hard, spend disproportionate effort building the loop. Guessing without a red-capable loop is the failure mode this skill exists to prevent.\n\n## When to Use\n\nUse for ANY technical issue:\n- Test failures\n- Bugs in production\n- Unexpected behavior\n- Performance problems\n- Build failures\n- Integration issues\n\n**Use this ESPECIALLY when:**\n- Under time pressure (emergencies make guessing tempting)\n- \"Just one quick fix\" seems obvious\n- You've already tried multiple fixes\n- Previous fix didn't work\n- You don't fully understand the issue\n\n**Don't skip when:**\n- Issue seems simple (simple bugs have root causes too)\n- You're in a hurry (rushing guarantees rework)\n- Someone wants it fixed NOW (systematic is faster than thrashing)\n\n## The Four Phases\n\nYou MUST complete each phase before proceeding to the next.\n\n---\n\n## Phase 1: Root Cause Investigation\n\n**BEFORE attempting ANY fix:**\n\n### 1. Read Error Messages Carefully\n\n- Don't skip past errors or warnings\n- They often contain the exact solution\n- Read stack traces completely\n- Note line numbers, file paths, error codes\n\n**Action:** Use `read_file` on the relevant source files. Use `search_files` to find the error string in the codebase.\n\n### 2. Build a Tight Feedback Loop\n\n- Can you trigger the user's exact symptom with one command?\n- Does the command fail for this bug and only pass once the bug is fixed?\n- Is it fast enough to run repeatedly?\n- Is it deterministic? For flaky bugs, can you raise the reproduction rate high enough to debug?\n- If not reproducible → gather more data, don't guess.\n\n**Ways to construct a loop — try in roughly this order:**\n\n1. **Failing test** at the seam that reaches the bug: unit, integration, or end-to-end.\n2. **HTTP script \u002F curl** against a running dev server.\n3. **CLI invocation** with fixture input, diffing stdout\u002Fstderr against expected output.\n4. **Headless browser script** (Playwright\u002FPuppeteer) asserting on DOM, console, or network.\n5. **Replay a captured trace**: HAR, request payload, event log, queue message, or webhook body.\n6. **Throwaway harness** that boots the smallest useful slice of the system and calls the failing path.\n7. **Property \u002F fuzz loop** when the bug is intermittent wrong output over a broad input space.\n8. **Bisection harness** suitable for `git bisect run` when the bug appeared between two known states.\n9. **Differential loop** comparing old vs new version, two configs, two providers, or two datasets.\n10. **Human-in-the-loop script** only as a last resort: script the human steps and capture their result so the loop stays structured.\n\n**Tighten the loop once it exists:**\n\n- Make it faster: cache setup, narrow scope, skip unrelated initialization.\n- Make the signal sharper: assert the exact symptom, not generic success.\n- Make it more deterministic: pin time, seed randomness, isolate filesystem, freeze network.\n\nFor non-deterministic bugs, the immediate goal is a higher reproduction rate, not perfection. Run the trigger 100x, parallelize, add stress, narrow timing windows, or inject sleeps. A 50% flake is debuggable; a 1% flake usually is not.\n\n**Action:** Use the `terminal` tool to run the tight loop:\n\n```bash\n# Run a specific failing test\npytest tests\u002Ftest_module.py::test_name -v\n\n# Or run a scripted repro\npython scripts\u002Frepro_bug.py\n\n# Or run a high-repetition flaky repro\nfor i in {1..100}; do pytest tests\u002Ftest_flake.py::test_name -q || break; done\n```\n\n### 3. Check Recent Changes\n\n- What changed that could cause this?\n- Git diff, recent commits\n- New dependencies, config changes\n\n**Action:**\n\n```bash\n# Recent commits\ngit log --oneline -10\n\n# Uncommitted changes\ngit diff\n\n# Changes in specific file\ngit log -p --follow src\u002Fproblematic_file.py | head -100\n```\n\n### 4. Gather Evidence in Multi-Component Systems\n\n**WHEN system has multiple components (API → service → database, CI → build → deploy):**\n\n**BEFORE proposing fixes, add diagnostic instrumentation:**\n\nFor EACH component boundary:\n- Log what data enters the component\n- Log what data exits the component\n- Verify environment\u002Fconfig propagation\n- Check state at each layer\n\nRun once to gather evidence showing WHERE it breaks.\nTHEN analyze evidence to identify the failing component.\nTHEN investigate that specific component.\n\n### 5. Trace Data Flow\n\n**WHEN error is deep in the call stack:**\n\n- Where does the bad value originate?\n- What called this function with the bad value?\n- Keep tracing upstream until you find the source\n- Fix at the source, not at the symptom\n\n**Action:** Use `search_files` to trace references:\n\n```python\n# Find where the function is called\nsearch_files(\"function_name(\", path=\"src\u002F\", file_glob=\"*.py\")\n\n# Find where the variable is set\nsearch_files(\"variable_name\\\\s*=\", path=\"src\u002F\", file_glob=\"*.py\")\n```\n\n### Phase 1 Completion Checklist\n\n- [ ] Error messages fully read and understood\n- [ ] A tight loop command exists and has been run at least once\n- [ ] Loop is red-capable: it asserts the user's exact symptom, not a nearby failure\n- [ ] Loop is deterministic, or a flaky bug has a high enough reproduction rate to debug\n- [ ] Recent changes identified and reviewed\n- [ ] Evidence gathered (logs, state, data flow)\n- [ ] Problem isolated to specific component\u002Fcode\n- [ ] Root cause hypotheses can be stated and tested\n\n**STOP:** Do not proceed to Phase 2 until you understand WHY it's happening.\n\n---\n\n## Phase 2: Pattern Analysis\n\n**Find the pattern before fixing:**\n\n### 0. Minimize the Reproduction\n\nOnce the loop is red, shrink the repro to the smallest scenario that still goes red. Cut inputs, callers, config, data, and steps **one at a time**, re-running the loop after each cut. Keep only what is load-bearing for the failure.\n\nDone when removing any remaining element makes the loop go green. A minimal repro narrows the hypothesis space and often becomes the cleanest regression test.\n\n### 1. Find Working Examples\n\n- Locate similar working code in the same codebase\n- What works that's similar to what's broken?\n\n**Action:** Use `search_files` to find comparable patterns:\n\n```python\nsearch_files(\"similar_pattern\", path=\"src\u002F\", file_glob=\"*.py\")\n```\n\n### 2. Compare Against References\n\n- If implementing a pattern, read the reference implementation COMPLETELY\n- Don't skim — read every line\n- Understand the pattern fully before applying\n\n### 3. Identify Differences\n\n- What's different between working and broken?\n- List every difference, however small\n- Don't assume \"that can't matter\"\n\n### 4. Understand Dependencies\n\n- What other components does this need?\n- What settings, config, environment?\n- What assumptions does it make?\n\n---\n\n## Phase 3: Hypothesis and Testing\n\n**Scientific method:**\n\n### 1. Form Ranked Falsifiable Hypotheses\n\n- Generate 3–5 plausible hypotheses before testing any single one.\n- Rank them by likelihood and cheapness to falsify.\n- State the prediction each hypothesis makes: \"If X is the cause, then changing or observing Y should make Z happen.\"\n- Discard or sharpen any hypothesis that does not make a testable prediction.\n\nIf the user is present, show the ranked list before testing. They may have domain knowledge that instantly re-ranks it. If the user is AFK, proceed with your ranking.\n\n### 2. Test Minimally\n\n- Test the highest-ranked hypothesis with the smallest possible probe.\n- Change one variable at a time.\n- Don't fix multiple things at once.\n- Prefer debugger\u002FREPL inspection when available; one breakpoint beats ten logs.\n- If you add logs, tag every temporary line with a unique prefix such as `[DEBUG-a4f2]` so cleanup is a single search.\n\n### 3. Verify Before Continuing\n\n- Did it work? → Phase 4\n- Didn't work? → Form NEW hypothesis\n- DON'T add more fixes on top\n\n### 4. When You Don't Know\n\n- Say \"I don't understand X\"\n- Don't pretend to know\n- Ask the user for help\n- Research more\n\n---\n\n## Phase 4: Implementation\n\n**Fix the root cause, not the symptom:**\n\n### 1. Create Failing Test Case\n\n- Simplest possible reproduction\n- Automated test if possible\n- MUST have before fixing\n- Use the `test-driven-development` skill\n\n### 2. Implement Single Fix\n\n- Address the root cause identified\n- ONE change at a time\n- No \"while I'm here\" improvements\n- No bundled refactoring\n\n### 3. Verify Fix\n\n```bash\n# Run the specific regression test\npytest tests\u002Ftest_module.py::test_regression -v\n\n# Run full suite — no regressions\npytest tests\u002F -q\n```\n\n### 4. If Fix Doesn't Work — The Rule of Three\n\n- **STOP.**\n- Count: How many fixes have you tried?\n- If \u003C 3: Return to Phase 1, re-analyze with new information\n- **If ≥ 3: STOP and question the architecture (step 5 below)**\n- DON'T attempt Fix #4 without architectural discussion\n\n### 5. If 3+ Fixes Failed: Question Architecture\n\n**Pattern indicating an architectural problem:**\n- Each fix reveals new shared state\u002Fcoupling in a different place\n- Fixes require \"massive refactoring\" to implement\n- Each fix creates new symptoms elsewhere\n\n**STOP and question fundamentals:**\n- Is this pattern fundamentally sound?\n- Are we \"sticking with it through sheer inertia\"?\n- Should we refactor the architecture vs. continue fixing symptoms?\n\n**Discuss with the user before attempting more fixes.**\n\nThis is NOT a failed hypothesis — this is a wrong architecture.\n\n---\n\n## Red Flags — STOP and Follow Process\n\nIf you catch yourself thinking:\n- \"Quick fix for now, investigate later\"\n- \"Just try changing X and see if it works\"\n- \"Add multiple changes, run tests\"\n- \"Skip the test, I'll manually verify\"\n- \"It's probably X, let me fix that\"\n- \"I don't fully understand but this might work\"\n- \"Pattern says X but I'll adapt it differently\"\n- \"Here are the main problems: [lists fixes without investigation]\"\n- Proposing solutions before tracing data flow\n- **\"One more fix attempt\" (when already tried 2+)**\n- **Each fix reveals a new problem in a different place**\n\n**ALL of these mean: STOP. Return to Phase 1.**\n\n**If 3+ fixes failed:** Question the architecture (Phase 4 step 5).\n\n## Common Rationalizations\n\n| Excuse | Reality |\n|--------|---------|\n| \"Issue is simple, don't need process\" | Simple issues have root causes too. Process is fast for simple bugs. |\n| \"Emergency, no time for process\" | Systematic debugging is FASTER than guess-and-check thrashing. |\n| \"Just try this first, then investigate\" | First fix sets the pattern. Do it right from the start. |\n| \"I'll write test after confirming fix works\" | Untested fixes don't stick. Test first proves it. |\n| \"Multiple fixes at once saves time\" | Can't isolate what worked. Causes new bugs. |\n| \"Reference too long, I'll adapt the pattern\" | Partial understanding guarantees bugs. Read it completely. |\n| \"I see the problem, let me fix it\" | Seeing symptoms ≠ understanding root cause. |\n| \"One more fix attempt\" (after 2+ failures) | 3+ failures = architectural problem. Question the pattern, don't fix again. |\n\n## Quick Reference\n\n| Phase | Key Activities | Success Criteria |\n|-------|---------------|------------------|\n| **1. Root Cause** | Read errors, reproduce, check changes, gather evidence, trace data flow | Understand WHAT and WHY |\n| **2. Pattern** | Find working examples, compare, identify differences | Know what's different |\n| **3. Hypothesis** | Form theory, test minimally, one variable at a time | Confirmed or new hypothesis |\n| **4. Implementation** | Create regression test, fix root cause, verify | Bug resolved, all tests pass |\n\n## Hermes Agent Integration\n\n### Investigation Tools\n\nUse these Hermes tools during Phase 1:\n\n- **`search_files`** — Find error strings, trace function calls, locate patterns\n- **`read_file`** — Read source code with line numbers for precise analysis\n- **`terminal`** — Run tests, check git history, reproduce bugs\n- **`web_search`\u002F`web_extract`** — Research error messages, library docs\n\n### With delegate_task\n\nFor complex multi-component debugging, dispatch investigation subagents:\n\n```python\ndelegate_task(\n    goal=\"Investigate why [specific test\u002Fbehavior] fails\",\n    context=\"\"\"\n    Follow systematic-debugging skill:\n    1. Read the error message carefully\n    2. Reproduce the issue\n    3. Trace the data flow to find root cause\n    4. Report findings — do NOT fix yet\n\n    Error: [paste full error]\n    File: [path to failing code]\n    Test command: [exact command]\n    \"\"\",\n    toolsets=['terminal', 'file']\n)\n```\n\n### With test-driven-development\n\nWhen fixing bugs:\n1. Write a test that reproduces the bug (RED)\n2. Debug systematically to find root cause\n3. Fix the root cause (GREEN)\n4. The test proves the fix and prevents regression\n\n## Real-World Impact\n\nFrom debugging sessions:\n- Systematic approach: 15-30 minutes to fix\n- Random fixes approach: 2-3 hours of thrashing\n- First-time fix rate: 95% vs 40%\n- New bugs introduced: Near zero vs common\n\n**No shortcuts. No guessing. Systematic always wins.**\n",{"name":5,"author":23,"license":14,"version":24,"metadata":25,"platforms":37,"description":7},"Hermes Agent (adapted from obra\u002Fsuperpowers)","1.1.0",{"hermes":26},{"tags":27,"related_skills":33},[28,29,30,31,32],"debugging","troubleshooting","problem-solving","root-cause","investigation",[34,35,36],"test-driven-development","plan","subagent-driven-development",[38,39,40],"linux","macos","windows","main","404fd33aabef3b6bc1cc913117ba2160ade62625","snapshots\u002F2026-08-23T14-00-52+0200\u002Fskills\u002Fsoftware-development\u002Fsystematic-debugging","https:\u002F\u002Fgithub.com\u002FLyrikNilpferd71\u002FHermes-Backup","https:\u002F\u002Fgithub.com\u002FLyrikNilpferd71","2026-11-08 20:00:57",{"source":8,"skillName":5,"commands":48,"prompt":58,"zipAvailable":59},[49,52,55],{"tool":50,"command":51},"npx","npx skills add LyrikNilpferd71\u002FHermes-Backup --skill systematic-debugging",{"tool":53,"command":54},"bunx","bunx skills add LyrikNilpferd71\u002FHermes-Backup --skill systematic-debugging",{"tool":56,"command":57},"pnpm","pnpm dlx skills add LyrikNilpferd71\u002FHermes-Backup --skill systematic-debugging","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FLyrikNilpferd71\u002FHermes-Backup\u002Fblob\u002Fmain\u002Fsnapshots\u002F2026-08-23T14-00-52+0200\u002Fskills\u002Fsoftware-development\u002Fsystematic-debugging\u002FSKILL.md",true,[],[62,70,75,81,87,94],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":69},"01M76BBCCNA7WQ82Q8QNZH8PBK","writing-plans","Write implementation plans: bite-sized tasks, paths, code.","https:\u002F\u002Fgithub.com\u002FLyrikNilpferd71\u002FHermes-Backup\u002Fblob\u002Fmain\u002Fsnapshots\u002F2026-11-08T13-00-51+0100\u002Fskills\u002Fsoftware-development\u002Fwriting-plans\u002FSKILL.md",[],[],"2026-11-12 13:55:43",{"skillNo":71,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":69},"01M76BB8YS41CA3NKW0YMSSB88","https:\u002F\u002Fgithub.com\u002FLyrikNilpferd71\u002FHermes-Backup\u002Fblob\u002Fmain\u002Fsnapshots\u002F2026-11-08T13-00-51+0100\u002Fskills\u002Fsoftware-development\u002Fsystematic-debugging\u002FSKILL.md",[],[],{"skillNo":76,"name":36,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":69},"01M76BB680FPNT998E1GM2QW10","Execute plans via delegate_task subagents (2-stage review).","https:\u002F\u002Fgithub.com\u002FLyrikNilpferd71\u002FHermes-Backup\u002Fblob\u002Fmain\u002Fsnapshots\u002F2026-11-08T13-00-51+0100\u002Fskills\u002Fsoftware-development\u002Fsubagent-driven-development\u002FSKILL.md",[],[],{"skillNo":82,"name":35,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":69},"01M76BB3C4ZB9S4RWPMM8MX0YB","Write a markdown plan to .hermes\u002Fplans\u002F; no execution.","https:\u002F\u002Fgithub.com\u002FLyrikNilpferd71\u002FHermes-Backup\u002Fblob\u002Fmain\u002Fsnapshots\u002F2026-11-08T13-00-51+0100\u002Fskills\u002Fsoftware-development\u002Fplan\u002FSKILL.md",[],[],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":69},"01M76BB0NK28KMP51YDB5R3EXA","hermes-agent-skill-authoring","Author in-repo SKILL.md files: frontmatter and structure.","https:\u002F\u002Fgithub.com\u002FLyrikNilpferd71\u002FHermes-Backup\u002Fblob\u002Fmain\u002Fsnapshots\u002F2026-11-08T13-00-51+0100\u002Fskills\u002Fsoftware-development\u002Fhermes-agent-skill-authoring\u002FSKILL.md",[],[],{"skillNo":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":69},"01M76BAYV58H0CKNSTZE3ZH4NY","debugging-hermes-tui-commands","Debug Hermes TUI slash commands: Python, gateway, Ink UI.","https:\u002F\u002Fgithub.com\u002FLyrikNilpferd71\u002FHermes-Backup\u002Fblob\u002Fmain\u002Fsnapshots\u002F2026-11-08T13-00-51+0100\u002Fskills\u002Fsoftware-development\u002Fdebugging-hermes-tui-commands\u002FSKILL.md",[],[]]