skills/oh-docs-check-zh-cn/SKILL.md
Check whether OpenHarmony API documentation follows the required templates and whether public API docs, system API docs, error code docs, and interface declarations/comments/implementations are consistent. Use when the user asks to review API doc quality, compare docs against code, audit error code docs, fill missing interface documentation, or generate a doc issue report.
npx skillsauth add openharmonyinsight/openharmony-skills docs-check-zh-cnInstall 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.
Run OpenHarmony API documentation quality checks with emphasis on template compliance, documentation consistency, error code coverage, and implementation alignment. Focus the output on issues only. Do not repeat content that already complies.
Infer paths from the user context, current working directory, and repository layout whenever possible. Ask the user only if the needed files still cannot be located.
Collect or infer the following inputs:
public API doc path, optional, usually under /docssystem API doc path, optional, usually under /docs/docs/interfaceBy default, resolve /docs first from the workspace root, then /interface.
If the user provides a path starting with /docs/... or /interface/..., interpret it as a repository-root path first, not as a path relative to the current module directory.
If the user provides only part of the paths, start from the known inputs and continue auto-discovery under the workspace root /docs and /interface. Explicitly state any unchecked scope in the report.
Follow this order.
scripts/check_api_doc_consistency.py first for the stable automatable checks.Use this lookup order by default:
docs and interface/docs/interfaceIf the current directory is a submodule, do not assume /docs or /interface exists under the current directory. Find the workspace root first.
Use this template priority:
In-repo template paths:
/docs/blob/master/zh-cn/contribute/template/native-template.md/docs/blob/master/zh-cn/contribute/template/ts-template.md/docs/blob/master/zh-cn/contribute/template/errorcodes-template.mdExternal links:
https://gitcode.com/openharmony/docs/blob/master/zh-cn/contribute/template/native-template.mdhttps://gitcode.com/openharmony/docs/blob/master/zh-cn/contribute/template/ts-template.mdhttps://gitcode.com/openharmony/docs/blob/master/zh-cn/contribute/template/errorcodes-template.mdBundled fallback templates:
references/js-template.mdreferences/ts-template.mdreferences/errorcodes-template.mdTry the in-repo template first. If it does not exist, try the external link. If that is still unavailable, fall back to the bundled template under references/. State the actual template source used in the final report.
Choose the template based on the interface category:
For ArkTS component detection, prefer the owning Kit:
ArkUI, treat it as an ArkTS component interface and use ts-templateDo not choose a template from the filename alone. Consider the Kit, interface type, current document structure, and d.ts content together.
After the script finishes, focus manual review on the parts that are not reliable to automate:
Use implementation code to identify missing or incorrect documentation such as:
If the implementation cannot be located from the current repository, pause this part and ask the user for the correct repository path.
Produce a Markdown report with the following rules:
Preferred issue fields:
LocationIssueSuggestionProposed FixRead files under references/ only when needed. Do not load everything by default. If a template is long, search for the relevant section first and then read only the needed part.
Use scripts/check_api_doc_consistency.py whenever the user provides a d.ts file together with public/system/error Markdown paths. The script already covers the repetitive high-confidence checks, including:
@throws parsing@syscap, @permission, @atomicservice, @systemapi, model-only tags, @deprecated, and @useinstead-sys.md naming, title, and Readme-CN.md entry checks<sup>x+</sup> presenceFor field-style checks, prefer the script result over manual keyword search. The current script parses labeled documentation fields such as 系统接口, 模型约束, and 需要权限, which reduces noise from unrelated prose matches.
For @since handling, interpret tags from the dynamic-API documentation perspective only:
@since x means the dynamic API starts at version x@since x dynamic means the dynamic API starts at version x@since x dynamic&static means both dynamic and static forms start at version x; for the current checker, use x as the dynamic version@since x static is ignored by the current doc checker@since x dynamiconly means the API is dynamic-only and starts at version x@since x staticonly is ignored by the current doc checkerDo not treat static-only version tags as documentation-version requirements for the current checks.
Do not hardcode evolving template wording in SKILL.md. The script reads its change-prone literals from scripts/doc_check_rules.json.
When the in-repo template or external template changes:
scripts/doc_check_rules.json.scripts/doc_check_rules.json first if only the expected text or required blocks changed.scripts/check_api_doc_consistency.py only when the rule logic itself is no longer valid.--js-template, --ts-template, and --error-template so it can warn when the configured rules no longer match the current template text.Run it like this:
python3 scripts/check_api_doc_consistency.py \
--api /path/to/file.d.ts \
--public-doc /path/to/public.md \
--system-doc /path/to/system.md \
--error-doc /path/to/error.md \
--readme-doc /path/to/Readme-CN.md \
--js-template /path/to/native-template.md \
--ts-template /path/to/ts-template.md \
--error-template /path/to/errorcodes-template.md
--readme-doc is optional. If omitted, the script tries to infer Readme-CN.md from the public/system doc directory.
The template arguments are also optional, but provide an additional guard that warns when the rule file no longer matches the current template wording.
Treat the script output as the first pass. Do not duplicate those low-level rules manually in the report unless you are clarifying or confirming a script finding. Spend manual review time on semantic gaps, explanation quality, and implementation alignment instead.
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