skills/oh-doc-knowledge-verifier/SKILL.md
文档知识正确性验证。检视 OpenHarmony API 文档中的技术描述是否与权威标准规范(W3C、CSS 等)、数学定义或行业事实一致。当发现知识性问题时,进一步对照业务代码实现,区分"文档描述错误"、"代码实现错误"或"三方均异常"。触发词:文档描述验证、文档知识正确性、描述是否准确、参数说明验证、文档纠错、文档与代码对照。
npx skillsauth add openharmonyinsight/openharmony-skills oh-doc-knowledge-verifierInstall 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.
验证 OpenHarmony API 文档中的知识性描述是否正确。这类问题主要与代码实现无关,而是文档本身对标准规范、数学定义、技术概念的描述存在错误。
核心工作流:知识验证(对照权威标准)→ 发现问题 → 代码实现二次验证(对照业务代码)→ 判定根因。
适用范围:
不适用:
对每条文档声明判断其知识来源类型,不同类型使用不同的验证源:
| 类型 | 特征 | 验证源 | |------|------|--------| | 标准规范型 | 行为由外部标准(W3C、CSS、IEEE 等)定义 | 标准规范原文 | | 数学事实型 | 由数学定义决定,不存在歧义 | 数学公式/定义 | | 竞品对标型 | 同类平台通用行为,多家实现一致 | Android/iOS/Chrome 等文档交叉验证 |
分类判断规则:
按声明类型查找验证源:
标准规范型:
https://www.w3.org/TR/SVG/https://www.w3.org/Style/CSS/https://developer.mozilla.org/(MDN 作为标准参考){属性名} W3C specification数学事实型:
{概念} mathematical definition竞品对标型:
https://developer.android.com/https://developer.apple.com/https://developer.mozilla.org/https://api.flutter.dev/对每条声明进行对比验证:
文档描述 → 权威验证源描述 → 是否一致
重点关注的高频错误模式:
触发条件: 当步骤 3 发现文档与权威标准不一致时,必须进一步对照业务代码实现,区分根因类型。
核心目的: 仅靠标准对比无法判断是"文档写错了"还是"代码实现错了"——必须看代码实际行为才能下结论。同一份文档可能有三种根因:
| 根因类型 | 文档 | 标准 | 代码 | 处置 | |---------|------|------|------|------| | A. 文档错误 | ✗ | ✓ | ✓ | 改文档 | | B. 代码错误 | ✓ | ✗ | ✗ | 改代码 | | C. 三方不一致 | ✗ | ✓ | ✗ | 改文档+改代码,并明确文档对齐代码还是标准 | | D. 平台有意扩展 | ✗ | ✓ | ✗(刻意) | 文档补充"扩展说明" |
验证流程:
frameworks/bridge/declarative_frontend/jsview/frameworks/core/components_ng/property/、frameworks/core/components/common/properties/frameworks/core/components_ng/render/、frameworks/core/components/common/painter/frameworks/core/components_ng/render/adapter/代码追踪必须给出:
js_view_abstract.cpp:2198)禁止的做法:
PlatformVersion::VERSION_TEN 等判断可能导致不同 API 版本默认值不同## 文档知识验证报告
### 验证目标
- 文档:{文件名}
- 章节:{章节名}
### 声明验证
| # | 文档描述 | 声明类型 | 验证源 | 验证源内容 | 判定 |
|---|---------|---------|-------|-----------|------|
| 1 | {原文} | {类型} | {来源} | {正确描述} | {一致/不一致} |
### 代码二次验证(仅不一致项)
| # | 文档描述 | 标准规定 | 代码实际 | 根因类型 |
|---|---------|---------|---------|---------|
| 1 | {原文} | {标准} | {代码值} | {A/B/C/D} |
**代码追踪证据:**
| 层级 | 文件:行号 | 关键逻辑 | 输出值 |
|------|----------|---------|-------|
| 入口层 | {path}:{line} | {代码片段} | — |
| 数据层 | {path}:{line} | {代码片段} | {值} |
| 处理层 | {path}:{line} | {代码片段} | {值} |
### 错误详情(如有)
**错误 #1:{根因类型}**
- 文档位置:{文件:行号}
- 文档描述:{原文}
- 标准描述:{标准内容}
- 代码实际:{代码行为}
- 验证依据:{标准链接 + 代码文件:行号}
### 修正建议
{根据根因类型给出针对性建议:
- A 类:改文档对齐标准
- B 类:建议提单改代码
- C 类:分别说明文档/代码的修正方向
- D 类:文档补充"OpenHarmony 相对标准的扩展说明"}
当需要快速判断常见错误类型时,读取 references/common-errors.md
| 错误模式 | 典型表现 | 检查方法 | |---------|---------|---------| | 参数作用互换 | 两个参数描述写反 | 对比标准定义中每个参数的数学含义 | | 方向描述错误 | x/y、水平/垂直、顺时针/逆时针搞反 | 查标准定义,数学公式无歧义 | | 顺序/索引错误 | 参数位置与标准不一致 | 对比标准函数签名的参数顺序 | | 类型与值域错误 | 取值范围或数据类型描述错误 | 查标准中的类型定义和约束条件 |
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