@buaa_smat/hometrans 0.1.17 → 0.1.20

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 (227) hide show
  1. package/README.md +138 -56
  2. package/agents/code-reviewer.md +321 -65
  3. package/agents/logic-coder.md +113 -88
  4. package/agents/logic-context-builder.md +47 -29
  5. package/agents/scripts/hmos-precheck/backends/arkts.mjs +567 -0
  6. package/agents/scripts/hmos-precheck/backends/arkts_diff.mjs +159 -0
  7. package/agents/scripts/hmos-precheck/backends/arkts_project_rules.mjs +398 -0
  8. package/agents/scripts/hmos-precheck/backends/codelinter.mjs +250 -0
  9. package/agents/scripts/hmos-precheck/backends/project_integrity.mjs +321 -0
  10. package/agents/scripts/hmos-precheck/backends/static_precheck.mjs +247 -0
  11. package/agents/scripts/hmos-precheck/core/config.mjs +184 -0
  12. package/agents/scripts/hmos-precheck/core/diagnostic_scope.mjs +20 -0
  13. package/agents/scripts/hmos-precheck/core/process_adapter.mjs +47 -0
  14. package/agents/scripts/hmos-precheck/core/project_catalog.mjs +50 -0
  15. package/agents/scripts/hmos-precheck/core/result_projection.mjs +147 -0
  16. package/agents/scripts/hmos-precheck/core/scope_plan.mjs +131 -0
  17. package/agents/scripts/hmos-precheck/core/sdk_context.mjs +67 -0
  18. package/agents/scripts/hmos-precheck/docs/architecture.md +37 -0
  19. package/agents/scripts/hmos-precheck/docs/performance-optimization.md +28 -0
  20. package/agents/scripts/hmos-precheck/docs/upstream-reference.json +19 -0
  21. package/agents/scripts/hmos-precheck/docs/validation.md +50 -0
  22. package/agents/scripts/hmos-precheck/index.mjs +17 -0
  23. package/agents/scripts/hmos-precheck/invocation.mjs +231 -0
  24. package/agents/scripts/hmos-precheck/rules/rule_case_matrix.csv +32 -0
  25. package/agents/scripts/hmos-precheck/rules/rule_inventory.csv +64 -0
  26. package/agents/scripts/hmos-precheck/rules/rule_inventory.mjs +59 -0
  27. package/agents/scripts/hmos-precheck/rules/rule_policy.mjs +54 -0
  28. package/agents/scripts/platform_query.mjs +626 -0
  29. package/agents/scripts/platform_query.test.mjs +422 -0
  30. package/agents/self-test-fixer.md +36 -34
  31. package/agents/self-tester.md +35 -376
  32. package/agents/test-case-generation-generator.md +317 -0
  33. package/agents/test-case-generation-validator.md +231 -0
  34. package/dist/cli/config-store.js +19 -146
  35. package/dist/cli/config.js +6 -8
  36. package/dist/cli/env-vars.js +1 -3
  37. package/dist/cli/index.js +0 -11
  38. package/dist/cli/init.js +147 -235
  39. package/dist/cli/uninstall.js +5 -129
  40. package/dist/utils/regex.js +8 -0
  41. package/env-requirements.json +57 -55
  42. package/package.json +6 -8
  43. package/resource/convert_pipeline_process.svg +103 -0
  44. package/resource/project_architecture.svg +122 -0
  45. package/resource/title_dark.png +0 -0
  46. package/skills/hmos-batch-ui-align/SKILL.md +345 -43
  47. package/skills/hmos-batch-ui-align/references/conversion-procedure.md +661 -180
  48. package/skills/hmos-batch-ui-align/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +2533 -2533
  49. package/skills/hmos-batch-ui-align/references/mappings/android-to-harmonyOS-ui-interaction-mapping-reference.md +555 -555
  50. package/skills/hmos-batch-ui-align/references/mappings/android-to-harmonyOS-ui-layout-mapping-reference.md +117 -117
  51. package/skills/hmos-batch-ui-align/references/mvvm/@Link/350/243/205/351/245/260/345/231/250/357/274/232/347/210/266/345/255/220/345/217/214/345/220/221/345/220/214/346/255/245.md +648 -648
  52. package/skills/hmos-batch-ui-align/references/mvvm/@Observed/350/243/205/351/245/260/345/231/250/345/222/214@ObjectLink/350/243/205/351/245/260/345/231/250/357/274/232/345/265/214/345/245/227/347/261/273/345/257/271/350/261/241/345/261/236/346/200/247/345/217/230/345/214/226.md +2088 -2088
  53. package/skills/hmos-batch-ui-align/references/mvvm/@Prop/350/243/205/351/245/260/345/231/250/357/274/232/347/210/266/345/255/220/345/215/225/345/220/221/345/220/214/346/255/245.md +1033 -1033
  54. package/skills/hmos-batch-ui-align/references/mvvm/@Provide/350/243/205/351/245/260/345/231/250/345/222/214@Consume/350/243/205/351/245/260/345/231/250/357/274/232/344/270/216/345/220/216/344/273/243/347/273/204/344/273/266/345/217/214/345/220/221/345/220/214/346/255/245.md +1183 -1183
  55. package/skills/hmos-batch-ui-align/references/mvvm/@State/350/243/205/351/245/260/345/231/250/357/274/232/347/273/204/344/273/266/345/206/205/347/212/266/346/200/201.md +576 -576
  56. package/skills/hmos-batch-ui-align/references/mvvm/@Track/350/243/205/351/245/260/345/231/250/357/274/232class/345/257/271/350/261/241/345/261/236/346/200/247/347/272/247/346/233/264/346/226/260.md +297 -297
  57. package/skills/hmos-batch-ui-align/references/mvvm/@Watch/350/243/205/351/245/260/345/231/250/357/274/232/347/212/266/346/200/201/345/217/230/351/207/217/346/233/264/346/224/271/351/200/232/347/237/245.md +395 -395
  58. package/skills/hmos-batch-ui-align/references/mvvm/AppStorage/357/274/232/345/272/224/347/224/250/345/205/250/345/261/200/347/232/204UI/347/212/266/346/200/201/345/255/230/345/202/250.md +902 -902
  59. package/skills/hmos-batch-ui-align/references/mvvm/Environment/357/274/232/350/256/276/345/244/207/347/216/257/345/242/203/346/237/245/350/257/242.md +106 -106
  60. package/skills/hmos-batch-ui-align/references/mvvm/LocalStorage/357/274/232/351/241/265/351/235/242/347/272/247UI/347/212/266/346/200/201/345/255/230/345/202/250.md +1178 -1178
  61. package/skills/hmos-batch-ui-align/references/mvvm/MVVM/346/250/241/345/274/217/357/274/210V1/357/274/211.md +911 -911
  62. package/skills/hmos-batch-ui-align/references/mvvm/PersistentStorage/357/274/232/346/214/201/344/271/205/345/214/226/345/255/230/345/202/250UI/347/212/266/346/200/201.md +354 -354
  63. package/skills/hmos-batch-ui-align/references/mvvm//347/256/241/347/220/206/345/272/224/347/224/250/346/213/245/346/234/211/347/232/204/347/212/266/346/200/201/346/246/202/350/277/260.md +11 -11
  64. package/skills/hmos-batch-ui-align/references/mvvm-v2/!!/350/257/255/346/263/225/357/274/232/345/217/214/345/220/221/347/273/221/345/256/232.md +206 -0
  65. package/skills/hmos-batch-ui-align/references/mvvm-v2/@Computed/350/243/205/351/245/260/345/231/250/357/274/232/350/256/241/347/256/227/345/261/236/346/200/247.md +373 -0
  66. package/skills/hmos-batch-ui-align/references/mvvm-v2/@Event/350/243/205/351/245/260/345/231/250/357/274/232/350/247/204/350/214/203/347/273/204/344/273/266/350/276/223/345/207/272.md +158 -0
  67. package/skills/hmos-batch-ui-align/references/mvvm-v2/@Local/350/243/205/351/245/260/345/231/250/357/274/232/347/273/204/344/273/266/345/206/205/351/203/250/347/212/266/346/200/201.md +750 -0
  68. package/skills/hmos-batch-ui-align/references/mvvm-v2/@Monitor/350/243/205/351/245/260/345/231/250/357/274/232/347/212/266/346/200/201/345/217/230/351/207/217/344/277/256/346/224/271/345/274/202/346/255/245/347/233/221/345/220/254.md +1704 -0
  69. package/skills/hmos-batch-ui-align/references/mvvm-v2/@ObservedV2/350/243/205/351/245/260/345/231/250/345/222/214@Trace/350/243/205/351/245/260/345/231/250/357/274/232/347/261/273/345/261/236/346/200/247/345/217/230/345/214/226/350/247/202/346/265/213.md +1012 -0
  70. package/skills/hmos-batch-ui-align/references/mvvm-v2/@Once/350/243/205/351/245/260/345/231/250/357/274/232/345/210/235/345/247/213/345/214/226/345/220/214/346/255/245/344/270/200/346/254/241.md +164 -0
  71. package/skills/hmos-batch-ui-align/references/mvvm-v2/@Param/350/243/205/351/245/260/345/231/250/357/274/232/347/273/204/344/273/266/345/244/226/351/203/250/350/276/223/345/205/245.md +840 -0
  72. package/skills/hmos-batch-ui-align/references/mvvm-v2/@Provider/350/243/205/351/245/260/345/231/250/345/222/214@Consumer/350/243/205/351/245/260/345/231/250/357/274/232/350/267/250/347/273/204/344/273/266/345/261/202/347/272/247/345/217/214/345/220/221/345/220/214/346/255/245.md +856 -0
  73. package/skills/hmos-batch-ui-align/references/mvvm-v2/@Type/350/243/205/351/245/260/345/231/250/357/274/232/346/240/207/350/256/260/347/261/273/345/261/236/346/200/247/347/232/204/347/261/273/345/236/213.md +83 -0
  74. package/skills/hmos-batch-ui-align/references/mvvm-v2/AppStorageV2/357/274/232/345/272/224/347/224/250/345/205/250/345/261/200UI/347/212/266/346/200/201/345/255/230/345/202/250.md +294 -0
  75. package/skills/hmos-batch-ui-align/references/mvvm-v2/MVVM/346/250/241/345/274/217/357/274/210V2/357/274/211.md +1407 -0
  76. package/skills/hmos-batch-ui-align/references/mvvm-v2/PersistenceV2/357/274/232/346/214/201/344/271/205/345/214/226/345/255/230/345/202/250UI/347/212/266/346/200/201.md +1220 -0
  77. package/skills/hmos-batch-ui-align/references/mvvm-v2/_/350/214/203/345/274/217/351/200/211/346/213/251/350/257/264/346/230/216.md +47 -0
  78. package/skills/hmos-batch-ui-align/references/mvvm-v2/_/350/243/205/351/245/260/345/231/250/351/200/237/346/237/245.md +133 -0
  79. package/skills/hmos-batch-ui-align/references/mvvm-v2//347/212/266/346/200/201/347/256/241/347/220/206V1/345/220/221V2/350/277/201/347/247/273/344/270/216/346/267/267/347/224/250/346/214/207/345/257/274.md +840 -0
  80. package/skills/hmos-batch-ui-align/scripts/android_parse_fast.ts +1798 -0
  81. package/skills/hmos-batch-ui-align/scripts/arkts_static_check.ts +1592 -0
  82. package/skills/hmos-batch-ui-align/scripts/measure_pack.ts +752 -0
  83. package/skills/hmos-convert-pipeline/SKILL.md +188 -131
  84. package/skills/hmos-fix-build-errors/SKILL.md +87 -67
  85. package/skills/hmos-fix-build-errors/references/arkts-strict-patterns.md +219 -219
  86. package/skills/hmos-fix-build-errors/references/known-patterns.md +157 -157
  87. package/skills/hmos-fix-build-errors/references/rdb-entity-pattern.md +131 -131
  88. package/skills/hmos-incremental-ui-align/README.md +57 -40
  89. package/skills/hmos-incremental-ui-align/SKILL.md +180 -24
  90. package/skills/hmos-incremental-ui-align/diff_analysis.md +52 -52
  91. package/skills/hmos-incremental-ui-align/page_align.md +62 -62
  92. package/skills/hmos-incremental-ui-align/references/Comparison_Template.md +38 -2
  93. package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@Link/350/243/205/351/245/260/345/231/250/357/274/232/347/210/266/345/255/220/345/217/214/345/220/221/345/220/214/346/255/245.md +648 -648
  94. package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@Observed/350/243/205/351/245/260/345/231/250/345/222/214@ObjectLink/350/243/205/351/245/260/345/231/250/357/274/232/345/265/214/345/245/227/347/261/273/345/257/271/350/261/241/345/261/236/346/200/247/345/217/230/345/214/226.md +2088 -2088
  95. package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@Prop/350/243/205/351/245/260/345/231/250/357/274/232/347/210/266/345/255/220/345/215/225/345/220/221/345/220/214/346/255/245.md +1033 -1033
  96. package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@Provide/350/243/205/351/245/260/345/231/250/345/222/214@Consume/350/243/205/351/245/260/345/231/250/357/274/232/344/270/216/345/220/216/344/273/243/347/273/204/344/273/266/345/217/214/345/220/221/345/220/214/346/255/245.md +1183 -1183
  97. package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@State/350/243/205/351/245/260/345/231/250/357/274/232/347/273/204/344/273/266/345/206/205/347/212/266/346/200/201.md +576 -576
  98. package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@Track/350/243/205/351/245/260/345/231/250/357/274/232class/345/257/271/350/261/241/345/261/236/346/200/247/347/272/247/346/233/264/346/226/260.md +297 -297
  99. package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@Watch/350/243/205/351/245/260/345/231/250/357/274/232/347/212/266/346/200/201/345/217/230/351/207/217/346/233/264/346/224/271/351/200/232/347/237/245.md +395 -395
  100. package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/AppStorage/357/274/232/345/272/224/347/224/250/345/205/250/345/261/200/347/232/204UI/347/212/266/346/200/201/345/255/230/345/202/250.md +902 -902
  101. package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/Environment/357/274/232/350/256/276/345/244/207/347/216/257/345/242/203/346/237/245/350/257/242.md +106 -106
  102. package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/LocalStorage/357/274/232/351/241/265/351/235/242/347/272/247UI/347/212/266/346/200/201/345/255/230/345/202/250.md +1178 -1178
  103. package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/MVVM/346/250/241/345/274/217V1.md +911 -911
  104. package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/PersistentStorage/357/274/232/346/214/201/344/271/205/345/214/226/345/255/230/345/202/250UI/347/212/266/346/200/201.md +354 -354
  105. package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243//347/256/241/347/220/206/345/272/224/347/224/250/346/213/245/346/234/211/347/232/204/347/212/266/346/200/201/346/246/202/350/277/260.md +11 -11
  106. package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/!!/350/257/255/346/263/225/357/274/232/345/217/214/345/220/221/347/273/221/345/256/232.md +206 -0
  107. package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@Computed/350/243/205/351/245/260/345/231/250/357/274/232/350/256/241/347/256/227/345/261/236/346/200/247.md +373 -0
  108. package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@Event/350/243/205/351/245/260/345/231/250/357/274/232/350/247/204/350/214/203/347/273/204/344/273/266/350/276/223/345/207/272.md +158 -0
  109. package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@Local/350/243/205/351/245/260/345/231/250/357/274/232/347/273/204/344/273/266/345/206/205/351/203/250/347/212/266/346/200/201.md +750 -0
  110. package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@Monitor/350/243/205/351/245/260/345/231/250/357/274/232/347/212/266/346/200/201/345/217/230/351/207/217/344/277/256/346/224/271/345/274/202/346/255/245/347/233/221/345/220/254.md +1704 -0
  111. package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@ObservedV2/350/243/205/351/245/260/345/231/250/345/222/214@Trace/350/243/205/351/245/260/345/231/250/357/274/232/347/261/273/345/261/236/346/200/247/345/217/230/345/214/226/350/247/202/346/265/213.md +1012 -0
  112. package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@Once/350/243/205/351/245/260/345/231/250/357/274/232/345/210/235/345/247/213/345/214/226/345/220/214/346/255/245/344/270/200/346/254/241.md +164 -0
  113. package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@Param/350/243/205/351/245/260/345/231/250/357/274/232/347/273/204/344/273/266/345/244/226/351/203/250/350/276/223/345/205/245.md +840 -0
  114. package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@Provider/350/243/205/351/245/260/345/231/250/345/222/214@Consumer/350/243/205/351/245/260/345/231/250/357/274/232/350/267/250/347/273/204/344/273/266/345/261/202/347/272/247/345/217/214/345/220/221/345/220/214/346/255/245.md +856 -0
  115. package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@Type/350/243/205/351/245/260/345/231/250/357/274/232/346/240/207/350/256/260/347/261/273/345/261/236/346/200/247/347/232/204/347/261/273/345/236/213.md +83 -0
  116. package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/AppStorageV2/357/274/232/345/272/224/347/224/250/345/205/250/345/261/200UI/347/212/266/346/200/201/345/255/230/345/202/250.md +294 -0
  117. package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/MVVM/346/250/241/345/274/217/357/274/210V2/357/274/211.md +1407 -0
  118. package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/PersistenceV2/357/274/232/346/214/201/344/271/205/345/214/226/345/255/230/345/202/250UI/347/212/266/346/200/201.md +1220 -0
  119. package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/_/350/214/203/345/274/217/351/200/211/346/213/251/350/257/264/346/230/216.md +47 -0
  120. package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2//347/212/266/346/200/201/347/256/241/347/220/206V1/345/220/221V2/350/277/201/347/247/273/344/270/216/346/267/267/347/224/250/346/214/207/345/257/274.md +840 -0
  121. package/skills/hmos-incremental-ui-align/references/State_Model_Template.md +74 -0
  122. package/skills/hmos-incremental-ui-align/references/UI_Analysis_Template.md +34 -4
  123. package/skills/hmos-incremental-ui-align/references/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +2533 -2533
  124. package/skills/hmos-incremental-ui-align/references/android-to-harmonyOS-ui-interaction-mapping-reference.md +555 -555
  125. package/skills/hmos-incremental-ui-align/references/android-to-harmonyOS-ui-layout-mapping-reference.md +117 -117
  126. package/skills/hmos-incremental-ui-align/scripts/app_feature_verify.ts +937 -0
  127. package/skills/hmos-incremental-ui-align/scripts/extract_checklist.ts +343 -0
  128. package/skills/hmos-incremental-ui-align/scripts/navigation-capure.md +44 -5
  129. package/skills/hmos-incremental-ui-align/scripts/page_capture.ts +977 -0
  130. package/skills/hmos-incremental-ui-align/scripts/page_capture_burst.ts +188 -0
  131. package/skills/hmos-integration-test/README.md +111 -79
  132. package/skills/hmos-integration-test/SKILL.md +216 -132
  133. package/skills/hmos-integration-test/scripts/report-tool.ts +791 -0
  134. package/skills/hmos-integration-test/scripts/resolve-metadata-tool.ts +125 -0
  135. package/skills/hmos-integration-test/scripts/self-test-runner.ts +756 -0
  136. package/skills/hmos-integration-test/scripts/testcases-tool.ts +239 -0
  137. package/skills/hmos-resources-convert/SKILL.md +334 -66
  138. package/skills/hmos-resources-convert/references/code-vector-icon-rules.md +335 -0
  139. package/skills/hmos-resources-convert/references/conversion-rules.md +676 -663
  140. package/skills/hmos-resources-convert/references/dependency-analysis-rules.md +410 -388
  141. package/skills/hmos-resources-convert/references/lottie-conversion-rules.md +219 -0
  142. package/skills/hmos-resources-convert/references/resource-mapping-rules.md +482 -457
  143. package/skills/hmos-resources-convert/references/xml-drawable-to-svg-rules.md +592 -513
  144. package/skills/hmos-resources-convert/scripts/a2h_resource_convert.ts +2163 -0
  145. package/skills/hmos-resources-convert/scripts/code_vector_icons.ts +591 -0
  146. package/skills/hmos-resources-convert/scripts/svg_fidelity_check.ts +632 -0
  147. package/skills/hmos-spec-generate/SKILL.md +293 -214
  148. package/skills/hmos-spec-generate/scripts/parse_requirements.ts +515 -0
  149. package/skills/hmos-spec-generate/template/REQ.txt +22 -0
  150. package/skills/hmos-spec-generate/template/REQ.xlsx +0 -0
  151. package/skills/hmos-test-case-generation/README.md +241 -0
  152. package/skills/hmos-test-case-generation/SKILL.md +324 -0
  153. package/skills/hmos-test-case-generation/references/contract.md +315 -0
  154. package/skills/hmos-test-case-generation/references/review-notes-template.md +84 -0
  155. package/skills/hmos-test-case-generation/references/ui-elements-schema.md +142 -0
  156. package/skills/hmos-test-case-generation/tools/convert_to_ui_elements.ts +550 -0
  157. package/skills/hmos-test-case-generation/tools/validate.ts +1312 -0
  158. package/tools/bfs-crawl/README.md +73 -0
  159. package/tools/bfs-crawl/android_viewtree_bfs_crawler.ts +1662 -0
  160. package/agents/build-fixer.md +0 -385
  161. package/agents/logic-coder/scripts/platform_context_query.py +0 -568
  162. package/agents/review-fixer.md +0 -405
  163. package/agents/spec-generator.md +0 -541
  164. package/dist/cli/mcp-setup.js +0 -258
  165. package/dist/cli/mcp.js +0 -94
  166. package/dist/context/index.js +0 -694
  167. package/resource/migration_process.svg +0 -94
  168. package/resource/migration_process_transparent.svg +0 -93
  169. package/skills/hmos-batch-ui-align/scripts/android_parse_fast.py +0 -1606
  170. package/skills/hmos-incremental-ui-align/scripts/__pycache__/app_feature_verify.cpython-314.pyc +0 -0
  171. package/skills/hmos-incremental-ui-align/scripts/app_feature_verify.py +0 -542
  172. package/skills/hmos-incremental-ui-align/scripts/page_capture.py +0 -597
  173. package/skills/hmos-resources-convert/evals/evals.json +0 -171
  174. package/skills/hmos-resources-convert/template/AppScope/app.json5 +0 -10
  175. package/skills/hmos-resources-convert/template/AppScope/resources/base/element/string.json +0 -8
  176. package/skills/hmos-resources-convert/template/AppScope/resources/base/media/background.png +0 -0
  177. package/skills/hmos-resources-convert/template/AppScope/resources/base/media/foreground.png +0 -0
  178. package/skills/hmos-resources-convert/template/AppScope/resources/base/media/layered_image.json +0 -7
  179. package/skills/hmos-resources-convert/template/build-profile.json5 +0 -42
  180. package/skills/hmos-resources-convert/template/code-linter.json5 +0 -32
  181. package/skills/hmos-resources-convert/template/entry/build-profile.json5 +0 -33
  182. package/skills/hmos-resources-convert/template/entry/hvigorfile.ts +0 -6
  183. package/skills/hmos-resources-convert/template/entry/obfuscation-rules.txt +0 -23
  184. package/skills/hmos-resources-convert/template/entry/oh-package.json5 +0 -10
  185. package/skills/hmos-resources-convert/template/entry/src/main/ets/entryability/EntryAbility.ets +0 -48
  186. package/skills/hmos-resources-convert/template/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +0 -16
  187. package/skills/hmos-resources-convert/template/entry/src/main/ets/pages/Index.ets +0 -23
  188. package/skills/hmos-resources-convert/template/entry/src/main/module.json5 +0 -55
  189. package/skills/hmos-resources-convert/template/entry/src/main/resources/base/element/color.json +0 -8
  190. package/skills/hmos-resources-convert/template/entry/src/main/resources/base/element/float.json +0 -8
  191. package/skills/hmos-resources-convert/template/entry/src/main/resources/base/element/string.json +0 -16
  192. package/skills/hmos-resources-convert/template/entry/src/main/resources/base/media/background.png +0 -0
  193. package/skills/hmos-resources-convert/template/entry/src/main/resources/base/media/foreground.png +0 -0
  194. package/skills/hmos-resources-convert/template/entry/src/main/resources/base/media/layered_image.json +0 -7
  195. package/skills/hmos-resources-convert/template/entry/src/main/resources/base/media/startIcon.png +0 -0
  196. package/skills/hmos-resources-convert/template/entry/src/main/resources/base/profile/backup_config.json +0 -3
  197. package/skills/hmos-resources-convert/template/entry/src/main/resources/base/profile/main_pages.json +0 -5
  198. package/skills/hmos-resources-convert/template/entry/src/main/resources/dark/element/color.json +0 -8
  199. package/skills/hmos-resources-convert/template/entry/src/mock/mock-config.json5 +0 -2
  200. package/skills/hmos-resources-convert/template/entry/src/ohosTest/ets/test/Ability.test.ets +0 -35
  201. package/skills/hmos-resources-convert/template/entry/src/ohosTest/ets/test/List.test.ets +0 -5
  202. package/skills/hmos-resources-convert/template/entry/src/ohosTest/module.json5 +0 -16
  203. package/skills/hmos-resources-convert/template/entry/src/test/List.test.ets +0 -5
  204. package/skills/hmos-resources-convert/template/entry/src/test/LocalUnit.test.ets +0 -33
  205. package/skills/hmos-resources-convert/template/hvigor/hvigor-config.json5 +0 -23
  206. package/skills/hmos-resources-convert/template/hvigorfile.ts +0 -6
  207. package/skills/hmos-resources-convert/template/oh-package-lock.json5 +0 -28
  208. package/skills/hmos-resources-convert/template/oh-package.json5 +0 -10
  209. package/skills/hmos-resources-convert/tools/apktool_3.0.1.jar +0 -0
  210. package/skills/hmos-spec-generate/references/android-platform-tokens.md +0 -105
  211. package/skills/hmos-spec-generate/references/spec-sample-1.md +0 -78
  212. package/skills/hmos-spec-generate/references/spec-sample-2.md +0 -58
  213. package/skills/hmos-spec-generate/references/spec-sample-3.md +0 -116
  214. package/skills/hmos-spec-generate/references/step4-report-template.md +0 -33
  215. package/tools/test-tools/autotest/README.md +0 -238
  216. package/tools/test-tools/autotest/pyproject.toml +0 -26
  217. package/tools/test-tools/autotest/report_tool.py +0 -759
  218. package/tools/test-tools/autotest/self_test_runner.py +0 -895
  219. package/tools/test-tools/autotest/testcases_schema.md +0 -143
  220. package/tools/test-tools/autotest/testcases_tool.py +0 -215
  221. package/tools/test-tools/autotest/uv.lock +0 -3156
  222. package/tools/test-tools/harmony_autotest-0.1.0-py3-none-any.whl +0 -0
  223. package/tools/test-tools/hypium-6.1.0.210-py3-none-any.whl +0 -0
  224. package/tools/test-tools/hypium_mcp-0.6.5-py3-none-any.whl +0 -0
  225. package/tools/test-tools/xdevice-6.1.0.210-py3-none-any.whl +0 -0
  226. package/tools/test-tools/xdevice_devicetest-6.1.0.210-py3-none-any.whl +0 -0
  227. package/tools/test-tools/xdevice_ohos-6.1.0.210-py3-none-any.whl +0 -0
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: hmos-spec-generate
3
- description: "Generate atomic-scenario requirement specs (markdown) from raw .txt requirement batches for Android-to-HarmonyOS migration. Reads a single .txt holding multiple REQ blocks (blank-line separated), explores the Android code graph via homegraph, writes per-REQ trace files first then synthesizes specs from the trace. Triggers: spec generation, generate spec, requirement to spec, atomic scenarios, scenario decomposition, decompose scenarios, req to spec, code-trace-first, batch req txt."
3
+ description: "Generate requirement specification (spec) documents for Android-to-HarmonyOS migration. Read a requirement description file containing multiple requirements, split it into individual requirements, then for each one explore the Android codebase via homegraph and decompose it into atomic user scenarios, emitting one markdown spec per requirement. Use when generating spec docs from raw requirement descriptions, decomposing requirements into atomic scenarios, or preparing scenario-based specs for HarmonyOS migration. Triggers: hmos-spec-generate, spec generation, 生成spec, requirement to spec, atomic scenarios, 拆分场景, scenario decomposition, 需求转spec."
4
4
  license: MIT
