skills/harmonyos-ai-agent-skill/SKILL.md
Entry skill for HarmonyOS multi-device adaptation. Use when the task broadly concerns HarmonyOS multi-device adaptation, or when the correct scenario is still unclear. This skill classifies the request by phase and scenario type, then routes to one or more scenario files for screen and window size, fold state, avoid areas, interaction methods, natural orientation, or hardware access.
npx skillsauth add openharmonyinsight/openharmony-skills hmos-multidevice-scenario-entryInstall 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_id | harmonyos-multi-device-scenario-entry |
| skill_name | 鸿蒙多设备适配总场景入口 |
| one_line_purpose | 先判断当前问题属于哪类多设备适配场景,再把请求引导到对应场景文件。 |
| device_scope | phone / tablet / foldable / tri-fold / pc / wearables / external input or device |
| problem_scope | 多设备布局、折展状态、避让区、交互方式、自然方向、硬件能力差异 |
| not_in_scope | 分布式流转、账号体系、网络通信、纯业务功能设计、与多设备无关的常规 UI 微调 |
| primary_outputs | active_phases、primary_phase、primary_scene、secondary_scenes、route_reason、next_scene_refs |
screen-window-size 是布局类兜底场景,不应吞并折展、避让、方向、交互和硬件问题。| 标签 | 阶段 | 总入口关注点 |
| --- | --- | --- |
| REQ | 需求分析设计 | 问题边界、设备范围、主适配维度 |
| DEV | 开发 | 主代码落点在哪个场景,是否需要多个场景联合 |
| FIX | 问题修复 | 根因属于哪个适配域,是否存在连带回归域 |
| VAL | 功能验证 | 验证矩阵应覆盖哪个场景,是否需要交叉验证 |
active_phases、primary_phase、primary_scene、secondary_scenes、route_reason、next_scene_refsREQ:problem_frame、device_scope_summary、routing_focusDEV:primary_code_domain、secondary_code_domains、integration_edgesFIX:suspected_root_domain、linked_regression_domains、handoff_priorityVAL:validation_domains、cross_checks、evidence_scopeprimary_scene:当前请求最应该先进入的场景。secondary_scenes:与主场景联动的次级场景列表,只允许填写 SCENE-xx 形式的场景 id,不填写 skill 路径。route_reason:说明为什么命中当前主场景,而不是其他场景。next_scene_refs:下一步应该实际打开的场景文件路径列表。primary_scene_ref:当前场景卡片直接指向的主场景路径,只在场景卡片内部使用。secondary_scene_refs:当前场景卡片常见的次级场景路径,只在场景卡片内部使用。scene_strategy:当前场景是 single 还是 composite。candidate_scenes:当 scene_strategy: composite 时,可作为主次场景的候选 SCENE-xx 列表。candidate_scene_refs:当 scene_strategy: composite 时,可进一步展开的候选场景文件路径列表。device_constraints;device_constraints 属于场景文件的 REQ 字段,由对应场景在展开分析时产出。active_phases:
REQDEVFIXVALprimary_scene,再从 secondary_scenes 里补充 1-2 个次级场景,并汇总为最终的 next_scene_refs。SCENE-01。setPreferredOrientation 或 rotation 值解释时,仍优先走 SCENE-01。SCENE-01 布局与窗口尺寸场景scene_id: SCENE-01
scene_name: 布局与窗口尺寸场景
phase_tags: [REQ, DEV, FIX, VAL]
priority: P2
intent_signals:
- 响应式
- breakpoint
- GridRow
- GridCol
- 多栏
- windowSizeChange
- media query
- 窗口变化
- 旋转后布局不同步
applies_when:
- 主要问题是断点、结构切换或窗口尺寸变化
- 问题可以不依赖折叠态、系统避让区、方向语义、输入设备或硬件能力来解释
not_applies_when:
- 存在折痕、悬停态、Pura X、键盘遮挡、状态栏遮挡、自然方向语义、`setPreferredOrientation`、`rotation` 值解释、mouse、canIUse 等更强信号
scene_strategy: single
primary_scene_ref: ./references/hmos-multidevice-screen-window-size/SKILL.md
secondary_scenes:
- SCENE-02
- SCENE-03
secondary_scene_refs:
- ./references/hmos-multidevice-fold-state/SKILL.md
- ./references/hmos-multidevice-avoid-areas/SKILL.md
SCENE-02 折展状态与折痕场景scene_id: SCENE-02
scene_name: 折展状态与折痕场景
phase_tags: [REQ, DEV, FIX, VAL]
priority: P0
intent_signals:
- foldStatus
- 折叠
- 展开
- 悬停态
- 折痕
- tri-fold
- G态
- Pura X
applies_when:
- 主要问题依赖设备折叠状态、折痕几何或宽折叠形态
- 页面在手机和平板正常,但在折叠设备上出现结构或行为异常
not_applies_when:
- 问题只与普通横竖屏变化或普通窗口断点有关
scene_strategy: single
primary_scene_ref: ./references/hmos-multidevice-fold-state/SKILL.md
secondary_scenes:
- SCENE-01
- SCENE-05
secondary_scene_refs:
- ./references/hmos-multidevice-screen-window-size/SKILL.md
- ./references/hmos-multidevice-natural-orientation/SKILL.md
SCENE-03 系统区域与键盘避让场景scene_id: SCENE-03
scene_name: 系统区域与键盘避让场景
phase_tags: [REQ, DEV, FIX, VAL]
priority: P0
intent_signals:
- safe area
- 状态栏
- 导航栏
- 挖孔
- 刘海
- 沉浸式
- 键盘遮挡
- 输入法
applies_when:
- 主要问题是内容被系统区域、挖孔区或软键盘遮挡
- 需要处理背景延伸和内容避让边界
not_applies_when:
- 问题只是普通 margin 或栅格调整
scene_strategy: single
primary_scene_ref: ./references/hmos-multidevice-avoid-areas/SKILL.md
secondary_scenes:
- SCENE-01
- SCENE-02
secondary_scene_refs:
- ./references/hmos-multidevice-screen-window-size/SKILL.md
- ./references/hmos-multidevice-fold-state/SKILL.md
SCENE-04 多输入与焦点交互场景scene_id: SCENE-04
scene_name: 多输入与焦点交互场景
phase_tags: [REQ, DEV, FIX, VAL]
priority: P1
intent_signals:
- 鼠标
- hover
- 右键
- 键盘焦点
- shortcut
- 手写笔
- 拖拽
- 外接键鼠
applies_when:
- 主要问题是交互模型会随输入方式变化
- 需要同时兼容触摸、鼠标、键盘或手写笔
not_applies_when:
- 问题只表现为布局变化,没有交互行为变化
scene_strategy: single
primary_scene_ref: ./references/hmos-multidevice-interaction-methods/SKILL.md
secondary_scenes:
- SCENE-01
secondary_scene_refs:
- ./references/hmos-multidevice-screen-window-size/SKILL.md
SCENE-05 自然方向与旋转语义场景scene_id: SCENE-05
scene_name: 自然方向与旋转语义场景
phase_tags: [REQ, DEV, FIX, VAL]
priority: P1
intent_signals:
- rotation 值
- orientation
- 自然竖屏
- 自然横屏
- setPreferredOrientation
- 传感器方向
- 横竖屏误判
applies_when:
- 主要问题是方向语义、rotation 值或自然方向类型
- 需要区分屏幕旋转、窗口方向和自然方向
not_applies_when:
- 只是宽度断点变化或窗口尺寸同步导致的布局切换
scene_strategy: single
primary_scene_ref: ./references/hmos-multidevice-natural-orientation/SKILL.md
secondary_scenes:
- SCENE-02
- SCENE-01
secondary_scene_refs:
- ./references/hmos-multidevice-fold-state/SKILL.md
- ./references/hmos-multidevice-screen-window-size/SKILL.md
SCENE-06 硬件能力与外设场景scene_id: SCENE-06
scene_name: 硬件能力与外设场景
phase_tags: [REQ, DEV, FIX, VAL]
priority: P0
intent_signals:
- canIUse
- SysCap
- 相机
- camera
- 传感器
- GPS
- NFC
- 蓝牙
- 外接设备
- 热插拔
applies_when:
- 主要问题是硬件能力存在设备差异,或调用前必须先检测能力
- 行为异常与设备枚举、权限声明、连接切换或降级策略直接相关
not_applies_when:
- 问题是纯 UI 布局、方向或避让,不涉及硬件能力差异
scene_strategy: single
primary_scene_ref: ./references/hmos-multidevice-hardware-access/SKILL.md
secondary_scenes:
- SCENE-04
secondary_scene_refs:
- ./references/hmos-multidevice-interaction-methods/SKILL.md
SCENE-07 复合问题联合场景scene_id: SCENE-07
scene_name: 复合问题联合场景
phase_tags: [REQ, DEV, FIX, VAL]
priority: P1
intent_signals:
- 同时出现折叠、键盘、窗口、方向、输入或硬件中的多个信号
- 需要解释主问题和连带问题
- 单一场景不足以完整覆盖
applies_when:
- 问题必须同时依赖两个以上场景才能解释
- 需要先选主场景,再合并次场景
not_applies_when:
- 单一场景已经足够解释问题
scene_strategy: composite
candidate_scenes:
- SCENE-01
- SCENE-02
- SCENE-03
- SCENE-04
- SCENE-05
- SCENE-06
candidate_scene_refs:
- ./references/hmos-multidevice-screen-window-size/SKILL.md
- ./references/hmos-multidevice-fold-state/SKILL.md
- ./references/hmos-multidevice-avoid-areas/SKILL.md
- ./references/hmos-multidevice-interaction-methods/SKILL.md
- ./references/hmos-multidevice-natural-orientation/SKILL.md
- ./references/hmos-multidevice-hardware-access/SKILL.md
SCENE-07 的组合策略。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