@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,344 @@
1
+ # SkillSelector — SKILL 选择器 ReAct Agent
2
+
3
+ 根据一个具体事项(任务)和 SKILL 筛选目录,自动选出最适合的 SKILL。
4
+
5
+ 采用 **ReAct(Reason + Act)** 设计模式,通过 LLM 推理 + 双通道 BM25 模糊匹配的三步编排完成选择。
6
+
7
+ ## 职责
8
+
9
+ 在给定 SKILL 筛选目录下,根据一个具体事项(任务),选出最适合的 SKILL。
10
+
11
+ 采用 **ReAct(Reason + Act)** 设计模式,分三步完成:
12
+
13
+ 1. **Reason #1 — 任务拆解**:LLM(百炼 / glm-5-1)分析任务,产出 `keywords / intent / constraints / techStack / whenToUse`,作为模糊匹配的输入。prompt 强制保留"准出审核/验收测试"等动作类型词,避免被技术细节淹没。
14
+ 2. **Act — 模糊匹配**:本地模糊匹配工具根据上一步输出,采用**双通道多路召回融合**(动作通道 + 领域通道 + 原文兜底通道),在候选 SKILL 池中召回最匹配的 topK。SKILL 文档索引 = metadata×3 + 正文前 2500 字符 + useWhen。
15
+ 3. **Reason #2 — 排序筛选**:LLM 对 topK 候选 SKILL 评分排序,选出最佳 SKILL。
16
+
17
+ ## 架构
18
+
19
+ ```mermaid
20
+ flowchart TD
21
+ Input["输入: task + skillDirectory"]
22
+ Input --> Scan["skillScanner 扫描目录"]
23
+ Scan -->|SkillMeta[]| R1
24
+
25
+ subgraph R1["Reason #1 — 任务拆解"]
26
+ R1a["llmClient 调用 glm-5-1"]
27
+ R1b["输出 TaskAnalysis: keywords / intent / constraints / techStack / whenToUse"]
28
+ R1a --> R1b
29
+ end
30
+
31
+ R1 --> Act["Act — fuzzyMatch 双通道多路召回融合"]
32
+ Scan --> Act
33
+ Act -->|"动作路 + 领域路 + 原文路融合"| TopK["topK 候选 SKILL"]
34
+ TopK --> R2
35
+
36
+ subgraph R2["Reason #2 — 排序筛选"]
37
+ R2a["llmClient 调用 glm-5-1"]
38
+ R2b["输出 ranked: 每项含 score + reason"]
39
+ R2a --> R2b
40
+ end
41
+
42
+ R2 --> Output["返回 SkillSelection: best + ranked + analysis + trace"]
43
+ ```
44
+
45
+ ## 目录结构
46
+
47
+ ```
48
+ SkillSelector/
49
+ ├── index.js # 模块统一导出
50
+ ├── types.js # 数据结构 JSDoc 契约(本地保留,不提交远端,已加入 .gitignore)
51
+ ├── core/
52
+ │ └── Agent.js # 对外导出的 Agent 类,selectSkill(task, skillDirectory) 主入口
53
+ ├── llm/
54
+ │ ├── llmClient.js # LLM 客户端(百炼 OpenAI 兼容,glm-5-1),提供 chat() / chatJSON()
55
+ │ ├── prompts.js # prompt 模板 + renderTemplate(TASK_ANALYSIS_PROMPT 含动作词/领域词约束)
56
+ │ └── reactSteps.js # 两个 Reason 步骤封装(analyzeTask / rankSkills)
57
+ ├── matcher/
58
+ │ └── fuzzyMatcher.js # 模糊匹配工具(分词器 + 纯 JS BM25 + 双通道多路召回融合)
59
+ │ # 动作通道加权 + 领域通道 + 原文兜底 + legacy fallback
60
+ ├── utils/
61
+ │ └── actionWords.js # 动作词表 + 领域词表(ACTION_WORDS / DOMAIN_WORDS / isActionWord / isDomainWord)
62
+ │ # 供 fuzzyMatcher.js 加权、prompts.js 示例共用
63
+ ├── scanner/
64
+ │ └── skillScanner.js # SKILL 目录扫描 + frontmatter 解析 → SkillMeta[]
65
+ │ # searchableText = metadata×3 + 正文前 2500 字符 + useWhen
66
+ └── __tests__/
67
+ ├── run-sample.js # 端到端自测脚本
68
+ └── test-pure-logic.js # 纯逻辑单测(不依赖 LLM/网络)
69
+ ```
70
+
71
+ ## 模块组成
72
+
73
+ | 文件 | 职责 |
74
+ |------|------|
75
+ | [core/Agent.js](core/Agent.js) | 对外导出的 `Agent` 类,`selectSkill(task, skillDirectory)` 主入口,编排 ReAct 流程 |
76
+ | [index.js](index.js) | 模块统一导出 |
77
+ | [llm/llmClient.js](llm/llmClient.js) | LLM 客户端(百炼 OpenAI 兼容,glm-5-1),提供 `chat()` / `chatJSON()` |
78
+ | [scanner/skillScanner.js](scanner/skillScanner.js) | 扫描 SKILL 目录,解析 `SKILL.md` frontmatter,产出 `SkillMeta[]` |
79
+ | [matcher/fuzzyMatcher.js](matcher/fuzzyMatcher.js) | 模糊匹配工具(合并模块):分词器 + 纯 JS BM25 + 双通道多路召回融合 + legacy fallback |
80
+ | [utils/actionWords.js](utils/actionWords.js) | 动作词表 + 领域词表(`ACTION_WORDS` / `DOMAIN_WORDS`),供 fuzzyMatcher 加权与 prompts 示例共用 |
81
+ | [llm/reactSteps.js](llm/reactSteps.js) | 两个 Reason 步骤封装:`analyzeTask` / `rankSkills` |
82
+ | [llm/prompts.js](llm/prompts.js) | prompt 模板 + `renderTemplate` 占位符替换(`TASK_ANALYSIS_PROMPT` 含动作词/领域词提取约束) |
83
+ | [types.js](types.js) | 数据结构 JSDoc 契约(`SkillMeta` / `TaskAnalysis` / `SkillSelection`;本地保留,不提交远端) |
84
+ | [__tests__/](__tests__/) | 自测脚本 |
85
+
86
+ ## 工作流
87
+
88
+ ### 步骤 0:扫描 SKILL 目录
89
+
90
+ `skillScanner.scanSkills(skillDirectory)` 遍历目录下每个子目录,读取 `SKILL.md`,解析 YAML frontmatter(`name` / `description` / `metadata` 含 `version` / `category` / `language` 等),产出 `SkillMeta[]`。每个 `SkillMeta` 含 `searchableText`(= name + description + category + language 等 metadata 字段×3 + 正文前 2500 字符 + useWhen 拼成的小写串),供 BM25 打分用。metadata 权重放大保证 frontmatter 匹配占主导,正文纳入覆盖 description 未提及的语义,useWhen 让"什么场景下调用"这一语义信号进入召回。
91
+
92
+ ### Reason #1:LLM 拆解任务
93
+
94
+ `reactSteps.analyzeTask(llm, task)` 调用 glm-5-1,将具体事项拆解为结构化的 `TaskAnalysis`。`TASK_ANALYSIS_PROMPT` 通过规则化约束 + few-shot 示例,强制 LLM 保留**动作类型词**(如"准出审核/验收测试/可行性分析/代码生成")与**领域/产出物特征词**(如"接口规格/接口签名/方法签名/导出链"),并让 `intent` 以动词开头点明动作类型:
95
+
96
+ ```json
97
+ {
98
+ "intent": "扫描源码提取方法级接口规格并输出文档",
99
+ "keywords": ["接口规格", "接口签名", "方法签名", "方法级接口", "扫描", "文档生成", "arkts", "fastble"],
100
+ "constraints": ["C++ 开源库", "鸿蒙平台", "输出可行性报告"],
101
+ "techStack": ["ArkTS"],
102
+ "whenToUse": "从源码提取方法级接口规格时"
103
+ }
104
+ ```
105
+
106
+ ### Act:模糊匹配召回(双通道多路融合)
107
+
108
+ `fuzzyMatcher.fuzzyMatch(analysis, skills, { topK, task, weights })` 采用**双通道 + 多路召回融合**,对每个 SKILL 的 `searchableText` 做 BM25 打分,按分数降序取 topK 候选。
109
+
110
+ 三路召回:
111
+
112
+ - **动作通道(路 A)**:仅用 `keywords + intent` 中的**动作类 token** 做 BM25 打分。动作词加权只对真动作词生效,避免领域词混入动作词表稀释信号。
113
+ - **领域通道(路 B)**:用 `keywords` 中的**领域/产出物特征词** + `whenToUse` 分词做 BM25 打分,直接匹配文档侧已索引的 `useWhen` 与 searchableText 中的领域词。这是召回稳定性的关键信号。
114
+ - **原文兜底通道(路 C)**:用**原始任务描述 task 全文**分词做 BM25 打分,覆盖 keywords 提取偏差导致的语义漂移。
115
+
116
+ 融合公式:`score = wA·bm25A + wB·bm25B + wC·bm25C`(归一化后加权,默认 `wA=0.4, wB=0.4, wC=0.2`)。
117
+
118
+ 关键打分策略:
119
+
120
+ - **分数归一化**:raw 分 ÷ max(3, 单路实际参与 token 数),使分数跨查询可比、阈值判定稳定,且避免多路融合/动作词展开导致分母虚高。
121
+ - **name 精确匹配 bonus**:query keywords 中任一词与 skill.name 精确匹配时 score ×1.15。
122
+ - **动作词加权**:query 侧的动作类型词(`utils/actionWords.js` 的 `ACTION_WORDS`,如"准出审核/验收测试")会被重复 `ACTION_WORD_WEIGHT`(默认 3)次,等价于打分时权重×3,使意向词主导排名。
123
+
124
+ 融合后全零分(无任何 token 重叠)时,回退到 legacy 子串匹配,保证不返回空。
125
+
126
+ ### Reason #2:LLM 排序筛选
127
+
128
+ `reactSteps.rankSkills(llm, task, analysis, candidates)` 把 topK 候选的简表(id / name / description / category / language / useWhen)发给 glm-5-1,让 LLM 按规则化评分(意图 40 / 技术栈 30 / 约束 20 / 关键词 10 + 硬否决规则)打分排序,选出最佳 SKILL。`Agent` 会对返回结果做稳定降序排序,确保 `topScore` 判定不依赖 LLM 的返回顺序。
129
+
130
+ ### 返回结果
131
+
132
+ ```js
133
+ {
134
+ best: SkillMeta|null, // 最佳 SKILL(未命中阈值/分差过小时为 null)
135
+ skillPath: string|null, // best 的绝对目录路径(未命中为 null)
136
+ hit: boolean, // 检索是否命中(top1>=阈值 且 top1-top2 分差>=10)
137
+ topScore: number, // top1 分数
138
+ scoreGap: number, // top1-top2 分差(<10 时判定不确定,hit=false)
139
+ ranked: [{ skill, score, dimensions, reason }], // topK 排序结果
140
+ analysis: TaskAnalysis, // 任务拆解
141
+ trace: [...] // ReAct 每步留痕(含 act:fuzzyMatch 每路分数明细)
142
+ }
143
+ ```
144
+
145
+ > `act:fuzzyMatch` 的 trace 会记录每路分数明细(`routes: { action, domain, raw }`),便于定位偶发未命中。
146
+
147
+ ## 快速开始
148
+
149
+ ### 1. 配置环境变量
150
+
151
+ 在 `Server/.env` 中配置:
152
+
153
+ ```env
154
+ DASHSCOPE_API_KEY=your_api_key_here
155
+ LLM_BASE_URL=https://dashscope.aliyuncs.com/compatible-mode/v1
156
+ LLM_MODEL=glm-5-1
157
+ ```
158
+
159
+ ### 2. 安装依赖
160
+
161
+ ```bash
162
+ cd Server
163
+ npm install
164
+ ```
165
+
166
+ ### 3. 使用
167
+
168
+ ```js
169
+ import { Agent } from './Agent/SkillSelector/index.js';
170
+
171
+ const agent = new Agent();
172
+ const result = await agent.selectSkill(
173
+ '分析 libcurl 这个 C++ 开源库能否移植到鸿蒙平台',
174
+ 'D:/code/AIWeb/Server/Skills'
175
+ );
176
+
177
+ console.log(result.best.dirName); // 'CPPAnalysisSkill'
178
+ console.log(result.best.name); // 'cpp-porting-analysis'
179
+ console.log(result.ranked); // 5 项排序,每项 { skill, score, reason }
180
+ console.log(result.analysis); // 任务拆解
181
+ console.log(result.trace); // ReAct 每步留痕
182
+ ```
183
+
184
+ ### 4. 运行自测
185
+
186
+ ```bash
187
+ # 纯逻辑自测(不调用 LLM,不依赖网络)
188
+ node Agent/SkillSelector/__tests__/test-pure-logic.js
189
+
190
+ # 完整 ReAct 自测(调用真实 LLM,需配置 API Key)
191
+ node Agent/SkillSelector/__tests__/run-sample.js
192
+ ```
193
+
194
+ ## 对外接口
195
+
196
+ ### `Agent` 类
197
+
198
+ ```js
199
+ import { Agent } from './Agent/SkillSelector/index.js';
200
+
201
+ const agent = new Agent();
202
+ // task: 具体事项;skillDirectory: SKILL 筛选目录绝对路径
203
+ const result = await agent.selectSkill('分析 libcurl 的鸿蒙化可行性', 'D:/code/AIWeb/Server/Skills');
204
+
205
+ console.log(result.best.name); // 最佳 SKILL 名称(未命中时 best 为 null)
206
+ console.log(result.best.dirName); // 最佳 SKILL 目录名
207
+ console.log(result.hit); // 检索是否命中(top1>=阈值 且 top1-top2 分差>=10)
208
+ console.log(result.skillPath); // best 的绝对目录路径
209
+ console.log(result.topScore); // top1 分数
210
+ console.log(result.scoreGap); // top1-top2 分差(<10 时判定不确定)
211
+ console.log(result.ranked); // 排序列表 [{ skill, score, dimensions, reason }]
212
+ console.log(result.analysis); // 任务拆解
213
+ console.log(result.trace); // ReAct 每步留痕
214
+ ```
215
+
216
+ ### `Agent` 构造选项(可选,用于测试 / 自定义)
217
+
218
+ ```js
219
+ new Agent({
220
+ llm: new LLMClient({ model: 'glm-5-1' }), // 注入自定义 LLM 客户端
221
+ matcher: customMatcher, // 注入自定义模糊匹配实现
222
+ topK: 5, // 召回候选数量
223
+ hitThreshold: 60, // 命中阈值
224
+ weights: { action: 0.4, domain: 0.4, raw: 0.2 }, // 多路召回融合权重
225
+ });
226
+ ```
227
+
228
+ ## SKILL 目录格式
229
+
230
+ 参考 `D:\code\AIWeb\Server\Skills`,每个 SKILL 是一个目录:
231
+
232
+ ```
233
+ <skillDirectory>/
234
+ ├── SomeSkill/
235
+ │ ├── SKILL.md # 必须存在,含 YAML frontmatter
236
+ │ ├── references/ # 可选
237
+ │ └── scripts/ # 可选
238
+ └── AnotherSkill/
239
+ └── SKILL.md
240
+ ```
241
+
242
+ `SKILL.md` 的 frontmatter 示例:
243
+
244
+ ```yaml
245
+ ---
246
+ name: cpp-porting-analysis
247
+ description: 对 C++ 开源库进行鸿蒙化可行性分析...
248
+ license: MIT
249
+ metadata:
250
+ author: lalhan
251
+ version: "2.2.0"
252
+ category: harmonyos-porting
253
+ language: C/C++
254
+ useWhen: 从鸿蒙原生库源码提取方法级接口规格时 # 可选,领域通道匹配的关键信号
255
+ compatibility: 适用于任意托管在 Git 仓库的 C/C++ 开源库。
256
+ ---
257
+ ```
258
+
259
+ ## 高级用法
260
+
261
+ ### 注入自定义 LLM 客户端
262
+
263
+ ```js
264
+ import { Agent, LLMClient } from './Agent/SkillSelector/index.js';
265
+
266
+ const customLLM = new LLMClient({
267
+ model: 'glm-5-1',
268
+ temperature: 0.1,
269
+ });
270
+ const agent = new Agent({ llm: customLLM });
271
+ ```
272
+
273
+ ### 注入自定义模糊匹配算法
274
+
275
+ `fuzzyMatch` 默认用 BM25,可通过构造函数注入自定义实现(如向量检索):
276
+
277
+ ```js
278
+ const agent = new Agent({
279
+ matcher: async (analysis, skills, options) => {
280
+ // 自定义匹配逻辑,返回 [{ skill, score }]
281
+ return myVectorSearch(analysis, skills, options.topK);
282
+ },
283
+ });
284
+ ```
285
+
286
+ ### 调整召回数量
287
+
288
+ ```js
289
+ const agent = new Agent({ topK: 10 }); // 召回 10 个候选
290
+ ```
291
+
292
+ 或在 `.env` 中配置:
293
+
294
+ ```env
295
+ SELECTOR_TOP_K=10
296
+ ```
297
+
298
+ ## 配置项
299
+
300
+ `Server/.env` 支持的环境变量:
301
+
302
+ | 变量 | 说明 | 默认值 |
303
+ |------|------|--------|
304
+ | `DASHSCOPE_API_KEY` | 百炼平台 API Key(必填) | — |
305
+ | `LLM_BASE_URL` | OpenAI 兼容端点 | `https://dashscope.aliyuncs.com/compatible-mode/v1` |
306
+ | `LLM_MODEL` | 模型名 | `glm-5-1` |
307
+ | `LLM_TEMPERATURE` | 采样温度 | `0.2` |
308
+ | `LLM_MAX_TOKENS` | 最大 token 数 | `2048` |
309
+ | `LLM_ENABLE_THINKING` | 是否开启 GLM 思考模式 | `false` |
310
+ | `SELECTOR_TOP_K` | 模糊匹配召回数量 | `5` |
311
+ | `SELECTOR_HIT_THRESHOLD` | 命中阈值(top1>=此值且分差>=10 才命中) | `60` |
312
+ | `SELECTOR_WEIGHT_ACTION` | 动作通道融合权重 | `0.4` |
313
+ | `SELECTOR_WEIGHT_DOMAIN` | 领域通道融合权重 | `0.4` |
314
+ | `SELECTOR_WEIGHT_RAW` | 原文兜底通道融合权重 | `0.2` |
315
+ | `FALLBACK_MODEL` | 连续 3 次 529 过载时切换的备用模型 | — |
316
+
317
+ ## 设计原则
318
+
319
+ - **高内聚低耦合**:每个文件单一职责,`core/Agent.js` 只做编排,prompt / fs / LLM / 匹配各自独立
320
+ - **可替换**:`LLMClient` 和 `matcher` 均支持注入 mock / 自定义实现
321
+ - **可测试**:纯逻辑自测不依赖 LLM 和网络,完整自测验证端到端流程
322
+ - **零原生依赖**:BM25 用纯 JS 实现,不依赖 SQLite / 原生编译模块
323
+ - **动作/领域词分离管理**:动作类型词与领域/产出物词分别在 `utils/actionWords.js` 的 `ACTION_WORDS` / `DOMAIN_WORDS`,prompt 示例与 BM25 加权共用同一来源,避免词表漂移
324
+
325
+ ## 匹配质量优化(演进记录)
326
+
327
+ SKILL 召回经历了以下演进,共同保证验收测试、接口规格等动作/领域匹配类 SKILL 能被精准召回:
328
+
329
+ 1. **提示词保留动作词**(`TASK_ANALYSIS_PROMPT`):强制 LLM 拆解时保留"准出审核/验收测试"等意向关键词,解决任务描述冗长时丢词问题。
330
+ 2. **searchableText 文档侧加权**(`skillScanner._buildSearchableText`):索引 = metadata 字段×3 + 正文前 2500 字符 + useWhen,提升 SKILL 文档匹配质量。
331
+ 3. **BM25 分数归一化 + name bonus**(`fuzzyMatcher`):raw 分 ÷ max(3, 原始 query token 数) 使跨查询可比、阈值判定稳定;query 关键词与 skill.name 精确匹配时 ×1.15。
332
+ 4. **BM25 query 侧动作词加权**(`fuzzyMatcher`):动作类型词权重×3,解决动作词被高频技术词淹没、目标 SKILL 被挤出 TopK 的问题。
333
+ 5. **动作/领域词表纯净化**(`utils/actionWords.js`):将语义非动作的产出物/领域词(接口规格/接口签名/方法签名/导出链/覆盖率等)从 `ACTION_WORDS` 移入独立的 `DOMAIN_WORDS`,避免"堆词"式打补丁稀释真正的动作信号。
334
+ 6. **双通道多路召回融合**(`fuzzyMatcher`):动作通道 + 领域通道 + 原文兜底通道,弱化对 LLM keywords 提取的单点依赖,目标 SKILL 即使 keywords 有偏差也能稳定进入 topK,解决偶现未命中问题。
335
+ 7. **ranked 稳定降序排序**(`core/Agent.js`):LLM 返回结果做稳定降序排序,确保 `topScore` 判定不依赖 LLM 的返回顺序。
336
+
337
+ ## 匹配质量优化注意点
338
+
339
+ - **提示词保留动作词**:`TASK_ANALYSIS_PROMPT` 强制 LLM 拆解时保留"准出审核/验收测试"等意向关键词,避免冗长任务描述导致丢词。
340
+ - **searchableText 文档侧加权**:`skillScanner._buildSearchableText` 构建索引 = metadata 字段×3 + 正文前 2500 字符 + useWhen,保证 frontmatter 匹配主导,正文补充语义。
341
+ - **BM25 分数归一化 + name bonus**:`fuzzyMatcher` raw 分 ÷ max(3, 单路实际参与 token 数),跨查询可比、阈值判定稳定;query 关键词与 skill.name 精确匹配时 ×1.15。
342
+ - **BM25 动作词加权**:`fuzzyMatcher` query 侧对动作词重复 `ACTION_WORD_WEIGHT` 次(默认 3),归一化分母用展开前原始 token 数,使动作词主导排名,避免被高频技术词挤出 TopK。
343
+ - **新增动作词**:匹配新动作类型时,把词加入 `utils/actionWords.js` 的 `ACTION_WORDS`,并同步 `TASK_ANALYSIS_PROMPT` 的动作词示例,确保 LLM 产出能被 `isActionWord` 识别。
344
+ - **新增领域词**:新增产出物/领域特征词时,把词加入 `utils/actionWords.js` 的 `DOMAIN_WORDS`(同步 `TASK_ANALYSIS_PROMPT` 的领域词示例),确保 LLM 产出能被 `isDomainWord` 识别,供领域通道召回。
@@ -0,0 +1,207 @@
1
+ /**
2
+ * Agent.js — SKILL 选择器 ReAct Agent(对外导出)
3
+ *
4
+ * 设计模式:ReAct(Reason + Act)
5
+ * - Reason #1:LLM 拆解任务 → 生成模糊匹配输入(keywords/intent/techStack)
6
+ * - Act :调用模糊匹配工具,召回 top5 候选 SKILL
7
+ * - Reason #2:LLM 对 top5 评分排序 → 选出最佳 SKILL
8
+ *
9
+ * 对外导出 Agent 类,核心方法:
10
+ * async selectSkill(task, skillDirectory) -> SkillSelection
11
+ *
12
+ * 使用示例:
13
+ * import { Agent } from './Agent/SkillSelector/index.js';
14
+ * const agent = new Agent();
15
+ * const result = await agent.selectSkill('分析 libcurl 的鸿蒙化可行性', 'D:/code/AIWeb/Server/Skills');
16
+ * console.log(result.best.name);
17
+ */
18
+
19
+ import path from 'node:path';
20
+ import { fileURLToPath } from 'node:url';
21
+ import dotenv from 'dotenv';
22
+
23
+ import { LLMClient } from '../llm/llmClient.js';
24
+ import { scanSkills } from '../scanner/skillScanner.js';
25
+ import { fuzzyMatch, createFuzzyMatcher } from '../matcher/fuzzyMatcher.js';
26
+ import { analyzeTask, rankSkills } from '../llm/reactSteps.js';
27
+ import { createLogger } from '../../../Routes/library/logger.js';
28
+
29
+ const log = createLogger('SkillSelector');
30
+
31
+ // 加载 Server/.env(本文件在 core/ 下,上三级目录为 Server/)
32
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
33
+ dotenv.config({ path: path.resolve(__dirname, '..', '..', '..', '.env') });
34
+
35
+ const DEFAULT_TOP_K = 5;
36
+ const DEFAULT_HIT_THRESHOLD = 60;
37
+
38
+ // 多路召回融合权重(默认:动作 0.4 / 领域 0.4 / 原文 0.2)
39
+ const DEFAULT_WEIGHTS = { action: 0.4, domain: 0.4, raw: 0.2 };
40
+
41
+ export class Agent {
42
+ /**
43
+ * @param {object} [options]
44
+ * @param {LLMClient} [options.llm] - 注入自定义 LLM 客户端(用于测试)
45
+ * @param {Function} [options.matcher] - 注入自定义模糊匹配实现
46
+ * @param {number} [options.topK] - 召回候选数量,默认 5 或读 SELECTOR_TOP_K
47
+ * @param {number} [options.hitThreshold] - 命中阈值,默认 60 或读 SELECTOR_HIT_THRESHOLD
48
+ */
49
+ constructor(options = {}) {
50
+ this.llm = options.llm || new LLMClient();
51
+ this.matcher = createFuzzyMatcher(options.matcher);
52
+ this.topK = options.topK ?? _envInt('SELECTOR_TOP_K', DEFAULT_TOP_K);
53
+ this.hitThreshold = options.hitThreshold ?? _envInt('SELECTOR_HIT_THRESHOLD', DEFAULT_HIT_THRESHOLD);
54
+ this.weights = {
55
+ action: options.weights?.action ?? _envFloat('SELECTOR_WEIGHT_ACTION', DEFAULT_WEIGHTS.action),
56
+ domain: options.weights?.domain ?? _envFloat('SELECTOR_WEIGHT_DOMAIN', DEFAULT_WEIGHTS.domain),
57
+ raw: options.weights?.raw ?? _envFloat('SELECTOR_WEIGHT_RAW', DEFAULT_WEIGHTS.raw),
58
+ };
59
+ }
60
+
61
+ /**
62
+ * 选择最适合的 SKILL(ReAct 主流程)
63
+ * @param {string} task - 具体事项
64
+ * @param {string} skillDirectory - SKILL 筛选目录绝对路径
65
+ * @returns {Promise<import('../types.js').SkillSelection>}
66
+ */
67
+ async selectSkill(task, skillDirectory) {
68
+ if (!task) throw new Error('Agent.selectSkill: task 不能为空');
69
+
70
+ if (!skillDirectory) throw new Error('Agent.selectSkill: skillDirectory 不能为空');
71
+
72
+ log.debug('selectSkill 入参', { task, skillDirectory });
73
+
74
+ const trace = [];
75
+
76
+ // ─── 步骤 0:扫描 SKILL 目录,构建候选池 ───
77
+ const skills = await scanSkills(skillDirectory);
78
+ if (skills.length === 0) {
79
+ throw new Error(`Agent.selectSkill: SKILL 目录 ${skillDirectory} 下未找到任何有效 SKILL`);
80
+ }
81
+ trace.push({ step: 'scan', output: { totalSkills: skills.length } });
82
+
83
+ // ─── Reason #1:LLM 拆解任务 ───
84
+ const analysis = await analyzeTask(this.llm, task);
85
+ trace.push({ step: 'reason-1:analyzeTask', input: { task }, output: analysis });
86
+
87
+ // ─── Act:调用模糊匹配工具,召回 topK(双通道多路融合) ───
88
+ const matched = await this.matcher(analysis, skills, { topK: this.topK, task, weights: this.weights });
89
+ if (matched.length === 0) {
90
+ throw new Error('Agent.selectSkill: 模糊匹配未召回任何 SKILL');
91
+ }
92
+ // trace 留痕:记录每路分数(动作/领域/原文),便于定位偶发未命中
93
+ trace.push({
94
+ step: 'act:fuzzyMatch',
95
+ output: {
96
+ topK: matched.length,
97
+ weights: this.weights,
98
+ scores: matched.map((m) => m.score),
99
+ routes: matched.map((m) => m.routes || null),
100
+ },
101
+ });
102
+
103
+ // ─── Reason #2:LLM 对候选评分排序 ───
104
+ const rankResult = await rankSkills(this.llm, task, analysis, matched);
105
+ trace.push({ step: 'reason-2:rankSkills', output: rankResult });
106
+
107
+ // ─── 组装返回:把 ranked 的 id 映射回完整 SkillMeta ───
108
+ const skillMap = new Map(skills.map((s) => [s.dirName, s]));
109
+ // fuzzyMatch 已产出的 score 作为回退
110
+ const matchScoreMap = new Map(matched.map((m) => [m.skill.dirName, m.score]));
111
+
112
+ let ranked = rankResult.ranked.map((r) => {
113
+ const skill = skillMap.get(r.id) || matched.find((m) => m.skill.dirName === r.id)?.skill;
114
+ if (!skill) return null;
115
+ return {
116
+ skill,
117
+ score: r.score,
118
+ // 携带 LLM 的分维度分数(容错:rankSkills 已保证 dimensions 为对象)
119
+ dimensions: r.dimensions || {},
120
+ reason: r.reason || `模糊匹配原始分:${matchScoreMap.get(r.id) ?? 0}`,
121
+ };
122
+ }).filter(Boolean);
123
+
124
+ // 兜底:若 LLM 排序结果为空(模型未按格式返回),用模糊匹配原始召回结果填充
125
+ if (ranked.length === 0) {
126
+ ranked = matched.map((m) => ({
127
+ skill: m.skill,
128
+ score: m.score,
129
+ dimensions: {},
130
+ reason: `模糊匹配原始分:${m.score}`,
131
+ }));
132
+ trace[trace.length - 1] = {
133
+ ...trace[trace.length - 1],
134
+ note: 'rankSkills 返回为空,已用模糊匹配结果兜底',
135
+ };
136
+ }
137
+
138
+ // 稳定降序排序:topScore 判定依赖 ranked[0],不能信任 LLM 的返回顺序(偶现不严格降序)
139
+ ranked = ranked.sort((a, b) => b.score - a.score);
140
+
141
+ // ─── 命中阈值判定:top1 分数 >= 阈值即命中 ───
142
+ // ranked 已按 score 降序,ranked[0] 是最高分候选
143
+ const topScore = ranked.length > 0 ? ranked[0].score : 0;
144
+ const secondScore = ranked.length > 1 ? ranked[1].score : 0;
145
+ // top1-top2 分差仅作参考信息保留,不参与命中判定:
146
+ // 高分 top1(>=阈值)已明确是最佳选择,即使 top2 分数接近也不应判为"不确定"
147
+ const scoreGap = topScore - secondScore;
148
+ const hit = topScore >= this.hitThreshold;
149
+
150
+ // 确定 best:命中时取最高分 SKILL,未命中时为 null(调用方据此走兜底流程)
151
+ let best = null;
152
+ if (hit) {
153
+ // 命中:优先用 LLM 的 bestId,否则取 ranked[0]
154
+ if (rankResult.bestId) {
155
+ best = skillMap.get(rankResult.bestId) || (ranked[0] && ranked[0].skill);
156
+ }
157
+ if (!best && ranked.length > 0) {
158
+ best = ranked[0].skill;
159
+ }
160
+ if (!best) {
161
+ throw new Error('Agent.selectSkill: 命中但无法确定最佳 SKILL');
162
+ }
163
+ }
164
+ // 未命中时 best 保持 null,skillPath 也为 null
165
+
166
+ const result = {
167
+ best,
168
+ // SKILL 绝对目录(命中时为 best.skillPath,未命中为 null)
169
+ skillPath: best ? best.skillPath : null,
170
+ // 检索是否命中阈值
171
+ hit,
172
+ // top1 分数(便于调用方了解置信度,未召回为 0)
173
+ topScore,
174
+ // top1-top2 分差(仅参考信息,不参与命中判定)
175
+ scoreGap,
176
+ ranked,
177
+ analysis,
178
+ trace,
179
+ };
180
+
181
+ log.debug('selectSkill 输出', {
182
+ hit: result.hit,
183
+ topScore: result.topScore,
184
+ best: result.best ? result.best.dirName : null,
185
+ skillPath: result.skillPath,
186
+ rankedCount: result.ranked.length,
187
+ });
188
+
189
+ return result;
190
+ }
191
+ }
192
+
193
+ function _envInt(key, def) {
194
+ const v = process.env[key];
195
+ if (v === undefined || v === '') return def;
196
+ const n = parseInt(v, 10);
197
+ return Number.isFinite(n) ? n : def;
198
+ }
199
+
200
+ function _envFloat(key, def) {
201
+ const v = process.env[key];
202
+ if (v === undefined || v === '') return def;
203
+ const n = Number(v);
204
+ return Number.isFinite(n) ? n : def;
205
+ }
206
+
207
+ export default Agent;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * index.js — SkillSelector 模块统一导出
3
+ *
4
+ * 外部使用:
5
+ * import { Agent } from './Agent/SkillSelector/index.js';
6
+ * const agent = new Agent();
7
+ * const result = await agent.selectSkill(task, skillDirectory);
8
+ */
9
+
10
+ export { Agent } from './core/Agent.js';
11
+ export { LLMClient } from './llm/llmClient.js';
12
+ export { scanSkills, parseFrontmatter } from './scanner/skillScanner.js';
13
+ export { fuzzyMatch, createFuzzyMatcher } from './matcher/fuzzyMatcher.js';
14
+ export { analyzeTask, rankSkills } from './llm/reactSteps.js';