5
5
  allowed-tools:
6
6
  - Read
@@ -13,313 +13,392 @@ allowed-tools:
13
13
  - TaskCreate
14
14
  - TaskList
15
15
  - TaskUpdate
16
- - mcp__homegraph__search
17
- - mcp__homegraph__explore
18
- - mcp__homegraph__node
19
- - mcp__homegraph__impact
20
- - mcp__homegraph__callers
21
- - mcp__homegraph__callees
22
- - mcp__homegraph__files
23
16
  ---
24
17
 
25
18
  # Spec Generator Skill
26
19
 
27
- Produce atomic-scenario requirement specs from Android source code for Android-to-HarmonyOS migration. The input is a single `.txt` carrying multiple REQ blocks (blank-line separated); each block is processed end-to-end (3.1 → 3.5) before the next block starts.
20
+ You are a **Spec Generator** that produces high-quality requirement specification (spec) documents for Android-to-HarmonyOS migration projects. Given a requirement description file containing multiple requirements, split it into individual requirements, explore the corresponding Android codebase via homegraph and emit a clean, atomic-scenario-based spec markdown for every requirement.
28
21
 
29
- This skill uses homegraph as the code-graph backend: the `homegraph` CLI for index management, and `mcp__homegraph__*` tools for code queries. Spec synthesis MUST go through a trace file written in 3.3 — never synthesize from conversation context.
22
+ ## Quick Reference
30
23
 
