@buaa_smat/hometrans 0.1.17 → 0.1.19

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 (234) hide show
  1. package/README.md +120 -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 +123 -143
  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 +16 -63
  35. package/dist/cli/env-vars.js +1 -3
  36. package/dist/cli/index.js +0 -11
  37. package/dist/cli/init.js +123 -204
  38. package/dist/cli/uninstall.js +3 -127
  39. package/dist/utils/regex.js +8 -0
  40. package/env-requirements.json +55 -54
  41. package/package.json +6 -6
  42. package/resource/convert_pipeline_process.svg +103 -0
  43. package/resource/project_architecture.svg +122 -0
  44. package/resource/title_dark.png +0 -0
  45. package/skills/hmos-batch-ui-align/SKILL.md +345 -43
  46. package/skills/hmos-batch-ui-align/references/conversion-procedure.md +661 -180
  47. package/skills/hmos-batch-ui-align/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +2533 -2533
  48. package/skills/hmos-batch-ui-align/references/mappings/android-to-harmonyOS-ui-interaction-mapping-reference.md +555 -555
  49. package/skills/hmos-batch-ui-align/references/mappings/android-to-harmonyOS-ui-layout-mapping-reference.md +117 -117
  50. 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
  51. 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
  52. 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
  53. 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
  54. 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
  55. 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
  56. 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
  57. 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
  58. 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
  59. 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
  60. package/skills/hmos-batch-ui-align/references/mvvm/MVVM/346/250/241/345/274/217/357/274/210V1/357/274/211.md +911 -911
  61. 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
  62. 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
  63. 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
  64. 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
  65. 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
  66. 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
  67. 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
  68. 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
  69. 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
  70. 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
  71. 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
  72. 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
  73. 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
  74. 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
  75. 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
  76. 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
  77. 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
  78. 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
  79. package/skills/hmos-batch-ui-align/scripts/android_parse_fast.ts +1798 -0
  80. package/skills/hmos-batch-ui-align/scripts/arkts_static_check.ts +1592 -0
  81. package/skills/hmos-batch-ui-align/scripts/measure_pack.ts +752 -0
  82. package/skills/hmos-convert-pipeline/SKILL.md +168 -121
  83. package/skills/hmos-fix-build-errors/SKILL.md +87 -67
  84. package/skills/hmos-fix-build-errors/references/arkts-strict-patterns.md +219 -219
  85. package/skills/hmos-fix-build-errors/references/known-patterns.md +157 -157
  86. package/skills/hmos-fix-build-errors/references/rdb-entity-pattern.md +131 -131
  87. package/skills/hmos-incremental-ui-align/README.md +53 -36
  88. package/skills/hmos-incremental-ui-align/SKILL.md +179 -23
  89. package/skills/hmos-incremental-ui-align/diff_analysis.md +52 -52
  90. package/skills/hmos-incremental-ui-align/page_align.md +62 -62
  91. package/skills/hmos-incremental-ui-align/references/Comparison_Template.md +38 -2
  92. 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
  93. 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
  94. 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
  95. 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
  96. 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
  97. 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
  98. 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
  99. 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
  100. 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
  101. 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
  102. 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
  103. 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
  104. 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
  105. 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
  106. 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
  107. 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
  108. 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
  109. 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
  110. 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
  111. 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
  112. 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
  113. 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
  114. 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
  115. 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
  116. 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
  117. 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
  118. 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
  119. 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
  120. package/skills/hmos-incremental-ui-align/references/State_Model_Template.md +74 -0
  121. package/skills/hmos-incremental-ui-align/references/UI_Analysis_Template.md +34 -4
  122. package/skills/hmos-incremental-ui-align/references/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +2533 -2533
  123. package/skills/hmos-incremental-ui-align/references/android-to-harmonyOS-ui-interaction-mapping-reference.md +555 -555
  124. package/skills/hmos-incremental-ui-align/references/android-to-harmonyOS-ui-layout-mapping-reference.md +117 -117
  125. package/skills/hmos-incremental-ui-align/scripts/app_feature_verify.ts +937 -0
  126. package/skills/hmos-incremental-ui-align/scripts/extract_checklist.ts +343 -0
  127. package/skills/hmos-incremental-ui-align/scripts/navigation-capure.md +44 -5
  128. package/skills/hmos-incremental-ui-align/scripts/page_capture.ts +977 -0
  129. package/skills/hmos-incremental-ui-align/scripts/page_capture_burst.ts +188 -0
  130. package/skills/hmos-integration-test/README.md +61 -70
  131. package/skills/hmos-integration-test/SKILL.md +128 -111
  132. package/skills/hmos-resources-convert/SKILL.md +334 -66
  133. package/skills/hmos-resources-convert/references/code-vector-icon-rules.md +335 -0
  134. package/skills/hmos-resources-convert/references/conversion-rules.md +676 -663
  135. package/skills/hmos-resources-convert/references/dependency-analysis-rules.md +410 -388
  136. package/skills/hmos-resources-convert/references/lottie-conversion-rules.md +219 -0
  137. package/skills/hmos-resources-convert/references/resource-mapping-rules.md +482 -457
  138. package/skills/hmos-resources-convert/references/xml-drawable-to-svg-rules.md +592 -513
  139. package/skills/hmos-resources-convert/scripts/a2h_resource_convert.ts +2163 -0
  140. package/skills/hmos-resources-convert/scripts/code_vector_icons.ts +591 -0
  141. package/skills/hmos-resources-convert/scripts/svg_fidelity_check.ts +632 -0
  142. package/skills/hmos-spec-generate/SKILL.md +293 -214
  143. package/skills/hmos-spec-generate/scripts/parse_requirements.ts +515 -0
  144. package/skills/hmos-spec-generate/template/REQ.txt +22 -0
  145. package/skills/hmos-spec-generate/template/REQ.xlsx +0 -0
  146. package/skills/hmos-test-case-generation/README.md +241 -0
  147. package/skills/hmos-test-case-generation/SKILL.md +324 -0
  148. package/skills/hmos-test-case-generation/references/contract.md +315 -0
  149. package/skills/hmos-test-case-generation/references/review-notes-template.md +84 -0
  150. package/skills/hmos-test-case-generation/references/ui-elements-schema.md +142 -0
  151. package/skills/hmos-test-case-generation/tools/convert_to_ui_elements.ts +550 -0
  152. package/skills/hmos-test-case-generation/tools/validate.ts +1312 -0
  153. package/tools/bfs-crawl/README.md +73 -0
  154. package/tools/bfs-crawl/android_viewtree_bfs_crawler.ts +1662 -0
  155. package/tools/test-tools/autotest/config.ts +175 -0
  156. package/tools/test-tools/autotest/deps/autotest-agent-0.1.1.tgz +0 -0
  157. package/tools/test-tools/autotest/docs/README.md +266 -0
  158. package/tools/test-tools/autotest/{testcases_schema.md → docs/testcases_schema.md} +1 -1
  159. package/tools/test-tools/autotest/engine/batch-launcher.ts +327 -0
  160. package/tools/test-tools/autotest/engine/report-tool.ts +773 -0
  161. package/tools/test-tools/autotest/engine/self-test-runner.ts +961 -0
  162. package/tools/test-tools/autotest/engine/testcases-tool.ts +246 -0
  163. package/tools/test-tools/autotest/paths.ts +41 -0
  164. package/tools/test-tools/autotest/resolve-metadata-tool.ts +143 -0
  165. package/tools/test-tools/autotest/runner/logger.ts +45 -0
  166. package/tools/test-tools/autotest/runner/process-utils.ts +41 -0
  167. package/tools/test-tools/autotest/validate.ts +167 -0
  168. package/agents/build-fixer.md +0 -385
  169. package/agents/logic-coder/scripts/platform_context_query.py +0 -568
  170. package/agents/review-fixer.md +0 -405
  171. package/agents/spec-generator.md +0 -541
  172. package/dist/cli/mcp-setup.js +0 -258
  173. package/dist/cli/mcp.js +0 -94
  174. package/dist/context/index.js +0 -694
  175. package/resource/migration_process.svg +0 -94
  176. package/resource/migration_process_transparent.svg +0 -93
  177. package/skills/hmos-batch-ui-align/scripts/android_parse_fast.py +0 -1606
  178. package/skills/hmos-incremental-ui-align/scripts/__pycache__/app_feature_verify.cpython-314.pyc +0 -0
  179. package/skills/hmos-incremental-ui-align/scripts/app_feature_verify.py +0 -542
  180. package/skills/hmos-incremental-ui-align/scripts/page_capture.py +0 -597
  181. package/skills/hmos-resources-convert/evals/evals.json +0 -171
  182. package/skills/hmos-resources-convert/template/AppScope/app.json5 +0 -10
  183. package/skills/hmos-resources-convert/template/AppScope/resources/base/element/string.json +0 -8
  184. package/skills/hmos-resources-convert/template/AppScope/resources/base/media/background.png +0 -0
  185. package/skills/hmos-resources-convert/template/AppScope/resources/base/media/foreground.png +0 -0
  186. package/skills/hmos-resources-convert/template/AppScope/resources/base/media/layered_image.json +0 -7
  187. package/skills/hmos-resources-convert/template/build-profile.json5 +0 -42
  188. package/skills/hmos-resources-convert/template/code-linter.json5 +0 -32
  189. package/skills/hmos-resources-convert/template/entry/build-profile.json5 +0 -33
  190. package/skills/hmos-resources-convert/template/entry/hvigorfile.ts +0 -6
  191. package/skills/hmos-resources-convert/template/entry/obfuscation-rules.txt +0 -23
  192. package/skills/hmos-resources-convert/template/entry/oh-package.json5 +0 -10
  193. package/skills/hmos-resources-convert/template/entry/src/main/ets/entryability/EntryAbility.ets +0 -48
  194. package/skills/hmos-resources-convert/template/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +0 -16
  195. package/skills/hmos-resources-convert/template/entry/src/main/ets/pages/Index.ets +0 -23
  196. package/skills/hmos-resources-convert/template/entry/src/main/module.json5 +0 -55
  197. package/skills/hmos-resources-convert/template/entry/src/main/resources/base/element/color.json +0 -8
  198. package/skills/hmos-resources-convert/template/entry/src/main/resources/base/element/float.json +0 -8
  199. package/skills/hmos-resources-convert/template/entry/src/main/resources/base/element/string.json +0 -16
  200. package/skills/hmos-resources-convert/template/entry/src/main/resources/base/media/background.png +0 -0
  201. package/skills/hmos-resources-convert/template/entry/src/main/resources/base/media/foreground.png +0 -0
  202. package/skills/hmos-resources-convert/template/entry/src/main/resources/base/media/layered_image.json +0 -7
  203. package/skills/hmos-resources-convert/template/entry/src/main/resources/base/media/startIcon.png +0 -0
  204. package/skills/hmos-resources-convert/template/entry/src/main/resources/base/profile/backup_config.json +0 -3
  205. package/skills/hmos-resources-convert/template/entry/src/main/resources/base/profile/main_pages.json +0 -5
  206. package/skills/hmos-resources-convert/template/entry/src/main/resources/dark/element/color.json +0 -8
  207. package/skills/hmos-resources-convert/template/entry/src/mock/mock-config.json5 +0 -2
  208. package/skills/hmos-resources-convert/template/entry/src/ohosTest/ets/test/Ability.test.ets +0 -35
  209. package/skills/hmos-resources-convert/template/entry/src/ohosTest/ets/test/List.test.ets +0 -5
  210. package/skills/hmos-resources-convert/template/entry/src/ohosTest/module.json5 +0 -16
  211. package/skills/hmos-resources-convert/template/entry/src/test/List.test.ets +0 -5
  212. package/skills/hmos-resources-convert/template/entry/src/test/LocalUnit.test.ets +0 -33
  213. package/skills/hmos-resources-convert/template/hvigor/hvigor-config.json5 +0 -23
  214. package/skills/hmos-resources-convert/template/hvigorfile.ts +0 -6
  215. package/skills/hmos-resources-convert/template/oh-package-lock.json5 +0 -28
  216. package/skills/hmos-resources-convert/template/oh-package.json5 +0 -10
  217. package/skills/hmos-resources-convert/tools/apktool_3.0.1.jar +0 -0
  218. package/skills/hmos-spec-generate/references/android-platform-tokens.md +0 -105
  219. package/skills/hmos-spec-generate/references/spec-sample-1.md +0 -78
  220. package/skills/hmos-spec-generate/references/spec-sample-2.md +0 -58
  221. package/skills/hmos-spec-generate/references/spec-sample-3.md +0 -116
  222. package/skills/hmos-spec-generate/references/step4-report-template.md +0 -33
  223. package/tools/test-tools/autotest/README.md +0 -238
  224. package/tools/test-tools/autotest/pyproject.toml +0 -26
  225. package/tools/test-tools/autotest/report_tool.py +0 -759
  226. package/tools/test-tools/autotest/self_test_runner.py +0 -895
  227. package/tools/test-tools/autotest/testcases_tool.py +0 -215
  228. package/tools/test-tools/autotest/uv.lock +0 -3156
  229. package/tools/test-tools/harmony_autotest-0.1.0-py3-none-any.whl +0 -0
  230. package/tools/test-tools/hypium-6.1.0.210-py3-none-any.whl +0 -0
  231. package/tools/test-tools/hypium_mcp-0.6.5-py3-none-any.whl +0 -0
  232. package/tools/test-tools/xdevice-6.1.0.210-py3-none-any.whl +0 -0
  233. package/tools/test-tools/xdevice_devicetest-6.1.0.210-py3-none-any.whl +0 -0
  234. package/tools/test-tools/xdevice_ohos-6.1.0.210-py3-none-any.whl +0 -0
