@buaa_smat/hometrans 0.1.13 → 0.1.15

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.
Files changed (88) hide show
  1. package/README.md +194 -136
  2. package/agents/build-fixer.md +38 -48
  3. package/agents/code-reviewer.md +20 -20
  4. package/agents/logic-coder.md +8 -8
  5. package/agents/logic-context-builder.md +5 -5
  6. package/agents/review-fixer.md +16 -16
  7. package/agents/self-test-fixer.md +15 -15
  8. package/agents/self-tester.md +56 -55
  9. package/agents/spec-generator.md +16 -16
  10. package/dist/cli/config-store.js +120 -9
  11. package/dist/cli/config.js +4 -4
  12. package/dist/cli/env-vars.js +129 -0
  13. package/dist/cli/init.js +315 -276
  14. package/dist/cli/uninstall.js +152 -17
  15. package/dist/context/index.js +10 -197
  16. package/env-requirements.json +181 -181
  17. package/package.json +1 -1
  18. package/resource/choose_editor.png +0 -0
  19. package/resource/common_config.png +0 -0
  20. package/resource/integration_test_config.png +0 -0
  21. package/resource/migration_process.svg +94 -0
  22. package/resource/migration_process_transparent.svg +93 -0
  23. package/resource/set_env.png +0 -0
  24. package/resource/ui_align_config.png +0 -0
  25. package/skills/hmos-batch-ui-align/SKILL.md +10 -0
  26. package/skills/hmos-batch-ui-align/references/conversion-procedure.md +180 -180
  27. package/skills/hmos-batch-ui-align/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +2533 -2533
  28. package/skills/hmos-batch-ui-align/references/mappings/android-to-harmonyOS-ui-interaction-mapping-reference.md +555 -555
  29. package/skills/hmos-batch-ui-align/references/mappings/android-to-harmonyOS-ui-layout-mapping-reference.md +117 -117
  30. package/skills/hmos-batch-ui-align/references/mvvm/@Link/350/243/205/351/245/260/345/231/250/357/274/232/347/210/266/345/255/220/345/217/214/345/220/221/345/220/214/346/255/245.md +648 -648
  31. package/skills/hmos-batch-ui-align/references/mvvm/@Observed/350/243/205/351/245/260/345/231/250/345/222/214@ObjectLink/350/243/205/351/245/260/345/231/250/357/274/232/345/265/214/345/245/227/347/261/273/345/257/271/350/261/241/345/261/236/346/200/247/345/217/230/345/214/226.md +2088 -2088
  32. package/skills/hmos-batch-ui-align/references/mvvm/@Prop/350/243/205/351/245/260/345/231/250/357/274/232/347/210/266/345/255/220/345/215/225/345/220/221/345/220/214/346/255/245.md +1033 -1033
  33. package/skills/hmos-batch-ui-align/references/mvvm/@Provide/350/243/205/351/245/260/345/231/250/345/222/214@Consume/350/243/205/351/245/260/345/231/250/357/274/232/344/270/216/345/220/216/344/273/243/347/273/204/344/273/266/345/217/214/345/220/221/345/220/214/346/255/245.md +1183 -1183
  34. package/skills/hmos-batch-ui-align/references/mvvm/@State/350/243/205/351/245/260/345/231/250/357/274/232/347/273/204/344/273/266/345/206/205/347/212/266/346/200/201.md +576 -576
  35. package/skills/hmos-batch-ui-align/references/mvvm/@Track/350/243/205/351/245/260/345/231/250/357/274/232class/345/257/271/350/261/241/345/261/236/346/200/247/347/272/247/346/233/264/346/226/260.md +297 -297
  36. package/skills/hmos-batch-ui-align/references/mvvm/@Watch/350/243/205/351/245/260/345/231/250/357/274/232/347/212/266/346/200/201/345/217/230/351/207/217/346/233/264/346/224/271/351/200/232/347/237/245.md +395 -395
  37. package/skills/hmos-batch-ui-align/references/mvvm/AppStorage/357/274/232/345/272/224/347/224/250/345/205/250/345/261/200/347/232/204UI/347/212/266/346/200/201/345/255/230/345/202/250.md +902 -902
  38. package/skills/hmos-batch-ui-align/references/mvvm/Environment/357/274/232/350/256/276/345/244/207/347/216/257/345/242/203/346/237/245/350/257/242.md +106 -106
  39. package/skills/hmos-batch-ui-align/references/mvvm/LocalStorage/357/274/232/351/241/265/351/235/242/347/272/247UI/347/212/266/346/200/201/345/255/230/345/202/250.md +1178 -1178
  40. package/skills/hmos-batch-ui-align/references/mvvm/MVVM/346/250/241/345/274/217/357/274/210V1/357/274/211.md +911 -911
  41. package/skills/hmos-batch-ui-align/references/mvvm/PersistentStorage/357/274/232/346/214/201/344/271/205/345/214/226/345/255/230/345/202/250UI/347/212/266/346/200/201.md +354 -354
  42. package/skills/hmos-batch-ui-align/references/mvvm//347/256/241/347/220/206/345/272/224/347/224/250/346/213/245/346/234/211/347/232/204/347/212/266/346/200/201/346/246/202/350/277/260.md +11 -11
  43. package/skills/hmos-convert-pipeline/SKILL.md +63 -49
  44. package/skills/hmos-fix-build-errors/SKILL.md +5 -6
  45. package/skills/hmos-fix-build-errors/references/arkts-strict-patterns.md +219 -219
  46. package/skills/hmos-fix-build-errors/references/known-patterns.md +157 -157
  47. package/skills/hmos-fix-build-errors/references/rdb-entity-pattern.md +131 -131
  48. package/skills/hmos-incremental-ui-align/{readme.md → README.md} +28 -21
  49. package/skills/hmos-incremental-ui-align/SKILL.md +46 -27
  50. package/skills/hmos-incremental-ui-align/diff_analysis.md +52 -52
  51. package/skills/hmos-incremental-ui-align/page_align.md +62 -62
  52. package/skills/hmos-incremental-ui-align/references/Comparison_Template.md +2 -2
  53. package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@Link/350/243/205/351/245/260/345/231/250/357/274/232/347/210/266/345/255/220/345/217/214/345/220/221/345/220/214/346/255/245.md +648 -648
  54. package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@Observed/350/243/205/351/245/260/345/231/250/345/222/214@ObjectLink/350/243/205/351/245/260/345/231/250/357/274/232/345/265/214/345/245/227/347/261/273/345/257/271/350/261/241/345/261/236/346/200/247/345/217/230/345/214/226.md +2088 -2088
  55. package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@Prop/350/243/205/351/245/260/345/231/250/357/274/232/347/210/266/345/255/220/345/215/225/345/220/221/345/220/214/346/255/245.md +1033 -1033
  56. package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@Provide/350/243/205/351/245/260/345/231/250/345/222/214@Consume/350/243/205/351/245/260/345/231/250/357/274/232/344/270/216/345/220/216/344/273/243/347/273/204/344/273/266/345/217/214/345/220/221/345/220/214/346/255/245.md +1183 -1183
  57. package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@State/350/243/205/351/245/260/345/231/250/357/274/232/347/273/204/344/273/266/345/206/205/347/212/266/346/200/201.md +576 -576
  58. package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@Track/350/243/205/351/245/260/345/231/250/357/274/232class/345/257/271/350/261/241/345/261/236/346/200/247/347/272/247/346/233/264/346/226/260.md +297 -297
  59. package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@Watch/350/243/205/351/245/260/345/231/250/357/274/232/347/212/266/346/200/201/345/217/230/351/207/217/346/233/264/346/224/271/351/200/232/347/237/245.md +395 -395
  60. package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/AppStorage/357/274/232/345/272/224/347/224/250/345/205/250/345/261/200/347/232/204UI/347/212/266/346/200/201/345/255/230/345/202/250.md +902 -902
  61. package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/Environment/357/274/232/350/256/276/345/244/207/347/216/257/345/242/203/346/237/245/350/257/242.md +106 -106
  62. package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/LocalStorage/357/274/232/351/241/265/351/235/242/347/272/247UI/347/212/266/346/200/201/345/255/230/345/202/250.md +1178 -1178
  63. 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/217V1.md +911 -911
  64. package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/PersistentStorage/357/274/232/346/214/201/344/271/205/345/214/226/345/255/230/345/202/250UI/347/212/266/346/200/201.md +354 -354
  65. package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243//347/256/241/347/220/206/345/272/224/347/224/250/346/213/245/346/234/211/347/232/204/347/212/266/346/200/201/346/246/202/350/277/260.md +11 -11
  66. package/skills/hmos-incremental-ui-align/references/UI_Analysis_Template.md +3 -3
  67. package/skills/hmos-incremental-ui-align/references/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +2533 -2533
  68. package/skills/hmos-incremental-ui-align/references/android-to-harmonyOS-ui-interaction-mapping-reference.md +555 -555
  69. package/skills/hmos-incremental-ui-align/references/android-to-harmonyOS-ui-layout-mapping-reference.md +117 -117
  70. package/skills/hmos-incremental-ui-align/scripts/navigation-capure.md +37 -37
  71. package/skills/hmos-integration-test/{readme.md → README.md} +38 -38
  72. package/skills/hmos-integration-test/SKILL.md +63 -52
  73. package/skills/hmos-resources-convert/SKILL.md +5 -5
  74. package/skills/hmos-resources-convert/references/conversion-rules.md +663 -663
  75. package/skills/hmos-resources-convert/references/dependency-analysis-rules.md +388 -388
  76. package/skills/hmos-resources-convert/references/resource-mapping-rules.md +457 -457
  77. package/skills/hmos-resources-convert/references/xml-drawable-to-svg-rules.md +513 -513
  78. package/skills/hmos-spec-generate/SKILL.md +19 -19
  79. package/skills/hmos-spec-generate/references/android-platform-tokens.md +105 -105
  80. package/skills/hmos-spec-generate/references/spec-sample-1.md +78 -78
  81. package/skills/hmos-spec-generate/references/spec-sample-2.md +58 -58
  82. package/skills/hmos-spec-generate/references/spec-sample-3.md +116 -116
  83. package/skills/hmos-spec-generate/references/step4-report-template.md +33 -33
  84. package/tools/test-tools/autotest/README.md +33 -17
  85. package/tools/test-tools/autotest/self_test_runner.py +109 -15
  86. package/resource/hometrans_config.png +0 -0
  87. package/skills/hmos-incremental-ui-align/config-example.json +0 -11
  88. package/tools/test-tools/autotest/config.yaml.example +0 -58
