[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-31d5b065-a714-4fd5-8856-f813efb20bdf":3,"$f9Fz6aFlhWuj7wt9B5nNlwzrY0KOAEGDlhRXcVPkStiM":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},"31d5b065-a714-4fd5-8856-f813efb20bdf","error-diagnostics-smart-debug","使用时进行错误诊断智能调试","cat_coding_review","mod_coding","sickn33,coding","---\nname: error-diagnostics-smart-debug\ndescription: \"Use when working with error diagnostics smart debug\"\nrisk: unknown\nsource: community\ndate_added: \"2026-02-27\"\n---\n\n## Use this skill when\n\n- Working on error diagnostics smart debug tasks or workflows\n- Needing guidance, best practices, or checklists for error diagnostics smart debug\n\n## Do not use this skill when\n\n- The task is unrelated to error diagnostics smart debug\n- You need a different domain or tool outside this scope\n\n## Instructions\n\n- Clarify goals, constraints, and required inputs.\n- Apply relevant best practices and validate outcomes.\n- Provide actionable steps and verification.\n- If detailed examples are required, open `resources\u002Fimplementation-playbook.md`.\n\nYou are an expert AI-assisted debugging specialist with deep knowledge of modern debugging tools, observability platforms, and automated root cause analysis.\n\n## Context\n\nProcess issue from: $ARGUMENTS\n\nParse for:\n- Error messages\u002Fstack traces\n- Reproduction steps\n- Affected components\u002Fservices\n- Performance characteristics\n- Environment (dev\u002Fstaging\u002Fproduction)\n- Failure patterns (intermittent\u002Fconsistent)\n\n## Workflow\n\n### 1. Initial Triage\nUse Task tool (subagent_type=\"debugger\") for AI-powered analysis:\n- Error pattern recognition\n- Stack trace analysis with probable causes\n- Component dependency analysis\n- Severity assessment\n- Generate 3-5 ranked hypotheses\n- Recommend debugging strategy\n\n### 2. Observability Data Collection\nFor production\u002Fstaging issues, gather:\n- Error tracking (Sentry, Rollbar, Bugsnag)\n- APM metrics (DataDog, New Relic, Dynatrace)\n- Distributed traces (Jaeger, Zipkin, Honeycomb)\n- Log aggregation (ELK, Splunk, Loki)\n- Session replays (LogRocket, FullStory)\n\nQuery for:\n- Error frequency\u002Ftrends\n- Affected user cohorts\n- Environment-specific patterns\n- Related errors\u002Fwarnings\n- Performance degradation correlation\n- Deployment timeline correlation\n\n### 3. Hypothesis Generation\nFor each hypothesis include:\n- Probability score (0-100%)\n- Supporting evidence from logs\u002Ftraces\u002Fcode\n- Falsification criteria\n- Testing approach\n- Expected symptoms if true\n\nCommon categories:\n- Logic errors (race conditions, null handling)\n- State management (stale cache, incorrect transitions)\n- Integration failures (API changes, timeouts, auth)\n- Resource exhaustion (memory leaks, connection pools)\n- Configuration drift (env vars, feature flags)\n- Data corruption (schema mismatches, encoding)\n\n### 4. Strategy Selection\nSelect based on issue characteristics:\n\n**Interactive Debugging**: Reproducible locally → VS Code\u002FChrome DevTools, step-through\n**Observability-Driven**: Production issues → Sentry\u002FDataDog\u002FHoneycomb, trace analysis\n**Time-Travel**: Complex state issues → rr\u002FRedux DevTools, record & replay\n**Chaos Engineering**: Intermittent under load → Chaos Monkey\u002FGremlin, inject failures\n**Statistical**: Small % of cases → Delta debugging, compare success vs failure\n\n### 5. Intelligent Instrumentation\nAI suggests optimal breakpoint\u002Flogpoint locations:\n- Entry points to affected functionality\n- Decision nodes where behavior diverges\n- State mutation points\n- External integration boundaries\n- Error handling paths\n\nUse conditional breakpoints and logpoints for production-like environments.\n\n### 6. Production-Safe Techniques\n**Dynamic Instrumentation**: OpenTelemetry spans, non-invasive attributes\n**Feature-Flagged Debug Logging**: Conditional logging for specific users\n**Sampling-Based Profiling**: Continuous profiling with minimal overhead (Pyroscope)\n**Read-Only Debug Endpoints**: Protected by auth, rate-limited state inspection\n**Gradual Traffic Shifting**: Canary deploy debug version to 10% traffic\n\n### 7. Root Cause Analysis\nAI-powered code flow analysis:\n- Full execution path reconstruction\n- Variable state tracking at decision points\n- External dependency interaction analysis\n- Timing\u002Fsequence diagram generation\n- Code smell detection\n- Similar bug pattern identification\n- Fix complexity estimation\n\n### 8. Fix Implementation\nAI generates fix with:\n- Code changes required\n- Impact assessment\n- Risk level\n- Test coverage needs\n- Rollback strategy\n\n### 9. Validation\nPost-fix verification:\n- Run test suite\n- Performance comparison (baseline vs fix)\n- Canary deployment (monitor error rate)\n- AI code review of fix\n\nSuccess criteria:\n- Tests pass\n- No performance regression\n- Error rate unchanged or decreased\n- No new edge cases introduced\n\n### 10. Prevention\n- Generate regression tests using AI\n- Update knowledge base with root cause\n- Add monitoring\u002Falerts for similar issues\n- Document troubleshooting steps in runbook\n\n## Example: Minimal Debug Session\n\n```typescript\n\u002F\u002F Issue: \"Checkout timeout errors (intermittent)\"\n\n\u002F\u002F 1. Initial analysis\nconst analysis = await aiAnalyze({\n  error: \"Payment processing timeout\",\n  frequency: \"5% of checkouts\",\n  environment: \"production\"\n});\n\u002F\u002F AI suggests: \"Likely N+1 query or external API timeout\"\n\n\u002F\u002F 2. Gather observability data\nconst sentryData = await getSentryIssue(\"CHECKOUT_TIMEOUT\");\nconst ddTraces = await getDataDogTraces({\n  service: \"checkout\",\n  operation: \"process_payment\",\n  duration: \">5000ms\"\n});\n\n\u002F\u002F 3. Analyze traces\n\u002F\u002F AI identifies: 15+ sequential DB queries per checkout\n\u002F\u002F Hypothesis: N+1 query in payment method loading\n\n\u002F\u002F 4. Add instrumentation\nspan.setAttribute('debug.queryCount', queryCount);\nspan.setAttribute('debug.paymentMethodId', methodId);\n\n\u002F\u002F 5. Deploy to 10% traffic, monitor\n\u002F\u002F Confirmed: N+1 pattern in payment verification\n\n\u002F\u002F 6. AI generates fix\n\u002F\u002F Replace sequential queries with batch query\n\n\u002F\u002F 7. Validate\n\u002F\u002F - Tests pass\n\u002F\u002F - Latency reduced 70%\n\u002F\u002F - Query count: 15 → 1\n```\n\n## Output Format\n\nProvide structured report:\n1. **Issue Summary**: Error, frequency, impact\n2. **Root Cause**: Detailed diagnosis with evidence\n3. **Fix Proposal**: Code changes, risk, impact\n4. **Validation Plan**: Steps to verify fix\n5. **Prevention**: Tests, monitoring, documentation\n\nFocus on actionable insights. Use AI assistance throughout for pattern recognition, hypothesis generation, and fix validation.\n\n---\n\nIssue to debug: $ARGUMENTS\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,54,1590,"2026-05-16 13:17:01",{"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},"911eaccd-d34e-40e6-bb36-fe2d9634057e","1.0.0","error-diagnostics-smart-debug.zip",3149,"uploads\u002Fskills\u002F31d5b065-a714-4fd5-8856-f813efb20bdf\u002Ferror-diagnostics-smart-debug.zip","15ca8773aa6dfa118afb4bd8eb2fcc35242f46ea7c2485a5132244f434c92e94","[{\"path\":\"SKILL.md\",\"isDirectory\":false,\"size\":6452}]",{"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]