@buaa_smat/hometrans 26.0.3 → 26.0.4-devecocli.1

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 (780) hide show
  1. package/agents/code-reviewer.md +91 -21
  2. package/devecocli-plugin/common.ts +2271 -0
  3. package/devecocli-plugin/content-resolver.ts +363 -0
  4. package/devecocli-plugin/install.ts +72 -0
  5. package/devecocli-plugin/uninstall.ts +26 -0
  6. package/devecocli-plugin/update.ts +77 -0
  7. package/i18n/agents/code-reviewer.md +93 -21
  8. package/i18n/skills/a2h-app-migrate/SKILL.md +19 -11
  9. package/i18n/skills/a2h-app-migrate/references/feature-scope.md +121 -0
  10. package/i18n/skills/a2h-app-migrate/references/stage-map.md +2 -2
  11. package/i18n/skills/a2h-app-migrate/references/workflow.yaml +320 -73
  12. package/i18n/skills/a2h-app-migrate/scripts/check_spec_gen_done.mjs +78 -5
  13. package/i18n/skills/a2h-app-migrate/scripts/env_preflight.mjs +79 -11
  14. package/i18n/skills/a2h-app-migrate/scripts/human_review_gate.mjs +75 -4
  15. package/i18n/skills/a2h-app-migrate/test/test_android_index.mjs +12 -0
  16. package/i18n/skills/a2h-app-migrate/test/test_env_requirements.mjs +25 -10
  17. package/i18n/skills/a2h-app-migrate/test/test_finalize.mjs +35 -7
  18. package/i18n/skills/a2h-app-migrate/test/test_resume_plan.mjs +52 -0
  19. package/i18n/skills/a2h-app-migrate/test/test_resume_summary.mjs +26 -0
  20. package/i18n/skills/a2h-app-migrate/test/test_reuse_static_utg.mjs +36 -0
  21. package/i18n/skills/a2h-app-migrate/test/test_run_dir.mjs +71 -7
  22. package/i18n/skills/a2h-app-migrate/test/test_spec_gen_done.mjs +117 -0
  23. package/i18n/skills/a2h-app-migrate/test/test_spec_gen_gate.mjs +7 -3
  24. package/i18n/skills/a2h-app-migrate/test/test_utg_static_done.mjs +38 -2
  25. package/i18n/skills/a2h-arch-generate/SKILL.md +20 -17
  26. package/i18n/skills/a2h-arch-generate/references/database-schema-recovery.md +2 -2
  27. package/i18n/skills/a2h-arch-generate/references/harmony-project-inspection.md +8 -8
  28. package/i18n/skills/a2h-arch-generate/references/homegraph-workflow.md +25 -14
  29. package/i18n/skills/a2h-arch-generate/references/source-baseline.md +4 -4
  30. package/i18n/skills/a2h-arch-generate/scripts/tests/run_tests.mjs +3 -3
  31. package/i18n/skills/a2h-arkts-logic-coder/SKILL.md +304 -0
  32. package/i18n/skills/a2h-arkts-logic-coder/references/ISSUES.md +2 -1
  33. package/i18n/skills/a2h-arkts-logic-coder/references/code-generation.md +59 -2
  34. package/i18n/skills/a2h-arkts-logic-coder/references/spec-design.md +52 -11
  35. package/i18n/skills/a2h-arkts-logic-coder/scripts/state_doc.mjs +328 -38
  36. package/i18n/skills/a2h-arkts-logic-coder/test/test_state_doc.mjs +245 -0
  37. package/i18n/skills/a2h-batch-ui-align/SKILL.md +70 -21
  38. package/i18n/skills/a2h-batch-ui-align/references/cards/alignment.md +5 -1
  39. package/i18n/skills/a2h-batch-ui-align/references/cards/geometry.md +5 -0
  40. package/i18n/skills/a2h-batch-ui-align/references/cards/interaction.md +2 -1
  41. package/i18n/skills/a2h-batch-ui-align/references/cards/resources.md +6 -4
  42. package/i18n/skills/a2h-batch-ui-align/references/cards/widgets.md +5 -0
  43. package/i18n/skills/a2h-batch-ui-align/references/cards/window.md +2 -1
  44. package/i18n/skills/a2h-batch-ui-align/references/checker-rules.md +236 -11
  45. package/i18n/skills/a2h-batch-ui-align/references/conversion-procedure.md +8 -5
  46. package/i18n/skills/a2h-batch-ui-align/references/incremental-scope.md +28 -9
  47. package/i18n/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +7 -4
  48. package/i18n/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-layout-mapping-reference.md +28 -1
  49. package/i18n/skills/a2h-batch-ui-align/references/state-mgmt/_decorator-quickref.md +31 -0
  50. package/i18n/skills/a2h-batch-ui-align/references/step3-capture.md +22 -6
  51. package/i18n/skills/a2h-batch-ui-align/references/step4-prepare.md +3 -0
  52. package/i18n/skills/a2h-batch-ui-align/references/step5-convert.md +26 -4
  53. package/i18n/skills/a2h-batch-ui-align/scripts/branch_coverage.mjs +155 -0
  54. package/i18n/skills/a2h-batch-ui-align/scripts/build_conversion_set.mjs +386 -16
  55. package/i18n/skills/a2h-batch-ui-align/scripts/export_ui_info.mjs +19 -1
  56. package/i18n/skills/a2h-batch-ui-align/scripts/group_pack.mjs +134 -11
  57. package/i18n/skills/a2h-batch-ui-align/scripts/icon_coverage.mjs +147 -0
  58. package/i18n/skills/a2h-batch-ui-align/scripts/measure_pack.ts +231 -5
  59. package/i18n/skills/a2h-batch-ui-align/scripts/phase5_check.mjs +82 -8
  60. package/i18n/skills/a2h-batch-ui-align/scripts/shell_contract.mjs +21 -7
  61. package/i18n/skills/a2h-batch-ui-align/scripts/state_doc.mjs +9 -4
  62. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/main.ts +48 -5
  63. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/a11y.ts +3 -17
  64. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/attr_chain.ts +1 -19
  65. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/dialog_backboard.ts +91 -0
  66. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/event_default_click.ts +179 -0
  67. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/hit_test.ts +339 -0
  68. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/image_source.ts +84 -0
  69. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/input_traps.ts +249 -0
  70. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/layout_placement.ts +234 -5
  71. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/lottie_host.ts +145 -0
  72. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/media_tint.ts +45 -11
  73. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/overlay_binds.ts +56 -0
  74. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/overlay_string.ts +96 -0
  75. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/padding_in_size.ts +60 -0
  76. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/percent_height_in_scroll.ts +3 -2
  77. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/relative_container_height.ts +102 -0
  78. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/root_weight.ts +54 -4
  79. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/runtime_traps.ts +440 -0
  80. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/scroll_align.ts +75 -23
  81. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/swiper_index.ts +65 -0
  82. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/theme_color.ts +63 -2
  83. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/waterflow_sections.ts +231 -0
  84. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/wide_constant_width.ts +4 -4
  85. package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_input_runtime.test.mjs +514 -0
  86. package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_layout_placement.test.mjs +224 -0
  87. package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_overlay_lottie.test.mjs +199 -0
  88. package/i18n/skills/a2h-batch-ui-align/scripts/tests/branch_coverage.test.mjs +116 -0
  89. package/i18n/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set.test.mjs +133 -0
  90. package/i18n/skills/a2h-batch-ui-align/scripts/tests/measure_pack.test.mjs +5 -3
  91. package/i18n/skills/a2h-batch-ui-align/scripts/tests/phase5_check.test.mjs +33 -2
  92. package/i18n/skills/a2h-batch-ui-align/scripts/tests/skill_doc_contract.test.mjs +12 -0
  93. package/i18n/skills/a2h-batch-ui-align/scripts/tests/state_doc.test.mjs +8 -0
  94. package/i18n/skills/a2h-coldstart-smoke-gate/SKILL.md +7 -4
  95. package/i18n/skills/a2h-dashboard-render/scripts/device_capture.mjs +11 -9
  96. package/i18n/skills/a2h-module-semantic-docs/SKILL.md +51 -13
  97. package/i18n/skills/a2h-page-specgen/SKILL.md +123 -20
  98. package/i18n/skills/a2h-page-specgen/references/behavior-ledger.md +1174 -0
  99. package/i18n/skills/a2h-page-specgen/references/body-language.md +11 -9
  100. package/i18n/skills/a2h-page-specgen/references/gates.md +119 -52
  101. package/i18n/skills/a2h-page-specgen/references/page-inventory.md +69 -22
  102. package/i18n/skills/a2h-page-specgen/references/scenario-authoring.md +274 -0
  103. package/i18n/skills/a2h-page-specgen/references/spec-example.md +312 -0
  104. package/i18n/skills/a2h-page-specgen/references/spec-template.md +113 -110
  105. package/i18n/skills/a2h-page-specgen/scripts/behavior-audit.mjs +2436 -0
  106. package/i18n/skills/a2h-page-specgen/scripts/behavior-discovery.mjs +1833 -0
  107. package/i18n/skills/a2h-page-specgen/scripts/behavior-model.mjs +181 -0
  108. package/i18n/skills/a2h-page-specgen/scripts/behavior-reconcile.mjs +1205 -0
  109. package/i18n/skills/a2h-page-specgen/scripts/entry-evidence.mjs +1123 -0
  110. package/i18n/skills/a2h-page-specgen/scripts/facts-build.mjs +171 -62
  111. package/i18n/skills/a2h-page-specgen/scripts/footprint.mjs +314 -192
  112. package/i18n/skills/a2h-page-specgen/scripts/gate.mjs +364 -76
  113. package/i18n/skills/a2h-page-specgen/scripts/interactions.mjs +216 -8
  114. package/i18n/skills/a2h-page-specgen/scripts/inventory.mjs +371 -0
  115. package/i18n/skills/a2h-page-specgen/scripts/lib/contracts.mjs +116 -223
  116. package/i18n/skills/a2h-page-specgen/scripts/lib/graph-evidence.mjs +235 -0
  117. package/i18n/skills/a2h-page-specgen/scripts/lib/hg.mjs +521 -13
  118. package/i18n/skills/a2h-page-specgen/scripts/lib/homegraph-process.mjs +102 -0
  119. package/i18n/skills/a2h-page-specgen/scripts/lib/homegraph-query.mjs +161 -0
  120. package/i18n/skills/a2h-page-specgen/scripts/lib/operation-reviews.mjs +913 -0
  121. package/i18n/skills/a2h-page-specgen/scripts/lib/prose.mjs +12 -8
  122. package/i18n/skills/a2h-page-specgen/scripts/lib/semantic-detail.mjs +353 -0
  123. package/i18n/skills/a2h-page-specgen/scripts/lib/source-text.mjs +497 -0
  124. package/i18n/skills/a2h-page-specgen/scripts/operation-evidence.mjs +1542 -0
  125. package/i18n/skills/a2h-page-specgen/scripts/prepare.mjs +483 -125
  126. package/i18n/skills/a2h-page-specgen/scripts/render.mjs +10 -33
  127. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/acceptance.mjs +288 -7
  128. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.json +25 -0
  129. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.prompt.md +373 -0
  130. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.worker.md +300 -0
  131. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.json +47 -0
  132. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.prompt.md +373 -0
  133. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.worker.md +300 -0
  134. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.discovery.json +2694 -0
  135. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.json +726 -0
  136. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.post-review.json +108 -0
  137. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.prompt.md +373 -0
  138. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.review.md +65 -0
  139. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.worker.md +267 -0
  140. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.json +57 -0
  141. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.prompt.md +373 -0
  142. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.worker.md +300 -0
  143. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/branch-checklist.md +32 -0
  144. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/gate-results.json +22 -0
  145. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/manifest.json +111 -0
  146. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/portability.test.mjs +141 -0
  147. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/review.md +22 -0
  148. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/run.mjs +553 -0
  149. package/i18n/skills/a2h-page-specgen/scripts/test/android-entry-evidence.test.mjs +585 -0
  150. package/i18n/skills/a2h-page-specgen/scripts/test/android-operation-evidence.test.mjs +755 -0
  151. package/i18n/skills/a2h-page-specgen/scripts/test/behavior-audit-group.test.mjs +546 -0
  152. package/i18n/skills/a2h-page-specgen/scripts/test/behavior-audit-post.test.mjs +655 -0
  153. package/i18n/skills/a2h-page-specgen/scripts/test/behavior-audit-pre.test.mjs +1234 -0
  154. package/i18n/skills/a2h-page-specgen/scripts/test/behavior-component-gate.test.mjs +520 -0
  155. package/i18n/skills/a2h-page-specgen/scripts/test/behavior-discovery.test.mjs +1516 -0
  156. package/i18n/skills/a2h-page-specgen/scripts/test/behavior-finalize.test.mjs +759 -0
  157. package/i18n/skills/a2h-page-specgen/scripts/test/behavior-fixtures.mjs +630 -0
  158. package/i18n/skills/a2h-page-specgen/scripts/test/behavior-model.test.mjs +118 -0
  159. package/i18n/skills/a2h-page-specgen/scripts/test/behavior-reconcile.test.mjs +798 -0
  160. package/i18n/skills/a2h-page-specgen/scripts/test/behavior-regression.test.mjs +886 -0
  161. package/i18n/skills/a2h-page-specgen/scripts/test/contracts.test.mjs +134 -163
  162. package/i18n/skills/a2h-page-specgen/scripts/test/entry-evidence.test.mjs +475 -0
  163. package/i18n/skills/a2h-page-specgen/scripts/test/facts.test.mjs +40 -1
  164. package/i18n/skills/a2h-page-specgen/scripts/test/finalize.test.mjs +206 -9
  165. package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/App.vue +1 -0
  166. package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/bundle-conflict-record.json +17 -0
  167. package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/bundle-record.json +17 -0
  168. package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/manifest.json +3 -0
  169. package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/pages/list/index.vue +80 -0
  170. package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/pages.json +14 -0
  171. package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/source-record.json +15 -0
  172. package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/components/RefreshPanel.vue +15 -0
  173. package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/composables/useRefresh.ts +50 -0
  174. package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/pages/help/index.vue +9 -0
  175. package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/state/store.ts +4 -0
  176. package/i18n/skills/a2h-page-specgen/scripts/test/footprint-resolve.test.mjs +459 -188
  177. package/i18n/skills/a2h-page-specgen/scripts/test/gate-partial.test.mjs +89 -0
  178. package/i18n/skills/a2h-page-specgen/scripts/test/gate.test.mjs +862 -12
  179. package/i18n/skills/a2h-page-specgen/scripts/test/graph-evidence.test.mjs +332 -0
  180. package/i18n/skills/a2h-page-specgen/scripts/test/helpers.mjs +139 -5
  181. package/i18n/skills/a2h-page-specgen/scripts/test/hg.test.mjs +378 -0
  182. package/i18n/skills/a2h-page-specgen/scripts/test/homegraph-process-fixture.mjs +130 -0
  183. package/i18n/skills/a2h-page-specgen/scripts/test/homegraph-query.test.mjs +288 -0
  184. package/i18n/skills/a2h-page-specgen/scripts/test/integration.test.mjs +69 -2
  185. package/i18n/skills/a2h-page-specgen/scripts/test/interactions.test.mjs +267 -2
  186. package/i18n/skills/a2h-page-specgen/scripts/test/inventory.test.mjs +111 -0
  187. package/i18n/skills/a2h-page-specgen/scripts/test/keys.test.mjs +10 -8
  188. package/i18n/skills/a2h-page-specgen/scripts/test/operation-reviews.test.mjs +1002 -0
  189. package/i18n/skills/a2h-page-specgen/scripts/test/plan-build.test.mjs +143 -51
  190. package/i18n/skills/a2h-page-specgen/scripts/test/prepare-homegraph-reproduction.mjs +365 -0
  191. package/i18n/skills/a2h-page-specgen/scripts/test/prepare-homegraph.test.mjs +569 -0
  192. package/i18n/skills/a2h-page-specgen/scripts/test/prepare-pipeline.test.mjs +326 -0
  193. package/i18n/skills/a2h-page-specgen/scripts/test/prompt-tpl.test.mjs +166 -3
  194. package/i18n/skills/a2h-page-specgen/scripts/test/prose.test.mjs +13 -5
  195. package/i18n/skills/a2h-page-specgen/scripts/test/protocol-docs.test.mjs +531 -0
  196. package/i18n/skills/a2h-page-specgen/scripts/test/recovery-e2e.test.mjs +102 -7
  197. package/i18n/skills/a2h-page-specgen/scripts/test/recovery.test.mjs +1308 -72
  198. package/i18n/skills/a2h-page-specgen/scripts/test/render.test.mjs +69 -44
  199. package/i18n/skills/a2h-page-specgen/scripts/test/review-followup.test.mjs +467 -0
  200. package/i18n/skills/a2h-page-specgen/scripts/test/semantic-detail.test.mjs +949 -0
  201. package/i18n/skills/a2h-page-specgen/scripts/test/submit.test.mjs +658 -120
  202. package/i18n/skills/a2h-page-specgen/scripts/test/uniapp-operation-evidence.test.mjs +639 -0
  203. package/i18n/skills/a2h-page-specgen/scripts/test/utg-footprint-contract.test.mjs +274 -0
  204. package/i18n/skills/a2h-page-specgen/scripts/test/waker-process.test.mjs +101 -65
  205. package/i18n/skills/a2h-resource-convert/SKILL.md +9 -1
  206. package/i18n/skills/a2h-resource-convert/references/code-vector-icon-rules.md +2 -1
  207. package/i18n/skills/a2h-resource-convert/references/incremental-page-migration.md +23 -2
  208. package/i18n/skills/a2h-resource-convert/references/lottie-conversion-rules.md +7 -0
  209. package/i18n/skills/a2h-resource-convert/references/step4-resource-types.md +2 -0
  210. package/i18n/skills/a2h-resource-convert/scripts/a2h_resource_convert.ts +67 -3
  211. package/i18n/skills/a2h-resource-convert/scripts/lottie_hosts.ts +415 -0
  212. package/i18n/skills/a2h-resource-convert/scripts/tests/lottie_hosts.test.mjs +222 -0
  213. package/i18n/skills/a2h-spec-design-pipeline/SKILL.md +69 -109
  214. package/i18n/skills/a2h-spec-design-pipeline/references/coding-loop.md +135 -37
  215. package/i18n/skills/a2h-spec-design-pipeline/references/homegraph-cli.md +307 -0
  216. package/i18n/skills/a2h-spec-design-pipeline/references/initialization.md +103 -0
  217. package/i18n/skills/a2h-spec-design-pipeline/references/merge-queue.md +126 -23
  218. package/i18n/skills/a2h-spec-design-pipeline/references/post-loop.md +23 -0
  219. package/i18n/skills/a2h-spec-design-pipeline/references/review-loop.md +71 -0
  220. package/i18n/skills/a2h-spec-design-pipeline/references/scripts.md +24 -13
  221. package/i18n/skills/a2h-spec-design-pipeline/references/state-and-resume.md +246 -0
  222. package/i18n/skills/a2h-spec-design-pipeline/scripts/plan_groups.ts +170 -7
  223. package/i18n/skills/a2h-spec-design-pipeline/scripts/test_plan_groups.ts +155 -0
  224. package/i18n/skills/a2h-spec-generate/SKILL.md +2 -2
  225. package/i18n/skills/a2h-utg-explorer/SKILL.md +9 -3
  226. package/i18n/skills/a2h-utg-explorer/references/architecture.md +3 -0
  227. package/i18n/skills/a2h-utg-explorer/scripts/compile_tasks.mjs +74 -84
  228. package/i18n/skills/a2h-utg-explorer/scripts/hybrid_route_cdp.mjs +376 -0
  229. package/i18n/skills/a2h-utg-explorer/scripts/recover_d.mjs +288 -21
  230. package/i18n/skills/a2h-utg-explorer/scripts/seed_recipes.mjs +426 -0
  231. package/i18n/skills/a2h-utg-explorer/scripts/tests/diagnostics.test.mjs +252 -0
  232. package/i18n/skills/a2h-utg-explorer/scripts/tests/hybrid_route_identity.test.mjs +146 -0
  233. package/i18n/skills/a2h-utg-explorer/scripts/tests/interruptions.test.mjs +122 -0
  234. package/i18n/skills/a2h-utg-explorer/scripts/tests/launch_bridge.test.mjs +15 -0
  235. package/i18n/skills/a2h-utg-explorer/scripts/tests/seed_recipes.test.mjs +261 -0
  236. package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/diagnostics.mjs +196 -0
  237. package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/hybrid_route.mjs +140 -0
  238. package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/semantics.mjs +211 -61
  239. package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/state_phase.mjs +47 -0
  240. package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/task_runner.mjs +724 -47
  241. package/i18n/skills/a2h-utg-static/SKILL.md +6 -2
  242. package/i18n/skills/a2h-utg-static/scripts/assemble.mjs +82 -12
  243. package/i18n/skills/a2h-utg-static/scripts/click_paths.mjs +116 -5
  244. package/i18n/skills/a2h-utg-static/scripts/compose_body_text.mjs +3 -3
  245. package/i18n/skills/a2h-utg-static/scripts/compose_titles.mjs +5 -5
  246. package/i18n/skills/a2h-utg-static/scripts/compose_widgets.mjs +4 -4
  247. package/i18n/skills/a2h-utg-static/scripts/data_model.mjs +590 -0
  248. package/i18n/skills/a2h-utg-static/scripts/data_producers.mjs +431 -0
  249. package/i18n/skills/a2h-utg-static/scripts/hybrid_scope.mjs +50 -5
  250. package/i18n/skills/a2h-utg-static/scripts/label_resolve.mjs +49 -4
  251. package/i18n/skills/a2h-utg-static/scripts/lib/hybrid-provenance.mjs +201 -0
  252. package/i18n/skills/a2h-utg-static/scripts/lib/uniapp-routes.mjs +195 -0
  253. package/i18n/skills/a2h-utg-static/scripts/nl_hints.mjs +32 -4
  254. package/i18n/skills/a2h-utg-static/scripts/tests/test_compose_res_text.mjs +17 -0
  255. package/i18n/skills/a2h-utg-static/scripts/tests/test_data_model.mjs +120 -0
  256. package/i18n/skills/a2h-utg-static/scripts/tests/test_data_producers.mjs +113 -0
  257. package/i18n/skills/a2h-utg-static/scripts/tests/test_hybrid_provenance.mjs +150 -0
  258. package/i18n/skills/a2h-utg-static/scripts/tests/test_hybrid_scope.mjs +181 -17
  259. package/i18n/skills/a2h-utg-static/scripts/tests/test_module_strings.mjs +35 -1
  260. package/i18n/skills/a2h-utg-static/scripts/tests/test_uniapp_routes.mjs +161 -0
  261. package/i18n/skills/a2h-utg-static/scripts/tests/test_uniapp_source.mjs +118 -19
  262. package/i18n/skills/a2h-utg-static/scripts/tests/test_utg_specgen_boundary.mjs +45 -0
  263. package/i18n/skills/a2h-utg-static/scripts/uniapp_nav.mjs +113 -70
  264. package/index.js +1643 -0
  265. package/package.json +10 -13
  266. package/plugin.jsonc +12 -0
  267. package/skills/a2h-app-migrate/SKILL.md +19 -11
  268. package/skills/a2h-app-migrate/references/feature-scope.md +121 -0
  269. package/skills/a2h-app-migrate/references/stage-map.md +2 -2
  270. package/skills/a2h-app-migrate/references/workflow.yaml +307 -74
  271. package/skills/a2h-app-migrate/scripts/android_index.mjs +35 -8
  272. package/skills/a2h-app-migrate/scripts/check_module_docs_done.mjs +39 -1
  273. package/skills/a2h-app-migrate/scripts/check_spec_gen_done.mjs +78 -5
  274. package/skills/a2h-app-migrate/scripts/check_spec_pipeline_done.mjs +144 -9
  275. package/skills/a2h-app-migrate/scripts/check_ui_batch_done.mjs +14 -1
  276. package/skills/a2h-app-migrate/scripts/check_utg_static_done.mjs +46 -5
  277. package/skills/a2h-app-migrate/scripts/diagnose.mjs +162 -0
  278. package/skills/a2h-app-migrate/scripts/env_preflight.mjs +79 -11
  279. package/skills/a2h-app-migrate/scripts/feature_scope.mjs +347 -0
  280. package/skills/a2h-app-migrate/scripts/human_review_gate.mjs +75 -4
  281. package/skills/a2h-app-migrate/scripts/infer_android_root.mjs +17 -1
  282. package/skills/a2h-app-migrate/scripts/ledger.mjs +64 -6
  283. package/skills/a2h-app-migrate/scripts/migration_manifest.mjs +351 -0
  284. package/skills/a2h-app-migrate/scripts/paths_preflight.mjs +9 -23
  285. package/skills/a2h-app-migrate/scripts/resume_plan.mjs +33 -9
  286. package/skills/a2h-app-migrate/scripts/reuse_static_utg.mjs +33 -1
  287. package/skills/a2h-app-migrate/scripts/run_dir.mjs +27 -17
  288. package/skills/a2h-app-migrate/scripts/scope_model.mjs +255 -0
  289. package/skills/a2h-app-migrate/scripts/scope_report.mjs +128 -0
  290. package/skills/a2h-app-migrate/scripts/source_fp.mjs +120 -0
  291. package/skills/a2h-app-migrate/test/test_android_index.mjs +12 -0
  292. package/skills/a2h-app-migrate/test/test_env_requirements.mjs +25 -10
  293. package/skills/a2h-app-migrate/test/test_feature_scope.mjs +217 -0
  294. package/skills/a2h-app-migrate/test/test_finalize.mjs +35 -7
  295. package/skills/a2h-app-migrate/test/test_hmos_fingerprint.mjs +7 -7
  296. package/skills/a2h-app-migrate/test/test_incremental_acceptance.mjs +145 -0
  297. package/skills/a2h-app-migrate/test/test_incremental_phase2.mjs +223 -0
  298. package/skills/a2h-app-migrate/test/test_incremental_phase2_acceptance.mjs +157 -0
  299. package/skills/a2h-app-migrate/test/test_incremental_profile.mjs +84 -0
  300. package/skills/a2h-app-migrate/test/test_infer_android_root.mjs +10 -0
  301. package/skills/a2h-app-migrate/test/test_json_io.mjs +1 -1
  302. package/skills/a2h-app-migrate/test/test_leaf_questions.mjs +39 -0
  303. package/skills/a2h-app-migrate/test/test_migration_manifest.mjs +225 -0
  304. package/skills/a2h-app-migrate/test/test_module_docs_done.mjs +33 -0
  305. package/skills/a2h-app-migrate/test/test_resume_plan.mjs +52 -0
  306. package/skills/a2h-app-migrate/test/test_resume_summary.mjs +26 -0
  307. package/skills/a2h-app-migrate/test/test_reuse_static_utg.mjs +36 -0
  308. package/skills/a2h-app-migrate/test/test_run_dir.mjs +71 -7
  309. package/skills/a2h-app-migrate/test/test_scope_model.mjs +172 -0
  310. package/skills/a2h-app-migrate/test/test_spec_engine_contract.mjs +13 -5
  311. package/skills/a2h-app-migrate/test/test_spec_gen_done.mjs +117 -0
  312. package/skills/a2h-app-migrate/test/test_spec_gen_gate.mjs +7 -3
  313. package/skills/a2h-app-migrate/test/test_spec_pipeline_done.mjs +170 -3
  314. package/skills/a2h-app-migrate/test/test_specs_json_preflight.mjs +1 -1
  315. package/skills/a2h-app-migrate/test/test_ui_batch_capture_audit.mjs +106 -0
  316. package/skills/a2h-app-migrate/test/test_ui_batch_done.mjs +12 -0
  317. package/skills/a2h-app-migrate/test/test_utg_static_done.mjs +38 -2
  318. package/skills/a2h-arch-generate/SKILL.md +20 -17
  319. package/skills/a2h-arch-generate/references/homegraph-workflow.md +10 -8
  320. package/skills/a2h-arch-generate/references/source-baseline.md +2 -2
  321. package/skills/a2h-arch-generate/scripts/cleanup_intermediates.mjs +34 -3
  322. package/skills/a2h-arch-generate/scripts/create_project.mjs +24 -1
  323. package/skills/a2h-arch-generate/scripts/inspect_and_route.mjs +29 -5
  324. package/skills/a2h-arch-generate/scripts/tests/run_tests.mjs +3 -3
  325. package/skills/a2h-arch-generate/scripts/tests/test_cleanup.mjs +17 -0
  326. package/skills/a2h-arch-generate/scripts/tests/test_router.mjs +26 -0
  327. package/skills/a2h-arch-generate/scripts/validate_incremental_docs.mjs +4 -2
  328. package/skills/a2h-arkts-logic-coder/SKILL.md +146 -17
  329. package/skills/a2h-arkts-logic-coder/references/ISSUES.md +2 -1
  330. package/skills/a2h-arkts-logic-coder/references/code-generation.md +59 -2
  331. package/skills/a2h-arkts-logic-coder/references/spec-design.md +42 -11
  332. package/skills/a2h-arkts-logic-coder/scripts/state_doc.mjs +328 -38
  333. package/skills/a2h-arkts-logic-coder/test/test_state_doc.mjs +244 -0
  334. package/skills/a2h-batch-ui-align/SKILL.md +72 -22
  335. package/skills/a2h-batch-ui-align/assets/ColorUtils.ets +16 -2
  336. package/skills/a2h-batch-ui-align/references/cards/alignment.md +5 -1
  337. package/skills/a2h-batch-ui-align/references/cards/geometry.md +5 -0
  338. package/skills/a2h-batch-ui-align/references/cards/interaction.md +2 -1
  339. package/skills/a2h-batch-ui-align/references/cards/resources.md +6 -4
  340. package/skills/a2h-batch-ui-align/references/cards/widgets.md +5 -0
  341. package/skills/a2h-batch-ui-align/references/cards/window.md +2 -1
  342. package/skills/a2h-batch-ui-align/references/checker-rules.md +236 -11
  343. package/skills/a2h-batch-ui-align/references/conversion-procedure.md +8 -5
  344. package/skills/a2h-batch-ui-align/references/host-dispatch.md +2 -0
  345. package/skills/a2h-batch-ui-align/references/incremental-scope.md +28 -9
  346. package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +7 -4
  347. package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-layout-mapping-reference.md +28 -1
  348. 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
  349. package/skills/a2h-batch-ui-align/references/step3-capture.md +25 -6
  350. package/skills/a2h-batch-ui-align/references/step4-prepare.md +3 -0
  351. package/skills/a2h-batch-ui-align/references/step5-convert.md +26 -4
  352. package/skills/a2h-batch-ui-align/scripts/branch_coverage.mjs +155 -0
  353. package/skills/a2h-batch-ui-align/scripts/build_conversion_set.mjs +380 -16
  354. package/skills/a2h-batch-ui-align/scripts/capture_audit.mjs +474 -0
  355. package/skills/a2h-batch-ui-align/scripts/capture_fast.mjs +665 -0
  356. package/skills/a2h-batch-ui-align/scripts/capture_verify.mjs +552 -0
  357. package/skills/a2h-batch-ui-align/scripts/detach.mjs +5 -2
  358. package/skills/a2h-batch-ui-align/scripts/evidence_gate.mjs +39 -5
  359. package/skills/a2h-batch-ui-align/scripts/export_ui_info.mjs +19 -1
  360. package/skills/a2h-batch-ui-align/scripts/group_pack.mjs +134 -11
  361. package/skills/a2h-batch-ui-align/scripts/group_queue.mjs +213 -30
  362. package/skills/a2h-batch-ui-align/scripts/icon_coverage.mjs +147 -0
  363. package/skills/a2h-batch-ui-align/scripts/list_existing.mjs +141 -0
  364. package/skills/a2h-batch-ui-align/scripts/measure_pack.ts +231 -5
  365. package/skills/a2h-batch-ui-align/scripts/page_gap.mjs +210 -0
  366. package/skills/a2h-batch-ui-align/scripts/phase5_check.mjs +82 -8
  367. package/skills/a2h-batch-ui-align/scripts/progress_identity.mjs +208 -0
  368. package/skills/a2h-batch-ui-align/scripts/scroll_verdict.mjs +62 -0
  369. package/skills/a2h-batch-ui-align/scripts/shell_contract.mjs +21 -7
  370. package/skills/a2h-batch-ui-align/scripts/shell_requests.mjs +273 -0
  371. package/skills/a2h-batch-ui-align/scripts/state_doc.mjs +9 -4
  372. package/skills/a2h-batch-ui-align/scripts/static_check/core/baseline.ts +79 -0
  373. package/skills/a2h-batch-ui-align/scripts/static_check/core/parse.ts +90 -2
  374. package/skills/a2h-batch-ui-align/scripts/static_check/core/scan.ts +44 -0
  375. package/skills/a2h-batch-ui-align/scripts/static_check/main.ts +48 -5
  376. package/skills/a2h-batch-ui-align/scripts/static_check/registry.ts +24 -0
  377. package/skills/a2h-batch-ui-align/scripts/static_check/rules/a11y.ts +3 -17
  378. package/skills/a2h-batch-ui-align/scripts/static_check/rules/attr_chain.ts +1 -19
  379. package/skills/a2h-batch-ui-align/scripts/static_check/rules/dialog_backboard.ts +91 -0
  380. package/skills/a2h-batch-ui-align/scripts/static_check/rules/event_default_click.ts +179 -0
  381. package/skills/a2h-batch-ui-align/scripts/static_check/rules/hit_test.ts +339 -0
  382. package/skills/a2h-batch-ui-align/scripts/static_check/rules/image_source.ts +84 -0
  383. package/skills/a2h-batch-ui-align/scripts/static_check/rules/input_traps.ts +249 -0
  384. package/skills/a2h-batch-ui-align/scripts/static_check/rules/layout_placement.ts +234 -5
  385. package/skills/a2h-batch-ui-align/scripts/static_check/rules/lottie_host.ts +145 -0
  386. package/skills/a2h-batch-ui-align/scripts/static_check/rules/media_tint.ts +45 -11
  387. package/skills/a2h-batch-ui-align/scripts/static_check/rules/overlay_binds.ts +56 -0
  388. package/skills/a2h-batch-ui-align/scripts/static_check/rules/overlay_string.ts +96 -0
  389. package/skills/a2h-batch-ui-align/scripts/static_check/rules/padding_in_size.ts +60 -0
  390. package/skills/a2h-batch-ui-align/scripts/static_check/rules/percent_height_in_scroll.ts +3 -2
  391. package/skills/a2h-batch-ui-align/scripts/static_check/rules/relative_container_height.ts +102 -0
  392. package/skills/a2h-batch-ui-align/scripts/static_check/rules/root_weight.ts +54 -4
  393. package/skills/a2h-batch-ui-align/scripts/static_check/rules/runtime_traps.ts +440 -0
  394. package/skills/a2h-batch-ui-align/scripts/static_check/rules/scroll_align.ts +75 -23
  395. package/skills/a2h-batch-ui-align/scripts/static_check/rules/swiper_index.ts +65 -0
  396. package/skills/a2h-batch-ui-align/scripts/static_check/rules/theme_color.ts +63 -2
  397. package/skills/a2h-batch-ui-align/scripts/static_check/rules/waterflow_sections.ts +231 -0
  398. package/skills/a2h-batch-ui-align/scripts/static_check/rules/wide_constant_width.ts +4 -4
  399. package/skills/a2h-batch-ui-align/scripts/static_check/scan_file.ts +24 -2
  400. package/skills/a2h-batch-ui-align/scripts/tests/agent_cli.test.mjs +14 -0
  401. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_baseline.test.mjs +129 -0
  402. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_coolmall_runtime2.test.mjs +697 -0
  403. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_hit_test.test.mjs +298 -0
  404. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_input_runtime.test.mjs +514 -0
  405. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_layout_placement.test.mjs +224 -0
  406. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_overlay_lottie.test.mjs +199 -0
  407. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_rule_smoke.test.mjs +41 -7
  408. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_runtime_api.test.mjs +346 -0
  409. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_theme_runtime.test.mjs +95 -0
  410. package/skills/a2h-batch-ui-align/scripts/tests/branch_coverage.test.mjs +116 -0
  411. package/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set.test.mjs +126 -0
  412. package/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set_scope.test.mjs +1 -0
  413. package/skills/a2h-batch-ui-align/scripts/tests/capture_audit.test.mjs +179 -0
  414. package/skills/a2h-batch-ui-align/scripts/tests/capture_fast.test.mjs +56 -0
  415. package/skills/a2h-batch-ui-align/scripts/tests/capture_gate.test.mjs +197 -0
  416. package/skills/a2h-batch-ui-align/scripts/tests/capture_review_fixes.test.mjs +322 -0
  417. package/skills/a2h-batch-ui-align/scripts/tests/color_utils_asset.test.mjs +19 -0
  418. package/skills/a2h-batch-ui-align/scripts/tests/evidence_gate.test.mjs +15 -0
  419. package/skills/a2h-batch-ui-align/scripts/tests/fixtures/icon_drift_search_sheet/SearchMenuDialog.buggy.ets +95 -0
  420. package/skills/a2h-batch-ui-align/scripts/tests/fixtures/icon_drift_search_sheet/page_0002_SearchMenuFragment/meta.json +21 -0
  421. package/skills/a2h-batch-ui-align/scripts/tests/fixtures/icon_drift_search_sheet/page_0002_SearchMenuFragment/screenshot.png +0 -0
  422. package/skills/a2h-batch-ui-align/scripts/tests/fixtures/icon_drift_search_sheet/page_0002_SearchMenuFragment/view.xml +35 -0
  423. package/skills/a2h-batch-ui-align/scripts/tests/group_pack_evidence.test.mjs +95 -0
  424. package/skills/a2h-batch-ui-align/scripts/tests/group_queue.test.mjs +155 -1
  425. package/skills/a2h-batch-ui-align/scripts/tests/icon_coverage.test.mjs +314 -0
  426. package/skills/a2h-batch-ui-align/scripts/tests/list_existing.test.mjs +157 -0
  427. package/skills/a2h-batch-ui-align/scripts/tests/measure_pack.test.mjs +5 -3
  428. package/skills/a2h-batch-ui-align/scripts/tests/page_gap.test.mjs +115 -0
  429. package/skills/a2h-batch-ui-align/scripts/tests/phase5_check.test.mjs +33 -2
  430. package/skills/a2h-batch-ui-align/scripts/tests/progress_identity.test.mjs +174 -0
  431. package/skills/a2h-batch-ui-align/scripts/tests/shell_contract.test.mjs +5 -0
  432. package/skills/a2h-batch-ui-align/scripts/tests/shell_requests.test.mjs +158 -0
  433. package/skills/a2h-batch-ui-align/scripts/tests/skill_doc_contract.test.mjs +12 -0
  434. package/skills/a2h-batch-ui-align/scripts/tests/state_doc.test.mjs +8 -0
  435. package/skills/a2h-coldstart-smoke-gate/SKILL.md +7 -4
  436. package/skills/a2h-dashboard-render/test/test_device_locale_dialogs.mjs +17 -0
  437. package/skills/a2h-module-semantic-docs/SKILL.md +51 -13
  438. package/skills/a2h-module-semantic-docs/scripts/scan_modules.mjs +66 -11
  439. package/skills/a2h-module-semantic-docs/test/test_incremental_fingerprint.mjs +94 -0
  440. package/skills/a2h-page-specgen/SKILL.md +124 -20
  441. package/skills/a2h-page-specgen/references/behavior-ledger.md +1170 -0
  442. package/skills/a2h-page-specgen/references/body-language.md +11 -9
  443. package/skills/a2h-page-specgen/references/evidence.md +35 -0
  444. package/skills/a2h-page-specgen/references/execution-model.md +135 -26
  445. package/skills/a2h-page-specgen/references/footprint-and-grouping.md +20 -15
  446. package/skills/a2h-page-specgen/references/gates.md +120 -52
  447. package/skills/a2h-page-specgen/references/page-inventory.md +69 -22
  448. package/skills/a2h-page-specgen/references/scenario-authoring.md +272 -0
  449. package/skills/a2h-page-specgen/references/spec-example.md +312 -0
  450. package/skills/a2h-page-specgen/references/spec-template.md +112 -109
  451. package/skills/a2h-page-specgen/scripts/behavior-audit.mjs +2436 -0
  452. package/skills/a2h-page-specgen/scripts/behavior-discovery.mjs +1833 -0
  453. package/skills/a2h-page-specgen/scripts/behavior-model.mjs +181 -0
  454. package/skills/a2h-page-specgen/scripts/behavior-reconcile.mjs +1205 -0
  455. package/skills/a2h-page-specgen/scripts/dispatch.mjs +8 -5
  456. package/skills/a2h-page-specgen/scripts/entry-evidence.mjs +1123 -0
  457. package/skills/a2h-page-specgen/scripts/facts-build.mjs +170 -61
  458. package/skills/a2h-page-specgen/scripts/finalize.mjs +466 -63
  459. package/skills/a2h-page-specgen/scripts/footprint.mjs +302 -180
  460. package/skills/a2h-page-specgen/scripts/gate.mjs +372 -82
  461. package/skills/a2h-page-specgen/scripts/interactions.mjs +215 -8
  462. package/skills/a2h-page-specgen/scripts/inventory.mjs +102 -0
  463. package/skills/a2h-page-specgen/scripts/lib/contracts.mjs +116 -216
  464. package/skills/a2h-page-specgen/scripts/lib/draft-store.mjs +105 -13
  465. package/skills/a2h-page-specgen/scripts/lib/graph-evidence.mjs +235 -0
  466. package/skills/a2h-page-specgen/scripts/lib/hg.mjs +520 -12
  467. package/skills/a2h-page-specgen/scripts/lib/homegraph-process.mjs +102 -0
  468. package/skills/a2h-page-specgen/scripts/lib/homegraph-query.mjs +161 -0
  469. package/skills/a2h-page-specgen/scripts/lib/ledger.mjs +129 -6
  470. package/skills/a2h-page-specgen/scripts/lib/main-module.mjs +24 -0
  471. package/skills/a2h-page-specgen/scripts/lib/operation-reviews.mjs +913 -0
  472. package/skills/a2h-page-specgen/scripts/lib/prose.mjs +12 -8
  473. package/skills/a2h-page-specgen/scripts/lib/recovery-policy.mjs +28 -0
  474. package/skills/a2h-page-specgen/scripts/lib/scope.mjs +355 -0
  475. package/skills/a2h-page-specgen/scripts/lib/semantic-detail.mjs +353 -0
  476. package/skills/a2h-page-specgen/scripts/lib/source-text.mjs +106 -0
  477. package/skills/a2h-page-specgen/scripts/operation-evidence.mjs +1542 -0
  478. package/skills/a2h-page-specgen/scripts/prepare.mjs +470 -122
  479. package/skills/a2h-page-specgen/scripts/render.mjs +11 -34
  480. package/skills/a2h-page-specgen/scripts/report.mjs +339 -6
  481. package/skills/a2h-page-specgen/scripts/submission.mjs +253 -88
  482. package/skills/a2h-page-specgen/scripts/submit.mjs +12 -6
  483. package/skills/a2h-page-specgen/scripts/test/acceptance/acceptance.mjs +288 -7
  484. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.java +15 -0
  485. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.json +26 -0
  486. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.prompt.md +347 -0
  487. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.worker.md +298 -0
  488. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.java +36 -0
  489. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.json +43 -0
  490. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.prompt.md +347 -0
  491. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.worker.md +298 -0
  492. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.discovery.json +2694 -0
  493. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.json +726 -0
  494. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.post-review.json +108 -0
  495. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.prompt.md +347 -0
  496. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.review.md +65 -0
  497. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.worker.md +265 -0
  498. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.java +47 -0
  499. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.json +54 -0
  500. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.prompt.md +347 -0
  501. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.worker.md +298 -0
  502. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/branch-checklist.md +32 -0
  503. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/gate-results.json +22 -0
  504. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/manifest.json +111 -0
  505. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/portability.test.mjs +141 -0
  506. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/review.md +22 -0
  507. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/run.mjs +515 -0
  508. package/skills/a2h-page-specgen/scripts/test/android-entry-evidence.test.mjs +585 -0
  509. package/skills/a2h-page-specgen/scripts/test/android-operation-evidence.test.mjs +755 -0
  510. package/skills/a2h-page-specgen/scripts/test/behavior-audit-group.test.mjs +543 -0
  511. package/skills/a2h-page-specgen/scripts/test/behavior-audit-post.test.mjs +652 -0
  512. package/skills/a2h-page-specgen/scripts/test/behavior-audit-pre.test.mjs +1231 -0
  513. package/skills/a2h-page-specgen/scripts/test/behavior-component-gate.test.mjs +494 -0
  514. package/skills/a2h-page-specgen/scripts/test/behavior-discovery.test.mjs +1513 -0
  515. package/skills/a2h-page-specgen/scripts/test/behavior-finalize.test.mjs +758 -0
  516. package/skills/a2h-page-specgen/scripts/test/behavior-fixtures.mjs +623 -0
  517. package/skills/a2h-page-specgen/scripts/test/behavior-model.test.mjs +116 -0
  518. package/skills/a2h-page-specgen/scripts/test/behavior-reconcile.test.mjs +795 -0
  519. package/skills/a2h-page-specgen/scripts/test/behavior-regression.test.mjs +883 -0
  520. package/skills/a2h-page-specgen/scripts/test/contracts.test.mjs +135 -137
  521. package/skills/a2h-page-specgen/scripts/test/entry-evidence.test.mjs +475 -0
  522. package/skills/a2h-page-specgen/scripts/test/facts.test.mjs +40 -1
  523. package/skills/a2h-page-specgen/scripts/test/finalize.test.mjs +178 -9
  524. package/skills/a2h-page-specgen/scripts/test/fixtures/hg.mkdb.mjs +19 -1
  525. package/skills/a2h-page-specgen/scripts/test/fixtures/src/BottomPanels.java +14 -0
  526. package/skills/a2h-page-specgen/scripts/test/fixtures/src/BottomPanels.kt +14 -0
  527. package/skills/a2h-page-specgen/scripts/test/fixtures/src/BottomPanelsKotlinForms.kt +12 -0
  528. package/skills/a2h-page-specgen/scripts/test/fixtures/src/ChildContent.java +6 -0
  529. package/skills/a2h-page-specgen/scripts/test/fixtures/src/ComposeLifecycle.kt +26 -0
  530. package/skills/a2h-page-specgen/scripts/test/fixtures/src/LifecycleCallAndOverride.java +10 -0
  531. package/skills/a2h-page-specgen/scripts/test/fixtures/src/LifecycleHooks.kt +31 -0
  532. package/skills/a2h-page-specgen/scripts/test/fixtures/src/ManyLifecycleHooks.kt +12 -0
  533. package/skills/a2h-page-specgen/scripts/test/fixtures/src/RefreshOnResume.java +7 -0
  534. package/skills/a2h-page-specgen/scripts/test/fixtures/src/RefreshResultNoise.kt +36 -0
  535. package/skills/a2h-page-specgen/scripts/test/fixtures/src/SelectionView.java +5 -0
  536. package/skills/a2h-page-specgen/scripts/test/fixtures/src/ShowPage.vue +12 -0
  537. package/skills/a2h-page-specgen/scripts/test/fixtures/src/ThirdPartyLifecycle.kt +25 -0
  538. package/skills/a2h-page-specgen/scripts/test/fixtures/src/fragment_detail.xml +1 -0
  539. package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/App.vue +1 -0
  540. package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/bundle-conflict-record.json +17 -0
  541. package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/bundle-record.json +17 -0
  542. package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/manifest.json +3 -0
  543. package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/pages/list/index.vue +80 -0
  544. package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/pages.json +14 -0
  545. package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/source-record.json +15 -0
  546. package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/components/RefreshPanel.vue +15 -0
  547. package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/composables/useRefresh.ts +50 -0
  548. package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/pages/help/index.vue +9 -0
  549. package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/state/store.ts +4 -0
  550. package/skills/a2h-page-specgen/scripts/test/footprint-resolve.test.mjs +459 -188
  551. package/skills/a2h-page-specgen/scripts/test/gate-partial.test.mjs +89 -0
  552. package/skills/a2h-page-specgen/scripts/test/gate.test.mjs +869 -13
  553. package/skills/a2h-page-specgen/scripts/test/graph-evidence.test.mjs +332 -0
  554. package/skills/a2h-page-specgen/scripts/test/helpers.mjs +139 -5
  555. package/skills/a2h-page-specgen/scripts/test/hg.test.mjs +378 -0
  556. package/skills/a2h-page-specgen/scripts/test/homegraph-process-fixture.mjs +130 -0
  557. package/skills/a2h-page-specgen/scripts/test/homegraph-query.test.mjs +288 -0
  558. package/skills/a2h-page-specgen/scripts/test/integration.test.mjs +69 -2
  559. package/skills/a2h-page-specgen/scripts/test/interactions.test.mjs +267 -2
  560. package/skills/a2h-page-specgen/scripts/test/inventory.test.mjs +111 -0
  561. package/skills/a2h-page-specgen/scripts/test/keys.test.mjs +10 -8
  562. package/skills/a2h-page-specgen/scripts/test/ledger-lock.test.mjs +77 -0
  563. package/skills/a2h-page-specgen/scripts/test/ledger.test.mjs +1 -1
  564. package/skills/a2h-page-specgen/scripts/test/main-module.test.mjs +43 -0
  565. package/skills/a2h-page-specgen/scripts/test/operation-reviews.test.mjs +1002 -0
  566. package/skills/a2h-page-specgen/scripts/test/plan-build.test.mjs +143 -51
  567. package/skills/a2h-page-specgen/scripts/test/prepare-homegraph-reproduction.mjs +365 -0
  568. package/skills/a2h-page-specgen/scripts/test/prepare-homegraph.test.mjs +569 -0
  569. package/skills/a2h-page-specgen/scripts/test/prepare-index.test.mjs +42 -2
  570. package/skills/a2h-page-specgen/scripts/test/prepare-pipeline.test.mjs +326 -0
  571. package/skills/a2h-page-specgen/scripts/test/prompt-tpl.test.mjs +171 -3
  572. package/skills/a2h-page-specgen/scripts/test/prose.test.mjs +13 -5
  573. package/skills/a2h-page-specgen/scripts/test/protocol-docs.test.mjs +365 -1
  574. package/skills/a2h-page-specgen/scripts/test/recovery-e2e.test.mjs +102 -7
  575. package/skills/a2h-page-specgen/scripts/test/recovery-policy.test.mjs +14 -0
  576. package/skills/a2h-page-specgen/scripts/test/recovery.test.mjs +1308 -72
  577. package/skills/a2h-page-specgen/scripts/test/render.test.mjs +85 -42
  578. package/skills/a2h-page-specgen/scripts/test/report.test.mjs +296 -0
  579. package/skills/a2h-page-specgen/scripts/test/review-followup.test.mjs +467 -0
  580. package/skills/a2h-page-specgen/scripts/test/scope.test.mjs +292 -0
  581. package/skills/a2h-page-specgen/scripts/test/semantic-detail.test.mjs +949 -0
  582. package/skills/a2h-page-specgen/scripts/test/submit.test.mjs +645 -115
  583. package/skills/a2h-page-specgen/scripts/test/uniapp-operation-evidence.test.mjs +639 -0
  584. package/skills/a2h-page-specgen/scripts/test/utg-footprint-contract.test.mjs +274 -0
  585. package/skills/a2h-page-specgen/scripts/test/waker-process.test.mjs +101 -65
  586. package/skills/a2h-page-specgen/scripts/test/waker.test.mjs +88 -74
  587. package/skills/a2h-page-specgen/scripts/test/watchdog.test.mjs +30 -1
  588. package/skills/a2h-page-specgen/scripts/waker.mjs +79 -12
  589. package/skills/a2h-page-specgen/scripts/watchdog.mjs +18 -17
  590. package/skills/a2h-resource-convert/SKILL.md +9 -1
  591. package/skills/a2h-resource-convert/references/code-vector-icon-rules.md +2 -1
  592. package/skills/a2h-resource-convert/references/incremental-page-migration.md +23 -2
  593. package/skills/a2h-resource-convert/references/lottie-conversion-rules.md +7 -0
  594. package/skills/a2h-resource-convert/references/step4-resource-types.md +2 -0
  595. package/skills/a2h-resource-convert/scripts/a2h_resource_convert.ts +67 -3
  596. package/skills/a2h-resource-convert/scripts/a2h_resource_incremental.ts +68 -0
  597. package/skills/a2h-resource-convert/scripts/code_vector_icons.ts +45 -3
  598. package/skills/a2h-resource-convert/scripts/extract_page_resources.ts +42 -5
  599. package/skills/a2h-resource-convert/scripts/lottie_hosts.ts +415 -0
  600. package/skills/a2h-resource-convert/scripts/lottie_refs.ts +398 -0
  601. package/skills/a2h-resource-convert/scripts/merge_mapping.ts +316 -0
  602. package/skills/a2h-resource-convert/scripts/svg_fidelity_check.ts +2 -1
  603. package/skills/a2h-resource-convert/scripts/tests/code_vector_guard.test.mjs +75 -0
  604. package/skills/a2h-resource-convert/scripts/tests/lottie_hosts.test.mjs +222 -0
  605. package/skills/a2h-resource-convert/scripts/tests/lottie_incremental.test.mjs +178 -0
  606. package/skills/a2h-resource-convert/scripts/tests/merge_mapping.test.mjs +201 -0
  607. package/skills/a2h-spec-design-pipeline/SKILL.md +48 -72
  608. package/skills/a2h-spec-design-pipeline/references/coding-loop.md +123 -37
  609. package/skills/a2h-spec-design-pipeline/references/execution-model.md +40 -8
  610. package/skills/a2h-spec-design-pipeline/references/final-report-template.md +5 -4
  611. package/skills/a2h-spec-design-pipeline/references/homegraph-cli.md +229 -0
  612. package/skills/a2h-spec-design-pipeline/references/initialization.md +37 -5
  613. package/skills/a2h-spec-design-pipeline/references/merge-queue.md +126 -23
  614. package/skills/a2h-spec-design-pipeline/references/permission-index.json +206 -0
  615. package/skills/a2h-spec-design-pipeline/references/post-loop.md +23 -0
  616. package/skills/a2h-spec-design-pipeline/references/resolver-prompt.md +7 -1
  617. package/skills/a2h-spec-design-pipeline/references/review-loop.md +46 -0
  618. package/skills/a2h-spec-design-pipeline/references/scripts.md +38 -14
  619. package/skills/a2h-spec-design-pipeline/references/shared-layer.md +127 -4
  620. package/skills/a2h-spec-design-pipeline/references/state-and-resume.md +90 -24
  621. package/skills/a2h-spec-design-pipeline/references/static-defect-gate.md +65 -34
  622. package/skills/a2h-spec-design-pipeline/rules/migration-rules/config/ruleMeta.json +11 -1
  623. package/skills/a2h-spec-design-pipeline/rules/migration-rules/config/ruleSet.json +10 -2
  624. package/skills/a2h-spec-design-pipeline/rules/migration-rules/data/README.md +47 -0
  625. package/skills/a2h-spec-design-pipeline/rules/migration-rules/data/api-param-contract.json +31 -0
  626. package/skills/a2h-spec-design-pipeline/rules/migration-rules/data/api-permission-map.json +698 -0
  627. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/api-permission-declared-cn.md +96 -0
  628. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/api-permission-declared-en.md +103 -0
  629. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/arkui-runtime-pitfall-cn.md +124 -0
  630. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/arkui-runtime-pitfall-en.md +138 -0
  631. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/platform-api-contract-cn.md +106 -0
  632. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/platform-api-contract-en.md +113 -0
  633. package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/ApiPermissionDeclaredCheck.js +705 -0
  634. package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/ArkUIRuntimePitfallCheck.js +1063 -0
  635. package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/PlatformApiContractCheck.js +473 -0
  636. package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/{HttpExtraDataEmptyStringCheck.js → platform/ExtraDataSubCheck.js} +27 -30
  637. package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/index.js +4 -2
  638. package/skills/a2h-spec-design-pipeline/rules/migration-rules/package.json +3 -2
  639. package/skills/a2h-spec-design-pipeline/scripts/check_design_map.ts +108 -0
  640. package/skills/a2h-spec-design-pipeline/scripts/check_permissions.ts +420 -0
  641. package/skills/a2h-spec-design-pipeline/scripts/check_review_evidence.ts +45 -0
  642. package/skills/a2h-spec-design-pipeline/scripts/dispatch/evidence.mjs +55 -2
  643. package/skills/a2h-spec-design-pipeline/scripts/dispatch/fold.mjs +138 -7
  644. package/skills/a2h-spec-design-pipeline/scripts/dispatch/landing.mjs +10 -13
  645. package/skills/a2h-spec-design-pipeline/scripts/dispatch/progress.mjs +21 -2
  646. package/skills/a2h-spec-design-pipeline/scripts/dispatch/reconcile.mjs +63 -4
  647. package/skills/a2h-spec-design-pipeline/scripts/dispatch/wait.mjs +32 -2
  648. package/skills/a2h-spec-design-pipeline/scripts/dispatch.mjs +109 -13
  649. package/skills/a2h-spec-design-pipeline/scripts/ensure_index.ts +866 -0
  650. package/skills/a2h-spec-design-pipeline/scripts/fixtures/homecheck-stub.cjs +47 -0
  651. package/skills/a2h-spec-design-pipeline/scripts/homecheck_scan.ts +12 -17
  652. package/skills/a2h-spec-design-pipeline/scripts/plan_groups.ts +172 -7
  653. package/skills/a2h-spec-design-pipeline/scripts/resolver_prompt.ts +36 -16
  654. package/skills/a2h-spec-design-pipeline/scripts/sync_permission_index.ts +340 -0
  655. package/skills/a2h-spec-design-pipeline/scripts/test_api_permission_declared.ts +281 -0
  656. package/skills/a2h-spec-design-pipeline/scripts/test_arkui_runtime_pitfall.ts +690 -0
  657. package/skills/a2h-spec-design-pipeline/scripts/test_check_design_map.ts +46 -0
  658. package/skills/a2h-spec-design-pipeline/scripts/test_check_permissions.ts +201 -0
  659. package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_commands.mjs +27 -3
  660. package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_e2e.mjs +20 -7
  661. package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_evidence.mjs +143 -13
  662. package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_fold.mjs +168 -7
  663. package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_landing.mjs +139 -2
  664. package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_progress.mjs +25 -0
  665. package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_reconcile.mjs +92 -4
  666. package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_wait.mjs +37 -0
  667. package/skills/a2h-spec-design-pipeline/scripts/test_ensure_index.ts +572 -0
  668. package/skills/a2h-spec-design-pipeline/scripts/test_ensure_index_real.ts +56 -0
  669. package/skills/a2h-spec-design-pipeline/scripts/test_homecheck_scan.ts +4 -5
  670. package/skills/a2h-spec-design-pipeline/scripts/test_homegraph_docs.ts +217 -0
  671. package/skills/a2h-spec-design-pipeline/scripts/test_permission_index.ts +214 -0
  672. package/skills/a2h-spec-design-pipeline/scripts/test_plan_groups.ts +155 -0
  673. package/skills/a2h-spec-design-pipeline/scripts/test_platform_api_contract.ts +308 -0
  674. package/skills/a2h-spec-design-pipeline/scripts/test_resolver_prompt.ts +59 -8
  675. package/skills/a2h-spec-design-pipeline/scripts/test_shared_layer_docs.ts +44 -0
  676. package/skills/a2h-spec-generate/SKILL.md +2 -2
  677. package/skills/a2h-spec-generate/references/specs.schema.json +24 -11
  678. package/skills/a2h-spec-generate/scripts/ensure-index.mjs +1 -2
  679. package/skills/a2h-spec-generate/test/ensure-index.test.mjs +1 -2
  680. package/skills/a2h-utg-explorer/SKILL.md +9 -3
  681. package/skills/a2h-utg-explorer/references/architecture.md +3 -0
  682. package/skills/a2h-utg-explorer/scripts/audit.mjs +8 -2
  683. package/skills/a2h-utg-explorer/scripts/compile_tasks.mjs +56 -5
  684. package/skills/a2h-utg-explorer/scripts/direct_launch.mjs +47 -2
  685. package/skills/a2h-utg-explorer/scripts/hybrid_route_cdp.mjs +376 -0
  686. package/skills/a2h-utg-explorer/scripts/plan.mjs +8 -0
  687. package/skills/a2h-utg-explorer/scripts/recover_d.mjs +288 -21
  688. package/skills/a2h-utg-explorer/scripts/report.mjs +89 -0
  689. package/skills/a2h-utg-explorer/scripts/run_cycle.mjs +67 -10
  690. package/skills/a2h-utg-explorer/scripts/run_device.mjs +10 -2
  691. package/skills/a2h-utg-explorer/scripts/seed_recipes.mjs +426 -0
  692. package/skills/a2h-utg-explorer/scripts/tests/blank_wait.test.mjs +126 -0
  693. package/skills/a2h-utg-explorer/scripts/tests/default_override.test.mjs +109 -0
  694. package/skills/a2h-utg-explorer/scripts/tests/device_locale_dialogs.test.mjs +29 -0
  695. package/skills/a2h-utg-explorer/scripts/tests/diagnostics.test.mjs +254 -0
  696. package/skills/a2h-utg-explorer/scripts/tests/foreground_spelling.test.mjs +155 -0
  697. package/skills/a2h-utg-explorer/scripts/tests/hybrid_route.test.mjs +120 -0
  698. package/skills/a2h-utg-explorer/scripts/tests/hybrid_route_identity.test.mjs +146 -0
  699. package/skills/a2h-utg-explorer/scripts/tests/interruptions.test.mjs +122 -0
  700. package/skills/a2h-utg-explorer/scripts/tests/launch_bridge.test.mjs +15 -0
  701. package/skills/a2h-utg-explorer/scripts/tests/pr169_review_fixes.test.mjs +218 -0
  702. package/skills/a2h-utg-explorer/scripts/tests/pr191_review_fixes.test.mjs +292 -0
  703. package/skills/a2h-utg-explorer/scripts/tests/recover_d_grounding.test.mjs +164 -0
  704. package/skills/a2h-utg-explorer/scripts/tests/replay_reroute.test.mjs +143 -0
  705. package/skills/a2h-utg-explorer/scripts/tests/run_cycle.test.mjs +6 -2
  706. package/skills/a2h-utg-explorer/scripts/tests/run_cycle_follow.test.mjs +35 -0
  707. package/skills/a2h-utg-explorer/scripts/tests/seed_recipes.test.mjs +261 -0
  708. package/skills/a2h-utg-explorer/scripts/utg_explorer/adapters.mjs +122 -4
  709. package/skills/a2h-utg-explorer/scripts/utg_explorer/diagnostics.mjs +196 -0
  710. package/skills/a2h-utg-explorer/scripts/utg_explorer/hybrid_route.mjs +140 -0
  711. package/skills/a2h-utg-explorer/scripts/utg_explorer/semantics.mjs +138 -4
  712. package/skills/a2h-utg-explorer/scripts/utg_explorer/state_phase.mjs +47 -0
  713. package/skills/a2h-utg-explorer/scripts/utg_explorer/strings.mjs +22 -13
  714. package/skills/a2h-utg-explorer/scripts/utg_explorer/task_runner.mjs +718 -42
  715. package/skills/a2h-utg-explorer/scripts/variant.mjs +57 -11
  716. package/skills/a2h-utg-static/SKILL.md +6 -2
  717. package/skills/a2h-utg-static/scripts/assemble.mjs +65 -0
  718. package/skills/a2h-utg-static/scripts/click_paths.mjs +116 -5
  719. package/skills/a2h-utg-static/scripts/compose_body_text.mjs +3 -3
  720. package/skills/a2h-utg-static/scripts/compose_overlay.mjs +8 -1
  721. package/skills/a2h-utg-static/scripts/compose_titles.mjs +5 -5
  722. package/skills/a2h-utg-static/scripts/compose_widgets.mjs +4 -4
  723. package/skills/a2h-utg-static/scripts/data_model.mjs +590 -0
  724. package/skills/a2h-utg-static/scripts/data_producers.mjs +431 -0
  725. package/skills/a2h-utg-static/scripts/hybrid_scope.mjs +46 -1
  726. package/skills/a2h-utg-static/scripts/label_resolve.mjs +49 -4
  727. package/skills/a2h-utg-static/scripts/lib/hybrid-provenance.mjs +201 -0
  728. package/skills/a2h-utg-static/scripts/lib/uniapp-routes.mjs +195 -0
  729. package/skills/a2h-utg-static/scripts/menu_nav.mjs +1 -1
  730. package/skills/a2h-utg-static/scripts/nl_hints.mjs +32 -4
  731. package/skills/a2h-utg-static/scripts/run_pipeline.mjs +86 -4
  732. package/skills/a2h-utg-static/scripts/tests/test_carry_answers.mjs +30 -0
  733. package/skills/a2h-utg-static/scripts/tests/test_compose_res_text.mjs +18 -0
  734. package/skills/a2h-utg-static/scripts/tests/test_data_model.mjs +120 -0
  735. package/skills/a2h-utg-static/scripts/tests/test_data_producers.mjs +114 -0
  736. package/skills/a2h-utg-static/scripts/tests/test_guard_kinds_locale.mjs +12 -0
  737. package/skills/a2h-utg-static/scripts/tests/test_hybrid_provenance.mjs +150 -0
  738. package/skills/a2h-utg-static/scripts/tests/test_hybrid_scope.mjs +165 -1
  739. package/skills/a2h-utg-static/scripts/tests/test_library_activity.mjs +45 -0
  740. package/skills/a2h-utg-static/scripts/tests/test_module_strings.mjs +35 -1
  741. package/skills/a2h-utg-static/scripts/tests/test_nl_hints_default_override.mjs +50 -0
  742. package/skills/a2h-utg-static/scripts/tests/test_pipeline_llm_phases.mjs +21 -0
  743. package/skills/a2h-utg-static/scripts/tests/test_pr169_review_fixes.mjs +172 -0
  744. package/skills/a2h-utg-static/scripts/tests/test_redirect_path_cost.mjs +136 -0
  745. package/skills/a2h-utg-static/scripts/tests/test_uniapp_route_jump.mjs +175 -0
  746. package/skills/a2h-utg-static/scripts/tests/test_uniapp_routes.mjs +161 -0
  747. package/skills/a2h-utg-static/scripts/tests/test_uniapp_source.mjs +99 -0
  748. package/skills/a2h-utg-static/scripts/tests/test_utg_specgen_boundary.mjs +45 -0
  749. package/skills/a2h-utg-static/scripts/tests/test_vm_nav_helper_navigate.mjs +21 -0
  750. package/skills/a2h-utg-static/scripts/uniapp_nav.mjs +112 -69
  751. package/skills/a2h-utg-static/scripts/vm_nav.mjs +9 -1
  752. package/README.md +0 -440
  753. package/dist/cli/config-store.js +0 -128
  754. package/dist/cli/config.js +0 -48
  755. package/dist/cli/editors.json +0 -114
  756. package/dist/cli/env-vars.js +0 -127
  757. package/dist/cli/index.js +0 -76
  758. package/dist/cli/init.js +0 -2618
  759. package/dist/cli/uninstall.js +0 -406
  760. package/dist/platform/compose.js +0 -228
  761. package/dist/platform/frontmatter.js +0 -151
  762. package/dist/platform/installer.js +0 -417
  763. package/dist/platform/language.js +0 -77
  764. package/dist/platform/registry.js +0 -337
  765. package/dist/platform/transform.js +0 -363
  766. package/dist/platform/types.js +0 -9
  767. package/dist/platform/validate.js +0 -152
  768. package/dist/utils/regex.js +0 -7
  769. package/env-requirements.json +0 -536
  770. package/resource/choose_editor.png +0 -0
  771. package/resource/convert_pipeline_process.svg +0 -114
  772. package/resource/project_architecture.svg +0 -120
  773. package/resource/set_environment.png +0 -0
  774. package/resource/set_multimodel.png +0 -0
  775. package/resource/set_sdk.png +0 -0
  776. package/resource/title_dark.png +0 -0
  777. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/http-extra-data-empty-string-cn.md +0 -55
  778. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/http-extra-data-empty-string-en.md +0 -60
  779. package/skills/a2h-spec-design-pipeline/scripts/ensure_wt_index.ts +0 -948
  780. package/skills/a2h-spec-design-pipeline/scripts/test_ensure_wt_index.ts +0 -1014