@@ -14,8 +14,8 @@ Execute a build-fix loop: resolve environment → validate project → build →
14
14
 
15
15
  ## Expected Input
16
16
 
17
- - `harmonyos-project-path`: Absolute path to the HarmonyOS project root (the directory containing `build-profile.json5`) — **required**
18
- - `output-path`: Absolute path to the directory where `build-fix-report.md` should be written — **optional** (defaults to cwd)
17
+ - `harmony_project_dir`: Absolute path to the HarmonyOS project root (the directory containing `build-profile.json5`) — **required**
18
+ - `output_path`: Absolute path to the directory where `build-fix-report.md` should be written — **optional** (defaults to cwd)
19
19
  - `--signed`: Optional flag. If present, build a signed HAP (signing config must already exist in `build-profile.json5`). Default is unsigned.
20
20
 
21
21
  ## Expected Output
@@ -29,34 +29,24 @@ Execute a build-fix loop: resolve environment → validate project → build →
29
29
 
30
30
  The build requires the **DevEco Studio installation path**, from which Node.js, hvigor, and ohpm are derived.
31
31
 
32
- ### 0a. Read the HomeTrans config
33
-
34
- Read the config file written by `ht init` at `~/.hometrans/config.json` (`$HOME/.hometrans/config.json`; on Windows `%USERPROFILE%\.hometrans\config.json`). Its shape is:
35
-
36
- ```jsonc
37
- {
38
- "editors": [ /* ... */ ],
39
- "env": {
40
- "DEVECO_SDK_HOME": "...", // DevEco sdk dir, e.g. "D:/DevEco Studio/sdk" — single source of truth
41
- "DEVECO_PATH": "...", // DevEco install root, e.g. "D:/DevEco Studio" (derived from DEVECO_SDK_HOME)
42
- "OHOS_SDK_PATH": "...", // <DEVECO_SDK_HOME>/default/openharmony/ets (derived)
43
- "HMS_SDK_PATH": "...", // <DEVECO_SDK_HOME>/default/hms/ets (derived)
44
- "TEST_API_KEY": "...",
45
- "TOOL_PATH": "..." // HomeTrans tools dir, e.g. "C:/Users/<you>/.hometrans/tools"
46
- }
47
- }
48
- ```
32
+ ### 0a. Read the DevEco environment variables
33
+
34
+ Read these **directly from the OS environment** `ht init` persists them as machine environment variables (`echo "$VAR"` on macOS/Linux; `$env:VAR` in PowerShell on Windows):
35
+
36
+ | Variable | Meaning |
37
+ |---|---|
38
+ | `DEVECO_SDK_HOME` | DevEco sdk dir, e.g. `D:/DevEco Studio/sdk` — single source of truth |
39
+ | `DEVECO_HOME` | DevEco install root, e.g. `D:/DevEco Studio` |
40
+ | `OHOS_SDK_PATH` | `<DEVECO_SDK_HOME>/default/openharmony/ets` |
41
+ | `HMS_SDK_PATH` | `<DEVECO_SDK_HOME>/default/hms/ets` |
49
42
 
