skills/code-problem-analyzer/SKILL.md
深度代码问题分析与根因定位。用于分析代码行为异常、执行流程问题、配置错误等技术问题。当用户需要:1) 分析代码执行流程找到问题根因,2) 理解复杂代码逻辑和调用链,3) 定位异常行为的原因,4) 排查配置或状态问题。使用触发词:问题定位、分析问题、问题分析、代码分析、根因分析。
npx skillsauth add openharmonyinsight/openharmony-skills code-problem-analyzerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
使用此 skill 时,用户必须提供以下信息:
问题背景
问题相关信息
根据问题类型,使用以下策略探索代码:
执行流程问题:
grep 搜索关键函数、参数、标志位read 阅读关键文件,理解调用链状态管理问题:
isDebugApp、isStartWithDebug)配置问题:
GetBoolParam、GetApplicationInfo)在分析过程中,构建清晰的执行流程:
入口点 → 函数A → 函数B → 关键决策点 → 结果
对于每个关键点,记录:
根据流程分析,列出所有可能导致问题的原因:
根据以下标准排序可能的原因:
如果存在以下情况,使用 question 工具暂停并询问用户:
询问示例:
question:
questions:
- question: "我发现了两个可能的原因:[原因1] 和 [原因2]。为了进一步确认,请提供:"
header: "需要更多信息"
options:
- label: "检查配置文件"
description: "查看应用配置文件中的 debug 字段值"
- label: "查看完整日志"
description: "提供应用启动的完整日志"
- label: "检查等待调试列表"
description: "运行 aa appdebug get 命令查看等待调试状态"
## 问题分析结果
### 所有可能的流程
1. **流程1**: [流程描述]
- 文件:file.cpp:行号 - [关键代码片段]
- 文件:file.cpp:行号 - [关键代码片段]
- ...
2. **流程2**: [流程描述]
- 文件:file.cpp:行号 - [关键代码片段]
- ...
### 最有可能的根因
**根因**: [明确的根因描述]
**原因解释**:
- [解释1]
- [解释2]
- [关键代码位置]: file.cpp:行号
**建议的解决方案**:
1. [解决方案1]
2. [解决方案2]
### 需要进一步确认
[如果需要,说明需要用户做什么]
## 问题分析结果
### 最有可能的根因
**根因**: [明确的根因描述]
**原因**: [简短解释]
**关键代码位置**: file.cpp:行号
**解决方案**: [具体操作步骤]
如需更详细的分析方法论,请参阅:
testing
--- name: ohos-req-value-decision description: Use after review meeting to record decision and route to next step. Triggers: 评审决策纪要, 评审结论回流, value decision, 评审接纳, 评审不接纳, 评审退回, 下次重新上会. Do NOT use for feature baseline (ohos-req-feature-baseline), review gate checks (ohos-req-review-gate), or IR generation (ohos-req-feature-to-ir). metadata: author: openharmony scope: common stage: requirements capability: value-decision version: 0.3.0 status: draft tags: - sdd - requirements
development
Use when converting an OpenHarmony requirement document, spec, or design proposal into an OpenHarmony review slide deck (需求评审 / 需求变更评审 / 设计评审 PPTX) — produces the fixed OpenHarmony-branded review-deck structure (OH logo on every page) with architecture/flow diagrams and field tables. Triggers on "需求评审PPT", "需求变更评审", "把需求文档转成评审PPT", "spec转评审PPT", "requirement/spec to review deck". NOT for arbitrary or generic slide decks unrelated to OpenHarmony requirement/design review.
testing
Use when performing the Phase 0 Step 0.5 Review Ready Gate on a 04-feature.md, especially when the user says "evaluate gate", "review readiness", "feature ready?", "should we generate IR", or when the ohos-req-intake-orchestration main session needs a structured Ready / Conditional Ready / Not Ready judgment instead of doing the check inline. Reads 01-04, runs seven fixed checks plus a conditional-items check, and returns a machine-readable JSON summary plus a human-readable table that the main session can route on. Do NOT use for feature baseline generation (ohos-req-feature-baseline), value decision recording (ohos-req-value-decision), or IR generation (ohos-req-feature-to-ir).
testing
--- name: ohos-req-requirement-intake description: Use when importing an OHOS requirement into Phase 0.1, especially for 01-requirement.md, requirement intake, background, user value, scenarios, scope, FR/NFR, affected modules, or priority. Triggers: 需求导入, 01-requirement, 需求基线, RR单号. Do NOT use for feasibility analysis (ohos-req-feasibility-analysis), architecture decision (ohos-req-arch-decision), or feature baseline (ohos-req-feature-baseline). metadata: author: openharmony scope: common