[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6GXR7PCQYA4CFRW3QWH73ZJ":3,"skill-same:01M6GXR7PCQYA4CFRW3QWH73ZJ":82},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":50,"commitSha":51,"skillDirectory":52,"forksCount":53,"repositoryHtmlUrl":54,"repositoryHomepageUrl":55,"ownerHtmlUrl":56,"ownerBlogUrl":55,"ownerDescription":57,"updatedAt":58,"install":59,"resources":71},"01M6GXR7PCQYA4CFRW3QWH73ZJ","systematic-debugging",null,"4-phase root cause analysis: observe, hypothesize, verify, fix. Enforces investigation before any code changes. Emergency stop after 2 failed fixes. Prevents shotgun debugging and fix cascades.","SethGammon\u002FCitadel","SethGammon","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F5523585?v=4","01M6GXJ90FD2CE9QF5GQERWN06","Seth Gammon","01M6GXJ94VXYGK5KAW14EYE901",931,"MIT","https:\u002F\u002Fgithub.com\u002FSethGammon\u002FCitadel\u002Fblob\u002Fmain\u002Fskills\u002Fsystematic-debugging\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"systematic debugging","debugging","systematic","why","true","root","false","wed","stop","observe","bug","fix","debug","investigate","verify","investigation","analysis","code","root cause analysis","diagnose","2026-11-10 10:12:30",false,"---\nname: systematic-debugging\nlicense: MIT\ndescription: >-\n  4-phase root cause analysis: observe, hypothesize, verify, fix. Enforces\n  investigation before any code changes. Emergency stop after 2 failed fixes.\n  Prevents shotgun debugging and fix cascades.\nuser-invocable: true\nauto-trigger: false\ntrigger_keywords:\n  - debug\n  - root cause\n  - diagnose\n  - why is\n  - investigate bug\nlast-updated: 2026-06-24\n---\n\n# \u002Fsystematic-debugging — Root Cause Before Fix\n\n## Orientation\n\n**Use when:** root cause is unknown and premature fixes keep failing -- enforces observe -> hypothesize -> verify before touching code.\n**Don't use when:** root cause is already known (use \u002Fmarshal to implement the fix); the bug is shallow and the stack trace is enough (use \u002Fdo).\n\n## Protocol\n\n### Phase 1: OBSERVATION & REPRODUCTION\n\n1. Read the error message, stack trace, or bug description\n2. Reproduce the issue:\n   - If it's a type error: run typecheck and read the full error\n   - If it's a runtime error: identify the triggering conditions\n   - If it's a behavioral bug: document expected vs actual behavior\n3. Isolate the failing component\u002Ffunction:\n   - What file? What function? What line?\n   - What are the inputs when it fails?\n   - Does it fail consistently or intermittently?\n\n**Output**: A clear problem statement:\n\"{Component} does {X} when it should do {Y}, triggered by {condition}\"\n\n### Phase 2: HYPOTHESIS & VERIFICATION\n\n1. Formulate up to 3 hypotheses for WHY the bug exists:\n   - H1: {most likely cause} — because {evidence}\n   - H2: {second candidate} — because {evidence}\n   - H3: {third candidate} — because {evidence}\n\n2. For each hypothesis, define a verification step:\n   - Add a console.log \u002F diagnostic read \u002F breakpoint\n   - Check a specific value at a specific point\n   - DO NOT change any logic yet — only observe\n\n3. Run the verification:\n   - Which hypothesis was confirmed?\n   - Which were eliminated?\n   - If none confirmed: formulate new hypotheses with the new information\n\n**CRITICAL**: Do not skip this phase. Do not \"just try\" a fix. Verify first.\n\n### Phase 3: ROOT CAUSE ANALYSIS\n\nOnce a hypothesis is confirmed:\n\n1. Explain WHY the bug happens, not just WHERE:\n   - Trace the data flow backward from the symptom to the source\n   - Identify the specific incorrect assumption or logic error\n   - Document the causal chain:\n     \"A calls B with X, B assumes X > 0, but A passes -1 when {condition}\"\n\n2. Check for related occurrences:\n   - Is this pattern used elsewhere? Could the same bug exist in similar code?\n   - Is there a systemic issue (e.g., missing validation at a boundary)?\n\n**Output**: Root cause statement:\n\"The bug occurs because {cause}. This happens when {trigger}.\"\n\n### Phase 4: IMPLEMENTATION\n\n1. Write a failing test case that reproduces the bug (if test framework exists)\n2. Apply the minimal fix — change only what's necessary to resolve the root cause\n3. Verify the fix:\n   - Test case now passes\n   - Typecheck passes\n   - No regressions in related functionality\n4. If the root cause analysis revealed related occurrences, fix those too\n\n## Emergency Stop Rule\n\n**If a fix fails TWICE: STOP.**\n\nDo not try a third guess. The root cause analysis was wrong. Either:\n- Go back to Phase 2 with new hypotheses\n- Ask the user for more context about the system's intended behavior\n- Check if there's a higher-level architectural issue\n\nThree failed fixes in a row means you're guessing, not debugging.\n\n## What This Skill Prevents\n\n- **Shotgun debugging** — changing random things until the error goes away\n- **Symptom fixing** — patching the output without understanding the cause\n- **Fix cascades** — one bad fix creating three new bugs\n- **Silent regressions** — fixing one path while breaking another\n\n## Contextual Gates\n\n**Disclosure:** \"Debugging [symptom]. Phases 1-3 read-only; will confirm before applying fixes in Phase 4.\"\n**Reversibility:** amber — Phase 4 applies targeted fixes to source files; undo with `git checkout` on modified files. Phases 1-3 are read-only.\n**Trust gates:**\n- Any: investigation (Phases 1-3).\n- Familiar (5+ sessions): applying fixes (Phase 4).\n\n## Quality Gates\n\n- A clear problem statement exists before any hypothesis is formed\n- At least one hypothesis was verified (not assumed) before the fix was written\n- The fix addresses the root cause, not just the symptom\n- Typecheck passes after the fix with no new errors\n- If related occurrences were found, they were fixed or documented\n\n## Fringe Cases\n\n**Bug is intermittent**: Document the triggering conditions as precisely as possible. Reproduce it at least once before forming hypotheses. If it can't be reproduced, stop at Phase 1 and ask for more context.\n\n**Two fix attempts have already failed**: Invoke the Emergency Stop Rule. Return to Phase 2 with new hypotheses. Do not try a third guess without re-reading the relevant code.\n\n**No test framework exists**: Skip the \"write a failing test\" step in Phase 4. Verify the fix manually and document how to reproduce the original bug for future reference.\n\n**Error is in a dependency or generated file**: Document the root cause but do not modify the dependency. Propose a workaround in the consuming code instead.\n\n## Exit Protocol\n\n```\n---HANDOFF---\n- Bug: {problem statement}\n- Root cause: {one-line cause}\n- Fix: {what was changed}\n- Verified: {typecheck + tests passing}\n- Related: {any similar patterns found and fixed}\n---\n```\n","# \u002Fsystematic-debugging — Root Cause Before Fix\n\n## Orientation\n\n**Use when:** root cause is unknown and premature fixes keep failing -- enforces observe -> hypothesize -> verify before touching code.\n**Don't use when:** root cause is already known (use \u002Fmarshal to implement the fix); the bug is shallow and the stack trace is enough (use \u002Fdo).\n\n## Protocol\n\n### Phase 1: OBSERVATION & REPRODUCTION\n\n1. Read the error message, stack trace, or bug description\n2. Reproduce the issue:\n   - If it's a type error: run typecheck and read the full error\n   - If it's a runtime error: identify the triggering conditions\n   - If it's a behavioral bug: document expected vs actual behavior\n3. Isolate the failing component\u002Ffunction:\n   - What file? What function? What line?\n   - What are the inputs when it fails?\n   - Does it fail consistently or intermittently?\n\n**Output**: A clear problem statement:\n\"{Component} does {X} when it should do {Y}, triggered by {condition}\"\n\n### Phase 2: HYPOTHESIS & VERIFICATION\n\n1. Formulate up to 3 hypotheses for WHY the bug exists:\n   - H1: {most likely cause} — because {evidence}\n   - H2: {second candidate} — because {evidence}\n   - H3: {third candidate} — because {evidence}\n\n2. For each hypothesis, define a verification step:\n   - Add a console.log \u002F diagnostic read \u002F breakpoint\n   - Check a specific value at a specific point\n   - DO NOT change any logic yet — only observe\n\n3. Run the verification:\n   - Which hypothesis was confirmed?\n   - Which were eliminated?\n   - If none confirmed: formulate new hypotheses with the new information\n\n**CRITICAL**: Do not skip this phase. Do not \"just try\" a fix. Verify first.\n\n### Phase 3: ROOT CAUSE ANALYSIS\n\nOnce a hypothesis is confirmed:\n\n1. Explain WHY the bug happens, not just WHERE:\n   - Trace the data flow backward from the symptom to the source\n   - Identify the specific incorrect assumption or logic error\n   - Document the causal chain:\n     \"A calls B with X, B assumes X > 0, but A passes -1 when {condition}\"\n\n2. Check for related occurrences:\n   - Is this pattern used elsewhere? Could the same bug exist in similar code?\n   - Is there a systemic issue (e.g., missing validation at a boundary)?\n\n**Output**: Root cause statement:\n\"The bug occurs because {cause}. This happens when {trigger}.\"\n\n### Phase 4: IMPLEMENTATION\n\n1. Write a failing test case that reproduces the bug (if test framework exists)\n2. Apply the minimal fix — change only what's necessary to resolve the root cause\n3. Verify the fix:\n   - Test case now passes\n   - Typecheck passes\n   - No regressions in related functionality\n4. If the root cause analysis revealed related occurrences, fix those too\n\n## Emergency Stop Rule\n\n**If a fix fails TWICE: STOP.**\n\nDo not try a third guess. The root cause analysis was wrong. Either:\n- Go back to Phase 2 with new hypotheses\n- Ask the user for more context about the system's intended behavior\n- Check if there's a higher-level architectural issue\n\nThree failed fixes in a row means you're guessing, not debugging.\n\n## What This Skill Prevents\n\n- **Shotgun debugging** — changing random things until the error goes away\n- **Symptom fixing** — patching the output without understanding the cause\n- **Fix cascades** — one bad fix creating three new bugs\n- **Silent regressions** — fixing one path while breaking another\n\n## Contextual Gates\n\n**Disclosure:** \"Debugging [symptom]. Phases 1-3 read-only; will confirm before applying fixes in Phase 4.\"\n**Reversibility:** amber — Phase 4 applies targeted fixes to source files; undo with `git checkout` on modified files. Phases 1-3 are read-only.\n**Trust gates:**\n- Any: investigation (Phases 1-3).\n- Familiar (5+ sessions): applying fixes (Phase 4).\n\n## Quality Gates\n\n- A clear problem statement exists before any hypothesis is formed\n- At least one hypothesis was verified (not assumed) before the fix was written\n- The fix addresses the root cause, not just the symptom\n- Typecheck passes after the fix with no new errors\n- If related occurrences were found, they were fixed or documented\n\n## Fringe Cases\n\n**Bug is intermittent**: Document the triggering conditions as precisely as possible. Reproduce it at least once before forming hypotheses. If it can't be reproduced, stop at Phase 1 and ask for more context.\n\n**Two fix attempts have already failed**: Invoke the Emergency Stop Rule. Return to Phase 2 with new hypotheses. Do not try a third guess without re-reading the relevant code.\n\n**No test framework exists**: Skip the \"write a failing test\" step in Phase 4. Verify the fix manually and document how to reproduce the original bug for future reference.\n\n**Error is in a dependency or generated file**: Document the root cause but do not modify the dependency. Propose a workaround in the consuming code instead.\n\n## Exit Protocol\n\n```\n---HANDOFF---\n- Bug: {problem statement}\n- Root cause: {one-line cause}\n- Fix: {what was changed}\n- Verified: {typecheck + tests passing}\n- Related: {any similar patterns found and fixed}\n---\n```\n",{"name":5,"license":15,"description":7,"auto-trigger":40,"last-updated":44,"user-invocable":45,"trigger_keywords":46},1782259200000,true,[31,47,38,48,49],"root cause","why is","investigate bug","main","e1a3d45697a0f323aaedcbea0ab6a0387b5fe722","skills\u002Fsystematic-debugging",84,"https:\u002F\u002Fgithub.com\u002FSethGammon\u002FCitadel","https:\u002F\u002Fsethgammon.github.io\u002FCitadel\u002F","https:\u002F\u002Fgithub.com\u002FSethGammon","Building Citadel, the repo-local operating layer for Claude Code and Codex. Persistent work, routing, verification, and coordinated agent fleets.","2026-11-13 02:05:13",{"source":8,"skillName":5,"commands":60,"prompt":70,"zipAvailable":45},[61,64,67],{"tool":62,"command":63},"npx","npx skills add SethGammon\u002FCitadel --skill systematic-debugging",{"tool":65,"command":66},"bunx","bunx skills add SethGammon\u002FCitadel --skill systematic-debugging",{"tool":68,"command":69},"pnpm","pnpm dlx skills add SethGammon\u002FCitadel --skill systematic-debugging","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FSethGammon\u002FCitadel\u002Fblob\u002Fmain\u002Fskills\u002Fsystematic-debugging\u002FSKILL.md",[72,78],{"path":73,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":76,"sourceHtmlUrl":77},"__benchmarks__\u002Fno-error-info.md","REFERENCE","参考文档",771,"https:\u002F\u002Fgithub.com\u002FSethGammon\u002FCitadel\u002Fblob\u002Fmain\u002Fskills\u002Fsystematic-debugging\u002F__benchmarks__\u002Fno-error-info.md",{"path":79,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":80,"sourceHtmlUrl":81},"__benchmarks__\u002Fwith-error.md",907,"https:\u002F\u002Fgithub.com\u002FSethGammon\u002FCitadel\u002Fblob\u002Fmain\u002Fskills\u002Fsystematic-debugging\u002F__benchmarks__\u002Fwith-error.md",[83,108,132,155,177,196],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":39},"01M6GXSBKE9A2HQWF8QRAZ4WJ5","workspace","Multi-repo campaign coordinator. Same lifecycle as fleet -- scope claims, discovery relay, wave-based execution -- but the unit of work is a repo, not a file. Coordinates campaigns across repositories with shared context.","https:\u002F\u002Fgithub.com\u002FSethGammon\u002FCitadel\u002Fblob\u002Fmain\u002Fskills\u002Fworkspace\u002FSKILL.md",[],[85,90,91,92,93,94,95,96,97,98,99,100,101,25,102,103,104,105,106,107],"repos","snowflake","multi-repo","work","context","campaign","coordinate","but","across","campaigns","shared","as","scope","add","unit","coordinator","fleet","claims",{"skillNo":109,"name":110,"nameZh":6,"description":111,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":112,"categories":113,"keywords":114,"publishedAt":39},"01M6GXS873AD1Y6RTM6GV47F3E","wiki","Markdown-first knowledge base where the LLM acts as librarian. Ingests raw sources, compiles and interlinks topic files, self-maintains an index. No vector DB or embeddings required -- uses LLM-native navigation over structured markdown up to ~400K words.","https:\u002F\u002Fgithub.com\u002FSethGammon\u002FCitadel\u002Fblob\u002Fmain\u002Fskills\u002Fwiki\u002FSKILL.md",[],[110,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,101,25,130,131],"vector","embeddings","librarian","markdown","knowledge","karpathy","knowledge management","karpathy wiki","up","files","maintain","self","knowledge base","project","db","sources","native",{"skillNo":133,"name":134,"nameZh":6,"description":135,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":136,"categories":137,"keywords":138,"publishedAt":39},"01M6GXS2840SJ61285SZ43EJC3","watch","File sentinel that monitors the working directory for changes and marker comments, then auto-triggers appropriate skills. Poll-based via git diff against the last scan commit. Writes intake items for batch processing and routes marker actions through \u002Fdo. Use for automatic reactions to file changes; do NOT use for one-off inspection or tasks needing human judgment per file.","https:\u002F\u002Fgithub.com\u002FSethGammon\u002FCitadel\u002Fblob\u002Fmain\u002Fskills\u002Fwatch\u002FSKILL.md",[],[134,139,140,141,142,143,144,145,146,147,148,27,124,149,150,151,152,153,25,154],"directory","commit","tasks","git","batch","actions","start","sentinel","diff","auto","do","scan","human","judgment","reactions","processing",{"skillNo":156,"name":33,"nameZh":6,"description":157,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":158,"categories":159,"keywords":160,"publishedAt":39},"01M6GXRXHYJ5RD9RZP81S2VFSW","Self-test the Citadel hook pipeline from within a live session. Exercises real tool calls (Write, Edit, Bash, Read) and checks that hooks fired, telemetry accumulated, and no errors occurred. Reports HOOK HEALTH: PASS or HOOK HEALTH: FAIL with a per-hook breakdown.","https:\u002F\u002Fgithub.com\u002FSethGammon\u002FCitadel\u002Fblob\u002Fmain\u002Fskills\u002Fverify\u002FSKILL.md",[],[33,161,162,163,164,165,166,167,168,169,170,171,172,126,173,25,174,175,176,23],"citadel","telemetry","harness","pipeline","Bash","tool","read","write","edit","session","hooks","reports","live","hook","errors","calls",{"skillNo":178,"name":179,"nameZh":6,"description":180,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":181,"categories":182,"keywords":183,"publishedAt":39},"01M6GXRS9MCJFMQZ917H2XH3AC","unharness","Safely leave Citadel using the active adoption receipt. Produces a no-write, reviewable plan, preserves a portable archive, removes only exact owned material, and reports modified or externally registered surfaces as retained or unknown. Legacy installs must be imported before exact leave is claimed.","https:\u002F\u002Fgithub.com\u002FSethGammon\u002FCitadel\u002Fblob\u002Fmain\u002Fskills\u002Funharness\u002FSKILL.md",[],[179,184,161,163,185,186,187,188,189,123,172,190,191,192,193,194,101,25,195,23],"uninstall","adoption","plan","archive","remove","only","Legacy","surfaces","clean","imported","active","material",{"skillNo":197,"name":198,"nameZh":6,"description":199,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":200,"categories":201,"keywords":202,"publishedAt":39},"01M6GXRMEJ2VHD43R9FNPD4910","triage","GitHub issue and PR investigator. Pulls open issues\u002FPRs, classifies them, searches the codebase for root cause or reviews contributed code, proposes fixes with file:line references, and optionally implements fixes. Use for investigating GitHub issues and reviewing PRs; do NOT use for general code review unrelated to GitHub issues.","https:\u002F\u002Fgithub.com\u002FSethGammon\u002FCitadel\u002Fblob\u002Fmain\u002Fskills\u002Ftriage\u002FSKILL.md",[],[198,203,204,205,206,36,207,208,209,210,211,212,213,214,149,25,215,216,217,23],"code review","review","review pr","pr","github issues","issues","open","use","unrelated","issue","general","references","line","investigator","reviews"]