50
- ### 0b. Resolve the DevEco root `<deveco>` — config first, then env vars, then ask
43
+ ### 0b. Resolve the DevEco root `<deveco>` — env vars first, then auto-detect, then ask
51
44
 
52
45
  Stop at the **first** source that yields a path:
53
46
 
54
- 1. **Config file** (`~/.hometrans/config.json`):
55
- - `env.DEVECO_PATH` if non-empty that is `<deveco>`.
56
- - else `env.DEVECO_SDK_HOME` `<deveco>` is its **parent directory**.
57
- - else (legacy configs) strip the trailing `/sdk/default/openharmony/ets` from `env.OHOS_SDK_PATH` (or `/sdk/default/hms/ets` from `env.HMS_SDK_PATH`) to get `<deveco>`.
58
- 2. **Environment variables** (same precedence): `DEVECO_PATH` → `DEVECO_SDK_HOME` (parent dir) → `OHOS_SDK_PATH` / `HMS_SDK_PATH` (strip suffix as above).
59
- 3. **Auto-detect** (0c below). If that also fails, **ask the user** for the DevEco Studio install path.
47
+ 1. **Environment variables**: `DEVECO_HOME` if non-empty → that is `<deveco>`; else `DEVECO_SDK_HOME` → `<deveco>` is its **parent directory**; else (legacy) strip the trailing `/sdk/default/openharmony/ets` from `OHOS_SDK_PATH` (or `/sdk/default/hms/ets` from `HMS_SDK_PATH`) to get `<deveco>`.
48
+ 2. **Auto-detect** (0c below).
49
+ 3. If both fail, **ask the user** for the DevEco Studio install path (suggest running `ht init` to persist it as an environment variable).
60
50
 
61
51
  > Example: `DEVECO_SDK_HOME = D:/DevEco Studio/sdk` → `<deveco> = D:/DevEco Studio`.
62
52
 
@@ -66,11 +56,11 @@ From `<deveco>`, derive:
66
56
  - **ohpm**: `<deveco>/tools/ohpm/bin/ohpm`
67
57
  - **SDK directory**: `<deveco>/sdk`
68
58
 
