[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6GXR7PCQYA4CFRW3QWH73ZJ":3,"skill-same:01M6GXR7PCQYA4CFRW3QWH73ZJ":92},{"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":28,"publishedAt":49,"linkOnly":50,"markdownContent":51,"markdownBody":52,"frontMatter":53,"refName":60,"commitSha":61,"skillDirectory":62,"forksCount":63,"repositoryHtmlUrl":64,"repositoryHomepageUrl":65,"ownerHtmlUrl":66,"ownerBlogUrl":65,"ownerDescription":67,"updatedAt":68,"install":69,"resources":81},"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",929,"MIT","https:\u002F\u002Fgithub.com\u002FSethGammon\u002FCitadel\u002Fblob\u002Fmain\u002Fskills\u002Fsystematic-debugging\u002FSKILL.md",[18,23],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",{"categoryNo":24,"categoryName":25,"taxonomyType":26,"taxonomyTypeDesc":27},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48],"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":50,"last-updated":54,"user-invocable":55,"trigger_keywords":56},1782259200000,true,[41,57,48,58,59],"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-06 02:04:44",{"source":8,"skillName":5,"commands":70,"prompt":80,"zipAvailable":55},[71,74,77],{"tool":72,"command":73},"npx","npx skills add SethGammon\u002FCitadel --skill systematic-debugging",{"tool":75,"command":76},"bunx","bunx skills add SethGammon\u002FCitadel --skill systematic-debugging",{"tool":78,"command":79},"pnpm","pnpm dlx skills add SethGammon\u002FCitadel --skill systematic-debugging","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FSethGammon\u002FCitadel\u002Fblob\u002Fmain\u002Fskills\u002Fsystematic-debugging\u002FSKILL.md",[82,88],{"path":83,"resourceType":84,"resourceTypeDesc":85,"sizeBytes":86,"sourceHtmlUrl":87},"__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":89,"resourceType":84,"resourceTypeDesc":85,"sizeBytes":90,"sourceHtmlUrl":91},"__benchmarks__\u002Fwith-error.md",907,"https:\u002F\u002Fgithub.com\u002FSethGammon\u002FCitadel\u002Fblob\u002Fmain\u002Fskills\u002Fsystematic-debugging\u002F__benchmarks__\u002Fwith-error.md",[93,118,145,168,193,212],{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":49},"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",[],[95,100,101,102,103,104,105,106,107,108,109,110,111,35,112,113,114,115,116,117],"repos","snowflake","multi-repo","work","context","campaign","coordinate","but","across","campaigns","shared","as","scope","add","unit","coordinator","fleet","claims",{"skillNo":119,"name":120,"nameZh":6,"description":121,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":122,"categories":123,"keywords":127,"publishedAt":49},"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",[124],{"categoryNo":125,"categoryName":126,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000021","资料检索与研究",[120,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,111,35,143,144],"vector","embeddings","librarian","markdown","knowledge","karpathy","knowledge management","karpathy wiki","up","files","maintain","self","knowledge base","project","db","sources","native",{"skillNo":146,"name":147,"nameZh":6,"description":148,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":149,"categories":150,"keywords":151,"publishedAt":49},"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",[],[147,152,153,154,155,156,157,158,159,160,161,37,137,162,163,164,165,166,35,167],"directory","commit","tasks","git","batch","actions","start","sentinel","diff","auto","do","scan","human","judgment","reactions","processing",{"skillNo":169,"name":43,"nameZh":6,"description":170,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":171,"categories":172,"keywords":176,"publishedAt":49},"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",[173],{"categoryNo":174,"categoryName":175,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000008","测试与质量",[43,177,178,179,180,181,182,183,184,185,186,187,188,139,189,35,190,191,192,33],"citadel","telemetry","harness","pipeline","Bash","tool","read","write","edit","session","hooks","reports","live","hook","errors","calls",{"skillNo":194,"name":195,"nameZh":6,"description":196,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":197,"categories":198,"keywords":199,"publishedAt":49},"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",[],[195,200,177,179,201,202,203,204,205,136,188,206,207,208,209,210,111,35,211,33],"uninstall","adoption","plan","archive","remove","only","Legacy","surfaces","clean","imported","active","material",{"skillNo":213,"name":214,"nameZh":6,"description":215,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":216,"categories":217,"keywords":222,"publishedAt":49},"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",[218,221],{"categoryNo":219,"categoryName":220,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000007","代码审查",{"categoryNo":24,"categoryName":25,"taxonomyType":26,"taxonomyTypeDesc":27},[214,223,224,225,226,46,227,228,229,230,231,232,233,234,162,35,235,236,237,33],"code review","review","review pr","pr","github issues","issues","open","use","unrelated","issue","general","references","line","investigator","reviews"]