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.
development
Run local code quality checks covering a subset of OpenHarmony gate CI (copyright, CodeArts C/C++) plus additional local checks (pylint/flake8, shellcheck/bashate, gn format). Use before committing to reduce gate failures. Triggers on: /oh-precommit-codecheck, "门禁检查", "门禁预检", "检查代码", "run codecheck", "check code quality", "lint my code", "代码检查", or after completing code implementation. WHEN to use: before git commit, before creating PR, after modifying C/C++/Python/Shell/GN files, when gate CI fails with codecheck defects, or when you want to preview what gate will flag.
development
OpenHarmony PR full lifecycle workflow. Five modes: - Commit: standardized commit with DCO sign-off and Issue linking - Create PR: commit + push to fork + create Issue + create PR on upstream - Fix Codecheck: fetch gate CI codecheck defects from a PR and auto-fix them - Review PR: fetch a PR's changes to local for code review - Fix Review: fetch unresolved review comments from a PR and auto-fix them Triggers on: /oh-pr-workflow, "提交代码", "创建PR", "提个PR", "commit", "修复告警", "修复门禁", "修复codecheck", "fix codecheck", "review pr", "review这个pr", "看下这个pr", "检视pr", "修复review", "修复检视意见", "fix review", or a GitCode PR URL with fix/review intent.
testing
分析 HM Desktop PRD 文档,提取需求信息、验证完整性、检查章节顺序(需求来源→需求背景→需求价值分析→竞品分析→需求描述)、检查 KEP 定义、检测需求冲突并生成结构化分析报告。适用于用户请求:(1) 分析或审查 PRD 文档, (2) 从需求中提取 KEP 列表, (3) 检查 PRD 完整性或一致性, (4) 将需求映射到模块架构, (5) 验证 PRD 格式合规性, (6) 验证竞品分析章节完整性。关键词:PRD分析, requirement extraction, KEP验证, completeness check, chapter order validation, 竞品分析检查, analyze PRD, 需求提取, 完整性检查, 章节顺序验证
development
基于 PRD 文档自动生成鸿蒙系统设计文档,包括架构设计文档和功能设计文档。生成前会分析 OpenHarmony 存量代码结构,确保与现有架构兼容。架构设计文档第2章必须为竞品方案分析,位于需求背景之后。适用于用户请求:(1) 生成架构设计文档, (2) 生成功能设计文档, (3) 从 PRD 生成设计文档, (4) 创建系统架构设计, (5) 编写功能规格说明, (6) 分析 OH 代码结构。关键词:architecture design, functional design, design doc, 竞品方案分析, OpenHarmony code analysis, 架构设计, 功能设计, 设计文档生成, OH代码分析, analyze codebase, competitor analysis