69
- Verify these files exist. If they do, use them and skip auto-detection. If a config-sourced path does **not** exist on disk, treat that source as invalid and continue down the resolution order.
59
+ Verify these files exist. If they do, use them and skip auto-detection. If an env-sourced path does **not** exist on disk, treat that source as invalid and continue down the resolution order.
70
60
 
71
- ### 0c. Auto-detect if config and env vars are missing or invalid
61
+ ### 0c. Auto-detect if env vars are missing or invalid
72
62
 
73
- If neither the config file nor environment variables yield a valid install, auto-detect:
63
+ If the environment variables do not yield a valid install, auto-detect:
74
64
 
75
65
  1. **Find DevEco Studio installation**:
76
66
  - Search common locations: `D:\DevEco Studio`, `C:\DevEco Studio`, `C:\Program Files\DevEco Studio`
@@ -86,7 +76,7 @@ If auto-detection fails for any critical path, **ask the user directly** for the
86
76
  ### 0d. Store resolved paths
87
77
 
88
78
  Keep these resolved values for use in later steps:
89
- - `DEVECO_PATH` — absolute path to DevEco Studio installation root
79
+ - `DEVECO_HOME` — absolute path to DevEco Studio installation root
90
80
  - `NODE_EXE` — absolute path to node executable
91
81
  - `HVIGORW_JS` — absolute path to hvigorw.js
92
82
  - `OHPM` — absolute path to ohpm executable
@@ -95,14 +85,14 @@ Keep these resolved values for use in later steps:
95
85
 
96
86
  ## Step 1: Validate Inputs & Setup Project
97
87
 
98
- 1. **Verify project exists** — Check that `harmonyos-project-path` contains:
88
+ 1. **Verify project exists** — Check that `harmony_project_dir` contains:
99
89
  - `build-profile.json5`
100
90
  - `entry/src` directory
101
91
  - `oh-package.json5`
102
92
 
103
93
  2. **Set up `local.properties`** — Ensure the project root has `local.properties` with:
104
94
  ```properties
105
- hwsdk.dir=<DEVECO_PATH>/sdk
95
+ hwsdk.dir=<DEVECO_HOME>/sdk
106
96
  ```
107
97
  Create it if missing. Use forward slashes in the path.
108
98
 
@@ -152,19 +142,19 @@ Execute the following loop. **Maximum 20 iterations** to prevent infinite loops.
152
142
  **For unsigned builds** (no `--signed`):
153
143
  ```bat
154
144
  @echo off
155
- set "DEVECO_SDK_HOME=<DEVECO_PATH>\sdk"
145
+ set "DEVECO_SDK_HOME=<DEVECO_HOME>\sdk"
156
146
  cd /d "<project-dir>"
157
- "<DEVECO_PATH>\tools\node\node.exe" "<DEVECO_PATH>\tools\hvigor\bin\hvigorw.js" assembleHap --mode module -p module=entry --no-daemon
147
+ "<DEVECO_HOME>\tools\node\node.exe" "<DEVECO_HOME>\tools\hvigor\bin\hvigorw.js" assembleHap --mode module -p module=entry --no-daemon
158
148
  ```
159
149
 
160
150
  **For signed builds** (`--signed`):
161
151
  ```bat
162
152
  @echo off
163
- set "PATH=<DEVECO_PATH>\jbr\bin;%PATH%"
164
- set "JAVA_HOME=<DEVECO_PATH>\jbr"
165
- set "DEVECO_SDK_HOME=<DEVECO_PATH>\sdk"
153
+ set "PATH=<DEVECO_HOME>\jbr\bin;%PATH%"
154
+ set "JAVA_HOME=<DEVECO_HOME>\jbr"
155
+ set "DEVECO_SDK_HOME=<DEVECO_HOME>\sdk"
166
156
  cd /d "<project-dir>"
167
- "<DEVECO_PATH>\tools\node\node.exe" "<DEVECO_PATH>\tools\hvigor\bin\hvigorw.js" assembleHap --mode module -p module=entry --no-daemon
157
+ "<DEVECO_HOME>\tools\node\node.exe" "<DEVECO_HOME>\tools\hvigor\bin\hvigorw.js" assembleHap --mode module -p module=entry --no-daemon
168
158
  ```
169
159
  Note: Signed builds need `JAVA_HOME` and `jbr\bin` in PATH because the `SignHap` step spawns `java` as a child process.
170
160
 
@@ -238,16 +228,16 @@ Then go back to **2.1** and rebuild.
238
228
 
239
229
  ## Step 2.6: Copy HAP to Output Directory
240
230
 
241
- If `output-path` was provided, copy the built HAP file to the output directory after a successful build:
231
+ If `output_path` was provided, copy the built HAP file to the output directory after a successful build:
242
232
 
243
233
  1. **Locate the HAP file** under `<project-dir>/entry/build/default/outputs/default/`:
244
234
  - If `--signed`: search for `*-signed.hap`
245
235
  - If unsigned (no `--signed`): search for `*-unsigned.hap`
246
236
  2. **Copy** the HAP to the output directory:
247
237
  ```bash
248
- cp "<hap-path>" "<output-path>/"
238
+ cp "<hap_path>" "<output_path>/"
249
239
  ```
250
- 3. **Verify** the copied file exists in `output-path`.
240
+ 3. **Verify** the copied file exists in `output_path`.
251
241
  4. If no matching HAP is found, report the issue in `build-fix-report.md` and note the expected path.
252
242
 
253
243
  ---
