[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-9f4cb0ea-c6c5-40a2-9d0c-13b20ab3ebf4":3,"$fzwEiRVe73ACCIL49rHMi6rLOVs7DJlW3ojWrIykqU58":43},{"id":4,"title":5,"description":6,"categoryId":7,"moduleId":8,"tags":9,"prompt":10,"icon":11,"source":12,"sourceUrl":13,"authorId":14,"authorName":15,"isPublic":16,"stars":17,"runs":18,"createdAt":19,"updatedAt":19,"module":20,"category":27,"packages":34},"9f4cb0ea-c6c5-40a2-9d0c-13b20ab3ebf4","phase-gated-debugging","用于调试任何错误。强制执行5阶段协议，代码编辑在确认根本原因之前被阻止。防止过早的修复尝试。","cat_coding_review","mod_coding","sickn33,coding","---\nname: phase-gated-debugging\ndescription: \"Use when debugging any bug. Enforces a 5-phase protocol where code edits are blocked until root cause is confirmed. Prevents premature fix attempts.\"\nrisk: safe\nsource: community\ndate_added: \"2026-03-28\"\n---\n\n# Phase-Gated Debugging\n\n## Overview\n\nAI coding agents see an error and immediately edit code. They guess at fixes, get it wrong, and spiral. This skill enforces a strict 5-phase protocol where you CANNOT edit source code until the root cause is identified and confirmed.\n\nBased on [claude-debug](https:\u002F\u002Fgithub.com\u002Fkrabat-l\u002Fclaude-debug) (full plugin with PreToolUse hook enforcement).\n\n## When to Use\nUse this skill when:\n\n- a bug keeps getting \"fixed\" without resolving the underlying issue\n- you need to slow an agent down and force disciplined debugging before code edits\n- the failure is intermittent, a regression, performance-related, or otherwise hard to isolate\n- you want an explicit user confirmation checkpoint before any fix is applied\n\n## The Protocol\n\n### Phase 1: REPRODUCE\nRun the failing command\u002Ftest. Capture the exact error. Run 2-3 times for consistency.\n- Do NOT read source code\n- Do NOT hypothesize\n- Do NOT edit any files\n\n### Phase 2: ISOLATE\nRead code. Add diagnostic logging marked `\u002F\u002F DEBUG`. Re-run with diagnostics. Binary search to narrow down.\n- Only `\u002F\u002F DEBUG` marked logging is allowed\n- Do NOT fix the bug even if you see it\n\n### Phase 3: ROOT CAUSE\nAnalyze WHY at the isolated location. Use \"5 Whys\" technique. Remove debug logging.\n\nState: \"This is my root cause analysis: [explanation]. Do you agree, or should I investigate further?\"\n\n**WAIT for user confirmation. Do NOT proceed without it.**\n\n### Phase 4: FIX\nRemove all `\u002F\u002F DEBUG` lines. Apply minimal change addressing confirmed root cause.\n- Only edit files related to root cause\n- Do NOT refactor unrelated code\n\n### Phase 5: VERIFY\nRun original failing test — must pass. Run related tests. For intermittent bugs, run 5+ times.\nIf verification fails: root cause was wrong, go back to Phase 2.\n\n## Bug-Type Strategies\n\n| Type | Technique |\n|------|-----------|\n| Crash\u002FPanic | Stack trace backward — trace the bad value to its source |\n| Wrong Output | Binary search — log midpoint, halve search space each iteration |\n| Intermittent | Compare passing vs failing run logs — find ordering divergence |\n| Regression | `git bisect` — find the offending commit |\n| Performance | Timing at stage boundaries — find the bottleneck |\n\n## Key Rules\n\n1. NEVER edit source code in phases 1-3 (except `\u002F\u002F DEBUG` in phase 2)\n2. NEVER proceed past phase 3 without user confirmation\n3. ALWAYS reproduce before investigating\n4. ALWAYS verify after fixing\n\n## Limitations\n- Use this skill only when the task clearly matches the scope described above.\n- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.\n- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.\n","","imported","https:\u002F\u002Fgithub.com\u002Fsickn33\u002Fantigravity-awesome-skills","user_system_seed","SkillOPIC",true,126,776,"2026-05-16 13:33:50",{"id":8,"name":21,"slug":22,"icon":23,"description":24,"sort":25,"createdAt":26},"编程开发","coding","mdi-code-braces","代码生成、调试、审查，提升开发效率",2,"2026-05-16 12:53:40",{"id":7,"name":28,"slug":29,"icon":30,"description":31,"moduleId":8,"sort":32,"skillCount":33,"createdAt":26},"代码审查","review","mdi-magnify-scan","代码质量分析、安全审查",4,145,[35],{"id":36,"skillId":4,"version":37,"fileName":38,"fileSize":39,"filePath":40,"fileHash":41,"manifest":42,"createdAt":19},"dccd9205-69fe-4c53-86a1-f9af160f6fd5","1.0.0","phase-gated-debugging.zip",1660,"uploads\u002Fskills\u002F9f4cb0ea-c6c5-40a2-9d0c-13b20ab3ebf4\u002Fphase-gated-debugging.zip","ec7dcc89aa50004839759f4df8a12ac2fd8f60a24d570c655479d53c99493e1f","[{\"path\":\"SKILL.md\",\"isDirectory\":false,\"size\":3021}]",{"code":44,"message":45,"data":46},200,"success",{"items":47,"stats":48,"page":51},[],{"averageRating":49,"totalRatings":49,"ratingCounts":50},0,[49,49,49,49,49],{"limit":52,"offset":49,"hasMore":53,"nextOffset":52,"ratedOnly":16},15,false]