@@ -1,457 +1,482 @@
1
- # Android Resource Mapping Rules
2
-
3
- This document defines how to build the Android resource inventory and the Android ↔ HarmonyOS mapping markdown written to `resource_mapping_path`.
4
-
5
- ## 1. Purpose
6
-
7
- The standard conversion report explains what the pipeline did. The mapping markdown serves a different purpose: it is an audit-friendly document for humans who need to review Android resources, understand their role, identify likely source ownership, and inspect how each Android resource maps to HarmonyOS output.
8
-
9
- The mapping markdown MUST be produced for every run.
10
-
11
- ---
12
-
13
- ## 2. Two Required Data Sets
14
-
15
- Build and retain two parallel data sets throughout the pipeline.
16
-
17
- ### 2.1 Android Resource Inventory Records
18
-
19
- One inventory record per Android resource item.
20
-
21
- Required fields:
22
- - `android_resource_path`
23
- - `android_resource_name`
24
- - `function`
25
- - `screens`
26
- - `source_category`
27
- - `type_category`
28
- - `status`
29
- - `notes`
30
-
31
- ### 2.2 Android ↔ HarmonyOS Mapping Records
32
-
33
- One mapping record per conversion outcome.
34
-
35
- Required fields:
36
- - `android_resource_path`
37
- - `android_screens`
38
- - `android_source_category`
39
- - `android_type_category`
40
- - `harmony_target`
41
- - `mapping_kind`
42
- - `notes`
43
-
44
- A single Android resource may produce multiple mapping records.
45
-
46
- ---
47
-
48
- ## 3. Path Rules
49
-
50
- ### 3.1 File-Based Android Resources
51
-
52
- Use the Android file path directly.
53
-
54
- Examples:
55
- - `app/src/main/res/drawable/home_login_btn.png`
56
- - `app/src/main/res/mipmap-xxxhdpi/logo.png`
57
- - `app/src/main/res/xml/file_paths.xml`
58
- - `feature_home/src/main/res/drawable/bg_header.xml`
59
-
60
- ### 3.2 `values/*.xml` Resources
61
-
62
- `values` resources MUST be recorded at entry granularity, not only file granularity.
63
-
64
- Format:
65
- - `file_path#tag/name`
66
-
67
- Examples:
68
- - `app/src/main/res/values/strings.xml#string/app_name`
69
- - `app/src/main/res/values/colors.xml#color/primary`
70
- - `app/src/main/res/values/dimens.xml#dimen/page_margin`
71
- - `app/src/main/res/values/arrays.xml#string-array/province_names`
72
- - `app/src/main/res/values/plurals.xml#plurals/items_count`
73
-
74
- ### 3.3 Android System Resources
75
-
76
- Android framework resources do not have a project-local file path. Record the reference itself as the path.
77
-
78
- Examples:
79
- - `@android:color/white`
80
- - `@android:dimen/app_icon_size`
81
- - `@android:drawable/ic_menu_close`
82
-
83
- ### 3.4 Runtime Remote Resources
84
-
85
- Remote resources are not Android `res/` files. Record them using code location plus the remote identifier when possible.
86
-
87
- Examples:
88
- - `app/src/main/java/com/example/home/HomeBanner.kt:88 -> https://...`
89
- - `app/src/main/java/com/example/api/BannerDto.kt:35 -> remote_image_url`
90
-
91
- If only the code location is known, record that and explain the limitation in `notes`.
92
-
93
- ---
94
-
95
- ## 4. Resource Name Rules
96
-
97
- ### 4.1 File Resources
98
-
99
- Use the Android resource name without qualifiers or extension.
100
-
101
- Examples:
102
- - `drawable/home_login_btn.png` → `home_login_btn`
103
- - `mipmap-anydpi-v26/ic_launcher.xml` → `ic_launcher`
104
-
105
- ### 4.2 `values` Resources
106
-
107
- Use the XML entry's `name` attribute.
108
-
109
- Examples:
110
- - `<string name="app_name">` → `app_name`
111
- - `<color name="primary">` → `primary`
112
-
113
- ### 4.3 System Resources
114
-
115
- Use the framework resource name after the slash.
116
-
117
- Examples:
118
- - `@android:color/white` → `white`
119
- - `@android:dimen/app_icon_size` → `app_icon_size`
120
-
121
- ---
122
-
123
- ## 5. Function Field Rules
124
-
125
- The `function` field should be short, concrete, and useful to a reviewer.
126
-
127
- Recommended inference priority:
128
-
129
- 1. **Explicit semantic name**
130
- - If the resource name clearly indicates its role, use that.
131
- - Examples:
132
- - `logo` → `App logo`
133
- - `ic_back` → `Back icon`
134
- - `home_header_bg` → `Home header background`
135
-
136
- 2. **Usage-site evidence**
137
- - If the resource is referenced from a known screen or component, use that context.
138
- - Examples:
139
- - `Login page close icon`
140
- - `Home tab selected background`
141
-
142
- 3. **Resource type evidence**
143
- - For XML drawables, infer from root element or role.
144
- - Examples:
145
- - `<shape>` → `Shape background`
146
- - `<selector>` → `State selector drawable`
147
- - `<layer-list>` → `Layered background`
148
-
149
- 4. **Directory-role evidence**
150
- - `mipmap` often means launcher or app icon resources.
151
- - `font` often means app font resource.
152
- - `xml` often means configuration resource.
153
-
154
- 5. **Conservative fallback**
155
- - If the exact role is uncertain, do not invent specifics.
156
- - Examples:
157
- - `Image resource (inferred from filename)`
158
- - `Color resource used by UI styling`
159
- - `Configuration XML resource`
160
-
161
- If the function is inferred rather than certain, mention the evidence in `notes`.
162
-
163
- ---
164
-
165
- ## 6. Screen Attribution Rules
166
-
167
- The `screens` field identifies which Android screen(s) use the resource.
168
-
169
- This is a best-effort static analysis field. Use evidence; do not fabricate certainty.
170
-
171
- ### 6.1 Screen Candidates
172
-
173
- Build the candidate screen set from:
174
- - Activities
175
- - Fragments
176
- - Compose screen / page / route files
177
- - Navigation graph destinations
178
- - Launcher entry activity
179
-
180
- ### 6.2 Direct Reference Rule
181
-
182
- If a screen file directly references:
183
- - `R.drawable.xxx`
184
- - `R.mipmap.xxx`
185
- - `R.string.xxx`
186
- - `R.color.xxx`
187
- - `R.font.xxx`
188
- - `R.xml.xxx`
189
-
190
- then attribute the resource to that screen.
191
-
192
- ### 6.3 Layout-Indirection Rule
193
-
194
- If:
195
- - a screen uses a layout file, and
196
- - that layout file references resources,
197
-
198
- then attribute those resources to that screen.
199
-
200
- ### 6.4 Shared-Component Rule
201
-
202
- If a shared component references a resource and that component is used by multiple screens:
203
- - record all known screens, or
204
- - use `Common` when the list is too broad to be helpful.
205
-
206
- ### 6.5 Global-App Rule
207
-
208
- Use one of the following fixed labels where appropriate:
209
- - `Launcher` — launcher icon, round icon, adaptive icon
210
- - `Global` — app-wide theme or identity resource
211
- - `Common` — shared across many screens
212
- - `Unknown` — insufficient evidence
213
-
214
- ### 6.6 Output Format
215
-
216
- The `screens` field may contain:
217
- - a single screen, e.g. `HomeScreen`
218
- - a comma-separated list, e.g. `HomeScreen, LoginScreen`
219
- - one of the labels: `Launcher`, `Global`, `Common`, `Unknown`
220
-
221
- ---
222
-
223
- ## 7. Source Category Rules
224
-
225
- The allowed source categories are:
226
- - `应用自身资源`
227
- - `项目内模块资源`
228
- - `第三方库资源`
229
- - `Android 系统资源`
230
- - `运行时远程资源`
231
-
232
- ### 7.1 应用自身资源
233
-
234
- Use when the resource is confirmed to come from the app module itself.
235
-
236
- Typical evidence:
237
- - path under `app/src/.../res`
238
- - path under the main application module
239
- - source `res/` fallback found it directly in the app module
240
-
241
- ### 7.2 项目内模块资源
242
-
243
- Use when the resource comes from another local module in the same Android project.
244
-
245
- Typical evidence:
246
- - path under another local module such as `common/src/.../res`, `feature_xxx/src/.../res`
247
- - local Gradle project dependency indicates the module belongs to the same repository
248
-
249
- ### 7.3 第三方库资源
250
-
251
- Use when the resource likely comes from an external dependency.
252
-
253
- Typical evidence:
254
- - resource exists only in the decompiled APK, not in project source modules
255
- - resource prefix matches common library conventions such as `abc_*`, `mtrl_*`, `design_*`, `material_*`
256
- - build dependencies indicate a matching library
257
-
258
- If the category is inferred, say so in `notes`.
259
-
260
- ### 7.4 Android 系统资源
261
-
262
- Use when the reference starts with `@android:`.
263
-
264
- ### 7.5 运行时远程资源
265
-
266
- Use when the asset is not packaged in `res/` and is instead fetched or constructed at runtime.
267
-
268
- Typical evidence:
269
- - URL-based image loading
270
- - server-driven icon/image fields
271
- - WebView / HTML / remote content assets
272
-
273
- ---
274
-
275
- ## 8. Type Category Rules
276
-
277
- The primary required categories are:
278
- - `drawable`
279
- - `mipmap`
280
- - `layout`
281
- - `values`
282
- - `xml`
283
- - `font`
284
-
285
- For required rows that do not originate from a concrete Android resource directory — such as runtime remote resources, resolved Android system references, and placeholder outputs created only to satisfy HarmonyOS references — normalize them into the closest review-friendly category instead of inventing a new top-level type category. In practice:
286
- - value-like references (`string`, `color`, `dimen`, `integer`, `bool`, `array`, `plurals`) should use `values`
287
- - runtime remote resources should use `xml` unless there is stronger evidence they behave like media assets
288
- - placeholder media outputs should use `drawable`
289
-
290
- ### 8.1 Normalization Rule
291
-
292
- For qualified directories such as `drawable-hdpi`, `mipmap-anydpi-v26`, `values-zh-rCN`, strip qualifiers and record the base type.
293
-
294
- Examples:
295
- - `drawable-hdpi` → `drawable`
296
- - `mipmap-anydpi-v26` → `mipmap`
297
- - `values-night` → `values`
298
-
299
- ### 8.2 `values` Rule
300
-
301
- Even though `values/*.xml` entries have different subtypes (`string`, `color`, `dimen`, etc.), the required `type_category` remains `values`.
302
-
303
- ### 8.3 Other Android Types
304
-
305
- If the original Android type is not one of the six required categories (`raw`, `menu`, `anim`, `animator`, `color`, etc.), do NOT mislabel it. Use:
306
- - the closest required category only if it is truly correct, otherwise
307
- - keep the row in scope and explain the original Android type in `notes`
308
-
309
- Recommended fallback in `notes`:
310
- - `Original Android type: raw`
311
- - `Original Android type: menu`
312
-
313
- ---
314
-
315
- ## 9. Mapping Kind Rules
316
-
317
- Suggested `mapping_kind` values:
318
- - `direct copy`
319
- - `rename`
320
- - `svg conversion`
321
- - `layered-image conversion`
322
- - `generated media`
323
- - `merged into json`
324
- - `unmappable`
325
- - `fallback applied`
326
- - `placeholder created`
327
- - `system resource resolved`
328
- - `remote resource (no local target)`
329
-
330
- Use the simplest accurate label.
331
-
332
- ---
333
-
334
- ## 10. One-to-One, One-to-Many, and Many-to-One Handling
335
-
336
- ### 10.1 One-to-One
337
-
338
- Example:
339
- - `res/drawable/home_login_btn.png` → `entry/src/main/resources/base/media/home_login_btn.png`
340
-
341
- Emit one mapping row.
342
-
343
- ### 10.2 One-to-Many
344
-
345
- Example: adaptive icon XML may produce:
346
- - layered-image JSON
347
- - generated solid-color PNG background
348
-
349
- Emit multiple mapping rows that share the same Android resource path.
350
-
351
- ### 10.3 Many-to-One
352
-
353
- Example: multiple Android `values` files merge into one Harmony JSON file.
354
-
355
- Still emit one mapping row per Android source entry.
356
-
357
- Examples:
358
- - `res/values/strings.xml#string/app_name` → `resources/base/element/string.json#app_name`
359
- - `res/values/app_strings.xml#string/login_title` → `resources/base/element/string.json#login_title`
360
-
361
- ### 10.4 No Harmony Target
362
-
363
- When there is no valid Harmony target, use:
364
- - `harmony_target = N/A`
365
-
366
- And explain the reason in `notes`.
367
-
368
- Examples:
369
- - layout XML has no direct ArkUI equivalent
370
- - remote resource is runtime-only
371
- - unresolved third-party resource had no extracted target
372
-
373
- ---
374
-
375
- ## 11. Required Markdown Output Structure
376
-
377
- The markdown written to `resource_mapping_path` MUST contain the following sections.
378
-
379
- ### 11.1 Title
380
-
381
- ```md
382
- # Android Resources ↔ HarmonyOS Resources Mapping
383
- ```
384
-
385
- ### 11.2 Metadata
386
-
387
- Include bullets for:
388
- - Android project path
389
- - HarmonyOS project output path
390
- - Resource source
391
- - Resource source path
392
- - Build result
393
- - Generation timestamp
394
-
395
- ### 11.3 Android Resource Inventory
396
-
397
- Use a markdown table with at least these columns:
398
- - `Android Resource Path`
399
- - `Resource Name`
400
- - `Function`
401
- - `Screen(s)`
402
- - `Source Category`
403
- - `Type Category`
404
- - `Status`
405
- - `Notes`
406
-
407
- ### 11.4 Android → HarmonyOS Mapping Details
408
-
409
- Use a markdown table with at least these columns:
410
- - `Android Resource Path`
411
- - `Android Screen(s)`
412
- - `Android Source Category`
413
- - `Android Type Category`
414
- - `HarmonyOS Target`
415
- - `Mapping Kind`
416
- - `Notes`
417
-
418
- Every mapping row MUST include the Android-side screen/source/type fields.
419
-
420
- ### 11.5 Unmapped / Unmappable / System / Remote Summary
421
-
422
- Include a compact summary table or grouped bullets covering:
423
- - resources with no direct HarmonyOS equivalent
424
- - Android framework resources
425
- - library-only resources inferred from dependencies or APK
426
- - runtime remote resources
427
-
428
- ### 11.6 Quick Findings
429
-
430
- Provide short bullets highlighting review-relevant findings, such as:
431
- - launcher icons coming from `mipmap`
432
- - probable third-party library assets such as `abc_*` / `mtrl_*`
433
- - resources found only in the decompiled APK
434
- - likely causes of icon or logo mismatches
435
-
436
- ---
437
-
438
- ## 12. Required Fallback Labels
439
-
440
- Never leave required fields blank.
441
-
442
- Use these fallback values where necessary:
443
- - `screens` → `Unknown`
444
- - `source_category` → best-evidence category; if still unclear, use `第三方库资源(推断)` or explain uncertainty in `notes`
445
- - `type_category` → base Android type if valid, otherwise use the closest valid category only if correct and explain the original type in `notes`
446
- - `harmony_target` → `N/A`
447
- - `function` → conservative descriptive fallback
448
-
449
- ---
450
-
451
- ## 13. Hard Requirements
452
-
453
- - Never silently omit an Android resource that the pipeline observed.
454
- - `values` resources must be recorded at entry granularity.
455
- - Mapping rows must preserve Android-side screen/source/type metadata.
456
- - Unmappable, library-only, system, and remote resources must still appear in the mapping markdown.
457
- - If a judgment is inferred rather than proven, say so in `notes`.
1
+ # Android Resource Mapping Rules
2
+
3
+ This document defines how to build the Android resource inventory and the Android ↔ HarmonyOS mapping markdown written to `resource_mapping_path`.
4
+
5
+ ## 1. Purpose
6
+
7
+ The standard conversion report explains what the pipeline did. The mapping markdown serves a different purpose: it is an audit-friendly document for humans who need to review Android resources, understand their role, identify likely source ownership, and inspect how each Android resource maps to HarmonyOS output.
8
+
9
+ The mapping markdown MUST be produced for every run.
10
+
11
+ ---
12
+
13
+ ## 2. Two Required Data Sets
14
+
15
+ Build and retain two parallel data sets throughout the pipeline.
16
+
17
+ ### 2.1 Android Resource Inventory Records
18
+
19
+ One inventory record per Android resource item.
20
+
21
+ Required fields:
22
+ - `android_resource_path`
23
+ - `android_resource_name`
24
+ - `function`
25
+ - `screens`
26
+ - `source_category`
27
+ - `type_category`
28
+ - `status`
29
+ - `notes`
30
+
31
+ ### 2.2 Android ↔ HarmonyOS Mapping Records
32
+
33
+ One mapping record per conversion outcome.
34
+
35
+ Required fields:
36
+ - `android_resource_path`
37
+ - `android_screens`
38
+ - `android_source_category`
39
+ - `android_type_category`
40
+ - `harmony_target`
41
+ - `mapping_kind`
42
+ - `notes`
43
+
44
+ A single Android resource may produce multiple mapping records.
45
+
46
+ ---
47
+
48
+ ## 3. Path Rules
49
+
50
+ ### 3.1 File-Based Android Resources
51
+
52
+ Use the Android file path directly.
53
+
54
+ Examples:
55
+ - `app/src/main/res/drawable/home_login_btn.png`
56
+ - `app/src/main/res/mipmap-xxxhdpi/logo.png`
57
+ - `app/src/main/res/xml/file_paths.xml`
58
+ - `feature_home/src/main/res/drawable/bg_header.xml`
59
+
60
+ ### 3.2 `values/*.xml` Resources
61
+
62
+ `values` resources MUST be recorded at entry granularity, not only file granularity.
63
+
64
+ Format:
65
+ - `file_path#tag/name`
66
+
67
+ Examples:
68
+ - `app/src/main/res/values/strings.xml#string/app_name`
69
+ - `app/src/main/res/values/colors.xml#color/primary`
70
+ - `app/src/main/res/values/dimens.xml#dimen/page_margin`
71
+ - `app/src/main/res/values/arrays.xml#string-array/province_names`
72
+ - `app/src/main/res/values/plurals.xml#plurals/items_count`
73
+
74
+ ### 3.3 Android System Resources
75
+
76
+ Android framework resources do not have a project-local file path. Record the reference itself as the path.
77
+
78
+ Examples:
79
+ - `@android:color/white`
80
+ - `@android:dimen/app_icon_size`
81
+ - `@android:drawable/ic_menu_close`
82
+
83
+ ### 3.4 Runtime Remote Resources
84
+
85
+ Remote resources are not Android `res/` files. Record them using code location plus the remote identifier when possible.
86
+
87
+ Examples:
88
+ - `app/src/main/java/com/example/home/HomeBanner.kt:88 -> https://...`
89
+ - `app/src/main/java/com/example/api/BannerDto.kt:35 -> remote_image_url`
90
+
91
+ If only the code location is known, record that and explain the limitation in `notes`.
92
+
93
+ ---
94
+
95
+ ## 4. Resource Name Rules
96
+
97
+ ### 4.1 File Resources
98
+
99
+ Use the Android resource name without qualifiers or extension.
100
+
101
+ Examples:
102
+ - `drawable/home_login_btn.png` → `home_login_btn`
103
+ - `mipmap-anydpi-v26/ic_launcher.xml` → `ic_launcher`
104
+
105
+ ### 4.2 `values` Resources
106
+
107
+ Use the XML entry's `name` attribute.
108
+
109
+ Examples:
110
+ - `<string name="app_name">` → `app_name`
111
+ - `<color name="primary">` → `primary`
112
+
113
+ ### 4.3 System Resources
114
+
115
+ Use the framework resource name after the slash.
116
+
117
+ Examples:
118
+ - `@android:color/white` → `white`
119
+ - `@android:dimen/app_icon_size` → `app_icon_size`
120
+
121
+ ---
122
+
123
+ ## 5. Function Field Rules
124
+
125
+ The `function` field should be short, concrete, and useful to a reviewer.
126
+
127
+ Recommended inference priority:
128
+
129
+ 1. **Explicit semantic name**
130
+ - If the resource name clearly indicates its role, use that.
131
+ - Examples:
132
+ - `logo` → `App logo`
133
+ - `ic_back` → `Back icon`
134
+ - `home_header_bg` → `Home header background`
135
+
136
+ 2. **Usage-site evidence**
137
+ - If the resource is referenced from a known screen or component, use that context.
138
+ - Examples:
139
+ - `Login page close icon`
140
+ - `Home tab selected background`
141
+
142
+ 3. **Resource type evidence**
143
+ - For XML drawables, infer from root element or role.
144
+ - Examples:
145
+ - `<shape>` → `Shape background`
146
+ - `<selector>` → `State selector drawable`
147
+ - `<layer-list>` → `Layered background`
148
+
149
+ 4. **Directory-role evidence**
150
+ - `mipmap` often means launcher or app icon resources.
151
+ - `font` often means app font resource.
152
+ - `xml` often means configuration resource.
153
+
154
+ 5. **Conservative fallback**
155
+ - If the exact role is uncertain, do not invent specifics.
156
+ - Examples:
157
+ - `Image resource (inferred from filename)`
158
+ - `Color resource used by UI styling`
159
+ - `Configuration XML resource`
160
+
161
+ If the function is inferred rather than certain, mention the evidence in `notes`.
162
+
163
+ ---
164
+
165
+ ## 6. Screen Attribution Rules
166
+
167
+ The `screens` field identifies which Android screen(s) use the resource.
168
+
169
+ This is a best-effort static analysis field. Use evidence; do not fabricate certainty.
170
+
171
+ ### 6.1 Screen Candidates
172
+
173
+ Build the candidate screen set from:
174
+ - Activities
175
+ - Fragments
176
+ - Compose screen / page / route files
177
+ - Navigation graph destinations
178
+ - Launcher entry activity
179
+
180
+ ### 6.2 Direct Reference Rule
181
+
182
+ If a screen file directly references:
183
+ - `R.drawable.xxx`
184
+ - `R.mipmap.xxx`
185
+ - `R.string.xxx`
186
+ - `R.color.xxx`
187
+ - `R.font.xxx`
188
+ - `R.xml.xxx`
189
+
190
+ then attribute the resource to that screen.
191
+
192
+ ### 6.3 Layout-Indirection Rule
193
+
194
+ If:
195
+ - a screen uses a layout file, and
196
+ - that layout file references resources,
197
+
198
+ then attribute those resources to that screen.
199
+
200
+ ### 6.4 Shared-Component Rule
201
+
202
+ If a shared component references a resource and that component is used by multiple screens:
203
+ - record all known screens, or
204
+ - use `Common` when the list is too broad to be helpful.
205
+
206
+ ### 6.5 Global-App Rule
207
+
208
+ Use one of the following fixed labels where appropriate:
209
+ - `Launcher` — launcher icon, round icon, adaptive icon
210
+ - `Global` — app-wide theme or identity resource
211
+ - `Common` — shared across many screens
212
+ - `Unknown` — insufficient evidence
213
+
214
+ ### 6.6 Output Format
215
+
216
+ The `screens` field may contain:
217
+ - a single screen, e.g. `HomeScreen`
218
+ - a comma-separated list, e.g. `HomeScreen, LoginScreen`
219
+ - one of the labels: `Launcher`, `Global`, `Common`, `Unknown`
220
+
221
+ ---
222
+
223
+ ## 7. Source Category Rules
224
+
225
+ The allowed source categories are:
226
+ - `应用自身资源`
227
+ - `项目内模块资源`
228
+ - `第三方库资源`
229
+ - `Android 系统资源`
230
+ - `运行时远程资源`
231
+
232
+ ### 7.1 应用自身资源
233
+
234
+ Use when the resource is confirmed to come from the app module itself.
235
+
236
+ Typical evidence:
237
+ - path under `app/src/.../res`
238
+ - path under the main application module
239
+ - source `res/` fallback found it directly in the app module
240
+
241
+ ### 7.2 项目内模块资源
242
+
243
+ Use when the resource comes from another local module in the same Android project.
244
+
245
+ Typical evidence:
246
+ - path under another local module such as `common/src/.../res`, `feature_xxx/src/.../res`
247
+ - local Gradle project dependency indicates the module belongs to the same repository
248
+
249
+ ### 7.3 第三方库资源
250
+
251
+ Use when the resource likely comes from an external dependency.
252
+
253
+ Typical evidence:
254
+ - resource exists only in the decoded APK, not in project source modules
255
+ - resource prefix matches common library conventions such as `abc_*`, `mtrl_*`, `design_*`, `material_*`
256
+ - build dependencies indicate a matching library
257
+
258
+ If the category is inferred, say so in `notes`.
259
+
260
+ ### 7.4 Android 系统资源
261
+
262
+ Use when the reference starts with `@android:`.
263
+
264
+ ### 7.5 运行时远程资源
265
+
266
+ Use when the asset is not packaged in `res/` and is instead fetched or constructed at runtime.
267
+
268
+ Typical evidence:
269
+ - URL-based image loading
270
+ - server-driven icon/image fields
271
+ - WebView / HTML / remote content assets
272
+
273
+ ---
274
+
275
+ ## 8. Type Category Rules
276
+
277
+ The primary required categories are:
278
+ - `drawable`
279
+ - `mipmap`
280
+ - `layout`
281
+ - `values`
282
+ - `xml`
283
+ - `font`
284
+
285
+ For required rows that do not originate from a concrete Android resource directory — such as runtime remote resources, resolved Android system references, and placeholder outputs created only to satisfy HarmonyOS references — normalize them into the closest review-friendly category instead of inventing a new top-level type category. In practice:
286
+ - value-like references (`string`, `color`, `dimen`, `integer`, `bool`, `array`, `plurals`) should use `values`
287
+ - runtime remote resources should use `xml` unless there is stronger evidence they behave like media assets
288
+ - placeholder media outputs should use `drawable`
289
+
290
+ ### 8.1 Normalization Rule
291
+
292
+ For qualified directories such as `drawable-hdpi`, `mipmap-anydpi-v26`, `values-zh-rCN`, strip qualifiers and record the base type.
293
+
294
+ Examples:
295
+ - `drawable-hdpi` → `drawable`
296
+ - `mipmap-anydpi-v26` → `mipmap`
297
+ - `values-night` → `values`
298
+
299
+ ### 8.2 `values` Rule
300
+
301
+ Even though `values/*.xml` entries have different subtypes (`string`, `color`, `dimen`, etc.), the required `type_category` remains `values`.
302
+
303
+ ### 8.3 Other Android Types
304
+
305
+ If the original Android type is not one of the six required categories (`raw`, `menu`, `anim`, `animator`, `color`, etc.), do NOT mislabel it. Use:
306
+ - the closest required category only if it is truly correct, otherwise
307
+ - keep the row in scope and explain the original Android type in `notes`
308
+
309
+ Recommended fallback in `notes`:
310
+ - `Original Android type: raw`
311
+ - `Original Android type: menu`
312
+
313
+ ### 8.4 Lottie Animation Special Case
314
+
315
+ Lottie JSON files live under Android `assets/` (passthrough) or `res/raw/` (raw type). Both normalize to HarmonyOS `rawfile/`. Record them with `type_category = raw` and identify the Lottie subtype in `notes` (`Lottie animation JSON`). Do NOT invent a new top-level `lottie` type category.
316
+
317
+ For each Lottie row:
318
+ - `source_category` follows the normal rules. Local Lottie under app/module `assets/` or `res/raw/` → `应用自身资源` or `项目内模块资源`. Runtime URL (`lottie_url` or code loading a `Uri`) → `运行时远程资源`.
319
+ - `screens` MUST identify the Activity/Fragment that plays the animation, using the evidence sources listed in `references/lottie-conversion-rules.md` (XML host layout → hosting Activity/Fragment, factory-call enclosing class, or picker navigation target). The `Screens` value is the Android host; the proposed HarmonyOS page name goes into `notes` as `page=<PageName>` (or into an optional `Suggested HarmonyOS Page` column if the mapping template exposes one).
320
+ - `function` should describe the animation's role, e.g. `Refresh loading animation`, `Splash intro animation`, `Wave background animation`.
321
+
322
+ See `references/lottie-conversion-rules.md` for the complete Lottie handling rules.
323
+
324
+ ---
325
+
326
+ ## 9. Mapping Kind Rules
327
+
328
+ Suggested `mapping_kind` values:
329
+ - `direct copy`
330
+ - `rename`
331
+ - `svg conversion`
332
+ - `layered-image conversion`
333
+ - `generated media`
334
+ - `merged into json`
335
+ - `lottie migration` — Lottie JSON copied from Android `assets/` or `res/raw/` to `rawfile/lottie/<normalized>.json`. Use in place of plain `direct copy` for Lottie assets so the row is easy to filter.
336
+ - `unmappable`
337
+ - `fallback applied`
338
+ - `placeholder created`
339
+ - `system resource resolved`
340
+ - `remote resource (no local target)`
341
+
342
+ Use the simplest accurate label.
343
+
344
+ ---
345
+
346
+ ## 10. One-to-One, One-to-Many, and Many-to-One Handling
347
+
348
+ ### 10.1 One-to-One
349
+
350
+ Example:
351
+ - `res/drawable/home_login_btn.png` → `entry/src/main/resources/base/media/home_login_btn.png`
352
+
353
+ Emit one mapping row.
354
+
355
+ ### 10.2 One-to-Many
356
+
357
+ Example: adaptive icon XML may produce:
358
+ - layered-image JSON
359
+ - generated solid-color PNG background
360
+
361
+ Emit multiple mapping rows that share the same Android resource path.
362
+
363
+ ### 10.3 Many-to-One
364
+
365
+ Example: multiple Android `values` files merge into one Harmony JSON file.
366
+
367
+ Still emit one mapping row per Android source entry.
368
+
369
+ Examples:
370
+ - `res/values/strings.xml#string/app_name` → `resources/base/element/string.json#app_name`
371
+ - `res/values/app_strings.xml#string/login_title` → `resources/base/element/string.json#login_title`
372
+
373
+ ### 10.4 No Harmony Target
374
+
375
+ When there is no valid Harmony target, use:
376
+ - `harmony_target = N/A`
377
+
378
+ And explain the reason in `notes`.
379
+
380
+ Examples:
381
+ - layout XML has no direct ArkUI equivalent
382
+ - remote resource is runtime-only
383
+ - unresolved third-party resource had no extracted target
384
+
385
+ ---
386
+
387
+ ## 11. Required Markdown Output Structure
388
+
389
+ The markdown written to `resource_mapping_path` MUST contain the following sections.
390
+
391
+ ### 11.1 Title
392
+
393
+ ```md
394
+ # Android Resources ↔ HarmonyOS Resources Mapping
395
+ ```
396
+
397
+ ### 11.2 Metadata
398
+
399
+ Include bullets for:
400
+ - `android_project_dir` (Android project path)
401
+ - `harmony_project_dir` (HarmonyOS project output path)
402
+ - Resource source
403
+ - Resource source path
404
+ - Decode result
405
+ - Generation timestamp
406
+
407
+ ### 11.3 Android Resource Inventory
408
+
409
+ Use a markdown table with at least these columns:
410
+ - `Android Resource Path`
411
+ - `Resource Name`
412
+ - `Function`
413
+ - `Screen(s)`
414
+ - `Source Category`
415
+ - `Type Category`
416
+ - `Status`
417
+ - `Notes`
418
+
419
+ ### 11.4 Android → HarmonyOS Mapping Details
420
+
421
+ Use a markdown table with at least these columns:
422
+ - `Android Resource Path`
423
+ - `Android Screen(s)`
424
+ - `Android Source Category`
425
+ - `Android Type Category`
426
+ - `HarmonyOS Target`
427
+ - `Mapping Kind`
428
+ - `Notes`
429
+
430
+ Every mapping row MUST include the Android-side screen/source/type fields.
431
+
432
+ ### 11.5 Unmapped / Unmappable / System / Remote Summary
433
+
434
+ Include a compact summary table or grouped bullets covering:
435
+ - resources with no direct HarmonyOS equivalent
436
+ - Android framework resources
437
+ - library-only resources inferred from dependencies or APK
438
+ - runtime remote resources
439
+
440
+ ### 11.5.1 Lottie Animation Table
441
+
442
+ If the project contains any Lottie animation JSONs (identified by structure signature per `references/lottie-conversion-rules.md`), include a dedicated table listing every detected animation. Required columns:
443
+
444
+ - `Android Source` — full path (e.g., `assets/AndroidWave.json`, `res/raw/lottielogo.json`, or `(remote) https://...`)
445
+ - `Target Rawfile Path` — `rawfile/lottie/<normalized>.json` or `N/A`
446
+ - `Host Activity/Fragment` — the Android class that plays the animation (or `Global` / `Launcher` / `Unknown`)
447
+ - `Host Layout / Loader` — the layout XML with `lottie_fileName` / `lottie_rawRes`, or the Kotlin/Java call site
448
+ - `Suggested HarmonyOS Page` — proposed ArkUI page name (e.g., `PlayerPage`)
449
+ - `Notes` — rename records, collision disambiguation, remote URL, or "no static references found"
450
+
451
+ This is the audit surface used by the HarmonyOS developer to wire `@ohos/lottie` calls to the correct pages. Never omit a detected Lottie asset from this table.
452
+
453
+ ### 11.6 Quick Findings
454
+
455
+ Provide short bullets highlighting review-relevant findings, such as:
456
+ - launcher icons coming from `mipmap`
457
+ - probable third-party library assets such as `abc_*` / `mtrl_*`
458
+ - resources found only in the decoded APK
459
+ - likely causes of icon or logo mismatches
460
+
461
+ ---
462
+
463
+ ## 12. Required Fallback Labels
464
+
465
+ Never leave required fields blank.
466
+
467
+ Use these fallback values where necessary:
468
+ - `screens` → `Unknown`
469
+ - `source_category` → best-evidence category; if still unclear, use `第三方库资源(推断)` or explain uncertainty in `notes`
470
+ - `type_category` → base Android type if valid, otherwise use the closest valid category only if correct and explain the original type in `notes`
471
+ - `harmony_target` → `N/A`
472
+ - `function` → conservative descriptive fallback
473
+
474
+ ---
475
+
476
+ ## 13. Hard Requirements
477
+
478
+ - Never silently omit an Android resource that the pipeline observed.
479
+ - `values` resources must be recorded at entry granularity.
480
+ - Mapping rows must preserve Android-side screen/source/type metadata.
481
+ - Unmappable, library-only, system, and remote resources must still appear in the mapping markdown.
482
+ - If a judgment is inferred rather than proven, say so in `notes`.