ワンクリックで
harmonyos-ui-automator
HarmonyOS UI 自动化交互技能。通过 hdc dump ArkUI 布局树,理解当前界面状态,根据用户意图找到目标组件位置,并执行点击、长按、滑动、输入等交互操作。适用于 UI 自动化测试、应用操作自动化等场景。
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
HarmonyOS UI 自动化交互技能。通过 hdc dump ArkUI 布局树,理解当前界面状态,根据用户意图找到目标组件位置,并执行点击、长按、滑动、输入等交互操作。适用于 UI 自动化测试、应用操作自动化等场景。
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
OpenHarmony (鸿蒙) 服务层/框架层代码仓库架构与命名规范领域知识。 适用于识别、导航、分析和创建符合 OpenHarmony 分层架构标准的代码仓库。 当用户需要以下任一场景时使用此 Skill: (1) 分析 OpenHarmony 服务层或框架层代码仓库的目录结构与命名约定, (2) 判断一个仓库是否符合 OpenHarmony foundation 分层架构规范(subsystem/component 路径模式), (3) 理解 bundle.json 组件描述符与 GN 构建系统的路径映射关系, (4) 在 OpenHarmony 项目内新增组件、服务或接口时遵循正确的命名格式, (5) 理解 frameworks/ vs services/ vs interfaces/ vs common/ 的分层职责边界。
Convert a macOS Electron app (from .dmg) into a runnable Linux Electron app. Use when the user needs to port a macOS-only Electron desktop application to Linux, build a .deb/.rpm package from a macOS DMG, patch app.asar for Linux window behavior, or fix startup crashes after such conversion (e.g., missing chunks, t.join errors, transparent background flickering, deb dependency issues).
Reverse engineer and deobfuscate bundled JavaScript/Electron applications. Extracts DMG/AppImage/pkg archives, unpacks app.asar, deobfuscates webpack/Vite/browserify bundles with scope-aware Babel-based variable renaming, and outputs readable source code. Use when the user wants to reverse engineer, deobfuscate, unminify, or analyze a bundled JS application (Electron, web app, Node.js), extract readable source from minified bundles, unpack app.asar, or understand how a third-party JS app works internally.
Up-to-date Zig programming language patterns for version 0.16.0. Use when writing, reviewing, or debugging Zig code, working with build.zig and build.zig.zon files, or using comptime metaprogramming. Critical for avoiding outdated patterns from training data - especially build system APIs (root_module instead of root_source_file), I/O APIs (buffered writer pattern), container initialization (.empty/.init), allocator selection (DebugAllocator), and removed language features (@Type, @cImport, async/await, usingnamespace).
Fix WSL git proxy connection errors (Failed to connect to 127.0.0.1 port 7890)
CS 课程系统性学习 Skill。融合横纵分析法与结构化写作质检体系,用于深度学习一门计算机科学课程(含 lecture notes、syllabus、paper list),最终输出一份结构完整、有个人洞察的学习报告。 触发词包括但不限于:学习这门课、帮我梳理一下这个课程、研究一下这门 CS 课程、输出学习报告、课程分析、lecture notes 整理、帮我搞懂这门课。 适用于用户丢来一个课程主页(如 https://cs.brown.edu/courses/csci1650/)说"帮我学习一下"或"帮我写个学习报告"的场景。 不要用于简单名词解释(如"什么是 OS"),也不要用于写公众号文章。
| name | harmonyos-ui-automator |
| description | HarmonyOS UI 自动化交互技能。通过 hdc dump ArkUI 布局树,理解当前界面状态,根据用户意图找到目标组件位置,并执行点击、长按、滑动、输入等交互操作。适用于 UI 自动化测试、应用操作自动化等场景。 |
| allowed-tools | ["Bash","Read","Write","Glob","Grep","AskUserQuestion"] |
本技能实现 HarmonyOS 设备的 UI 自动化交互:
# 默认输出到 /tmp/harmonyos_layout_<timestamp>.json
python3 $SKILL_DIR/scripts/dump_layout.py
# 指定输出路径
python3 $SKILL_DIR/scripts/dump_layout.py --output /tmp/current_layout.json
返回布局文件路径和界面摘要。
# 按文本查找
python3 $SKILL_DIR/scripts/find_component.py --text "设置"
# 按 ID 查找
python3 $SKILL_DIR/scripts/find_component.py --id "AppIcon_Image"
# 按类型查找
python3 $SKILL_DIR/scripts/find_component.py --type "Button"
# 组合条件
python3 $SKILL_DIR/scripts/find_component.py --text "登录" --clickable true
# 点击坐标
python3 $SKILL_DIR/scripts/interact.py click 660 416
# 点击组件(自动计算中心点;至少提供一个选择器)
python3 $SKILL_DIR/scripts/interact.py click-component --text "设置"
# 长按
python3 $SKILL_DIR/scripts/interact.py long-click 660 416
# 双击
python3 $SKILL_DIR/scripts/interact.py double-click 660 416
# 滑动
python3 $SKILL_DIR/scripts/interact.py swipe 100 500 100 200
# 输入文本(先点击获取焦点)
python3 $SKILL_DIR/scripts/interact.py input-text 200 300 "Hello World"
# 按键事件
python3 $SKILL_DIR/scripts/interact.py key-event Back
# 方向甩动(0=left, 1=right, 2=up, 3=down)
python3 $SKILL_DIR/scripts/interact.py dirc-fling 2
# 返回桌面
python3 $SKILL_DIR/scripts/shortcut.py home
# 下拉通知栏
python3 $SKILL_DIR/scripts/shortcut.py notification
# 多任务中心
python3 $SKILL_DIR/scripts/shortcut.py recent
当用户请求执行某个 UI 操作时,按以下流程执行:
python3 $SKILL_DIR/scripts/dump_layout.py
这会返回:
根据用户的意图,在布局树中搜索目标组件:
找到组件后,计算其中心坐标,执行相应操作:
# 假设找到的组件 bounds 为 "[100,200][300,400]"
# 中心点为 ((100+300)/2, (200+400)/2) = (200, 300)
python3 $SKILL_DIR/scripts/interact.py click 200 300
ArkUI 布局树为 JSON 格式,每个节点包含:
{
"attributes": {
"bounds": "[left,top][right,bottom]", // 组件边界坐标
"text": "按钮文字", // 显示文本
"type": "Button", // 组件类型
"id": "button_id", // 组件 ID
"clickable": "true/false", // 是否可点击
"longClickable": "true/false", // 是否可长按
"scrollable": "true/false", // 是否可滚动
"enabled": "true/false", // 是否可用
"visible": "true/false", // 是否可见
"description": "描述" // 无障碍描述
},
"children": [...] // 子组件
}
| 类型 | 说明 |
|---|---|
| Text | 文本组件 |
| Image | 图片组件 |
| Button | 按钮组件 |
| TextInput | 输入框 |
| Toggle | 开关组件 |
| Checkbox | 复选框 |
| List | 列表 |
| Grid | 网格 |
| Swiper | 轮播 |
| Stack | 堆叠容器 |
| Row/Column | 行/列容器 |
--device,避免操作到错误设备click-component / long-click-component 至少要提供一个选择器(--text/--id/--type/--regex)clickable=true、enabled=true、visible=true,避免误点不可交互节点bash $SKILL_DIR/scripts/smoke_test.sh