@ohos-cpf/3rdloop 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (389) hide show
  1. package/README.md +425 -0
  2. package/bin/3rdloop.mjs +48 -0
  3. package/lib/cli.js +741 -0
  4. package/lib/config.js +318 -0
  5. package/lib/doctor.js +114 -0
  6. package/lib/exit-codes.js +31 -0
  7. package/lib/opencode.js +156 -0
  8. package/lib/orch.js +427 -0
  9. package/lib/queries.js +264 -0
  10. package/lib/runner.js +979 -0
  11. package/lib/step.js +326 -0
  12. package/lib/ui.js +223 -0
  13. package/lib/workflow.js +291 -0
  14. package/lib/workflows.js +132 -0
  15. package/package.json +50 -0
  16. package/vendor/Server/Agent/SkillSelector/README.md +344 -0
  17. package/vendor/Server/Agent/SkillSelector/core/Agent.js +207 -0
  18. package/vendor/Server/Agent/SkillSelector/index.js +14 -0
  19. package/vendor/Server/Agent/SkillSelector/llm/llmClient.js +313 -0
  20. package/vendor/Server/Agent/SkillSelector/llm/prompts.js +161 -0
  21. package/vendor/Server/Agent/SkillSelector/llm/reactSteps.js +144 -0
  22. package/vendor/Server/Agent/SkillSelector/matcher/fuzzyMatcher.js +433 -0
  23. package/vendor/Server/Agent/SkillSelector/scanner/skillScanner.js +382 -0
  24. package/vendor/Server/Agent/SkillSelector/types.js +63 -0
  25. package/vendor/Server/Agent/SkillSelector/utils/actionWords.js +60 -0
  26. package/vendor/Server/Brain/AnalysisStrategies.js +422 -0
  27. package/vendor/Server/Brain/Brain.js +686 -0
  28. package/vendor/Server/Brain/DecompositionStrategies.js +621 -0
  29. package/vendor/Server/Brain/PlanPersistence.js +196 -0
  30. package/vendor/Server/Brain/SkillExecutor.js +251 -0
  31. package/vendor/Server/Brain/index.js +11 -0
  32. package/vendor/Server/CLI/cli.js +243 -0
  33. package/vendor/Server/CLI/opencode/index.js +804 -0
  34. package/vendor/Server/CLI/opencode.js +5 -0
  35. package/vendor/Server/DbUse/MessageArchive.js +61 -0
  36. package/vendor/Server/DbUse/StorageManager.js +107 -0
  37. package/vendor/Server/DbUse/adapters/BaseAdapter.js +94 -0
  38. package/vendor/Server/DbUse/adapters/FileAdapter.js +138 -0
  39. package/vendor/Server/DbUse/adapters/JsonAdapter.js +138 -0
  40. package/vendor/Server/DbUse/adapters/JsonlAdapter.js +114 -0
  41. package/vendor/Server/DbUse/adapters/SqliteAdapter.js +157 -0
  42. package/vendor/Server/DbUse/index.js +160 -0
  43. package/vendor/Server/DbUse/stores/SessionStore.js +279 -0
  44. package/vendor/Server/DbUse/stores/TaskExecutionStore.js +133 -0
  45. package/vendor/Server/DbUse/stores/TaskRegistryStore.js +262 -0
  46. package/vendor/Server/DbUse/stores/TaskStepStore.js +279 -0
  47. package/vendor/Server/FlexRunner/FlexRunner.js +1759 -0
  48. package/vendor/Server/FlexRunner/index.js +12 -0
  49. package/vendor/Server/Knowledge/KnowledgeImporter.js +523 -0
  50. package/vendor/Server/Knowledge/KnowledgeManager.js +341 -0
  51. package/vendor/Server/Knowledge/index.js +33 -0
  52. package/vendor/Server/LoopEngine/LoopEngine.js +1133 -0
  53. package/vendor/Server/LoopEngine/index.js +11 -0
  54. package/vendor/Server/Orchestrator/Orchestrator.js +1425 -0
  55. package/vendor/Server/Orchestrator/StepNode.js +312 -0
  56. package/vendor/Server/Orchestrator/index.js +13 -0
  57. package/vendor/Server/Routes/controllers/BrainController.js +241 -0
  58. package/vendor/Server/Routes/controllers/FlexRunnerController.js +1125 -0
  59. package/vendor/Server/Routes/controllers/HealthController.js +44 -0
  60. package/vendor/Server/Routes/controllers/KnowledgeImportController.js +355 -0
  61. package/vendor/Server/Routes/controllers/LoopEngineController.js +788 -0
  62. package/vendor/Server/Routes/controllers/OrchestratorController.js +911 -0
  63. package/vendor/Server/Routes/controllers/StatsController.js +57 -0
  64. package/vendor/Server/Routes/controllers/StreamController.js +67 -0
  65. package/vendor/Server/Routes/library/logger.js +179 -0
  66. package/vendor/Server/Routes/library/zipArchive.js +172 -0
  67. package/vendor/Server/Routes/router/Router.js +204 -0
  68. package/vendor/Server/Routes/routes/brain.js +47 -0
  69. package/vendor/Server/Routes/routes/flexrunner.js +72 -0
  70. package/vendor/Server/Routes/routes/health.js +28 -0
  71. package/vendor/Server/Routes/routes/index.js +57 -0
  72. package/vendor/Server/Routes/routes/knowledge.js +55 -0
  73. package/vendor/Server/Routes/routes/loopengine.js +58 -0
  74. package/vendor/Server/Routes/routes/orchestrator.js +61 -0
  75. package/vendor/Server/Routes/routes/registry.js +98 -0
  76. package/vendor/Server/Routes/routes/stats.js +23 -0
  77. package/vendor/Server/Routes/routes/stream.js +30 -0
  78. package/vendor/Server/Routes/server.js +202 -0
  79. package/vendor/Server/Routes/sse/SseHub.js +308 -0
  80. package/vendor/Server/Skills/acceptance-check/SKILL.md +174 -0
  81. package/vendor/Server/Skills/acceptance-check/references/PHASE1_ARTIFACT_COLLECTION.md +52 -0
  82. package/vendor/Server/Skills/acceptance-check/references/PHASE2_CRITERIA_EVALUATION.md +77 -0
  83. package/vendor/Server/Skills/arkts-code-check/SKILL.md +314 -0
  84. package/vendor/Server/Skills/arkts-code-check/references/CODE_CHECK_GUIDE.md +160 -0
  85. package/vendor/Server/Skills/arkts-code-check/references/FILE_TYPE_GUIDE.md +29 -0
  86. package/vendor/Server/Skills/arkts-code-check/references/PHASE1_INFO_COLLECTION.md +222 -0
  87. package/vendor/Server/Skills/arkts-code-check/references/REPORT_TEMPLATE.md +220 -0
  88. package/vendor/Server/Skills/arkts-library-compile-validate/SKILL.md +329 -0
  89. package/vendor/Server/Skills/arkts-library-compile-validate/scripts/build.ps1 +93 -0
  90. package/vendor/Server/Skills/arkts-library-compile-validate/scripts/code-linter.cjs +433 -0
  91. package/vendor/Server/Skills/arkts-library-compile-validate/scripts/migrate.cjs +851 -0
  92. package/vendor/Server/Skills/arkts-library-compile-validate/scripts/ohpm-switch.cjs +789 -0
  93. package/vendor/Server/Skills/arkts-library-demo-code/SKILL.md +291 -0
  94. package/vendor/Server/Skills/arkts-library-demo-code/references/API_SIGNATURE_CHECKS.md +68 -0
  95. package/vendor/Server/Skills/arkts-library-demo-code/references/BUILD_VALIDATION.md +184 -0
  96. package/vendor/Server/Skills/arkts-library-demo-code/references/CODE_STANDARDS.md +337 -0
  97. package/vendor/Server/Skills/arkts-library-demo-code/references/EXAMPLES.md +400 -0
  98. package/vendor/Server/Skills/arkts-library-demo-code/references/SYSTEM_API_LOOKUP.md +99 -0
  99. package/vendor/Server/Skills/arkts-library-demo-code/references/TEMPLATE.md +544 -0
  100. package/vendor/Server/Skills/arkts-library-demo-code/scripts/build.ps1 +93 -0
  101. package/vendor/Server/Skills/arkts-library-demo-code/scripts/code-linter.cjs +433 -0
  102. package/vendor/Server/Skills/arkts-library-demo-code/scripts/migrate.cjs +851 -0
  103. package/vendor/Server/Skills/arkts-library-demo-code/scripts/ohpm-switch.cjs +789 -0
  104. package/vendor/Server/Skills/arkts-library-demo-coverage/SKILL.md +174 -0
  105. package/vendor/Server/Skills/arkts-library-demo-scenario/SKILL.md +321 -0
  106. package/vendor/Server/Skills/arkts-library-demo-scenario/references/EXAMPLES.md +100 -0
  107. package/vendor/Server/Skills/arkts-library-demo-scenario/references/TEMPLATE.md +185 -0
  108. package/vendor/Server/Skills/arkts-library-documentation-quality-check/SKILL.md +234 -0
  109. package/vendor/Server/Skills/arkts-library-documentation-quality-check/assets/REPORT_TEMPLATE.md +103 -0
  110. package/vendor/Server/Skills/arkts-library-documentation-quality-check/references/CHECK_DIMENSIONS.md +89 -0
  111. package/vendor/Server/Skills/arkts-library-documentation-quality-check/references/COMPLIANCE_CHECKLIST.md +62 -0
  112. package/vendor/Server/Skills/arkts-library-documentation-quality-check/references/KB_QUERY_GUIDE.md +108 -0
  113. package/vendor/Server/Skills/arkts-library-documentation-quality-check/references/MCP_TOOL_DISCOVERY.md +124 -0
  114. package/vendor/Server/Skills/arkts-library-documentation-quality-check/references/REPORT_TEMPLATE.md +90 -0
  115. package/vendor/Server/Skills/arkts-library-documentation-quality-check/references/SCORING_FORMULA.md +57 -0
  116. package/vendor/Server/Skills/arkts-library-documentation-quality-check/scripts/validate-skill.cjs +259 -0
  117. package/vendor/Server/Skills/arkts-library-interface-spec/SKILL.md +97 -0
  118. package/vendor/Server/Skills/arkts-library-memory-leak-check/SKILL.md +392 -0
  119. package/vendor/Server/Skills/arkts-library-source-clone/SKILL.md +113 -0
  120. package/vendor/Server/Skills/arkts-library-stability-check/SKILL.md +313 -0
  121. package/vendor/Server/Skills/arkts-library-stability-check/assets/REPORT_TEMPLATE.md +154 -0
  122. package/vendor/Server/Skills/arkts-library-stability-check/references/CHECKLIST.md +166 -0
  123. package/vendor/Server/Skills/arkts-library-stability-check/references/CODE_EXAMPLES.md +309 -0
  124. package/vendor/Server/Skills/arkts-library-stability-check/references/SCORING_RULES.md +90 -0
  125. package/vendor/Server/Skills/arkts-library-stability-check/scripts/validate-skill.cjs +282 -0
  126. package/vendor/Server/Skills/arkts-library-test-coverage-check/SKILL.md +361 -0
  127. package/vendor/Server/Skills/arkts-library-test-coverage-check/assets/REPORT_TEMPLATE.md +146 -0
  128. package/vendor/Server/Skills/arkts-library-test-coverage-check/references/CHECKLIST.md +253 -0
  129. package/vendor/Server/Skills/arkts-library-test-coverage-check/references/MCP_TOOL_USAGE.md +115 -0
  130. package/vendor/Server/Skills/arkts-library-test-coverage-check/scripts/validate-skill.cjs +263 -0
  131. package/vendor/Server/Skills/arkts-library-xts-code/SKILL.md +455 -0
  132. package/vendor/Server/Skills/arkts-library-xts-code/assets/report-template.md +60 -0
  133. package/vendor/Server/Skills/arkts-library-xts-code/references/ACCESS_MODIFIER_PRECHECK.md +76 -0
  134. package/vendor/Server/Skills/arkts-library-xts-code/references/BUILD_VERIFICATION.md +200 -0
  135. package/vendor/Server/Skills/arkts-library-xts-code/references/CODE_STANDARDS.md +519 -0
  136. package/vendor/Server/Skills/arkts-library-xts-code/references/SUBAGENT_PROMPT_TEMPLATE.md +276 -0
  137. package/vendor/Server/Skills/arkts-library-xts-code/references/SYSTEM_API_LOOKUP.md +93 -0
  138. package/vendor/Server/Skills/arkts-library-xts-code/references/XTS_TEMPLATE.md +767 -0
  139. package/vendor/Server/Skills/arkts-library-xts-code/scripts/build.ps1 +93 -0
  140. package/vendor/Server/Skills/arkts-library-xts-code/scripts/code-linter.cjs +433 -0
  141. package/vendor/Server/Skills/arkts-library-xts-code/scripts/migrate.cjs +851 -0
  142. package/vendor/Server/Skills/arkts-library-xts-code/scripts/ohpm-switch.cjs +789 -0
  143. package/vendor/Server/Skills/arkts-library-xts-code/scripts/precheck-access-modifiers.cjs +221 -0
  144. package/vendor/Server/Skills/arkts-library-xts-code-fix/SKILL.md +229 -0
  145. package/vendor/Server/Skills/arkts-library-xts-coverage/SKILL.md +97 -0
  146. package/vendor/Server/Skills/arkts-library-xts-doc/SKILL.md +194 -0
  147. package/vendor/Server/Skills/arkts-library-xts-doc/references/EXAMPLES.md +576 -0
  148. package/vendor/Server/Skills/arkts-library-xts-doc/references/TEMPLATE.md +575 -0
  149. package/vendor/Server/Skills/arkts-library-xts-doc/references/TESTABILITY_GUIDE.md +182 -0
  150. package/vendor/Server/Skills/arkts-library-xts-execution/SKILL.md +491 -0
  151. package/vendor/Server/Skills/arkts-library-xts-execution/references/error-fixing-examples.md +217 -0
  152. package/vendor/Server/Skills/arkts-library-xts-execution/scripts/build.ps1 +93 -0
  153. package/vendor/Server/Skills/arkts-library-xts-execution/scripts/code-linter.cjs +433 -0
  154. package/vendor/Server/Skills/arkts-library-xts-execution/scripts/migrate.cjs +851 -0
  155. package/vendor/Server/Skills/arkts-library-xts-execution/scripts/ohpm-switch.cjs +789 -0
  156. package/vendor/Server/Skills/flutter-code-check/SKILL.md +299 -0
  157. package/vendor/Server/Skills/flutter-code-check/assets/OUTPUT_TEMPLATE.md +312 -0
  158. package/vendor/Server/Skills/flutter-code-check/references/CHECKLIST.md +190 -0
  159. package/vendor/Server/Skills/flutter-code-check/references/PLATFORMS.md +134 -0
  160. package/vendor/Server/Skills/flutter-code-check/scripts/validate-skill.cjs +259 -0
  161. package/vendor/Server/Skills/flutter-interface/README.md +75 -0
  162. package/vendor/Server/Skills/flutter-interface/SKILL.md +291 -0
  163. package/vendor/Server/Skills/flutter-interface/references/EXAMPLES.md +336 -0
  164. package/vendor/Server/Skills/flutter-interface/references/GIT_CLONE_GUIDE.md +190 -0
  165. package/vendor/Server/Skills/flutter-interface/references/SCRIPT_REFERENCE.md +258 -0
  166. package/vendor/Server/Skills/flutter-interface/references/TEMPLATE.md +254 -0
  167. package/vendor/Server/Skills/flutter-library-consistency-check/SKILL.md +518 -0
  168. package/vendor/Server/Skills/flutter-library-consistency-check/references/CHECKLIST.md +382 -0
  169. package/vendor/Server/Skills/flutter-library-consistency-check/references/FUNCTION_COMPARISON_GUIDE.md +342 -0
  170. package/vendor/Server/Skills/flutter-library-consistency-check/references/PLATFORM_LIMITATION_GUIDE.md +71 -0
  171. package/vendor/Server/Skills/flutter-library-documentation-quality-check/SKILL.md +519 -0
  172. package/vendor/Server/Skills/flutter-library-documentation-quality-check/references/CHECKLIST.md +407 -0
  173. package/vendor/Server/Skills/flutter-library-memory-leak-check/SKILL.md +653 -0
  174. package/vendor/Server/Skills/flutter-library-memory-leak-check/references/CHECKLIST.md +397 -0
  175. package/vendor/Server/Skills/flutter-library-stability-check/SKILL.md +745 -0
  176. package/vendor/Server/Skills/flutter-library-stability-check/references/CHECKLIST.md +721 -0
  177. package/vendor/Server/Skills/flutter-library-test-coverage-check/SKILL.md +414 -0
  178. package/vendor/Server/Skills/flutter-library-test-coverage-check/assets/REPORT_TEMPLATE.md +150 -0
  179. package/vendor/Server/Skills/flutter-library-test-coverage-check/references/CHECKLIST.md +304 -0
  180. package/vendor/Server/Skills/flutter-library-test-coverage-check/references/SCORING_RULES.md +265 -0
  181. package/vendor/Server/Skills/flutter-library-test-coverage-check/references/SCRIPT_USAGE.md +286 -0
  182. package/vendor/Server/Skills/knowledge-import/SKILL.md +383 -0
  183. package/vendor/Server/Skills/knowledge-import/references/MCP_TOOL_USAGE.md +165 -0
  184. package/vendor/Server/Skills/knowledge-import/references/SKILL_LOCATOR_GUIDE.md +91 -0
  185. package/vendor/Server/Skills/knowledge-import/references/SKILL_OPTIMIZATION_GUIDE.md +127 -0
  186. package/vendor/Server/Skills/ohos-lib-pr-push/SKILL.md +301 -0
  187. package/vendor/Server/Skills/ohos-lib-pr-push/assets/PR_ISSUE_TEMPLATE.md +105 -0
  188. package/vendor/Server/Skills/ohos-lib-pr-push/references/GITCODE_API.md +127 -0
  189. package/vendor/Server/Skills/ohos-lib-pr-push/scripts/gitcode-api.cjs +208 -0
  190. package/vendor/Server/Skills/rn-code-check/SKILL.md +321 -0
  191. package/vendor/Server/Skills/rn-code-check/references/API-GUIDE.md +235 -0
  192. package/vendor/Server/Skills/rn-code-check/references/CHECKLIST.md +189 -0
  193. package/vendor/Server/Skills/rn-code-check/references/REPORT-TEMPLATE.md +247 -0
  194. package/vendor/Server/Skills/rn-lib-add-example/SKILL.md +198 -0
  195. package/vendor/Server/Skills/rn-lib-add-example/references/APP_RENAME_GUIDE.md +40 -0
  196. package/vendor/Server/Skills/rn-lib-add-example/references/SHELL_ADAPTATION_CHECKLIST.md +78 -0
  197. package/vendor/Server/Skills/rn-lib-add-example/references/TEMPLATE_REPO_GUIDE.md +70 -0
  198. package/vendor/Server/Skills/rn-lib-add-example/references/VERIFICATION_GUIDE.md +47 -0
  199. package/vendor/Server/Skills/rn-lib-add-example/scripts/create-example.cjs +252 -0
  200. package/vendor/Server/Skills/rn-lib-update-doc/SKILL.md +176 -0
  201. package/vendor/Server/Skills/rn-lib-update-doc/config.json +5 -0
  202. package/vendor/Server/Skills/rn-lib-update-doc/references/changelog-template.md +35 -0
  203. package/vendor/Server/Skills/rn-lib-update-doc/references/format-diff.md +137 -0
  204. package/vendor/Server/Skills/rn-lib-update-doc/references/link-registry.json +33 -0
  205. package/vendor/Server/Skills/rn-lib-update-doc/references/model-0.4.2-overview.md +40 -0
  206. package/vendor/Server/Skills/rn-lib-update-doc/references/model-0.4.2.md +429 -0
  207. package/vendor/Server/Skills/rn-lib-update-doc/scripts/detect-readme-format.cjs +105 -0
  208. package/vendor/Server/Skills/rn-lib-update-doc/scripts/find-usage-doc.cjs +90 -0
  209. package/vendor/Server/Skills/rn-lib-update-doc/scripts/link-verify.cjs +213 -0
  210. package/vendor/Server/Skills/rn-lib-update-doc/scripts/normalize-changelog.cjs +73 -0
  211. package/vendor/Server/Skills/rn-lib-update-doc/scripts/normalize-package-meta.cjs +258 -0
  212. package/vendor/Server/Skills/rn-lib-update-doc/scripts/normalize-readme-links.cjs +341 -0
  213. package/vendor/Server/Skills/rn-lib-update-doc/scripts/resolve-usage-docs.cjs +67 -0
  214. package/vendor/Server/Skills/rn-library-consistency-check/SKILL.md +299 -0
  215. package/vendor/Server/Skills/rn-library-consistency-check/assets/REPORT_TEMPLATE.md +293 -0
  216. package/vendor/Server/Skills/rn-library-consistency-check/references/ARKTS_COMPONENT_CHECK_GUIDE.md +857 -0
  217. package/vendor/Server/Skills/rn-library-consistency-check/references/ARKTS_TURBOMODULE_CHECK_GUIDE.md +856 -0
  218. package/vendor/Server/Skills/rn-library-consistency-check/references/CHECKLIST.md +157 -0
  219. package/vendor/Server/Skills/rn-library-consistency-check/references/CPP_COMPONENT_CHECK_GUIDE.md +801 -0
  220. package/vendor/Server/Skills/rn-library-consistency-check/references/CPP_TURBOMODULE_CHECK_GUIDE.md +684 -0
  221. package/vendor/Server/Skills/rn-library-consistency-check/references/FUNCTION_COMPARISON_GUIDE.md +233 -0
  222. package/vendor/Server/Skills/rn-library-consistency-check/references/NATIVE_COMPONENT_IDENTIFICATION.md +1373 -0
  223. package/vendor/Server/Skills/rn-library-consistency-check/references/SCORING_STANDARD.md +220 -0
  224. package/vendor/Server/Skills/rn-library-consistency-check/scripts/validate-skill.py +245 -0
  225. package/vendor/Server/Skills/rn-library-documentation-quality-check/SKILL.md +263 -0
  226. package/vendor/Server/Skills/rn-library-documentation-quality-check/assets/MODEL.md +414 -0
  227. package/vendor/Server/Skills/rn-library-documentation-quality-check/assets/MODEL_en.md +413 -0
  228. package/vendor/Server/Skills/rn-library-documentation-quality-check/assets/REPORT_TEMPLATE.md +311 -0
  229. package/vendor/Server/Skills/rn-library-documentation-quality-check/references/CHECK_CHECKLIST.md +355 -0
  230. package/vendor/Server/Skills/rn-library-documentation-quality-check/references/CROSS_VALIDATION_GUIDE.md +115 -0
  231. package/vendor/Server/Skills/rn-library-documentation-quality-check/references/DOC_COLLECTION_GUIDE.md +139 -0
  232. package/vendor/Server/Skills/rn-library-documentation-quality-check/references/EXAMPLES.md +586 -0
  233. package/vendor/Server/Skills/rn-library-documentation-quality-check/references/GOTCHAS.md +57 -0
  234. package/vendor/Server/Skills/rn-library-documentation-quality-check/scripts/validate-skill.py +259 -0
  235. package/vendor/Server/Skills/rn-library-interface-analyzer/SKILL.md +301 -0
  236. package/vendor/Server/Skills/rn-library-interface-analyzer/assets/REPORT_TEMPLATE.md +148 -0
  237. package/vendor/Server/Skills/rn-library-interface-analyzer/references/DOC_ANNOTATION_GUIDE.md +118 -0
  238. package/vendor/Server/Skills/rn-library-interface-analyzer/references/SCRIPT_USAGE_GUIDE.md +168 -0
  239. package/vendor/Server/Skills/rn-library-interface-analyzer/references/URL_PARSING_RULES.md +176 -0
  240. package/vendor/Server/Skills/rn-library-issue-generalizer/SKILL.md +274 -0
  241. package/vendor/Server/Skills/rn-library-issue-generalizer/assets/case-template.md +45 -0
  242. package/vendor/Server/Skills/rn-library-issue-generalizer/assets/rule-template.md +25 -0
  243. package/vendor/Server/Skills/rn-library-issue-generalizer/references/PR_FETCH_GUIDE.md +61 -0
  244. package/vendor/Server/Skills/rn-library-issue-generalizer/references/RULE_TEMPLATE_GUIDE.md +165 -0
  245. package/vendor/Server/Skills/rn-library-issue-generalizer/scripts/fetch-pr-info.py +239 -0
  246. package/vendor/Server/Skills/rn-library-known-issue-check/SKILL.md +263 -0
  247. package/vendor/Server/Skills/rn-library-known-issue-check/assets/REPORT_TEMPLATE.md +96 -0
  248. package/vendor/Server/Skills/rn-library-known-issue-check/references/COMPLIANCE_CHECKLIST.md +58 -0
  249. package/vendor/Server/Skills/rn-library-known-issue-check/references/INSPECTION_GUIDE.md +99 -0
  250. package/vendor/Server/Skills/rn-library-known-issue-check/references/PRESCREEN_GUIDE.md +64 -0
  251. package/vendor/Server/Skills/rn-library-known-issue-check/references/SOURCE_PREP_GUIDE.md +75 -0
  252. package/vendor/Server/Skills/rn-library-known-issue-check/scripts/validate-known-issue-report.py +164 -0
  253. package/vendor/Server/Skills/rn-library-memory-leak-check/SKILL.md +339 -0
  254. package/vendor/Server/Skills/rn-library-memory-leak-check/assets/REPORT_TEMPLATE.md +83 -0
  255. package/vendor/Server/Skills/rn-library-memory-leak-check/references/CHECKLIST.md +859 -0
  256. package/vendor/Server/Skills/rn-library-memory-leak-check/references/HARMONY_CODE_PATTERNS.md +122 -0
  257. package/vendor/Server/Skills/rn-library-memory-leak-check/scripts/scan_harmony_code.py +279 -0
  258. package/vendor/Server/Skills/rn-library-stability-check/SKILL.md +273 -0
  259. package/vendor/Server/Skills/rn-library-stability-check/assets/REPORT_TEMPLATE.md +129 -0
  260. package/vendor/Server/Skills/rn-library-stability-check/references/CHECKLIST.md +581 -0
  261. package/vendor/Server/Skills/rn-library-stability-check/references/SCORING_RULES.md +138 -0
  262. package/vendor/Server/Skills/rn-library-stability-check/scripts/scan-harmony-code.py +168 -0
  263. package/vendor/Server/Skills/rn-library-test-coverage-check/SKILL.md +506 -0
  264. package/vendor/Server/Skills/rn-library-test-coverage-check/references/CHECKLIST.md +280 -0
  265. package/vendor/Server/Skills/rn-library-test-coverage-check/references/DEMO_LOCATION.md +221 -0
  266. package/vendor/Server/Skills/rn-library-test-coverage-check/references/REPORT_TEMPLATE.md +209 -0
  267. package/vendor/Server/Skills/rn-library-test-coverage-check/references/SCRIPT_USAGE.md +325 -0
  268. package/vendor/Server/Skills/rn-ohos-xts-generator/SKILL.md +279 -0
  269. package/vendor/Server/Skills/rn-ohos-xts-generator/assets/TEST_FILE_TEMPLATES.md +404 -0
  270. package/vendor/Server/Skills/rn-ohos-xts-generator/references/BUILD_TROUBLESHOOTING.md +185 -0
  271. package/vendor/Server/Skills/rn-ohos-xts-generator/references/BUILD_WORKFLOW.md +265 -0
  272. package/vendor/Server/Skills/rn-ohos-xts-generator/references/COMMON_CONFIG.md +189 -0
  273. package/vendor/Server/Skills/rn-ohos-xts-generator/references/CONFIG_GUIDE.md +203 -0
  274. package/vendor/Server/Skills/rn-ohos-xts-generator/references/COVERAGE_ANALYZER.md +147 -0
  275. package/vendor/Server/Skills/rn-ohos-xts-generator/references/DESIGN_DOC_GUIDE.md +148 -0
  276. package/vendor/Server/Skills/rn-ohos-xts-generator/references/GENERATION_FLOW.md +165 -0
  277. package/vendor/Server/Skills/rn-ohos-xts-generator/references/GENERATION_STRATEGY.md +195 -0
  278. package/vendor/Server/Skills/rn-ohos-xts-generator/references/HARMONY_SCANNER.md +249 -0
  279. package/vendor/Server/Skills/rn-ohos-xts-generator/references/JEST_FRAMEWORK.md +235 -0
  280. package/vendor/Server/Skills/rn-ohos-xts-generator/references/PLATFORM_COMPAT.md +161 -0
  281. package/vendor/Server/Skills/rn-ohos-xts-generator/references/RN_TEST_PATTERNS.md +413 -0
  282. package/vendor/Server/Skills/rn-ohos-xts-generator/references/SOURCE_PARSER.md +235 -0
  283. package/vendor/Server/Skills/rn-ohos-xts-generator/references/TEST_CONVENTIONS.md +245 -0
  284. package/vendor/Server/Skills/rn-ohos-xts-generator/references/TROUBLESHOOTING.md +282 -0
  285. package/vendor/Server/Skills/rn-ohos-xts-generator/references/USAGE_GUIDE.md +251 -0
  286. package/vendor/Server/Skills/rnoh-cptf-api-test/SKILL.md +469 -0
  287. package/vendor/Server/Skills/rnoh-cptf-api-test/assets/CPTF_TEST_TEMPLATE.md +310 -0
  288. package/vendor/Server/Skills/rnoh-cptf-api-test/assets/DEMO_PAGE_TEMPLATE.md +303 -0
  289. package/vendor/Server/Skills/rnoh-cptf-api-test/references/CPTF_TEST_GENERATION_GUIDE.md +421 -0
  290. package/vendor/Server/Skills/rnoh-cptf-api-test/references/DEMO_GENERATION_GUIDE.md +358 -0
  291. package/vendor/Server/Skills/rnoh-cptf-api-test/references/QUALITY_CHECKLIST.md +114 -0
  292. package/vendor/Server/Skills/rnoh-cptf-api-test/references/SPEC_PARSING_GUIDE.md +274 -0
  293. package/vendor/Server/Skills/rnoh-cptf-api-test/scripts/validate-rnoh-cptf-api-test.sh +185 -0
  294. package/vendor/Server/Skills/rnoh-cptf-demo-test/SKILL.md +191 -0
  295. package/vendor/Server/Skills/rnoh-cptf-demo-test/assets/TEST_TEMPLATE.md +216 -0
  296. package/vendor/Server/Skills/rnoh-cptf-demo-test/references/CPTF_SETUP.md +107 -0
  297. package/vendor/Server/Skills/rnoh-cptf-demo-test/references/DEMO_ANALYSIS.md +120 -0
  298. package/vendor/Server/Skills/rnoh-cptf-demo-test/scripts/validate-rnoh-cptf-test.sh +108 -0
  299. package/vendor/Server/Skills/rnoh-cptf-test-run/SKILL.md +237 -0
  300. package/vendor/Server/Skills/rnoh-cptf-test-run/references/DEBUG_PLAYBOOK.md +261 -0
  301. package/vendor/Server/Skills/rnoh-cptf-test-run/scripts/validate-run-env.sh +112 -0
  302. package/vendor/Server/Skills/rnoh-lib-code-adapt/SKILL.md +498 -0
  303. package/vendor/Server/Skills/rnoh-lib-code-adapt/references/adapt-checklist.md +270 -0
  304. package/vendor/Server/Skills/rnoh-lib-code-adapt/references/api-migration-checklist.md +164 -0
  305. package/vendor/Server/Skills/rnoh-lib-code-adapt/references/common-compile-errors.md +556 -0
  306. package/vendor/Server/Skills/rnoh-lib-code-adapt/references/deveco-cli-tools.md +459 -0
  307. package/vendor/Server/Skills/rnoh-lib-code-adapt/references/edge-cases.md +65 -0
  308. package/vendor/Server/Skills/rnoh-lib-code-adapt/references/har-tgz-build.md +512 -0
  309. package/vendor/Server/Skills/rnoh-lib-code-adapt/references/version-compat-matrix.md +132 -0
  310. package/vendor/Server/Skills/rnoh-lib-code-adapt/scripts/auto-integrate.sh +424 -0
  311. package/vendor/Server/Skills/rnoh-lib-demo-coverage/SKILL.md +137 -0
  312. package/vendor/Server/Skills/rnoh-lib-demo-create/SKILL.md +306 -0
  313. package/vendor/Server/Skills/rnoh-lib-demo-create/assets/DEMO_PAGE_TEMPLATE.md +485 -0
  314. package/vendor/Server/Skills/rnoh-lib-demo-create/assets/INDEX_TEMPLATE.md +172 -0
  315. package/vendor/Server/Skills/rnoh-lib-demo-create/references/DEMO_CODE_RULES.md +422 -0
  316. package/vendor/Server/Skills/rnoh-lib-demo-create/references/QUALITY_CHECKLIST.md +95 -0
  317. package/vendor/Server/Skills/rnoh-lib-demo-create/references/SOURCE_EXPLORATION.md +169 -0
  318. package/vendor/Server/Skills/rnoh-lib-demo-doc/SKILL.md +554 -0
  319. package/vendor/Server/Skills/rnoh-lib-demo-doc/assets/DEMO_DOC_TEMPLATE.md +106 -0
  320. package/vendor/Server/Skills/rnoh-lib-demo-doc/references/COVERAGE_INCREMENTAL.md +216 -0
  321. package/vendor/Server/Skills/rnoh-lib-demo-doc/references/DEMO_DESIGN_RULES.md +413 -0
  322. package/vendor/Server/Skills/rnoh-lib-demo-doc/references/OUTPUT_FORMAT.md +269 -0
  323. package/vendor/Server/Skills/rnoh-lib-demo-doc/references/QUALITY_CHECKLIST.md +98 -0
  324. package/vendor/Server/Skills/rnoh-lib-func-test/SKILL.md +337 -0
  325. package/vendor/Server/Skills/rnoh-lib-rnt-search/SKILL.md +722 -0
  326. package/vendor/Server/Skills/rnoh-lib-rnt-search/assets/PORT_REPORT_TEMPLATE.md +219 -0
  327. package/vendor/Server/Skills/rnoh-lib-rnt-search/references/DEMO_PORTING_GUIDE.md +345 -0
  328. package/vendor/Server/Skills/rnoh-lib-rnt-search/references/PORT_VERIFICATION.md +269 -0
  329. package/vendor/Server/Skills/rnoh-lib-rnt-search/references/RNT_PROJECT_STRUCTURE.md +173 -0
  330. package/vendor/Server/Skills/rnoh-lib-rnt-search/scripts/analyze-demo-deps.cjs +267 -0
  331. package/vendor/Server/Skills/rnoh-lib-rnt-search/scripts/detect-rnoh-version.cjs +174 -0
  332. package/vendor/Server/Skills/rnoh-lib-rnt-search/scripts/find-rnt-demo.sh +111 -0
  333. package/vendor/Server/Skills/rnoh-lib-rnt-search/scripts/port-demo.sh +186 -0
  334. package/vendor/Server/Skills/rnoh-lib-rnt-search/scripts/read-lib-meta.cjs +150 -0
  335. package/vendor/Server/Skills/rnoh-lib-test-align/SKILL.md +296 -0
  336. package/vendor/Server/Skills/rnoh-lib-test-align/references/jest-troubleshooting.md +371 -0
  337. package/vendor/Server/Skills/rnoh-lib-test-align/references/port-test-demo-guide.md +212 -0
  338. package/vendor/Server/Skills/rnoh-lib-test-align/references/runtime-troubleshooting.md +345 -0
  339. package/vendor/Server/Skills/rnoh-lib-test-align/references/unit-test-template.md +223 -0
  340. package/vendor/Server/Skills/rnoh-lib-test-align/scripts/port-test-demo.sh +1053 -0
  341. package/vendor/Server/Skills/rnoh-lib-version-diff/SKILL.md +255 -0
  342. package/vendor/Server/Skills/rnoh-lib-version-diff/references/OHOS_ADAPTATION.md +77 -0
  343. package/vendor/Server/Skills/rnoh-lib-version-diff/references/OHOS_API_LOOKUP.md +224 -0
  344. package/vendor/Server/Skills/rnoh-lib-version-diff/references/script-reference.md +174 -0
  345. package/vendor/Server/Skills/rnoh-lib-version-diff/scripts/detect-upstream-version.js +967 -0
  346. package/vendor/Server/Skills/rnoh-lib-version-diff/scripts/generate-diff.js +1798 -0
  347. package/vendor/Server/Skills/rnoh-lib-version-diff/scripts/package.json +5 -0
  348. package/vendor/Server/Skills/rnoh-lib-version-diff/templates/report-template.md +137 -0
  349. package/vendor/Server/Skills/rnoh-lib-xts-coverage/SKILL.md +145 -0
  350. package/vendor/Server/Skills/skill-generator/SKILL.md +365 -0
  351. package/vendor/Server/Skills/skill-generator/assets/SKILL_TEMPLATE.md +183 -0
  352. package/vendor/Server/Skills/skill-generator/references/COMPLIANCE_CHECKLIST.md +82 -0
  353. package/vendor/Server/Skills/skill-generator/references/KB_QUERY_GUIDE.md +110 -0
  354. package/vendor/Server/Skills/skill-generator/references/MCP_TOOL_DISCOVERY.md +122 -0
  355. package/vendor/Server/Skills/skill-generator/references/SKILL_SPEC.md +121 -0
  356. package/vendor/Server/Skills/skill-generator/scripts/validate-skill.cjs +259 -0
  357. package/vendor/Server/Skills/task-analysis/SKILL.md +234 -0
  358. package/vendor/Server/Skills/task-analysis/assets/OUTPUT_EXAMPLES.md +160 -0
  359. package/vendor/Server/Skills/task-analysis/references/ACCEPTANCE_CRITERIA_GUIDE.md +190 -0
  360. package/vendor/Server/Skills/task-analysis/references/ANALYSIS_SCHEMA.md +224 -0
  361. package/vendor/Server/Skills/task-analysis/references/INTEGRATION_CONTEXT.md +162 -0
  362. package/vendor/Server/Skills/task-analysis/references/LESSONS_LEARNED.md +55 -0
  363. package/vendor/Server/Skills/task-analysis/references/REPLAN_CONTEXT_GUIDE.md +126 -0
  364. package/vendor/Server/Skills/task-analysis/scripts/validate-analysis-output.sh +256 -0
  365. package/vendor/Server/Skills/task-decomposition/SKILL.md +529 -0
  366. package/vendor/Server/Skills/task-decomposition/assets/OUTPUT_EXAMPLES.md +451 -0
  367. package/vendor/Server/Skills/task-decomposition/references/ACCEPTANCE_CRITERIA_GUIDE.md +179 -0
  368. package/vendor/Server/Skills/task-decomposition/references/DEPENDENCY_GRAPH_GUIDE.md +152 -0
  369. package/vendor/Server/Skills/task-decomposition/references/INTEGRATION_CONTEXT.md +175 -0
  370. package/vendor/Server/Skills/task-decomposition/references/REPLAN_CONTEXT_GUIDE.md +195 -0
  371. package/vendor/Server/Skills/task-decomposition/references/TASK_DECOMPOSITION_TEMPLATES.md +226 -0
  372. package/vendor/Server/Skills/task-decomposition/scripts/list-available-skills.cjs +263 -0
  373. package/vendor/Server/Skills/task-decomposition/scripts/skill-blacklist.json +29 -0
  374. package/vendor/Server/Skills/task-decomposition/scripts/validate-decomposition-output.cjs +376 -0
  375. package/vendor/Server/Skills/task-decomposition/scripts/validate-param-consistency.cjs +259 -0
  376. package/vendor/Server/Skills/task-decomposition/scripts/validate-specified-skills.cjs +216 -0
  377. package/vendor/Server/Skills/task-decomposition/scripts/validate-step-graph.cjs +425 -0
  378. package/vendor/Server/Skills/tpc-cpp-check/SKILL.md +427 -0
  379. package/vendor/Server/Skills/tpc-cpp-check/references/CHECKLIST.md +214 -0
  380. package/vendor/Server/Skills/tpc-cpp-check/references/HPKBUILD_GUIDE.md +235 -0
  381. package/vendor/Server/Skills/tpc-cpp-check/references/REPORT_TEMPLATE.md +250 -0
  382. package/vendor/Server/TestCheck/TestCheck.js +775 -0
  383. package/vendor/Server/TestCheck/index.js +11 -0
  384. package/vendor/Server/library/McpToolGuide.js +280 -0
  385. package/vendor/Server/library/StatsService.js +127 -0
  386. package/vendor/Server/library/cstTime.js +16 -0
  387. package/vendor/Server/package.json +17 -0
  388. package/vendor/VERSION +3 -0
  389. package/workflows/pr-check.mjs +106 -0