@@ -297,25 +287,25 @@ Files modified: {comma-separated list of modified files}
297
287
  cd "<project-dir>" && git rev-parse HEAD
298
288
  ```
299
289
 
300
- 4. **Write commit info** to `<output-path>/build-fix-commit-info.md`:
290
+ 4. **Write commit info** to `<output_path>/build-fix-commit-info.md`:
301
291
  ```
302
- commit-id: <commit-id>
292
+ commit_id: <commit_id>
303
293
  ```
304
294
 
305
295
  **If no source files were modified** (build succeeded on first attempt with zero errors):
306
- - Write `<output-path>/build-fix-commit-info.md` with:
296
+ - Write `<output_path>/build-fix-commit-info.md` with:
307
297
  ```
308
- commit-id: none
298
+ commit_id: none
309
299
  ```
310
300
 
311
301
  **If not in a git repository**:
312
302
  - Record issue "Not a git repository — skipped commit" in `build-fix-report.md`.
313
- - Write `<output-path>/build-fix-commit-info.md` with:
303
+ - Write `<output_path>/build-fix-commit-info.md` with:
314
304
  ```
315
- commit-id: none
305
+ commit_id: none
316
306
  ```
317
307
 
318
- **If `output-path` was not provided**, skip writing `build-fix-commit-info.md`.
308
+ **If `output_path` was not provided**, skip writing `build-fix-commit-info.md`.
319
309
 
320
310
  ---
321
311
 
@@ -14,14 +14,14 @@ Read the user scenario design document, then systematically verify the HarmonyOS
14
14
 
15
15
  ## Expected Input
16
16
 
17
- - `harmonyos-project-path`: Absolute path to the HarmonyOS project root (directory containing ArkTS source code)
18
- - `commit-id`: The commit ID of the code submission to review (required)
19
- - `output-path`: Absolute path to the directory where the review report should be written (required)
20
- - `test-case-path`: Absolute path to the user scenario design document. If not provided, defaults to `<output-path>/test_case.md`
17
+ - `harmony_project_dir`: Absolute path to the HarmonyOS project root (directory containing ArkTS source code)
18
+ - `commit_id`: The commit ID of the code submission to review (required)
19
+ - `output_path`: Absolute path to the directory where the review report should be written (required)
20
+ - `test_case_path`: Absolute path to the user scenario design document. If not provided, defaults to `<output_path>/test_case.md`
21
21
 
22
22
  ## Expected Output
23
23
 
24
- - A file named `code-review-report.md` in `output-path`
24
+ - A file named `code-review-report.md` in `output_path`
25
25
 
26
26
  ---
27
27
 
@@ -30,19 +30,19 @@ Read the user scenario design document, then systematically verify the HarmonyOS
30
30
  Before starting the review, extract the code context for the commit via the `extract_commit_context` MCP tool.
31
31
 
32
32
  1. **Call the MCP tool** `extract_commit_context` with:
33
- - `projectPath`: `<harmonyos-project-path>` (absolute path to the HarmonyOS project root containing the `.git` directory)
34
- - `commitId`: `<commit-id>` (the git commit to analyze — diffs against its first parent)
33
+ - `projectPath`: `<harmony_project_dir>` (absolute path to the HarmonyOS project root containing the `.git` directory)
34
+ - `commitId`: `<commit_id>` (the git commit to analyze — diffs against its first parent)
35
35
  - `mode`: `"default"` (builds full call graph for call-chain context)
36
- - `ohosSdkPath` / `hmsSdkPath`: the OpenHarmony / HMS SDK ETS directory paths. Resolve each in this order, stop at the first hit:
37
- 1. `env.OHOS_SDK_PATH` / `env.HMS_SDK_PATH` from `~/.hometrans/config.json` (on Windows `%USERPROFILE%\.hometrans\config.json`); if those are empty but `env.DEVECO_SDK_HOME` is set, derive them as `<DEVECO_SDK_HOME>/default/openharmony/ets` and `<DEVECO_SDK_HOME>/default/hms/ets`.
38
- 2. Omit the parameter to let the tool read `OHOS_SDK_PATH` / `HMS_SDK_PATH` from the environment variables.
39
- 3. If neither config nor environment provides a path that exists on disk, **ask the user** for the DevEco `sdk` directory (and suggest `ht init` to persist it).
36
+ - `ohosSdkPath` / `hmsSdkPath`: the OpenHarmony / HMS SDK ETS directory paths. Resolve each **from the OS environment**, stopping at the first hit:
37
+ 1. `OHOS_SDK_PATH` / `HMS_SDK_PATH` environment variables; if those are empty but `DEVECO_SDK_HOME` is set, derive them as `<DEVECO_SDK_HOME>/default/openharmony/ets` and `<DEVECO_SDK_HOME>/default/hms/ets`.
38
+ 2. Omit the parameter to let the tool read `OHOS_SDK_PATH` / `HMS_SDK_PATH` from the environment itself.
39
+ 3. If the environment provides no path that exists on disk, **ask the user** for the DevEco `sdk` directory (and suggest running `ht init` to persist it as an environment variable).
40
40
 
41
41
  2. **On success** — the tool returns the affected code context (diffs, call graphs, impacted files). Treat this response as the **code context** for the review.
42
42
 
43
43
  3. **On failure** — if the MCP tool call fails (network error, tool unavailable, or returns an error), fall back to direct commit analysis:
44
- - Run `git diff <commit-id>^..<commit-id>` in `<harmonyos-project-path>` to obtain the raw diff.
45
- - Run `git show --stat <commit-id>` to list affected files.
44
+ - Run `git diff <commit_id>^..<commit_id>` in `<harmony_project_dir>` to obtain the raw diff.
45
+ - Run `git show --stat <commit_id>` to list affected files.
46
46
  - Read the changed files directly from the project to build the code context manually.
47
47
  - Proceed with the review using this manually assembled context — do not stop.
48
48
 
@@ -52,15 +52,15 @@ Before starting the review, extract the code context for the commit via the `ext
52
52
 