31
- ## Expected Input
32
-
33
- - `requirement_description_file`: absolute path to a single `.txt` file containing one or more REQ blocks separated by blank lines. Within each block, the first line is the REQ title (often a dash-separated settings path like `Settings-UserInterface-ImmersionMode`), and the remaining lines are the body (behavior, default values, toggles). Required.
34
- - `android_project_dir`: absolute path to the Android project root (must be inside a Git repo). Required.
35
- - `spec_output_dir`: absolute path to the directory where spec files will be written (will be created if missing). Required.
24
+ | Item | Value |
25
+ |------|-------|
26
+ | **Input** | `requirement_description_file` + `android_project_dir` + `spec_output_dir` |
27
+ | **Output** | One `<feature>-SPEC.md` per requirement under `spec_output_dir` |
28
+ | **homegraph** | `npx --yes homegraph <command>` CLI via `Bash` (index management + code queries) |
29
+ | **Processing Mode** | Per-requirement end-to-end loop (split first, then one requirement at a time) |
36
30
 
37
- **Caller example**:
31
+ ## Expected Input
38
32
 
39
- ```
40
- requirement_description_file: C:\proj\reqs\req-batch2-zh.txt
41
- android_project_dir: C:\proj\SaltPlayer\
42
- spec_output_dir: C:\proj\specs-out\
43
- ```
33
+ - `requirement_description_file`: Absolute path to a requirement description file whose content contains multiple requirements (required). Supported types: Excel (`.xlsx` / `.xlsm` / `.csv`, one row = one requirement) and text (`.txt` / `.md`, one blank-line-separated paragraph = one requirement). See `template/REQ.xlsx` and `template/REQ.txt` for equivalent examples.
34
+ - `android_project_dir`: Absolute path to the Android project root (required).
35
+ - `spec_output_dir`: Absolute path to the directory where the generated spec files (`<feature>-SPEC.md`) will be written (required).
44
36
 
