[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6CB7FQ407KQTD4Z9VAWKY54":3,"skill-same:01M6CB7FQ407KQTD4Z9VAWKY54":80},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":18,"categories":19,"keywords":30,"publishedAt":44,"linkOnly":45,"markdownContent":46,"markdownBody":47,"frontMatter":48,"refName":59,"commitSha":60,"skillDirectory":61,"forksCount":62,"repositoryHtmlUrl":63,"repositoryHomepageUrl":17,"ownerHtmlUrl":64,"ownerBlogUrl":17,"ownerDescription":17,"updatedAt":65,"install":66,"resources":79},"01M6CB7FQ407KQTD4Z9VAWKY54","systematic-debugging","系统化根因调试","4-phase root cause debugging: understand bugs before fixing.","四阶段根因调试：先理解缺陷，再着手修复。","adnichols\u002Fai-configs","adnichols","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F493746?v=4","01M6C33VRY9WF6XWYPT1AFA7JJ","Aaron Nichols","01M6C33VWTNKGRM92E9G643V4W",5,"MIT",null,"https:\u002F\u002Fgithub.com\u002Fadnichols\u002Fai-configs\u002Fblob\u002Fmain\u002F_hermes\u002Fdefault\u002Fskills\u002Fsoftware-development\u002Fsystematic-debugging\u002FSKILL.md",[20,25],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQ6TQZN6R52WBJ9H8NRMQM","软件开发工程师","PROFESSION","适用职业",{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BRSRYQ3M8N5063NNQPF2B1","调试与故障排查","SCENARIO","使用场景",[31,32,33,34,35,36,37,38,39,40,41,42,43],"systematic debugging","debugging","macos","linux","test","windows","development","investigation","plan","troubleshooting","hermes","hermes agent","superpowers","2026-11-10 10:12:30",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]\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### Direct investigation\n\nKeep debugging in the driving session so hypotheses, experiments, and fixes share one evidence trail. Use direct search, reads, reproduction commands, and targeted instrumentation. If an explicitly read-only helper is used for a bounded evidence question, the driving agent still owns diagnosis and all fixes.\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### Direct investigation\n\nKeep debugging in the driving session so hypotheses, experiments, and fixes share one evidence trail. Use direct search, reads, reproduction commands, and targeted instrumentation. If an explicitly read-only helper is used for a bounded evidence question, the driving agent still owns diagnosis and all fixes.\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":49,"license":16,"version":50,"metadata":51,"platforms":58,"description":7},"Hermes Agent (adapted from obra\u002Fsuperpowers)","1.1.0",{"hermes":52},{"tags":53,"related_skills":56},[32,40,54,55,38],"problem-solving","root-cause",[57,39],"test-driven-development",[34,33,36],"main","64e2fc9afa7bb3da1138eb73399144d0e7e73e9d","_hermes\u002Fdefault\u002Fskills\u002Fsoftware-development\u002Fsystematic-debugging",4,"https:\u002F\u002Fgithub.com\u002Fadnichols\u002Fai-configs","https:\u002F\u002Fgithub.com\u002Fadnichols","2026-11-06 00:28:38",{"source":9,"skillName":5,"commands":67,"prompt":77,"zipAvailable":78},[68,71,74],{"tool":69,"command":70},"npx","npx skills add adnichols\u002Fai-configs --skill systematic-debugging",{"tool":72,"command":73},"bunx","bunx skills add adnichols\u002Fai-configs --skill systematic-debugging",{"tool":75,"command":76},"pnpm","pnpm dlx skills add adnichols\u002Fai-configs --skill systematic-debugging","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fadnichols\u002Fai-configs\u002Fblob\u002Fmain\u002F_hermes\u002Fdefault\u002Fskills\u002Fsoftware-development\u002Fsystematic-debugging\u002FSKILL.md",true,[],[81,106,130,149,168,189],{"skillNo":82,"name":83,"nameZh":84,"description":85,"descriptionZh":86,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":87,"categories":88,"keywords":95,"publishedAt":44},"01M6CB7RN791P5RRRCJWWC7DAR","blocked-page-recovery","网页抓取受阻恢复","Use when a fetch fails: 403\u002F429, paywall, WAF, bot wall.","当抓取失败时使用：403\u002F429 状态码、付费墙（paywall）、WAF、机器人验证墙（bot wall）。","https:\u002F\u002Fgithub.com\u002Fadnichols\u002Fai-configs\u002Fblob\u002Fmain\u002F_hermes\u002Fdefault\u002Fskills\u002Fweb\u002Fblocked-page-recovery\u002FSKILL.md",[89,92],{"categoryNo":90,"categoryName":91,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BRK8296DVQW3GCBXC89NVG","网页搜索与信息研究",{"categoryNo":93,"categoryName":94,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BTGTEHKD89NSZ5CT4Y5AGV","数据工程师",[96,97,98,33,99,34,100,36,101,102,41,42,103,104,105],"recovery","page","blocked page recovery","bot","research","waf","Citations","fetch","use","fallback",{"skillNo":107,"name":108,"nameZh":109,"description":110,"descriptionZh":111,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":112,"categories":113,"keywords":118,"publishedAt":44},"01M6CB7NQY2VVYCQJ1QBXACQF4","writing-plans","软件实施计划编写","Use when creating or updating executable software plans. Keep plans as local files unless the user explicitly asks to register them in Doct.","在创建或更新可执行的软件计划时使用。除非用户明确要求将计划注册到 Doct，否则请将计划保留为本地文件。","https:\u002F\u002Fgithub.com\u002Fadnichols\u002Fai-configs\u002Fblob\u002Fmain\u002F_hermes\u002Fdefault\u002Fskills\u002Fsoftware-development\u002Fwriting-plans\u002FSKILL.md",[114,115],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":116,"categoryName":117,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BTBRTQXJ9T5TABNS7XP1A0","任务规划与分解",[119,120,121,122,35,123,37,124,39,41,42,125,126,104,127,128,129],"writing","writing plans","design","workflow","documentation","planning","user","ops","html","implementation","files",{"skillNo":131,"name":57,"nameZh":132,"description":133,"descriptionZh":134,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":135,"categories":136,"keywords":141,"publishedAt":44},"01M6CB7JME246KZQHP73Z2STDF","测试驱动开发","TDD: enforce RED-GREEN-REFACTOR, tests before code.","TDD：强制执行「红-绿-重构」（RED-GREEN-REFACTOR）循环，先写测试再写代码。","https:\u002F\u002Fgithub.com\u002Fadnichols\u002Fai-configs\u002Fblob\u002Fmain\u002F_hermes\u002Fdefault\u002Fskills\u002Fsoftware-development\u002Ftest-driven-development\u002FSKILL.md",[137,138],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":139,"categoryName":140,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BQJH394GT47X57A9Q8G7HX","测试与质量保障",[35,142,37,143,33,34,144,36,32,145,146,39,147,41,42,43,148],"test driven development","testing","tdd","code","refactor","quality","red-green-refactor",{"skillNo":150,"name":151,"nameZh":152,"description":153,"descriptionZh":154,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":155,"categories":156,"keywords":161,"publishedAt":44},"01M6CB7D57MK88HE5YPZHKH68Q","spike","技术预研验证","Throwaway experiments to validate an idea before build.","在正式构建前，通过一次性（可丢弃的）实验来验证某个想法。","https:\u002F\u002Fgithub.com\u002Fadnichols\u002Fai-configs\u002Fblob\u002Fmain\u002F_hermes\u002Fdefault\u002Fskills\u002Fsoftware-development\u002Fspike\u002FSKILL.md",[157,158],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":159,"categoryName":160,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8CA7BPYYPVSH8VYED4N4P5Y","技术预研与概念验证",[151,33,34,162,100,163,164,36,165,124,39,41,42,166,167],"prototype","experiments","validate","feasibility","experiment","sketch",{"skillNo":169,"name":170,"nameZh":171,"description":172,"descriptionZh":173,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":174,"categories":175,"keywords":180,"publishedAt":44},"01M6CB7APAQ37YE5YE1MAAFT42","simplify-code","代码变更并行清理精简","Parallel 3-agent cleanup of recent code changes.","并行使用 3 个智能体（agent）对近期代码变更进行清理精简。","https:\u002F\u002Fgithub.com\u002Fadnichols\u002Fai-configs\u002Fblob\u002Fmain\u002F_hermes\u002Fdefault\u002Fskills\u002Fsoftware-development\u002Fsimplify-code\u002FSKILL.md",[176,177],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":178,"categoryName":179,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BT7QVANT4709358VEJK53E","代码实现",[145,181,182,33,183,34,35,36,37,184,185,186,146,39,187,188,41,42],"simplify","simplify code","review","cleanup","delegation","code-review","subagent","parallel",{"skillNo":190,"name":191,"nameZh":192,"description":193,"descriptionZh":194,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":195,"categories":196,"keywords":201,"publishedAt":44},"01M6CB71SF58GH5WATE5B1VQ0R","requesting-code-review","提交前代码审查","Pre-commit review: security scan, quality gates, auto-fix.","提交前审查：安全扫描、质量门禁、自动修复。","https:\u002F\u002Fgithub.com\u002Fadnichols\u002Fai-configs\u002Fblob\u002Fmain\u002F_hermes\u002Fdefault\u002Fskills\u002Fsoftware-development\u002Frequesting-code-review\u002FSKILL.md",[197,198],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":199,"categoryName":200,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BR5V701HCN066VEP7H4812","代码仓库协作管理",[202,183,145,203,204,34,35,205,36,206,37,186,207,208,209,39,147,210,211,43],"code review","requesting code review","github","commit","quality gates","verification","security scan","pre-commit","fix","auto"]