@buaa_smat/hometrans 26.0.2 → 26.0.4

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 (1471) hide show
  1. package/README.md +8 -7
  2. package/agents/code-reviewer.md +111 -154
  3. package/dist/cli/index.js +4 -1
  4. package/dist/cli/init.js +131 -26
  5. package/dist/cli/uninstall.js +5 -5
  6. package/dist/platform/language.js +77 -0
  7. package/env-requirements.json +30 -5
  8. package/i18n/FILE-NAMES.md +9 -0
  9. package/i18n/agents/code-reviewer.md +436 -0
  10. package/i18n/agents/model-render-worker.md +38 -0
  11. package/i18n/agents/specgen-worker.md +18 -0
  12. package/i18n/commands/hometrans.md +17 -0
  13. package/i18n/skills/a2h-app-migrate/SKILL.md +206 -0
  14. package/i18n/skills/a2h-app-migrate/references/config.example.json +28 -0
  15. package/i18n/skills/a2h-app-migrate/references/feature-scope.md +121 -0
  16. package/i18n/skills/a2h-app-migrate/references/specs.example.json +19 -0
  17. package/i18n/skills/a2h-app-migrate/references/stage-map.md +50 -0
  18. package/i18n/skills/a2h-app-migrate/references/workflow.yaml +2007 -0
  19. package/i18n/skills/a2h-app-migrate/scripts/check_spec_gen_done.mjs +187 -0
  20. package/i18n/skills/a2h-app-migrate/scripts/env_preflight.mjs +1656 -0
  21. package/i18n/skills/a2h-app-migrate/scripts/human_review_gate.mjs +728 -0
  22. package/i18n/skills/a2h-app-migrate/scripts/validate_workflow.mjs +541 -0
  23. package/i18n/skills/a2h-app-migrate/test/test_android_index.mjs +143 -0
  24. package/i18n/skills/a2h-app-migrate/test/test_arch_done.mjs +54 -0
  25. package/i18n/skills/a2h-app-migrate/test/test_build_fixer_contract.mjs +98 -0
  26. package/i18n/skills/a2h-app-migrate/test/test_config_example.mjs +42 -0
  27. package/i18n/skills/a2h-app-migrate/test/test_ensure_utg_snapshot.mjs +147 -0
  28. package/i18n/skills/a2h-app-migrate/test/test_env_requirements.mjs +713 -0
  29. package/i18n/skills/a2h-app-migrate/test/test_finalize.mjs +117 -0
  30. package/i18n/skills/a2h-app-migrate/test/test_image_probe.mjs +120 -0
  31. package/i18n/skills/a2h-app-migrate/test/test_interaction.mjs +122 -0
  32. package/i18n/skills/a2h-app-migrate/test/test_preflight_report.mjs +93 -0
  33. package/i18n/skills/a2h-app-migrate/test/test_resume_plan.mjs +271 -0
  34. package/i18n/skills/a2h-app-migrate/test/test_resume_summary.mjs +222 -0
  35. package/i18n/skills/a2h-app-migrate/test/test_reuse_static_utg.mjs +136 -0
  36. package/i18n/skills/a2h-app-migrate/test/test_run_dir.mjs +552 -0
  37. package/i18n/skills/a2h-app-migrate/test/test_skill_doc.mjs +144 -0
  38. package/i18n/skills/a2h-app-migrate/test/test_spec_gen_done.mjs +263 -0
  39. package/i18n/skills/a2h-app-migrate/test/test_spec_gen_gate.mjs +165 -0
  40. package/i18n/skills/a2h-app-migrate/test/test_specs_json_preflight.mjs +76 -0
  41. package/i18n/skills/a2h-app-migrate/test/test_ui_batch_gate.mjs +226 -0
  42. package/i18n/skills/a2h-app-migrate/test/test_user_facing_progress.mjs +43 -0
  43. package/i18n/skills/a2h-app-migrate/test/test_utg_static_done.mjs +207 -0
  44. package/i18n/skills/a2h-app-migrate/test/test_validate_workflow_bilingual.mjs +87 -0
  45. package/i18n/skills/a2h-arch-generate/SKILL.md +378 -0
  46. package/i18n/skills/a2h-arch-generate/examples/reconcile-existing-project.md +107 -0
  47. package/i18n/skills/a2h-arch-generate/examples/simple-conversion-backend.md +70 -0
  48. package/i18n/skills/a2h-arch-generate/references/arkts-mvvm-v2.md +1407 -0
  49. package/i18n/skills/a2h-arch-generate/references/artifact-contracts.generate.md +120 -0
  50. package/i18n/skills/a2h-arch-generate/references/artifact-contracts.reconcile.md +123 -0
  51. package/i18n/skills/a2h-arch-generate/references/bpta-layered-architecture-design.md +88 -0
  52. package/i18n/skills/a2h-arch-generate/references/database-schema-recovery.md +107 -0
  53. package/i18n/skills/a2h-arch-generate/references/existing-target-annotation.md +68 -0
  54. package/i18n/skills/a2h-arch-generate/references/harmony-project-inspection.md +150 -0
  55. package/i18n/skills/a2h-arch-generate/references/harmony-target-architecture.md +94 -0
  56. package/i18n/skills/a2h-arch-generate/references/homegraph-workflow.md +131 -0
  57. package/i18n/skills/a2h-arch-generate/references/source-baseline.md +93 -0
  58. package/i18n/skills/a2h-arch-generate/scripts/generate_source_baseline.mjs +360 -0
  59. package/i18n/skills/a2h-arch-generate/scripts/inspect_harmony_target.mjs +798 -0
  60. package/i18n/skills/a2h-arch-generate/scripts/lib/contract_terms.mjs +40 -0
  61. package/i18n/skills/a2h-arch-generate/scripts/module_create/generate.mjs +639 -0
  62. package/i18n/skills/a2h-arch-generate/scripts/module_create/testdata/reconcile-layer-PROJECT_DESIGN.md +47 -0
  63. package/i18n/skills/a2h-arch-generate/scripts/module_create/testdata/single-entry-PROJECT_DESIGN.md +15 -0
  64. package/i18n/skills/a2h-arch-generate/scripts/module_create/testdata/three-layer-PROJECT_DESIGN.md +36 -0
  65. package/i18n/skills/a2h-arch-generate/scripts/module_create/testdata/verification-report.md +150 -0
  66. package/i18n/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/uniapp_source/pages.json +5 -0
  67. package/i18n/skills/a2h-arch-generate/scripts/tests/e2e/run_e2e.mjs +548 -0
  68. package/i18n/skills/a2h-arch-generate/scripts/tests/run_tests.mjs +1261 -0
  69. package/i18n/skills/a2h-arch-generate/scripts/tests/test_module_templates.mjs +70 -0
  70. package/i18n/skills/a2h-arch-generate/scripts/validate_architecture_docs.mjs +851 -0
  71. package/i18n/skills/a2h-arch-generate/scripts/validate_data_docs.mjs +982 -0
  72. package/i18n/skills/a2h-arkts-logic-coder/SKILL.md +304 -0
  73. package/i18n/skills/a2h-arkts-logic-coder/references/ISSUES.md +10 -0
  74. package/i18n/skills/a2h-arkts-logic-coder/references/code-generation.md +249 -0
  75. package/i18n/skills/a2h-arkts-logic-coder/references/spec-design.md +344 -0
  76. package/i18n/skills/a2h-arkts-logic-coder/scripts/design/move_spec_technical_reference.mjs +162 -0
  77. package/i18n/skills/a2h-arkts-logic-coder/scripts/design/validate_spec_design_output.mjs +298 -0
  78. package/i18n/skills/a2h-arkts-logic-coder/scripts/state_doc.mjs +877 -0
  79. package/i18n/skills/a2h-arkts-logic-coder/scripts/test_check_units.ts +149 -0
  80. package/i18n/skills/a2h-arkts-logic-coder/test/golden/move_design.md +18 -0
  81. package/i18n/skills/a2h-arkts-logic-coder/test/golden/move_design_crlf.md +18 -0
  82. package/i18n/skills/a2h-arkts-logic-coder/test/golden/move_spec.md +7 -0
  83. package/i18n/skills/a2h-arkts-logic-coder/test/golden/validate_issue_file.md +12 -0
  84. package/i18n/skills/a2h-arkts-logic-coder/test/golden/validate_issues.json +57 -0
  85. package/i18n/skills/a2h-arkts-logic-coder/test/test_spec_design_scripts.mjs +547 -0
  86. package/i18n/skills/a2h-arkts-logic-coder/test/test_state_doc.mjs +597 -0
  87. package/i18n/skills/a2h-batch-ui-align/SKILL.md +372 -0
  88. package/i18n/skills/a2h-batch-ui-align/references/cards/alignment.md +35 -0
  89. package/i18n/skills/a2h-batch-ui-align/references/cards/build.md +13 -0
  90. package/i18n/skills/a2h-batch-ui-align/references/cards/canvas.md +17 -0
  91. package/i18n/skills/a2h-batch-ui-align/references/cards/dynamics.md +27 -0
  92. package/i18n/skills/a2h-batch-ui-align/references/cards/geometry.md +85 -0
  93. package/i18n/skills/a2h-batch-ui-align/references/cards/interaction.md +23 -0
  94. package/i18n/skills/a2h-batch-ui-align/references/cards/resources.md +89 -0
  95. package/i18n/skills/a2h-batch-ui-align/references/cards/state-v1.md +29 -0
  96. package/i18n/skills/a2h-batch-ui-align/references/cards/state.md +14 -0
  97. package/i18n/skills/a2h-batch-ui-align/references/cards/widgets.md +62 -0
  98. package/i18n/skills/a2h-batch-ui-align/references/cards/window.md +30 -0
  99. package/i18n/skills/a2h-batch-ui-align/references/checker-rules.md +930 -0
  100. package/i18n/skills/a2h-batch-ui-align/references/conversion-procedure.md +420 -0
  101. package/i18n/skills/a2h-batch-ui-align/references/incremental-scope.md +158 -0
  102. package/i18n/skills/a2h-batch-ui-align/references/lottie-integration.md +43 -0
  103. package/i18n/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +2552 -0
  104. package/i18n/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-interaction-mapping-reference.md +560 -0
  105. package/i18n/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-layout-mapping-reference.md +175 -0
  106. package/i18n/skills/a2h-batch-ui-align/references/state-mgmt/_decorator-quickref.md +251 -0
  107. package/i18n/skills/a2h-batch-ui-align/references/state-mgmt/_paradigm-selection.md +28 -0
  108. package/i18n/skills/a2h-batch-ui-align/references/step3-capture.md +232 -0
  109. package/i18n/skills/a2h-batch-ui-align/references/step4-prepare.md +206 -0
  110. package/i18n/skills/a2h-batch-ui-align/references/step5-convert.md +232 -0
  111. package/i18n/skills/a2h-batch-ui-align/scripts/android_parse_fast.ts +2005 -0
  112. package/i18n/skills/a2h-batch-ui-align/scripts/branch_coverage.mjs +155 -0
  113. package/i18n/skills/a2h-batch-ui-align/scripts/build_conversion_set.mjs +2118 -0
  114. package/i18n/skills/a2h-batch-ui-align/scripts/databinding_analyzer_design.md +79 -0
  115. package/i18n/skills/a2h-batch-ui-align/scripts/detect_paradigm.mjs +245 -0
  116. package/i18n/skills/a2h-batch-ui-align/scripts/draw_coverage.mjs +264 -0
  117. package/i18n/skills/a2h-batch-ui-align/scripts/export_ui_info.mjs +1805 -0
  118. package/i18n/skills/a2h-batch-ui-align/scripts/gen_rule_docs.mjs +100 -0
  119. package/i18n/skills/a2h-batch-ui-align/scripts/generate_pages_json.mjs +612 -0
  120. package/i18n/skills/a2h-batch-ui-align/scripts/group_pack.mjs +1959 -0
  121. package/i18n/skills/a2h-batch-ui-align/scripts/icon_coverage.mjs +147 -0
  122. package/i18n/skills/a2h-batch-ui-align/scripts/image_probe.mjs +405 -0
  123. package/i18n/skills/a2h-batch-ui-align/scripts/measure_pack.ts +1632 -0
  124. package/i18n/skills/a2h-batch-ui-align/scripts/phase5_check.mjs +1300 -0
  125. package/i18n/skills/a2h-batch-ui-align/scripts/shell_contract.mjs +1234 -0
  126. package/i18n/skills/a2h-batch-ui-align/scripts/state_doc.mjs +417 -0
  127. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/core/cli.ts +134 -0
  128. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/core/i18n.ts +18 -0
  129. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/main.ts +216 -0
  130. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/a11y.ts +615 -0
  131. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/android_immersive.ts +125 -0
  132. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/attr_chain.ts +49 -0
  133. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/block_comment_break.ts +64 -0
  134. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/blur_mirrored.ts +134 -0
  135. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/builder_call_sites.ts +242 -0
  136. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/builder_invokes_callback.ts +136 -0
  137. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/canvas.ts +255 -0
  138. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/color_string.ts +109 -0
  139. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/column_shrink.ts +154 -0
  140. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/constant_coordinate.ts +39 -0
  141. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/container_align.ts +140 -0
  142. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/dialog_backboard.ts +91 -0
  143. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/entry_root_builtin.ts +69 -0
  144. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/entry_route.ts +114 -0
  145. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/event_default_click.ts +179 -0
  146. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/fixed_size_safe_area.ts +103 -0
  147. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/format_string.ts +157 -0
  148. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/framework_dialog.ts +110 -0
  149. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/framework_picker.ts +115 -0
  150. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/hit_test.ts +339 -0
  151. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/image_source.ts +84 -0
  152. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/input_traps.ts +249 -0
  153. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/layout_placement.ts +780 -0
  154. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/lottie_host.ts +145 -0
  155. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/media_content.ts +138 -0
  156. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/media_tint.ts +408 -0
  157. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/offset_in_scroll.ts +163 -0
  158. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/orphan_component.ts +119 -0
  159. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/overlay_binds.ts +56 -0
  160. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/overlay_string.ts +96 -0
  161. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/padding_in_size.ts +179 -0
  162. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/page_reachability.ts +94 -0
  163. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/path_commands_vp.ts +50 -0
  164. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/percent_height_in_scroll.ts +81 -0
  165. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/popup_menu.ts +137 -0
  166. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/r_template_string.ts +37 -0
  167. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/relative_container_height.ts +102 -0
  168. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/request_permission.ts +98 -0
  169. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/resource_as_string.ts +68 -0
  170. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/root_weight.ts +147 -0
  171. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/runtime_traps.ts +440 -0
  172. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/safe_area_clipping.ts +168 -0
  173. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/scroll_align.ts +127 -0
  174. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/scroll_delta.ts +178 -0
  175. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/sdk_api.ts +195 -0
  176. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/shared_chrome.ts +73 -0
  177. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/sheet_blur.ts +95 -0
  178. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/shell_content.ts +198 -0
  179. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/stack_occluding.ts +118 -0
  180. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/state_decorators.ts +73 -0
  181. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/state_name_shadows.ts +93 -0
  182. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/string_quote_leak.ts +73 -0
  183. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/surface_stroke.ts +50 -0
  184. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/swiper_index.ts +65 -0
  185. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/theme_color.ts +184 -0
  186. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/track_getter.ts +132 -0
  187. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/waterflow_sections.ts +231 -0
  188. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/wide_constant_width.ts +53 -0
  189. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/window_mode.ts +67 -0
  190. package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_a11y.test.mjs +598 -0
  191. package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_blur.test.mjs +217 -0
  192. package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_builder_calls.test.mjs +323 -0
  193. package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_fidelity.test.mjs +507 -0
  194. package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_input_runtime.test.mjs +514 -0
  195. package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_layout_placement.test.mjs +651 -0
  196. package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_occlusion_offset_format.test.mjs +372 -0
  197. package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_overlay_lottie.test.mjs +199 -0
  198. package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_review_fixes.test.mjs +298 -0
  199. package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_rules.test.mjs +365 -0
  200. package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_scroll_padding_raster.test.mjs +262 -0
  201. package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_weight_color.test.mjs +473 -0
  202. package/i18n/skills/a2h-batch-ui-align/scripts/tests/branch_coverage.test.mjs +116 -0
  203. package/i18n/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set.test.mjs +693 -0
  204. package/i18n/skills/a2h-batch-ui-align/scripts/tests/draw_coverage.test.mjs +245 -0
  205. package/i18n/skills/a2h-batch-ui-align/scripts/tests/export_ui_info.test.mjs +742 -0
  206. package/i18n/skills/a2h-batch-ui-align/scripts/tests/generate_pages_json.test.mjs +123 -0
  207. package/i18n/skills/a2h-batch-ui-align/scripts/tests/group_pack.test.mjs +363 -0
  208. package/i18n/skills/a2h-batch-ui-align/scripts/tests/image_probe.test.mjs +243 -0
  209. package/i18n/skills/a2h-batch-ui-align/scripts/tests/measure_pack.test.mjs +326 -0
  210. package/i18n/skills/a2h-batch-ui-align/scripts/tests/occlusion.test.mjs +102 -0
  211. package/i18n/skills/a2h-batch-ui-align/scripts/tests/phase5_check.test.mjs +356 -0
  212. package/i18n/skills/a2h-batch-ui-align/scripts/tests/skill_doc_contract.test.mjs +60 -0
  213. package/i18n/skills/a2h-batch-ui-align/scripts/tests/state_doc.test.mjs +395 -0
  214. package/i18n/skills/a2h-batch-ui-align/scripts/tests/static_check_registry.test.mjs +122 -0
  215. package/i18n/skills/a2h-batch-ui-align/scripts/tests/text_color_diff.test.mjs +250 -0
  216. package/i18n/skills/a2h-batch-ui-align/scripts/text_color_diff.mjs +470 -0
  217. package/i18n/skills/a2h-coldstart-smoke-gate/SKILL.md +62 -0
  218. package/i18n/skills/a2h-dashboard-render/SKILL.md +73 -0
  219. package/i18n/skills/a2h-dashboard-render/references/artifact-contract.jsonc +117 -0
  220. package/i18n/skills/a2h-dashboard-render/references/artifact-registry-spec.md +67 -0
  221. package/i18n/skills/a2h-dashboard-render/references/dashboard-guide.md +91 -0
  222. package/i18n/skills/a2h-dashboard-render/references/dashboard.config.example.json +19 -0
  223. package/i18n/skills/a2h-dashboard-render/scripts/dashboard.mjs +3245 -0
  224. package/i18n/skills/a2h-dashboard-render/scripts/device_capture.mjs +2050 -0
  225. package/i18n/skills/a2h-dashboard-render/test/fixtures/page_capture/expected.json +156 -0
  226. package/i18n/skills/a2h-dashboard-render/test/fixtures/page_capture/hmos.json +1 -0
  227. package/i18n/skills/a2h-dashboard-render/test/fixtures/page_capture/list.xml +1 -0
  228. package/i18n/skills/a2h-dashboard-render/test/test_artifact_contract.mjs +168 -0
  229. package/i18n/skills/a2h-dashboard-render/test/test_dashboard_architecture.mjs +118 -0
  230. package/i18n/skills/a2h-dashboard-render/test/test_dashboard_build.mjs +93 -0
  231. package/i18n/skills/a2h-dashboard-render/test/test_dashboard_i18n.mjs +154 -0
  232. package/i18n/skills/a2h-dashboard-render/test/test_dashboard_node.mjs +1369 -0
  233. package/i18n/skills/a2h-dashboard-render/test/test_dashboard_spec_pipeline.mjs +318 -0
  234. package/i18n/skills/a2h-dashboard-render/test/test_dashboard_ui_pipeline.mjs +81 -0
  235. package/i18n/skills/a2h-dashboard-render/test/test_device_capture_env.mjs +115 -0
  236. package/i18n/skills/a2h-dashboard-render/test/test_device_capture_policy.mjs +411 -0
  237. package/i18n/skills/a2h-dashboard-render/test/test_page_capture.mjs +147 -0
  238. package/i18n/skills/a2h-dashboard-render/test/test_usage_readers.mjs +512 -0
  239. package/i18n/skills/a2h-fix-build-errors/SKILL.md +304 -0
  240. package/i18n/skills/a2h-fix-build-errors/references/arkts-strict-patterns.md +219 -0
  241. package/i18n/skills/a2h-fix-build-errors/references/rdb-entity-pattern.md +131 -0
  242. package/i18n/skills/a2h-module-semantic-docs/SKILL.md +265 -0
  243. package/i18n/skills/a2h-module-semantic-docs/test/golden/module_structure.json +187 -0
  244. package/i18n/skills/a2h-module-semantic-docs/test/golden/module_understanding.json +351 -0
  245. package/i18n/skills/a2h-module-semantic-docs/test/golden/module_update_plan.json +495 -0
  246. package/i18n/skills/a2h-module-semantic-docs/test/golden/project_directory_structure.json +157 -0
  247. package/i18n/skills/a2h-module-semantic-docs/test/test_scan_and_commit.mjs +388 -0
  248. package/i18n/skills/a2h-page-specgen/SKILL.md +239 -0
  249. package/i18n/skills/a2h-page-specgen/references/behavior-ledger.md +1174 -0
  250. package/i18n/skills/a2h-page-specgen/references/body-language.md +179 -0
  251. package/i18n/skills/a2h-page-specgen/references/gates.md +329 -0
  252. package/i18n/skills/a2h-page-specgen/references/page-inventory.md +220 -0
  253. package/i18n/skills/a2h-page-specgen/references/scenario-authoring.md +274 -0
  254. package/i18n/skills/a2h-page-specgen/references/spec-example.md +312 -0
  255. package/i18n/skills/a2h-page-specgen/references/spec-template.md +210 -0
  256. package/i18n/skills/a2h-page-specgen/scripts/behavior-audit.mjs +2436 -0
  257. package/i18n/skills/a2h-page-specgen/scripts/behavior-discovery.mjs +1833 -0
  258. package/i18n/skills/a2h-page-specgen/scripts/behavior-model.mjs +181 -0
  259. package/i18n/skills/a2h-page-specgen/scripts/behavior-reconcile.mjs +1205 -0
  260. package/i18n/skills/a2h-page-specgen/scripts/entry-evidence.mjs +1123 -0
  261. package/i18n/skills/a2h-page-specgen/scripts/facts-build.mjs +1613 -0
  262. package/i18n/skills/a2h-page-specgen/scripts/footprint.mjs +1650 -0
  263. package/i18n/skills/a2h-page-specgen/scripts/gate.mjs +864 -0
  264. package/i18n/skills/a2h-page-specgen/scripts/interactions.mjs +346 -0
  265. package/i18n/skills/a2h-page-specgen/scripts/inventory.mjs +371 -0
  266. package/i18n/skills/a2h-page-specgen/scripts/lib/contracts.mjs +155 -0
  267. package/i18n/skills/a2h-page-specgen/scripts/lib/graph-evidence.mjs +235 -0
  268. package/i18n/skills/a2h-page-specgen/scripts/lib/hg.mjs +684 -0
  269. package/i18n/skills/a2h-page-specgen/scripts/lib/homegraph-process.mjs +102 -0
  270. package/i18n/skills/a2h-page-specgen/scripts/lib/homegraph-query.mjs +161 -0
  271. package/i18n/skills/a2h-page-specgen/scripts/lib/operation-reviews.mjs +913 -0
  272. package/i18n/skills/a2h-page-specgen/scripts/lib/prose.mjs +252 -0
  273. package/i18n/skills/a2h-page-specgen/scripts/lib/reach.mjs +53 -0
  274. package/i18n/skills/a2h-page-specgen/scripts/lib/semantic-detail.mjs +353 -0
  275. package/i18n/skills/a2h-page-specgen/scripts/lib/source-text.mjs +497 -0
  276. package/i18n/skills/a2h-page-specgen/scripts/operation-evidence.mjs +1542 -0
  277. package/i18n/skills/a2h-page-specgen/scripts/prepare.mjs +864 -0
  278. package/i18n/skills/a2h-page-specgen/scripts/render.mjs +276 -0
  279. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/acceptance.mjs +897 -0
  280. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.json +25 -0
  281. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.prompt.md +373 -0
  282. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.worker.md +300 -0
  283. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.json +47 -0
  284. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.prompt.md +373 -0
  285. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.worker.md +300 -0
  286. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.discovery.json +2694 -0
  287. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.json +726 -0
  288. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.post-review.json +108 -0
  289. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.prompt.md +373 -0
  290. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.review.md +65 -0
  291. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.worker.md +267 -0
  292. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.json +57 -0
  293. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.prompt.md +373 -0
  294. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.worker.md +300 -0
  295. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/branch-checklist.md +32 -0
  296. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/gate-results.json +22 -0
  297. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/manifest.json +111 -0
  298. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/portability.test.mjs +141 -0
  299. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/review.md +22 -0
  300. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/run.mjs +553 -0
  301. package/i18n/skills/a2h-page-specgen/scripts/test/android-entry-evidence.test.mjs +585 -0
  302. package/i18n/skills/a2h-page-specgen/scripts/test/android-operation-evidence.test.mjs +755 -0
  303. package/i18n/skills/a2h-page-specgen/scripts/test/behavior-audit-group.test.mjs +546 -0
  304. package/i18n/skills/a2h-page-specgen/scripts/test/behavior-audit-post.test.mjs +655 -0
  305. package/i18n/skills/a2h-page-specgen/scripts/test/behavior-audit-pre.test.mjs +1234 -0
  306. package/i18n/skills/a2h-page-specgen/scripts/test/behavior-component-gate.test.mjs +520 -0
  307. package/i18n/skills/a2h-page-specgen/scripts/test/behavior-discovery.test.mjs +1516 -0
  308. package/i18n/skills/a2h-page-specgen/scripts/test/behavior-finalize.test.mjs +759 -0
  309. package/i18n/skills/a2h-page-specgen/scripts/test/behavior-fixtures.mjs +630 -0
  310. package/i18n/skills/a2h-page-specgen/scripts/test/behavior-model.test.mjs +118 -0
  311. package/i18n/skills/a2h-page-specgen/scripts/test/behavior-reconcile.test.mjs +798 -0
  312. package/i18n/skills/a2h-page-specgen/scripts/test/behavior-regression.test.mjs +886 -0
  313. package/i18n/skills/a2h-page-specgen/scripts/test/contracts.test.mjs +205 -0
  314. package/i18n/skills/a2h-page-specgen/scripts/test/entry-evidence.test.mjs +475 -0
  315. package/i18n/skills/a2h-page-specgen/scripts/test/facts.test.mjs +1205 -0
  316. package/i18n/skills/a2h-page-specgen/scripts/test/finalize.test.mjs +271 -0
  317. package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/facts/i18n/zh.js.txt +8 -0
  318. package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/facts/res/values-b+zh+Hans/strings.xml +7 -0
  319. package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/facts/res/values-zh/strings.xml +8 -0
  320. package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/App.vue +1 -0
  321. package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/bundle-conflict-record.json +17 -0
  322. package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/bundle-record.json +17 -0
  323. package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/manifest.json +3 -0
  324. package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/pages/list/index.vue +80 -0
  325. package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/pages.json +14 -0
  326. package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/source-record.json +15 -0
  327. package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/components/RefreshPanel.vue +15 -0
  328. package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/composables/useRefresh.ts +50 -0
  329. package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/pages/help/index.vue +9 -0
  330. package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/state/store.ts +4 -0
  331. package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/utg/click_paths.json +28 -0
  332. package/i18n/skills/a2h-page-specgen/scripts/test/footprint-resolve.test.mjs +1029 -0
  333. package/i18n/skills/a2h-page-specgen/scripts/test/fsx.test.mjs +32 -0
  334. package/i18n/skills/a2h-page-specgen/scripts/test/gate-partial.test.mjs +143 -0
  335. package/i18n/skills/a2h-page-specgen/scripts/test/gate.test.mjs +1121 -0
  336. package/i18n/skills/a2h-page-specgen/scripts/test/graph-evidence.test.mjs +332 -0
  337. package/i18n/skills/a2h-page-specgen/scripts/test/helpers.mjs +188 -0
  338. package/i18n/skills/a2h-page-specgen/scripts/test/hg.test.mjs +549 -0
  339. package/i18n/skills/a2h-page-specgen/scripts/test/homegraph-process-fixture.mjs +130 -0
  340. package/i18n/skills/a2h-page-specgen/scripts/test/homegraph-query.test.mjs +288 -0
  341. package/i18n/skills/a2h-page-specgen/scripts/test/integration.test.mjs +368 -0
  342. package/i18n/skills/a2h-page-specgen/scripts/test/interactions.test.mjs +348 -0
  343. package/i18n/skills/a2h-page-specgen/scripts/test/inventory.test.mjs +250 -0
  344. package/i18n/skills/a2h-page-specgen/scripts/test/keys.test.mjs +776 -0
  345. package/i18n/skills/a2h-page-specgen/scripts/test/operation-reviews.test.mjs +1002 -0
  346. package/i18n/skills/a2h-page-specgen/scripts/test/plan-build.test.mjs +1103 -0
  347. package/i18n/skills/a2h-page-specgen/scripts/test/prepare-homegraph-reproduction.mjs +365 -0
  348. package/i18n/skills/a2h-page-specgen/scripts/test/prepare-homegraph.test.mjs +569 -0
  349. package/i18n/skills/a2h-page-specgen/scripts/test/prepare-pipeline.test.mjs +326 -0
  350. package/i18n/skills/a2h-page-specgen/scripts/test/prompt-tpl.test.mjs +240 -0
  351. package/i18n/skills/a2h-page-specgen/scripts/test/prose.test.mjs +427 -0
  352. package/i18n/skills/a2h-page-specgen/scripts/test/protocol-docs.test.mjs +531 -0
  353. package/i18n/skills/a2h-page-specgen/scripts/test/reach.test.mjs +93 -0
  354. package/i18n/skills/a2h-page-specgen/scripts/test/recovery-e2e.test.mjs +418 -0
  355. package/i18n/skills/a2h-page-specgen/scripts/test/recovery.test.mjs +1782 -0
  356. package/i18n/skills/a2h-page-specgen/scripts/test/render.test.mjs +536 -0
  357. package/i18n/skills/a2h-page-specgen/scripts/test/review-followup.test.mjs +467 -0
  358. package/i18n/skills/a2h-page-specgen/scripts/test/semantic-detail.test.mjs +949 -0
  359. package/i18n/skills/a2h-page-specgen/scripts/test/submit.test.mjs +1239 -0
  360. package/i18n/skills/a2h-page-specgen/scripts/test/uniapp-operation-evidence.test.mjs +639 -0
  361. package/i18n/skills/a2h-page-specgen/scripts/test/utg-footprint-contract.test.mjs +274 -0
  362. package/i18n/skills/a2h-page-specgen/scripts/test/utg-io.test.mjs +90 -0
  363. package/i18n/skills/a2h-page-specgen/scripts/test/waker-process.test.mjs +1801 -0
  364. package/i18n/skills/a2h-resource-convert/SKILL.md +375 -0
  365. package/i18n/skills/a2h-resource-convert/references/code-vector-icon-rules.md +336 -0
  366. package/i18n/skills/a2h-resource-convert/references/incremental-page-migration.md +272 -0
  367. package/i18n/skills/a2h-resource-convert/references/lottie-conversion-rules.md +226 -0
  368. package/i18n/skills/a2h-resource-convert/references/resource-mapping-rules.md +493 -0
  369. package/i18n/skills/a2h-resource-convert/references/step4-resource-types.md +251 -0
  370. package/i18n/skills/a2h-resource-convert/references/step7-report-template.md +217 -0
  371. package/i18n/skills/a2h-resource-convert/scripts/a2h_resource_convert.ts +2596 -0
  372. package/i18n/skills/a2h-resource-convert/scripts/lottie_hosts.ts +415 -0
  373. package/i18n/skills/a2h-resource-convert/scripts/tests/docs_only_i18n.test.mjs +44 -0
  374. package/i18n/skills/a2h-resource-convert/scripts/tests/lottie_hosts.test.mjs +222 -0
  375. package/i18n/skills/a2h-spec-design-pipeline/SKILL.md +238 -0
  376. package/i18n/skills/a2h-spec-design-pipeline/references/coding-loop.md +358 -0
  377. package/i18n/skills/a2h-spec-design-pipeline/references/homegraph-cli.md +307 -0
  378. package/i18n/skills/a2h-spec-design-pipeline/references/initialization.md +103 -0
  379. package/i18n/skills/a2h-spec-design-pipeline/references/merge-queue.md +266 -0
  380. package/i18n/skills/a2h-spec-design-pipeline/references/post-loop.md +23 -0
  381. package/i18n/skills/a2h-spec-design-pipeline/references/review-loop.md +71 -0
  382. package/i18n/skills/a2h-spec-design-pipeline/references/scripts.md +55 -0
  383. package/i18n/skills/a2h-spec-design-pipeline/references/specs.example.json +19 -0
  384. package/i18n/skills/a2h-spec-design-pipeline/references/state-and-resume.md +246 -0
  385. package/i18n/skills/a2h-spec-design-pipeline/scripts/plan_groups.ts +752 -0
  386. package/i18n/skills/a2h-spec-design-pipeline/scripts/test_plan_groups.ts +661 -0
  387. package/i18n/skills/a2h-spec-generate/SKILL.md +375 -0
  388. package/i18n/skills/a2h-spec-generate/references/batch-mode.md +215 -0
  389. package/i18n/skills/a2h-spec-generate/references/delete-blast-radius.md +3 -0
  390. package/i18n/skills/a2h-spec-generate/references/dispatch-watchdog.md +150 -0
  391. package/i18n/skills/a2h-spec-generate/references/fusion-task-contract.md +184 -0
  392. package/i18n/skills/a2h-spec-generate/references/input-formats.md +27 -0
  393. package/i18n/skills/a2h-spec-generate/references/library-evidence.md +3 -0
  394. package/i18n/skills/a2h-spec-generate/references/method-discipline.md +64 -0
  395. package/i18n/skills/a2h-spec-generate/references/optional-gates.json +45 -0
  396. package/i18n/skills/a2h-spec-generate/references/recall-guide.md +84 -0
  397. package/i18n/skills/a2h-spec-generate/references/recall-terse.md +3 -0
  398. package/i18n/skills/a2h-spec-generate/references/recall-uniapp.md +10 -0
  399. package/i18n/skills/a2h-spec-generate/references/requirement-scope.md +122 -0
  400. package/i18n/skills/a2h-spec-generate/references/review-checklist.md +22 -0
  401. package/i18n/skills/a2h-spec-generate/references/spec-sample-complex.md +80 -0
  402. package/i18n/skills/a2h-spec-generate/references/spec-sample-transfer.md +43 -0
  403. package/i18n/skills/a2h-spec-generate/references/spec-samples.md +65 -0
  404. package/i18n/skills/a2h-spec-generate/references/specs.schema.json +85 -0
  405. package/i18n/skills/a2h-spec-generate/references/synthesis-rules.md +145 -0
  406. package/i18n/skills/a2h-spec-generate/references/transfer-file.md +5 -0
  407. package/i18n/skills/a2h-spec-generate/references/transfer-socket.md +5 -0
  408. package/i18n/skills/a2h-spec-generate/references/worker-rules.md +129 -0
  409. package/i18n/skills/a2h-spec-generate/scripts/check-fused-spec.mjs +702 -0
  410. package/i18n/skills/a2h-spec-generate/scripts/check_spec.ts +515 -0
  411. package/i18n/skills/a2h-spec-generate/scripts/collect-specs.mjs +727 -0
  412. package/i18n/skills/a2h-spec-generate/scripts/feature-stem.mjs +151 -0
  413. package/i18n/skills/a2h-spec-generate/scripts/parse_requirements.ts +515 -0
  414. package/i18n/skills/a2h-spec-generate/scripts/prepare-facts.mjs +313 -0
  415. package/i18n/skills/a2h-spec-generate/scripts/publish-specs.mjs +354 -0
  416. package/i18n/skills/a2h-spec-generate/scripts/regroup-by-page.mjs +669 -0
  417. package/i18n/skills/a2h-spec-generate/scripts/render-tasks.mjs +385 -0
  418. package/i18n/skills/a2h-spec-generate/scripts/report.mjs +136 -0
  419. package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/analysis/graph/build.ts +2217 -0
  420. package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/analysis/graph/component-variants.ts +845 -0
  421. package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/analysis/names/policy.ts +572 -0
  422. package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/analysis/names/traceability.ts +580 -0
  423. package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/analysis/req-model/build.ts +1265 -0
  424. package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/fusion/area-facts.ts +1057 -0
  425. package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/fusion/behavior-seed.ts +565 -0
  426. package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/fusion/library-evidence.ts +544 -0
  427. package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/fusion/navigation-guard.ts +363 -0
  428. package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/fusion/schema.ts +317 -0
  429. package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/fusion/selfcheck.ts +707 -0
  430. package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/fusion/spec-bindings.ts +436 -0
  431. package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/fusion/task-contract.ts +608 -0
  432. package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/contracts.ts +650 -0
  433. package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/task-contract.ts +178 -0
  434. package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/tree-sitter-adapter.ts +923 -0
  435. package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/model/finalize.ts +912 -0
  436. package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/model/task.ts +279 -0
  437. package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/requirement-scope.ts +163 -0
  438. package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/source-index/homegraph.ts +1039 -0
  439. package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/validation/req-text.ts +256 -0
  440. package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fixtures/fusion-run.ts +243 -0
  441. package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-area-facts.test.ts +576 -0
  442. package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-behavior-detectors.test.ts +176 -0
  443. package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-behavior-e2e.test.ts +103 -0
  444. package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-behavior-schema.test.ts +111 -0
  445. package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-behavior-selfcheck.test.ts +307 -0
  446. package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-contract.test.ts +340 -0
  447. package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-finalize.test.ts +1857 -0
  448. package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-navigation-guard.test.ts +262 -0
  449. package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-prepare.test.ts +722 -0
  450. package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-scope.test.ts +339 -0
  451. package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-selfcheck.test.ts +1253 -0
  452. package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-spec.test.ts +608 -0
  453. package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/model-scope.test.ts +411 -0
  454. package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/model-task-contract.test.ts +300 -0
  455. package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/model-v4.test.ts +1061 -0
  456. package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/uniapp-scanner.test.ts +159 -0
  457. package/i18n/skills/a2h-spec-generate/template/REQ.txt +22 -0
  458. package/i18n/skills/a2h-spec-generate/template/REQ.xlsx +0 -0
  459. package/i18n/skills/a2h-spec-generate/test/check-fused-spec.test.mjs +847 -0
  460. package/i18n/skills/a2h-spec-generate/test/check-spec.test.ts +415 -0
  461. package/i18n/skills/a2h-spec-generate/test/collect-specs.test.mjs +808 -0
  462. package/i18n/skills/a2h-spec-generate/test/feature-stem.test.mjs +157 -0
  463. package/i18n/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/components/MyCard.vue +9 -0
  464. package/i18n/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/feature/editor/index.vue +1 -0
  465. package/i18n/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/pages/detail/index.vue +1 -0
  466. package/i18n/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/pages/home/index.vue +33 -0
  467. package/i18n/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/pages/settings/index.vue +1 -0
  468. package/i18n/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/pages.json +23 -0
  469. package/i18n/skills/a2h-spec-generate/test/inspect-uniapp.test.mjs +54 -0
  470. package/i18n/skills/a2h-spec-generate/test/prepare-facts.test.mjs +41 -0
  471. package/i18n/skills/a2h-spec-generate/test/publish-specs.test.mjs +295 -0
  472. package/i18n/skills/a2h-spec-generate/test/regroup-by-page.test.mjs +354 -0
  473. package/i18n/skills/a2h-spec-generate/test/render-tasks.test.mjs +596 -0
  474. package/i18n/skills/a2h-spec-generate/test/report.test.mjs +47 -0
  475. package/i18n/skills/a2h-utg-explorer/SKILL.md +126 -0
  476. package/i18n/skills/a2h-utg-explorer/references/architecture.md +282 -0
  477. package/i18n/skills/a2h-utg-explorer/scripts/compile_tasks.mjs +908 -0
  478. package/i18n/skills/a2h-utg-explorer/scripts/final_utg.mjs +446 -0
  479. package/i18n/skills/a2h-utg-explorer/scripts/hint_check.mjs +147 -0
  480. package/i18n/skills/a2h-utg-explorer/scripts/hint_source.mjs +119 -0
  481. package/i18n/skills/a2h-utg-explorer/scripts/hybrid_route_cdp.mjs +376 -0
  482. package/i18n/skills/a2h-utg-explorer/scripts/recover_b.mjs +550 -0
  483. package/i18n/skills/a2h-utg-explorer/scripts/recover_d.mjs +647 -0
  484. package/i18n/skills/a2h-utg-explorer/scripts/seed_recipes.mjs +426 -0
  485. package/i18n/skills/a2h-utg-explorer/scripts/tests/attest.test.mjs +66 -0
  486. package/i18n/skills/a2h-utg-explorer/scripts/tests/compose_identity.test.mjs +302 -0
  487. package/i18n/skills/a2h-utg-explorer/scripts/tests/content_wait.test.mjs +207 -0
  488. package/i18n/skills/a2h-utg-explorer/scripts/tests/diagnostics.test.mjs +252 -0
  489. package/i18n/skills/a2h-utg-explorer/scripts/tests/direct_launch.test.mjs +130 -0
  490. package/i18n/skills/a2h-utg-explorer/scripts/tests/final_utg.test.mjs +135 -0
  491. package/i18n/skills/a2h-utg-explorer/scripts/tests/generalization_fixes.test.mjs +252 -0
  492. package/i18n/skills/a2h-utg-explorer/scripts/tests/hint_check.test.mjs +129 -0
  493. package/i18n/skills/a2h-utg-explorer/scripts/tests/hybrid_route_identity.test.mjs +146 -0
  494. package/i18n/skills/a2h-utg-explorer/scripts/tests/interruptions.test.mjs +614 -0
  495. package/i18n/skills/a2h-utg-explorer/scripts/tests/launch_bridge.test.mjs +214 -0
  496. package/i18n/skills/a2h-utg-explorer/scripts/tests/overflow_prefix.test.mjs +327 -0
  497. package/i18n/skills/a2h-utg-explorer/scripts/tests/overlay_identity.test.mjs +204 -0
  498. package/i18n/skills/a2h-utg-explorer/scripts/tests/page_identity_tiers.test.mjs +393 -0
  499. package/i18n/skills/a2h-utg-explorer/scripts/tests/pager_navigation.test.mjs +119 -0
  500. package/i18n/skills/a2h-utg-explorer/scripts/tests/panel_routes.test.mjs +208 -0
  501. package/i18n/skills/a2h-utg-explorer/scripts/tests/pipeline.test.mjs +240 -0
  502. package/i18n/skills/a2h-utg-explorer/scripts/tests/recover_b.test.mjs +173 -0
  503. package/i18n/skills/a2h-utg-explorer/scripts/tests/recover_d.test.mjs +280 -0
  504. package/i18n/skills/a2h-utg-explorer/scripts/tests/robustness_fixes.test.mjs +345 -0
  505. package/i18n/skills/a2h-utg-explorer/scripts/tests/runner_capabilities.test.mjs +194 -0
  506. package/i18n/skills/a2h-utg-explorer/scripts/tests/seed_recipes.test.mjs +261 -0
  507. package/i18n/skills/a2h-utg-explorer/scripts/tests/semantics.test.mjs +102 -0
  508. package/i18n/skills/a2h-utg-explorer/scripts/tests/state_ambiguity.test.mjs +92 -0
  509. package/i18n/skills/a2h-utg-explorer/scripts/tests/twin_opener.test.mjs +119 -0
  510. package/i18n/skills/a2h-utg-explorer/scripts/tests/variant_strings.test.mjs +63 -0
  511. package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/diagnostics.mjs +196 -0
  512. package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/hybrid_route.mjs +140 -0
  513. package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/semantics.mjs +1562 -0
  514. package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/state_phase.mjs +47 -0
  515. package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/task_runner.mjs +2714 -0
  516. package/i18n/skills/a2h-utg-static/SKILL.md +372 -0
  517. package/i18n/skills/a2h-utg-static/references/ui-elements-static-utg-schema.md +248 -0
  518. package/i18n/skills/a2h-utg-static/references/view-interactions.md +215 -0
  519. package/i18n/skills/a2h-utg-static/scripts/assemble.mjs +2190 -0
  520. package/i18n/skills/a2h-utg-static/scripts/audit.mjs +268 -0
  521. package/i18n/skills/a2h-utg-static/scripts/click_paths.mjs +720 -0
  522. package/i18n/skills/a2h-utg-static/scripts/compose_body_text.mjs +250 -0
  523. package/i18n/skills/a2h-utg-static/scripts/compose_titles.mjs +374 -0
  524. package/i18n/skills/a2h-utg-static/scripts/compose_widgets.mjs +498 -0
  525. package/i18n/skills/a2h-utg-static/scripts/data_model.mjs +590 -0
  526. package/i18n/skills/a2h-utg-static/scripts/data_producers.mjs +431 -0
  527. package/i18n/skills/a2h-utg-static/scripts/fragment_nav.mjs +1137 -0
  528. package/i18n/skills/a2h-utg-static/scripts/hybrid_scope.mjs +705 -0
  529. package/i18n/skills/a2h-utg-static/scripts/interaction_sites.mjs +267 -0
  530. package/i18n/skills/a2h-utg-static/scripts/label_resolve.mjs +958 -0
  531. package/i18n/skills/a2h-utg-static/scripts/lib/hybrid-provenance.mjs +201 -0
  532. package/i18n/skills/a2h-utg-static/scripts/lib/uniapp-routes.mjs +195 -0
  533. package/i18n/skills/a2h-utg-static/scripts/nl_hints.mjs +545 -0
  534. package/i18n/skills/a2h-utg-static/scripts/presenter_nav.mjs +490 -0
  535. package/i18n/skills/a2h-utg-static/scripts/static_prior.mjs +956 -0
  536. package/i18n/skills/a2h-utg-static/scripts/tests/regression_matrix.mjs +1261 -0
  537. package/i18n/skills/a2h-utg-static/scripts/tests/test_callee_string_default.mjs +30 -0
  538. package/i18n/skills/a2h-utg-static/scripts/tests/test_chrome_tokens.mjs +60 -0
  539. package/i18n/skills/a2h-utg-static/scripts/tests/test_commented_out_trigger.mjs +111 -0
  540. package/i18n/skills/a2h-utg-static/scripts/tests/test_compose_res_text.mjs +125 -0
  541. package/i18n/skills/a2h-utg-static/scripts/tests/test_compose_vm_nav.mjs +289 -0
  542. package/i18n/skills/a2h-utg-static/scripts/tests/test_data_model.mjs +120 -0
  543. package/i18n/skills/a2h-utg-static/scripts/tests/test_data_producers.mjs +113 -0
  544. package/i18n/skills/a2h-utg-static/scripts/tests/test_disabled_guard.mjs +42 -0
  545. package/i18n/skills/a2h-utg-static/scripts/tests/test_drawer_panel_gesture.mjs +140 -0
  546. package/i18n/skills/a2h-utg-static/scripts/tests/test_fresh_branch_guard.mjs +49 -0
  547. package/i18n/skills/a2h-utg-static/scripts/tests/test_hint_language.mjs +136 -0
  548. package/i18n/skills/a2h-utg-static/scripts/tests/test_hybrid_bundle_attribution.mjs +74 -0
  549. package/i18n/skills/a2h-utg-static/scripts/tests/test_hybrid_bundled_pages.mjs +181 -0
  550. package/i18n/skills/a2h-utg-static/scripts/tests/test_hybrid_provenance.mjs +150 -0
  551. package/i18n/skills/a2h-utg-static/scripts/tests/test_hybrid_scope.mjs +457 -0
  552. package/i18n/skills/a2h-utg-static/scripts/tests/test_hybrid_title_renders.mjs +118 -0
  553. package/i18n/skills/a2h-utg-static/scripts/tests/test_label_accessor_forms.mjs +187 -0
  554. package/i18n/skills/a2h-utg-static/scripts/tests/test_label_source.mjs +70 -0
  555. package/i18n/skills/a2h-utg-static/scripts/tests/test_launch_intent_guard.mjs +67 -0
  556. package/i18n/skills/a2h-utg-static/scripts/tests/test_login_interceptor.mjs +368 -0
  557. package/i18n/skills/a2h-utg-static/scripts/tests/test_mode_and_cb_param.mjs +172 -0
  558. package/i18n/skills/a2h-utg-static/scripts/tests/test_module_strings.mjs +78 -0
  559. package/i18n/skills/a2h-utg-static/scripts/tests/test_nl_hint_grammar.mjs +42 -0
  560. package/i18n/skills/a2h-utg-static/scripts/tests/test_nl_hints_gate.mjs +85 -0
  561. package/i18n/skills/a2h-utg-static/scripts/tests/test_nl_hints_off_path.mjs +67 -0
  562. package/i18n/skills/a2h-utg-static/scripts/tests/test_non_gesture_step_flag.mjs +62 -0
  563. package/i18n/skills/a2h-utg-static/scripts/tests/test_preference_widgets.mjs +48 -0
  564. package/i18n/skills/a2h-utg-static/scripts/tests/test_read_text_crlf.mjs +41 -0
  565. package/i18n/skills/a2h-utg-static/scripts/tests/test_sealed_dialog_state.mjs +148 -0
  566. package/i18n/skills/a2h-utg-static/scripts/tests/test_state_specific_hop.mjs +130 -0
  567. package/i18n/skills/a2h-utg-static/scripts/tests/test_synthetic_label_identity.mjs +51 -0
  568. package/i18n/skills/a2h-utg-static/scripts/tests/test_template_title.mjs +61 -0
  569. package/i18n/skills/a2h-utg-static/scripts/tests/test_ui_elements_flow_filter.mjs +110 -0
  570. package/i18n/skills/a2h-utg-static/scripts/tests/test_uniapp_data_table.mjs +340 -0
  571. package/i18n/skills/a2h-utg-static/scripts/tests/test_uniapp_relative_url.mjs +125 -0
  572. package/i18n/skills/a2h-utg-static/scripts/tests/test_uniapp_routes.mjs +161 -0
  573. package/i18n/skills/a2h-utg-static/scripts/tests/test_uniapp_source.mjs +330 -0
  574. package/i18n/skills/a2h-utg-static/scripts/tests/test_utg_specgen_boundary.mjs +45 -0
  575. package/i18n/skills/a2h-utg-static/scripts/tests/test_viewpage_nav.mjs +340 -0
  576. package/i18n/skills/a2h-utg-static/scripts/uniapp_nav.mjs +1394 -0
  577. package/i18n/skills/a2h-utg-static/scripts/uniapp_widgets.mjs +244 -0
  578. package/i18n/skills/a2h-utg-static/tools/convert_static_utg_to_ui_elements.ts +769 -0
  579. package/package.json +11 -161
  580. package/platforms/deveco/agents/code-reviewer.frontmatter.md +1 -1
  581. package/platforms/opencode/agents/code-reviewer.frontmatter.md +1 -1
  582. package/skills/a2h-app-migrate/SKILL.md +31 -12
  583. package/skills/a2h-app-migrate/references/config.example.json +1 -0
  584. package/skills/a2h-app-migrate/references/feature-scope.md +121 -0
  585. package/skills/a2h-app-migrate/references/stage-map.md +4 -2
  586. package/skills/a2h-app-migrate/references/workflow.yaml +427 -103
  587. package/skills/a2h-app-migrate/scripts/android_index.mjs +35 -8
  588. package/skills/a2h-app-migrate/scripts/check_module_docs_done.mjs +39 -1
  589. package/skills/a2h-app-migrate/scripts/check_spec_gen_done.mjs +78 -6
  590. package/skills/a2h-app-migrate/scripts/check_spec_pipeline_done.mjs +144 -9
  591. package/skills/a2h-app-migrate/scripts/check_ui_batch_done.mjs +14 -1
  592. package/skills/a2h-app-migrate/scripts/check_utg_static_done.mjs +46 -5
  593. package/skills/a2h-app-migrate/scripts/diagnose.mjs +162 -0
  594. package/skills/a2h-app-migrate/scripts/env_preflight.mjs +178 -44
  595. package/skills/a2h-app-migrate/scripts/feature_scope.mjs +347 -0
  596. package/skills/a2h-app-migrate/scripts/human_review_gate.mjs +81 -11
  597. package/skills/a2h-app-migrate/scripts/infer_android_root.mjs +17 -1
  598. package/skills/a2h-app-migrate/scripts/ledger.mjs +80 -10
  599. package/skills/a2h-app-migrate/scripts/migration_manifest.mjs +351 -0
  600. package/skills/a2h-app-migrate/scripts/paths_preflight.mjs +9 -23
  601. package/skills/a2h-app-migrate/scripts/resume_plan.mjs +72 -12
  602. package/skills/a2h-app-migrate/scripts/reuse_static_utg.mjs +33 -1
  603. package/skills/a2h-app-migrate/scripts/run_dir.mjs +137 -41
  604. package/skills/a2h-app-migrate/scripts/scope_model.mjs +255 -0
  605. package/skills/a2h-app-migrate/scripts/scope_report.mjs +128 -0
  606. package/skills/a2h-app-migrate/scripts/source_fp.mjs +120 -0
  607. package/skills/a2h-app-migrate/scripts/spec_layout.mjs +2 -0
  608. package/skills/a2h-app-migrate/scripts/validate_workflow.mjs +38 -0
  609. package/skills/a2h-app-migrate/test/test_android_index.mjs +143 -0
  610. package/skills/a2h-app-migrate/test/test_apk_preflight.mjs +63 -0
  611. package/skills/a2h-app-migrate/test/test_arch_done.mjs +54 -0
  612. package/skills/a2h-app-migrate/test/test_build_fixer_contract.mjs +98 -0
  613. package/skills/a2h-app-migrate/test/test_config_example.mjs +42 -0
  614. package/skills/a2h-app-migrate/test/test_devecocli_docs_preflight.mjs +32 -0
  615. package/skills/a2h-app-migrate/test/test_ensure_utg_snapshot.mjs +147 -0
  616. package/skills/a2h-app-migrate/test/test_entry_guards.mjs +102 -0
  617. package/skills/a2h-app-migrate/test/test_env_requirements.mjs +713 -0
  618. package/skills/a2h-app-migrate/test/test_feature_scope.mjs +217 -0
  619. package/skills/a2h-app-migrate/test/test_finalize.mjs +117 -0
  620. package/skills/a2h-app-migrate/test/test_gate_checkpoint.mjs +146 -0
  621. package/skills/a2h-app-migrate/test/test_hmos_fingerprint.mjs +68 -0
  622. package/skills/a2h-app-migrate/test/test_i18n_engine_mirror.mjs +51 -0
  623. package/skills/a2h-app-migrate/test/test_image_probe.mjs +120 -0
  624. package/skills/a2h-app-migrate/test/test_incremental_acceptance.mjs +145 -0
  625. package/skills/a2h-app-migrate/test/test_incremental_phase2.mjs +223 -0
  626. package/skills/a2h-app-migrate/test/test_incremental_phase2_acceptance.mjs +157 -0
  627. package/skills/a2h-app-migrate/test/test_incremental_profile.mjs +84 -0
  628. package/skills/a2h-app-migrate/test/test_infer_android_root.mjs +101 -0
  629. package/skills/a2h-app-migrate/test/test_interaction.mjs +122 -0
  630. package/skills/a2h-app-migrate/test/test_json_io.mjs +32 -0
  631. package/skills/a2h-app-migrate/test/test_leaf_questions.mjs +150 -0
  632. package/skills/a2h-app-migrate/test/test_migration_manifest.mjs +225 -0
  633. package/skills/a2h-app-migrate/test/test_module_docs_done.mjs +86 -0
  634. package/skills/a2h-app-migrate/test/test_parse_args.mjs +69 -0
  635. package/skills/a2h-app-migrate/test/test_preflight_report.mjs +93 -0
  636. package/skills/a2h-app-migrate/test/test_resume_plan.mjs +271 -0
  637. package/skills/a2h-app-migrate/test/test_resume_summary.mjs +222 -0
  638. package/skills/a2h-app-migrate/test/test_reuse_static_utg.mjs +136 -0
  639. package/skills/a2h-app-migrate/test/test_run_dir.mjs +552 -0
  640. package/skills/a2h-app-migrate/test/test_scope_model.mjs +172 -0
  641. package/skills/a2h-app-migrate/test/test_skill_doc.mjs +144 -0
  642. package/skills/a2h-app-migrate/test/test_spec_engine_acceptance.mjs +94 -0
  643. package/skills/a2h-app-migrate/test/test_spec_engine_contract.mjs +155 -0
  644. package/skills/a2h-app-migrate/test/test_spec_gen_done.mjs +263 -0
  645. package/skills/a2h-app-migrate/test/test_spec_gen_gate.mjs +165 -0
  646. package/skills/a2h-app-migrate/test/test_spec_pipeline_done.mjs +511 -0
  647. package/skills/a2h-app-migrate/test/test_specs_json_preflight.mjs +76 -0
  648. package/skills/a2h-app-migrate/test/test_ui_batch_capture_audit.mjs +106 -0
  649. package/skills/a2h-app-migrate/test/test_ui_batch_done.mjs +65 -0
  650. package/skills/a2h-app-migrate/test/test_ui_batch_gate.mjs +226 -0
  651. package/skills/a2h-app-migrate/test/test_uniapp_preflight.mjs +83 -0
  652. package/skills/a2h-app-migrate/test/test_user_facing_progress.mjs +43 -0
  653. package/skills/a2h-app-migrate/test/test_utg_dirs.mjs +41 -0
  654. package/skills/a2h-app-migrate/test/test_utg_static_done.mjs +214 -0
  655. package/skills/a2h-app-migrate/test/test_validate_races.mjs +50 -0
  656. package/skills/a2h-app-migrate/test/test_validate_workflow_bilingual.mjs +87 -0
  657. package/skills/a2h-arch-generate/SKILL.md +20 -17
  658. package/skills/a2h-arch-generate/references/database-schema-recovery.md +2 -2
  659. package/skills/a2h-arch-generate/references/harmony-project-inspection.md +8 -8
  660. package/skills/a2h-arch-generate/references/homegraph-workflow.md +25 -14
  661. package/skills/a2h-arch-generate/references/module-evidence-subagent.md +2 -2
  662. package/skills/a2h-arch-generate/references/source-baseline.md +4 -4
  663. package/skills/a2h-arch-generate/scripts/cleanup_intermediates.mjs +34 -3
  664. package/skills/a2h-arch-generate/scripts/create_project.mjs +24 -1
  665. package/skills/a2h-arch-generate/scripts/generate_source_baseline.mjs +35 -46
  666. package/skills/a2h-arch-generate/scripts/inspect_and_route.mjs +29 -5
  667. package/skills/a2h-arch-generate/scripts/inspect_harmony_target.mjs +33 -40
  668. package/skills/a2h-arch-generate/scripts/module_create/generate.mjs +2 -3
  669. package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/android_source/app/build.gradle +11 -0
  670. package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/android_source/app/src/main/AndroidManifest.xml +12 -0
  671. package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/android_source/app/src/main/java/com/example/notes/MainActivity.kt +8 -0
  672. package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/android_source/app/src/main/java/com/example/notes/NotesStore.kt +17 -0
  673. package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/android_source/build.gradle +3 -0
  674. package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/android_source/settings.gradle +1 -0
  675. package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/AppScope/app.json5 +8 -0
  676. package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/build-profile.json5 +14 -0
  677. package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/common/utils/build-profile.json5 +7 -0
  678. package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/common/utils/oh-package.json5 +1 -0
  679. package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/common/utils/src/main/ets/utils/Format.ets +3 -0
  680. package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/features/home/build-profile.json5 +7 -0
  681. package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/features/home/oh-package.json5 +1 -0
  682. package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/features/home/src/main/ets/pages/Home.ets +3 -0
  683. package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/features/sync/build-profile.json5 +7 -0
  684. package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/features/sync/oh-package.json5 +1 -0
  685. package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/features/sync/src/main/ets/engine/SyncEngine.ets +3 -0
  686. package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/hvigorfile.ts +1 -0
  687. package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/oh-package.json5 +1 -0
  688. package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/products/app/build-profile.json5 +7 -0
  689. package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/products/app/oh-package.json5 +9 -0
  690. package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/products/app/src/main/ets/pages/Index.ets +7 -0
  691. package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/uniapp_source/App.vue +10 -0
  692. package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/uniapp_source/manifest.json +6 -0
  693. package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/uniapp_source/pages/index/index.vue +16 -0
  694. package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/uniapp_source/pages.json +5 -0
  695. package/skills/a2h-arch-generate/scripts/tests/e2e/run_e2e.mjs +548 -0
  696. package/skills/a2h-arch-generate/scripts/tests/run_tests.mjs +1260 -0
  697. package/skills/a2h-arch-generate/scripts/tests/test_cleanup.mjs +208 -0
  698. package/skills/a2h-arch-generate/scripts/tests/test_console_encoding.mjs +52 -0
  699. package/skills/a2h-arch-generate/scripts/tests/test_git_root.mjs +34 -0
  700. package/skills/a2h-arch-generate/scripts/tests/test_module_templates.mjs +70 -0
  701. package/skills/a2h-arch-generate/scripts/tests/test_router.mjs +164 -0
  702. package/skills/a2h-arch-generate/scripts/validate_architecture_docs.mjs +2 -5
  703. package/skills/a2h-arch-generate/scripts/validate_incremental_docs.mjs +4 -2
  704. package/skills/a2h-arkts-logic-coder/SKILL.md +163 -15
  705. package/skills/a2h-arkts-logic-coder/references/ISSUES.md +3 -1
  706. package/skills/a2h-arkts-logic-coder/references/code-generation.md +120 -1
  707. package/skills/a2h-arkts-logic-coder/references/spec-design.md +46 -11
  708. package/skills/a2h-arkts-logic-coder/scripts/design/validate_spec_design_output.mjs +22 -25
  709. package/skills/a2h-arkts-logic-coder/scripts/state_doc.mjs +873 -0
  710. package/skills/a2h-arkts-logic-coder/test/golden/inspect_happy.json +20 -0
  711. package/skills/a2h-arkts-logic-coder/test/golden/move_design.md +18 -0
  712. package/skills/a2h-arkts-logic-coder/test/golden/move_design_crlf.md +18 -0
  713. package/skills/a2h-arkts-logic-coder/test/golden/move_spec.md +7 -0
  714. package/skills/a2h-arkts-logic-coder/test/golden/resolve_cases.json +36 -0
  715. package/skills/a2h-arkts-logic-coder/test/golden/validate_issue_file.md +12 -0
  716. package/skills/a2h-arkts-logic-coder/test/golden/validate_issues.json +57 -0
  717. package/skills/a2h-arkts-logic-coder/test/test_spec_design_scripts.mjs +547 -0
  718. package/skills/a2h-arkts-logic-coder/test/test_state_doc.mjs +596 -0
  719. package/skills/a2h-batch-ui-align/SKILL.md +78 -26
  720. package/skills/a2h-batch-ui-align/assets/ColorUtils.ets +16 -2
  721. package/skills/a2h-batch-ui-align/references/cards/alignment.md +5 -1
  722. package/skills/a2h-batch-ui-align/references/cards/geometry.md +6 -1
  723. package/skills/a2h-batch-ui-align/references/cards/interaction.md +2 -1
  724. package/skills/a2h-batch-ui-align/references/cards/resources.md +9 -3
  725. package/skills/a2h-batch-ui-align/references/cards/widgets.md +27 -3
  726. package/skills/a2h-batch-ui-align/references/cards/window.md +2 -1
  727. package/skills/a2h-batch-ui-align/references/checker-rules.md +301 -13
  728. package/skills/a2h-batch-ui-align/references/conversion-procedure.md +53 -13
  729. package/skills/a2h-batch-ui-align/references/host-dispatch.md +2 -0
  730. package/skills/a2h-batch-ui-align/references/incremental-scope.md +28 -9
  731. package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +14 -9
  732. package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-interaction-mapping-reference.md +2 -2
  733. package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-layout-mapping-reference.md +28 -1
  734. package/skills/a2h-batch-ui-align/references/state-mgmt/_/350/243/205/351/245/260/345/231/250/351/200/237/346/237/245.md +30 -0
  735. package/skills/a2h-batch-ui-align/references/step3-capture.md +25 -6
  736. package/skills/a2h-batch-ui-align/references/step4-prepare.md +7 -2
  737. package/skills/a2h-batch-ui-align/references/step5-convert.md +33 -9
  738. package/skills/a2h-batch-ui-align/scripts/android_parse_fast.ts +6 -7
  739. package/skills/a2h-batch-ui-align/scripts/branch_coverage.mjs +155 -0
  740. package/skills/a2h-batch-ui-align/scripts/build_conversion_set.mjs +463 -22
  741. package/skills/a2h-batch-ui-align/scripts/capture_audit.mjs +474 -0
  742. package/skills/a2h-batch-ui-align/scripts/capture_fast.mjs +665 -0
  743. package/skills/a2h-batch-ui-align/scripts/capture_verify.mjs +552 -0
  744. package/skills/a2h-batch-ui-align/scripts/detach.mjs +5 -2
  745. package/skills/a2h-batch-ui-align/scripts/draw_coverage.mjs +264 -0
  746. package/skills/a2h-batch-ui-align/scripts/evidence_gate.mjs +263 -0
  747. package/skills/a2h-batch-ui-align/scripts/export_ui_info.mjs +20 -3
  748. package/skills/a2h-batch-ui-align/scripts/generate_pages_json.mjs +4 -5
  749. package/skills/a2h-batch-ui-align/scripts/group_pack.mjs +220 -35
  750. package/skills/a2h-batch-ui-align/scripts/group_queue.mjs +517 -41
  751. package/skills/a2h-batch-ui-align/scripts/icon_coverage.mjs +147 -0
  752. package/skills/a2h-batch-ui-align/scripts/image_probe.mjs +231 -54
  753. package/skills/a2h-batch-ui-align/scripts/list_existing.mjs +141 -0
  754. package/skills/a2h-batch-ui-align/scripts/measure_pack.ts +239 -14
  755. package/skills/a2h-batch-ui-align/scripts/page_gap.mjs +210 -0
  756. package/skills/a2h-batch-ui-align/scripts/phase5_check.mjs +98 -11
  757. package/skills/a2h-batch-ui-align/scripts/progress_identity.mjs +208 -0
  758. package/skills/a2h-batch-ui-align/scripts/scroll_verdict.mjs +62 -0
  759. package/skills/a2h-batch-ui-align/scripts/shell_contract.mjs +118 -4
  760. package/skills/a2h-batch-ui-align/scripts/shell_requests.mjs +273 -0
  761. package/skills/a2h-batch-ui-align/scripts/state_doc.mjs +9 -4
  762. package/skills/a2h-batch-ui-align/scripts/static_check/core/android.ts +231 -0
  763. package/skills/a2h-batch-ui-align/scripts/static_check/core/baseline.ts +79 -0
  764. package/skills/a2h-batch-ui-align/scripts/static_check/core/i18n.ts +1 -5
  765. package/skills/a2h-batch-ui-align/scripts/static_check/core/parse.ts +90 -2
  766. package/skills/a2h-batch-ui-align/scripts/static_check/core/scan.ts +44 -0
  767. package/skills/a2h-batch-ui-align/scripts/static_check/main.ts +61 -12
  768. package/skills/a2h-batch-ui-align/scripts/static_check/registry.ts +32 -0
  769. package/skills/a2h-batch-ui-align/scripts/static_check/rules/a11y.ts +3 -17
  770. package/skills/a2h-batch-ui-align/scripts/static_check/rules/android_immersive.ts +3 -3
  771. package/skills/a2h-batch-ui-align/scripts/static_check/rules/attr_chain.ts +1 -19
  772. package/skills/a2h-batch-ui-align/scripts/static_check/rules/blur_mirrored.ts +2 -2
  773. package/skills/a2h-batch-ui-align/scripts/static_check/rules/builder_invokes_callback.ts +84 -19
  774. package/skills/a2h-batch-ui-align/scripts/static_check/rules/color_string.ts +11 -4
  775. package/skills/a2h-batch-ui-align/scripts/static_check/rules/constant_coordinate.ts +2 -2
  776. package/skills/a2h-batch-ui-align/scripts/static_check/rules/dialog_backboard.ts +91 -0
  777. package/skills/a2h-batch-ui-align/scripts/static_check/rules/event_default_click.ts +179 -0
  778. package/skills/a2h-batch-ui-align/scripts/static_check/rules/framework_dialog.ts +110 -0
  779. package/skills/a2h-batch-ui-align/scripts/static_check/rules/framework_picker.ts +5 -5
  780. package/skills/a2h-batch-ui-align/scripts/static_check/rules/hit_test.ts +339 -0
  781. package/skills/a2h-batch-ui-align/scripts/static_check/rules/image_source.ts +84 -0
  782. package/skills/a2h-batch-ui-align/scripts/static_check/rules/input_traps.ts +249 -0
  783. package/skills/a2h-batch-ui-align/scripts/static_check/rules/layout_placement.ts +234 -5
  784. package/skills/a2h-batch-ui-align/scripts/static_check/rules/lottie_host.ts +145 -0
  785. package/skills/a2h-batch-ui-align/scripts/static_check/rules/media_content.ts +2 -2
  786. package/skills/a2h-batch-ui-align/scripts/static_check/rules/media_tint.ts +110 -12
  787. package/skills/a2h-batch-ui-align/scripts/static_check/rules/overlay_binds.ts +56 -0
  788. package/skills/a2h-batch-ui-align/scripts/static_check/rules/overlay_string.ts +96 -0
  789. package/skills/a2h-batch-ui-align/scripts/static_check/rules/padding_in_size.ts +179 -0
  790. package/skills/a2h-batch-ui-align/scripts/static_check/rules/percent_height_in_scroll.ts +3 -2
  791. package/skills/a2h-batch-ui-align/scripts/static_check/rules/popup_menu.ts +81 -8
  792. package/skills/a2h-batch-ui-align/scripts/static_check/rules/relative_container_height.ts +102 -0
  793. package/skills/a2h-batch-ui-align/scripts/static_check/rules/root_weight.ts +54 -4
  794. package/skills/a2h-batch-ui-align/scripts/static_check/rules/runtime_traps.ts +440 -0
  795. package/skills/a2h-batch-ui-align/scripts/static_check/rules/scroll_align.ts +75 -23
  796. package/skills/a2h-batch-ui-align/scripts/static_check/rules/scroll_delta.ts +178 -0
  797. package/skills/a2h-batch-ui-align/scripts/static_check/rules/swiper_index.ts +65 -0
  798. package/skills/a2h-batch-ui-align/scripts/static_check/rules/theme_color.ts +184 -0
  799. package/skills/a2h-batch-ui-align/scripts/static_check/rules/waterflow_sections.ts +231 -0
  800. package/skills/a2h-batch-ui-align/scripts/static_check/rules/wide_constant_width.ts +4 -4
  801. package/skills/a2h-batch-ui-align/scripts/static_check/rules/window_mode.ts +2 -3
  802. package/skills/a2h-batch-ui-align/scripts/static_check/scan_file.ts +30 -2
  803. package/skills/a2h-batch-ui-align/scripts/tests/agent_cli.test.mjs +231 -0
  804. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_a11y.test.mjs +598 -0
  805. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_align_tint.test.mjs +312 -0
  806. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_baseline.test.mjs +129 -0
  807. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_blur.test.mjs +217 -0
  808. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_builder_calls.test.mjs +323 -0
  809. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_canvas_pct.test.mjs +312 -0
  810. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_coolmall_runtime2.test.mjs +697 -0
  811. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_fidelity.test.mjs +507 -0
  812. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_hit_test.test.mjs +298 -0
  813. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_input_runtime.test.mjs +514 -0
  814. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_layout_placement.test.mjs +651 -0
  815. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_occlusion_offset_format.test.mjs +372 -0
  816. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_overlay_lottie.test.mjs +199 -0
  817. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_review_fixes.test.mjs +298 -0
  818. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_rule_smoke.test.mjs +269 -0
  819. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_rules.test.mjs +365 -0
  820. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_runtime_api.test.mjs +346 -0
  821. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_scroll_padding_raster.test.mjs +262 -0
  822. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_scroll_safearea.test.mjs +742 -0
  823. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_shell.test.mjs +91 -0
  824. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_theme.test.mjs +86 -0
  825. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_theme_runtime.test.mjs +95 -0
  826. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_weight_color.test.mjs +473 -0
  827. package/skills/a2h-batch-ui-align/scripts/tests/branch_coverage.test.mjs +116 -0
  828. package/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set.test.mjs +693 -0
  829. package/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set_scope.test.mjs +291 -0
  830. package/skills/a2h-batch-ui-align/scripts/tests/capture_audit.test.mjs +179 -0
  831. package/skills/a2h-batch-ui-align/scripts/tests/capture_fast.test.mjs +56 -0
  832. package/skills/a2h-batch-ui-align/scripts/tests/capture_gate.test.mjs +197 -0
  833. package/skills/a2h-batch-ui-align/scripts/tests/capture_review_fixes.test.mjs +322 -0
  834. package/skills/a2h-batch-ui-align/scripts/tests/color_utils_asset.test.mjs +93 -0
  835. package/skills/a2h-batch-ui-align/scripts/tests/detect_paradigm.test.mjs +260 -0
  836. package/skills/a2h-batch-ui-align/scripts/tests/draw_coverage.test.mjs +244 -0
  837. package/skills/a2h-batch-ui-align/scripts/tests/evidence_gate.test.mjs +435 -0
  838. package/skills/a2h-batch-ui-align/scripts/tests/export_scroll_states.test.mjs +31 -0
  839. package/skills/a2h-batch-ui-align/scripts/tests/export_ui_info.test.mjs +742 -0
  840. package/skills/a2h-batch-ui-align/scripts/tests/fixtures/icon_drift_search_sheet/SearchMenuDialog.buggy.ets +95 -0
  841. package/skills/a2h-batch-ui-align/scripts/tests/fixtures/icon_drift_search_sheet/page_0002_SearchMenuFragment/meta.json +21 -0
  842. package/skills/a2h-batch-ui-align/scripts/tests/fixtures/icon_drift_search_sheet/page_0002_SearchMenuFragment/screenshot.png +0 -0
  843. package/skills/a2h-batch-ui-align/scripts/tests/fixtures/icon_drift_search_sheet/page_0002_SearchMenuFragment/view.xml +35 -0
  844. package/skills/a2h-batch-ui-align/scripts/tests/generate_pages_json.test.mjs +123 -0
  845. package/skills/a2h-batch-ui-align/scripts/tests/group_commit.test.mjs +126 -0
  846. package/skills/a2h-batch-ui-align/scripts/tests/group_pack.test.mjs +363 -0
  847. package/skills/a2h-batch-ui-align/scripts/tests/group_pack_evidence.test.mjs +95 -0
  848. package/skills/a2h-batch-ui-align/scripts/tests/group_queue.test.mjs +1782 -0
  849. package/skills/a2h-batch-ui-align/scripts/tests/group_watch.test.mjs +215 -0
  850. package/skills/a2h-batch-ui-align/scripts/tests/harmony_index.test.mjs +95 -0
  851. package/skills/a2h-batch-ui-align/scripts/tests/host_env.test.mjs +115 -0
  852. package/skills/a2h-batch-ui-align/scripts/tests/icon_coverage.test.mjs +314 -0
  853. package/skills/a2h-batch-ui-align/scripts/tests/image_probe.test.mjs +243 -0
  854. package/skills/a2h-batch-ui-align/scripts/tests/list_existing.test.mjs +157 -0
  855. package/skills/a2h-batch-ui-align/scripts/tests/measure_pack.test.mjs +326 -0
  856. package/skills/a2h-batch-ui-align/scripts/tests/occlusion.test.mjs +102 -0
  857. package/skills/a2h-batch-ui-align/scripts/tests/page_gap.test.mjs +115 -0
  858. package/skills/a2h-batch-ui-align/scripts/tests/phase5_check.test.mjs +356 -0
  859. package/skills/a2h-batch-ui-align/scripts/tests/progress_identity.test.mjs +174 -0
  860. package/skills/a2h-batch-ui-align/scripts/tests/shell_contract.test.mjs +302 -0
  861. package/skills/a2h-batch-ui-align/scripts/tests/shell_requests.test.mjs +158 -0
  862. package/skills/a2h-batch-ui-align/scripts/tests/skill_doc_contract.test.mjs +60 -0
  863. package/skills/a2h-batch-ui-align/scripts/tests/state_doc.test.mjs +395 -0
  864. package/skills/a2h-batch-ui-align/scripts/tests/static_check_registry.test.mjs +122 -0
  865. package/skills/a2h-batch-ui-align/scripts/tests/test_bfs_exit.ts +49 -0
  866. package/skills/a2h-batch-ui-align/scripts/tests/text_color_diff.test.mjs +250 -0
  867. package/skills/a2h-coldstart-smoke-gate/SKILL.md +7 -4
  868. package/skills/a2h-dashboard-render/scripts/dashboard.mjs +12 -14
  869. package/skills/a2h-dashboard-render/scripts/device_capture.mjs +29 -30
  870. package/skills/a2h-dashboard-render/test/fixtures/page_capture/broken.xml +1 -0
  871. package/skills/a2h-dashboard-render/test/fixtures/page_capture/expected.json +156 -0
  872. package/skills/a2h-dashboard-render/test/fixtures/page_capture/hmos.json +1 -0
  873. package/skills/a2h-dashboard-render/test/fixtures/page_capture/list.xml +1 -0
  874. package/skills/a2h-dashboard-render/test/fixtures/page_capture/nested_scroll.xml +1 -0
  875. package/skills/a2h-dashboard-render/test/test_artifact_contract.mjs +168 -0
  876. package/skills/a2h-dashboard-render/test/test_cli_check_registry.mjs +99 -0
  877. package/skills/a2h-dashboard-render/test/test_dashboard_architecture.mjs +118 -0
  878. package/skills/a2h-dashboard-render/test/test_dashboard_build.mjs +93 -0
  879. package/skills/a2h-dashboard-render/test/test_dashboard_i18n.mjs +203 -0
  880. package/skills/a2h-dashboard-render/test/test_dashboard_node.mjs +1369 -0
  881. package/skills/a2h-dashboard-render/test/test_dashboard_spec_pipeline.mjs +318 -0
  882. package/skills/a2h-dashboard-render/test/test_dashboard_ui_pipeline.mjs +81 -0
  883. package/skills/a2h-dashboard-render/test/test_device_capture_env.mjs +115 -0
  884. package/skills/a2h-dashboard-render/test/test_device_capture_policy.mjs +411 -0
  885. package/skills/a2h-dashboard-render/test/test_device_locale_dialogs.mjs +17 -0
  886. package/skills/a2h-dashboard-render/test/test_page_capture.mjs +147 -0
  887. package/skills/a2h-dashboard-render/test/test_usage_readers.mjs +512 -0
  888. package/skills/a2h-module-semantic-docs/SKILL.md +51 -13
  889. package/skills/a2h-module-semantic-docs/scripts/scan_modules.mjs +66 -11
  890. package/skills/a2h-module-semantic-docs/test/golden/module_structure.json +187 -0
  891. package/skills/a2h-module-semantic-docs/test/golden/module_understanding.json +351 -0
  892. package/skills/a2h-module-semantic-docs/test/golden/module_update_plan.json +495 -0
  893. package/skills/a2h-module-semantic-docs/test/golden/project_directory_structure.json +157 -0
  894. package/skills/a2h-module-semantic-docs/test/test_incremental_fingerprint.mjs +94 -0
  895. package/skills/a2h-module-semantic-docs/test/test_scan_and_commit.mjs +388 -0
  896. package/skills/a2h-page-specgen/SKILL.md +240 -0
  897. package/skills/a2h-page-specgen/references/behavior-ledger.md +1170 -0
  898. package/skills/a2h-page-specgen/references/body-language.md +179 -0
  899. package/skills/a2h-page-specgen/references/evidence.md +105 -0
  900. package/skills/a2h-page-specgen/references/execution-model.md +364 -0
  901. package/skills/a2h-page-specgen/references/footprint-and-grouping.md +255 -0
  902. package/skills/a2h-page-specgen/references/gates.md +323 -0
  903. package/skills/a2h-page-specgen/references/page-inventory.md +220 -0
  904. package/skills/a2h-page-specgen/references/scenario-authoring.md +272 -0
  905. package/skills/a2h-page-specgen/references/spec-example.md +312 -0
  906. package/skills/a2h-page-specgen/references/spec-template.md +210 -0
  907. package/skills/a2h-page-specgen/scripts/behavior-audit.mjs +2436 -0
  908. package/skills/a2h-page-specgen/scripts/behavior-discovery.mjs +1833 -0
  909. package/skills/a2h-page-specgen/scripts/behavior-model.mjs +181 -0
  910. package/skills/a2h-page-specgen/scripts/behavior-reconcile.mjs +1205 -0
  911. package/skills/a2h-page-specgen/scripts/dispatch.mjs +212 -0
  912. package/skills/a2h-page-specgen/scripts/entry-evidence.mjs +1123 -0
  913. package/skills/a2h-page-specgen/scripts/facts-build.mjs +1613 -0
  914. package/skills/a2h-page-specgen/scripts/finalize.mjs +825 -0
  915. package/skills/a2h-page-specgen/scripts/footprint.mjs +1650 -0
  916. package/skills/a2h-page-specgen/scripts/gate.mjs +848 -0
  917. package/skills/a2h-page-specgen/scripts/interactions.mjs +344 -0
  918. package/skills/a2h-page-specgen/scripts/inventory.mjs +371 -0
  919. package/skills/a2h-page-specgen/scripts/lib/contracts.mjs +155 -0
  920. package/skills/a2h-page-specgen/scripts/lib/deps-source.mjs +399 -0
  921. package/skills/a2h-page-specgen/scripts/lib/draft-store.mjs +229 -0
  922. package/skills/a2h-page-specgen/scripts/lib/footprint-roles.mjs +278 -0
  923. package/skills/a2h-page-specgen/scripts/lib/fsx.mjs +79 -0
  924. package/skills/a2h-page-specgen/scripts/lib/graph-evidence.mjs +235 -0
  925. package/skills/a2h-page-specgen/scripts/lib/hg.mjs +683 -0
  926. package/skills/a2h-page-specgen/scripts/lib/homegraph-process.mjs +102 -0
  927. package/skills/a2h-page-specgen/scripts/lib/homegraph-query.mjs +161 -0
  928. package/skills/a2h-page-specgen/scripts/lib/ledger.mjs +478 -0
  929. package/skills/a2h-page-specgen/scripts/lib/main-module.mjs +24 -0
  930. package/skills/a2h-page-specgen/scripts/lib/operation-reviews.mjs +913 -0
  931. package/skills/a2h-page-specgen/scripts/lib/prose.mjs +238 -0
  932. package/skills/a2h-page-specgen/scripts/lib/reach.mjs +53 -0
  933. package/skills/a2h-page-specgen/scripts/lib/recovery-policy.mjs +28 -0
  934. package/skills/a2h-page-specgen/scripts/lib/scope.mjs +355 -0
  935. package/skills/a2h-page-specgen/scripts/lib/semantic-detail.mjs +353 -0
  936. package/skills/a2h-page-specgen/scripts/lib/source-text.mjs +497 -0
  937. package/skills/a2h-page-specgen/scripts/lib/symbols.mjs +125 -0
  938. package/skills/a2h-page-specgen/scripts/lib/utg-io.mjs +110 -0
  939. package/skills/a2h-page-specgen/scripts/lib/waker-event-store.mjs +658 -0
  940. package/skills/a2h-page-specgen/scripts/operation-evidence.mjs +1542 -0
  941. package/skills/a2h-page-specgen/scripts/prepare.mjs +840 -0
  942. package/skills/a2h-page-specgen/scripts/render.mjs +294 -0
  943. package/skills/a2h-page-specgen/scripts/report.mjs +340 -0
  944. package/skills/a2h-page-specgen/scripts/submission.mjs +697 -0
  945. package/skills/a2h-page-specgen/scripts/submit.mjs +85 -0
  946. package/skills/a2h-page-specgen/scripts/test/acceptance/README.md +77 -0
  947. package/skills/a2h-page-specgen/scripts/test/acceptance/acceptance.mjs +871 -0
  948. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.java +15 -0
  949. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.json +26 -0
  950. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.prompt.md +347 -0
  951. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.worker.md +298 -0
  952. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.java +36 -0
  953. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.json +43 -0
  954. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.prompt.md +347 -0
  955. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.worker.md +298 -0
  956. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.discovery.json +2694 -0
  957. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.json +726 -0
  958. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.post-review.json +108 -0
  959. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.prompt.md +347 -0
  960. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.review.md +65 -0
  961. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.worker.md +265 -0
  962. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.java +47 -0
  963. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.json +54 -0
  964. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.prompt.md +347 -0
  965. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.worker.md +298 -0
  966. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/branch-checklist.md +32 -0
  967. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/gate-results.json +22 -0
  968. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/manifest.json +111 -0
  969. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/portability.test.mjs +141 -0
  970. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/review.md +22 -0
  971. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/run.mjs +515 -0
  972. package/skills/a2h-page-specgen/scripts/test/acceptance/cases.example.json +57 -0
  973. package/skills/a2h-page-specgen/scripts/test/android-entry-evidence.test.mjs +585 -0
  974. package/skills/a2h-page-specgen/scripts/test/android-operation-evidence.test.mjs +755 -0
  975. package/skills/a2h-page-specgen/scripts/test/behavior-audit-group.test.mjs +543 -0
  976. package/skills/a2h-page-specgen/scripts/test/behavior-audit-post.test.mjs +652 -0
  977. package/skills/a2h-page-specgen/scripts/test/behavior-audit-pre.test.mjs +1231 -0
  978. package/skills/a2h-page-specgen/scripts/test/behavior-component-gate.test.mjs +494 -0
  979. package/skills/a2h-page-specgen/scripts/test/behavior-discovery.test.mjs +1513 -0
  980. package/skills/a2h-page-specgen/scripts/test/behavior-finalize.test.mjs +758 -0
  981. package/skills/a2h-page-specgen/scripts/test/behavior-fixtures.mjs +623 -0
  982. package/skills/a2h-page-specgen/scripts/test/behavior-model.test.mjs +116 -0
  983. package/skills/a2h-page-specgen/scripts/test/behavior-reconcile.test.mjs +795 -0
  984. package/skills/a2h-page-specgen/scripts/test/behavior-regression.test.mjs +883 -0
  985. package/skills/a2h-page-specgen/scripts/test/contracts.test.mjs +205 -0
  986. package/skills/a2h-page-specgen/scripts/test/dispatch.test.mjs +258 -0
  987. package/skills/a2h-page-specgen/scripts/test/entry-evidence.test.mjs +475 -0
  988. package/skills/a2h-page-specgen/scripts/test/facts.test.mjs +1203 -0
  989. package/skills/a2h-page-specgen/scripts/test/finalize.test.mjs +243 -0
  990. package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Api.kt +20 -0
  991. package/skills/a2h-page-specgen/scripts/test/fixtures/facts/BothAnnotations.kt +28 -0
  992. package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Cache.kt +7 -0
  993. package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Comments.kt +26 -0
  994. package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Mmkv.kt +7 -0
  995. package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Models.kt +19 -0
  996. package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Pair.kt +7 -0
  997. package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Prefs.kt +9 -0
  998. package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Room.kt +11 -0
  999. package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Sample.kt +43 -0
  1000. package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Templates.kt +34 -0
  1001. package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Timeouts.kt +8 -0
  1002. package/skills/a2h-page-specgen/scripts/test/fixtures/facts/androidTest/Helper.kt +5 -0
  1003. package/skills/a2h-page-specgen/scripts/test/fixtures/facts/build.gradle.kts +16 -0
  1004. package/skills/a2h-page-specgen/scripts/test/fixtures/facts/i18n/en.js.txt +5 -0
  1005. package/skills/a2h-page-specgen/scripts/test/fixtures/facts/i18n/zh.js.txt +4 -0
  1006. package/skills/a2h-page-specgen/scripts/test/fixtures/facts/libs.versions.toml +14 -0
  1007. package/skills/a2h-page-specgen/scripts/test/fixtures/facts/package.json +10 -0
  1008. package/skills/a2h-page-specgen/scripts/test/fixtures/facts/res/values/strings.xml +10 -0
  1009. package/skills/a2h-page-specgen/scripts/test/fixtures/facts/res/values-b+zh+Hans/strings.xml +4 -0
  1010. package/skills/a2h-page-specgen/scripts/test/fixtures/facts/res/values-land/strings.xml +5 -0
  1011. package/skills/a2h-page-specgen/scripts/test/fixtures/facts/res/values-night/strings.xml +5 -0
  1012. package/skills/a2h-page-specgen/scripts/test/fixtures/facts/res/values-v21/strings.xml +4 -0
  1013. package/skills/a2h-page-specgen/scripts/test/fixtures/facts/res/values-zh/strings.xml +4 -0
  1014. package/skills/a2h-page-specgen/scripts/test/fixtures/facts/test/Legacy.kt +4 -0
  1015. package/skills/a2h-page-specgen/scripts/test/fixtures/facts/weather.proto +11 -0
  1016. package/skills/a2h-page-specgen/scripts/test/fixtures/facts-container/src/AppPreferences.kt +13 -0
  1017. package/skills/a2h-page-specgen/scripts/test/fixtures/facts-container/src/SettingsViewModel.kt +16 -0
  1018. package/skills/a2h-page-specgen/scripts/test/fixtures/facts-dao/src/UserDao.kt +28 -0
  1019. package/skills/a2h-page-specgen/scripts/test/fixtures/facts-moko/i18n/src/commonMain/moko-resources/base/strings.xml +6 -0
  1020. package/skills/a2h-page-specgen/scripts/test/fixtures/facts-moko/i18n/src/commonMain/moko-resources/fil/strings.xml +6 -0
  1021. package/skills/a2h-page-specgen/scripts/test/fixtures/facts-pref/res/values/arrays.xml +25 -0
  1022. package/skills/a2h-page-specgen/scripts/test/fixtures/facts-pref/res/values/strings.xml +10 -0
  1023. package/skills/a2h-page-specgen/scripts/test/fixtures/facts-pref/res/xml/prefs.xml +27 -0
  1024. package/skills/a2h-page-specgen/scripts/test/fixtures/facts-pref/src/Api.java +19 -0
  1025. package/skills/a2h-page-specgen/scripts/test/fixtures/facts-pref/src/Datastore.kt +12 -0
  1026. package/skills/a2h-page-specgen/scripts/test/fixtures/facts-pref/src/Settings.java +13 -0
  1027. package/skills/a2h-page-specgen/scripts/test/fixtures/facts-pref/src/forecast.js +14 -0
  1028. package/skills/a2h-page-specgen/scripts/test/fixtures/facts-pref/src/store.js +14 -0
  1029. package/skills/a2h-page-specgen/scripts/test/fixtures/facts-receiver/src/BasePreferences.kt +13 -0
  1030. package/skills/a2h-page-specgen/scripts/test/fixtures/facts-receiver/src/Screen.kt +14 -0
  1031. package/skills/a2h-page-specgen/scripts/test/fixtures/facts-receiver/src/UiPreferences.kt +8 -0
  1032. package/skills/a2h-page-specgen/scripts/test/fixtures/facts-retrofit/src/AuthAPI.kt +26 -0
  1033. package/skills/a2h-page-specgen/scripts/test/fixtures/fp/AndroidManifest.xml +20 -0
  1034. package/skills/a2h-page-specgen/scripts/test/fixtures/fp/feature/auth/navigation/ScreenRoute.kt +8 -0
  1035. package/skills/a2h-page-specgen/scripts/test/fixtures/fp/pages.json +19 -0
  1036. package/skills/a2h-page-specgen/scripts/test/fixtures/fp/src/components/Widget.vue +11 -0
  1037. package/skills/a2h-page-specgen/scripts/test/fixtures/fp/src/pages/detail/detail.vue +14 -0
  1038. package/skills/a2h-page-specgen/scripts/test/fixtures/fp/src/pages/index/index.vue +24 -0
  1039. package/skills/a2h-page-specgen/scripts/test/fixtures/fp/src/store/userStore.js +11 -0
  1040. package/skills/a2h-page-specgen/scripts/test/fixtures/fp/src/uni_modules/uview-ui/components/u-thing.js +5 -0
  1041. package/skills/a2h-page-specgen/scripts/test/fixtures/fp.mkdb.mjs +144 -0
  1042. package/skills/a2h-page-specgen/scripts/test/fixtures/hg.mkdb.mjs +112 -0
  1043. package/skills/a2h-page-specgen/scripts/test/fixtures/src/BottomPanels.java +14 -0
  1044. package/skills/a2h-page-specgen/scripts/test/fixtures/src/BottomPanels.kt +14 -0
  1045. package/skills/a2h-page-specgen/scripts/test/fixtures/src/BottomPanelsKotlinForms.kt +12 -0
  1046. package/skills/a2h-page-specgen/scripts/test/fixtures/src/ChildContent.java +6 -0
  1047. package/skills/a2h-page-specgen/scripts/test/fixtures/src/ComposeLifecycle.kt +26 -0
  1048. package/skills/a2h-page-specgen/scripts/test/fixtures/src/LifecycleCallAndOverride.java +10 -0
  1049. package/skills/a2h-page-specgen/scripts/test/fixtures/src/LifecycleHooks.kt +31 -0
  1050. package/skills/a2h-page-specgen/scripts/test/fixtures/src/MainFragment.java +6 -0
  1051. package/skills/a2h-page-specgen/scripts/test/fixtures/src/ManyLifecycleHooks.kt +12 -0
  1052. package/skills/a2h-page-specgen/scripts/test/fixtures/src/ManyListeners.java +12 -0
  1053. package/skills/a2h-page-specgen/scripts/test/fixtures/src/PlainActivity.java +3 -0
  1054. package/skills/a2h-page-specgen/scripts/test/fixtures/src/RefreshOnResume.java +7 -0
  1055. package/skills/a2h-page-specgen/scripts/test/fixtures/src/RefreshResultNoise.kt +36 -0
  1056. package/skills/a2h-page-specgen/scripts/test/fixtures/src/SelectionView.java +5 -0
  1057. package/skills/a2h-page-specgen/scripts/test/fixtures/src/ShowPage.vue +12 -0
  1058. package/skills/a2h-page-specgen/scripts/test/fixtures/src/ThirdPartyLifecycle.kt +25 -0
  1059. package/skills/a2h-page-specgen/scripts/test/fixtures/src/fragment_detail.xml +1 -0
  1060. package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/App.vue +1 -0
  1061. package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/bundle-conflict-record.json +17 -0
  1062. package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/bundle-record.json +17 -0
  1063. package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/manifest.json +3 -0
  1064. package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/pages/list/index.vue +80 -0
  1065. package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/pages.json +14 -0
  1066. package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/source-record.json +15 -0
  1067. package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/components/RefreshPanel.vue +15 -0
  1068. package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/composables/useRefresh.ts +50 -0
  1069. package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/pages/help/index.vue +9 -0
  1070. package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/state/store.ts +4 -0
  1071. package/skills/a2h-page-specgen/scripts/test/fixtures/utg/click_paths.json +28 -0
  1072. package/skills/a2h-page-specgen/scripts/test/fixtures/utg/fold-chain/utg.json +12 -0
  1073. package/skills/a2h-page-specgen/scripts/test/fixtures/utg/utg.json +34 -0
  1074. package/skills/a2h-page-specgen/scripts/test/footprint-resolve.test.mjs +1029 -0
  1075. package/skills/a2h-page-specgen/scripts/test/footprint-roles.test.mjs +172 -0
  1076. package/skills/a2h-page-specgen/scripts/test/fsx.test.mjs +32 -0
  1077. package/skills/a2h-page-specgen/scripts/test/gate-partial.test.mjs +143 -0
  1078. package/skills/a2h-page-specgen/scripts/test/gate.test.mjs +1078 -0
  1079. package/skills/a2h-page-specgen/scripts/test/graph-evidence.test.mjs +332 -0
  1080. package/skills/a2h-page-specgen/scripts/test/helpers.mjs +188 -0
  1081. package/skills/a2h-page-specgen/scripts/test/hg.test.mjs +549 -0
  1082. package/skills/a2h-page-specgen/scripts/test/homegraph-process-fixture.mjs +130 -0
  1083. package/skills/a2h-page-specgen/scripts/test/homegraph-query.test.mjs +288 -0
  1084. package/skills/a2h-page-specgen/scripts/test/integration.test.mjs +368 -0
  1085. package/skills/a2h-page-specgen/scripts/test/interactions.test.mjs +310 -0
  1086. package/skills/a2h-page-specgen/scripts/test/inventory.test.mjs +250 -0
  1087. package/skills/a2h-page-specgen/scripts/test/keys.test.mjs +776 -0
  1088. package/skills/a2h-page-specgen/scripts/test/ledger-lock.test.mjs +77 -0
  1089. package/skills/a2h-page-specgen/scripts/test/ledger.test.mjs +464 -0
  1090. package/skills/a2h-page-specgen/scripts/test/main-module.test.mjs +43 -0
  1091. package/skills/a2h-page-specgen/scripts/test/operation-reviews.test.mjs +1002 -0
  1092. package/skills/a2h-page-specgen/scripts/test/plan-build.test.mjs +1103 -0
  1093. package/skills/a2h-page-specgen/scripts/test/prepare-homegraph-reproduction.mjs +365 -0
  1094. package/skills/a2h-page-specgen/scripts/test/prepare-homegraph.test.mjs +569 -0
  1095. package/skills/a2h-page-specgen/scripts/test/prepare-index.test.mjs +160 -0
  1096. package/skills/a2h-page-specgen/scripts/test/prepare-pipeline.test.mjs +326 -0
  1097. package/skills/a2h-page-specgen/scripts/test/prompt-tpl.test.mjs +236 -0
  1098. package/skills/a2h-page-specgen/scripts/test/prose.test.mjs +398 -0
  1099. package/skills/a2h-page-specgen/scripts/test/protocol-docs.test.mjs +531 -0
  1100. package/skills/a2h-page-specgen/scripts/test/reach.test.mjs +93 -0
  1101. package/skills/a2h-page-specgen/scripts/test/recovery-e2e.test.mjs +418 -0
  1102. package/skills/a2h-page-specgen/scripts/test/recovery-policy.test.mjs +14 -0
  1103. package/skills/a2h-page-specgen/scripts/test/recovery.test.mjs +1782 -0
  1104. package/skills/a2h-page-specgen/scripts/test/render.test.mjs +546 -0
  1105. package/skills/a2h-page-specgen/scripts/test/report.test.mjs +296 -0
  1106. package/skills/a2h-page-specgen/scripts/test/review-followup.test.mjs +467 -0
  1107. package/skills/a2h-page-specgen/scripts/test/scope.test.mjs +292 -0
  1108. package/skills/a2h-page-specgen/scripts/test/semantic-detail.test.mjs +949 -0
  1109. package/skills/a2h-page-specgen/scripts/test/source-text.test.mjs +181 -0
  1110. package/skills/a2h-page-specgen/scripts/test/submit.test.mjs +1231 -0
  1111. package/skills/a2h-page-specgen/scripts/test/uniapp-operation-evidence.test.mjs +639 -0
  1112. package/skills/a2h-page-specgen/scripts/test/utg-footprint-contract.test.mjs +274 -0
  1113. package/skills/a2h-page-specgen/scripts/test/utg-io.test.mjs +90 -0
  1114. package/skills/a2h-page-specgen/scripts/test/waker-event-store.test.mjs +1365 -0
  1115. package/skills/a2h-page-specgen/scripts/test/waker-process.test.mjs +1801 -0
  1116. package/skills/a2h-page-specgen/scripts/test/waker.test.mjs +1993 -0
  1117. package/skills/a2h-page-specgen/scripts/test/watchdog.test.mjs +342 -0
  1118. package/skills/a2h-page-specgen/scripts/waker.mjs +1301 -0
  1119. package/skills/a2h-page-specgen/scripts/watchdog.mjs +299 -0
  1120. package/skills/a2h-resource-convert/SKILL.md +9 -1
  1121. package/skills/a2h-resource-convert/references/code-vector-icon-rules.md +2 -1
  1122. package/skills/a2h-resource-convert/references/incremental-page-migration.md +23 -2
  1123. package/skills/a2h-resource-convert/references/lottie-conversion-rules.md +7 -0
  1124. package/skills/a2h-resource-convert/references/step4-resource-types.md +2 -0
  1125. package/skills/a2h-resource-convert/scripts/a2h_resource_convert.ts +115 -53
  1126. package/skills/a2h-resource-convert/scripts/a2h_resource_incremental.ts +68 -0
  1127. package/skills/a2h-resource-convert/scripts/code_vector_icons.ts +45 -3
  1128. package/skills/a2h-resource-convert/scripts/extract_page_resources.ts +42 -5
  1129. package/skills/a2h-resource-convert/scripts/lottie_hosts.ts +415 -0
  1130. package/skills/a2h-resource-convert/scripts/lottie_refs.ts +398 -0
  1131. package/skills/a2h-resource-convert/scripts/merge_mapping.ts +316 -0
  1132. package/skills/a2h-resource-convert/scripts/svg_fidelity_check.ts +2 -1
  1133. package/skills/a2h-resource-convert/scripts/tests/adaptive_icon.test.mjs +182 -0
  1134. package/skills/a2h-resource-convert/scripts/tests/app_identity.test.mjs +206 -0
  1135. package/skills/a2h-resource-convert/scripts/tests/code_vector_guard.test.mjs +75 -0
  1136. package/skills/a2h-resource-convert/scripts/tests/docs_only_i18n.test.mjs +44 -0
  1137. package/skills/a2h-resource-convert/scripts/tests/lottie_hosts.test.mjs +222 -0
  1138. package/skills/a2h-resource-convert/scripts/tests/lottie_incremental.test.mjs +178 -0
  1139. package/skills/a2h-resource-convert/scripts/tests/merge_mapping.test.mjs +201 -0
  1140. package/skills/a2h-spec-design-pipeline/SKILL.md +98 -121
  1141. package/skills/a2h-spec-design-pipeline/references/coding-loop.md +170 -45
  1142. package/skills/a2h-spec-design-pipeline/references/execution-model.md +62 -12
  1143. package/skills/a2h-spec-design-pipeline/references/final-report-template.md +6 -4
  1144. package/skills/a2h-spec-design-pipeline/references/homegraph-cli.md +229 -0
  1145. package/skills/a2h-spec-design-pipeline/references/initialization.md +49 -6
  1146. package/skills/a2h-spec-design-pipeline/references/merge-queue.md +198 -54
  1147. package/skills/a2h-spec-design-pipeline/references/permission-index.json +206 -0
  1148. package/skills/a2h-spec-design-pipeline/references/post-loop.md +23 -0
  1149. package/skills/a2h-spec-design-pipeline/references/resolver-prompt.md +67 -0
  1150. package/skills/a2h-spec-design-pipeline/references/review-loop.md +46 -0
  1151. package/skills/a2h-spec-design-pipeline/references/scripts.md +47 -14
  1152. package/skills/a2h-spec-design-pipeline/references/shared-layer.md +390 -0
  1153. package/skills/a2h-spec-design-pipeline/references/state-and-resume.md +148 -29
  1154. package/skills/a2h-spec-design-pipeline/references/static-defect-gate.md +104 -24
  1155. package/skills/a2h-spec-design-pipeline/rules/migration-rules/config/ruleMeta.json +18 -0
  1156. package/skills/a2h-spec-design-pipeline/rules/migration-rules/config/ruleSet.json +16 -0
  1157. package/skills/a2h-spec-design-pipeline/rules/migration-rules/data/README.md +47 -0
  1158. package/skills/a2h-spec-design-pipeline/rules/migration-rules/data/api-param-contract.json +31 -0
  1159. package/skills/a2h-spec-design-pipeline/rules/migration-rules/data/api-permission-map.json +698 -0
  1160. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/api-permission-declared-cn.md +96 -0
  1161. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/api-permission-declared-en.md +103 -0
  1162. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/arkui-runtime-pitfall-cn.md +124 -0
  1163. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/arkui-runtime-pitfall-en.md +138 -0
  1164. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/platform-api-contract-cn.md +106 -0
  1165. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/platform-api-contract-en.md +113 -0
  1166. package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/ApiPermissionDeclaredCheck.js +705 -0
  1167. package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/ArkUIRuntimePitfallCheck.js +1063 -0
  1168. package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/PlatformApiContractCheck.js +473 -0
  1169. package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/platform/ExtraDataSubCheck.js +485 -0
  1170. package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/index.js +13 -0
  1171. package/skills/a2h-spec-design-pipeline/rules/migration-rules/package.json +18 -0
  1172. package/skills/a2h-spec-design-pipeline/scripts/branch_landed.ts +12 -38
  1173. package/skills/a2h-spec-design-pipeline/scripts/check_design_map.ts +108 -0
  1174. package/skills/a2h-spec-design-pipeline/scripts/check_permissions.ts +420 -0
  1175. package/skills/a2h-spec-design-pipeline/scripts/check_review_evidence.ts +45 -0
  1176. package/skills/a2h-spec-design-pipeline/scripts/dispatch/evidence.mjs +95 -7
  1177. package/skills/a2h-spec-design-pipeline/scripts/dispatch/fold.mjs +156 -7
  1178. package/skills/a2h-spec-design-pipeline/scripts/dispatch/landing.mjs +71 -0
  1179. package/skills/a2h-spec-design-pipeline/scripts/dispatch/progress.mjs +22 -3
  1180. package/skills/a2h-spec-design-pipeline/scripts/dispatch/reconcile.mjs +63 -4
  1181. package/skills/a2h-spec-design-pipeline/scripts/dispatch/wait.mjs +33 -3
  1182. package/skills/a2h-spec-design-pipeline/scripts/dispatch/worktree.mjs +2 -2
  1183. package/skills/a2h-spec-design-pipeline/scripts/dispatch.mjs +232 -13
  1184. package/skills/a2h-spec-design-pipeline/scripts/ensure_index.ts +866 -0
  1185. package/skills/a2h-spec-design-pipeline/scripts/fixtures/homecheck-stub.cjs +47 -0
  1186. package/skills/a2h-spec-design-pipeline/scripts/homecheck_scan.ts +220 -44
  1187. package/skills/a2h-spec-design-pipeline/scripts/lib/shared_classes.ts +113 -0
  1188. package/skills/a2h-spec-design-pipeline/scripts/lib/shared_docs.ts +202 -0
  1189. package/skills/a2h-spec-design-pipeline/scripts/lib/wiring.ts +58 -0
  1190. package/skills/a2h-spec-design-pipeline/scripts/plan_groups.ts +178 -14
  1191. package/skills/a2h-spec-design-pipeline/scripts/resolve_wiring.ts +3 -0
  1192. package/skills/a2h-spec-design-pipeline/scripts/resolver_prompt.ts +368 -0
  1193. package/skills/a2h-spec-design-pipeline/scripts/scan_shared.ts +642 -0
  1194. package/skills/a2h-spec-design-pipeline/scripts/sync_permission_index.ts +340 -0
  1195. package/skills/a2h-spec-design-pipeline/scripts/test_api_permission_declared.ts +281 -0
  1196. package/skills/a2h-spec-design-pipeline/scripts/test_arkui_runtime_pitfall.ts +690 -0
  1197. package/skills/a2h-spec-design-pipeline/scripts/test_check_design_map.ts +46 -0
  1198. package/skills/a2h-spec-design-pipeline/scripts/test_check_permissions.ts +201 -0
  1199. package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_commands.mjs +42 -8
  1200. package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_e2e.mjs +27 -9
  1201. package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_evidence.mjs +242 -9
  1202. package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_fold.mjs +192 -7
  1203. package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_landing.mjs +531 -0
  1204. package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_progress.mjs +49 -1
  1205. package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_reconcile.mjs +92 -4
  1206. package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_wait.mjs +51 -0
  1207. package/skills/a2h-spec-design-pipeline/scripts/test_ensure_index.ts +572 -0
  1208. package/skills/a2h-spec-design-pipeline/scripts/test_ensure_index_real.ts +56 -0
  1209. package/skills/a2h-spec-design-pipeline/scripts/test_homecheck_scan.ts +17 -10
  1210. package/skills/a2h-spec-design-pipeline/scripts/test_homegraph_docs.ts +217 -0
  1211. package/skills/a2h-spec-design-pipeline/scripts/test_permission_index.ts +214 -0
  1212. package/skills/a2h-spec-design-pipeline/scripts/test_plan_groups.ts +155 -0
  1213. package/skills/a2h-spec-design-pipeline/scripts/test_platform_api_contract.ts +308 -0
  1214. package/skills/a2h-spec-design-pipeline/scripts/test_resolve_wiring.ts +14 -0
  1215. package/skills/a2h-spec-design-pipeline/scripts/test_resolver_prompt.ts +401 -0
  1216. package/skills/a2h-spec-design-pipeline/scripts/test_scan_shared.ts +996 -0
  1217. package/skills/a2h-spec-design-pipeline/scripts/test_shared_classes.ts +80 -0
  1218. package/skills/a2h-spec-design-pipeline/scripts/test_shared_docs.ts +205 -0
  1219. package/skills/a2h-spec-design-pipeline/scripts/test_shared_layer_docs.ts +165 -0
  1220. package/skills/a2h-spec-design-pipeline/scripts/test_shared_layer_e2e.ts +85 -0
  1221. package/skills/a2h-spec-design-pipeline/scripts/test_validate_shared_manifest.ts +720 -0
  1222. package/skills/a2h-spec-design-pipeline/scripts/test_wiring.ts +40 -0
  1223. package/skills/a2h-spec-design-pipeline/scripts/validate_shared_manifest.ts +566 -0
  1224. package/skills/a2h-spec-generate/SKILL.md +89 -23
  1225. package/skills/a2h-spec-generate/references/batch-mode.md +78 -17
  1226. package/skills/a2h-spec-generate/references/dispatch-watchdog.md +150 -0
  1227. package/skills/a2h-spec-generate/references/fusion-task-contract.md +7 -0
  1228. package/skills/a2h-spec-generate/references/review-checklist.md +1 -0
  1229. package/skills/a2h-spec-generate/references/specs.schema.json +24 -11
  1230. package/skills/a2h-spec-generate/references/synthesis-rules.md +4 -2
  1231. package/skills/a2h-spec-generate/references/worker-rules.md +6 -3
  1232. package/skills/a2h-spec-generate/scripts/check-fused-spec.mjs +4 -5
  1233. package/skills/a2h-spec-generate/scripts/check_spec.ts +145 -14
  1234. package/skills/a2h-spec-generate/scripts/collect-specs.mjs +261 -19
  1235. package/skills/a2h-spec-generate/scripts/dispatch-watch.mjs +1168 -0
  1236. package/skills/a2h-spec-generate/scripts/ensure-index.mjs +1 -2
  1237. package/skills/a2h-spec-generate/scripts/feature-stem.mjs +1 -2
  1238. package/skills/a2h-spec-generate/scripts/publish-specs.mjs +1 -2
  1239. package/skills/a2h-spec-generate/scripts/regroup-by-page.mjs +1 -2
  1240. package/skills/a2h-spec-generate/scripts/render-tasks.mjs +25 -46
  1241. package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/graph/build.ts +26 -27
  1242. package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/graph/component-variants.ts +3 -6
  1243. package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/names/policy.ts +31 -32
  1244. package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/names/traceability.ts +2 -3
  1245. package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/req-model/build.ts +15 -26
  1246. package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/area-facts.ts +102 -81
  1247. package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/behavior-seed.ts +39 -19
  1248. package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/library-evidence.ts +12 -13
  1249. package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/navigation-guard.ts +363 -0
  1250. package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/task-contract.ts +35 -196
  1251. package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/contracts.ts +3 -1
  1252. package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/task-contract.ts +22 -96
  1253. package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/tree-sitter-adapter.ts +3 -4
  1254. package/skills/a2h-spec-generate/scripts/reqgen/src/model/contracts.ts +1 -1
  1255. package/skills/a2h-spec-generate/scripts/reqgen/src/model/finalize.ts +74 -7
  1256. package/skills/a2h-spec-generate/scripts/reqgen/src/model/prepare.ts +51 -7
  1257. package/skills/a2h-spec-generate/scripts/reqgen/src/model/task.ts +42 -111
  1258. package/skills/a2h-spec-generate/scripts/reqgen/src/requirement-scope.ts +1 -20
  1259. package/skills/a2h-spec-generate/scripts/reqgen/src/source-index/homegraph.ts +1 -2
  1260. package/skills/a2h-spec-generate/scripts/reqgen/src/validation/req-text.ts +3 -4
  1261. package/skills/a2h-spec-generate/scripts/reqgen/test/control-fact-join.test.ts +50 -0
  1262. package/skills/a2h-spec-generate/scripts/reqgen/test/control-name-uniapp.test.ts +75 -0
  1263. package/skills/a2h-spec-generate/scripts/reqgen/test/cross-area-anchor.test.ts +256 -0
  1264. package/skills/a2h-spec-generate/scripts/reqgen/test/fixtures/fusion-run.ts +243 -0
  1265. package/skills/a2h-spec-generate/scripts/reqgen/test/fixtures/zip.ts +63 -0
  1266. package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-area-facts.test.ts +650 -0
  1267. package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-behavior-detectors.test.ts +176 -0
  1268. package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-behavior-e2e.test.ts +103 -0
  1269. package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-behavior-schema.test.ts +111 -0
  1270. package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-behavior-seed.test.ts +195 -0
  1271. package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-behavior-selfcheck.test.ts +307 -0
  1272. package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-contract.test.ts +347 -0
  1273. package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-finalize.test.ts +1948 -0
  1274. package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-library-evidence.test.ts +239 -0
  1275. package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-navigation-guard.test.ts +277 -0
  1276. package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-prepare.test.ts +844 -0
  1277. package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-scope.test.ts +339 -0
  1278. package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-selfcheck.test.ts +1253 -0
  1279. package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-spec.test.ts +608 -0
  1280. package/skills/a2h-spec-generate/scripts/reqgen/test/model-cli-blockers.test.ts +117 -0
  1281. package/skills/a2h-spec-generate/scripts/reqgen/test/model-scope.test.ts +411 -0
  1282. package/skills/a2h-spec-generate/scripts/reqgen/test/model-seeds.test.ts +175 -0
  1283. package/skills/a2h-spec-generate/scripts/reqgen/test/model-task-contract.test.ts +300 -0
  1284. package/skills/a2h-spec-generate/scripts/reqgen/test/model-v4.test.ts +1061 -0
  1285. package/skills/a2h-spec-generate/scripts/reqgen/test/specgen-completeness.test.ts +286 -0
  1286. package/skills/a2h-spec-generate/scripts/reqgen/test/stagem-stored-path.test.ts +25 -0
  1287. package/skills/a2h-spec-generate/scripts/reqgen/test/uniapp-scanner.test.ts +159 -0
  1288. package/skills/a2h-spec-generate/scripts/reqgen/test/zip.test.ts +61 -0
  1289. package/skills/a2h-spec-generate/test/check-fused-spec.test.mjs +879 -0
  1290. package/skills/a2h-spec-generate/test/check-spec.test.ts +430 -0
  1291. package/skills/a2h-spec-generate/test/collect-specs.test.mjs +811 -0
  1292. package/skills/a2h-spec-generate/test/detect-project.test.mjs +37 -0
  1293. package/skills/a2h-spec-generate/test/dispatch-watch.test.mjs +606 -0
  1294. package/skills/a2h-spec-generate/test/ensure-index.test.mjs +229 -0
  1295. package/skills/a2h-spec-generate/test/feature-stem.test.mjs +157 -0
  1296. package/skills/a2h-spec-generate/test/fixtures/android/app/src/main/AndroidManifest.xml +3 -0
  1297. package/skills/a2h-spec-generate/test/fixtures/android/build.gradle +3 -0
  1298. package/skills/a2h-spec-generate/test/fixtures/android/settings.gradle +3 -0
  1299. package/skills/a2h-spec-generate/test/fixtures/uniapp-src/package.json +9 -0
  1300. package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/App.vue +8 -0
  1301. package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/components/MyCard.vue +9 -0
  1302. package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/feature/editor/index.vue +1 -0
  1303. package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/main.ts +6 -0
  1304. package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/manifest.json +4 -0
  1305. package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/pages/detail/index.vue +1 -0
  1306. package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/pages/home/index.vue +33 -0
  1307. package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/pages/settings/index.vue +1 -0
  1308. package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/pages.json +23 -0
  1309. package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/services/items.ts +3 -0
  1310. package/skills/a2h-spec-generate/test/fixtures/uniapp-src/tsconfig.json +8 -0
  1311. package/skills/a2h-spec-generate/test/fixtures/unknown/README.txt +1 -0
  1312. package/skills/a2h-spec-generate/test/inspect-uniapp.test.mjs +54 -0
  1313. package/skills/a2h-spec-generate/test/prepare-facts.test.mjs +41 -0
  1314. package/skills/a2h-spec-generate/test/publication-verdict.test.mjs +182 -0
  1315. package/skills/a2h-spec-generate/test/publish-specs.test.mjs +295 -0
  1316. package/skills/a2h-spec-generate/test/regroup-by-page.test.mjs +354 -0
  1317. package/skills/a2h-spec-generate/test/render-tasks.test.mjs +596 -0
  1318. package/skills/a2h-spec-generate/test/report.test.mjs +47 -0
  1319. package/skills/a2h-utg-explorer/SKILL.md +9 -3
  1320. package/skills/a2h-utg-explorer/references/architecture.md +7 -0
  1321. package/skills/a2h-utg-explorer/scripts/audit.mjs +8 -2
  1322. package/skills/a2h-utg-explorer/scripts/compile_tasks.mjs +120 -85
  1323. package/skills/a2h-utg-explorer/scripts/direct_launch.mjs +47 -2
  1324. package/skills/a2h-utg-explorer/scripts/hint_check.mjs +1 -2
  1325. package/skills/a2h-utg-explorer/scripts/hybrid_route_cdp.mjs +376 -0
  1326. package/skills/a2h-utg-explorer/scripts/plan.mjs +8 -0
  1327. package/skills/a2h-utg-explorer/scripts/recover.mjs +1 -1
  1328. package/skills/a2h-utg-explorer/scripts/recover_d.mjs +288 -21
  1329. package/skills/a2h-utg-explorer/scripts/rejudge.mjs +5 -3
  1330. package/skills/a2h-utg-explorer/scripts/report.mjs +89 -0
  1331. package/skills/a2h-utg-explorer/scripts/run_cycle.mjs +67 -10
  1332. package/skills/a2h-utg-explorer/scripts/run_device.mjs +10 -2
  1333. package/skills/a2h-utg-explorer/scripts/seed_recipes.mjs +426 -0
  1334. package/skills/a2h-utg-explorer/scripts/tests/attest.test.mjs +66 -0
  1335. package/skills/a2h-utg-explorer/scripts/tests/blank_wait.test.mjs +126 -0
  1336. package/skills/a2h-utg-explorer/scripts/tests/calendar_round_fixes.test.mjs +244 -0
  1337. package/skills/a2h-utg-explorer/scripts/tests/chain.test.mjs +45 -0
  1338. package/skills/a2h-utg-explorer/scripts/tests/compose_identity.test.mjs +302 -0
  1339. package/skills/a2h-utg-explorer/scripts/tests/content_wait.test.mjs +207 -0
  1340. package/skills/a2h-utg-explorer/scripts/tests/coverage_rules.test.mjs +104 -0
  1341. package/skills/a2h-utg-explorer/scripts/tests/d_prereqs.test.mjs +231 -0
  1342. package/skills/a2h-utg-explorer/scripts/tests/default_override.test.mjs +109 -0
  1343. package/skills/a2h-utg-explorer/scripts/tests/device_health.test.mjs +160 -0
  1344. package/skills/a2h-utg-explorer/scripts/tests/device_locale_dialogs.test.mjs +29 -0
  1345. package/skills/a2h-utg-explorer/scripts/tests/device_locale_identity.test.mjs +77 -0
  1346. package/skills/a2h-utg-explorer/scripts/tests/device_lock_retry.test.mjs +187 -0
  1347. package/skills/a2h-utg-explorer/scripts/tests/diagnostics.test.mjs +254 -0
  1348. package/skills/a2h-utg-explorer/scripts/tests/direct_launch.test.mjs +130 -0
  1349. package/skills/a2h-utg-explorer/scripts/tests/explorer_review_fixes.test.mjs +137 -0
  1350. package/skills/a2h-utg-explorer/scripts/tests/final_utg.test.mjs +135 -0
  1351. package/skills/a2h-utg-explorer/scripts/tests/first_round_phases.test.mjs +16 -0
  1352. package/skills/a2h-utg-explorer/scripts/tests/foreground_spelling.test.mjs +155 -0
  1353. package/skills/a2h-utg-explorer/scripts/tests/fresh_state_plan.test.mjs +78 -0
  1354. package/skills/a2h-utg-explorer/scripts/tests/generalization_fixes.test.mjs +252 -0
  1355. package/skills/a2h-utg-explorer/scripts/tests/hint_check.test.mjs +129 -0
  1356. package/skills/a2h-utg-explorer/scripts/tests/holds_without_data_parity.test.mjs +26 -0
  1357. package/skills/a2h-utg-explorer/scripts/tests/hybrid_route.test.mjs +120 -0
  1358. package/skills/a2h-utg-explorer/scripts/tests/hybrid_route_identity.test.mjs +146 -0
  1359. package/skills/a2h-utg-explorer/scripts/tests/interruptions.test.mjs +614 -0
  1360. package/skills/a2h-utg-explorer/scripts/tests/launch_bridge.test.mjs +214 -0
  1361. package/skills/a2h-utg-explorer/scripts/tests/launch_failure.test.mjs +40 -0
  1362. package/skills/a2h-utg-explorer/scripts/tests/node_coverage.test.mjs +193 -0
  1363. package/skills/a2h-utg-explorer/scripts/tests/overflow_prefix.test.mjs +327 -0
  1364. package/skills/a2h-utg-explorer/scripts/tests/overlay_identity.test.mjs +204 -0
  1365. package/skills/a2h-utg-explorer/scripts/tests/page_identity_tiers.test.mjs +393 -0
  1366. package/skills/a2h-utg-explorer/scripts/tests/pager_navigation.test.mjs +119 -0
  1367. package/skills/a2h-utg-explorer/scripts/tests/panel_routes.test.mjs +208 -0
  1368. package/skills/a2h-utg-explorer/scripts/tests/pipeline.test.mjs +240 -0
  1369. package/skills/a2h-utg-explorer/scripts/tests/pr169_review_fixes.test.mjs +218 -0
  1370. package/skills/a2h-utg-explorer/scripts/tests/pr191_review_fixes.test.mjs +292 -0
  1371. package/skills/a2h-utg-explorer/scripts/tests/recover.test.mjs +212 -0
  1372. package/skills/a2h-utg-explorer/scripts/tests/recover_b.test.mjs +173 -0
  1373. package/skills/a2h-utg-explorer/scripts/tests/recover_d.test.mjs +280 -0
  1374. package/skills/a2h-utg-explorer/scripts/tests/recover_d_grounding.test.mjs +164 -0
  1375. package/skills/a2h-utg-explorer/scripts/tests/replay_reroute.test.mjs +143 -0
  1376. package/skills/a2h-utg-explorer/scripts/tests/review_fixes.test.mjs +213 -0
  1377. package/skills/a2h-utg-explorer/scripts/tests/robustness_fixes.test.mjs +345 -0
  1378. package/skills/a2h-utg-explorer/scripts/tests/run_cycle.test.mjs +458 -0
  1379. package/skills/a2h-utg-explorer/scripts/tests/run_cycle_follow.test.mjs +35 -0
  1380. package/skills/a2h-utg-explorer/scripts/tests/runner_capabilities.test.mjs +194 -0
  1381. package/skills/a2h-utg-explorer/scripts/tests/scope.test.mjs +229 -0
  1382. package/skills/a2h-utg-explorer/scripts/tests/scroll_sweep.test.mjs +336 -0
  1383. package/skills/a2h-utg-explorer/scripts/tests/seed_recipes.test.mjs +261 -0
  1384. package/skills/a2h-utg-explorer/scripts/tests/semantics.test.mjs +102 -0
  1385. package/skills/a2h-utg-explorer/scripts/tests/snapshot_integrity.test.mjs +142 -0
  1386. package/skills/a2h-utg-explorer/scripts/tests/state_ambiguity.test.mjs +92 -0
  1387. package/skills/a2h-utg-explorer/scripts/tests/string_tables_twin_ties.test.mjs +83 -0
  1388. package/skills/a2h-utg-explorer/scripts/tests/tar_fixture.mjs +12 -0
  1389. package/skills/a2h-utg-explorer/scripts/tests/twin_opener.test.mjs +119 -0
  1390. package/skills/a2h-utg-explorer/scripts/tests/u2_backend.test.mjs +346 -0
  1391. package/skills/a2h-utg-explorer/scripts/tests/ui_state_anchors.test.mjs +112 -0
  1392. package/skills/a2h-utg-explorer/scripts/tests/variant_strings.test.mjs +63 -0
  1393. package/skills/a2h-utg-explorer/scripts/tests/worklist_parts.test.mjs +24 -0
  1394. package/skills/a2h-utg-explorer/scripts/utg_explorer/adapters.mjs +135 -7
  1395. package/skills/a2h-utg-explorer/scripts/utg_explorer/diagnostics.mjs +196 -0
  1396. package/skills/a2h-utg-explorer/scripts/utg_explorer/hybrid_route.mjs +140 -0
  1397. package/skills/a2h-utg-explorer/scripts/utg_explorer/semantics.mjs +245 -69
  1398. package/skills/a2h-utg-explorer/scripts/utg_explorer/state_phase.mjs +47 -0
  1399. package/skills/a2h-utg-explorer/scripts/utg_explorer/strings.mjs +164 -0
  1400. package/skills/a2h-utg-explorer/scripts/utg_explorer/task_runner.mjs +718 -42
  1401. package/skills/a2h-utg-explorer/scripts/variant.mjs +57 -11
  1402. package/skills/a2h-utg-static/SKILL.md +6 -2
  1403. package/skills/a2h-utg-static/scripts/assemble.mjs +93 -3
  1404. package/skills/a2h-utg-static/scripts/click_paths.mjs +135 -25
  1405. package/skills/a2h-utg-static/scripts/compose_body_text.mjs +3 -3
  1406. package/skills/a2h-utg-static/scripts/compose_overlay.mjs +110 -3
  1407. package/skills/a2h-utg-static/scripts/compose_titles.mjs +5 -5
  1408. package/skills/a2h-utg-static/scripts/compose_widgets.mjs +4 -4
  1409. package/skills/a2h-utg-static/scripts/data_model.mjs +590 -0
  1410. package/skills/a2h-utg-static/scripts/data_producers.mjs +431 -0
  1411. package/skills/a2h-utg-static/scripts/fragment_nav.mjs +2 -3
  1412. package/skills/a2h-utg-static/scripts/hybrid_scope.mjs +46 -1
  1413. package/skills/a2h-utg-static/scripts/label_resolve.mjs +49 -4
  1414. package/skills/a2h-utg-static/scripts/lib/hybrid-provenance.mjs +201 -0
  1415. package/skills/a2h-utg-static/scripts/lib/uniapp-routes.mjs +195 -0
  1416. package/skills/a2h-utg-static/scripts/menu_nav.mjs +1 -1
  1417. package/skills/a2h-utg-static/scripts/nl_hints.mjs +34 -7
  1418. package/skills/a2h-utg-static/scripts/presenter_nav.mjs +1 -2
  1419. package/skills/a2h-utg-static/scripts/route_interceptor.mjs +21 -7
  1420. package/skills/a2h-utg-static/scripts/run_pipeline.mjs +86 -4
  1421. package/skills/a2h-utg-static/scripts/static_prior.mjs +26 -29
  1422. package/skills/a2h-utg-static/scripts/tests/test_activity_gates.mjs +84 -0
  1423. package/skills/a2h-utg-static/scripts/tests/test_carry_answers.mjs +30 -0
  1424. package/skills/a2h-utg-static/scripts/tests/test_compose_res_text.mjs +18 -0
  1425. package/skills/a2h-utg-static/scripts/tests/test_data_model.mjs +120 -0
  1426. package/skills/a2h-utg-static/scripts/tests/test_data_producers.mjs +114 -0
  1427. package/skills/a2h-utg-static/scripts/tests/test_guard_kinds_locale.mjs +12 -0
  1428. package/skills/a2h-utg-static/scripts/tests/test_hybrid_provenance.mjs +150 -0
  1429. package/skills/a2h-utg-static/scripts/tests/test_hybrid_scope.mjs +165 -1
  1430. package/skills/a2h-utg-static/scripts/tests/test_library_activity.mjs +45 -0
  1431. package/skills/a2h-utg-static/scripts/tests/test_login_interceptor.mjs +38 -0
  1432. package/skills/a2h-utg-static/scripts/tests/test_module_strings.mjs +35 -1
  1433. package/skills/a2h-utg-static/scripts/tests/test_nl_hints_default_override.mjs +50 -0
  1434. package/skills/a2h-utg-static/scripts/tests/test_pipeline_llm_phases.mjs +21 -0
  1435. package/skills/a2h-utg-static/scripts/tests/test_pr169_review_fixes.mjs +172 -0
  1436. package/skills/a2h-utg-static/scripts/tests/test_redirect_path_cost.mjs +136 -0
  1437. package/skills/a2h-utg-static/scripts/tests/test_route_token_words.mjs +29 -1
  1438. package/skills/a2h-utg-static/scripts/tests/test_uniapp_route_jump.mjs +175 -0
  1439. package/skills/a2h-utg-static/scripts/tests/test_uniapp_routes.mjs +161 -0
  1440. package/skills/a2h-utg-static/scripts/tests/test_uniapp_source.mjs +99 -0
  1441. package/skills/a2h-utg-static/scripts/tests/test_utg_specgen_boundary.mjs +45 -0
  1442. package/skills/a2h-utg-static/scripts/tests/test_vm_nav_helper_navigate.mjs +21 -0
  1443. package/skills/a2h-utg-static/scripts/uniapp_nav.mjs +112 -69
  1444. package/skills/a2h-utg-static/scripts/vm_nav.mjs +9 -1
  1445. package/skills/a2h-app-migrate/scripts/i18n-term.d.mts +0 -5
  1446. package/skills/a2h-app-migrate/scripts/i18n-term.mjs +0 -54
  1447. package/skills/a2h-arch-generate/scripts/i18n-term.d.mts +0 -5
  1448. package/skills/a2h-arch-generate/scripts/i18n-term.mjs +0 -54
  1449. package/skills/a2h-arkts-logic-coder/scripts/design/i18n-term.d.mts +0 -5
  1450. package/skills/a2h-arkts-logic-coder/scripts/design/i18n-term.mjs +0 -54
  1451. package/skills/a2h-batch-ui-align/references/source-only-tier.md +0 -38
  1452. package/skills/a2h-batch-ui-align/scripts/i18n-term.d.mts +0 -5
  1453. package/skills/a2h-batch-ui-align/scripts/i18n-term.mjs +0 -54
  1454. package/skills/a2h-dashboard-render/scripts/i18n-term.d.mts +0 -5
  1455. package/skills/a2h-dashboard-render/scripts/i18n-term.mjs +0 -54
  1456. package/skills/a2h-resource-convert/scripts/i18n-term.d.mts +0 -5
  1457. package/skills/a2h-resource-convert/scripts/i18n-term.mjs +0 -54
  1458. package/skills/a2h-spec-design-pipeline/scripts/ensure_wt_index.ts +0 -885
  1459. package/skills/a2h-spec-design-pipeline/scripts/i18n-term.d.mts +0 -5
  1460. package/skills/a2h-spec-design-pipeline/scripts/i18n-term.mjs +0 -54
  1461. package/skills/a2h-spec-design-pipeline/scripts/test_ensure_wt_index.ts +0 -856
  1462. package/skills/a2h-spec-design-pipeline/scripts/test_i18n_term.ts +0 -70
  1463. package/skills/a2h-spec-generate/scripts/i18n-term.d.mts +0 -5
  1464. package/skills/a2h-spec-generate/scripts/i18n-term.mjs +0 -54
  1465. package/skills/a2h-spec-generate/scripts/reqgen/src/i18n-term.d.mts +0 -5
  1466. package/skills/a2h-spec-generate/scripts/reqgen/src/i18n-term.mjs +0 -54
  1467. package/skills/a2h-utg-explorer/scripts/i18n-term.d.mts +0 -5
  1468. package/skills/a2h-utg-explorer/scripts/i18n-term.mjs +0 -54
  1469. package/skills/a2h-utg-static/scripts/i18n-term.d.mts +0 -5
  1470. package/skills/a2h-utg-static/scripts/i18n-term.mjs +0 -54
  1471. package/skills/a2h-utg-static/scripts/tests/test_i18n_term.mjs +0 -155