53
53
  0. **Resolve document paths**:
54
54
 
55
- - If `test-case-path` is not provided, use `<output-path>/test_case.md`
55
+ - If `test_case_path` is not provided, use `<output_path>/test_case.md`
56
56
 
57
57
  1. **Read the code context** (from Step 0):
58
58
  - Parse the code context returned by the MCP tool (or the manually assembled fallback)
59
- - This contains the diff and relevant code context for commit `commit-id`
59
+ - This contains the diff and relevant code context for commit `commit_id`
60
60
  - Understand the scope of changes: which files were modified, added, or deleted
61
61
  - Build a map of the changed code areas — these are the primary focus of the review
62
62
 
63
- 3. **Read the user scenario design document** (`test-case-path`):
63
+ 3. **Read the user scenario design document** (`test_case_path`):
64
64
 
65
65
  - Extract every user scenario / user story / use case described
66
66
  - For each scenario, identify:
@@ -82,7 +82,7 @@ Before starting the review, extract the code context for the commit via the `ext
82
82
  Review the code based on the extracted code context (from the MCP tool or fallback) combined with the broader project structure:
83
83
 
84
84
  1. **Code context analysis** (primary focus): Analyze the extracted code context to understand:
85
- - Which files were changed in commit `commit-id`
85
+ - Which files were changed in commit `commit_id`
86
86
  - The specific diffs and surrounding code for each changed file
87
87
  - The intent and scope of the changes relative to the commit
88
88
 
@@ -152,7 +152,7 @@ After per-scenario review, check these cross-cutting concerns that affect multip
152
152
 
153
153
  ## Step 5 — Write `code-review-report.md`
154
154
 
155
- Write the report to `output-path/code-review-report.md` with the following structure:
155
+ Write the report to `output_path/code-review-report.md` with the following structure:
156
156
 
157
157
  ```markdown
158
158
  # Code Review Report
@@ -160,8 +160,8 @@ Write the report to `output-path/code-review-report.md` with the following struc
160
160
  ## Overview
161
161
 
162
162
  - **Project**: <project name/path>
163
- - **Commit ID**: <commit-id>
164
- - **Scenario Doc**: <test-case-path>
163
+ - **Commit ID**: <commit_id>
164
+ - **Scenario Doc**: <test_case_path>
165
165
  - **Code Context**: extract_commit_context MCP tool (or git-diff fallback)
166
166
  - **Review Date**: <date>
167
167
  - **Total Scenarios**: <N>
@@ -7,10 +7,10 @@ min-model: sonnet
7
7
 
8
8
  ## Inputs
9
9
 
10
- - `plan-file` = `{output_path}/plan.md`
11
- - `harmonyos-project-path` (abs)
12
- - `output-path` (abs)
13
- - `plugin-path` (abs) — plugin root; `{scripts}` = `{plugin-path}/agents/logic-coder/scripts/`
10
+ - `plan_file` = `{output_path}/plan.md`
11
+ - `harmony_project_dir` (abs)
12
+ - `output_path` (abs)
13
+ - `plugin_path` (abs) — plugin root; `{scripts}` = `{plugin_path}/agents/logic-coder/scripts/`
14
14
 
15
15
  ## Tools
16
16
 
@@ -38,15 +38,15 @@ blocked, write the gap instead of fake completion.
38
38
 
39
39
  ## Procedure
40
40
 
41
- 1. Read `plan-file` first.
42
- 2. If runtime provides checked constraints, read them after `plan-file`; they
41
+ 1. Read `plan_file` first.
42
+ 2. If runtime provides checked constraints, read them after `plan_file`; they
43
43
  narrow unsafe choices but do not broaden plan scope.
44
44
  3. Verify local facts (per Verification, in stated order).
45
45
  4. Patch only plan-required behavior.
46
46
  5. Validate (per Validate And Output). Stage only plan-required files; do not
47
47
  use `git add -A`.
48
48
  6. Commit with a non-interactive message naming the decision contract.
49
- 7. Write `{output_path}/commit-info.md` with `commit-id: <full hash>`.
49
+ 7. Write `{output_path}/commit-info.md` with `commit_id: <full hash>`.
50
50
  8. Write `{output_path}/issues.md` only for blocking `Unknown`,
51
51
  repo-vs-plan contradiction, platform drift, missing proof, or validation
52
52
  failure.
@@ -55,7 +55,7 @@ Never ask. Never commit outside plan scope.
55
55
 
56
56
  ## Read Scope
57
57
 
58
- After `plan-file`, read only plan-named files, direct imports/exports, needed
58
+ After `plan_file`, read only plan-named files, direct imports/exports, needed
59
59
  symbol/type definitions, current producer/owner/consumer/target display,