@@ -0,0 +1,122 @@
1
+ # 鸿蒙化代码特征识别模式
2
+
3
+ > 本文档详细列出 Phase 0 中用于识别 RN 三方库鸿蒙化实现代码的特征模式,包括 RN JS 三方库判定、ArkTS/ETS 层特征、C++ Native 层特征及常见目录结构。
4
+
5
+ ---
6
+
7
+ ## 1. RN JS 三方库判定
8
+
9
+ 扫描源码 ts、js 和 tsx 文件,识别是否**不包含**以下 RN 鸿蒙化特征。若不包含,则判定为 **RNJS 三方库**,不进行后续内存泄露检视,直接输出报告评分 0 分,标注"RNJS 三方库"。
10
+
11
+ **ts、js 和 tsx 文件代码特征**:
12
+
13
+ ```typescript
14
+ // 特征 1:TurboModule 模块导入
15
+ import { TurboModuleRegistry } from 'react-native';
16
+ TurboModuleRegistry.getEnforcing<Spec>('Xxx');
17
+
18
+ // 特征 2:NativeModules 模块导入
19
+ import { NativeModules } from 'react-native';
20
+ NativeModules.xxxTurboModule;
21
+
22
+ // 特征 3:Native Component 组件导入
23
+ import codegenNativeComponent from 'xxxx'
24
+ codegenNativeComponent<NativeProps>(
25
+ 'Xxxx'
26
+ ) as HostComponent<NativeProps>;
27
+ ```
28
+
29
+ ---
30
+
31
+ ## 2. ArkTS/ETS 代码特征
32
+
33
+ ```typescript
34
+ // 特征 1:@ohos 模块导入
35
+ import ble from '@ohos.bluetooth';
36
+ import geoLocationManager from '@ohos.geoLocationManager';
37
+
38
+ // 特征 2:RN TurboModule 鸿蒙实现
39
+ class XxxTurboModule extends TurboModule {
40
+ // ...
41
+ }
42
+
43
+ // 特征 3:RN NativeComponent 鸿蒙实现
44
+ @Component
45
+ export struct RNCWebView {
46
+ // ...
47
+ }
48
+
49
+ // 特征 4:RN Bridge 事件机制
50
+ this.eventEmitter = new NativeEventEmitter(xxxNativeModule);
51
+ this.deviceEventEmitter.addListener('xxx', callback);
52
+
53
+ // 特征 5:.ets 文件扩展名
54
+ *.ets // ArkTS 文件
55
+ ```
56
+
57
+ ---
58
+
59
+ ## 3. C++ Native 代码特征
60
+
61
+ ```cpp
62
+ // 特征 1:包括但不仅限于以下头文件
63
+ #include "RNOH/CppComponentInstance.h" // 关键 RN 组件头文件
64
+ #include <napi/native_api.h>
65
+ #include <ReactCommon/TurboModule.h>
66
+
67
+ // 特征 2:含有 CppComponentInstance
68
+ class XxxxxxComponentInstance
69
+ : public CppComponentInstance<> {
70
+ }
71
+
72
+ // 特征 3:TurboModule/JSI 特征
73
+ class XxxTurboModule : public TurboModule {
74
+ // JSI HostFunction / HostObject
75
+ };
76
+
77
+ // 特征 4:NAPI 函数调用
78
+ napi_create_reference(env, value, 1, &ref);
79
+ napi_wrap(env, jsThis, nativePtr, finalizeCb, nullptr, &ref);
80
+ ```
81
+
82
+ ---
83
+
84
+ ## 4. 常见鸿蒙化目录结构
85
+
86
+ > ⚠️ 目录名称仅供参考,**不作为唯一判定依据**。必须通过代码特征交叉验证。
87
+
88
+ ```
89
+ 常见目录名称:
90
+ ├── harmony/ # 最常见
91
+ ├── ohos/ # 部分库使用
92
+ ├── harmonyos/ # 部分库使用
93
+ ├── example/ # 示例代码 ❌ 不检视
94
+ ├── android/ # Android 实现 ❌ 不检视
95
+ ├── ios/ # iOS 实现 ❌ 不检视
96
+ ├── js/ # RN JS 层 ❌ 不检视
97
+ ```
98
+
99
+ ---
100
+
101
+ ## 5. 判定规则
102
+
103
+ | 条件 | 判定结果 |
104
+ |------|----------|
105
+ | 扫描到 `@ohos` 模块导入、TurboModule/JSI 实现或 NAPI 函数调用 | 确认鸿蒙化实现,进入 Phase 1 |
106
+ | 存在 `.ets` 文件且包含鸿蒙 API 调用或 RN 组件实现 | 确认鸿蒙化实现,进入 Phase 1 |
107
+ | 扫描整个源码均未发现鸿蒙代码特征 | 报告评分 0 分,标注"未实现鸿蒙化" |
108
+ | 源码不包含 TurboModuleRegistry/NativeModules/codegenNativeComponent 特征 | 判定为 RNJS 三方库,评分 0 分 |
109
+
110
+ ---
111
+
112
+ ## 6. RN 鸿蒙化架构关键差异
113
+
114
+ > 与 Flutter 对比,理解 RN 鸿蒙化的核心架构概念。
115
+
116
+ | 概念 | Flutter | React Native |
117
+ |------|---------|-------------|
118
+ | 插件注册 | FlutterPlugin | TurboModule / NativeModule |
119
+ | 通信机制 | MethodChannel | Bridge / JSI / TurboModule |
120
+ | UI 组件 | Flutter Widget | NativeComponent(ViewManager) |
121
+ | 事件系统 | EventChannel | NativeEventEmitter / RCTEventEmitter |
122
+ | 生命周期 | onAttached/DetachedFromEngine | constructor/__onDestroy__(TurboModule)/ aboutToAppear/aboutToDisappear(NativeComponent) |
@@ -0,0 +1,279 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ * Copyright (C) 2025 Huawei Device Co., Ltd.
4
+ * Licensed under the Apache License, Version 2.0 (the 'License');
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an 'AS IS' BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ """
16
+ # @tool scan-harmony-code
17
+ # @description 扫描 RN 三方库源码,识别鸿蒙化实现代码特征(ArkTS/ETS + C++ NAPI),输出文件列表和特征匹配结果
18
+ # @param sourceDir: string - 源码根目录路径(通常为 {outputDir}/source)
19
+
20
+ """
21
+ Harmony Code Scanner Script
22
+ 扫描 RN 三方库源码,识别鸿蒙化实现代码特征。
23
+ 跨平台实现(仅依赖 Python 标准库),支持 Windows/macOS/Linux。
24
+ """
25
+
26
+ import sys
27
+ import os
28
+ import re
29
+ import json
30
+ from pathlib import Path
31
+ from typing import List, Set, Dict, Tuple
32
+
33
+
34
+ # ─── 扫描配置 ───
35
+
36
+ ARKTS_EXTENSIONS = {'.ets', '.ts'}
37
+ JS_EXTENSIONS = {'.ts', '.js', '.tsx'}
38
+ CPP_EXTENSIONS = {'.cpp', '.c', '.h', '.hpp'}
39
+ HARMONY_DIRS = {'harmony', 'ohos', 'harmonyos'}
40
+
41
+ # RN JS 三方库特征(检测这些以确认是 RN 鸿蒙化库而非纯 JS 库)
42
+ RN_JS_PATTERNS = [
43
+ re.compile(r'TurboModuleRegistry', re.IGNORECASE),
44
+ re.compile(r'NativeModules', re.IGNORECASE),
45
+ re.compile(r'codegenNativeComponent', re.IGNORECASE),
46
+ ]
47
+
48
+ # ArkTS/ETS 层特征
49
+ OHOS_IMPORT_PATTERN = re.compile(r'@ohos\.')
50
+ TURBOMODULE_ARKTS_PATTERN = re.compile(r'extends\s+TurboModule|class\s+\w+TurboModule')
51
+ NATIVE_COMPONENT_PATTERN = re.compile(r'@Component|export\s+struct\s+RN')
52
+ EVENT_EMITTER_PATTERN = re.compile(r'NativeEventEmitter|DeviceEventEmitter|RCTEventEmitter')
53
+
54
+ # C++ Native 层特征
55
+ NAPI_CPP_PATTERN = re.compile(r'napi_|TurboModule|JSI|HostFunction|CppComponentInstance')
56
+ NAPI_REF_PATTERN = re.compile(r'napi_create_reference|napi_wrap|napi_delete_reference|napi_open_handle_scope')
57
+
58
+ MAX_LIST_FILES = 20
59
+
60
+
61
+ # ─── 工具函数 ───
62
+
63
+ def parse_args() -> str:
64
+ """解析命令行参数,支持 MCP Gateway JSON 字符串和直接 CLI 两种方式。"""
65
+ if len(sys.argv) > 1:
66
+ arg = sys.argv[1]
67
+ if arg.startswith('{'):
68
+ try:
69
+ data = json.loads(arg)
70
+ return data.get('sourceDir', '')
71
+ except (json.JSONDecodeError, AttributeError):
72
+ pass
73
+ return arg
74
+ return ''
75
+
76
+
77
+ def find_files(root: Path, extensions: Set[str], max_results: int = 0) -> List[Path]:
78
+ """递归查找指定扩展名的文件,跨平台实现。"""
79
+ results = []
80
+ for dirpath, dirnames, filenames in os.walk(root):
81
+ for filename in filenames:
82
+ ext = os.path.splitext(filename)[1].lower()
83
+ if ext in extensions:
84
+ results.append(Path(dirpath) / filename)
85
+ if max_results and len(results) >= max_results:
86
+ return results
87
+ return results
88
+
89
+
90
+ def find_dirs(root: Path, target_names: Set[str], max_results: int = 5) -> List[Path]:
91
+ """查找指定名称的目录。"""
92
+ results = []
93
+ for dirpath, dirnames, _ in os.walk(root):
94
+ for dirname in dirnames:
95
+ if dirname in target_names:
96
+ results.append(Path(dirpath) / dirname)
97
+ if len(results) >= max_results:
98
+ return results
99
+ return results
100
+
101
+
102
+ def grep_files(files: List[Path], patterns: List[re.Pattern]) -> List[Path]:
103
+ """在文件列表中搜索正则模式,返回匹配的文件路径。"""
104
+ matched = []
105
+ for filepath in files:
106
+ try:
107
+ with open(filepath, 'r', encoding='utf-8', errors='ignore') as f:
108
+ content = f.read()
109
+ for pattern in patterns:
110
+ if pattern.search(content):
111
+ matched.append(filepath)
112
+ break
113
+ except (OSError, PermissionError):
114
+ continue
115
+ return matched
116
+
117
+
118
+ def grep_dir(root: Path, extensions: Set[str], patterns: List[re.Pattern], max_results: int = MAX_LIST_FILES) -> List[Path]:
119
+ """在目录中搜索指定扩展名文件中的正则模式,返回匹配的文件路径。"""
120
+ files = find_files(root, extensions)
121
+ matched = grep_files(files, patterns)
122
+ return matched[:max_results] if max_results else matched
123
+
124
+
125
+ def format_paths(paths: List[Path], indent: str = ' ') -> str:
126
+ """格式化路径列表为缩进行。"""
127
+ return '\n'.join(f'{indent}{p}' for p in paths) if paths else ''
128
+
129
+
130
+ # ─── 扫描阶段 ───
131
+
132
+ def scan_rn_js_features(source_dir: Path) -> Tuple[List[Path], bool]:
133
+ """阶段 1:RN JS 三方库特征检测。"""
134
+ print('--- 1. RN JS 三方库特征检测 ---')
135
+ matched = grep_dir(source_dir, JS_EXTENSIONS, RN_JS_PATTERNS, max_results=5)
136
+ if not matched:
137
+ print(' ⚠️ 未检测到 TurboModuleRegistry/NativeModules/codegenNativeComponent')
138
+ print(' → 可能是 RNJS 三方库,无需鸿蒙化内存泄露检视')
139
+ else:
140
+ print(' ✅ 检测到 RN 鸿蒙化特征文件:')
141
+ print(format_paths(matched))
142
+ print()
143
+ return matched, bool(matched)
144
+
145
+
146
+ def scan_arkts_layer(source_dir: Path) -> Dict[str, int]:
147
+ """阶段 2:ArkTS/ETS 层特征扫描。"""
148
+ print('--- 2. ArkTS/ETS 层特征扫描 ---')
149
+
150
+ ets_files = find_files(source_dir, {'.ets'})
151
+ ets_count = len(ets_files)
152
+ print(f' .ets 文件数: {ets_count}')
153
+
154
+ ohos_files = grep_dir(source_dir, ARKTS_EXTENSIONS, [OHOS_IMPORT_PATTERN])
155
+ ohos_count = len(ohos_files)
156
+ print(f' @ohos 模块导入文件数: {ohos_count}')
157
+
158
+ turbomodule_files = grep_dir(source_dir, ARKTS_EXTENSIONS, [TURBOMODULE_ARKTS_PATTERN])
159
+ turbomodule_count = len(turbomodule_files)
160
+ print(f' TurboModule 鸿蒙实现文件数: {turbomodule_count}')
161
+
162
+ native_component_files = grep_dir(source_dir, {'.ets'}, [NATIVE_COMPONENT_PATTERN])
163
+ native_component_count = len(native_component_files)
164
+ print(f' NativeComponent 鸿蒙实现文件数: {native_component_count}')
165
+
166
+ event_emitter_files = grep_dir(source_dir, ARKTS_EXTENSIONS, [EVENT_EMITTER_PATTERN])
167
+ event_emitter_count = len(event_emitter_files)
168
+ print(f' Bridge 事件机制文件数: {event_emitter_count}')
169
+
170
+ print()
171
+ return {
172
+ 'ets_count': ets_count,
173
+ 'ohos_count': ohos_count,
174
+ 'turbomodule_count': turbomodule_count,
175
+ 'native_component_count': native_component_count,
176
+ 'event_emitter_count': event_emitter_count,
177
+ }
178
+
179
+
180
+ def scan_cpp_layer(source_dir: Path) -> Dict[str, int]:
181
+ """阶段 3:C/C++ NAPI 绑定层特征扫描。"""
182
+ print('--- 3. C/C++ NAPI 绑定层特征扫描 ---')
183
+
184
+ cpp_files = find_files(source_dir, CPP_EXTENSIONS)
185
+ cpp_count = len(cpp_files)
186
+ print(f' C/C++ 文件数: {cpp_count}')
187
+
188
+ napi_files = grep_dir(source_dir, CPP_EXTENSIONS, [NAPI_CPP_PATTERN])
189
+ napi_count = len(napi_files)
190
+ print(f' NAPI/TurboModule/JSI 特征文件数: {napi_count}')
191
+
192
+ napi_ref_files = grep_dir(source_dir, CPP_EXTENSIONS, [NAPI_REF_PATTERN])
193
+ napi_ref_count = len(napi_ref_files)
194
+ print(f' NAPI 引用管理文件数: {napi_ref_count}')
195
+
196
+ print()
197
+ return {
198
+ 'cpp_count': cpp_count,
199
+ 'napi_count': napi_count,
200
+ 'napi_ref_count': napi_ref_count,
201
+ }
202
+
203
+
204
+ def scan_harmony_dirs(source_dir: Path) -> List[Path]:
205
+ """阶段 4:鸿蒙化目录检测。"""
206
+ print('--- 4. 鸿蒙化目录检测 ---')
207
+ found_dirs = []
208
+ for dir_name in sorted(HARMONY_DIRS):
209
+ found = find_dirs(source_dir, {dir_name}, max_results=5)
210
+ if found:
211
+ print(f' ✅ 发现目录: {dir_name}')
212
+ print(format_paths(found))
213
+ found_dirs.extend(found)
214
+ print()
215
+ return found_dirs
216
+
217
+
218
+ def print_summary(
219
+ arkts: Dict[str, int],
220
+ cpp: Dict[str, int],
221
+ rn_js_detected: bool,
222
+ ) -> None:
223
+ """阶段 5:汇总判定。"""
224
+ print('=== 扫描结果汇总 ===')
225
+
226
+ has_harmony = (
227
+ arkts['ets_count'] > 0
228
+ or arkts['ohos_count'] > 0
229
+ or arkts['turbomodule_count'] > 0
230
+ or cpp['napi_count'] > 0
231
+ )
232
+
233
+ if has_harmony:
234
+ print(' ✅ 确认鸿蒙化实现,建议进入 Phase 1 内存泄露检视')
235
+ print(f' ArkTS/ETS 层文件数: {arkts["ets_count"]}')
236
+ print(f' C/C++ 层文件数: {cpp["cpp_count"]}')
237
+ print(' 特征匹配:')
238
+ print(f' @ohos 导入: {arkts["ohos_count"]}')
239
+ print(f' TurboModule 实现: {arkts["turbomodule_count"]}')
240
+ print(f' NativeComponent: {arkts["native_component_count"]}')
241
+ print(f' Bridge 事件: {arkts["event_emitter_count"]}')
242
+ print(f' NAPI/JSI: {cpp["napi_count"]}')
243
+ print(f' NAPI 引用管理: {cpp["napi_ref_count"]}')
244
+ elif not rn_js_detected:
245
+ print(' ⚠️ 未检测到 RN 鸿蒙化特征,可能为 RNJS 三方库')
246
+ print(" → 建议评分 0 分,标注 'RNJS 三方库'")
247
+ else:
248
+ print(' ⚠️ 未发现鸿蒙化代码特征')
249
+ print(" → 建议评分 0 分,标注 '未实现鸿蒙化'")
250
+
251
+
252
+ # ─── 主入口 ───
253
+
254
+ def main() -> None:
255
+ source_dir_str = parse_args()
256
+
257
+ if not source_dir_str:
258
+ print('Usage: scan_harmony_code.py <sourceDir>')
259
+ print('Error: sourceDir parameter is required')
260
+ sys.exit(1)
261
+
262
+ source_dir = Path(source_dir_str)
263
+ if not source_dir.is_dir():
264
+ print(f'Error: Directory does not exist: {source_dir_str}')
265
+ sys.exit(1)
266
+
267
+ print('=== 鸿蒙化代码特征扫描 ===')
268
+ print(f'源码目录: {source_dir_str}')
269
+ print()
270
+
271
+ rn_js_matched, rn_js_detected = scan_rn_js_features(source_dir)
272
+ arkts = scan_arkts_layer(source_dir)
273
+ cpp = scan_cpp_layer(source_dir)
274
+ scan_harmony_dirs(source_dir)
275
+ print_summary(arkts, cpp, rn_js_detected)
276
+
277
+
278
+ if __name__ == '__main__':
279
+ main()
@@ -0,0 +1,273 @@
1
+ ---
2
+ name: rn-library-stability-check
3
+ description: 对 RN 三方库鸿蒙化代码进行稳定性检视,聚焦 ArkTS/ETS 和 C++ 代码,分析异常处理、资源释放、并发安全、生命周期管理、NAPI 跨语言调用、调用链完整性等维度,生成严苛评分报告(0-100分)。作为 RN 仓库检视流程的第二阶段,依赖 rn-library-interface-analyzer 的输出。使用场景:RN 三方库鸿蒙化稳定性评估、稳定性问题发现、代码质量改进。
4
+ license: Apache-2.0
5
+ compatibility: 需要访问源码目录、分析 ArkTS/ETS 和 C++ 源码,可选调用 MCP 脚本工具辅助代码扫描
6
+ metadata:
7
+ version: "1.0.0"
8
+ category: rn-library-check
9
+ ---
10
+
11
+ # RNLibraryStabilityCheckSkill
12
+
13
+ 对 RN 三方库的**鸿蒙化实现代码**进行稳定性检视,评估库在异常情况下的处理能力、资源管理安全性、并发处理可靠性、跨语言调用安全性等关键稳定性指标。
14
+
15
+ > ⚠️ **核心定位**:本 SKILL **仅检视鸿蒙化实现代码**,通过智能扫描识别代码范围(`*.ets`、NAPI C++、`module.json5`、`@ohos.*` API、TurboModule 桥接),而非依赖固定目录名称。
16
+
17
+ ---
18
+
19
+ ## 任务参数
20
+
21
+ | 参数 | 类型 | 必填 | 说明 |
22
+ |------|------|------|------|
23
+ | `repoUrl` | string | ✅ | 鸿蒙化仓库地址(ohosRepoUrl) |
24
+ | `outputDir` | string | ✅ | 输出目录绝对路径 |
25
+ | `interfaceDocPath` | string | ✅ | 接口规格说明文档路径 |
26
+ | `repoName` | string | ✅ | 仓库名称 |
27
+
28
+ ---
29
+
30
+ ## 输入依赖
31
+
32
+ - **前置 SKILL**: `rn-library-interface-analyzer`
33
+ - **输入文件**: `接口规格说明.md`(位于 outputDir)
34
+ - **仓库源码**: 已克隆到 `{outputDir}/source/`
35
+
36
+ ---
37
+
38
+ ## 工作流程概览
39
+
40
+ ```
41
+ Phase 1: 鸿蒙代码智能定位与范围识别
42
+
43
+ Phase 2: ArkTS 层稳定性分析(异常处理 + 资源释放 + 并发安全 + 生命周期)
44
+
45
+ Phase 3: C++ Native 层稳定性分析(NAPI 跨语言 + 内存管理)
46
+
47
+ Phase 4: 调用链完整性分析(跨层级异常传播追踪)
48
+
49
+ Phase 5: 严苛评分计算(维度扣分 + 归零规则)
50
+
51
+ Phase 6: 报告生成
52
+ ```
53
+
54
+ ---
55
+
56
+ ## Phase 1:鸿蒙代码智能定位与范围识别
57
+
58
+ **通过多维度特征扫描**,智能识别鸿蒙化代码,而非依赖固定目录名称。
59
+
60
+ ### 1.1 扫描策略(优先级递减)
61
+
62
+ | 扫描维度 | 特征模式 | 权重 | 说明 |
63
+ |----------|----------|------|------|
64
+ | **文件类型** | `*.ets` 文件 | ⭐⭐⭐ 高 | ArkTS/ETS 是鸿蒙化最强特征 |
65
+ | **配置文件** | `module.json5`、`oh-package.json5` | ⭐⭐⭐ 高 | 鸿蒙特有模块配置 |
66
+ | **API 调用** | `@ohos.*`、`napi_*`、`import from '@ohos'` | ⭐⭐ 中 | 鸿蒙 API 特征 |
67
+ | **RN 桥接** | TurboModule、NativeModule 注册代码 | ⭐⭐ 中 | RN 鸿蒙化关键桥接层 |
68
+ | **C++ NAPI** | `napi_create_reference`、`napi_value` 等 | ⭐⭐ 中 | Native 层鸿蒙绑定 |
69
+ | **目录标识** | 目录名包含 `ohos`、`harmony`、`openharmony` | ⭐ 低 | 辅助参考 |
70
+
71
+ ### 1.2 扫描执行
72
+
73
+ 可使用辅助脚本 `scripts/scan-harmony-code.py` 自动执行扫描,传入 `sourceDir` 参数:
74
+
75
+ ```bash
76
+ python3 scripts/scan-harmony-code.py '{"sourceDir": "{outputDir}/source"}'
77
+ ```
78
+
79
+ 脚本输出各维度文件列表和分类统计,辅助判定检视范围。
80
+
81
+ ### 1.3 判定规则
82
+
83
+ | 扫描结果 | 判定 | 评分 | 后续操作 |
84
+ |----------|------|------|----------|
85
+ | 发现 `.ets` 文件 | ✅ 存在鸿蒙化 | 正常评分 | 进入 Phase 2 |
86
+ | 发现 `module.json5` + NAPI 代码 | ✅ 存在鸿蒙化 | 正常评分 | 进入 Phase 2 |
87
+ | 仅发现目录名含 `ohos` 但无代码文件 | ⚠️ 疑似未完成 | 0-30 分 | 标注"鸿蒙化代码疑似缺失" |
88
+ | 未发现任何鸿蒙特征 | ❌ 未鸿蒙化 | 0 分 | 标注"未发现鸿蒙化实现代码" |
89
+ | 无法访问源码目录 | ❌ 无法检视 | 0 分 | 标注"源码目录不可访问" |
90
+
91
+ > **不以固定目录名否定**:即使没有 `ohos/` 目录,只要发现 `.ets` 文件或鸿蒙 API 调用,即判定为存在鸿蒙化。
92
+
93
+ ---
94
+
95
+ ## Phase 2:ArkTS 层稳定性分析
96
+
97
+ > 完整检查项判定标准与代码示例参见 [references/CHECKLIST.md](references/CHECKLIST.md)
98
+
99
+ ### 2.1 异常处理完整性(基础分 25)
100
+
101
+ 所有 `@ohos` 模块 API 调用和 TurboModule 注册方法必须覆盖异常捕获,关键路径必须包含完整异常处理链。
102
+
103
+ | # | 检查项 | 扣分 | 严重度 |
104
+ |---|--------|------|--------|
105
+ | E-01 | 关键 API 调用无 try-catch | **-10** | Critical |
106
+ | E-02 | Promise rejection 未处理 | **-8** | Critical |
107
+ | E-03 | 异常吞没(catch 块为空或仅 console.log) | **-7** | Major |
108
+ | E-04 | 参数验证缺失 | **-5** | Major |
109
+ | E-05 | 异常类型窄化 | **-3** | Minor |
110
+ | E-06 | finally 缺失(资源操作路径) | **-2** | Minor |
111
+
112
+ ### 2.2 资源释放安全性(基础分 20)
113
+
114
+ 鸿蒙系统资源必须在 TurboModule 销毁或组件/Ability 生命周期结束时释放。
115
+
116
+ | # | 检查项 | 扣分 | 严重度 |
117
+ |---|--------|------|--------|
118
+ | R-01 | 系统资源未释放(sensor/location/network/bluetooth) | **-10** | Critical |
119
+ | R-02 | 事件订阅未取消(`on()` 无对应 `off()`) | **-8** | Critical |
120
+ | R-03 | Stream/Connection 泄露 | **-5** | Major |
121
+ | R-04 | Timer 未清理 | **-3** | Minor |
122
+ | R-05 | Worker 未终止 | **-3** | Minor |
123
+
124
+ ### 2.3 并发安全(基础分 20)
125
+
126
+ | # | 检查项 | 扣分 | 严重度 |
127
+ |---|--------|------|--------|
128
+ | C-01 | 主线程阻塞操作(耗时同步 I/O/大循环) | **-10** | Critical |
129
+ | C-02 | 共享状态无同步保护 | **-7** | Major |
130
+ | C-03 | 回调重入无防护 | **-3** | Minor |
131
+
132
+ ### 2.4 ArkTS 生命周期管理(基础分 10)
133
+
134
+ | # | 检查项 | 扣分 | 严重度 |
135
+ |---|--------|------|--------|
136
+ | L-01 | aboutToDisappear/onDestroy 未清理 | **-8** | Critical |
137
+ | L-02 | @State/@Link 对象持有大引用未释放 | **-2** | Minor |
138
+
139
+ ---
140
+
141
+ ## Phase 3:C++ Native 层稳定性分析
142
+
143
+ > 完整检查项判定标准与代码示例参见 [references/CHECKLIST.md](references/CHECKLIST.md)
144
+
145
+ ### 3.1 NAPI 跨语言调用安全(基础分 15)
146
+
147
+ | # | 检查项 | 扣分 | 严重度 |
148
+ |---|--------|------|--------|
149
+ | N-01 | napi_ref 创建/释放不匹配 | **-10** | Critical |
150
+ | N-02 | napi_handle_scope 未清理 | **-8** | Critical |
151
+ | N-03 | napi_value 类型转换无边界检查 | **-5** | Major |
152
+ | N-04 | napi_create_async_work 缺少异常处理 | **-5** | Major |
153
+ | N-05 | Native 对象与 JS 对象生命周期不一致 | **-3** | Minor |
154
+
155
+ ### 3.2 C++ 内存管理安全(基础分 10)
156
+
157
+ | # | 检查项 | 扣分 | 严重度 |
158
+ |---|--------|------|--------|
159
+ | M-01 | malloc/new 与 free/delete 不匹配 | **-8** | Critical |
160
+ | M-02 | 异常路径资源未释放 | **-5** | Major |
161
+ | M-03 | 未使用 RAII 管理资源 | **-3** | Minor |
162
+
163
+ ---
164
+
165
+ ## Phase 4:调用链完整性分析
166
+
167
+ ### 4.1 跨层级调用链追踪
168
+
169
+ 追踪关键功能的完整调用链(JS 层 → ArkTS 鸿蒙层 → Native C++ 层),检查异常传播路径和资源释放节点。**必须追踪至少 3 个关键功能**的完整调用链,标注每个节点的异常处理状态。
170
+
171
+ ### 4.2 异常传播链检查(额外扣分,不占基础分)
172
+
173
+ | # | 检查项 | 扣分 | 严重度 |
174
+ |---|--------|------|--------|
175
+ | CH-01 | ArkTS → Native 异常传播断裂(未通过 `napi_throw` 传播) | **-10** | Critical |
176
+ | CH-02 | 跨模块调用异常未传播 | **-5** | Major |
177
+ | CH-03 | 关键功能调用链缺失异常处理节点 | **-3** | Minor |
178
+
179
+ ---
180
+
181
+ ## Phase 5:严苛评分计算
182
+
183
+ ### 5.1 评分公式
184
+
185
+ ```
186
+ 维度得分 = max(0, 基础分 - 该维度累计扣分)
187
+ 综合评分 = Σ(各维度得分) - 调用链完整性扣分(CH-01~CH-03)
188
+ ```
189
+
190
+ | 维度 | 基础分 | 检查项范围 |
191
+ |------|--------|------------|
192
+ | 异常处理完整性 | 25 | E-01~E-06 |
193
+ | 资源释放安全性 | 20 | R-01~R-05 |
194
+ | 并发安全 | 20 | C-01~C-03 |
195
+ | ArkTS 生命周期 | 10 | L-01~L-02 |
196
+ | NAPI 跨语言调用 | 15 | N-01~N-05 |
197
+ | C++ 内存管理 | 10 | M-01~M-03 |
198
+
199
+ ### 5.2 归零规则与严重度映射
200
+
201
+ 存在特殊归零规则(如 Critical ≥ 5 个直接评 0 分),以及按扣分值映射的严重度分级(Critical/Major/Minor)。
202
+
203
+ > 完整归零规则、严重度映射表和评分等级说明参见 [references/SCORING_RULES.md](references/SCORING_RULES.md)
204
+
205
+ ---
206
+
207
+ ## Phase 6:报告生成
208
+
209
+ 在 `{outputDir}` 下生成 `稳定性检视报告.md`,包含:检视概览、综合评分、检视范围、维度明细、调用链分析、问题清单、改进建议。
210
+
211
+ > 完整报告格式模板参见 [assets/REPORT_TEMPLATE.md](assets/REPORT_TEMPLATE.md)
212
+
213
+ > **重要**:报告必须包含 `**综合评分:XX/100**` 格式(粗体标记、中文冒号),且评分值位于"二、综合评分"章节,确保可被 `_parseRNLibraryScore` 函数正确解析。评分正则匹配优先级为 `综合评分` > `总体评分/评分` > `得分`。
214
+
215
+ ---
216
+
217
+ ## 输出产物
218
+
219
+ | 产物 | 文件名 | 说明 |
220
+ |------|--------|------|
221
+ | 稳定性检视报告 | `稳定性检视报告.md` | 评分 + 维度明细 + 调用链 + 问题清单 + 修复建议 |
222
+
223
+ 所有产物写入 `{outputDir}` 目录。
224
+
225
+ > ⚠️ **输出文件自检**:写入结果文件前,先确认 `稳定性检视报告.md` 已存在且内容完整(**独立文件,禁止只写入 result 执行结果文件**)。若报告内容仅在草稿中,必须先将其保存为上述独立文件。
226
+
227
+ ### 结构化指标输出(必须执行)
228
+
229
+ 执行环境会在任务 prompt 中下发一个**结构化指标文件输出路径**(`stepId{X}_loop{L}_meta_{N}.json`)。
230
+ 检视完成后,**必须**将最终评分以下述 JSON 对象写入该路径:
231
+
232
+ ```json
233
+ {
234
+ "stabilityScore": 85,
235
+ "scoreReason": "异常处理缺失2处-16等(一句话判定依据,≤50字;触发一票否决时必须注明)"
236
+ }
237
+ ```
238
+
239
+ | 字段 | 类型 | 说明 |
240
+ |------|------|------|
241
+ | `stabilityScore` | number | 稳定性评分(0-100 整数,与报告中 `**综合评分:XX/100**` 的数值一致) |
242
+ | `scoreReason` | string | 评分判定依据摘要(可选,前端悬浮提示展示;0 分时强烈建议写明触发规则,如"Critical≥5 触发归零") |
243
+
244
+ **说明**:该文件由执行框架自动收割入库(前端/历史列表直接读取评分,无需解析报告文本)。若 prompt 未下发该路径则跳过本节。
245
+
246
+ ---
247
+
248
+ ## 特殊情况处理
249
+
250
+ | 情况 | 处理方式 | 评分 |
251
+ |------|----------|------|
252
+ | 未发现 `.ets` 文件和鸿蒙 API 特征 | 报告标注"未发现鸿蒙化实现代码" | 0 分 |
253
+ | 仅发现目录名含 `ohos` 但无代码文件 | 报告标注"鸿蒙化代码疑似缺失" | 0-30 分 |
254
+ | 发现鸿蒙代码但解析失败 | 报告标注"鸿蒙代码解析失败"并说明原因 | 0 分 |
255
+ | Critical 问题 ≥ 5 个 | 报告标注"存在严重稳定性风险" | 0 分 |
256
+ | 扫描到 `.ets` 但不在 `ohos/` 目录 | 正常检视,标注实际路径 | 正常评分 |
257
+
258
+ ---
259
+
260
+ ## 评分权重
261
+
262
+ 本 SKILL 在 RN 仓库检视综合评分中权重为 **25%**。
263
+
264
+ ---
265
+
266
+ ## 参考文档
267
+
268
+ | 文档 | 路径 | 说明 |
269
+ |------|------|------|
270
+ | 完整检查清单 | [references/CHECKLIST.md](references/CHECKLIST.md) | 所有检查项的判定标准与代码示例 |
271
+ | 评分规则 | [references/SCORING_RULES.md](references/SCORING_RULES.md) | 归零规则、严重度映射、评分等级 |
272
+ | 报告模板 | [assets/REPORT_TEMPLATE.md](assets/REPORT_TEMPLATE.md) | 完整报告格式模板 |
273
+ | 代码扫描脚本 | [scripts/scan-harmony-code.py](scripts/scan-harmony-code.py) | Phase 1 鸿蒙代码智能扫描辅助工具(跨平台) |