@@ -0,0 +1,1407 @@
1
+ # MVVM Pattern (V2)
2
+
3
+ ## Overview
4
+
5
+ In application development, UI updates must stay in sync with changes in data state in real time, and this synchronization often determines an app's performance and user experience. To tame the complexity of data-UI synchronization, ArkUI adopts the Model-View-ViewModel (MVVM) architecture pattern. MVVM divides an app into three core parts, Model, View and ViewModel, separating data, view and logic. With this pattern the UI updates automatically as state changes, with no manual handling, so the binding and updating of data and views is managed efficiently.
6
+
7
+ * Model: stores and manages application data and business logic, and does not interact with the user interface directly. It usually fetches data from backend APIs, is the data foundation of the app, and ensures data consistency and integrity.
8
+ * View: displays data in the user interface and interacts with the user, without containing any business logic. It updates the UI dynamically by binding to data provided by the ViewModel layer.
9
+ * ViewModel: manages UI state and interaction logic. As the bridge between Model and View, the ViewModel watches for changes in Model data, notifies the View to update the UI, and handles user interaction events by turning them into data operations.
10
+
11
+ ## Implementing the ViewModel with State Management V2
12
+
13
+ In the MVVM pattern, the ViewModel manages data state and updates the view automatically when data changes. ArkUI State Management V2 provides a rich set of decorators and tools that help developers share data between custom components and ensure data changes are synced to the UI automatically. Common state management decorators include @Local, @Param, @Event, [@ObservedV2, @Trace](https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/arkts-new-observedv2-and-trace), and more. V2 also provides AppStorageV2 and PersistenceV2 as global state storage tools for sharing state across the app and persisting it.
14
+
15
+ This section uses a simple todolist example to introduce the State Management V2 decorators and tools step by step, starting from a basic static task list and gradually extending its features. Each step builds on the previous one, helping developers understand and master each decorator incrementally.
16
+
17
+ ### Basic Example
18
+
19
+ First, start with a static to-do list. In Example 1 the tasks are static, with no state changes or dynamic interaction.
20
+
21
+ **Example 1**
22
+
23
+ ```
24
+ 1. // src/main/ets/pages/BasicPage.ets
25
+ 2. @Entry
26
+ 3. @ComponentV2
27
+ 4. struct TodoList {
28
+ 5. build() {
29
+ 6. Column() {
30
+ 7. Text('To do')
31
+ 8. .fontSize(40)
32
+ 9. .margin({ bottom: 10 })
33
+ 10. Text('task1')
34
+ 11. Text('task2')
35
+ 12. Text('task3')
36
+ 13. }
37
+ 14. }
38
+ 15. }
39
+ ```
40
+
41
+ [BasicPage.ets](https://gitcode.com/HarmonyOS_Samples/guide-snippets/blob/HarmonyOS-feature-20260402/ArkUISample/StateMgmtV2MVVM/entry/src/main/ets/pages/BasicPage.ets#L17-L33)
42
+
43
+ ### Adding @Local to Observe Component-Internal State
44
+
45
+ After the static to-do list is displayed, letting users change a task's completion state requires the to-do items to respond to interaction and update their display dynamically. To do this, the @Local decorator is introduced to manage the component's internal state. When a variable decorated with @Local changes, the bound UI components are refreshed.
46
+
47
+ Example 2 adds an @Local-decorated isFinish property indicating whether the task is finished. Two icons, finished.png and unfinished.png, show the finished or unfinished state. Tapping a to-do item toggles isFinish and updates the icon and the strikethrough on the text.
48
+
49
+ **Example 2**
50
+
51
+ ```
52
+ 1. // src/main/ets/pages/LocalPage.ets
53
+ 2. @Entry
54
+ 3. @ComponentV2
55
+ 4. struct TodoList {
56
+ 5. @Local isFinish: boolean = false;
57
+
58
+ 7. build() {
59
+ 8. Column() {
60
+ 9. Text('To do')
61
+ 10. .fontSize(40)
62
+ 11. .margin({ bottom: 10 })
63
+ 12. Row() {
64
+ 13. // Add the two images finished.png and unfinished.png under src/main/resources/base/media yourself; otherwise the app reports an error at runtime because of the missing resources.
65
+ 14. Image(this.isFinish ? $r('app.media.finished') : $r('app.media.unfinished'))
66
+ 15. .width(28)
67
+ 16. .height(28)
68
+ 17. Text('task1')
69
+ 18. .decoration({ type: this.isFinish ? TextDecorationType.LineThrough : TextDecorationType.None })
70
+ 19. }
71
+ 20. .onClick(() => this.isFinish = !this.isFinish)
72
+ 21. }
73
+ 22. }
74
+ 23. }
75
+ ```
76
+
77
+ [LocalPage.ets](https://gitcode.com/HarmonyOS_Samples/guide-snippets/blob/HarmonyOS-feature-20260402/ArkUISample/StateMgmtV2MVVM/entry/src/main/ets/pages/LocalPage.ets#L17-L41)
78
+
79
+ ### Adding @Param So a Component Receives External Input
80
+
81
+ After switching a task's local state works, to make the to-do list more flexible the name of each task should be settable dynamically rather than hard-coded. With the @Param decorator, a decorated variable in a child component can receive a value passed in by its parent, achieving one-way data synchronization. @Param is read-only by default; using @Param @Once allows the passed-in value to be updated locally in the child component.
82
+
83
+ In Example 3, each to-do item is abstracted into a TaskItem component. The @Param-decorated taskName property receives the task name from the parent component TodoList, making TaskItem flexible and reusable, able to receive and render different task names. The isFinish property decorated with @Param @Once can be updated inside the child component after receiving its initial value.
84
+
85
+ **Example 3**
86
+
87
+ ```
88
+ 1. // src/main/ets/pages/ParamPage.ets
89
+ 2. @ComponentV2
90
+ 3. struct TaskItem {
91
+ 4. @Param taskName: string = '';
92
+ 5. @Param @Once isFinish: boolean = false;
93
+
94
+ 7. build() {
95
+ 8. Row() {
96
+ 9. // Add the two images finished.png and unfinished.png under src/main/resources/base/media yourself; otherwise the app reports an error at runtime because of the missing resources.
97
+ 10. Image(this.isFinish ? $r('app.media.finished') : $r('app.media.unfinished'))
98
+ 11. .width(28)
99
+ 12. .height(28)
100
+ 13. Text(this.taskName)
101
+ 14. .decoration({ type: this.isFinish ? TextDecorationType.LineThrough : TextDecorationType.None })
102
+ 15. }
103
+ 16. .onClick(() => this.isFinish = !this.isFinish)
104
+ 17. }
105
+ 18. }
106
+
107
+ 20. @Entry
108
+ 21. @ComponentV2
109
+ 22. struct TodoList {
110
+ 23. build() {
111
+ 24. Column() {
112
+ 25. Text('To do')
113
+ 26. .fontSize(40)
114
+ 27. .margin({ bottom: 10 })
115
+ 28. TaskItem({ taskName: 'Task 1', isFinish: false })
116
+ 29. TaskItem({ taskName: 'Task 2', isFinish: false })
117
+ 30. TaskItem({ taskName: 'Task 3', isFinish: false })
118
+ 31. }
119
+ 32. }
120
+ 33. }
121
+ ```
122
+
123
+ [ParamPage.ets](https://gitcode.com/HarmonyOS_Samples/guide-snippets/blob/HarmonyOS-feature-20260402/ArkUISample/StateMgmtV2MVVM/entry/src/main/ets/pages/ParamPage.ets#L17-L51)
124
+
125
+ ### Adding @Event So a Component Emits Output
126
+
127
+ After task names can be set dynamically, the content of the task list is still fixed. To make the task list dynamically extensible, adding and deleting task items is needed. To do this, the @Event decorator is introduced so child components can output data to their parent.
128
+
129
+ In Example 4, each TaskItem gets a delete button, and a feature for adding new tasks is added at the bottom of the task list. When the "Delete" button of the child TaskItem is tapped, the deleteTask event is triggered and passed to the parent TodoList, which responds by removing the task. With @Param and @Event, a child component can not only receive data from its parent but also pass events back to it, achieving two-way data synchronization.
130
+
131
+ **Example 4**
132
+
133
+ ```
134
+ 1. // src/main/ets/pages/EventPage.ets
135
+ 2. @ComponentV2
136
+ 3. struct TaskItem {
137
+ 4. @Param taskName: string = '';
138
+ 5. @Param @Once isFinish: boolean = false;
139
+ 6. @Event deleteTask: () => void = () => {};
140
+
141
+ 8. build() {
142
+ 9. Row() {
143
+ 10. // Add the two images finished.png and unfinished.png under src/main/resources/base/media yourself; otherwise the app reports an error at runtime because of the missing resources.
144
+ 11. Image(this.isFinish ? $r('app.media.finished') : $r('app.media.unfinished'))
145
+ 12. .width(28)
146
+ 13. .height(28)
147
+ 14. Text(this.taskName)
148
+ 15. .decoration({ type: this.isFinish ? TextDecorationType.LineThrough : TextDecorationType.None })
149
+ 16. Button('Delete')
150
+ 17. .onClick(() => {
151
+ 18. this.deleteTask();
152
+ 19. })
153
+ 20. }
154
+ 21. .onClick(() => {
155
+ 22. this.isFinish = !this.isFinish;
156
+ 23. })
157
+ 24. }
158
+ 25. }
159
+
160
+ 27. @Entry
161
+ 28. @ComponentV2
162
+ 29. struct TodoList {
163
+ 30. @Local tasks: string[] = ['task1', 'task2', 'task3'];
164
+ 31. @Local newTaskName: string = '';
165
+
166
+ 33. build() {
167
+ 34. Column() {
168
+ 35. Text('To do')
169
+ 36. .fontSize(40)
170
+ 37. .margin({ bottom: 10 })
171
+ 38. ForEach(this.tasks, (task: string) => {
172
+ 39. TaskItem({
173
+ 40. taskName: task,
174
+ 41. isFinish: false,
175
+ 42. deleteTask: () => {
176
+ 43. this.tasks.splice(this.tasks.indexOf(task), 1);
177
+ 44. }
178
+ 45. })
179
+ 46. })
180
+ 47. Row() {
181
+ 48. TextInput({ placeholder: 'Add new tasks', text: this.newTaskName })
182
+ 49. .onChange((value) => {
183
+ 50. this.newTaskName = value;
184
+ 51. })
185
+ 52. .width('70%')
186
+ 53. Button('+')
187
+ 54. .onClick(() => {
188
+ 55. this.tasks.push(this.newTaskName);
189
+ 56. this.newTaskName = '';
190
+ 57. })
191
+ 58. }
192
+ 59. }
193
+ 60. }
194
+ 61. }
195
+ ```
196
+
197
+ [EventPage.ets](https://gitcode.com/HarmonyOS_Samples/guide-snippets/blob/HarmonyOS-feature-20260402/ArkUISample/StateMgmtV2MVVM/entry/src/main/ets/pages/EventPage.ets#L17-L79)
198
+
199
+ ### Adding Repeat to Reuse Child Components
200
+
201
+ After adding and deleting tasks is supported, the task list grows, and multiple child components with the same structure must be rendered efficiently to keep the UI performant. The Repeat component is introduced to optimize task list rendering.
202
+
203
+ Repeat supports two scenarios: lazy loading and non-lazy loading.
204
+
205
+ * The lazy-loading scenario suits large amounts of data: components are loaded on demand inside scrolling containers, greatly saving memory and improving rendering efficiency.
206
+ * The non-lazy-loading scenario suits small amounts of data: all components are rendered at once, and when data changes only the parts that need to change are updated, avoiding a full re-render.
207
+
208
+ In Example 5, because there are few tasks, Repeat is used in the non-lazy-loading scenario. A task array tasks is created, and the Repeat method iterates over each item in the array to dynamically generate and reuse TaskItem components. When tasks are added or deleted, this approach efficiently reuses existing components and avoids repeated rendering, improving UI responsiveness and performance. This mechanism effectively improves code reuse and rendering efficiency.
209
+
210
+ **Example 5**
211
+
212
+ ```
213
+ 1. // src/main/ets/pages/RepeatPage.ets
214
+ 2. @ComponentV2
215
+ 3. struct TaskItem {
216
+ 4. @Param taskName: string = '';
217
+ 5. @Param @Once isFinish: boolean = false;
218
+ 6. @Event deleteTask: () => void = () => {};
219
+
220
+ 8. build() {
221
+ 9. Row() {
222
+ 10. // Add the two images finished.png and unfinished.png under src/main/resources/base/media yourself; otherwise the app reports an error at runtime because of the missing resources.
223
+ 11. Image(this.isFinish ? $r('app.media.finished') : $r('app.media.unfinished'))
224
+ 12. .width(28)
225
+ 13. .height(28)
226
+ 14. Text(this.taskName)
227
+ 15. .decoration({ type: this.isFinish ? TextDecorationType.LineThrough : TextDecorationType.None })
228
+ 16. Button('Delete')
229
+ 17. .onClick(() => {
230
+ 18. this.deleteTask();
231
+ 19. })
232
+ 20. }
233
+ 21. .onClick(() => {
234
+ 22. this.isFinish = !this.isFinish;
235
+ 23. })
236
+ 24. }
237
+ 25. }
238
+
239
+ 27. @Entry
240
+ 28. @ComponentV2
241
+ 29. struct TodoList {
242
+ 30. @Local tasks: string[] = ['task1', 'task2', 'task3'];
243
+ 31. @Local newTaskName: string = '';
244
+
245
+ 33. build() {
246
+ 34. Column() {
247
+ 35. Text('To do')
248
+ 36. .fontSize(40)
249
+ 37. .margin({ bottom: 10 })
250
+ 38. Repeat<string>(this.tasks)
251
+ 39. .each((obj: RepeatItem<string>) => {
252
+ 40. TaskItem({
253
+ 41. taskName: obj.item,
254
+ 42. isFinish: false,
255
+ 43. deleteTask: () => {
256
+ 44. this.tasks.splice(this.tasks.indexOf(obj.item), 1);
257
+ 45. }
258
+ 46. })
259
+ 47. })
260
+ 48. Row() {
261
+ 49. TextInput({ placeholder: 'Add new tasks', text: this.newTaskName })
262
+ 50. .onChange((value) => {
263
+ 51. this.newTaskName = value;
264
+ 52. })
265
+ 53. .width('70%')
266
+ 54. Button('+')
267
+ 55. .onClick(() => {
268
+ 56. this.tasks.push(this.newTaskName);
269
+ 57. this.newTaskName = '';
270
+ 58. })
271
+ 59. }
272
+ 60. }
273
+ 61. }
274
+ 62. }
275
+ ```
276
+
277
+ [RepeatPage.ets](https://gitcode.com/HarmonyOS_Samples/guide-snippets/blob/HarmonyOS-feature-20260402/ArkUISample/StateMgmtV2MVVM/entry/src/main/ets/pages/RepeatPage.ets#L17-L80)
278
+
279
+ ### Adding @ObservedV2 and @Trace to Observe Class Property Changes
280
+
281
+ After several features are implemented, managing the task list becomes complex. To handle changes in task data effectively, especially in multi-level nested structures, property changes must be observed deeply and update the UI automatically. To do this, the @ObservedV2 and @Trace decorators are introduced. Unlike @Local, which can only observe an object and its first-level changes, @ObservedV2 and @Trace suit complex scenarios such as multi-level nesting and inheritance. In a class decorated with @ObservedV2, a change to an @Trace-decorated property refreshes the bound UI components.
282
+
283
+ In Example 6, a task (Task) is abstracted into a class marked with @ObservedV2, and the isFinish property is marked with @Trace. The TodoList component nests TaskItem, and TaskItem in turn nests Task. In the outermost TodoList, "Finish all" and "Unfinish all" buttons are added; each tap directly updates the isFinish property of the innermost Task class. @ObservedV2 and @Trace ensure the refresh of the corresponding isFinish UI components is observed, achieving deep observation of nested class properties.
284
+
285
+ **Example 6**
286
+
287
+ ```
288
+ 1. // src/main/ets/pages/ObservedV2TracePage.ets
289
+ 2. @ObservedV2
290
+ 3. class Task {
291
+ 4. public taskName: string = '';
292
+ 5. @Trace public isFinish: boolean = false;
293
+
294
+ 7. constructor(taskName: string, isFinish: boolean) {
295
+ 8. this.taskName = taskName;
296
+ 9. this.isFinish = isFinish;
297
+ 10. }
298
+ 11. }
299
+
300
+ 13. @ComponentV2
301
+ 14. struct TaskItem {
302
+ 15. @Param task: Task = new Task('', false);
303
+ 16. @Event deleteTask: () => void = () => {};
304
+
305
+ 18. build() {
306
+ 19. Row() {
307
+ 20. // Add the two images finished.png and unfinished.png under src/main/resources/base/media yourself; otherwise the app reports an error at runtime because of the missing resources.
308
+ 21. Image(this.task.isFinish ? $r('app.media.finished') : $r('app.media.unfinished'))
309
+ 22. .width(28)
310
+ 23. .height(28)
311
+ 24. Text(this.task.taskName)
312
+ 25. .decoration({ type: this.task.isFinish ? TextDecorationType.LineThrough : TextDecorationType.None })
313
+ 26. Button('Delete')
314
+ 27. .onClick(() => {
315
+ 28. this.deleteTask();
316
+ 29. })
317
+ 30. }
318
+ 31. .onClick(() => {
319
+ 32. this.task.isFinish = !this.task.isFinish;
320
+ 33. })
321
+ 34. }
322
+ 35. }
323
+
324
+ 37. @Entry
325
+ 38. @ComponentV2
326
+ 39. struct TodoList {
327
+ 40. @Local tasks: Task[] = [
328
+ 41. new Task('task1', false),
329
+ 42. new Task('task2', false),
330
+ 43. new Task('task3', false),
331
+ 44. ];
332
+ 45. @Local newTaskName: string = '';
333
+
334
+ 47. finishAll(ifFinish: boolean) {
335
+ 48. for (let task of this.tasks) {
336
+ 49. task.isFinish = ifFinish;
337
+ 50. }
338
+ 51. }
339
+
340
+ 53. build() {
341
+ 54. Column() {
342
+ 55. Text('To do')
343
+ 56. .fontSize(40)
344
+ 57. .margin({ bottom: 10 })
345
+ 58. Repeat<Task>(this.tasks)
346
+ 59. .each((obj: RepeatItem<Task>) => {
347
+ 60. TaskItem({
348
+ 61. task: obj.item,
349
+ 62. deleteTask: () => {
350
+ 63. this.tasks.splice(this.tasks.indexOf(obj.item), 1);
351
+ 64. }
352
+ 65. })
353
+ 66. })
354
+ 67. Row() {
355
+ 68. Button('All Completed')
356
+ 69. .onClick(() => {
357
+ 70. this.finishAll(true);
358
+ 71. })
359
+ 72. Button('All Not Completed')
360
+ 73. .onClick(() => {
361
+ 74. this.finishAll(false);
362
+ 75. })
363
+ 76. }
364
+ 77. Row() {
365
+ 78. TextInput({ placeholder: 'Add new tasks', text: this.newTaskName })
366
+ 79. .onChange((value) => {
367
+ 80. this.newTaskName = value;
368
+ 81. })
369
+ 82. .width('70%')
370
+ 83. Button('+')
371
+ 84. .onClick(() => {
372
+ 85. this.tasks.push(new Task(this.newTaskName, false));
373
+ 86. this.newTaskName = '';
374
+ 87. })
375
+ 88. }
376
+ 89. }
377
+ 90. }
378
+ 91. }
379
+ ```
380
+
381
+ [ObservedV2TracePage.ets](https://gitcode.com/HarmonyOS_Samples/guide-snippets/blob/HarmonyOS-feature-20260402/ArkUISample/StateMgmtV2MVVM/entry/src/main/ets/pages/ObservedV2TracePage.ets#L17-L109)
382
+
383
+ ### Adding @Monitor and @Computed to Watch State Variables and Compute Properties
384
+
385
+ On top of the current task list features, some extra functionality can be added to improve the experience, such as watching task state changes and dynamically computing the number of unfinished tasks. To do this, the [@Monitor](https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/arkts-new-monitor) and [@Computed](https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/arkts-new-computed) decorators are introduced. @Monitor deeply watches state variables and triggers a custom callback when a property changes. @Computed decorates a getter method and detects changes to the properties being computed. When a computed value changes it is computed only once, reducing repeated computation overhead.
386
+
387
+ In Example 7, the @Monitor decorator deeply watches the isFinish property of task in TaskItem. When a task's completion state changes, the onTaskFinished callback is triggered and records the change. A record of the number of unfinished tasks in the todolist is also added: tasksUnfinished is defined with the @Computed decorator and is recomputed automatically whenever a task's state changes. With these two decorators, deep watching of state variables and efficient computed properties are achieved.
388
+
389
+ **Example 7**
390
+
391
+ ```
392
+ 1. // src/main/ets/pages/MonitorComputedPage.ets
393
+ 2. import { hilog } from '@kit.PerformanceAnalysisKit';
394
+
395
+ 4. @ObservedV2
396
+ 5. class Task {
397
+ 6. public taskName: string = '';
398
+ 7. @Trace public isFinish: boolean = false;
399
+
400
+ 9. constructor(taskName: string, isFinish: boolean) {
401
+ 10. this.taskName = taskName;
402
+ 11. this.isFinish = isFinish;
403
+ 12. }
404
+ 13. }
405
+
406
+ 15. @ComponentV2
407
+ 16. struct TaskItem {
408
+ 17. @Param task: Task = new Task('', false);
409
+ 18. @Event deleteTask: () => void = () => {};
410
+
411
+ 20. @Monitor('task.isFinish')
412
+ 21. onTaskFinished(mon: IMonitor) {
413
+ 22. hilog.info(0x0000, 'testTag', '%{public}s', 'Task ' + this.task.taskName + ' completion status changed from ' + mon.value()?.before + ' to ' + mon.value()?.now);
414
+ 23. }
415
+
416
+ 25. build() {
417
+ 26. Row() {
418
+ 27. // Add the two images finished.png and unfinished.png under src/main/resources/base/media yourself; otherwise the app reports an error at runtime because of the missing resources.
419
+ 28. Image(this.task.isFinish ? $r('app.media.finished') : $r('app.media.unfinished'))
420
+ 29. .width(28)
421
+ 30. .height(28)
422
+ 31. Text(this.task.taskName)
423
+ 32. .decoration({ type: this.task.isFinish ? TextDecorationType.LineThrough : TextDecorationType.None })
424
+ 33. Button('Delete')
425
+ 34. .onClick(() => {
426
+ 35. this.deleteTask();
427
+ 36. })
428
+ 37. }
429
+ 38. .onClick(() => {
430
+ 39. this.task.isFinish = !this.task.isFinish;
431
+ 40. })
432
+ 41. }
433
+ 42. }
434
+
435
+ 44. @Entry
436
+ 45. @ComponentV2
437
+ 46. struct TodoList {
438
+ 47. @Local tasks: Task[] = [
439
+ 48. new Task('task1', false),
440
+ 49. new Task('task2', false),
441
+ 50. new Task('task3', false),
442
+ 51. ];
443
+ 52. @Local newTaskName: string = '';
444
+
445
+ 54. finishAll(ifFinish: boolean) {
446
+ 55. for (let task of this.tasks) {
447
+ 56. task.isFinish = ifFinish;
448
+ 57. }
449
+ 58. }
450
+
451
+ 60. @Computed
452
+ 61. get tasksUnfinished(): number {
453
+ 62. return this.tasks.filter(task => !task.isFinish).length;
454
+ 63. }
455
+
456
+ 65. build() {
457
+ 66. Column() {
458
+ 67. Text('To do')
459
+ 68. .fontSize(40)
460
+ 69. .margin({ bottom: 10 })
461
+ 70. Text('Unfinished task' + `: ${this.tasksUnfinished}`)
462
+ 71. Repeat<Task>(this.tasks)
463
+ 72. .each((obj: RepeatItem<Task>) => {
464
+ 73. TaskItem({
465
+ 74. task: obj.item,
466
+ 75. deleteTask: () => {
467
+ 76. this.tasks.splice(this.tasks.indexOf(obj.item), 1);
468
+ 77. }
469
+ 78. })
470
+ 79. })
471
+ 80. Row() {
472
+ 81. Button('All Completed')
473
+ 82. .onClick(() => {
474
+ 83. this.finishAll(true);
475
+ 84. })
476
+ 85. Button('All Not Completed')
477
+ 86. .onClick(() => {
478
+ 87. this.finishAll(false);
479
+ 88. })
480
+ 89. }
481
+ 90. Row() {
482
+ 91. TextInput({ placeholder: 'Add new tasks', text: this.newTaskName })
483
+ 92. .onChange((value) => {
484
+ 93. this.newTaskName = value;
485
+ 94. })
486
+ 95. .width('70%')
487
+ 96. Button('+')
488
+ 97. .onClick(() => {
489
+ 98. this.tasks.push(new Task(this.newTaskName, false));
490
+ 99. this.newTaskName = '';
491
+ 100. })
492
+ 101. }
493
+ 102. }
494
+ 103. }
495
+ 104. }
496
+ ```
497
+
498
+ [MonitorComputedPage.ets](https://gitcode.com/HarmonyOS_Samples/guide-snippets/blob/HarmonyOS-feature-20260402/ArkUISample/StateMgmtV2MVVM/entry/src/main/ets/pages/MonitorComputedPage.ets#L16-L121)
499
+
500
+ ### Adding AppStorageV2 for App-Global UI State Storage
501
+
502
+ As the to-do features grow and the app involves multiple pages or feature modules, global state must be shared among those pages. For example, in the to-do app a settings page is added that works together with the main screen. To share state across pages, AppStorageV2 is introduced to store and share the app's global state across multiple UIAbility instances.
503
+
504
+ In this example, a new Ability, SettingAbility, is added to load the settings page SettingPage. SettingPage contains a Setting class whose showCompletedTask property controls whether finished tasks are shown. The user toggles this option with a switch. The two Abilities share the settings data through AppStorageV2 under the key "Setting", whose data is the Setting class. The first time Setting is connected via connect, if no stored data exists, a Setting instance with showCompletedTask defaulting to true is created. Later, after the user changes the setting on the settings page, the main page updates the display of the task list accordingly. With AppStorageV2, data is shared across Abilities and pages.
505
+
506
+ **Example 8**
507
+
508
+ ```
509
+ 1. // src/main/ets/pages/AppStorageV2Page.ets
510
+ 2. import { AppStorageV2 } from '@kit.ArkUI';
511
+ 3. import { common, Want } from '@kit.AbilityKit';
512
+ 4. import { Setting } from './SettingPage';
513
+ 5. import { hilog } from '@kit.PerformanceAnalysisKit';
514
+
515
+ 7. @ObservedV2
516
+ 8. class Task {
517
+ 9. public taskName: string = '';
518
+ 10. @Trace public isFinish: boolean = false;
519
+
520
+ 12. constructor(taskName: string, isFinish: boolean) {
521
+ 13. this.taskName = taskName;
522
+ 14. this.isFinish = isFinish;
523
+ 15. }
524
+ 16. }
525
+
526
+ 18. @ComponentV2
527
+ 19. struct TaskItem {
528
+ 20. @Param task: Task = new Task('', false);
529
+ 21. @Event deleteTask: () => void = () => {};
530
+
531
+ 23. @Monitor('task.isFinish')
532
+ 24. onTaskFinished(mon: IMonitor) {
533
+ 25. hilog.info(0x0000, 'testTag', '%{public}s', 'Task ' + this.task.taskName + ' completion status changed from ' + mon.value()?.before + ' to ' + mon.value()?.now);
534
+ 26. }
535
+
536
+ 28. build() {
537
+ 29. Row() {
538
+ 30. // Add the two images finished.png and unfinished.png under src/main/resources/base/media yourself; otherwise the app reports an error at runtime because of the missing resources.
539
+ 31. Image(this.task.isFinish ? $r('app.media.finished') : $r('app.media.unfinished'))
540
+ 32. .width(28)
541
+ 33. .height(28)
542
+ 34. Text(this.task.taskName)
543
+ 35. .decoration({ type: this.task.isFinish ? TextDecorationType.LineThrough : TextDecorationType.None })
544
+ 36. Button('Delete')
545
+ 37. .onClick(() => {
546
+ 38. this.deleteTask();
547
+ 39. })
548
+ 40. }
549
+ 41. .onClick(() => {
550
+ 42. this.task.isFinish = !this.task.isFinish;
551
+ 43. })
552
+ 44. }
553
+ 45. }
554
+
555
+ 47. @Entry
556
+ 48. @ComponentV2
557
+ 49. struct TodoList {
558
+ 50. @Local tasks: Task[] = [
559
+ 51. new Task('task1', false),
560
+ 52. new Task('task2', false),
561
+ 53. new Task('task3', false),
562
+ 54. ];
563
+ 55. @Local newTaskName: string = '';
564
+ 56. @Local setting: Setting = AppStorageV2.connect(Setting, 'Setting', () => new Setting())!;
565
+ 57. private context = this.getUIContext().getHostContext() as common.UIAbilityContext;
566
+
567
+ 59. finishAll(ifFinish: boolean) {
568
+ 60. for (let task of this.tasks) {
569
+ 61. task.isFinish = ifFinish;
570
+ 62. }
571
+ 63. }
572
+
573
+ 65. @Computed
574
+ 66. get tasksUnfinished(): number {
575
+ 67. return this.tasks.filter(task => !task.isFinish).length;
576
+ 68. }
577
+
578
+ 70. build() {
579
+ 71. Column() {
580
+ 72. Text('To do')
581
+ 73. .fontSize(40)
582
+ 74. .margin({ bottom: 10 })
583
+ 75. Text('Unfinished task' + `: ${this.tasksUnfinished}`)
584
+ 76. Repeat<Task>(this.tasks.filter(task => this.setting.showCompletedTask || !task.isFinish))
585
+ 77. .each((obj: RepeatItem<Task>) => {
586
+ 78. TaskItem({
587
+ 79. task: obj.item,
588
+ 80. deleteTask: () => {
589
+ 81. this.tasks.splice(this.tasks.indexOf(obj.item), 1);
590
+ 82. }
591
+ 83. })
592
+ 84. })
593
+ 85. Row() {
594
+ 86. Button('All Completed')
595
+ 87. .onClick(() => {
596
+ 88. this.finishAll(true);
597
+ 89. })
598
+ 90. Button('All Not Completed')
599
+ 91. .onClick(() => {
600
+ 92. this.finishAll(false);
601
+ 93. })
602
+ 94. Button('Setting')
603
+ 95. .onClick(() => {
604
+ 96. let wantInfo: Want = {
605
+ 97. deviceId: '', // An empty deviceId means the local device.
606
+ 98. bundleName: 'com.samples.statemgmtv2mvvm', // Replace with the bundleName in AppScope/app.json5.
607
+ 99. abilityName: 'SettingAbility',
608
+ 100. };
609
+ 101. this.context.startAbility(wantInfo);
610
+ 102. })
611
+ 103. }
612
+ 104. Row() {
613
+ 105. TextInput({ placeholder: 'Add new tasks', text: this.newTaskName })
614
+ 106. .onChange((value) => {
615
+ 107. this.newTaskName = value;
616
+ 108. })
617
+ 109. .width('70%')
618
+ 110. Button('+')
619
+ 111. .onClick(() => {
620
+ 112. this.tasks.push(new Task(this.newTaskName, false));
621
+ 113. this.newTaskName = '';
622
+ 114. })
623
+ 115. }
624
+ 116. }
625
+ 117. }
626
+ 118. }
627
+ ```
628
+
629
+ [AppStorageV2Page.ets](https://gitcode.com/HarmonyOS_Samples/guide-snippets/blob/HarmonyOS-feature-20260402/ArkUISample/StateMgmtV2MVVM/entry/src/main/ets/pages/AppStorageV2Page.ets#L17-L136)
630
+
631
+ ```
632
+ 1. // src/main/ets/pages/SettingPage.ets
633
+ 2. import { AppStorageV2 } from '@kit.ArkUI';
634
+ 3. import { common } from '@kit.AbilityKit';
635
+
636
+ 5. @ObservedV2
637
+ 6. export class Setting {
638
+ 7. @Trace public showCompletedTask: boolean = true;
639
+ 8. }
640
+
641
+ 10. @Entry
642
+ 11. @ComponentV2
643
+ 12. struct SettingPage {
644
+ 13. @Local setting: Setting = AppStorageV2.connect(Setting, 'Setting', () => new Setting())!;
645
+ 14. private context = this.getUIContext().getHostContext() as common.UIAbilityContext;
646
+
647
+ 16. build() {
648
+ 17. Column() {
649
+ 18. Text('Setting')
650
+ 19. .fontSize(40)
651
+ 20. .margin({ bottom: 10 })
652
+ 21. Row() {
653
+ 22. Text('Show completed tasks')
654
+ 23. Toggle({ type: ToggleType.Switch, isOn: this.setting.showCompletedTask })
655
+ 24. .onChange((isOn) => {
656
+ 25. this.setting.showCompletedTask = isOn;
657
+ 26. })
658
+ 27. }
659
+ 28. Button('Back to To do')
660
+ 29. .onClick(() => {
661
+ 30. this.context.terminateSelf();
662
+ 31. })
663
+ 32. .margin({ top: 10 })
664
+ 33. }
665
+ 34. .alignItems(HorizontalAlign.Start)
666
+ 35. }
667
+ 36. }
668
+ ```
669
+
670
+ [SettingPage.ets](https://gitcode.com/HarmonyOS_Samples/guide-snippets/blob/HarmonyOS-feature-20260402/ArkUISample/StateMgmtV2MVVM/entry/src/main/ets/pages/SettingPage.ets#L17-L54)
671
+
672
+ ### Adding PersistenceV2 for Persistent UI State Storage
673
+
674
+ To make sure users see their previous task state when they reopen the app, PersistenceV2 is recommended for persistent data storage. PersistenceV2 saves data on the device disk; compared with AppStorageV2's runtime memory, it ensures data stays unchanged when the app is closed and started again.
675
+
676
+ In Example 9, a TaskList class is created to persist all task information through PersistenceV2, under the key "TaskList", whose data is the TaskList class. The first time TaskList is connected via connect, if there is no data, a new TaskList instance with an empty default tasks array is created. In the aboutToAppear lifecycle function, the app connects to the TaskList in PersistenceV2; if no task data is stored, tasks are loaded from the local file defaultTasks.json and stored into PersistenceV2. From then on, each task's completion state is synced to PersistenceV2. This way, all task data stays unchanged even after the app is closed and reopened, achieving persistent app state storage.
677
+
678
+ **Example 9**
679
+
680
+ ```
681
+ 1. // src/main/ets/pages/PersistenceV2Page.ets
682
+ 2. import { AppStorageV2, PersistenceV2, Type } from '@kit.ArkUI';
683
+ 3. import { common, Want } from '@kit.AbilityKit';
684
+ 4. import { Setting } from './SettingPage';
685
+ 5. import { util } from '@kit.ArkTS';
686
+ 6. import { hilog } from '@kit.PerformanceAnalysisKit';
687
+
688
+ 8. @ObservedV2
689
+ 9. class Task {
690
+ 10. // No constructor is implemented, because @Type does not currently support constructors with parameters.
691
+ 11. @Trace public taskName: string = 'Todo';
692
+ 12. @Trace public isFinish: boolean = false;
693
+ 13. }
694
+
695
+ 15. @ObservedV2
696
+ 16. class TaskList {
697
+ 17. // Complex objects need the @Type decorator to make sure serialization succeeds.
698
+ 18. @Type(Task)
699
+ 19. @Trace public tasks: Task[] = [];
700
+
701
+ 21. constructor(tasks: Task[]) {
702
+ 22. this.tasks = tasks;
703
+ 23. }
704
+
705
+ 25. async loadTasks(context: common.UIAbilityContext) {
706
+ 26. let getJson = await context.resourceManager.getRawFileContent('defaultTasks.json');
707
+ 27. let textDecoderOptions: util.TextDecoderOptions = { ignoreBOM: true };
708
+ 28. let textDecoder = util.TextDecoder.create('utf-8', textDecoderOptions);
709
+ 29. let result = textDecoder.decodeToString(getJson);
710
+ 30. this.tasks = JSON.parse(result).map((task: Task) => {
711
+ 31. let newTask = new Task();
712
+ 32. newTask.taskName = task.taskName;
713
+ 33. newTask.isFinish = task.isFinish;
714
+ 34. return newTask;
715
+ 35. });
716
+ 36. }
717
+ 37. }
718
+
719
+ 39. @ComponentV2
720
+ 40. struct TaskItem {
721
+ 41. @Param task: Task = new Task();
722
+ 42. @Event deleteTask: () => void = () => {};
723
+
724
+ 44. @Monitor('task.isFinish')
725
+ 45. onTaskFinished(mon: IMonitor) {
726
+ 46. hilog.info(0x0000, 'testTag', '%{public}s', 'Task ' + this.task.taskName + ' completion status changed from ' + mon.value()?.before + ' to ' + mon.value()?.now);
727
+ 47. }
728
+
729
+ 49. build() {
730
+ 50. Row() {
731
+ 51. // Add the two images finished.png and unfinished.png under src/main/resources/base/media yourself; otherwise the app reports an error at runtime because of the missing resources.
732
+ 52. Image(this.task.isFinish ? $r('app.media.finished') : $r('app.media.unfinished'))
733
+ 53. .width(28)
734
+ 54. .height(28)
735
+ 55. Text(this.task.taskName)
736
+ 56. .decoration({ type: this.task.isFinish ? TextDecorationType.LineThrough : TextDecorationType.None })
737
+ 57. Button('Delete')
738
+ 58. .onClick(() => {
739
+ 59. this.deleteTask();
740
+ 60. })
741
+ 61. }
742
+ 62. .onClick(() => {
743
+ 63. this.task.isFinish = !this.task.isFinish;
744
+ 64. })
745
+ 65. }
746
+ 66. }
747
+
748
+ 68. @Entry
749
+ 69. @ComponentV2
750
+ 70. struct TodoList {
751
+ 71. @Local taskList: TaskList = new TaskList([]);
752
+ 72. @Local newTaskName: string = '';
753
+ 73. @Local setting: Setting = AppStorageV2.connect(Setting, 'Setting', () => new Setting())!;
754
+ 74. private context = this.getUIContext().getHostContext() as common.UIAbilityContext;
755
+
756
+ 76. async aboutToAppear() {
757
+ 77. this.taskList = PersistenceV2.connect(TaskList, 'TaskList', () => new TaskList([]))!;
758
+ 78. if (this.taskList.tasks.length === 0) {
759
+ 79. await this.taskList.loadTasks(this.context);
760
+ 80. }
761
+ 81. }
762
+
763
+ 83. finishAll(ifFinish: boolean) {
764
+ 84. for (let task of this.taskList.tasks) {
765
+ 85. task.isFinish = ifFinish;
766
+ 86. }
767
+ 87. }
768
+
769
+ 89. @Computed
770
+ 90. get tasksUnfinished(): number {
771
+ 91. return this.taskList.tasks.filter(task => !task.isFinish).length;
772
+ 92. }
773
+
774
+ 94. build() {
775
+ 95. Column() {
776
+ 96. Text('To do')
777
+ 97. .fontSize(40)
778
+ 98. .margin({ bottom: 10 })
779
+ 99. Text('Unfinished task' + `: ${this.tasksUnfinished}`)
780
+ 100. Repeat<Task>(this.taskList.tasks.filter(task => this.setting.showCompletedTask || !task.isFinish))
781
+ 101. .each((obj: RepeatItem<Task>) => {
782
+ 102. TaskItem({
783
+ 103. task: obj.item,
784
+ 104. deleteTask: () => {
785
+ 105. this.taskList.tasks.splice(this.taskList.tasks.indexOf(obj.item), 1);
786
+ 106. }
787
+ 107. })
788
+ 108. })
789
+ 109. Row() {
790
+ 110. Button('All Completed')
791
+ 111. .onClick(() => {
792
+ 112. this.finishAll(true);
793
+ 113. })
794
+ 114. Button('All Not Completed')
795
+ 115. .onClick(() => {
796
+ 116. this.finishAll(false);
797
+ 117. })
798
+ 118. Button('Setting')
799
+ 119. .onClick(() => {
800
+ 120. let wantInfo: Want = {
801
+ 121. deviceId: '', // An empty deviceId means the local device.
802
+ 122. bundleName: 'com.samples.statemgmtv2mvvm', // Replace with the bundleName in AppScope/app.json5.
803
+ 123. abilityName: 'SettingAbility',
804
+ 124. };
805
+ 125. this.context.startAbility(wantInfo);
806
+ 126. })
807
+ 127. }
808
+ 128. Row() {
809
+ 129. TextInput({ placeholder: 'Add new tasks', text: this.newTaskName })
810
+ 130. .onChange((value) => {
811
+ 131. this.newTaskName = value;
812
+ 132. })
813
+ 133. .width('70%')
814
+ 134. Button('+')
815
+ 135. .onClick(() => {
816
+ 136. let newTask = new Task();
817
+ 137. newTask.taskName = this.newTaskName;
818
+ 138. this.taskList.tasks.push(newTask);
819
+ 139. this.newTaskName = '';
820
+ 140. })
821
+ 141. }
822
+ 142. }
823
+ 143. }
824
+ 144. }
825
+ ```
826
+
827
+ [PersistenceV2Page.ets](https://gitcode.com/HarmonyOS_Samples/guide-snippets/blob/HarmonyOS-feature-20260402/ArkUISample/StateMgmtV2MVVM/entry/src/main/ets/pages/PersistenceV2Page.ets#L17-L162)
828
+
829
+ The JSON file is located at src/main/resources/rawfile/defaultTasks.json.
830
+
831
+ ```
832
+ 1. [
833
+ 2. {"taskName": "Learn ArkTS development", "isFinish": false},
834
+ 3. {"taskName": "Work out", "isFinish": false},
835
+ 4. {"taskName": "Buy fruit", "isFinish": true},
836
+ 5. {"taskName": "Pick up a parcel", "isFinish": true},
837
+ 6. {"taskName": "Practice problems", "isFinish": true}
838
+ 7. ]
839
+ ```
840
+
841
+ ### Adding @Builder for Custom Builder Functions
842
+
843
+ As the app's features expand, some UI elements in the code start to repeat, which not only increases code size but also complicates maintenance. To solve this, the @Builder decorator is recommended to abstract repeated UI components into standalone builder methods, making reuse and code modularization easier.
844
+
845
+ In Example 10, the ActionButton method defined with @Builder manages button text, style and click events uniformly, improving code conciseness and maintainability. The layout and styling of the UI components are also optimized, including visual elements such as spacing, colors and sizes, resulting in a full-featured to-do app with a clean, attractive interface.
846
+
847
+ **Example 10**
848
+
849
+ ```
850
+ 1. // src/main/ets/pages/BuilderPage.ets
851
+ 2. import { AppStorageV2, PersistenceV2, Type } from '@kit.ArkUI';
852
+ 3. import { common, Want } from '@kit.AbilityKit';
853
+ 4. import { Setting } from './SettingPage';
854
+ 5. import { util } from '@kit.ArkTS';
855
+ 6. import { hilog } from '@kit.PerformanceAnalysisKit';
856
+
857
+ 8. @ObservedV2
858
+ 9. class Task {
859
+ 10. // No constructor is implemented, because @Type does not currently support constructors with parameters.
860
+ 11. @Trace public taskName: string = 'Todo';
861
+ 12. @Trace public isFinish: boolean = false;
862
+ 13. }
863
+
864
+ 15. @Builder
865
+ 16. function actionButton(text: string | Resource, onClick: () => void) {
866
+ 17. Button(text, { buttonStyle: ButtonStyleMode.NORMAL })
867
+ 18. .onClick(onClick)
868
+ 19. .margin({
869
+ 20. left: 10,
870
+ 21. right: 10,
871
+ 22. top: 5,
872
+ 23. bottom: 5
873
+ 24. })
874
+ 25. }
875
+
876
+ 27. @ObservedV2
877
+ 28. class TaskList {
878
+ 29. // Complex objects need the @Type decorator to make sure serialization succeeds.
879
+ 30. @Type(Task)
880
+ 31. @Trace public tasks: Task[] = [];
881
+
882
+ 33. constructor(tasks: Task[]) {
883
+ 34. this.tasks = tasks;
884
+ 35. }
885
+
886
+ 37. async loadTasks(context: common.UIAbilityContext) {
887
+ 38. let getJson = await context.resourceManager.getRawFileContent('defaultTasks.json');
888
+ 39. let textDecoderOptions: util.TextDecoderOptions = { ignoreBOM: true };
889
+ 40. let textDecoder = util.TextDecoder.create('utf-8', textDecoderOptions);
890
+ 41. let result = textDecoder.decodeToString(getJson);
891
+ 42. this.tasks = JSON.parse(result).map((task: Task) => {
892
+ 43. let newTask = new Task();
893
+ 44. newTask.taskName = task.taskName;
894
+ 45. newTask.isFinish = task.isFinish;
895
+ 46. return newTask;
896
+ 47. });
897
+ 48. }
898
+ 49. }
899
+
900
+ 51. @ComponentV2
901
+ 52. struct TaskItem {
902
+ 53. @Param task: Task = new Task();
903
+ 54. @Event deleteTask: () => void = () => {};
904
+
905
+ 56. @Monitor('task.isFinish')
906
+ 57. onTaskFinished(mon: IMonitor) {
907
+ 58. hilog.info(0x0000, 'testTag', '%{public}s', 'Task ' + this.task.taskName + ' completion status changed from ' + mon.value()?.before + ' to ' + mon.value()?.now);
908
+ 59. }
909
+
910
+ 61. build() {
911
+ 62. Row() {
912
+ 63. // Add the two images finished.png and unfinished.png under src/main/resources/base/media yourself; otherwise the app reports an error at runtime because of the missing resources.
913
+ 64. Image(this.task.isFinish ? $r('app.media.finished') : $r('app.media.unfinished'))
914
+ 65. .width(28)
915
+ 66. .height(28)
916
+ 67. .margin({ left: 15, right: 10 })
917
+ 68. Text(this.task.taskName)
918
+ 69. .decoration({ type: this.task.isFinish ? TextDecorationType.LineThrough : TextDecorationType.None })
919
+ 70. .fontSize(18)
920
+ 71. actionButton('Delete', () => {
921
+ 72. this.deleteTask();
922
+ 73. })
923
+ 74. }
924
+ 75. .height('7%')
925
+ 76. .width('90%')
926
+ 77. .backgroundColor('#90f1f3f5')
927
+ 78. .borderRadius(25)
928
+ 79. .onClick(() => {
929
+ 80. this.task.isFinish = !this.task.isFinish;
930
+ 81. })
931
+ 82. }
932
+ 83. }
933
+
934
+ 85. @Entry
935
+ 86. @ComponentV2
936
+ 87. struct TodoList {
937
+ 88. @Local taskList: TaskList = PersistenceV2.connect(TaskList, 'TaskList', () => new TaskList([]))!;
938
+ 89. @Local newTaskName: string = '';
939
+ 90. @Local setting: Setting = AppStorageV2.connect(Setting, 'Setting', () => new Setting())!;
940
+ 91. private context = this.getUIContext().getHostContext() as common.UIAbilityContext;
941
+
942
+ 93. async aboutToAppear() {
943
+ 94. if (this.taskList.tasks.length === 0) {
944
+ 95. await this.taskList.loadTasks(this.context);
945
+ 96. }
946
+ 97. }
947
+
948
+ 99. finishAll(ifFinish: boolean) {
949
+ 100. for (let task of this.taskList.tasks) {
950
+ 101. task.isFinish = ifFinish;
951
+ 102. }
952
+ 103. }
953
+
954
+ 105. @Computed
955
+ 106. get tasksUnfinished(): number {
956
+ 107. return this.taskList.tasks.filter(task => !task.isFinish).length;
957
+ 108. }
958
+
959
+ 110. build() {
960
+ 111. Column() {
961
+ 112. Text('To do')
962
+ 113. .fontSize(40)
963
+ 114. .margin(10)
964
+ 115. Text('Unfinished task' + `: ${this.tasksUnfinished}`)
965
+ 116. .margin({ left: 10, bottom: 10 })
966
+ 117. Repeat<Task>(this.taskList.tasks.filter(task => this.setting.showCompletedTask || !task.isFinish))
967
+ 118. .each((obj: RepeatItem<Task>) => {
968
+ 119. TaskItem({
969
+ 120. task: obj.item,
970
+ 121. deleteTask: () => {
971
+ 122. this.taskList.tasks.splice(this.taskList.tasks.indexOf(obj.item), 1);
972
+ 123. }
973
+ 124. })
974
+ 125. .margin(5)
975
+ 126. })
976
+ 127. Row() {
977
+ 128. actionButton('All Completed', (): void => this.finishAll(true))
978
+ 129. actionButton('All Not Completed', (): void => this.finishAll(false))
979
+ 130. actionButton('Setting', (): void => {
980
+ 131. let wantInfo: Want = {
981
+ 132. deviceId: '', // An empty deviceId means the local device.
982
+ 133. bundleName: 'com.samples.statemgmtv2mvvm', // Replace with the bundleName in AppScope/app.json5.
983
+ 134. abilityName: 'SettingAbility',
984
+ 135. };
985
+ 136. this.context.startAbility(wantInfo);
986
+ 137. })
987
+ 138. }
988
+ 139. .margin({ top: 10, bottom: 5 })
989
+ 140. Row() {
990
+ 141. TextInput({ placeholder: 'Add new tasks', text: this.newTaskName })
991
+ 142. .onChange((value) => {
992
+ 143. this.newTaskName = value;
993
+ 144. })
994
+ 145. .width('70%')
995
+ 146. actionButton('+', (): void => {
996
+ 147. let newTask = new Task();
997
+ 148. newTask.taskName = this.newTaskName;
998
+ 149. this.taskList.tasks.push(newTask);
999
+ 150. this.newTaskName = '';
1000
+ 151. })
1001
+ 152. }
1002
+ 153. }
1003
+ 154. .height('100%')
1004
+ 155. .width('100%')
1005
+ 156. .alignItems(HorizontalAlign.Start)
1006
+ 157. .margin({ left: 15 })
1007
+ 158. }
1008
+ 159. }
1009
+ ```
1010
+
1011
+ [BuilderPage.ets](https://gitcode.com/HarmonyOS_Samples/guide-snippets/blob/HarmonyOS-feature-20260402/ArkUISample/StateMgmtV2MVVM/entry/src/main/ets/pages/BuilderPage.ets#L17-L177)
1012
+
1013
+ ### Result Preview
1014
+
1015
+ ![](https://contentcenter-vali-drcn.dbankcdn.cn/pvt_2/DeveloperAlliance_scene_100_1/d4/v3/IX83dfWkSvK7Q6nzw-pktw/zh-cn_image_0000002622857425.gif?HW-CC-KV=V1&HW-CC-Date=20260611T062902Z&HW-CC-Expire=86400&HW-CC-Sign=1B6DDE4A1DE464A9FB7913A85BBA5497A3C56728151E9634AAD6171097661A49)
1016
+
1017
+ ## Refactoring the Code to Follow the MVVM Architecture
1018
+
1019
+ The previous examples used a series of state management decorators to implement data synchronization and UI updates in the todolist. However, as the app's features become more complex, the code structure becomes hard to maintain: the responsibilities of Model, View and ViewModel are not fully separated and are coupled. To organize the code better and improve maintainability, the code is refactored with the MVVM pattern, further separating the data layer (Model), the logic layer (ViewModel) and the presentation layer (View).
1020
+
1021
+ ### Code Structure After Refactoring
1022
+
1023
+ ```
1024
+ 1. /src
1025
+ 2. ├── /main
1026
+ 3. │ ├── /ets
1027
+ 4. │ │ ├── /entryability
1028
+ 5. │ │ ├── /model
1029
+ 6. │ │ │ ├── TaskListModel.ets
1030
+ 7. │ │ │ └── TaskModel.ets
1031
+ 8. │ │ ├── /pages
1032
+ 9. │ │ │ ├── SettingPage.ets
1033
+ 10. │ │ │ └── TodoListPage.ets
1034
+ 11. │ │ ├── /settingability
1035
+ 12. │ │ ├── /view
1036
+ 13. │ │ │ ├── BottomView.ets
1037
+ 14. │ │ │ ├── ListView.ets
1038
+ 15. │ │ │ └── TitleView.ets
1039
+ 16. │ │ ├── /viewmodel
1040
+ 17. │ │ │ ├── TaskListViewModel.ets
1041
+ 18. │ │ │ └── TaskViewModel.ets
1042
+ 19. │ └── /resources
1043
+ 20. │ ├── ...
1044
+ 21. ├─── ...
1045
+ ```
1046
+
1047
+ ### Model Layer
1048
+
1049
+ The Model layer manages the app's data and business logic, usually interacting with a backend or data storage. In the todolist app, the main responsibilities of the Model layer are to store task data, load the task list, and provide interfaces for data operations, without dealing directly with UI display.
1050
+
1051
+ * TaskModel: the basic data structure of a single task, containing the task name and completion state.
1052
+
1053
+ ```
1054
+ 1. export default class TaskModel {
1055
+ 2. public taskName: string = 'Todo';
1056
+ 3. public isFinish: boolean = false;
1057
+ 4. }
1058
+ ```
1059
+
1060
+ [TaskModel.ets](https://gitcode.com/HarmonyOS_Samples/guide-snippets/blob/HarmonyOS-feature-20260402/ArkUISample/StateMgmtV2MVVM/entry/src/main/ets/model/TaskModel.ets#L18-L23)
1061
+ * TaskListModel: the collection of tasks, providing the ability to load task data locally.
1062
+
1063
+ ```
1064
+ 1. import { common } from '@kit.AbilityKit';
1065
+ 2. import { util } from '@kit.ArkTS';
1066
+ 3. import TaskModel from './TaskModel';
1067
+ 4. import { hilog } from '@kit.PerformanceAnalysisKit';
1068
+
1069
+ 6. const DOMAIN = 0x0000;
1070
+
1071
+ 8. // Model layer: TaskListModel is responsible for loading the task list
1072
+ 9. export default class TaskListModel {
1073
+ 10. public tasks: TaskModel[] = [];
1074
+
1075
+ 12. constructor(tasks: TaskModel[]) {
1076
+ 13. this.tasks = tasks;
1077
+ 14. }
1078
+
1079
+ 16. async loadTasks(context: common.UIAbilityContext) {
1080
+ 17. try {
1081
+ 18. let getJson = await context.resourceManager.getRawFileContent('defaultTasks.json');
1082
+ 19. let textDecoderOptions: util.TextDecoderOptions = { ignoreBOM: true };
1083
+ 20. let textDecoder = util.TextDecoder.create('utf-8', textDecoderOptions);
1084
+ 21. let result = textDecoder.decodeToString(getJson);
1085
+ 22. this.tasks = JSON.parse(result).map((task: TaskModel) => {
1086
+ 23. let newTask = new TaskModel();
1087
+ 24. newTask.taskName = task.taskName;
1088
+ 25. newTask.isFinish = task.isFinish;
1089
+ 26. return newTask;
1090
+ 27. });
1091
+ 28. } catch (e) {
1092
+ 29. hilog.error(DOMAIN, 'testTag', 'Failed to getRawFileContent', JSON.stringify(e) ?? '');
1093
+ 30. }
1094
+ 31. }
1095
+ 32. }
1096
+ ```
1097
+
1098
+ [TaskListModel.ets](https://gitcode.com/HarmonyOS_Samples/guide-snippets/blob/HarmonyOS-feature-20260402/ArkUISample/StateMgmtV2MVVM/entry/src/main/ets/model/TaskListModel.ets#L18-L50)
1099
+
1100
+ ### ViewModel Layer
1101
+
1102
+ The ViewModel layer manages UI state and business logic, connecting Model and View. By watching changes in Model data and handling app logic, it syncs data to the View layer so the UI updates automatically. Using a ViewModel decouples data from views, improving code readability and maintainability.
1103
+
1104
+ * TaskViewModel: encapsulates a single task's data and state-change logic, watching data changes through state decorators.
1105
+
1106
+ ```
1107
+ 1. // src/main/ets/viewmodel/TaskViewModel.ets
1108
+ 2. import TaskModel from '../model/TaskModel';
1109
+
1110
+ 4. @ObservedV2
1111
+ 5. export default class TaskViewModel {
1112
+ 6. @Trace public taskName: string = 'Todo';
1113
+ 7. @Trace public isFinish: boolean = false;
1114
+
1115
+ 9. updateTask(task: TaskModel) {
1116
+ 10. this.taskName = task.taskName;
1117
+ 11. this.isFinish = task.isFinish;
1118
+ 12. }
1119
+
1120
+ 14. updateIsFinish(): void {
1121
+ 15. this.isFinish = !this.isFinish;
1122
+ 16. }
1123
+ 17. }
1124
+ ```
1125
+
1126
+ [TaskViewModel.ets](https://gitcode.com/HarmonyOS_Samples/guide-snippets/blob/HarmonyOS-feature-20260402/ArkUISample/StateMgmtV2MVVM/entry/src/main/ets/viewmodel/TaskViewModel.ets#L17-L35)
1127
+ * TaskListViewModel: encapsulates the task list and its management features, including loading tasks, batch-updating task state, and adding and deleting tasks.
1128
+
1129
+ ```
1130
+ 1. // src/main/ets/viewmodel/TaskListViewModel.ets
1131
+ 2. import { common } from '@kit.AbilityKit';
1132
+ 3. import { Type } from '@kit.ArkUI';
1133
+ 4. import TaskListModel from '../model/TaskListModel';
1134
+ 5. import TaskViewModel from './TaskViewModel';
1135
+
1136
+ 7. @ObservedV2
1137
+ 8. export default class TaskListViewModel {
1138
+ 9. @Type(TaskViewModel)
1139
+ 10. @Trace public tasks: TaskViewModel[] = [];
1140
+
1141
+ 12. async loadTasks(context: common.UIAbilityContext) {
1142
+ 13. let taskList = new TaskListModel([]);
1143
+ 14. await taskList.loadTasks(context);
1144
+ 15. for (let task of taskList.tasks) {
1145
+ 16. let taskViewModel = new TaskViewModel();
1146
+ 17. taskViewModel.updateTask(task);
1147
+ 18. this.tasks.push(taskViewModel);
1148
+ 19. }
1149
+ 20. }
1150
+
1151
+ 22. finishAll(ifFinish: boolean): void {
1152
+ 23. for (let task of this.tasks) {
1153
+ 24. task.isFinish = ifFinish;
1154
+ 25. }
1155
+ 26. }
1156
+
1157
+ 28. addTask(newTask: TaskViewModel): void {
1158
+ 29. this.tasks.push(newTask);
1159
+ 30. }
1160
+
1161
+ 32. removeTask(removedTask: TaskViewModel): void {
1162
+ 33. this.tasks.splice(this.tasks.indexOf(removedTask), 1);
1163
+ 34. }
1164
+ 35. }
1165
+ ```
1166
+
1167
+ [TaskListViewModel.ets](https://gitcode.com/HarmonyOS_Samples/guide-snippets/blob/HarmonyOS-feature-20260402/ArkUISample/StateMgmtV2MVVM/entry/src/main/ets/viewmodel/TaskListViewModel.ets#L17-L53)
1168
+
1169
+ ### View Layer
1170
+
1171
+ The View layer handles the app's UI display and interaction with the user. It only cares about how to render the user interface and display data, and contains no business logic. All data state and logic come from the ViewModel layer; the View layer renders by receiving state data passed from the ViewModel, keeping views and data separate.
1172
+
1173
+ * TitleView: displays the app's title and statistics on unfinished tasks.
1174
+
1175
+ ```
1176
+ 1. // src/main/ets/view/TitleView.ets
1177
+ 2. @ComponentV2
1178
+ 3. export default struct TitleView {
1179
+ 4. @Param tasksUnfinished: number = 0;
1180
+
1181
+ 6. build() {
1182
+ 7. Column() {
1183
+ 8. Text('To do')
1184
+ 9. .fontSize(40)
1185
+ 10. .margin(10)
1186
+ 11. Text(`All Not Completed: ${this.tasksUnfinished}`)
1187
+ 12. .margin({ left: 10, bottom: 10 })
1188
+ 13. }
1189
+ 14. }
1190
+ 15. }
1191
+ ```
1192
+
1193
+ [TitleView.ets](https://gitcode.com/HarmonyOS_Samples/guide-snippets/blob/HarmonyOS-feature-20260402/ArkUISample/StateMgmtV2MVVM/entry/src/main/ets/view/TitleView.ets#L17-L33)
1194
+ * ListView: displays the task list and filters whether finished tasks are shown according to the Setting. It depends on TaskListViewModel to get task data and renders through the TaskItem component, including the task name, completion state and delete button. User interactions, such as toggling a task's completion state and deleting a task, are implemented through TaskViewModel and TaskListViewModel.
1195
+
1196
+ ```
1197
+ 1. // src/main/ets/view/ListView.ets
1198
+ 2. import TaskViewModel from '../viewmodel/TaskViewModel';
1199
+ 3. import TaskListViewModel from '../viewmodel/TaskListViewModel';
1200
+ 4. import { Setting } from '../pages/SettingPage';
1201
+ 5. import { ActionButton } from './BottomView';
1202
+ 6. import { hilog } from '@kit.PerformanceAnalysisKit';
1203
+
1204
+ 8. @ComponentV2
1205
+ 9. struct TaskItem {
1206
+ 10. @Param task: TaskViewModel = new TaskViewModel();
1207
+ 11. @Event deleteTask: () => void = () => {};
1208
+
1209
+ 13. @Monitor('task.isFinish')
1210
+ 14. onTaskFinished(mon: IMonitor) {
1211
+ 15. hilog.info(0x0000, 'testTag', '%{public}s', 'Task ' + this.task.taskName + ' completion status changed from ' + mon.value()?.before + ' to ' + mon.value()?.now);
1212
+ 16. }
1213
+
1214
+ 18. build() {
1215
+ 19. Row() {
1216
+ 20. // Add the two images finished.png and unfinished.png under src/main/resources/base/media yourself; otherwise the app reports an error at runtime because of the missing resources.
1217
+ 21. Image(this.task.isFinish ? $r('app.media.finished') : $r('app.media.unfinished'))
1218
+ 22. .width(28)
1219
+ 23. .height(28)
1220
+ 24. .margin({ left: 15, right: 10 })
1221
+ 25. Text(this.task.taskName)
1222
+ 26. .decoration({ type: this.task.isFinish ? TextDecorationType.LineThrough : TextDecorationType.None })
1223
+ 27. .fontSize(18)
1224
+ 28. ActionButton('Delete', () => this.deleteTask());
1225
+ 29. }
1226
+ 30. .height('7%')
1227
+ 31. .width('90%')
1228
+ 32. .backgroundColor('#90f1f3f5')
1229
+ 33. .borderRadius(25)
1230
+ 34. .onClick(() => this.task.updateIsFinish())
1231
+ 35. }
1232
+ 36. }
1233
+
1234
+ 38. @ComponentV2
1235
+ 39. export default struct ListView {
1236
+ 40. @Param taskList: TaskListViewModel = new TaskListViewModel();
1237
+ 41. @Param setting: Setting = new Setting();
1238
+
1239
+ 43. build() {
1240
+ 44. Repeat<TaskViewModel>(this.taskList.tasks.filter(task => this.setting.showCompletedTask || !task.isFinish))
1241
+ 45. .each((obj: RepeatItem<TaskViewModel>) => {
1242
+ 46. TaskItem({
1243
+ 47. task: obj.item,
1244
+ 48. deleteTask: () => this.taskList.removeTask(obj.item)
1245
+ 49. }).margin(5)
1246
+ 50. })
1247
+ 51. }
1248
+ 52. }
1249
+ ```
1250
+
1251
+ [ListView.ets](https://gitcode.com/HarmonyOS_Samples/guide-snippets/blob/HarmonyOS-feature-20260402/ArkUISample/StateMgmtV2MVVM/entry/src/main/ets/view/ListView.ets#L17-L70)
1252
+ * BottomView: provides the buttons and input box related to task operations, i.e. the three buttons "Finish all", "Unfinish all" and "Settings", plus the input box for adding new tasks. Tapping "Finish all" or "Unfinish all" changes the state of all tasks through TaskListViewModel. Tapping the "Settings" button navigates to the settings page of SettingAbility. When a new task is added, it is added to the task list through TaskListViewModel.
1253
+
1254
+ ```
1255
+ 1. // src/main/ets/view/BottomView.ets
1256
+ 2. import { common, Want } from '@kit.AbilityKit';
1257
+ 3. import TaskViewModel from '../viewmodel/TaskViewModel';
1258
+ 4. import TaskListViewModel from '../viewmodel/TaskListViewModel';
1259
+
1260
+ 6. @Builder
1261
+ 7. export function ActionButton(text: string | Resource, onClick: () => void) {
1262
+ 8. Button(text, { buttonStyle: ButtonStyleMode.NORMAL })
1263
+ 9. .onClick(onClick)
1264
+ 10. .margin({
1265
+ 11. left: 10,
1266
+ 12. right: 10,
1267
+ 13. top: 5,
1268
+ 14. bottom: 5
1269
+ 15. })
1270
+ 16. }
1271
+
1272
+ 18. @ComponentV2
1273
+ 19. export default struct BottomView {
1274
+ 20. @Param taskList: TaskListViewModel = new TaskListViewModel();
1275
+ 21. @Local newTaskName: string = '';
1276
+ 22. private context = this.getUIContext().getHostContext() as common.UIAbilityContext;
1277
+
1278
+ 24. build() {
1279
+ 25. Column() {
1280
+ 26. Row() {
1281
+ 27. ActionButton('All Completed', (): void => this.taskList.finishAll(true))
1282
+ 28. ActionButton('All Not Completed', (): void => this.taskList.finishAll(false))
1283
+ 29. }
1284
+ 30. .margin({ top: 10 })
1285
+
1286
+ 32. Row() {
1287
+ 33. ActionButton('Setting', (): void => {
1288
+ 34. let wantInfo: Want = {
1289
+ 35. deviceId: '', // An empty deviceId means the local device.
1290
+ 36. bundleName: 'com.samples.statemgmtv2mvvm', // Replace with the bundleName in AppScope/app.json5.
1291
+ 37. abilityName: 'SettingAbility',
1292
+ 38. };
1293
+ 39. this.context.startAbility(wantInfo);
1294
+ 40. })
1295
+ 41. }
1296
+ 42. .margin({ bottom: 5 })
1297
+
1298
+ 44. Row() {
1299
+ 45. TextInput({ placeholder: 'Add new tasks', text: this.newTaskName })
1300
+ 46. .onChange((value) => this.newTaskName = value)
1301
+ 47. .width('70%')
1302
+ 48. ActionButton('+', (): void => {
1303
+ 49. let newTask = new TaskViewModel();
1304
+ 50. newTask.taskName = this.newTaskName;
1305
+ 51. this.taskList.addTask(newTask);
1306
+ 52. this.newTaskName = '';
1307
+ 53. })
1308
+ 54. }
1309
+ 55. }
1310
+ 56. }
1311
+ 57. }
1312
+ ```
1313
+
1314
+ [BottomView.ets](https://gitcode.com/HarmonyOS_Samples/guide-snippets/blob/HarmonyOS-feature-20260402/ArkUISample/StateMgmtV2MVVM/entry/src/main/ets/view/BottomView.ets#L17-L75)
1315
+ * TodoListPage: the main todolist page, containing the three View components above (TitleView, ListView, BottomView) to present all parts of the to-do list together and manage the task list and user settings. TodoListPage gets data from the ViewModel and passes it to each child View component for rendering, and persists task data through PersistenceV2 so data stays consistent after the app restarts.
1316
+
1317
+ ```
1318
+ 1. // src/main/ets/pages/TodoListPage.ets
1319
+ 2. import TaskListViewModel from '../viewmodel/TaskListViewModel';
1320
+ 3. import { common } from '@kit.AbilityKit';
1321
+ 4. import { AppStorageV2, PersistenceV2 } from '@kit.ArkUI';
1322
+ 5. import { Setting } from '../pages/SettingPage';
1323
+ 6. import TitleView from '../view/TitleView';
1324
+ 7. import ListView from '../view/ListView';
1325
+ 8. import BottomView from '../view/BottomView';
1326
+
1327
+ 10. @Entry
1328
+ 11. @ComponentV2
1329
+ 12. struct TodoList {
1330
+ 13. @Local taskList: TaskListViewModel = PersistenceV2.connect(TaskListViewModel, 'TaskList', () => new TaskListViewModel())!;
1331
+ 14. @Local setting: Setting = AppStorageV2.connect(Setting, 'Setting', () => new Setting())!;
1332
+ 15. private context = this.getUIContext().getHostContext() as common.UIAbilityContext;
1333
+
1334
+ 17. async aboutToAppear() {
1335
+ 18. if (this.taskList.tasks.length === 0) {
1336
+ 19. await this.taskList.loadTasks(this.context);
1337
+ 20. }
1338
+ 21. }
1339
+
1340
+ 23. @Computed
1341
+ 24. get tasksUnfinished(): number {
1342
+ 25. return this.taskList.tasks.filter(task => !task.isFinish).length;
1343
+ 26. }
1344
+
1345
+ 28. build() {
1346
+ 29. Column() {
1347
+ 30. TitleView({ tasksUnfinished: this.tasksUnfinished })
1348
+ 31. ListView({ taskList: this.taskList, setting: this.setting });
1349
+ 32. BottomView({ taskList: this.taskList });
1350
+ 33. }
1351
+ 34. .height('100%')
1352
+ 35. .width('100%')
1353
+ 36. .alignItems(HorizontalAlign.Start)
1354
+ 37. .margin({ left: 15 })
1355
+ 38. }
1356
+ 39. }
1357
+ ```
1358
+
1359
+ [TodoListPage.ets](https://gitcode.com/HarmonyOS_Samples/guide-snippets/blob/HarmonyOS-feature-20260402/ArkUISample/StateMgmtV2MVVM/entry/src/main/ets/pages/TodoListPage.ets#L17-L57)
1360
+ * SettingPage: the settings page, managing the setting of whether finished tasks are shown. The user's setting is stored globally through AppStorageV2, and the user toggles the showCompletedTask state with a Toggle switch.
1361
+
1362
+ ```
1363
+ 1. // src/main/ets/pages/SettingPage.ets
1364
+ 2. import { AppStorageV2 } from '@kit.ArkUI';
1365
+ 3. import { common } from '@kit.AbilityKit';
1366
+
1367
+ 5. @ObservedV2
1368
+ 6. export class Setting {
1369
+ 7. @Trace public showCompletedTask: boolean = true;
1370
+ 8. }
1371
+
1372
+ 10. @Entry
1373
+ 11. @ComponentV2
1374
+ 12. struct SettingPage {
1375
+ 13. @Local setting: Setting = AppStorageV2.connect(Setting, 'Setting', () => new Setting())!;
1376
+ 14. private context = this.getUIContext().getHostContext() as common.UIAbilityContext;
1377
+
1378
+ 16. build(){
1379
+ 17. Column(){
1380
+ 18. Text('Setting')
1381
+ 19. .fontSize(40)
1382
+ 20. .margin({ bottom: 10 })
1383
+ 21. Row() {
1384
+ 22. Text('Show completed tasks')
1385
+ 23. Toggle({ type: ToggleType.Switch, isOn:this.setting.showCompletedTask })
1386
+ 24. .onChange((isOn) => {
1387
+ 25. this.setting.showCompletedTask = isOn;
1388
+ 26. })
1389
+ 27. }
1390
+ 28. Button('Back to To do')
1391
+ 29. .onClick(()=>this.context.terminateSelf())
1392
+ 30. .margin({ top: 10 })
1393
+ 31. }
1394
+ 32. .alignItems(HorizontalAlign.Start)
1395
+ 33. }
1396
+ 34. }
1397
+ ```
1398
+
1399
+ [SettingPage.ets](https://gitcode.com/HarmonyOS_Samples/guide-snippets/blob/HarmonyOS-feature-20260402/ArkUISample/StateMgmtV2MVVM/entry/src/main/ets/pages/SettingPage.ets#L17-L54)
1400
+
1401
+ ## Summary
1402
+
1403
+ Using a to-do app as the example, this guide introduces the State Management V2 decorators and implements the MVVM architecture through code refactoring. Data, business logic and view presentation end up in separate layers, making the code structure clearer and easier to maintain. By correctly applying the Model, View and ViewModel layered structure, developers can better understand and apply the MVVM pattern, improving development efficiency and code quality in real projects, optimizing the data-UI synchronization mechanism, and simplifying the overall development process.
1404
+
1405
+ ## Code Sample
1406
+
1407
+ [Full source code](https://gitcode.com/openharmony/applications_app_samples/tree/master/code/DocsSample/ArkUISample/StateMgmtV2MVVM/entry)