60
60
  same-pattern local code, build-error files, and plan-named platform evidence.
61
61
 
@@ -7,10 +7,10 @@ min-model: sonnet
7
7
 
8
8
  ## Inputs
9
9
 
10
- - `spec-file` (abs)
11
- - `harmonyos-project-path` (abs)
12
- - `output-path` (abs)
13
- - `plugin-path` (abs) — plugin root; `{scripts}` = `{plugin-path}/agents/logic-coder/scripts/`
10
+ - `spec_file` (abs)
11
+ - `harmony_project_dir` (abs)
12
+ - `output_path` (abs)
13
+ - `plugin_path` (abs) — plugin root; `{scripts}` = `{plugin_path}/agents/logic-coder/scripts/`
14
14
 
15
15
  ## Tools
16
16
 
@@ -66,7 +66,7 @@ chooses."
66
66
  Evidence priority: visible/resource text > render/caller path >
67
67
  producer/consumer > route/menu > file/class names. Reject name-only/comment-only.
68
68
 
69
- 1. Read `spec-file`. Extract SPEC anchors: visible text/resources, route/menu,
69
+ 1. Read `spec_file`. Extract SPEC anchors: visible text/resources, route/menu,
70
70
  UI section, component/builder, entity/field/action, acceptance, non-goals.
71
71
  2. Reason internally until a chain node needs a concrete fact.
72
72
  3. Narrow chain nodes by project and platform evidence. Write plan.md.
@@ -18,10 +18,10 @@ Read a code-review report (`code-review-report.md`), double-check every reported
18
18
 
19
19
  ## Expected Input
20
20
 
21
- - `review-report-path`: Path to the code-review report file (`.md`) — **required**
22
- - `harmonyos-project-path`: Path to the HarmonyOS project root — **required**
23
- - `android-project-path`: Path to the Android source project — **optional** (enables reference-based fixing)
24
- - `output-path`: Directory to store `review-fix-report.md` — **optional** (defaults to cwd)
21
+ - `review_report_path`: Path to the code-review report file (`.md`) — **required**
22
+ - `harmony_project_dir`: Path to the HarmonyOS project root — **required**
23
+ - `android_project_dir`: Path to the Android source project — **optional** (enables reference-based fixing)
24
+ - `output_path`: Directory to store `review-fix-report.md` — **optional** (defaults to cwd)
25
25
 
26
26
  ## Expected Output
27
27
 
@@ -134,7 +134,7 @@ For each **CONFIRMED** issue, apply the appropriate fix strategy based on the is
134
134
 
135
135
  **When**: A page or component referenced by a scenario does not exist.
136
136
 
137
- 1. **Read the Android source** (if `android-project-path` is provided):
137
+ 1. **Read the Android source** (if `android_project_dir` is provided):
138
138
  - Find the corresponding Android Activity/Fragment/View.
139
139
  - Document: layout structure, event handlers, data sources, navigation targets.
140
140
  2. **Use Context7 MCP tool** to look up the HarmonyOS equivalent UI components (e.g., `Grid` for `RecyclerView`, `List` for `ListView`).
@@ -216,7 +216,7 @@ For each **CONFIRMED** issue, apply the appropriate fix strategy based on the is
216
216
 
217
217
  After completing fixes for a group of related issues (e.g., all issues in one scenario, or all permission issues), verify the project still compiles:
218
218
 
219
- 1. Launch the **build-fixer** agent with `harmonyos-project-path` and `output-path`.
219
+ 1. Launch the **build-fixer** agent with `harmony_project_dir` and `output_path`.
220
220
  2. If compilation fails, the build-fixer agent will auto-fix compile errors — this does **not** count as an effective attempt.
221
221
  3. If compilation succeeds, proceed to the next group of issues.
222
222
  4. If compilation cannot be fixed after build-fixer's attempts, **revert the most recent changes** for that group and record the issue as "failed to fix — compilation error".
@@ -239,9 +239,9 @@ After processing all issues, write `review-fix-report.md` to the output director
239
239
 
240
240
  ## Overview
241
241
 
242
- - **Review Report**: <review-report-path>
243
- - **HarmonyOS Project**: <harmonyos-project-path>
244
- - **Android Source**: <android-project-path or "not provided">
242
+ - **Review Report**: <review_report_path>
243
+ - **HarmonyOS Project**: <harmony_project_dir>
244
+ - **Android Source**: <android_project_dir or "not provided">
245
245
  - **Fix Date**: <date>
246
246
  - **Total Issues in Report**: <N>
247
247
  - **Verified (CONFIRMED)**: <X>
@@ -368,25 +368,25 @@ Confirmed: {X}, Fixed: {A}, False positives: {Y}
368
368
  cd "<project-dir>" && git rev-parse HEAD
369
369
  ```
370
370
 
371
- 4. **Write commit info** to `<output-path>/review-fix-commit-info.md`:
371
+ 4. **Write commit info** to `<output_path>/review-fix-commit-info.md`:
372
372
  ```
373
- commit-id: <commit-id>
373
+ commit_id: <commit_id>
374
374
  ```
375
375
 
376
376
  **If no files were modified** (all issues were false positives or all fix attempts failed):
377
- - Write `<output-path>/review-fix-commit-info.md` with:
377
+ - Write `<output_path>/review-fix-commit-info.md` with:
378
378
  ```
