harmony-skills-standalone 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,18 @@
1
+ ---
2
+ name: autotest-agent
3
+ description: Run the repository AutoTestAgent for a declared test-execution workflow node.
4
+ ---
5
+
6
+ # AutoTest Agent Bridge
7
+
8
+ Use the checked-in `SubAgents/AutoTestAgent-master` implementation to execute the
9
+ test intent or test-case input named in the prompt.
10
+
11
+ - Verify the device and HAP prerequisites before execution.
12
+ - Never fabricate device interaction, screenshots, pass counts, or reports.
13
+ - Preserve the AutoTestAgent raw report under the declared node output directory.
14
+ - Write the declared `result` output as valid JSON containing the real command,
15
+ device, case totals, pass/fail counts, report paths, and blocking reason.
16
+ - Emit structured JSON progress lines during setup, execution, attribution, and
17
+ report generation.
18
+ - Fail when required device or application prerequisites are unavailable.
@@ -0,0 +1,92 @@
1
+ ---
2
+ name: deveco-cli
3
+ description: Use DevEco CLI for HarmonyOS application creation, build, deployment, devices, emulators, logs, local documentation, UI inspection, and DevEco MCP setup. Use when a workspace contains build-profile.json5 or oh-package.json5, or the task mentions HarmonyOS, ArkTS, ArkUI, DevEco, HDC, Hvigor, HarmonyOS UI inspection, or HarmonyOS documentation.
4
+ source: https://gitcode.com/openharmony-sig/deveco-cli
5
+ upstream_version: 0.4.0
6
+ ---
7
+
8
+ # DevEco CLI
9
+
10
+ `devecocli` is the preferred entry point for the DevEco Studio toolchain. It wraps
11
+ Hvigor, OHPM, HDC, emulators, logs, documentation search, UI inspection, Skill
12
+ installation, and the bundled DevEco MCP server.
13
+
14
+ ## Operating rules
15
+
16
+ - Run commands from the HarmonyOS project root containing `build-profile.json5`.
17
+ - Prefer `devecocli` to manually assembling Hvigor/HDC commands.
18
+ - Ask for a device selector when multiple devices are connected.
19
+ - Do not repeatedly retry emulator image downloads, license prompts, or emulator
20
+ creation failures. Report the required user action.
21
+ - Use `--uninstall` when installation fails because signing information differs.
22
+ - Treat build, install, launch, emulator mutation, and package installation as
23
+ external operations that require the normal workspace authorization.
24
+
25
+ ## Common workflow
26
+
27
+ ```bash
28
+ devecocli device list
29
+ devecocli build
30
+ devecocli run --device <name-or-serial>
31
+ devecocli log --level E --from 5m --tail 200
32
+ ```
33
+
34
+ Useful commands:
35
+
36
+ | Goal | Command |
37
+ |---|---|
38
+ | Build default product | `devecocli build` |
39
+ | Build modules | `devecocli build --modules entry feature` |
40
+ | Release build | `devecocli build --build-mode release` |
41
+ | Clean | `devecocli build clean` |
42
+ | Build/install/launch | `devecocli run` |
43
+ | Resolve signing mismatch | `devecocli run --uninstall` |
44
+ | List devices | `devecocli device list` |
45
+ | Device details | `devecocli device view -t <serial>` |
46
+ | Crash logs | `devecocli log --crash --bundle-name <bundle>` |
47
+ | Error logs | `devecocli log --level E --from 5m --tail 200` |
48
+ | Search docs | `devecocli docs search <keywords...>` |
49
+ | Read docs | `devecocli docs read <document-id>` |
50
+ | UI tree | `devecocli ui layout --format json` |
51
+ | Screenshot | `devecocli ui screenshot --path <output.png>` |
52
+ | Windows | `devecocli ui window list --format json` |
53
+
54
+ ## DevEco MCP
55
+
56
+ Start the bundled stdio MCP server with:
57
+
58
+ ```bash
59
+ PROJECT_PATH=/absolute/path/to/project devecocli serve mcp
60
+ ```
61
+
62
+ The MCP server currently exposes ArkTS and C/C++ diagnostic tools. The broader
63
+ build, run, device, log, docs, and UI commands remain CLI capabilities directed by
64
+ this Skill unless the installed MCP version explicitly advertises additional tools.
65
+
66
+ Supported environment variables:
67
+
68
+ - `PROJECT_PATH`: HarmonyOS project root. Required for deterministic project binding.
69
+ - `DEVECO_PATH`: optional explicit DevEco Studio installation path.
70
+ - `NODE_MAX_OLD_SPACE_SIZE`: optional Node memory limit; use `8192` for large projects.
71
+ - `DEBUG=1`: emit MCP/toolchain diagnostics.
72
+
73
+ Agent configuration can also be generated by DevEco CLI:
74
+
75
+ ```bash
76
+ devecocli init --mcp --agent codex --project /absolute/path/to/project
77
+ ```
78
+
79
+ ## Setup and maintenance
80
+
81
+ ```bash
82
+ devecocli init --skill --agent <agent>
83
+ devecocli skills list --long
84
+ devecocli skills find <keyword>
85
+ devecocli update
86
+ ```
87
+
88
+ For emulator license agreements, use an interactive terminal, or explicitly run
89
+ `devecocli emulator license accept` in an approved non-interactive workflow.
90
+
91
+ This local Skill is derived from the official OpenHarmony SIG DevEco CLI Skill.
92
+ Consult the upstream repository when CLI behavior changes.
@@ -0,0 +1,117 @@
1
+ ---
2
+ name: htrace-converter
3
+ description: >
4
+ 将鸿蒙 HarmonyOS trace 文件(.htrace、.ftrace)转换为 SQLite .db 格式。
5
+ 当用户提到"转换 htrace"、"convert htrace"、"htrace 转 db"、"ftrace 转 db"、
6
+ "trace_streamer"、"解析 trace 文件"时使用。
7
+ ---
8
+
9
+ # HTrace 文件转换工具
10
+
11
+ 将 HarmonyOS 抓取的 `.htrace` 或 `.ftrace` trace 文件,通过 `trace_streamer` 工具转换为可查询的 SQLite `.db` 格式,以便后续分析使用。
12
+
13
+ ## 使用方式
14
+
15
+ | 命令 | 说明 |
16
+ |------|------|
17
+ | `/htrace-converter <trace文件路径>` | 转换指定 trace 文件为 .db |
18
+ | `/htrace-converter install` | 安装/更新 trace_streamer 到系统 PATH |
19
+ | `/htrace-converter check` | 检查当前环境中 trace_streamer 是否可用 |
20
+
21
+ ## 执行步骤
22
+
23
+ ### 步骤一:环境检查
24
+
25
+ 检查 `trace_streamer` 是否可用,按以下顺序查找:
26
+
27
+ 1. **系统 PATH**:`which trace_streamer_mac`(或对应平台名)
28
+ 2. **当前目录**:`./trace_streamer_binary/<平台二进制名>`
29
+ 3. **上级目录**:`../trace_streamer_binary/<平台二进制名>`
30
+ 4. **应用包内**(macOS):`<jar所在目录>/../trace_streamer/<平台二进制名>`
31
+
32
+ 检测当前平台:
33
+
34
+ ```bash
35
+ uname -s
36
+ ```
37
+
38
+ 平台到二进制名的映射:
39
+ - `Darwin`(macOS)→ `trace_streamer_mac`
40
+ - `Linux` → `trace_streamer_linux`
41
+ - `MINGW*` / `CYGWIN*`(Windows)→ `trace_streamer_windows.exe`
42
+
43
+ ### 步骤二:安装 trace_streamer(仅 `/htrace-converter install` 时执行)
44
+
45
+ 从 [华为 SmartPerf-Host 项目](https://gitee.com/openharmony/developtools_smartperf_host/releases) 或随 trace-analyzer 一起发布的 `trace_streamer_binary` 目录中获取二进制文件。
46
+
47
+ 安装步骤:
48
+ 1. 从 trace-analyzer 项目的 `trace_streamer_binary/` 目录复制对应平台二进制到 `/usr/local/bin/`
49
+ 2. 赋予执行权限:`chmod +x /usr/local/bin/trace_streamer_<platform>`
50
+ 3. 验证:运行 `trace_streamer_mac --version`(或对应名称)
51
+
52
+ **也可以直接配置环境变量指向 `trace_streamer_binary/` 目录,无需复制到系统 PATH。**
53
+
54
+ ### 步骤三:执行转换
55
+
56
+ 确认以下信息:
57
+ - **输入文件**:`.htrace` 或 `.ftrace` 文件路径
58
+ - **输出路径**(可选):默认输出到系统临时目录 `/tmp/trace-analyzer/<basename>.htrace_db`
59
+
60
+ 执行转换命令:
61
+
62
+ ```bash
63
+ # macOS
64
+ trace_streamer_mac <input.htrace> -e <output.db>
65
+
66
+ # Linux
67
+ trace_streamer_linux <input.htrace> -e <output.db>
68
+
69
+ # Windows
70
+ trace_streamer_windows.exe <input.htrace> -e <output.db>
71
+ ```
72
+
73
+ **缓存策略**:如果输出 `.db` 文件已存在且比输入文件更新,跳过转换直接使用缓存。
74
+
75
+ ### 步骤四:验证结果
76
+
77
+ 转换完成后验证 `.db` 文件:
78
+
79
+ ```bash
80
+ # 检查文件存在且非空
81
+ ls -lh <output.db>
82
+
83
+ # 验证是有效的 SQLite 文件(可选)
84
+ sqlite3 <output.db> ".tables" 2>/dev/null | head -5
85
+ ```
86
+
87
+ ### 步骤五:输出结果
88
+
89
+ 成功后告知用户:
90
+
91
+ ```
92
+ 转换完成!
93
+
94
+ 输入文件: /path/to/input.htrace
95
+ 输出文件: /tmp/trace-analyzer/input.htrace_db
96
+ 文件大小: XX MB
97
+
98
+ 可使用以下工具继续分析:
99
+ - trace-analyzer <output.db> -m <线程名> # 卡顿/完成时延分析
100
+ - sqlite3 <output.db> # 直接查询数据库
101
+ ```
102
+
103
+ ## 错误处理
104
+
105
+ | 错误情况 | 处理方式 |
106
+ |----------|----------|
107
+ | 输入文件不存在 | 提示用户确认文件路径 |
108
+ | trace_streamer 不存在 | 引导用户运行 `/htrace-converter install` |
109
+ | 转换失败(非零退出码) | 显示完整错误输出,建议检查文件是否损坏 |
110
+ | 输出目录无写权限 | 建议用户指定其他输出路径 |
111
+
112
+ ## 说明
113
+
114
+ - `trace_streamer` 是华为开源的 HarmonyOS trace 解析工具,来自 [SmartPerf-Host](https://gitee.com/openharmony/developtools_smartperf_host) 项目
115
+ - 转换后的 `.db` 是标准 SQLite 文件,包含线程调度、函数调用、CPU 状态等信息
116
+ - 支持 `.htrace`(二进制格式)和 `.ftrace`(文本格式)两种输入格式
117
+ - 转换耗时取决于文件大小,通常 100MB 的 trace 文件需要 10-30 秒
@@ -0,0 +1,117 @@
1
+ ---
2
+ name: htrace-converter
3
+ description: >
4
+ 将鸿蒙 HarmonyOS trace 文件(.htrace、.ftrace)转换为 SQLite .db 格式。
5
+ 当用户提到"转换 htrace"、"convert htrace"、"htrace 转 db"、"ftrace 转 db"、
6
+ "trace_streamer"、"解析 trace 文件"时使用。
7
+ ---
8
+
9
+ # HTrace 文件转换工具
10
+
11
+ 将 HarmonyOS 抓取的 `.htrace` 或 `.ftrace` trace 文件,通过 `trace_streamer` 工具转换为可查询的 SQLite `.db` 格式,以便后续分析使用。
12
+
13
+ ## 使用方式
14
+
15
+ | 命令 | 说明 |
16
+ |------|------|
17
+ | `/htrace-converter <trace文件路径>` | 转换指定 trace 文件为 .db |
18
+ | `/htrace-converter install` | 安装/更新 trace_streamer 到系统 PATH |
19
+ | `/htrace-converter check` | 检查当前环境中 trace_streamer 是否可用 |
20
+
21
+ ## 执行步骤
22
+
23
+ ### 步骤一:环境检查
24
+
25
+ 检查 `trace_streamer` 是否可用,按以下顺序查找:
26
+
27
+ 1. **系统 PATH**:`which trace_streamer_mac`(或对应平台名)
28
+ 2. **当前目录**:`./trace_streamer_binary/<平台二进制名>`
29
+ 3. **上级目录**:`../trace_streamer_binary/<平台二进制名>`
30
+ 4. **应用包内**(macOS):`<jar所在目录>/../trace_streamer/<平台二进制名>`
31
+
32
+ 检测当前平台:
33
+
34
+ ```bash
35
+ uname -s
36
+ ```
37
+
38
+ 平台到二进制名的映射:
39
+ - `Darwin`(macOS)→ `trace_streamer_mac`
40
+ - `Linux` → `trace_streamer_linux`
41
+ - `MINGW*` / `CYGWIN*`(Windows)→ `trace_streamer_windows.exe`
42
+
43
+ ### 步骤二:安装 trace_streamer(仅 `/htrace-converter install` 时执行)
44
+
45
+ 从 [华为 SmartPerf-Host 项目](https://gitee.com/openharmony/developtools_smartperf_host/releases) 或随 trace-analyzer 一起发布的 `trace_streamer_binary` 目录中获取二进制文件。
46
+
47
+ 安装步骤:
48
+ 1. 从 trace-analyzer 项目的 `trace_streamer_binary/` 目录复制对应平台二进制到 `/usr/local/bin/`
49
+ 2. 赋予执行权限:`chmod +x /usr/local/bin/trace_streamer_<platform>`
50
+ 3. 验证:运行 `trace_streamer_mac --version`(或对应名称)
51
+
52
+ **也可以直接配置环境变量指向 `trace_streamer_binary/` 目录,无需复制到系统 PATH。**
53
+
54
+ ### 步骤三:执行转换
55
+
56
+ 确认以下信息:
57
+ - **输入文件**:`.htrace` 或 `.ftrace` 文件路径
58
+ - **输出路径**(可选):默认输出到系统临时目录 `/tmp/trace-analyzer/<basename>.htrace_db`
59
+
60
+ 执行转换命令:
61
+
62
+ ```bash
63
+ # macOS
64
+ trace_streamer_mac <input.htrace> -e <output.db>
65
+
66
+ # Linux
67
+ trace_streamer_linux <input.htrace> -e <output.db>
68
+
69
+ # Windows
70
+ trace_streamer_windows.exe <input.htrace> -e <output.db>
71
+ ```
72
+
73
+ **缓存策略**:如果输出 `.db` 文件已存在且比输入文件更新,跳过转换直接使用缓存。
74
+
75
+ ### 步骤四:验证结果
76
+
77
+ 转换完成后验证 `.db` 文件:
78
+
79
+ ```bash
80
+ # 检查文件存在且非空
81
+ ls -lh <output.db>
82
+
83
+ # 验证是有效的 SQLite 文件(可选)
84
+ sqlite3 <output.db> ".tables" 2>/dev/null | head -5
85
+ ```
86
+
87
+ ### 步骤五:输出结果
88
+
89
+ 成功后告知用户:
90
+
91
+ ```
92
+ 转换完成!
93
+
94
+ 输入文件: /path/to/input.htrace
95
+ 输出文件: /tmp/trace-analyzer/input.htrace_db
96
+ 文件大小: XX MB
97
+
98
+ 可使用以下工具继续分析:
99
+ - trace-analyzer <output.db> -m <线程名> # 卡顿/完成时延分析
100
+ - sqlite3 <output.db> # 直接查询数据库
101
+ ```
102
+
103
+ ## 错误处理
104
+
105
+ | 错误情况 | 处理方式 |
106
+ |----------|----------|
107
+ | 输入文件不存在 | 提示用户确认文件路径 |
108
+ | trace_streamer 不存在 | 引导用户运行 `/htrace-converter install` |
109
+ | 转换失败(非零退出码) | 显示完整错误输出,建议检查文件是否损坏 |
110
+ | 输出目录无写权限 | 建议用户指定其他输出路径 |
111
+
112
+ ## 说明
113
+
114
+ - `trace_streamer` 是华为开源的 HarmonyOS trace 解析工具,来自 [SmartPerf-Host](https://gitee.com/openharmony/developtools_smartperf_host) 项目
115
+ - 转换后的 `.db` 是标准 SQLite 文件,包含线程调度、函数调用、CPU 状态等信息
116
+ - 支持 `.htrace`(二进制格式)和 `.ftrace`(文本格式)两种输入格式
117
+ - 转换耗时取决于文件大小,通常 100MB 的 trace 文件需要 10-30 秒
package/package.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "harmony-skills-standalone",
3
+ "version": "1.0.0",
4
+ "description": "Skills: standalone",
5
+ "files": [
6
+ "autotest-agent",
7
+ "deveco-cli",
8
+ "htrace-converter",
9
+ "workflow-generalist"
10
+ ]
11
+ }
@@ -0,0 +1,16 @@
1
+ ---
2
+ name: workflow-generalist
3
+ description: Execute one statically declared workflow node and write its declared result.
4
+ ---
5
+
6
+ # Workflow Generalist
7
+
8
+ Execute only the node described by the supplied prompt.
9
+
10
+ - Treat all input paths as read-only unless the prompt explicitly identifies the target project as writable.
11
+ - Do not invent upstream results or report success for work that was not performed.
12
+ - Keep changes within the authorized target project and declared task output paths.
13
+ - Write the declared `result` output as valid JSON.
14
+ - Include `status`, `summary`, `evidence`, and `artifacts` fields.
15
+ - Emit progress as one-line JSON objects with `type`, `phase`, `message`, and `progress`.
16
+ - Return a non-zero result when the requested operation cannot be completed or verified.