@@ -0,0 +1,274 @@
1
+ # Scenario and Step Authoring Rules
2
+
3
+ ## Principles
4
+
5
+ The final SPEC must follow these rules:
6
+
7
+ - Requirements must be decomposed into atomic scenarios; atomic scenarios combine to form a requirement.
8
+ - Each atomic scenario corresponds to exactly one normal case or one edge/boundary case.
9
+ - Atomic scenarios must be comprehensive and non-redundant.
10
+ - The SPEC must contain a requirement semantic description, scenario semantic descriptions, and scenario flow descriptions.
11
+ - The scenario flow description must contain the trigger operation sequence and the logical execution steps for that scenario.
12
+
13
+ The sections below define how to apply them. The rules constrain only the final SPEC prose; evidence collection still keeps source symbols, paths, and `file:line`.
14
+
15
+ ## Evidence-First Expansion
16
+
17
+ Expand only branches that the source actually implements and that affect user-observable behavior. Every scenario, step, and outcome must be traceable to source evidence. Do not fill gaps with behavior that is merely common in similar products.
18
+
19
+ - Do not add timeout, permission, retry, or empty-state scenarios without evidence just because software of this kind usually has them.
20
+ - Fixed copy, the source of dynamic copy, counts, thresholds, formats, retention policies, and recovery behavior all require evidence. Never invent fixed error copy or replace dynamic copy with an unsupported literal value.
21
+ - When the source implements dynamic error copy, state its real source, for example: “Show an error message using the text returned by the server.”
22
+ - A failure without a textual message is valid. Write only the actual observable outcomes, such as loading ending, old content remaining, or another real result; for example: “When the request finishes, stop loading and retain the old content without showing an additional message.”
23
+ - An internal failure with no user-observable outcome does not become a UI scenario. Never invent a message, navigation, or state change just to cover a failure category.
24
+
25
+ ## Atomic Scenarios
26
+
27
+ Use separate scenarios for different user entry points, preconditions, source branches, observable outcomes, or side effects. Merge only when the UI or equivalent trigger, precondition, source branch, observable outcome, and side effects are all identical.
28
+
29
+ An atomic scenario is the smallest independently verifiable user-perceivable path:
30
+
31
+ - exactly one normal case or one edge/boundary case, never both and never two branches of one decision;
32
+ - exactly one trigger sequence;
33
+ - exactly one observable outcome;
34
+ - verifiable on its own; a reference to the same path is allowed, a missing prerequisite is not.
35
+
36
+ | Case type | Meaning | Typical members |
37
+ |---|---|---|
38
+ | Normal | representative happy path with typical data | entry and first frame, data ready, primary interaction |
39
+ | Edge/boundary | the edge of the valid domain | empty, minimum, maximum, duplicate, conflict, denied, timeout, interrupted |
40
+
41
+ Do not compress normal, empty-data, failure, timeout, or recovery paths into multiple “if” alternatives within one scenario merely to shorten the SPEC. Each of these paths still requires source evidence. Consecutive display steps under the same data-ready state may remain in one scenario.
42
+
43
+ - Keep one scenario for one trigger plus one outcome.
44
+ - Do not split fields or items that share source, format, visibility, and empty behavior.
45
+ - A noun-only change (“the first song” / “the second song”) is data, not a scenario.
46
+ - Split when success and failure are mixed in one scenario, or when two unrelated outcomes appear.
47
+
48
+ ## Source Inspection Axes for Scenario Expansion
49
+
50
+ Before drafting, inspect the source for the page's actual behavior along every axis below. These axes help discover implemented branches; they are not a list of scenarios every page must contain. Expand an item only when the source implements it and it affects user-observable behavior.
51
+
52
+ | Axis | Source checks |
53
+ |---|---|
54
+ | Input and submission | Empty input, whitespace-only input, leading/trailing whitespace, valid input, length boundaries, over-limit input, invalid characters, clearing, repeated submission, rapid consecutive submission |
55
+ | Data display | No cache, existing cache, loading, complete data, missing fields, empty fields, data-source precedence, fallback, conditional hiding, formatting boundaries |
56
+ | Network requests | No network, connection failure, connection/read timeout, service or business failure, empty response, malformed response, missing fields, retries implemented in source, old-content policy |
57
+ | Lists and pagination | Initial load, empty list, exactly one page, more than one page, append/replace, loading completion, pagination failure, relationship between refresh and pagination |
58
+ | Permissions and services | First request, grant, denial, permanent denial, service disabled, cached or default fallback, system settings and rechecking after return |
59
+ | Overlay flows | Open, valid/invalid confirmation, cancel, back dismissal, repeated opening, host state after closing |
60
+ | Local reads and writes | No record, successful/failed read, corrupted data, defaults, successful/failed write, read-back after re-entry |
61
+ | Lifecycle | Cold start, re-entry, back navigation, page recreation, settings changes, saving on exit; see the “Lifecycle and Invalidation Axis” |
62
+ | Repeated operations | Add/cancel, toggle switches, repeated taps, triggering again while in progress, updates to associated areas |
63
+
64
+ ## Scenario Flow and Step Writing
65
+
66
+ A scenario flow description consists of the trigger operation sequence and the logical execution steps:
67
+
68
+ - The trigger operation sequence names the page, control, gesture, dialog action, or lifecycle event that reaches this case.
69
+ - The logical execution steps state validation order, branch decisions, data operations in business terms, state changes, feedback, and navigation.
70
+ - Each step expresses only one action or one observation.
71
+ - Preserve validation order and short-circuit order; which message appears first is user-visible behavior.
72
+ - Copy toast and dialog strings from the UI verbatim (except localizable resources — see “Localizable copy and enums”).
73
+ - Use business vocabulary only; rewrite class and method names per `body-language.md`; data facts (URLs, parameter names, key names, field names, enum values) keep their source spelling.
74
+ - End on the observable outcome; do not append a summary or test conclusion.
75
+
76
+ “Precondition → user/system trigger → validation/processing → in-progress state → observable outcome → completion” is an optional inspection order, not a set of slots every scenario must fill. Organize steps around the stages the scenario actually passes through; never add unsupported content to complete the sequence.
77
+
78
+ - Each step expresses one verifiable action, processing rule, or observable outcome; do not compress independent branches into one step.
79
+ - Name the actor, target, and result so a reviewer can tell who does what to which object under which state, and what is observed afterward.
80
+ - State source-backed fixed copy, dynamic-copy sources, counts, thresholds, formats, units, and ordering. Never supply a value that lacks evidence.
81
+ - A pure display scenario must state at least its entry condition or data state, its data source or derivation, and the concrete display result.
82
+ - Both dynamic error copy and silent failure are valid when they match the source; not every error needs a fixed literal message.
83
+ - Do not replace necessary steps with abbreviated cross-scenario references such as “same as above,” “follow scenario 1,” or “same as scenario 2.” Every scenario must independently state its own trigger, processing, and outcome.
84
+ - Do not inflate the text by repeating conclusions, mechanically splitting sentences, or stacking vague phrases.
85
+ - Keep endpoints, storage keys, and field names in the consuming scenario's `contracts` as the fact base, then merge them naturally into that scenario's steps before submission; repeat a shared fact in full in every scenario that consumes it. Never add a page-level `contracts` field.
86
+ - Copy data values with their source spelling, but never write assignment expressions: write "the code field is 1001", not `code=1001`.
87
+
88
+ Do not introduce a minimum of two steps per scenario or a minimum of 12 characters per step. English retains the existing floors of at least 5 words per step and at least 40 words in the summary. A complete, concise one-step scenario is valid.
89
+
90
+ ### Natural merge: contract facts enter the steps
91
+
92
+ Before submitting the draft, do one merge pass: rewrite every fact in that scenario's `contracts` into the step that consumes it, as a natural English sentence. The drafting model performs this step; it is not a mechanical appendix.
93
+
94
+ Build behavior from entry candidates, `operation_candidates`, `response_spans`, and evidence assertions first, then place it in the scenario and steps owned by `operation_reviews`. **Contracts only add implementation facts; they never replace triggers, state transitions, visible UI content, exception handling, or boundary behavior.** Semantic categories come from evidence rather than a fixed eight-item checklist for every page. Each evidence-backed category needs `operation_id`, `category`, and `claim_token` on its corresponding `coverage.behaviors` link, pointing to steps that contain that exact observable claim.
95
+ Real `response_spans` map `callback`, `promise`, `complete`, and `response-interceptor` to `ui-result`, `ui-result`, `reset`, and `state-transition` respectively. When a span has no `category` or `assertion_id`, bind it to an assertion through an exact source-location match in `evidence_refs`; an unrecognized role or explicit category must become a scoped unknown, and an invalid category never falls back to the real-role mapping. Audit each response branch independently by its scenario, steps, and response span: one branch cannot satisfy another branch that happens to share its `operation_id` and `category`. When one assertion owns multiple branches, every specified link needs a distinct exact `response_span` / `response_role` backed by that branch's evidence and scenario/step ownership; true duplicates and identity-less sharing remain failures. Entry-only semantic ownership needs no synthetic operation candidate, but only an evidence-backed entry assertion can own that review. A lawful unknown or waiver keeps its existing partial or waived delivery outcome instead of producing `semantic-category-missing`.
96
+
97
+ - Request facts go into the step that issues the request; key names, defaults, and enum values go into the step that reads or writes persistence; field names, types, and units go into the step that displays or computes; conversion and boundary rules go into the step that converts or decides.
98
+ - **Do not change the existing step count or order**: never delete, merge, or reorder steps, only rewrite their text; appending at the end of a scenario is the only allowed addition, and existing step numbers stay fixed (`coverage.behaviors[].steps` depends on that order).
99
+ - Copy data facts with their source spelling; do not write class or method names, `file:line`, assignment expressions, `dp`/`sp`/`px`/`dip` (including a bare unit name), or colour values; a field, parameter, or key name the contract requires verbatim is a fact the steps must carry, not a source symbol; rewrite visual values as business descriptions ("the size is large").
100
+ - Never write a sub-heading or note paragraph, and never use "same as above" or "as in scenario 1".
101
+ - Self-check: walk the `contracts` entries and confirm that the URL, method, every parameter name, response field, every key name, default, all enum values, and every field name appear in this scenario's steps.
102
+
103
+ **Cross-boundary implementation facts**: a method or gRPC service and method, a URL or service endpoint, headers or metadata, field names, protocol commands, and keys are first written into the consuming scenario's `contracts`, then merged into the same scenario's steps together with the observable behaviour they produce.
104
+
105
+ | Boundary | Facts the steps must state in full | Merge location |
106
+ |---|---|---|
107
+ | HTTP / gRPC | HTTP method or gRPC service and method, URL or service endpoint, headers or metadata, query/path/body or message fields, response fields, timeouts | The step that issues the request |
108
+ | Private protocol / socket / WebSocket | Direction, handshake and subprotocol, header/version/command/length, frame structure and field order, encoding, checksum | The step that frames, sends, or decodes |
109
+ | Persistence | Key, type, default, all values, fields | The step that reads or writes persistence |
110
+ | Callback / observer / event | Registration, trigger condition, payload fields, ordering and timing | The step that triggers and refreshes |
111
+
112
+ **Localizable copy and enums**: when copy or an enum label comes from a localizable resource (`strings.xml` / `plurals` / `string-array`, UniApp `i18n/*.js`, etc.) that is not marked `translatable="false"`, the body still carries assertable text: give the logical name and every language's value, e.g. “show localizable copy `confirm_text` (zh: `确定` / en: `OK`)”, with the current UI language selecting which one is displayed. Never keep only the `default` or one language column, and never drop the per-language values in favour of just “displayed per the current UI language”. An enum fixes only its language-neutral values and lists labels per language. Write the mapping into that scenario's steps, e.g. “the confirm copy's logical name is confirm_text, zh is 确定 and en is OK; Android reads strings.xml confirm_text, and HarmonyOS resolves the same logical name into string.json — never assume the resource name matches Android”. Only a `translatable="false"` resource may be copied verbatim; a hardcoded non-resource literal is still copied as-is.
113
+
114
+ **Flow anti-patterns**:
115
+
116
+ | Anti-pattern | Rewrite |
117
+ |---|---|
118
+ | “Call the endpoint to get data” | Merge the method, URL, parameter names, and value sources into the step that issues the request; state the result in the next step |
119
+ | “Validate the input” | Enumerate each check in order with its failure outcome |
120
+ | “Update the UI” | Name the areas updated and the format used |
121
+ | “Handle success and failure” | Split into two atomic scenarios |
122
+ | “Show a message” | Quote the toast text |
123
+ | Steps with no trigger | Add the trigger operation sequence as step 1 |
124
+ | A trailing “Network Endpoints / Local Persistence” section | Delete the section and rewrite its content into the steps that consume it |
125
+
126
+ ## Data-Change Impact Scope
127
+
128
+ When a scenario creates, reads, updates, or deletes data, or synchronizes state or data, it must list every affected piece of data one by one. Do not describe only the site that triggers the change, and never use vague phrasing such as “related data updates in sync” or “other places change accordingly.”
129
+
130
+ For example, “after favoriting, update global state and refresh related pages” fails; state that the detail page's favorite marker turns favorited, the favorite data source gains the song at the top (appended live when the list is open), the favorite count increases by one, and the player's favorite marker follows — all reversed when unfavoriting. The favorite field and cache key are implementation facts: put them in `contracts.entities` / `contracts.stores` and merge them into the matching steps, never into a vague “update related data.”
131
+
132
+ - While drafting, derive the impact list from the source: every piece of data this operation writes, deletes, updates, recomputes, or synchronizes — persistent records and their aggregate values, caches, in-memory or global state, lists and counts, data shown by associated pages or components, and data read back after writing.
133
+ - For each item, state which piece of data, in which scenario and step, triggered by what, changes from what to what (added, deleted, modified, cleared, recomputed, or left unchanged).
134
+ - User-visible changes go into the scenario steps; persistent records, cache keys, and in-memory or global state fields first go into `contracts.entities` / `contracts.stores`, then their key names, field names, types and defaults are merged into the steps — G2 requires those facts to appear in the steps.
135
+ - Every item on the impact list must land in the final SPEC's scenario steps; when one operation affects several visible pieces of data, expand each one instead of merging them into a single sentence.
136
+ - Cross-page linkage states only the data-layer result (e.g. “the favorite data source gains the song”); showing it on the target page belongs to that page's own SPEC, and this SPEC's implementation must not modify other pages' code.
137
+ - The impact scope follows the source: never omit a linkage the source implements, and never invent one it does not.
138
+ - State the effective timing of every completed write item by item: which surfaces refresh immediately and which wait until the target page next becomes visible; never write "refresh immediately" for a page that is not open.
139
+
140
+ ## Lifecycle and Invalidation Axis
141
+
142
+ Inspect every page against the four trigger classes below; for each class answer three questions: what is re-read, who is notified, and where the evidence is. Static discovery records the hooks it hits as `lifecycle-signal` candidates; a candidate only locates the line and decides nothing — hooks the scan does not reach are still self-checked under this section.
143
+
144
+ | Trigger class | Questions to check |
145
+ |---|---|
146
+ | Entry | What is read on first entry; on re-entry, what is read back from persistence, what is requested again, and what keeps the stale in-memory value |
147
+ | Back navigation | After returning from a lower page or a dialog, which regions re-read; which keep stale values |
148
+ | Tab switch | When a tab is selected again without being destroyed and recreated, what is re-read; whether the refresh signal still fires when the selection does not change |
149
+ | Write completion | After a write, which surfaces refresh immediately; which wait until they next become visible |
150
+
151
+ Android retrieval clues (the corresponding semantics are the candidate claim_token vocabulary):
152
+
153
+ | Retrieval clue | Corresponding semantics |
154
+ |---|---|
155
+ | A zero-argument `onResume` / `onStart` override in a page or view model, or Compose's `LifecycleResumeEffect` / `LifecycleEventEffect` | Re-read when visible again |
156
+ | `LifecycleEventObserver` / `DefaultLifecycleObserver` / `addObserver` / `onStateChanged` | Lifecycle-linked refresh |
157
+ | An `observeRefreshState` call site, and `RefreshResult` construction or `is` checks | Refresh result notification |
158
+ | Observation registration and collection of `LiveData` / `StateFlow` / `SharedFlow`, plus `collectAsStateWithLifecycle` / `WhileSubscribed` | Collect while visible |
159
+ | A global mode setting call | Global mode applied |
160
+
161
+ Review every lifecycle-signal candidate and choose one of three: a user-observable behavior exists → write it as an assertion with outcomes on observable results and link the scenario, mapping the trigger class from the navigation structure and source; confirmed none → a lawful waiver (no-user-observable) with source evidence; insufficient evidence → record an unknown and keep the page partial. Unreviewed candidates stay pending; never skip the review to deliver.
162
+
163
+ Timing wording follows the source: "refreshes immediately" when it takes effect on completion, "re-read on return" or "re-read on next entry" when it waits until the page is visible again — never mix the two. An axis scenario's trigger sequence starts from the timing event, and its last step lands on an assertable observable outcome.
164
+
165
+ ## Request Bodies and Responses
166
+
167
+ When a scenario performs a network request, its request body must be written key by key in `contracts.endpoints` — never “call the endpoint” or a bare URL; the response should also be described key by key where possible. The contracts are the fact base: the method, the complete URL, every parameter name and every response field must be merged into the consuming request step as natural sentences (see `spec-template.md` 1.4).
168
+
169
+ - For each request-body key, state its name, type, required flag, default value (what is sent when absent), nested structure, and value source (UI input, local storage, the previous response, or a fixed value); list query parameters, path parameters, and headers the same way, marking each one's `in`.
170
+ - Use only the keys listed in `spec-template.md`: write the default and the value source into that parameter's `default` and `source`, and write nested keys as a path (e.g. `data.list[].id`) in `name`; any other key cannot reach the steps and is rejected by G2.
171
+ - When the body is an object or an array, state the nesting and every child key; never write “other fields,” “etc.,” or a single sample value.
172
+ - For the response, try to list one field path per string in `response_fields` (e.g. `current_temperature`, `hourly.temperatures[]`), naming only the field or its path; the envelope (e.g. code/data/message), types, nullability, and how a missing or default-valued field is handled go into that endpoint's `note` and are merged into the steps — never into a `response_fields` element, because G2 requires each element to appear verbatim in the steps.
173
+ - Key names, defaults, and fixed values follow the source: when the SPEC does not state them, read the place in the source that builds the request and parses the response and fill them in — never guess, and never drop a key that has a default.
174
+
175
+ G2 checks the method, URL, parameter names, parameter defaults, value sources and response fields verbatim: a fact present in the contracts but absent from the steps fails the gate. The envelope, types, nullability and missing-value handling are outside that check and must still be written into the steps, not left in `contracts` alone.
176
+
177
+ ## Platform-Neutral Body Text
178
+
179
+ This constrains only the final SPEC prose. The test: a reader writes HarmonyOS code with no source project open; anything requiring Android or UniApp implementation knowledge, or wrong when copied into HarmonyOS code, must not appear.
180
+
181
+ Keep in the body the product semantics that users can perceive: business concepts and rules, evaluation order, toast copy, counts and thresholds, defaults, sort rules, value formats and units, user-visible names, refresh timing, and the perceivable part of event ordering.
182
+
183
+ Put implementation facts into `contracts` first, then merge them into the same scenario's steps: HTTP/gRPC endpoints and fields, headers or metadata, persistence keys with migration semantics, protocol command/version/transaction, frame structure, encoding, field order and byte order, callback payloads, and file roles. No separate section is rendered.
184
+
185
+ Drop visual and layout values: sizes, `dp`/`sp`/`px`, coordinates, margins, padding, alignment, z-order, spacing, radius, fonts, colors, backgrounds, shadows, icon assets. Do not restate layout words from the source (“on the right”, “above”, “on the same row”, “stacked”); describe the outcome (“the whole row is no longer shown”, not “the row height becomes 0”).
186
+
187
+ Motion duration is the exception: state the exact duration in a neutral unit (“0.35 seconds”, not “about half a second”) and the ordering of concurrent animations; do not write displacement, curve names, resources, or property names; a spring or velocity animation states its feel, never an invented duration.
188
+
189
+ | Android / UniApp content banned from the body | Write instead |
190
+ |---|---|
191
+ | Exception class names (`SecurityException`, `IllegalStateException`) | The user-visible consequence: message, dialog left open, operation has no effect |
192
+ | Platform constants and resource ids (`PERMISSION_GRANTED`, bundle keys, `R.string.*`) | The resolved text or the concrete value (for a multi-language resource, give the logical name and every language's value) |
193
+ | Platform types (`Bundle`, `IBinder`, `Intent`, `Context`, `Cursor`, `LiveData`, `Parcelable`) | Delete, or name the product concept (playlist, song) |
194
+ | Framework components and APIs (`Activity`, `Fragment`, `RecyclerView`, `ViewModel`, `SharedPreferences`, `PackageManager`) | The user-facing surface (page, dialog, list, switch, menu) or a neutral capability |
195
+ | SQLite/Room/DAO, raw SQL, query builders | The persistent record and its product-level fields |
196
+ | Network client class names (OkHttp, Retrofit, Volley, gRPC stub) | The network capability plus the business protocol |
197
+ | File APIs and absolute paths (`/data/data/...`) | The logical file role, naming rule, read/write/move/delete behavior |
198
+ | UniApp/Vue APIs (`uni.navigateTo`, `onShow`, `ref`, `reactive`, `pages.json`, `.vue`) | The user-visible navigation, lifecycle outcome, state change, page, control, or persistence behavior |
199
+ | Permission strings (`android.permission.*`) | The capability name (location permission) and when it is requested |
200
+ | Log text and exception messages copied from source | Delete; logs are invisible to the user |
201
+ | AIDL/Binder mechanics (`AIDL`, `Binder`, `oneway`, `Stub`, `linkToDeath`) | Behavioral terms (live refresh, asynchronous callback, cross-process call) |
202
+ | Binder transaction codes, Parcel/Bundle/Intent-extra field order | Delete; carrier detail, not business protocol |
203
+ | Version branches (`Build.VERSION.SDK_INT >= Q`) | Delete unless user-visible; then write the difference as a scenario |
204
+ | Thread/Handler/Looper/coroutine/executor mechanics | An observable ordering, concurrency, or timing requirement only |
205
+ | Telemetry API names | “Report event: <event>, field <field> is <value>”, with source-backed names and values |
206
+
207
+ ## No-Vagueness Rules
208
+
209
+ The SPEC is a contract for reimplementation: a statement that cannot become code or a test assertion is a defect.
210
+
211
+ | Banned wording | Write instead |
212
+ |---|---|
213
+ | “show the corresponding message” / “give a prompt” | Show the toast “Added to playlist” (copy the UI text verbatim) |
214
+ | “prompt the user when the name is too long” | When the trimmed name is longer than 100 characters, show the toast “Playlist name is too long” |
215
+ | “several” / “a certain number” / “relatively large” / “relatively long” | 100 characters / 500 milliseconds / at most 20 items |
216
+ | “sort by a certain rule” | Sort by time added to the playlist, descending |
217
+ | “perform the corresponding handling” / “run the necessary validation” | Validate in order: trim whitespace → check empty → check length ≤ 100 |
218
+ | “store locally” | Write to the playlist persistent storage; it still applies after the page is reopened |
219
+ | “a suitable default is fine” | The switch defaults to off; each page holds at most 20 items |
220
+ | “refresh the page” | The song count refreshes live on the playlist list page, the playlist detail page, and the playlist picker |
221
+ | “call the cloud endpoint” / “request the network” | `POST https://...` with body fields `...`, and decide the next step from the response field `code`; for gRPC give the service and method plus message fields, for a private protocol the command/version/payload fields |
222
+ | “send data” | Direction, frame/message fields, command/version, length, payload, field order, encoding |
223
+ | “return data” / “return the result” | Response structure, field types and semantics, branch conditions |
224
+ | “notify by callback” | Registration, trigger condition, callback fields, repeat, ordering and timing, post-unregister behavior |
225
+ | “encode according to the format” | JSON / field order / UTF-8 / little-endian / checksum as fixed by the source |
226
+ | “read and write files” | Logical file role, naming rule, operation timing, failure behavior |
227
+ | “delete cache files” | Delete the cover cache file `<song id>.jpg` (app local cache directory, named by item id) |
228
+ | “report events” / “analytics” | “Report event: <event>, field <field> is <value>”, matching the source |
229
+ | “log” | “Log: <tag>, <level>: <message>”, only where the source actually logs |
230
+ | “maybe” / “generally” / “usually” / “recommended” | The definite behavior |
231
+ | “platform-dependent” / “implementation-defined” | The business definition the source proves; if none, record the gap |
232
+
233
+ Also banned:
234
+
235
+ - **Failure jargon**: “return an error code” / “return -1” / “throw an exception” / “the endpoint returns” / “input parameters” / “return value” → the user-visible outcome or the concrete transfer behavior; a failure with no visible outcome is not written as a UI scenario.
236
+ - **Open enumerations**: “etc.” / “and the like” / “several” / “multiple” → list every value or state the exact count.
237
+ - **Layout and visual values**; the motion-duration exception above is the only timing value.
238
+ - **Invented precision**: a number, default, limit, or enum value absent from the evidence is a fabrication; if the source does not fix it, describe the behavior without it.
239
+ - **Unclaimable sentences**: every sentence, titles included, must be supportable; a title qualifier must not contradict the weakened phrasing of its own steps.
240
+
241
+ ## Behavior Assertions and Coverage Links
242
+
243
+ Static discovery produces behavior assertions and discovery unknowns. Every
244
+ assertion needs exactly one disposition, and the draft's `coverage.behaviors`
245
+ must explain explicitly which scenario and steps cover it.
246
+
247
+ - A `specified` link must name an existing 1-based `scenario` and `steps` array in this draft; writing a keyword or merely listing the assertion is not coverage.
248
+ - When the assertion's precondition is a navigation gate, the linked scenario's steps must state the gate in user-visible terms: where it leads when met, and the prompt or redirect seen when unmet. If the page already requires the same state at entry (`required_state` or an interceptor), the entry scenario covers it and action scenarios need not repeat it. The audit mechanically checks for the gate axis token, and a missing token is a hard failure; whether both the met and unmet branches are stated remains a semantic-review item.
249
+ - An `unknown` link must cite an unresolved unknown that is directly related to the same assertion; it cannot borrow an unrelated page unknown or dodge authoring when the evidence is already sufficient.
250
+ - A `waived` link is legal only with a structured reason and evidence: `duplicate-assertion` must name the plan-selected reviewed canonical assertion; `no-user-observable` and `out-of-scope` need current evidence, and the latter accepts only `external-surface` or `explicitly-excluded-source`, repeated exactly from the planned disposition.
251
+ - `refuted` is the terminal conclusion that there is no user-observable result and only supports `no-user-observable`; `insufficient` is the terminal conclusion that the evidence cannot determine the trigger, preconditions, outcomes, or side effects and only supports an `unknown` with a related unknown record. Neither replaces the other, and neither is a pass.
252
+ - Unread source, changed source, stale evidence, an unsupported construct, or an unfinished review are unresolved blind spots. Without new evidence, none may be rewritten as `specified`; stale evidence needs rediscovery, and an unfinished review only leaves delivery partial.
253
+ - `coverage.behaviors` and `discovery_digest` exist only for the behavior evidence audit and never render into the SPEC body. Partial delivery is a generation-side state and must not appear in scenario prose, `specs.json`, or downstream coder instructions.
254
+
255
+ ## Pre-Submission Checklist
256
+
257
+ Before submission, confirm all of the following:
258
+
259
+ - Every UTG interaction's relevant source branches were inspected, rather than drafting only the normal path.
260
+ - The “Lifecycle and Invalidation Axis” was checked against the source for all four trigger classes, and every lifecycle-signal candidate has a terminal disposition.
261
+ - Every discovered exceptional path has an explicit disposition: an independent scenario, steps on the same path, or confirmation that it has no user-observable behavior.
262
+ - Lists and complex display areas were checked for empty and partial data.
263
+ - Asynchronous operations were checked for in-progress, success, and the failure states implemented in source.
264
+ - Persistent operations were checked for write outcomes and read-back behavior.
265
+ - Scenarios that create, read, update, or delete data, or synchronize state or data, list every affected piece of data and how it changes, with no vague “related data updates in sync.”
266
+ - Network scenarios give every request-body key's name, type, required flag, default value, and value source in `contracts.endpoints`, describe the response structure as fully as possible, and merge those facts into the request step.
267
+ - No vague phrase such as “handle all other errors uniformly” substitutes for concrete branches.
268
+ - Every scenario is independently readable, with no abbreviated cross-scenario references and no unsupported copy, branches, thresholds, or outcomes added to fill gaps.
269
+ - Each scenario is exactly one normal or one edge/boundary case, with no success/failure mix.
270
+ - Every scenario flow starts with its trigger operation sequence and ends with the observable outcome.
271
+ - The body carries no leftover source symbols, framework types, resources, package names, paths, or carrier detail.
272
+ - No banned wording; numbers instead of quantifiers; complete enumerations; verbatim toast copy (localizable resources give the logical name and every language's value; non-resource literals stay verbatim).
273
+ - Every cross-boundary data transfer uses its concrete step form.
274
+ - Validation and short-circuit order match the source.
@@ -0,0 +1,312 @@
1
+ ## Example 1: Playlist share code
2
+
3
+ ```markdown
4
+ # Playlist share code SPEC
5
+
6
+ Encode a playlist as a text share code to move it across devices, then decode the share code and import it locally.
7
+
8
+ ## Scenario 1
9
+
10
+ ### Scenario Overview
11
+
12
+ The user shares a playlist, and the app encodes it as a share code and copies it to the clipboard
13
+
14
+ ### Scenario Steps
15
+
16
+ - 1. The user taps the "Share playlist" button on the "Playlist detail page"
17
+ - 2. Normalization: trim leading and trailing whitespace from the playlist name and apply Unicode NFC normalization; if the result is empty, use the default name "Untitled playlist"; if any song id does not match `^[A-Za-z0-9_-]{1,64}$`, show the toast "Playlist data is invalid, share code unavailable" and stop
18
+ - 3. Serialize as UTF-8 JSON: fixed key order `id`, `name`, `songs`; no space indentation (separators `,` and `:`); non-ASCII is emitted as UTF-8 bytes directly, never as `\uXXXX`; no BOM and no trailing newline; record the payload byte count as N (one Chinese character takes 3 bytes); if N > 16384, show the toast "Playlist is too large to share" and stop
19
+ - 4. Frame assembly: write `0x47`, `0x01`, `0x01`, `0x00`, the big-endian 2-byte value of N, the payload bytes, and finally a 4-byte big-endian CRC-32 over offsets `0` to `6+N-1` (excluding the checksum itself), using CRC-32/ISO-HDLC (reflected polynomial `0xEDB88320`, initial value `0xFFFFFFFF`, final XOR `0xFFFFFFFF`, identical to `zlib.crc32`)
20
+ - 5. Base64URL-encode the whole frame: alphabet `A-Z a-z 0-9 - _`, strip every trailing `=`, no line breaks; prepend `GPL1-` to get the final share code
21
+ - 6. Encoding baseline example: `{"id":"pl_1001","name":"My playlist","songs":["s_1","s_2"]}` → N=59, header `47010100003b`, CRC `0x5403D718`, frame length 69 → share code `GPL1-RwEBAAA7eyJpZCI6InBsXzEwMDEiLCJuYW1lIjoiTXkgcGxheWxpc3QiLCJzb25ncyI6WyJzXzEiLCJzXzIiXX1UA9cY`
22
+ - 7. Write the share code to the system clipboard as plain text and show the toast "Share code copied"
23
+
24
+ ## Scenario 2
25
+
26
+ ### Scenario Overview
27
+
28
+ When the playlist holds more than 500 songs, the app refuses to generate a share code
29
+
30
+ ### Scenario Steps
31
+
32
+ - 1. The user taps the "Share playlist" button on the "Playlist detail page"
33
+ - 2. Count the songs in the current playlist; if the count > 500 → show the toast "Playlist is too large to share", write nothing to the clipboard, and stop
34
+ - 3. Normalize the playlist name and serialize it as UTF-8 JSON by Scenario 1 steps 2–3, emit every song in full (no truncation, no dropped fields, no compressed structure), and measure the actual payload byte count N (count bytes, not characters: one Chinese character takes 3 bytes, one emoji takes 4 bytes; verify with `N = 30 + len(id) + b(name) + Σ(len(songId) + 2) + (k − 1)`, 60 in the example)
35
+ - 4. Compare N with the 16384 limit: N ≤ 16384 → go to the next step; N > 16384 → show the toast "Playlist is too large to share", generate no share code, keep the clipboard and playlist data unchanged, and stop (no chunking, no partial share, no song trimming)
36
+ - 5. Following Scenario 1 steps 4–7, assemble the frame, Base64URL-encode it, prepend `GPL1-`, and write it to the clipboard (when N = 16384 the frame is 16394 bytes and the share code is 21864 characters; it is still generated normally)
37
+
38
+ ## Scenario 3
39
+
40
+ ### Scenario Overview
41
+
42
+ The user imports the same share code more than once, or imports a playlist whose name matches an existing local playlist
43
+
44
+ ### Scenario Steps
45
+
46
+ - 1. On the "Playlist page", the user taps "Import via share code" in the "More menu"; the "Import share code" dialog opens; after pasting the share code and tapping "Import", the button immediately becomes unavailable to prevent repeated submission
47
+ - 2. Decode and validate (on any failure, show a toast and stop): trim whitespace and zero-width characters, convert full-width U+FF01–U+FF5E to half-width by subtracting `0xFFE0` → compare the first 5 characters with `GPL1-` → normalize `+`/`/` in the remaining text to `-`/`_` and allow only `[A-Za-z0-9_-]` → pad with `==`/`=` by `mod 4` and decode standard Base64 to get frame F → read N big-endian from `F[4]` and `F[5]` and check `F.length == 10 + N` → recompute CRC-32 over `F[0..6+N-1]` and compare it with `F[6+N..9+N]` → check `F[0]=0x47`, `F[1]=0x01` (a value greater than `0x01` prompts an upgrade), `F[2]=0x01`, `F[3]=0x00` → strictly UTF-8 decode `F[6..6+N-1]`, strip the BOM, parse strict JSON → `id` matches `^[A-Za-z0-9_-]{1,64}$`, `name` is 1–100 code points after trimming and NFC normalization, `songs` has at most 500 items with each item matching the same rule, and duplicate ids are removed in order
48
+ - 3. Look up the local `originId` with the share code's `id` as the dedup key: on a hit (the same share code imported more than once) → create nothing, change no existing playlist, show the toast "Playlist already exists, not imported again", and stop
49
+ - 4. On a miss, compare the normalized `name` with local playlists for a name match (compare NFC code point sequences, not raw bytes): the same name may coexist, no suffix is appended, nothing is overwritten, and only the toast copy changes; then use a new UUID v4 as the local `id`, record the share code's `id` as `originId`, and write in a single transaction (the `originId` unique constraint rolls back a conflicting write and reports the duplicate-import message)
50
+ - 5. Insert the new playlist at the top of the "Playlist page" list, refresh the song count, show the toast "Import succeeded" for a normal import or "Import succeeded, a playlist with the same name already exists" for a same-name import, and close the dialog
51
+
52
+ ## Android Code Reference
53
+
54
+ - app/src/main/java/com/melody/musicapp/ui/fragment/PlaylistShareFragment.java:41
55
+ - app/src/main/java/com/melody/musicapp/ui/fragment/PlaylistShareFragment.java:57
56
+ - app/src/main/java/com/melody/musicapp/ui/dialog/ImportShareCodeDialog.java:36
57
+ - app/src/main/java/com/melody/musicapp/ui/dialog/ImportShareCodeDialog.java:58
58
+ - app/src/main/java/com/melody/musicapp/util/ShareCodeCodec.java:24
59
+ - app/src/main/java/com/melody/musicapp/util/ShareCodeCodec.java:63
60
+ - app/src/main/java/com/melody/musicapp/util/ShareCodeCodec.java:88
61
+ - app/src/main/java/com/melody/musicapp/util/Crc32Util.java:19
62
+ - app/src/main/java/com/melody/musicapp/data/repository/PlaylistRepository.java:74
63
+ ```
64
+ ```
65
+
66
+ ## Example 2: Add to playlist
67
+
68
+ ```markdown
69
+ # Add to playlist SPEC
70
+
71
+ Users can add one or more songs to a playlist from several entry points; the playlist detail page shows songs under the configured sort rule and adds a "by time added to the playlist" option.
72
+
73
+ ## Scenario 1
74
+
75
+ ### Scenario Overview
76
+
77
+ The user adds one song to a playlist from the song list page through the more actions of a single song
78
+
79
+ ### Scenario Steps
80
+
81
+ - 1. The user taps the "More actions" button of one song on the song list page
82
+ - 2. The user taps "Add to playlist" in the menu, and the playlist picker opens
83
+ - 3. The playlist picker contains every existing playlist and a new-playlist button
84
+ - 3.1 The user can tap an existing playlist in the picker to add the song to it, which shows the toast "Added to playlist"
85
+ - 3.2 The user can tap the new-playlist button to create a playlist; after creation the picker returns, its playlist list refreshes with the new playlist at the top, and tapping the new playlist adds the song to it and shows the toast "Added to playlist"
86
+ - 4. The song is added to the target playlist, and the song list refreshes under the target playlist's current sort rule
87
+ - 4.1 If the target playlist's sort rule is "by time added to the playlist", the song goes directly to the top of the song list
88
+ - 4.2 If the target playlist uses another sort rule, the song list refreshes and sorts under that rule
89
+ - 5. The playlist cover refreshes to this song's cover
90
+
91
+ ## Scenario 2
92
+
93
+ ### Scenario Overview
94
+
95
+ The user adds multiple songs at once from the song list page through multi-select
96
+
97
+ ### Scenario Steps
98
+
99
+ - 1. The user enters multi-select mode on the song list page and selects multiple songs in order
100
+ - 2. The user taps the "Add to playlist" button, and the playlist picker opens
101
+ - 3. The playlist picker contains every existing playlist and a new-playlist button
102
+ - 3.1 The user can tap an existing playlist in the picker to add the song to it, which shows the toast "Added to playlist"
103
+ - 3.2 The user can tap the new-playlist button to create a playlist; after creation the picker returns, its playlist list refreshes with the new playlist at the top, and tapping the new playlist adds the song to it and shows the toast "Added to playlist"
104
+ - 4. The selected songs are added to the target playlist, and the song list refreshes under the target playlist's current sort rule
105
+ - 4.1 If the target playlist's sort rule is "by time added to the playlist", the selection order decides the add order, and the first selected song is at the top (that is, its added time is the latest)
106
+ - 4.2 If the target playlist uses another sort rule, the song list refreshes and sorts under that rule
107
+ - 5. The playlist cover refreshes to the cover of the last song added to the playlist
108
+
109
+ ## Scenario 3
110
+
111
+ ### Scenario Overview
112
+
113
+ The user adds one song to a playlist from the album detail page through the more actions of a single song
114
+
115
+ ### Scenario Steps
116
+
117
+ - 1. The user taps the "More actions" button of one song on the album detail page
118
+ - 2. The user taps "Add to playlist" in the menu, and the playlist picker opens
119
+ - 3. The playlist picker contains every existing playlist and a new-playlist button
120
+ - 3.1 The user can tap an existing playlist in the picker to add the song to it, which shows the toast "Added to playlist"
121
+ - 3.2 The user can tap the new-playlist button to create a playlist; after creation the picker returns, its playlist list refreshes with the new playlist at the top, and tapping the new playlist adds the song to it and shows the toast "Added to playlist"
122
+ - 4. The song is added to the target playlist, and the song list refreshes under the target playlist's current sort rule
123
+ - 4.1 If the target playlist's sort rule is "by time added to the playlist", the song goes directly to the top of the song list
124
+ - 4.2 If the target playlist uses another sort rule, the song list refreshes and sorts under that rule
125
+ - 5. The playlist cover refreshes to this song's cover
126
+
127
+ ## Scenario 4
128
+
129
+ ### Scenario Overview
130
+
131
+ The user adds one song to a playlist from the artist detail page through the more actions of a single song
132
+
133
+ ### Scenario Steps
134
+
135
+ - 1. The user taps the "More actions" button of one song on the artist detail page
136
+ - 2. The user taps "Add to playlist" in the menu, and the playlist picker opens
137
+ - 3. The playlist picker contains every existing playlist and a new-playlist button
138
+ - 3.1 The user can tap an existing playlist in the picker to add the song to it, which shows the toast "Added to playlist"
139
+ - 3.2 The user can tap the new-playlist button to create a playlist; after creation the picker returns, its playlist list refreshes with the new playlist at the top, and tapping the new playlist adds the song to it and shows the toast "Added to playlist"
140
+ - 4. The song is added to the target playlist, and the song list refreshes under the target playlist's current sort rule
141
+ - 4.1 If the target playlist's sort rule is "by time added to the playlist", the song goes directly to the top of the song list
142
+ - 4.2 If the target playlist uses another sort rule, the song list refreshes and sorts under that rule
143
+ - 5. The playlist cover refreshes to this song's cover
144
+
145
+ ## Scenario 5
146
+
147
+ ### Scenario Overview
148
+
149
+ The user adds one song to a playlist from the folder detail page through the more actions of a single song
150
+
151
+ ### Scenario Steps
152
+
153
+ - 1. The user taps the "More actions" button of one song on the folder detail page
154
+ - 2. The user taps "Add to playlist" in the menu, and the playlist picker opens
155
+ - 3. The playlist picker contains every existing playlist and a new-playlist button
156
+ - 3.1 The user can tap an existing playlist in the picker to add the song to it, which shows the toast "Added to playlist"
157
+ - 3.2 The user can tap the new-playlist button to create a playlist; after creation the picker returns, its playlist list refreshes with the new playlist at the top, and tapping the new playlist adds the song to it and shows the toast "Added to playlist"
158
+ - 4. The song is added to the target playlist, and the song list refreshes under the target playlist's current sort rule
159
+ - 4.1 If the target playlist's sort rule is "by time added to the playlist", the song goes directly to the top of the song list
160
+ - 4.2 If the target playlist uses another sort rule, the song list refreshes and sorts under that rule
161
+ - 5. The playlist cover refreshes to this song's cover
162
+
163
+ ## Scenario 6
164
+
165
+ ### Scenario Overview
166
+
167
+ The user adds multiple songs at once from the folder detail page through multi-select
168
+
169
+ ### Scenario Steps
170
+
171
+ - 1. The user enters multi-select mode on the folder detail page and selects multiple songs in order
172
+ - 2. The user taps the "Add to playlist" button, and the playlist picker opens
173
+ - 3. The playlist picker contains every existing playlist and a new-playlist button
174
+ - 3.1 The user can tap an existing playlist in the picker to add the song to it, which shows the toast "Added to playlist"
175
+ - 3.2 The user can tap the new-playlist button to create a playlist; after creation the picker returns, its playlist list refreshes with the new playlist at the top, and tapping the new playlist adds the song to it and shows the toast "Added to playlist"
176
+ - 4. The selected songs are added to the target playlist, and the song list refreshes under the target playlist's current sort rule
177
+ - 4.1 If the target playlist's sort rule is "by time added to the playlist", the selection order decides the add order, and the first selected song is at the top (that is, its added time is the latest)
178
+ - 4.2 If the target playlist uses another sort rule, the song list refreshes and sorts under that rule
179
+ - 5. The playlist cover refreshes to the cover of the last song added to the playlist
180
+
181
+ ## Scenario 7
182
+
183
+ ### Scenario Overview
184
+
185
+ The user opens the playlist detail page and views the playlist name and song list
186
+
187
+ ### Scenario Steps
188
+
189
+ - 1. The user taps a playlist to open the playlist detail page
190
+ - 2. The page top shows the playlist name
191
+ - 3. The page lower area shows the playlist's song list, with songs under the playlist's configured sort rule
192
+ - 4. A new playlist's default sort rule is "by time added to the playlist" (songs added later appear above)
193
+
194
+ ## Scenario 8
195
+
196
+ ### Scenario Overview
197
+
198
+ The user switches the sort rule on the playlist detail page to a rule other than "by time added to the playlist"
199
+
200
+ ### Scenario Steps
201
+
202
+ - 1. The user taps the sort option entry on the playlist detail page
203
+ - 2. The user selects another sort rule (such as title or artist)
204
+ - 3. The song list re-sorts and refreshes under the selected rule
205
+ - 4. The rule stays in effect until the user switches again, and songs added later are inserted at their position under that rule
206
+
207
+ ## Scenario 9
208
+
209
+ ### Scenario Overview
210
+
211
+ When the user tries to add a song that is already in the target playlist, the app does not add it again
212
+
213
+ ### Scenario Steps
214
+
215
+ - 1. The user selects songs through any entry point (single or multi-select) and adds them to the target playlist, which shows the toast "Added to playlist"
216
+ - 2. If a selected song is already in the target playlist, it is not added again, and its original added time stays unchanged
217
+ - 3. Songs from this operation that are not yet in the target playlist are added normally under the applicable sort rule
218
+
219
+ ## Scenario 10
220
+
221
+ ### Scenario Overview
222
+
223
+ The user cancels the add-to-playlist operation in the playlist picker
224
+
225
+ ### Scenario Steps
226
+
227
+ - 1. The user triggers "Add to playlist" from any entry point, and the playlist picker opens
228
+ - 2. The user closes the picker by tapping outside it
229
+ - 3. The playlist content does not change, and the user returns to the previous page state
230
+
231
+ ## Scenario 11
232
+
233
+ ### Scenario Overview
234
+
235
+ The playlist picker must contain every existing playlist and its song information
236
+
237
+ ### Scenario Steps
238
+
239
+ - 1. The user triggers the playlist picker through an add-to-playlist action
240
+ - 2. The picker lists every existing playlist, and each playlist's song count is accurate
241
+
242
+ ## Scenario 12
243
+
244
+ ### Scenario Overview
245
+
246
+ After songs are added to a playlist, the playlist's song count refreshes immediately
247
+
248
+ ### Scenario Steps
249
+
250
+ - 1. The user adds songs to a playlist
251
+ - 2. The playlist's song count refreshes in the playlist list page, the playlist detail page, and the playlist picker
252
+
253
+ ## Android Code Reference
254
+
255
+ - app/src/main/java/com/melody/musicapp/ui/fragment/SongListFragment.java:88
256
+ - app/src/main/java/com/melody/musicapp/ui/fragment/SongListFragment.java:104
257
+ - app/src/main/java/com/melody/musicapp/ui/dialog/AddToPlaylistDialog.java:42
258
+ - app/src/main/java/com/melody/musicapp/ui/dialog/AddToPlaylistDialog.java:66
259
+ - app/src/main/java/com/melody/musicapp/ui/fragment/PlaylistDetailFragment.java:51
260
+ - app/src/main/java/com/melody/musicapp/ui/helper/PlaylistSortHelper.java:33
261
+ - app/src/main/java/com/melody/musicapp/data/repository/PlaylistRepository.java:39
262
+ - app/src/main/java/com/melody/musicapp/data/repository/PlaylistRepository.java:58
263
+ - app/src/main/java/com/melody/musicapp/data/db/dao/PlaylistSongDao.java:27
264
+ ```
265
+ ```
266
+
267
+ ## Example 3: Data sync
268
+
269
+ ```markdown
270
+ # Data sync SPEC
271
+
272
+ Sync the current business object to the cloud.
273
+
274
+ ## Scenario 1
275
+
276
+ ### Scenario Overview
277
+
278
+ When the request is valid and the server returns success, the app sends the request under the business HTTP contract, parses the response, and persists it
279
+
280
+ ### Scenario Steps
281
+
282
+ - 1. The user taps the "Sync now" button on the "Settings page"
283
+ - 2. Send `POST https://api.example.com/v1/sync` with the header `Content-Type: application/json; charset=utf-8`
284
+ - 3. Encode the request body as UTF-8 JSON with field order `userId`, `deviceId`, `payload`
285
+ - 4. Receive the response and read `code`, `data`, `message`
286
+ - 5. When `code=0`, read the sync id from `data.syncId`, write a sync record to local persistence, and keep it across page reentry
287
+ - 6. Show the toast "Sync succeeded" and update the "Last sync time" on the "Settings page" to this sync's time
288
+
289
+ ## Scenario 2
290
+
291
+ ### Scenario Overview
292
+
293
+ When the server returns a business failure, the app persists nothing and shows the corresponding message
294
+
295
+ ### Scenario Steps
296
+
297
+ - 1. The user taps the "Sync now" button on the "Settings page"
298
+ - 2. Send the request with the same headers, field order, and encoding as Scenario 1
299
+ - 3. Receive the response and read `code`, `message`
300
+ - 4. When `code=1001`, do not read `data`, write no sync record to local persistence, and keep the "Last sync time" at its original value
301
+ - 5. Show the toast "Sync failed, try again later"
302
+
303
+ ## Android Code Reference
304
+
305
+ - app/src/main/java/com/melody/musicapp/ui/fragment/SettingsFragment.java:61
306
+ - app/src/main/java/com/melody/musicapp/network/SyncApi.java:28
307
+ - app/src/main/java/com/melody/musicapp/network/SyncApi.java:44
308
+ - app/src/main/java/com/melody/musicapp/network/SyncRequestBody.java:22
309
+ - app/src/main/java/com/melody/musicapp/data/repository/SyncRepository.java:47
310
+ - app/src/main/java/com/melody/musicapp/data/repository/SyncRepository.java:63
311
+ ```
312
+ ```