379
- commit-id: none
379
+ commit_id: none
380
380
  ```
381
381
 
382
382
  **If not in a git repository**:
383
383
  - Record issue "Not a git repository — skipped commit" in `review-fix-report.md`.
384
- - Write `<output-path>/review-fix-commit-info.md` with:
384
+ - Write `<output_path>/review-fix-commit-info.md` with:
385
385
  ```
386
- commit-id: none
386
+ commit_id: none
387
387
  ```
388
388
 
389
- **If `output-path` was not provided**, skip writing `review-fix-commit-info.md`.
389
+ **If `output_path` was not provided**, skip writing `review-fix-commit-info.md`.
390
390
 
391
391
  ---
392
392
 
@@ -14,10 +14,10 @@ Read a self-test report (`self-test-report.md`), extract all failed scenarios, w
14
14
 
15
15
  ## Expected Input
16
16
 
17
- - `self-test-report-path`: Path to the self-test report file (`.md`) — **required**
18
- - `harmonyos-project-path`: Path to the HarmonyOS project root — **required**
19
- - `android-project-path`: Path to the Android source project — **optional** (enables reference-based fixing)
20
- - `output-path`: Directory to store `self-test-fix-report.md` — **optional** (defaults to cwd)
17
+ - `self_test_report_path`: Path to the self-test report file (`.md`) — **required**
18
+ - `harmony_project_dir`: Path to the HarmonyOS project root — **required**
19
+ - `android_project_dir`: Path to the Android source project — **optional** (enables reference-based fixing)
20
+ - `output_path`: Directory to store `self-test-fix-report.md` — **optional** (defaults to cwd)
21
21
 
22
22
  ## Expected Output
23
23
 
@@ -28,7 +28,7 @@ Read a self-test report (`self-test-report.md`), extract all failed scenarios, w
28
28
 
29
29
  ## Step 1 — Read Report and Extract Failed Scenarios
30
30
 
31
- Read the self-test report file at `self-test-report-path`. **Do not assume any fixed format** — understand the report structure by reading it, then extract all scenarios that are marked as failed / not passed / unsuccessful.
31
+ Read the self-test report file at `self_test_report_path`. **Do not assume any fixed format** — understand the report structure by reading it, then extract all scenarios that are marked as failed / not passed / unsuccessful.
32
32
 
33
33
  For each failed scenario, record whatever information is available:
34
34
 
@@ -102,7 +102,7 @@ Before modifying any code, analyze all `confirmed` failures together and create
102
102
 
103
103
  For each fix item in the plan:
104
104
 
105
- 1. **Reference Android implementation** (if `android-project-path` is provided):
105
+ 1. **Reference Android implementation** (if `android_project_dir` is provided):
106
106
  - Search the Android source for the corresponding feature
107
107
  - Understand: entry point, event handling, business logic, persistence, UI feedback
108
108
  - Use the Android behavior as the specification for the fix
@@ -126,7 +126,7 @@ For each fix item in the plan:
126
126
 
127
127
  After **all** fix items are complete, launch the **build-fixer** agent **once** to verify compilation:
128
128
 
129
- - Pass `harmonyos-project-path` and `output-path` to the build-fixer agent
129
+ - Pass `harmony_project_dir` and `output_path` to the build-fixer agent
130
130
  - If compilation fails, build-fixer will auto-fix compile errors
131
131
  - Compilation issues do NOT count as effective fix attempts
132
132
 
@@ -159,25 +159,25 @@ Fixed: {N}/{M} failed scenarios
159
159
  cd "<project-dir>" && git rev-parse HEAD
160
160
  ```
161
161
 
162
- 4. **Write commit info** to `<output-path>/self-test-fix-commit-info.md`:
162
+ 4. **Write commit info** to `<output_path>/self-test-fix-commit-info.md`:
163
163
  ```
164
- commit-id: <commit-id>
164
+ commit_id: <commit_id>
165
165
  ```
166
166
 
167
167
  **If no files were modified** (all failures were false positives):
168
- - Write `<output-path>/self-test-fix-commit-info.md` with:
168
+ - Write `<output_path>/self-test-fix-commit-info.md` with:
169
169
  ```
170
- commit-id: none
170
+ commit_id: none
171
171
  ```
172
172
 
173
173
  **If not in a git repository**:
174
174
  - Record issue "Not a git repository — skipped commit" in `self-test-fix-report.md`.
175
- - Write `<output-path>/self-test-fix-commit-info.md` with:
175
+ - Write `<output_path>/self-test-fix-commit-info.md` with:
176
176
  ```
177
- commit-id: none
177
+ commit_id: none
178
178
  ```
179
179
 
180
- **If `output-path` was not provided**, skip writing `self-test-fix-commit-info.md`.
180
+ **If `output_path` was not provided**, skip writing `self-test-fix-commit-info.md`.
181
181
 
182
182
  ### 3d. Retry Logic (Maximum 2 Effective Attempts)
183
183
 
@@ -194,7 +194,7 @@ An "effective attempt" = code was modified AND compilation succeeded, but code r
194
194
 
195
195
  ## Step 4 — Generate Detailed Fix Report
196
196
 
197
- Write `self-test-fix-report.md` to `output-path`. The report must be comprehensive and actionable.
197
+ Write `self-test-fix-report.md` to `output_path`. The report must be comprehensive and actionable.
198
198
 
199
199
  ### Report Structure
200
200