{"skill":{"slug":"problem-solving-methodology","displayName":"Problem Solving","summary":"结构化问题诊断与解决方法论。 Use when: (1) 问题原因不明需要调查/\"分析一下这个问题\"/\"排查一下\", (2) 之前的修复尝试失败了, (3) 问题涉及多个组件交互/\"为什么会这样\"/\"调查一下原因\", (4) 修改有风险或副作用/\"诊断一下\", (5) 用户明确要求先分析再修复。 NOT for:...","description":"---\nname: problem-solving\nversion: 1.0.0\ndescription: >\n  结构化问题诊断与解决方法论。\n  Use when: (1) 问题原因不明需要调查/\"分析一下这个问题\"/\"排查一下\",\n  (2) 之前的修复尝试失败了,\n  (3) 问题涉及多个组件交互/\"为什么会这样\"/\"调查一下原因\",\n  (4) 修改有风险或副作用/\"诊断一下\",\n  (5) 用户明确要求先分析再修复。\n  NOT for: 明显的一行修复、错误信息清晰且有已知方案的问题、\n  用户说\"直接修\"的简单问题。\n---\n\n# Structured Problem Solving\n\n## When to Use This vs. Direct Fix\n\n**Direct fix (skip this skill)**:\n- Error message points to exact cause\n- One-line config/code fix\n- You've seen this exact problem before\n\n**Use this skill**:\n- You'd need to say \"可能是...\" to explain the cause\n- 2+ components involved\n- You already tried a fix that didn't work\n- Wrong fix could cause data loss, privacy leak, or downtime\n\n## The Process\n\n### Step 0: Question Dissolution (消解层)\n\nBefore solving, check if the problem itself is valid. Many problems dissolve when examined properly.\n\n**Run these 3 checks sequentially. If any check dissolves the problem, stop and tell the user — a dissolved problem is more valuable than a solved one.**\n\n#### 0.1 Language Trap Detection (语言陷阱)\n\nDoes the problem statement contain vague, undefined key terms?\n\nCommon trap words: \"优化\" \"合适\" \"更好\" \"正常\" \"应该\" \"稳定\"\n\n**Test**: Can you give a measurable or actionable definition for every key term? If not, the problem can't be solved because it hasn't been stated.\n\n→ If trapped: Ask the user to define the vague term. \"你说的'优化'具体指什么？响应时间从 X 降到 Y？还是内存占用？还是用户体验？\"\n\n#### 0.2 Hidden Assumption Check (假设检验)\n\nRewrite the problem as: \"This problem assumes X. Is X true?\"\n\nCommon false assumptions:\n- \"系统变慢了\" → assumes it was faster before (was it? measured when?)\n- \"用户不喜欢这个功能\" → assumes users have tried it (have they? data?)\n- \"我们需要加这个功能\" → assumes the current system can't do it (can it?)\n\n→ If assumption is false: Tell the user. \"你的问题假设了「X」，但这个前提可能不成立。如果 X 不成立，问题就消失了。\"\n\n#### 0.3 Question vs. Problem Classification\n\n- **Question**: Has a standard answer, can be resolved by looking it up or reading docs\n  - → Answer directly, don't enter the full diagnostic process\n- **Problem**: No standard answer, requires investigation + experimentation\n  - → Continue to Step 1\n\nIf the problem survives all 3 checks, proceed to full diagnosis.\n\n---\n\n### Step 1: Define the Problem\n\nTurn vague \"something's wrong\" into a precise statement.\n\n```\n问题：[一句话]\n现象：[具体发生了什么]\n预期：[应该是什么样]\n影响：[谁受影响，严重程度]\n可复现：[是/否，触发条件]\n```\n\n**Rules**:\n- Describe what you observe, not what you think caused it\n- \"webchat replies appear in DingTalk group\" = problem ✅\n- \"origin got polluted\" = hypothesis, not problem ❌\n\n### Step 2: Diagnose\n\n**Do not skip to fixing.** Trace the data flow end-to-end first.\n\n#### 2.1 Map the call chain\n```\nInput → Step A → Step B → Step C → Output\n          ↓          ↓          ↓\n        Check      Check      Check\n```\n\n#### 2.2 Verify each step\nRead actual values (logs, state files, source code). Do not guess.\n\n#### 2.3 Narrow down\nFind the first step where output diverges from expected. That's where the bug is.\n\n#### 2.4 Confirm root cause\n\nThree questions before you declare root cause:\n1. **Why?** — Explain the mechanism, not just the symptom\n2. **Sufficient?** — If I fix this, will the problem definitely disappear?\n3. **Unique?** — Is there another cause that could produce the same symptom?\n\nAll three must be answered. If not → keep diagnosing.\n\n**Diagnostic tools (prefer in order)**:\n1. Error messages / logs (fastest)\n2. State inspection (config files, DB, session store)\n3. Source code tracing (most reliable)\n4. Minimal reproduction experiment\n\n### Step 3: Design Solutions\n\nGenerate **at least 2** candidate solutions. Compare on:\n\n| Dimension | Question |\n|-----------|----------|\n| Effectiveness | Fixes root cause or just symptom? |\n| Risk | Could it break something else? |\n| Complexity | How many components touched? |\n| Reversibility | Can we roll back if wrong? |\n| Durability | Survives restarts / updates? |\n| Side effects | Impact on other features? |\n\nPresent as:\n```\n方案 A：[one line]\n  ✅ [pros]  ⚠️ [risks]\n\n方案 B：[one line]\n  ✅ [pros]  ⚠️ [risks]\n\n→ 推荐 A，因为 [reason]\n```\n\nAlways include the \"do nothing / workaround\" option if viable.\n\n### Step 4: Execute\n\nPre-flight checklist:\n- [ ] Root cause confirmed (not guessed)\n- [ ] Solution evaluated (not first idea)\n- [ ] User confirmed (for risky changes)\n- [ ] Rollback plan ready\n\n**Rules**:\n- Change one variable at a time\n- Record what was changed and what it was before\n- Minimize scope — don't \"fix other things while you're at it\"\n\n### Step 5: Verify\n\nThree levels of verification:\n\n1. **Direct**: Reproduce original trigger → problem gone?\n2. **Regression**: Related features still work?\n3. **Durability**: Survives restart / next trigger?\n\nShow evidence, don't say \"应该好了\".\n\n### Step 6: Review\n\n```\n## 复盘：[问题名]\n耗时：X 分钟（有效 Y / 弯路 Z）\n根因：[一句话]\n修复：[一句话]\n弯路：[走了什么弯路]\n教训：[提炼的规则]\n```\n\nWrite lessons to `.learnings/` if reusable.\n\n## 诊断超时与死胡同处理\n\n| 信号 | 动作 |\n|------|------|\n| 同一假设连续 3 次验证无结论 | 停止，换假设或换诊断维度 |\n| 累计诊断 >15 分钟无进展 | 暂停，向用户汇报已排除项 + 当前卡点，询问是否有额外线索 |\n| 累计尝试 >5 个假设均被否定 | 考虑问题是否需要消解（回 Step 0）或需要更多上下文 |\n| 修复后问题复现 | 不叠加补丁，回退到修复前状态，重新走 Step 1 |\n\n## Anti-patterns\n\n| Pattern | What it looks like | Fix |\n|---------|-------------------|-----|\n| Guess-and-fix | See symptom → hypothesize → change immediately | Map call chain first |\n| One-end-only | Check only input or output | Trace full data flow |\n| Surface fix | Change the bad value without asking why it's bad | Ask \"why did it become this value?\" |\n| Multi-change | Change 3 things at once | One variable at a time |\n| Premature victory | \"Should be fixed now\" without checking | Show evidence |\n| No rollback | Forget to record original values | Backup before modify |\n\n## Communication During Problem-Solving\n\n- **Define**: Confirm understanding (\"你说的问题是 X 对吗？\")\n- **Diagnose**: Share progress, don't go silent (\"在查 Y 环节，发现了 Z\")\n- **Design**: Give choices, not just one option\n- **Execute**: Confirm before risky operations\n- **Verify**: Ask user to check on their end\n- **Throughout**: Say \"I'm not sure yet\" over false confidence\n\n---\n\n## 下一步建议（条件触发）\n\n问题解决后，根据结果判断是否推荐下一步。\n\n| 触发条件 | 推荐 |\n|---------|------|\n| 根因是代码 bug，修复需要多文件改动 | 「根因清楚了，修复交给 coding-agent spawn Claude Code 来做。」 |\n| 问题根因值得记录（同类问题可能再犯） | 「这个教训值得记下来，写到 .learnings/ 防止再犯。」 |\n| 问题在消解层被消解（问题本身不成立） | 「问题已经消解了。如果背后有更大的决策要做，可以拉出来单独讨论。」 |\n| 诊断过程发现系统架构层面的隐患 | 「这次修好了，但架构上还有隐患。要不要排个时间做一次 healthcheck？」 |\n","tags":{"latest":"1.0.3"},"stats":{"comments":0,"downloads":1063,"installsAllTime":40,"installsCurrent":5,"stars":0,"versions":8},"createdAt":1773652546313,"updatedAt":1778491943830},"latestVersion":{"version":"1.0.3","createdAt":1778048994164,"changelog":"Weekly sync","license":"MIT-0"},"metadata":null,"owner":{"handle":"lovensky1992-wk","userId":"s17dsprt4znvnqphy9hhy68va983nsqs","displayName":"lovensky1992-wk","image":"https://avatars.githubusercontent.com/u/264908128?v=4"},"moderation":null}