45
37
  ## Expected Output
46
38
 
47
- - One markdown spec per REQ block, written to `<spec_output_dir>/<feature>-SPEC.md`. `<feature>` is the ≤ 20-character slug distilled in 3.1 (use the REQ's own language for the slug; ASCII / kebab-case acceptable when shorter).
48
- - One intermediate code-trace file per REQ block, written to `<spec_output_dir>/.trace/<feature>.md` (same slug). 3.5 synthesis MUST `Read` this file rather than recalling from conversation context.
49
- - Both files overwrite if they already exist.
39
+ - One markdown spec file per requirement split out of `requirement_description_file`, written under `spec_output_dir` as **`<feature>-SPEC.md`**, where `<feature>` is the requirement title. The `-SPEC.md` suffix is required by the downstream `hmos-test-case-generation` skill, which only accepts a `spec-path` ending in it.
50
40
 
51
41
  ---
52
42
 
53
43
  ## Principles
54
44
 
55
- Rules the final spec MUST obey:
45
+ These are the authoring rules the final spec MUST follow:
56
46
 
57
- 1. Decompose the requirement into atomic scenarios — their union reconstitutes the full requirement.
58
- 2. Each atomic scenario corresponds to one happy path OR one boundary / exception path.
59
- 3. Atomic scenarios MUST be exhaustive and mutually non-redundant.
60
- 4. The spec MUST contain a requirement-level semantic description, scenario-level semantic descriptions, and scenario flow descriptions.
61
- 5. Scenario flow descriptions MUST contain both a trigger action sequence and the corresponding logical execution steps.
62
- 6. The spec MUST NOT contain any Android-related knowledge, design, or code-level description. See `references/android-platform-tokens.md` for the full strip list and Chinese replacement vocabulary.
63
- 7. When `REQ_DESC` disagrees with the Android code implementation, the spec follows `REQ_DESC`; discrepancies are summarized at the end of the spec in user-facing language.
64
- 8. **Coverage rule** — scenarios MUST cover ALL UI entries discovered in code, not just those explicitly mentioned in `REQ_DESC`. If the trace's Scope / Boundary section enumerates N entries and `REQ_DESC` only mentions M < N, the spec still produces scenarios for all N. Missing entries here = missing scenarios in the spec.
47
+ 1. Requirements must be decomposed into atomic scenarios. Atomic scenarios combine to form a requirement.
48
+ 2. Each atomic scenario corresponds to one normal case or one edge/boundary case.
49
+ 3. Atomic scenarios must be comprehensive and non-redundant.
50
+ 4. The spec document must include a requirement semantic description, scenario semantic descriptions, and scenario flow descriptions.
51
+ 5. The scenario flow description in the spec document must include the trigger operation sequence and the logical execution steps for that scenario.
52
+ 6. The spec document must not contain any Android-related knowledge descriptions, design descriptions, or code descriptions.
65
53
 
66
54
  ---
67
55
 
68
- ## Method Discipline
56
+ ## Spec Few-shot Samples
69
57
 
70
- Cross-cutting disciplines for trace exploration (3.1 → 3.3), verified in 3.4 Review.
58
+ ### Sample 1
59
+ ```
60
+ # 新建歌单SPEC
71
61
 
72
- ### Multi-layer claim
62
+ 创建新歌单
73
63
 
74
- **Rule**: A user-observable behavior on Android is typically carried by multiple source layers. Every claim in the trace MUST enumerate each relevant layer's state — either a `file:line` hit, or an explicit `N/A: <reason>` saying why that layer does not carry it. This applies to both positive claims ("this behavior is wired at X") and negative ones ("Y does not exist"). Omitting a layer = layer not checked, never = layer not present.
64
+ ## 场景一
75
65
 
76
- Android source layers:
66
+ ### 场景概述
77
67
 
78
- | Layer | Examples |
79
- |---|---|
80
- | **code** | Java / Kotlin / Compose source (`.java`, `.kt`) — click handlers, ViewModels, Services, Repositories, DAOs, Workers |
81
- | **resource** | `res/layout/*.xml`, `res/menu/*.xml`, `res/drawable/*.xml`, `res/values/*.xml`, `res/xml/*.xml` (preference screens), `res/navigation/*.xml` |
82
- | **manifest** | `AndroidManifest.xml` (activity / service / receiver / provider / permission / intent-filter / foreground-service-type declarations); `build.gradle` flavor or `buildConfig` flags when behavior is build-gated |
68
+ 用户点击创建歌单,但输入的歌单名称为空并且创建歌单
83
69
 
84
- ### Replayable fact
70
+ ### 场景逻辑步骤
85
71
 
86
- **Rule**: Every fact in the trace MUST be **replayable verbatim** from a tool response. `file:line` anchors come from `mcp__homegraph__explore` / `node` results or the line-number prefix of a `Read` output. Phrases with counts or ordering ("called N times", "first X then Y", "synchronously then asynchronously", "again") MUST be derivable from precise tool-driven counting and sequencing (e.g. `mcp__homegraph__callers` / `callees` enumeration, or repeated `mcp__homegraph__impact` calls). Delete any fact that cannot be replayed.
72
+ - 1. 用户在“歌单页面”点击“更多菜单”中的“新建歌单按钮”或者用户在“添加到歌单弹窗”中点击“新建歌单按钮”
73
+ - 2. 弹出“新建歌单对话框”
74
+ - 3. 用户在输入框中输入空白歌单名称并点击确定按钮
75
+ - 4. 弹出toast”歌单名称不得为空“并且关闭“新建歌单对话框”
87
76
 
88
- **Common failure mode**: Hallucinate detail by analogy with common patterns ("synchronous write then asynchronous overwrite", "set X again"); estimate a line number from a `mcp__homegraph__node` / `explore` snippet and drift to a neighbouring symbol; make negative assertions from intuition instead of reverse-lookup with `mcp__homegraph__impact` / `callers` / `Grep`.
77
+ ## 场景二
89
78
 
90
- ---
79
+ ### 场景概述
91
80
 
92
- ## References
81
+ 用户点击创建歌单,但输入的歌单名称超过最大长度并且创建歌单
93
82
 
94
- External resources Read on demand (not pre-loaded). Loading these too early wastes context budget; load each only at the step that needs it.
83
+ ### 场景逻辑步骤
95
84
 
96
- | File | When to read |
97
- |---|---|
98
- | `references/spec-sample-1.md` | 3.5 Synthesize — boundary-and-happy-path decomposition style |
99
- | `references/spec-sample-2.md` | 3.5 Synthesize — nested sub-bullet decomposition style |
100
- | `references/spec-sample-3.md` | 3.5 Synthesize — shared-mechanic + per-value decomposition for enumerated multi-entry settings |
101
- | `references/android-platform-tokens.md` | 3.5 Synthesize — platform-token strip list + Chinese replacement vocabulary |
102
- | `references/step4-report-template.md` | Step 4 — summary report output format |
85
+ - 1. 用户在“歌单页面”点击“更多菜单”中的“新建歌单按钮”或者用户在“添加到歌单弹窗”中点击“新建歌单按钮”
86
+ - 2. 弹出“新建歌单对话框”
87
+ - 3. 用户在输入框中输入歌单名称并且歌单名称超过100个字符,然后点击确定按钮
88
+ - 4. 弹出toast“歌单名称过长”并且关闭“新建歌单对话框”
103
89
 
104
- Mimic the samples' voice, scenario granularity, and structure — NOT their vocabulary or domain. The samples happen to use consumer-app domains (music / video); this skill applies to any Android application domain.
90
+ ## 场景三
105
91
 
106
- ---
92
+ ### 场景概述
107
93
 
108
- ## Workflow
94
+ 用户点击创建歌单,输入有效歌单名称并且创建歌单
109
95
 
110
- ### Step 0 — Validate inputs and parse REQ blocks
96
+ ### 场景逻辑步骤
111
97
 
112
- 1. Verify `requirement_description_file` exists and is a file. If not, stop and report.
113
- 2. Verify `android_project_dir` exists and is a directory. If not, stop and report.
114
- 3. Ensure `spec_output_dir` exists (create if missing). Ensure `<spec_output_dir>/.trace/` exists (create if missing).
115
- 4. **Parse the input `.txt`** (UTF-8):
116
- - Split into REQ blocks by blank lines. Each block: first non-blank line = `title`, remaining non-blank lines = `body`.
117
- - If a block has empty `body`, mark it for skip with reason `empty body`; do not abort the whole batch.
118
- - If the file yields zero blocks, stop and report.
119
- 5. **Distill a feature slug** for each block:
120
- - Summarize the REQ into a `<feature>` phrase. **≤ 20 characters, in the REQ's own language.**
121
- - Sanitize illegal filesystem characters (`< > : " / \ | ? *` and ASCII control chars) by replacing each with `-`.
122
- - Different REQ blocks should produce different features. Titles already encode the top-level category (e.g. `Settings-UI-...` vs `Settings-Lyrics-...`); retain enough category context in the slug to keep distinct.
123
- - The slug is the filename stem for both the trace (`.trace/<feature>.md`) and the spec (`<feature>-SPEC.md`).
98
+ - 1. 用户在“歌单页面”点击“更多菜单”中的“新建歌单按钮”或者用户在“添加到歌单弹窗”中点击“新建歌单按钮”
99
+ - 2. 弹出“新建歌单对话框”
100
+ - 3. 用户在输入框中输入有效歌单名称,即用户输入到歌单名称不为空并且歌单名称没有超过100个字符,然后点击确定按钮
101
+ - 4. 去除歌单名称首尾空白字符
102
+ - 5. 把新建的歌单数据写入数据库中的歌单数据库表
103
+ - 6. 如果是在“歌单页面”,那么从数据库中读取新建歌单的数据,并且在“歌单页面”创建新建歌单item,实时刷新歌单页面,在歌单页面列表中的第一个位置上显示新建的歌单
104
+ - 7. 如果是在“添加到歌单弹窗”,那么从数据库中读取新建歌单的数据,并且在“添加到歌单弹窗”创建新建歌单item,实时刷新歌单页面,在添加到歌单弹窗列表中的第一个位置上显示新建的歌单
124
105
 
125
- Step 0 output: an ordered list of `(title, body, feature)` tuples plus a skip list. Proceed directly to Step 1.
106
+ ## 场景四
126
107
 
127
- ### Step 1 — Confirm the Android project is a Git repo
108
+ ### 场景概述
128
109
 
129
- `git rev-parse --is-inside-work-tree` in `android_project_dir`: `true` → Step 2; otherwise STOP — tell the user to `git init` the project first, then re-invoke. Do NOT auto-init / modify the user's repo.
110
+ 用户点击创建歌单,输入或者不输入歌单名称,然后点击取消按钮
130
111
 
131
- ### Step 2 — Ensure homegraph has a fresh index for the project
112
+ ### 场景逻辑步骤
132
113
 
133
- homegraph exposes two surfaces:
114
+ - 1. 用户在“歌单页面”点击“更多菜单”中的“新建歌单按钮”或者用户在“添加到歌单弹窗”中点击“新建歌单按钮”
115
+ - 2. 弹出“新建歌单对话框”
116
+ - 3. 无论用户是否在输入框中输入歌单名称,只要用户点击取消按钮,那么就关闭“新建歌单对话框”,无需执行其他操作
117
+ ```
134
118
 
135
- - **Index management** (`init`, `index`, `sync`, `status`) → run the `homegraph` CLI via `Bash`.
136
- - **Code queries** (`search`, `explore`, `node`, `impact`, `callers`, `callees`, `files`) → call `mcp__homegraph__*` tools directly.
119
+ ### Sample 2
120
+ ```
121
+ # 歌曲信息页信息展示与信息更新SPEC
137
122
 
138
- homegraph indexes per-project into a local `.homegraph/` directory; there is no central repo registry. Scope every MCP call to the Android project with `projectPath: "<android_project_dir>"` (the skill's working directory is the spec project, NOT the Android project, so the parameter is mandatory — omitting it queries the wrong project).
123
+ 歌曲信息页展示音频信息、出自专辑、参与创作的艺术家,以及播放界面保持屏幕唤醒、沉浸模式内容。
139
124
 
140
- Procedure:
125
+ ## 场景一
141
126
 
142
- 1. Run `homegraph status <android_project_dir>` to check index state.
143
- 2. Decide based on the output:
144
- - **Not indexed** (no `.homegraph/`) → run `homegraph init -i <android_project_dir>`, wait for completion.
145
- - **Stale** → run `homegraph sync <android_project_dir>` (incremental; use `homegraph index <android_project_dir> --force` for a full rebuild), wait for completion.
146
- - **Fresh** → proceed.
127
+ ### 场景概述
147
128
 
148
- **Hard fail policy** — any of the following stops the skill and surfaces the error to the user; do NOT degrade to `Read` + `Grep`:
129
+ 进入歌曲信息页后,展示当前播放歌曲的信息及相关功能入口
130
+
131
+ ### 场景逻辑步骤
149
132
 
150
- - `homegraph` CLI is not found on PATH → ask the user to install it (`npm install -g homegraph`).
151
- - `homegraph status`, `init`, `sync`, or `index` returns an error → surface the error verbatim.
152
- - Any `mcp__homegraph__*` call reports the project is not indexed → verify `init -i` ran against `android_project_dir`.
153
- - Any `mcp__homegraph__*` call in Step 3 fails unexpectedly → surface the error; stop the skill.
133
+ - 1. 在播放页右滑进入歌曲信息页
134
+ - 2. 歌曲信息页读取信息并展示:
135
+ - 2.1 音频信息展示:
136
+ - 当当前播放歌曲的音频格式存在时,显示当前播放歌曲的音频格式
137
+ - 当当前播放歌曲的音频格式缺失时,显示当前播放歌曲的文件扩展名;若文件扩展名也为空,则显示为空白
138
+ - 当当前播放歌曲的声道数存在时,显示声道数
139
+ - 当当前播放歌曲的声道数缺失时,隐藏该字段
140
+ - 当当前播放歌曲的采样率存在时,显示采样率
141
+ - 当当前播放歌曲的采样率缺失时,隐藏该字段
142
+ - 当当前播放歌曲的比特率存在时,显示比特率
143
+ - 当当前播放歌曲的比特率缺失时,显示 0 Kbps
144
+ - 2.2 出自专辑展示:
145
+ - 当当前播放歌曲的专辑封面存在时,显示专辑封面
146
+ - 当当前播放歌曲的专辑封面缺失时,显示默认专辑封面图标
147
+ - 当当前播放歌曲的专辑标题存在时,显示专辑标题
148
+ - 当当前播放歌曲的专辑标题缺失时,显示“未知专辑标题”
149
+ - 当当前播放歌曲的专辑艺术家存在时,显示专辑艺术家
150
+ - 当当前播放歌曲的专辑艺术家缺失时,显示“未知专辑艺术家”
151
+ - 2.3 参与创作的艺术家展示:
152
+ - 当当前播放歌曲的艺术家头像存在时,显示艺术家头像
153
+ - 当当前播放歌曲的艺术家头像缺失时,显示默认歌曲封面图标
154
+ - 当当前播放歌曲的艺术家名称存在时,显示艺术家名称
155
+ - 当当前播放歌曲的艺术家名称缺失时,显示“未知艺术家”
156
+ - 当当前播放歌曲的艺术家音轨数量(歌曲数量)存在时,显示艺术家音轨数量(歌曲数量)
157
+ - 当当前播放歌曲的艺术家音轨数量(歌曲数量)缺失时,显示 0
154
158
 
155
- > All `mcp__homegraph__*` calls in Step 3 MUST carry `projectPath: "<android_project_dir>"`. A missing or wrong `projectPath` poisons the trace.
156
159
 
157
- ### Step 3 — Process each REQ block end-to-end
160
+ ## 场景二
158
161
 
159
- Iterate the `(title, body, feature)` tuples from Step 0 in order. For each tuple, run **3.1 → 3.5** in full before starting the next. Do NOT batch code exploration across REQ blocks.
162
+ ### 场景概述
160
163
 
161
- Order matters: build the trace from Android source first, then synthesize the spec from the trace. Spec synthesis (3.5) MUST `Read` the trace written in 3.3 / 3.4 — recalling from conversation context causes scenario drift and `file:line` fabrication.
164
+ 切换播放歌曲后,歌曲信息页面同步刷新
162
165
 
163
- #### 3.1 Read
166
+ ### 场景逻辑步骤
164
167
 
165
- - Use the parsed `body` directly (already loaded in Step 0). If the tuple is marked `skip: empty body`, skip to the next tuple and record in Step 4 report.
166
- - Extract from `body`: UI path / page anchors (if any), primary user intent, key entities (data models, persistence key names, setting names), explicit boundary conditions (default values, toggle states, error messages, length limits).
167
- - For dependent REQs (body mentions "depends on X" or similar), note the dependency for the 3.3 trace's `Core business entities` section.
168
+ - 1. 在播放页右滑进入歌曲信息页
169
+ - 2. 用户通过上一首、下一首、播放队列切歌或自动切歌等方式切换当前播放歌曲
170
+ - 3. 歌曲信息页中的音频信息、专辑信息、艺术家信息同步刷新为新歌曲对应内容
171
+ ```
172
+
173
+ ### Sample 3
174
+ ```
175
+ # 添加到歌单SPEC
168
176
 
169
- #### 3.2 Recall — Locate entry points (dual-path union)
177
+ 用户可通过多种入口将单首或多首歌曲添加到歌单,歌单详情页按配置的排序规则展示歌曲,并新增"按添加到歌单时间排序"选项。
170
178
 
171
- Run both paths in parallel within the same turn (emit all mcp calls together); the deduplicated union is the recall result. All mcp calls MUST carry `projectPath: "<android_project_dir>"`.
179
+ ## 场景一
172
180
 
173
- | Path | Approach | Value |
174
- |---|---|---|
175
- | **Path 1 · By-concept lookup** | For each entity / UI anchor / intent verb from 3.1, call `mcp__homegraph__search({ query: "<concept>", projectPath: "<android_project_dir>" })` to locate candidate symbols, then `mcp__homegraph__explore({ query: "<symbols / file names>", projectPath: "<android_project_dir>" })` to pull their source + call relations (Activities / Fragments / Composables / ViewModels / Services / Repositories / DAOs). Cross-validate symbol name, file path, and context against `REQ_DESC`. | Direct hits: pages obviously implementing the REQ; data models named after REQ entities. |
176
- | **Path 2 · Reverse-by-usage** | Take the most discriminative keyword (a settings key literal, a persistence column / preference key, a unique business term). `search` → candidate symbol → `mcp__homegraph__callers({ symbol: "<symbol>", projectPath: "<android_project_dir>" })` (or `mcp__homegraph__impact` for the wider blast radius) returns who reaches it. Walk callers upward until hitting an `Activity` / `Fragment` / `@Composable` host. That host is an entry point. If the walk passes through intermediate dialog / popup / bottom-sheet / inner-composable components that directly reference the target key, record each as a **separate entry point** — these represent distinct user-facing surfaces within the host. | Covers structural blind spots Path 1 misses: deeply nested consumers, pass-through navigation pages, manifest-declared receivers. |
181
+ ### 场景概述
177
182
 
178
- **Behavioral REQ anchor extraction**: when `REQ_DESC` has no explicit literal keyword (e.g. "after track-change X refreshes synchronously"), extract anchors as `(action verb, affected entity)` tuples — e.g. `(track-change, X)` — and feed both into Path 1's `search` and Path 2's seed symbol search.
183
+ 用户从歌曲列表页,通过单首歌曲的更多操作-添加到歌单,将一首歌曲添加到歌单
179
184
 
180
- **Both paths hit zero** → ask the user via `AskUserQuestion` whether to manually specify an entry point. If declined → write `status: no_recall` in the trace, skip 3.3 / 3.4 / 3.5, flag in Step 4 report. Do NOT fabricate entry points.
185
+ ### 场景逻辑步骤
181
186
 
182
- **Terse REQ handling** — if the REQ body has fewer than ~20 substantive characters, OR contains only topical keywords (e.g. "multi-device", "landscape/portrait") with no concrete action verb / entity:
187
+ - 1. 用户在歌曲列表页点击某首歌曲的"更多操作"按钮
188
+ - 2. 用户在弹出菜单中点击"添加到歌单",弹出歌单选择弹窗
189
+ - 3. 歌单选择弹窗中包含当前所有已经创建好的歌单以及新建歌单按钮
190
+ - 3.1 用户可以在歌单选择弹窗中点击已有的歌单将歌曲添加到歌单中,触发toast提示“已添加到歌单”
191
+ - 3.2 用户可以点击新建歌单按钮创建新歌单,歌单创建成功后返回歌单选择弹窗,弹窗的当前歌单列表刷新后,新创建的歌单位于最上面,点击新歌单将歌曲添加到新创建的歌单中,触发toast提示“已添加到歌单”
192
+ - 4. 歌曲被添加到目标歌单,并按目标歌单当前的排序规则刷新歌曲列表
193
+ - 4.1 如果目标歌单排序规则为"按添加到歌单时间排序",则该歌曲直接添加到歌曲列表最上方
194
+ - 4.2 如果目标歌单排序规则为其他规则,则按相应规则刷新歌曲列表进行排序
195
+ - 5. 歌单封面刷新为该歌曲对应的封面
183
196
 
184
- 1. **MUST** run two broad enumeration passes (both mandatory, not optional):
185
- - **Pass A · Feature code**: enumerate hosts via `mcp__homegraph__search({ kind: "class" | "component", projectPath })` (Activities / Fragments / Composables), then `Grep` `AndroidManifest.xml` for non-default `configChanges` (orientation / resize cases) and `mcp__homegraph__files({ pattern, projectPath })` / `Grep` over `res/` for layout resource qualifiers matching the REQ topic (e.g. `-land`, `-sw600dp`, `-night`). Manifest attributes and resource qualifiers live outside the code graph, so `Grep` is authoritative there.
186
- - **Pass B · Settings breadth**: For EACH distinct keyword in the REQ body, run `mcp__homegraph__search` + `Grep` to enumerate ALL settings / configuration screens that reference that keyword or a semantically related term. Terse REQs frequently span multiple unrelated settings pages; anchoring on the single most obvious page is the primary failure mode. The union of Pass A and Pass B is the recall result.
187
- 2. If ≥3 plausible candidates → list them in the trace's `Status` section as `candidate_hosts: [...]` and proceed normally.
188
- 3. If <3 candidates → invoke `AskUserQuestion`: show the candidate list, ask which are in-scope for this REQ. Do NOT silently guess.
189
- 4. Mark in trace `Status` block: `terse_req: true` (this signal feeds 3.4 review).
190
- 5. **3.4 Review MUST verify**: every settings screen discovered in Pass B has at least one Entry or Touched-entry in the trace. A discovered-but-untraced screen → fail review, return to 3.3.
197
+ ## 场景二
191
198
 
192
- **Clarification triggers** (interrupt 3.2 / 3.3 with `AskUserQuestion`):
199
+ ### 场景概述
193
200
 
194
- - `REQ_DESC` contains ambiguous phrases ("any entry point", "related pages", "all related locations") AND the trace cannot map them to a unique set of components.
195
- - Path 1 + Path 2 both return zero, before writing `no_recall`.
196
- - Deviations from `REQ_DESC` exceed five AND touch core behavior (REQ may be stale; confirm before proceeding).
201
+ 用户从歌曲列表页,通过多选操作-添加到歌单,将多首歌曲同时添加到歌单
197
202
 
198
- #### 3.3 Trace — Explore code and write `<spec_output_dir>/.trace/<feature>.md`
203
+ ### 场景逻辑步骤
199
204
 
200
- The trace file is the sole machine-readable contract delivered to 3.5. Exploration and writing form a single unit.
205
+ - 1. 用户在歌曲列表页进入多选模式,依次选中多首歌曲
206
+ - 2. 用户点击"添加到歌单"按钮,弹出歌单选择弹窗
207
+ - 3. 歌单选择弹窗中包含当前所有已经创建好的歌单以及新建歌单按钮
208
+ - 3.1 用户可以在歌单选择弹窗中点击已有的歌单将歌曲添加到歌单中,触发toast提示“已添加到歌单”
209
+ - 3.2 用户可以点击新建歌单按钮创建新歌单,歌单创建成功后返回歌单选择弹窗,弹窗的当前歌单列表刷新后,新创建的歌单位于最上面,点击新歌单将歌曲添加到新创建的歌单中,触发toast提示“已添加到歌单”
210
+ - 4. 所选歌曲添加到目标歌单,并按目标歌单当前的排序规则刷新歌曲列表
211
+ - 4.1 如果目标歌单排序规则为"按添加到歌单时间排序",则按用户多选过程中每首歌的选中顺序决定添加次序,最先选中的歌曲在最上方(即添加到歌单的时间最晚)
212
+ - 4.2 如果目标歌单排序规则为其他规则,则按相应规则刷新歌曲列表进行排序
213
+ - 5. 歌单封面刷新为最后添加到歌单中的歌曲对应的封面
201
214
 
202
- **Exploration checklist — execution order** (all mcp calls carry `projectPath: "<android_project_dir>"`):
215
+ ## 场景三
203
216
 
204
- | Step | Action | Tool |
205
- |---|---|---|
206
- | 1 | Survey candidate symbols for each anchor from 3.1 | `mcp__homegraph__search` → `mcp__homegraph__explore` / `node` |
207
- | 2 | Full call chain (callers / callees, up and down) | `mcp__homegraph__callers` / `callees` / `impact` |
208
- | 3 | Cross-class traversal / reverse-lookup state writers / aggregation | `mcp__homegraph__impact` (deep reverse closure; raise `depth`), then `Grep` for literal keys |
209
- | 4 | Exact literal positioning (settings keys, DAO columns, intent actions, preference `android:key`) | `Grep` |
210
- | 5 | Final `file:line` verification / zero-hit counter-evidence | `Read` (small window) / `Grep` |
217
+ ### 场景概述
211
218
 
212
- > **homegraph has no `cypher`.** Split its two roles by whether you have a seed symbol:
213
- > - **Reverse-lookup from a known symbol** (who writes / reaches this state, cross-class closure, aggregation) → prefer `mcp__homegraph__impact({ symbol, depth, projectPath })` and raise `depth` for multi-hop. It traverses the full reverse-dependency closure — deeper than `callers` (depth-1). Use `callers` / `callees` only for a single hop.
214
- > - **Seedless enumeration** (all hosts of a kind, anything matching a pattern / manifest attribute / resource qualifier) → `impact` cannot help (it needs a starting symbol); use `mcp__homegraph__search({ kind })` + `mcp__homegraph__files` + `Grep`.
219
+ 用户从专辑详情页,通过单首歌曲的更多操作入口,将一首歌曲添加到歌单
215
220
 
216
- **Exploration dimensions — information coverage** (orthogonal to the checklist; checklist = order, dimensions = what to capture). Apply each to every recall entry:
221
+ ### 场景逻辑步骤
217
222
 
218
- - **Trigger code** — UI control + event callback (click / long-press / swipe / lifecycle / broadcast receiver) invoking the REQ behavior. Fill Entry's `code` and `resource` layer fields.
219
- - **End-to-end call chain** — trigger → ViewModel / UseCase → Service / Repository → data source. Fill Entry's `data_flow`; each hop carries `file:line`.
220
- - **State writes & persistence** — every state mutation (state holders, DAO inserts, preference / DataStore / MMKV puts, file writes). Record key / column names verbatim.
221
- - **Side effects / cross-boundary** — broadcasts, bound services, notifications, App Widget IPC, content providers, accessibility events.
222
- - **Manifest declarations / build flags** — activity / service / receiver registration, intent filters, permissions, foreground service types, build flavor / `buildConfig` gates. Fill Entry's `manifest` field — `N/A: <reason>` if none.
223
- - **Deviations from `REQ_DESC`** — every gap (default values, copy strings, behavior, hidden entries, validation rules). Feeds Principle 7.
224
- - **Application scope / boundary · Exhaustive entry enumeration** — ALL UI paths touching this feature / state, beyond REQ text. For state keys: reverse-lookup writers + lift to UI hosts. For readers: enumerate consumers + non-consumers. One field block per entry; omitted here = scenario omitted in spec.
225
- - **Consumer list & non-consumers** — who reads this state, plus which UI surfaces explicitly do NOT. Non-consumer claims use the structured field block (`claim` / `closure_layers` / `tools` / `zero_hits`).
223
+ - 1. 用户在专辑详情页点击某首歌曲的"更多操作"按钮
224
+ - 2. 用户在弹出菜单中点击"添加到歌单",弹出歌单选择弹窗
225
+ - 3. 歌单选择弹窗中包含当前所有已经创建好的歌单以及新建歌单按钮
226
+ - 3.1 用户可以在歌单选择弹窗中点击已有的歌单将歌曲添加到歌单中,触发toast提示“已添加到歌单”
227
+ - 3.2 用户可以点击新建歌单按钮创建新歌单,歌单创建成功后返回歌单选择弹窗,弹窗的当前歌单列表刷新后,新创建的歌单位于最上面,点击新歌单将歌曲添加到新创建的歌单中,触发toast提示“已添加到歌单”
228
+ - 4. 歌曲被添加到目标歌单,并按目标歌单当前的排序规则刷新歌曲列表
229
+ - 4.1 如果目标歌单排序规则为"按添加到歌单时间排序",则该歌曲直接添加到歌曲列表最上方
230
+ - 4.2 如果目标歌单排序规则为其他规则,则按相应规则刷新歌曲列表进行排序
231
+ - 5. 歌单封面刷新为该歌曲对应的封面
226
232
 
227
- **Trace file template** (write to `<spec_output_dir>/.trace/<feature>.md`):
233
+ ## 场景四
228
234
 
229
- ```markdown
230
- # Code trace · <feature>
235
+ ### 场景概述
231
236
 
232
- ## Status
233
- status: ok | no_recall | error
234
- project-path: <android_project_dir>
235
- backend: homegraph
237
+ 用户从艺术家详情页,通过单首歌曲的更多操作入口,将一首歌曲添加到歌单
236
238
 
237
- ## Recalled entry points (Path 1 + Path 2 union, deduplicated)
238
- - Entry 1: <UI path / page name> — file:line — recalled by: path 1 | path 2 | both
239
- - ...
239
+ ### 场景逻辑步骤
240
240
 
241
- ## Entry · <name>
242
- - claim: <user-observable behavior in one sentence>
243
- - layers:
244
- - code: <file:line> # required; hit or `N/A: <reason>`
245
- - resource: <file:line> | N/A: <reason> # layout / menu / drawable / values / xml-preferences / navigation
246
- - manifest: <file:line> | N/A: <reason> # AndroidManifest entry / build.gradle flag
247
- - interaction: <state writes, persistence keys (verbatim), in-memory mutations>
248
- - data_flow: <trigger → ViewModel / Service / Repo → data source, each hop with file:line>
241
+ - 1. 用户在艺术家详情页点击某首歌曲的"更多操作"按钮
242
+ - 2. 用户在弹出菜单中点击"添加到歌单",弹出歌单选择弹窗
243
+ - 3. 歌单选择弹窗中包含当前所有已经创建好的歌单以及新建歌单按钮
244
+ - 3.1 用户可以在歌单选择弹窗中点击已有的歌单将歌曲添加到歌单中,触发toast提示“已添加到歌单”
245
+ - 3.2 用户可以点击新建歌单按钮创建新歌单,歌单创建成功后返回歌单选择弹窗,弹窗的当前歌单列表刷新后,新创建的歌单位于最上面,点击新歌单将歌曲添加到新创建的歌单中,触发toast提示“已添加到歌单”
246
+ - 4. 歌曲被添加到目标歌单,并按目标歌单当前的排序规则刷新歌曲列表
247
+ - 4.1 如果目标歌单排序规则为"按添加到歌单时间排序",则该歌曲直接添加到歌曲列表最上方
248
+ - 4.2 如果目标歌单排序规则为其他规则,则按相应规则刷新歌曲列表进行排序
249
+ - 5. 歌单封面刷新为该歌曲对应的封面
249
250
 
250
- ## Entry · <name 2> ... Entry · <name N>
251
- (each entry repeats the claim / layers / interaction / data_flow field block)
251
+ ## 场景五
252
252
 
253
- ## Implicit triggers (non-UI state changes that activate this feature)
254
- - Trigger: <track-change / Pro status change / permission change / foreground-background switch / network change / lyrics document change / current track is null> — <file:line> — behavior: <one sentence>
255
- - (write "None" if no implicit trigger applies)
253
+ ### 场景概述
256
254
 
257
- ## Core business entities (data model / persistence key / state machine)
258
- - Entity X: <file:line + field list + semantics>
259
- - For dependent REQs: <dependency-key-name> sourced from feature `<depended-feature>` at file:line
260
- - ...
255
+ 用户从文件夹详情页,通过单首歌曲的更多操作入口,将一首歌曲添加到歌单
261
256
 
262
- ## Cross-entry shared declarations
263
- - <AndroidManifest.xml / build.gradle entries with file:line, shared across multiple entries>
264
- - ... (write "None" explicitly if no cross-entry declaration applies; per-entry manifest facts live in each Entry's `manifest` layer field)
257
+ ### 场景逻辑步骤
265
258
 
266
- ## Deviations from REQ_DESC
267
- 1. <REQ says A; but code at file:line behaves as B>
268
- 2. ...
269
- (empty → write "None" explicitly to confirm the check was performed)
259
+ - 1. 用户在文件夹详情页点击某首歌曲的"更多操作"按钮
260
+ - 2. 用户在弹出菜单中点击"添加到歌单",弹出歌单选择弹窗
261
+ - 3. 歌单选择弹窗中包含当前所有已经创建好的歌单以及新建歌单按钮
262
+ - 3.1 用户可以在歌单选择弹窗中点击已有的歌单将歌曲添加到歌单中,触发toast提示“已添加到歌单”
263
+ - 3.2 用户可以点击新建歌单按钮创建新歌单,歌单创建成功后返回歌单选择弹窗,弹窗的当前歌单列表刷新后,新创建的歌单位于最上面,点击新歌单将歌曲添加到新创建的歌单中,触发toast提示“已添加到歌单”
264
+ - 4. 歌曲添加到目标歌单,并按目标歌单当前的排序规则刷新歌曲列表
265
+ - 4.1 如果目标歌单排序规则为"按添加到歌单时间排序",则该歌曲直接添加到歌曲列表最上方
266
+ - 4.2 如果目标歌单排序规则为其他规则,则按相应规则刷新歌曲列表进行排序
267
+ - 5. 歌单封面刷新为该歌曲对应的封面
270
268
 
271
- ## Scope / Boundary — Exhaustive entry enumeration
272
- ### Touched entries (all UI paths, not limited to REQ_DESC mentions)
273
- (each touched entry uses the same `claim` / `layers` / `interaction` / `data_flow` field block as the Entry template above)
274
-
275
- ### Consumers (who reads this state / data)
276
- - Consumer: <component name> — file:line
269
+ ## 场景六
277
270
 
278
- ### Non-consumers (boundary counter-examples with evidence)
279
- - claim: <e.g. "App widget does not read this key">
280
- closure_layers: [code, resource, manifest]
281
- tools: [Grep "<pattern>", mcp__homegraph__impact "<symbol>", Read "<path>"]
282
- zero_hits: <verbatim zero-hit evidence — file globs searched, regex used, hit count>
283
-
284
- ## Same-source cross-reference (if applicable)
285
- - This REQ shares behavior with feature `<other-feature>` (e.g. the same setting exposed under multiple settings paths).
286
- Both specs are generated independently and reference each other in their deviation sections.
287
- - (write "None" if not applicable)
288
- ```
271
+ ### 场景概述
272
+
273
+ 用户从文件夹详情页,通过多选操作,将多首歌曲同时添加到歌单
274
+
275
+ ### 场景逻辑步骤
276
+
277
+ - 1. 用户在文件夹详情页进入多选模式,依次选中多首歌曲
278
+ - 2. 用户点击"添加到歌单"按钮,弹出歌单选择弹窗
279
+ - 3. 歌单选择弹窗中包含当前所有已经创建好的歌单以及新建歌单按钮
280
+ - 3.1 用户可以在歌单选择弹窗中点击已有的歌单将歌曲添加到歌单中,触发toast提示“已添加到歌单”
281
+ - 3.2 用户可以点击新建歌单按钮创建新歌单,歌单创建成功后返回歌单选择弹窗,弹窗的当前歌单列表刷新后,新创建的歌单位于最上面,点击新歌单将歌曲添加到新创建的歌单中,触发toast提示“已添加到歌单”
282
+ - 4. 所选歌曲添加到目标歌单,并按目标歌单当前的排序规则刷新歌曲列表
283
+ - 4.1 如果目标歌单排序规则为"按添加到歌单时间排序",则按用户多选过程中每首歌的选中顺序决定添加次序,最先选中的歌曲在最上方(即添加到歌单的时间最晚)
284
+ - 4.2 如果目标歌单排序规则为其他规则,则按相应规则刷新歌曲列表进行排序
285
+ - 5. 歌单封面刷新为最后添加到歌单中的歌曲对应的封面
286
+
287
+ ## 场景七
288
+
289
+ ### 场景概述
290
+
291
+ 用户进入歌单详情页,查看歌单名称及歌曲列表
292
+
293
+ ### 场景逻辑步骤
294
+
295
+ - 1. 用户点击某个歌单进入歌单详情页
296
+ - 2. 页面顶部展示歌单名字
297
+ - 3. 页面下方展示歌单包含的歌曲列表,歌曲按照当前歌单配置的排序规则进行展示
298
+ - 4. 新建歌单的默认排序规则为"按添加到歌单时间排序"(后添加到歌单的歌曲排在上面)
299
+
300
+ ## 场景八
301
+
302
+ ### 场景概述
303
+
304
+ 用户在歌单详情页切换排序规则为"按添加到歌单时间排序"以外的其他规则
289
305
 
290
- #### 3.4 Review — No fabrication, no omission, method-discipline compliant
306
+ ### 场景逻辑步骤
291
307
 
292
- Run the checks below against the trace from 3.3; every check must pass before proceeding to 3.5.
308
+ - 1. 用户在歌单详情页点击排序选项入口
309
+ - 2. 用户选择其他排序规则(如标题、艺术家等)
310
+ - 3. 歌曲列表按所选规则重新排序并刷新展示
311
+ - 4. 该排序规则在用户再次切换前保持生效,后续新添加的歌曲按该规则插入对应位置
293
312
 
294
- - **No fabrication** — every declared `file:line` actually exists (sample-verify via `mcp__homegraph__node` or `Read`); every behavioral claim is source-supported; every boundary claim has tool evidence.
295
- - **No omission** — every detail in `REQ_DESC` has a counterpart in the trace (Entry / behavior / deviation). If REQ mentions a feature code does not implement, record as deviation, not omission.
296
- - **Method-discipline compliance** (Multi-layer claim + Replayable fact) — sample-verify random `file:line` anchors via `mcp__homegraph__node` / `Read` (≥1 line drift → fail); sample-verify every count / ordering phrase against source (unreplayable → fail); every Entry / Touched-entry has all three layer fields filled (hit or `N/A: <reason>`); every Non-consumer claim has all four structured fields (`claim` / `closure_layers` / `tools` / `zero_hits`).
297
- - **Implicit triggers coverage** — the trace's `Implicit triggers` section is present and explicitly filled (≥1 trigger OR `None`). Absence of the section = fail review.
298
- - **Trace section presence audit** — every trace MUST contain these H2 sections (with `None` if truly empty; absence = fail): `Status` / `Recalled entry points` / per `Entry` (all 4 fields: `claim` / `layers` / `interaction` / `data_flow`) / `Implicit triggers` / `Core business entities` / `Cross-entry shared declarations` / `Deviations from REQ_DESC` / `Scope / Boundary` / `Same-source cross-reference`.
313
+ ## 场景九
299
314
 
300
- Any check failing → return to 3.3 (rewrite / supplement / fix). Judge convergence yourself; no external iteration cap. All checks pass → proceed to 3.5.
315
+ ### 场景概述
301
316
 
302
- #### 3.5 Synthesize — Write the final spec
317
+ 当用户尝试将已存在于目标歌单中的歌曲再次添加到该歌单时,不会重复添加
303
318
 
304
- `Read` the trace from 3.3 / 3.4, then synthesize the spec following `## Principles` and the style references under `references/`. Write to `<spec_output_dir>/<feature>-SPEC.md` (overwrite if exists).
319
+ ### 场景逻辑步骤
305
320
 
306
- **Synthesis discipline**:
321
+ - 1. 用户通过任意入口(单首或多选)选择歌曲并添加到目标歌单,触发toast提示“已添加到歌单”
322
+ - 2. 如果所选歌曲中存在已在目标歌单中的歌曲,该歌曲不会被重复添加,其原有的添加时间保持不变
323
+ - 3. 对于本次操作中尚未在目标歌单中的歌曲,按对应排序规则正常添加
307
324
 
308
- - **Implicit triggers coverage** — every entry in the trace's `Implicit triggers` section MUST appear in the spec as an independent scenario OR as a main step within an existing scenario. Listed in trace but absent from spec = scenario omission. (Extends Principle 8 to non-UI triggers.)
309
- - **Shared-mechanic factoring** — for enumerated-value settings (three-way / four-way / radio-group) accessible from multiple entry points, factor the shared menu interaction across all entries into ONE scenario; give each enum value its OWN runtime-semantics scenario. Do NOT split the mechanical scenario per entry point, and do NOT bundle "user picks X" with "what X does" in the same scenario per value.
310
- - **Binary-toggle anti-pattern** — a binary on/off switch is ONE trigger; write ONE scenario for the toggle (both directions), with linked-control side-effects as sub-bullets. Write SEPARATE scenarios for each state's runtime rendering (e.g. "when ON, cover rotates" / "when OFF, cover is static"). Do NOT split "turn on" / "turn off" into independent scenes.
311
- - **Same-source cross-reference** — if the trace's `Same-source cross-reference` section is non-empty, append a short note at the end of the spec referencing the other `<feature>-SPEC.md` (e.g. "This setting also exists under `<other-feature>-SPEC.md` with identical behavior").
312
- - **REQ-vs-code-string arbitration** — code's user-facing strings (toast / notification / dialog / snackbar / error) that conflict with `REQ_DESC` are **deviation evidence**, NOT authoritative facts. Author spec body per `REQ_DESC` phrasing; record the conflicting string + `file:line` in trace's `Deviations`. Do NOT copy code strings verbatim into the spec.
325
+ ## 场景十
313
326
 
314
- After writing, proceed to the next REQ block.
327
+ ### 场景概述
315
328
 
316
- ### Step 4 — Summary report
329
+ 用户在歌单选择弹窗中取消添加到歌单操作
317
330
 
318
- Once all REQ blocks are processed (or skipped with warnings), produce a brief report following `references/step4-report-template.md`. The template defines the per-block table format, skipped-block list, and aggregates. Keep the in-session reply within ~40 lines; per-block detail belongs in spec / trace files.
331
+ ### 场景逻辑步骤
332
+
333
+ - 1. 用户通过任意入口触发"添加到歌单",弹出歌单选择弹窗
334
+ - 2. 用户通过点击弹窗外部区域关闭弹窗
335
+ - 3. 歌单内容不发生任何变化,用户返回操作前的页面状态
336
+
337
+
338
+ ## 场景十一
339
+
340
+ ### 场景概述
341
+
342
+ 歌单选择弹窗需要包含当前所有已创建的歌单及歌曲信息
343
+
344
+ ### 场景逻辑步骤
345
+
346
+ - 1. 用户通过添加到歌单操作触发歌单选择弹窗
347
+ - 2. 歌单选择弹窗通过列表形式展示当前所有已经创建好的歌单,每个歌单对应的歌曲数目是准确的
348
+
349
+ ## 场景十二
350
+
351
+ ### 场景概述
352
+
353
+ 添加歌曲到歌单后,歌单的歌曲数量需要实时刷新
354
+
355
+ ### 场景逻辑步骤
356
+
357
+ - 1. 用户将歌曲添加到歌单
358
+ - 2. 歌单列表页,歌单详情页,歌单选择弹窗中该歌单对应的歌曲数目需要实时刷新
359
+ ```
319
360
 
320
361
  ---
321
362
 
322
- ## Forbidden
363
+ ## Workflow
364
+
365
+ ### Step 0 — Validate inputs and split requirements
366
+
367
+ 1. Verify `requirement_description_file` exists and is a readable file, then split its content into individual requirements by input type. Keep each requirement's text verbatim and record them in order; do NOT analyze them yet. If no requirement can be extracted, stop and report the error.
368
+ - **Excel type (`.xlsx` / `.xlsm` / `.csv`)**: run `node <skill-dir>/scripts/parse_requirements.ts --input <requirement_description_file> --json` via `Bash` to read the file content. Each item of the returned JSON array is one raw requirement: `uiPath` is the title, `description` is the requirement body. If the script errors, surface it verbatim and stop.
369
+ - **Text type (`.txt` / `.md`)**: read the content directly and split it into individual requirements (each requirement starts with a title line followed by its description; requirements are separated by blank lines).
370
+ 2. Verify `android_project_dir` exists and is a directory.
371
+ 3. Ensure `spec_output_dir` exists (create it if it does not).
372
+
373
+ ### Step 1 — Ensure homegraph has a fresh index for the project
374
+
375
+ homegraph is invoked exclusively through its CLI via `Bash`. Always prefix commands with `npx` (e.g. `npx --yes homegraph status <android_project_dir>`); `npx` resolves the binary without requiring a global install. All index management and code query commands share the same CLI — there is no MCP surface in this skill.
376
+
377
+ homegraph indexes per-project into a local `.homegraph/` directory; there is no central repo registry. Always pass the Android project path as the positional `[path]` argument to scope the command to the Android project (this skill's working directory is the spec project, NOT the Android project, so omitting the path queries the wrong project).
378
+
379
+ Procedure:
380
+
381
+ 1. Run `npx --yes homegraph status <android_project_dir>` to inspect the index state.
382
+ 2. Decide based on the output:
383
+ - **Not indexed** (no `.homegraph/`) → run `npx --yes homegraph init -i <android_project_dir>`, wait for completion.
384
+ - **Stale** (`npx --yes homegraph status` output does NOT contain `[OK] Index is up to date`) → run `npx --yes homegraph sync <android_project_dir>` (incremental; use `npx --yes homegraph index <android_project_dir> --force` for a full rebuild), wait for completion.
385
+ - **Fresh** → proceed to Step 2.
386
+
387
+ **Hard fail policy** — any of the following stops the skill and surfaces the error to the user; do NOT degrade to `Read` + `Grep`:
388
+
389
+ - `homegraph` CLI is not reachable via `npx` → ask the user to install it (`npm install -g homegraph` or `npx --yes homegraph install`).
390
+ - `npx --yes homegraph status`, `init`, `sync`, or `index` returns an error → surface the error verbatim and stop. Do not attempt spec generation without an index — the resulting spec would miss code-grounded scenarios.
391
+ - Any `npx --yes homegraph` query reports the project is not indexed → verify `init -i` ran against `android_project_dir`.
392
+
393
+ ### Step 2 — Process each requirement independently, one at a time
394
+
395
+ For each requirement split out in Step 0, in order, run 2.1 → 2.4 end-to-end before moving to the next requirement.
396
+
397
+ - **2.1 Scope**: Take this requirement's title + description verbatim as the raw requirement under analysis. If it is empty, warn and skip to the next requirement.
398
+ - **2.2 Analyze**: Explore the Android codebase for this requirement using the `npx --yes homegraph` CLI (via `Bash`) to retrieve the complete code implementation (entry points, end-to-end call chains, state writes / persistence keys, manifest declarations). Query commands (`query` / `explore` / `node` / `callers` / `callees` / `impact` / `files`) resolve their target project from the current working directory's nearest `.homegraph/` index, so run them from within the Android project root using a subshell — e.g. `cd <android_project_dir> && npx --yes homegraph explore "<query>"` (the index commands `status` / `init` / `sync` / `index` accept an explicit path argument, see Step 1). Use `npx --yes homegraph query "<keyword>"` / `npx --yes homegraph explore "<query>"` to locate symbols and read their line-numbered source; `npx --yes homegraph node "<symbol|file>"` to read a single symbol or whole file; `npx --yes homegraph callers "<symbol>"` / `npx --yes homegraph callees "<symbol>"` to walk call chains up and down; `npx --yes homegraph impact "<symbol>"` for change blast radius; `npx --yes homegraph files` to enumerate indexed files; and `Grep` for exact literals (settings keys, DAO columns, `android:key`) that live outside the code graph. Always run query commands from `<android_project_dir>` — this skill's working directory is the spec project, NOT the Android project, so running them from elsewhere queries the wrong project (or none). Use the CLI directly — do NOT invoke any MCP tool or nested exploration skill. If any `npx --yes homegraph` call fails unexpectedly, surface the error and stop.
399
+ - **2.3 Decompose**: Using the raw requirement + code from 2.2, generate the spec per `## Principles` and `## Spec Few-shot Samples`.
400
+ - **2.4 Write**: Write the spec to `<spec_output_dir>/<feature>-SPEC.md` (overwrite if exists), then move on to the next requirement.
401
+
402
+ ### Step 3 — Report
323
403
 
324
- - **No nested LLM-agent skill calls** — no `homegraph-exploring`, no `homegraph-debugging`, no `homegraph-refactoring`, no `homegraph-impact-analysis`. They override this SKILL's instructions and cause role drift. Index management uses the `homegraph` CLI directly (`Bash`), not a skill.
325
- - **No modification of the Android project** — `.gradle`, `AndroidManifest.xml`, source files. This skill is read-only.
404
+ After all requirements have been processed (or skipped with a warning), report a brief summary listing each generated spec file path and any requirements that were skipped.