skills/arkuix-module-adapter/SKILL.md
--- name: ArkUIX Module Adapter description: Guide OHOS modules cross-platform adaptation with automated architecture analysis, code sync, and configuration generation. Use for adapting OHOS subsystem modules (@ohos.data.preferences, @ohos.intl, @ohos.multimedia.image, etc.) to Android/iOS. Provides 6-phase workflow: info collection → code sync → API analysis → architecture analysis → recommendation → implementation. Includes automated scripts for DTS analysis, architecture analysis, and configu
npx skillsauth add openharmonyinsight/openharmony-skills skills/arkuix-module-adapterInstall 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.
Guide OHOS modules through cross-platform adaptation with automated analysis and code generation. This skill transforms Claude into a specialized adaptation assistant with domain expertise in OHOS/ArkUI-X architecture.
User: "I need to adapt @ohos.data.preferences module"
The skill automatically guides through all 6 phases of adaptation.
Collects minimal information upfront (module name), then lazily collects additional details (repository name, storage path) only when needed.
Output: Module identification information
Intelligently checks if OHOS code already exists before syncing. Avoids redundant operations.
Decision Tree:
.repo/manifests/openharmony-master.xmlplugins/ directoryOutput: Sync status or repository verification results
Analyzes .d.ts file to determine @crossplatform coverage.
Metrics:
Output: Comprehensive API statistics with coverage progress bar
Automation: scripts/dts_analyzer.py interface/sdk-js/api/@ohos.{module}.d.ts
Analyzes OHOS module code composition and platform dependencies.
Analysis Dimensions:
Key Rule: C/C++ Cross-Platform Native Support
Output: Detailed code composition and dependency analysis
Automation: scripts/architecture_analyzer.py foundation/{module_path}
Recommends adaptation mode based on analysis: OHOS Reuse / Independent / Hybrid
Decision Matrix:
| Mode | Code Reuse | New Code | Time | Best For | |------|------------|----------|------|----------| | OHOS Reuse | 90-95% | 500-800 lines | 4-6 weeks | Data-focused (preferences, kv_store) | | Hybrid | 60-80% | 1,500-2,500 lines | 6-10 weeks | Mixed (location, sensor) | | Independent | 10-30% | 4,000-6,000 lines | 10-16 weeks | Platform-heavy (BLE, pasteboard) |
Output: Recommended mode with rationale and effort estimates
Provides actual implementation code with complete examples for:
Output: Production-ready code with comprehensive error handling
Automation: scripts/code_generator.py {module} {repo} --api-version {ver}
All scripts are in scripts/ directory:
# Analyze .d.ts coverage
python3 scripts/dts_analyzer.py interface/sdk-js/api/@ohos.data.preferences.d.ts
# Analyze module architecture
python3 scripts/architecture_analyzer.py foundation/distributeddatamgr/preferences
# Generate configuration files (dry-run)
python3 scripts/code_generator.py data/preferences distributeddatamgr_preferences --api-version 23 --dry-run
# Apply changes
python3 scripts/code_generator.py data/preferences distributeddatamgr_preferences --api-version 23
Core workflow in SKILL.md (this file), detailed content in references:
references/phase{1-6}*.mdreferences/architecture-modes.mdreferences/code-examples.mdassets/templates/ (code templates for reuse)For data-focused modules with minimal platform dependencies.
Characteristics:
Example Modules: preferences, kv_store, http
For modules with heavy platform API dependencies.
Characteristics:
Example Modules: bluetooth, pasteboard, camera
For mixed data/platform logic modules.
Characteristics:
Example Modules: geolocation, sensor, request
Use this checklist to track adaptation progress:
After code generation, ensure all 4 files are updated:
plugins/plugin_lib.gni - Module entryinterface/sdk/plugins/api/apiConfig.json - Library configurationbuild_plugins/sdk/arkui_cross_sdk_description_std.json - Build entriesinterface/sdk-js/api/@ohos.{module}.d.ts - @crossplatform annotationsRepository not found on GitCode?
{subsystem}_{module} or {module}Validation failed?
Build errors?
--dry-run flag before applying changesdevelopment
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