@buaa_smat/hometrans 0.1.7 → 0.1.8
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.
- package/README.md +2 -2
- package/package.json +8 -2
- package/resource/choose_editor.png +0 -0
- package/resource/finish_init.png +0 -0
- package/skills/hmos-convert-pipeline/SKILL.md +5 -21
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/MVVM/346/250/241/345/274/217/357/274/210V1/357/274/211.md +0 -911
- package/skills/skill-quality-evaluator/SKILL.md +0 -138
- package/skills/skill-quality-evaluator/assets/SKILL_TEMPLATE.md +0 -77
- package/skills/skill-quality-evaluator/references/Best-practices-for-skill-creators.md +0 -277
- package/skills/skill-quality-evaluator/references/Evaluating-skill-output-quality.md +0 -300
- package/skills/skill-quality-evaluator/references/Optimizing-skill-descriptions.md +0 -196
- package/skills/skill-quality-evaluator/references/Specification.md +0 -272
- package/skills/skill-quality-evaluator/references/Using-scripts-in-skills.md +0 -308
- package/skills/skill-quality-evaluator/references/report-template.md +0 -163
- package/skills/skill-quality-evaluator/references/scoring-rubric.md +0 -269
package/README.md
CHANGED
|
@@ -116,7 +116,6 @@ After confirming your editor selection, HomeTrans installs all bundled **skills*
|
|
|
116
116
|
| `assets-output-path` | **必选** | 输出/报告文件的存放目录(需包含 `plan.md` 需求规格文件) |
|
|
117
117
|
| `max-rounds-review` | 可选 | 代码检视循环最大轮数(正整数 `>= 1`,默认 `2`) |
|
|
118
118
|
| `max-rounds-test` | 可选 | 自测循环最大轮数(正整数 `>= 1`,默认 `2`) |
|
|
119
|
-
| `variant` | 可选 | `enhanced`(默认,全功能 agent)或 `baseline`(纯 LLM baseline agent) |
|
|
120
119
|
| `skip-test` | 可选 | `true` 跳过集成测试阶段(无真机验证环境时需要设置为true,默认 `false`) |
|
|
121
120
|
|
|
122
121
|
---
|
|
@@ -168,12 +167,13 @@ After confirming your editor selection, HomeTrans installs all bundled **skills*
|
|
|
168
167
|
|
|
169
168
|
| Skill | Trigger phrases | Description | Prerequisites | Arguments | Example |
|
|
170
169
|
|-------|-----------------|-------------|---------------|-----------|--------|
|
|
171
|
-
| `hmos-convert-pipeline` | "full Android-to-HarmonyOS pipeline", "run the conversion pipeline end-to-end", "hmos-convert-pipeline" | Runs all conversion agents in sequence with progress tracking, duration stats, and defect recording. 4 stages: Logic Development (Context Builder) → Logic Coding → Build → Code Review/Fix/Rebuild loop → Self-Test/Fix/Rebuild loop | `assets-output-path` 下需存在 `plan.md` 需求规格文件 | `android-project-path` (required), `harmonyos-project-path` (required), `assets-output-path` (required), `max-rounds-review` (optional, default 2), `max-rounds-test` (optional, default 2), `
|
|
170
|
+
| `hmos-convert-pipeline` | "full Android-to-HarmonyOS pipeline", "run the conversion pipeline end-to-end", "hmos-convert-pipeline" | Runs all conversion agents in sequence with progress tracking, duration stats, and defect recording. 4 stages: Logic Development (Context Builder) → Logic Coding → Build → Code Review/Fix/Rebuild loop → Self-Test/Fix/Rebuild loop | `assets-output-path` 下需存在 `plan.md` 需求规格文件 | `android-project-path` (required), `harmonyos-project-path` (required), `assets-output-path` (required), `max-rounds-review` (optional, default 2), `max-rounds-test` (optional, default 2), `skip-test` (optional, default false) | `"/hmos-convert-pipeline android-project-path=D:/path/to/android harmonyos-project-path=D:/path/to/harmonyos assets-output-path=D:/path/to/output"` |
|
|
172
171
|
| `hmos-spec-generate` | "spec generation", "generate spec", "requirement to spec", "atomic scenarios", "scenario decomposition", "req to spec" | Generates atomic-scenario requirement specs from raw `.txt` requirement batches. Reads REQ blocks, explores the Android code graph via GitNexus, writes per-REQ trace files, then synthesizes specs from the trace | 需求描述文件 (`.txt`),每段以 `REQ` 开头 | `requirement-description-file` (required), `android-project-path` (required), `spec-output-dir` (required) | `"/hmos-spec-generate requirement-description-file=D:/path/to/req.txt android-project-path=D:/path/to/android spec-output-dir=D:/path/to/specs"` |
|
|
173
172
|
| `hmos-resources-convert` | "Android resources to HarmonyOS", "migrate Android res", "convert drawables/strings/colors" | Converts Android project resources (strings, colors, dimensions, images, drawables, icons) into HarmonyOS resources, including qualifier directories and XML→JSON format conversion | Android 项目中需包含 `res/` 资源目录 | `android-project-path` (required), `harmonyos-project-path` (required), `resource_mapping_path` (required), `apk-path` (optional) | `"/hmos-resources-convert android-project-path=D:/path/to/android harmonyos-project-path=D:/path/to/harmonyos resource_mapping_path=D:/path/to/resource_mapping.md"` |
|
|
174
173
|
| `hmos-incremental-ui-align` | "UI对齐", "页面对齐", "和安卓对齐", "鸿蒙页面修复", "UI增量开发", "align HarmonyOS with Android" | Automated HarmonyOS-Android UI alignment: navigates to target pages on both devices, captures view trees + screenshots, then aligns HarmonyOS code to match Android | 需连接 Android 设备进行 UI 对比;`config-path` 指向的 `config.json` 中需配置项目路径、SDK 路径、API key | `config-path` (required) | `"/hmos-incremental-ui-align config-path=D:/path/to/config.json 帮我对齐设置页面的关于页面"` |
|
|
175
174
|
| `hmos-batch-ui-align` | "把安卓页面迁移到鸿蒙", "Android UI 转鸿蒙", "批量转 ArkTS" | Batch-converts multiple Android Activity UI snapshots (`page_NNNN_ActivityName`) to HarmonyOS ArkUI (ArkTS) pages | `ui_info_root` 下需包含 `page_NNNN_ActivityName` 格式的页面快照子目录 | `android_project_dir` (required), `harmony_project_dir` (required), `ui_info_root` (optional), `pages` (optional) | `"/hmos-batch-ui-align android_project_dir=D:/path/to/android harmony_project_dir=D:/path/to/harmonyos ui_info_root=D:/path/to/pages"` |
|
|
176
175
|
| `hmos-integration-test` | "跑自测", "运行自测", "自动测试", "设备测试", "self test", "run autotest" | Runs on-device self-test for a HarmonyOS app: parses `test_case.md`, installs the HAP, executes AutoTest, and produces a verification report — optionally entering a test-and-fix loop | 需存在 `test_case.md` 测试用例文件,设备需安装待测 HAP | `test-case-path` (required), `hap-path` (required), `output-path` (optional), `pre-test-case-path` (optional), `android-project-path` (optional), `max-rounds` (optional, default 3) | `"/hmos-integration-test test-case-path=D:/path/to/test_case.md hap-path=D:/path/to/app-signed.hap"` |
|
|
176
|
+
| `hmos-fix-build-errors` | "build HarmonyOS project", "fix compile errors", "auto build and fix", "hmos-fix-build-errors" | Builds a HarmonyOS NEXT project from the command line, parses compile errors, fixes them, and retries in a loop until the build succeeds. Default produces an unsigned HAP; `--signed` produces a signed HAP | 有效的 HarmonyOS 项目(含 `build-profile.json5`、`entry/src`、`oh-package.json5`)+ DevEco Studio 安装目录;`--signed` 时签名配置须已存在于 `build-profile.json5` | `harmonyos-project-path` (required), `deveco-studio-path` (required), `--signed` (optional) | `"/hmos-fix-build-errors D:/MyHmosApp \"D:/DevEco Studio\" --signed"` |
|
|
177
177
|
|
|
178
178
|
---
|
|
179
179
|
|
package/package.json
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@buaa_smat/hometrans",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "HomeTrans (Android-to-HarmonyOS) skill + agent installer. Run `ht init` to distribute conversion skills and subagents into AI editors.",
|
|
5
5
|
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://gitcode.com/SMAT/HomeTrans"
|
|
9
|
+
},
|
|
6
10
|
"type": "module",
|
|
7
11
|
"bin": {
|
|
8
12
|
"hometrans": "dist/cli/index.js",
|
|
@@ -12,7 +16,9 @@
|
|
|
12
16
|
"dist",
|
|
13
17
|
"skills",
|
|
14
18
|
"agents",
|
|
15
|
-
|
|
19
|
+
|
|
20
|
+
"tools",
|
|
21
|
+
"resource"
|
|
16
22
|
],
|
|
17
23
|
"scripts": {
|
|
18
24
|
"build": "node scripts/build.js",
|
|
Binary file
|
|
Binary file
|
|
@@ -20,10 +20,9 @@ Parse `$ARGUMENTS` as positional tokens:
|
|
|
20
20
|
- **Arg 3** (`assets-output-path`): Directory to store all output/report files (required)
|
|
21
21
|
- **Arg 4** (`max-rounds-review`): Maximum number of Stage 3→3a→3b code-review-fix rounds to run (optional, default `2`). Must be a positive integer `>= 1`.
|
|
22
22
|
- **Arg 5** (`max-rounds-test`): Maximum number of Stage 4→4a→4b self-test rounds to run (optional, default `2`). Must be a positive integer `>= 1`.
|
|
23
|
-
- **Arg 6** (`
|
|
24
|
-
- **Arg 7** (`skip-test`): `true` or `false` (optional, default `false`). When `true`, skip Stage 4 / 4a / 4b (Self-Testing Loop) entirely. Use this when no real HarmonyOS device is available for on-device testing. To pass this arg, provide explicit values for Args 4, 5, and 6 first.
|
|
23
|
+
- **Arg 6** (`skip-test`): `true` or `false` (optional, default `false`). When `true`, skip Stage 4 / 4a / 4b (Self-Testing Loop) entirely. Use this when no real HarmonyOS device is available for on-device testing. To pass this arg, provide explicit values for Args 4 and 5 first.
|
|
25
24
|
|
|
26
|
-
If any required argument is missing, ask the user before proceeding. If `max-rounds-review` or `max-rounds-test` is provided but is not a positive integer, ask the user before proceeding. If `
|
|
25
|
+
If any required argument is missing, ask the user before proceeding. If `max-rounds-review` or `max-rounds-test` is provided but is not a positive integer, ask the user before proceeding. If `skip-test` is provided but is not `true` or `false`, ask the user before proceeding.
|
|
27
26
|
|
|
28
27
|
Define shorthand variables for the instructions below:
|
|
29
28
|
|
|
@@ -34,7 +33,6 @@ Define shorthand variables for the instructions below:
|
|
|
34
33
|
| `OUTPUT` | assets-output-path (resolved or generated) |
|
|
35
34
|
| `MAX_ROUNDS_REVIEW` | max-rounds-review — positive integer (default `2`). Controls Stage 3→3a→3b code-review-fix loop. |
|
|
36
35
|
| `MAX_ROUNDS_TEST` | max-rounds-test — positive integer (default `2`). Controls Stage 4→4a→4b self-test loop. |
|
|
37
|
-
| `VARIANT` | variant — `enhanced` (default) or `baseline`. `baseline` switches Stage 1/1a to the minimal pure-LLM baseline agents. |
|
|
38
36
|
| `SKIP_TEST` | skip-test — `true` or `false` (default `false`). When `true`, skip Stage 4 / 4a / 4b entirely (no real device available). |
|
|
39
37
|
|
|
40
38
|
---
|
|
@@ -145,40 +143,26 @@ Flags: `skip-plan-builder: true|false` (default `false`) — when `true`, skip t
|
|
|
145
143
|
|
|
146
144
|
Prompt format (applies to both Stage 1 and Stage 1a): ONLY the key-value lines below. No natural language, step lists, or Markdown.
|
|
147
145
|
|
|
148
|
-
1. Launch the logic context builder agent
|
|
146
|
+
1. Launch the logic context builder agent:
|
|
149
147
|
```
|
|
150
|
-
# VARIANT=enhanced (default) — full agent
|
|
151
148
|
Agent(
|
|
152
149
|
subagent_type="logic-context-builder",
|
|
153
150
|
prompt="harmonyos-project-path: HMOS\nspec-file: OUTPUT/plan.md\noutput-path: OUTPUT/logic"
|
|
154
151
|
)
|
|
155
|
-
|
|
156
|
-
# VARIANT=baseline — pure-LLM baseline agent
|
|
157
|
-
Agent(
|
|
158
|
-
subagent_type="logic-context-builder-minimal",
|
|
159
|
-
prompt="harmonyos-project-path: HMOS\nspec-file: OUTPUT/plan.md\noutput-path: OUTPUT/logic"
|
|
160
|
-
)
|
|
161
152
|
```
|
|
162
153
|
2. Verify `OUTPUT/logic/plan.md` exists.
|
|
163
154
|
|
|
164
155
|
### Stage 1a — Logic Coding
|
|
165
156
|
|
|
166
|
-
1. Launch the logic coding agent
|
|
157
|
+
1. Launch the logic coding agent:
|
|
167
158
|
```
|
|
168
|
-
# VARIANT=enhanced (default) — full agent
|
|
169
159
|
Agent(
|
|
170
160
|
subagent_type="logic-coder",
|
|
171
161
|
prompt="harmonyos-project-path: HMOS\nplan-file: OUTPUT/logic/plan.md\noutput-path: OUTPUT/logic"
|
|
172
162
|
)
|
|
173
|
-
|
|
174
|
-
# VARIANT=baseline — pure-LLM baseline agent
|
|
175
|
-
Agent(
|
|
176
|
-
subagent_type="logic-coding-minimal",
|
|
177
|
-
prompt="harmonyos-project-path: HMOS\nplan-file: OUTPUT/logic/plan.md\noutput-path: OUTPUT/logic"
|
|
178
|
-
)
|
|
179
163
|
```
|
|
180
164
|
2. Copy `OUTPUT/logic/commit-info.md` → `OUTPUT/commit-info.md` and verify it contains a hex `commit-id`.
|
|
181
|
-
3. `OUTPUT/logic/coding-summary.md`
|
|
165
|
+
3. `OUTPUT/logic/coding-summary.md` is human-readable auxiliary; downstream stages consume only `OUTPUT/commit-info.md`.
|
|
182
166
|
|
|
183
167
|
### Stage 2 — Compilation and Build
|
|
184
168
|
|