@zeyue0329/xiaoma-cli 1.6.4 → 1.7.0

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 (950) hide show
  1. package/.idea/workspace.xml +35 -22
  2. package/AGENTS.md +9 -0
  3. package/README.md +33 -33
  4. package/README_CN.md +121 -0
  5. package/package.json +5 -8
  6. package/pipeline-optimization-report.md +688 -0
  7. package/src/core/module-help.csv +10 -9
  8. package/src/core/skills/xiaoma-advanced-elicitation/SKILL.md +6 -0
  9. package/src/core/skills/xiaoma-advanced-elicitation/SKILL.md.bak +6 -0
  10. package/src/core/skills/xiaoma-advanced-elicitation/workflow.md +135 -0
  11. package/src/core/skills/xiaoma-brainstorming/SKILL.md +6 -0
  12. package/src/core/skills/xiaoma-brainstorming/SKILL.md.bak +6 -0
  13. package/src/core/skills/xiaoma-brainstorming/steps/step-01-session-setup.md +210 -0
  14. package/src/core/skills/xiaoma-brainstorming/steps/step-03-technique-execution.md +399 -0
  15. package/src/core/skills/xiaoma-brainstorming/workflow.md +54 -0
  16. package/src/core/skills/xiaoma-distillator/SKILL.md +178 -0
  17. package/src/core/skills/xiaoma-distillator/SKILL.md.bak +178 -0
  18. package/src/core/skills/xiaoma-distillator/agents/distillate-compressor.md +116 -0
  19. package/src/core/skills/xiaoma-distillator/agents/round-trip-reconstructor.md +68 -0
  20. package/src/core/skills/xiaoma-distillator/resources/compression-rules.md +51 -0
  21. package/src/core/skills/xiaoma-distillator/resources/distillate-format-reference.md +227 -0
  22. package/src/core/skills/xiaoma-distillator/resources/splitting-strategy.md +78 -0
  23. package/src/core/skills/xiaoma-distillator/scripts/analyze_sources.py +300 -0
  24. package/src/core/skills/xiaoma-distillator/scripts/tests/test_analyze_sources.py +204 -0
  25. package/src/core/skills/xiaoma-distillator/xiaoma-skill-manifest.yaml +15 -0
  26. package/src/core/skills/xiaoma-editorial-review-prose/SKILL.md +6 -0
  27. package/src/core/skills/xiaoma-editorial-review-prose/SKILL.md.bak +6 -0
  28. package/src/core/skills/xiaoma-editorial-review-prose/workflow.md +81 -0
  29. package/src/core/skills/xiaoma-editorial-review-structure/SKILL.md +6 -0
  30. package/src/core/skills/xiaoma-editorial-review-structure/SKILL.md.bak +6 -0
  31. package/src/core/skills/xiaoma-editorial-review-structure/workflow.md +174 -0
  32. package/src/core/skills/xiaoma-editorial-review-structure/xiaoma-skill-manifest.yaml +1 -0
  33. package/src/core/skills/xiaoma-help/workflow.md +88 -0
  34. package/src/core/skills/xiaoma-help/xiaoma-skill-manifest.yaml +1 -0
  35. package/src/core/skills/xiaoma-index-docs/SKILL.md +6 -0
  36. package/src/core/skills/xiaoma-index-docs/SKILL.md.bak +6 -0
  37. package/src/core/skills/xiaoma-index-docs/workflow.md +61 -0
  38. package/src/core/skills/xiaoma-index-docs/xiaoma-skill-manifest.yaml +1 -0
  39. package/src/core/skills/xiaoma-party-mode/SKILL.md +6 -0
  40. package/src/core/skills/xiaoma-party-mode/SKILL.md.bak +6 -0
  41. package/src/core/skills/xiaoma-party-mode/steps/step-01-agent-loading.md +138 -0
  42. package/src/core/skills/xiaoma-party-mode/steps/step-02-discussion-orchestration.md +187 -0
  43. package/src/core/skills/xiaoma-party-mode/steps/step-03-graceful-exit.md +167 -0
  44. package/src/core/skills/xiaoma-party-mode/workflow.md +190 -0
  45. package/src/core/skills/xiaoma-party-mode/xiaoma-skill-manifest.yaml +1 -0
  46. package/src/core/skills/xiaoma-review-adversarial-general/SKILL.md.bak +6 -0
  47. package/src/core/skills/xiaoma-review-adversarial-general/xiaoma-skill-manifest.yaml +1 -0
  48. package/src/core/skills/xiaoma-review-edge-case-hunter/SKILL.md.bak +6 -0
  49. package/src/core/skills/xiaoma-review-edge-case-hunter/xiaoma-skill-manifest.yaml +1 -0
  50. package/src/core/skills/xiaoma-shard-doc/SKILL.md +6 -0
  51. package/src/core/skills/xiaoma-shard-doc/SKILL.md.bak +6 -0
  52. package/src/core/skills/xiaoma-shard-doc/workflow.md +100 -0
  53. package/src/core/skills/xiaoma-shard-doc/xiaoma-skill-manifest.yaml +1 -0
  54. package/src/core/tasks/xiaoma-create-prd/SKILL.md +6 -0
  55. package/src/core/tasks/xiaoma-create-prd/SKILL.md.bak +6 -0
  56. package/src/core/tasks/xiaoma-create-prd/data/domain-complexity.csv +15 -0
  57. package/src/core/tasks/xiaoma-create-prd/data/prd-purpose.md +197 -0
  58. package/src/core/tasks/xiaoma-create-prd/data/project-types.csv +11 -0
  59. package/src/core/tasks/xiaoma-create-prd/steps-c/step-01-init.md +178 -0
  60. package/src/core/tasks/xiaoma-create-prd/steps-c/step-01b-continue.md +161 -0
  61. package/src/core/tasks/xiaoma-create-prd/steps-c/step-02-discovery.md +208 -0
  62. package/src/core/tasks/xiaoma-create-prd/steps-c/step-02b-vision.md +142 -0
  63. package/src/core/tasks/xiaoma-create-prd/steps-c/step-02c-executive-summary.md +158 -0
  64. package/src/core/tasks/xiaoma-create-prd/steps-c/step-03-success.md +214 -0
  65. package/src/core/tasks/xiaoma-create-prd/steps-c/step-04-journeys.md +201 -0
  66. package/src/core/tasks/xiaoma-create-prd/steps-c/step-05-domain.md +194 -0
  67. package/src/core/tasks/xiaoma-create-prd/steps-c/step-06-innovation.md +211 -0
  68. package/src/core/tasks/xiaoma-create-prd/steps-c/step-07-project-type.md +222 -0
  69. package/src/core/tasks/xiaoma-create-prd/steps-c/step-08-scoping.md +216 -0
  70. package/src/core/tasks/xiaoma-create-prd/steps-c/step-09-functional.md +219 -0
  71. package/src/core/tasks/xiaoma-create-prd/steps-c/step-10-nonfunctional.md +230 -0
  72. package/src/core/tasks/xiaoma-create-prd/steps-c/step-11-polish.md +221 -0
  73. package/src/core/tasks/xiaoma-create-prd/steps-c/step-12-complete.md +115 -0
  74. package/src/core/tasks/xiaoma-create-prd/workflow.md +62 -0
  75. package/src/core/tasks/xiaoma-create-prd/xiaoma-skill-manifest.yaml +1 -0
  76. package/src/utility/agent-components/activation-steps.txt +2 -2
  77. package/src/xmc/agents/analyst.agent.yaml +10 -6
  78. package/src/xmc/agents/architect.agent.yaml +2 -2
  79. package/src/xmc/agents/dev.agent.yaml +2 -2
  80. package/src/xmc/agents/pm.agent.yaml +6 -6
  81. package/src/xmc/agents/qa.agent.yaml +2 -2
  82. package/src/xmc/agents/quick-flow-solo-dev.agent.yaml +3 -3
  83. package/src/xmc/agents/sm.agent.yaml +8 -4
  84. package/src/xmc/agents/tech-writer/tech-writer-sidecar/documentation-standards.md +2 -2
  85. package/src/xmc/agents/tech-writer/tech-writer.agent.yaml +1 -1
  86. package/src/xmc/agents/tech-writer/xiaoma-skill-manifest.yaml +1 -1
  87. package/src/xmc/agents/ux-designer.agent.yaml +1 -1
  88. package/src/xmc/agents/xiaoma-skill-manifest.yaml +8 -8
  89. package/src/xmc/module-help.csv +31 -31
  90. package/src/xmc/module.yaml +2 -2
  91. package/src/xmc/teams/default-party.csv +14 -14
  92. package/src/xmc/teams/team-fullstack.yaml +1 -1
  93. package/src/xmc/workflows/1-analysis/auto-requirements-pipeline/SKILL.md +6 -0
  94. package/src/xmc/workflows/1-analysis/auto-requirements-pipeline/checklist.md +28 -0
  95. package/src/xmc/workflows/1-analysis/auto-requirements-pipeline/steps/step-01-init-and-validate.md +102 -0
  96. package/src/xmc/workflows/1-analysis/auto-requirements-pipeline/steps/step-02-requirements-analysis.md +146 -0
  97. package/src/xmc/workflows/1-analysis/auto-requirements-pipeline/steps/step-03-architecture-analysis.md +141 -0
  98. package/src/xmc/workflows/1-analysis/auto-requirements-pipeline/steps/step-04-create-prd.md +100 -0
  99. package/src/xmc/workflows/1-analysis/auto-requirements-pipeline/steps/step-05-validate-prd.md +105 -0
  100. package/src/xmc/workflows/1-analysis/auto-requirements-pipeline/steps/step-06-create-epics.md +95 -0
  101. package/src/xmc/workflows/1-analysis/auto-requirements-pipeline/steps/step-07-create-architecture.md +107 -0
  102. package/src/xmc/workflows/1-analysis/auto-requirements-pipeline/steps/step-08-finalize.md +124 -0
  103. package/src/xmc/workflows/1-analysis/auto-requirements-pipeline/workflow.md +106 -0
  104. package/src/xmc/workflows/1-analysis/auto-requirements-pipeline/xiaoma-skill-manifest.yaml +3 -0
  105. package/src/xmc/workflows/1-analysis/research/xiaoma-domain-research/SKILL.md +6 -0
  106. package/src/xmc/workflows/1-analysis/research/xiaoma-domain-research/SKILL.md.bak +6 -0
  107. package/src/xmc/workflows/1-analysis/research/xiaoma-domain-research/domain-steps/step-01-init.md +137 -0
  108. package/src/xmc/workflows/1-analysis/research/xiaoma-domain-research/domain-steps/step-02-domain-analysis.md +229 -0
  109. package/src/xmc/workflows/1-analysis/research/xiaoma-domain-research/domain-steps/step-03-competitive-landscape.md +238 -0
  110. package/src/xmc/workflows/1-analysis/research/xiaoma-domain-research/domain-steps/step-04-regulatory-focus.md +206 -0
  111. package/src/xmc/workflows/1-analysis/research/xiaoma-domain-research/domain-steps/step-05-technical-trends.md +234 -0
  112. package/src/xmc/workflows/1-analysis/research/xiaoma-domain-research/research.template.md +29 -0
  113. package/src/xmc/workflows/1-analysis/research/xiaoma-domain-research/workflow.md +49 -0
  114. package/src/xmc/workflows/1-analysis/research/xiaoma-domain-research/xiaoma-skill-manifest.yaml +1 -0
  115. package/src/xmc/workflows/1-analysis/research/xiaoma-market-research/SKILL.md +6 -0
  116. package/src/xmc/workflows/1-analysis/research/xiaoma-market-research/SKILL.md.bak +6 -0
  117. package/src/xmc/workflows/1-analysis/research/xiaoma-market-research/research.template.md +29 -0
  118. package/src/xmc/workflows/1-analysis/research/xiaoma-market-research/steps/step-01-init.md +184 -0
  119. package/src/xmc/workflows/1-analysis/research/xiaoma-market-research/steps/step-02-customer-behavior.md +239 -0
  120. package/src/xmc/workflows/1-analysis/research/xiaoma-market-research/steps/step-03-customer-pain-points.md +251 -0
  121. package/src/xmc/workflows/1-analysis/research/xiaoma-market-research/steps/step-04-customer-decisions.md +261 -0
  122. package/src/xmc/workflows/1-analysis/research/xiaoma-market-research/steps/step-05-competitive-analysis.md +173 -0
  123. package/src/xmc/workflows/1-analysis/research/xiaoma-market-research/steps/step-06-research-completion.md +478 -0
  124. package/src/xmc/workflows/1-analysis/research/xiaoma-market-research/workflow.md +49 -0
  125. package/src/xmc/workflows/1-analysis/research/xiaoma-market-research/xiaoma-skill-manifest.yaml +1 -0
  126. package/src/xmc/workflows/1-analysis/research/xiaoma-technical-research/SKILL.md +6 -0
  127. package/src/xmc/workflows/1-analysis/research/xiaoma-technical-research/SKILL.md.bak +6 -0
  128. package/src/xmc/workflows/1-analysis/research/xiaoma-technical-research/research.template.md +29 -0
  129. package/src/xmc/workflows/1-analysis/research/xiaoma-technical-research/technical-steps/step-01-init.md +137 -0
  130. package/src/xmc/workflows/1-analysis/research/xiaoma-technical-research/technical-steps/step-02-technical-overview.md +239 -0
  131. package/src/xmc/workflows/1-analysis/research/xiaoma-technical-research/technical-steps/step-03-integration-patterns.md +248 -0
  132. package/src/xmc/workflows/1-analysis/research/xiaoma-technical-research/technical-steps/step-04-architectural-patterns.md +202 -0
  133. package/src/xmc/workflows/1-analysis/research/xiaoma-technical-research/technical-steps/step-05-implementation-research.md +233 -0
  134. package/src/xmc/workflows/1-analysis/research/xiaoma-technical-research/workflow.md +50 -0
  135. package/src/xmc/workflows/1-analysis/research/xiaoma-technical-research/xiaoma-skill-manifest.yaml +1 -0
  136. package/src/xmc/workflows/1-analysis/xiaoma-create-product-brief/SKILL.md +6 -0
  137. package/src/xmc/workflows/1-analysis/xiaoma-create-product-brief/SKILL.md.bak +6 -0
  138. package/src/xmc/workflows/1-analysis/xiaoma-create-product-brief/product-brief.template.md +10 -0
  139. package/src/xmc/workflows/1-analysis/xiaoma-create-product-brief/steps/step-01-init.md +170 -0
  140. package/src/xmc/workflows/1-analysis/xiaoma-create-product-brief/steps/step-01b-continue.md +158 -0
  141. package/src/xmc/workflows/1-analysis/xiaoma-create-product-brief/steps/step-02-vision.md +192 -0
  142. package/src/xmc/workflows/1-analysis/xiaoma-create-product-brief/steps/step-03-users.md +195 -0
  143. package/src/xmc/workflows/1-analysis/xiaoma-create-product-brief/steps/step-04-metrics.md +198 -0
  144. package/src/xmc/workflows/1-analysis/xiaoma-create-product-brief/steps/step-05-scope.md +212 -0
  145. package/src/xmc/workflows/1-analysis/xiaoma-create-product-brief/steps/step-06-complete.md +159 -0
  146. package/src/xmc/workflows/1-analysis/xiaoma-create-product-brief/workflow.md +55 -0
  147. package/src/xmc/workflows/1-analysis/xiaoma-create-product-brief/xiaoma-skill-manifest.yaml +1 -0
  148. package/src/xmc/workflows/1-analysis/xiaoma-product-brief-preview/SKILL.md +88 -0
  149. package/src/xmc/workflows/1-analysis/xiaoma-product-brief-preview/SKILL.md.bak +88 -0
  150. package/src/xmc/workflows/1-analysis/xiaoma-product-brief-preview/agents/artifact-analyzer.md +60 -0
  151. package/src/xmc/workflows/1-analysis/xiaoma-product-brief-preview/agents/opportunity-reviewer.md +44 -0
  152. package/src/xmc/workflows/1-analysis/xiaoma-product-brief-preview/agents/skeptic-reviewer.md +44 -0
  153. package/src/xmc/workflows/1-analysis/xiaoma-product-brief-preview/agents/web-researcher.md +49 -0
  154. package/src/xmc/workflows/1-analysis/xiaoma-product-brief-preview/prompts/contextual-discovery.md +57 -0
  155. package/src/xmc/workflows/1-analysis/xiaoma-product-brief-preview/prompts/draft-and-review.md +86 -0
  156. package/src/xmc/workflows/1-analysis/xiaoma-product-brief-preview/prompts/finalize.md +75 -0
  157. package/src/xmc/workflows/1-analysis/xiaoma-product-brief-preview/prompts/guided-elicitation.md +70 -0
  158. package/src/xmc/workflows/1-analysis/xiaoma-product-brief-preview/resources/brief-template.md +60 -0
  159. package/src/xmc/workflows/1-analysis/xiaoma-product-brief-preview/xiaoma-manifest.json +17 -0
  160. package/src/xmc/workflows/1-analysis/xiaoma-product-brief-preview/xiaoma-skill-manifest.yaml +1 -0
  161. package/src/xmc/workflows/2-plan-workflows/create-prd/data/prd-purpose.md +4 -4
  162. package/src/xmc/workflows/2-plan-workflows/create-prd/data/project-types.csv +1 -1
  163. package/src/xmc/workflows/2-plan-workflows/create-prd/steps-v/step-v-01-discovery.md +3 -5
  164. package/src/xmc/workflows/2-plan-workflows/create-prd/steps-v/step-v-02-format-detection.md +16 -16
  165. package/src/xmc/workflows/2-plan-workflows/create-prd/steps-v/step-v-02b-parity-check.md +9 -9
  166. package/src/xmc/workflows/2-plan-workflows/create-prd/steps-v/step-v-03-density-validation.md +1 -1
  167. package/src/xmc/workflows/2-plan-workflows/create-prd/steps-v/step-v-10-smart-validation.md +1 -1
  168. package/src/xmc/workflows/2-plan-workflows/create-prd/steps-v/step-v-11-holistic-quality-validation.md +11 -11
  169. package/src/xmc/workflows/2-plan-workflows/create-prd/steps-v/step-v-13-report-complete.md +1 -0
  170. package/src/xmc/workflows/2-plan-workflows/create-prd/workflow-validate-prd.md +4 -2
  171. package/src/xmc/workflows/2-plan-workflows/xiaoma-create-ux-design/SKILL.md +6 -0
  172. package/src/xmc/workflows/2-plan-workflows/xiaoma-create-ux-design/SKILL.md.bak +6 -0
  173. package/src/xmc/workflows/2-plan-workflows/xiaoma-create-ux-design/steps/step-01-init.md +135 -0
  174. package/src/xmc/workflows/2-plan-workflows/xiaoma-create-ux-design/steps/step-01b-continue.md +127 -0
  175. package/src/xmc/workflows/2-plan-workflows/xiaoma-create-ux-design/steps/step-02-discovery.md +190 -0
  176. package/src/xmc/workflows/2-plan-workflows/xiaoma-create-ux-design/steps/step-03-core-experience.md +217 -0
  177. package/src/xmc/workflows/2-plan-workflows/xiaoma-create-ux-design/steps/step-04-emotional-response.md +220 -0
  178. package/src/xmc/workflows/2-plan-workflows/xiaoma-create-ux-design/steps/step-05-inspiration.md +235 -0
  179. package/src/xmc/workflows/2-plan-workflows/xiaoma-create-ux-design/steps/step-06-design-system.md +253 -0
  180. package/src/xmc/workflows/2-plan-workflows/xiaoma-create-ux-design/steps/step-07-defining-experience.md +255 -0
  181. package/src/xmc/workflows/2-plan-workflows/xiaoma-create-ux-design/steps/step-08-visual-foundation.md +225 -0
  182. package/src/xmc/workflows/2-plan-workflows/xiaoma-create-ux-design/steps/step-09-design-directions.md +225 -0
  183. package/src/xmc/workflows/2-plan-workflows/xiaoma-create-ux-design/steps/step-10-user-journeys.md +242 -0
  184. package/src/xmc/workflows/2-plan-workflows/xiaoma-create-ux-design/steps/step-11-component-strategy.md +249 -0
  185. package/src/xmc/workflows/2-plan-workflows/xiaoma-create-ux-design/steps/step-12-ux-patterns.md +238 -0
  186. package/src/xmc/workflows/2-plan-workflows/xiaoma-create-ux-design/steps/step-13-responsive-accessibility.md +265 -0
  187. package/src/xmc/workflows/2-plan-workflows/xiaoma-create-ux-design/steps/step-14-complete.md +171 -0
  188. package/src/xmc/workflows/2-plan-workflows/xiaoma-create-ux-design/workflow.md +36 -0
  189. package/src/xmc/workflows/2-plan-workflows/xiaoma-create-ux-design/xiaoma-skill-manifest.yaml +1 -0
  190. package/src/xmc/workflows/2-plan-workflows/xiaoma-edit-prd/SKILL.md +6 -0
  191. package/src/xmc/workflows/2-plan-workflows/xiaoma-edit-prd/SKILL.md.bak +6 -0
  192. package/src/xmc/workflows/2-plan-workflows/xiaoma-edit-prd/steps-e/step-e-01-discovery.md +246 -0
  193. package/src/xmc/workflows/2-plan-workflows/xiaoma-edit-prd/steps-e/step-e-01b-legacy-conversion.md +208 -0
  194. package/src/xmc/workflows/2-plan-workflows/xiaoma-edit-prd/steps-e/step-e-02-review.md +249 -0
  195. package/src/xmc/workflows/2-plan-workflows/xiaoma-edit-prd/steps-e/step-e-03-edit.md +254 -0
  196. package/src/xmc/workflows/2-plan-workflows/xiaoma-edit-prd/steps-e/step-e-04-complete.md +168 -0
  197. package/src/xmc/workflows/2-plan-workflows/xiaoma-edit-prd/workflow.md +64 -0
  198. package/src/xmc/workflows/2-plan-workflows/xiaoma-edit-prd/xiaoma-skill-manifest.yaml +1 -0
  199. package/src/xmc/workflows/2-plan-workflows/xiaoma-validate-prd/SKILL.md +6 -0
  200. package/src/xmc/workflows/2-plan-workflows/xiaoma-validate-prd/SKILL.md.bak +6 -0
  201. package/src/xmc/workflows/2-plan-workflows/xiaoma-validate-prd/data/domain-complexity.csv +15 -0
  202. package/src/xmc/workflows/2-plan-workflows/xiaoma-validate-prd/data/prd-purpose.md +197 -0
  203. package/src/xmc/workflows/2-plan-workflows/xiaoma-validate-prd/data/project-types.csv +11 -0
  204. package/src/xmc/workflows/2-plan-workflows/xiaoma-validate-prd/steps-v/step-v-01-discovery.md +224 -0
  205. package/src/xmc/workflows/2-plan-workflows/xiaoma-validate-prd/steps-v/step-v-02-format-detection.md +191 -0
  206. package/src/xmc/workflows/2-plan-workflows/xiaoma-validate-prd/steps-v/step-v-02b-parity-check.md +209 -0
  207. package/src/xmc/workflows/2-plan-workflows/xiaoma-validate-prd/steps-v/step-v-03-density-validation.md +174 -0
  208. package/src/xmc/workflows/2-plan-workflows/xiaoma-validate-prd/steps-v/step-v-04-brief-coverage-validation.md +214 -0
  209. package/src/xmc/workflows/2-plan-workflows/xiaoma-validate-prd/steps-v/step-v-05-measurability-validation.md +228 -0
  210. package/src/xmc/workflows/2-plan-workflows/xiaoma-validate-prd/steps-v/step-v-06-traceability-validation.md +217 -0
  211. package/src/xmc/workflows/2-plan-workflows/xiaoma-validate-prd/steps-v/step-v-07-implementation-leakage-validation.md +205 -0
  212. package/src/xmc/workflows/2-plan-workflows/xiaoma-validate-prd/steps-v/step-v-08-domain-compliance-validation.md +243 -0
  213. package/src/xmc/workflows/2-plan-workflows/xiaoma-validate-prd/steps-v/step-v-09-project-type-validation.md +263 -0
  214. package/src/xmc/workflows/2-plan-workflows/xiaoma-validate-prd/steps-v/step-v-10-smart-validation.md +209 -0
  215. package/src/xmc/workflows/2-plan-workflows/xiaoma-validate-prd/steps-v/step-v-11-holistic-quality-validation.md +264 -0
  216. package/src/xmc/workflows/2-plan-workflows/xiaoma-validate-prd/steps-v/step-v-12-completeness-validation.md +242 -0
  217. package/src/xmc/workflows/2-plan-workflows/xiaoma-validate-prd/steps-v/step-v-13-report-complete.md +232 -0
  218. package/src/xmc/workflows/2-plan-workflows/xiaoma-validate-prd/workflow.md +62 -0
  219. package/src/xmc/workflows/2-plan-workflows/xiaoma-validate-prd/xiaoma-skill-manifest.yaml +1 -0
  220. package/src/xmc/workflows/3-solutioning/xiaoma-check-implementation-readiness/SKILL.md +6 -0
  221. package/src/xmc/workflows/3-solutioning/xiaoma-check-implementation-readiness/SKILL.md.bak +6 -0
  222. package/src/xmc/workflows/3-solutioning/xiaoma-check-implementation-readiness/steps/step-01-document-discovery.md +179 -0
  223. package/src/xmc/workflows/3-solutioning/xiaoma-check-implementation-readiness/steps/step-02-prd-analysis.md +168 -0
  224. package/src/xmc/workflows/3-solutioning/xiaoma-check-implementation-readiness/steps/step-03-epic-coverage-validation.md +169 -0
  225. package/src/xmc/workflows/3-solutioning/xiaoma-check-implementation-readiness/steps/step-04-ux-alignment.md +129 -0
  226. package/src/xmc/workflows/3-solutioning/xiaoma-check-implementation-readiness/steps/step-05-epic-quality-review.md +241 -0
  227. package/src/xmc/workflows/3-solutioning/xiaoma-check-implementation-readiness/steps/step-06-final-assessment.md +126 -0
  228. package/src/xmc/workflows/3-solutioning/xiaoma-check-implementation-readiness/workflow.md +49 -0
  229. package/src/xmc/workflows/3-solutioning/xiaoma-check-implementation-readiness/xiaoma-skill-manifest.yaml +1 -0
  230. package/src/xmc/workflows/3-solutioning/xiaoma-create-architecture/SKILL.md +6 -0
  231. package/src/xmc/workflows/3-solutioning/xiaoma-create-architecture/SKILL.md.bak +6 -0
  232. package/src/xmc/workflows/3-solutioning/xiaoma-create-architecture/steps/step-01-init.md +153 -0
  233. package/src/xmc/workflows/3-solutioning/xiaoma-create-architecture/steps/step-01b-continue.md +173 -0
  234. package/src/xmc/workflows/3-solutioning/xiaoma-create-architecture/steps/step-02-context.md +224 -0
  235. package/src/xmc/workflows/3-solutioning/xiaoma-create-architecture/steps/step-03-starter.md +329 -0
  236. package/src/xmc/workflows/3-solutioning/xiaoma-create-architecture/steps/step-04-decisions.md +318 -0
  237. package/src/xmc/workflows/3-solutioning/xiaoma-create-architecture/steps/step-05-patterns.md +359 -0
  238. package/src/xmc/workflows/3-solutioning/xiaoma-create-architecture/steps/step-06-structure.md +379 -0
  239. package/src/xmc/workflows/3-solutioning/xiaoma-create-architecture/steps/step-07-validation.md +359 -0
  240. package/src/xmc/workflows/3-solutioning/xiaoma-create-architecture/workflow.md +38 -0
  241. package/src/xmc/workflows/3-solutioning/xiaoma-create-architecture/xiaoma-skill-manifest.yaml +1 -0
  242. package/src/xmc/workflows/3-solutioning/xiaoma-create-epics-and-stories/SKILL.md +6 -0
  243. package/src/xmc/workflows/3-solutioning/xiaoma-create-epics-and-stories/SKILL.md.bak +6 -0
  244. package/src/xmc/workflows/3-solutioning/xiaoma-create-epics-and-stories/steps/step-01-validate-prerequisites.md +255 -0
  245. package/src/xmc/workflows/3-solutioning/xiaoma-create-epics-and-stories/steps/step-02-design-epics.md +212 -0
  246. package/src/xmc/workflows/3-solutioning/xiaoma-create-epics-and-stories/steps/step-03-create-stories.md +255 -0
  247. package/src/xmc/workflows/3-solutioning/xiaoma-create-epics-and-stories/steps/step-04-final-validation.md +131 -0
  248. package/src/xmc/workflows/3-solutioning/xiaoma-create-epics-and-stories/templates/epics-template.md +61 -0
  249. package/src/xmc/workflows/3-solutioning/xiaoma-create-epics-and-stories/workflow.md +53 -0
  250. package/src/xmc/workflows/3-solutioning/xiaoma-create-epics-and-stories/xiaoma-skill-manifest.yaml +1 -0
  251. package/src/xmc/workflows/4-implementation/auto-story-pipeline/SKILL.md +6 -0
  252. package/src/xmc/workflows/4-implementation/auto-story-pipeline/checklist.md +22 -0
  253. package/src/xmc/workflows/4-implementation/auto-story-pipeline/steps/step-01-init-and-validate.md +160 -0
  254. package/src/xmc/workflows/4-implementation/auto-story-pipeline/steps/step-02-create-story.md +92 -0
  255. package/src/xmc/workflows/4-implementation/auto-story-pipeline/steps/step-03-validate-story.md +105 -0
  256. package/src/xmc/workflows/4-implementation/auto-story-pipeline/steps/step-04-develop-story.md +90 -0
  257. package/src/xmc/workflows/4-implementation/auto-story-pipeline/steps/step-05-code-review.md +96 -0
  258. package/src/xmc/workflows/4-implementation/auto-story-pipeline/steps/step-06-test-story.md +144 -0
  259. package/src/xmc/workflows/4-implementation/auto-story-pipeline/steps/step-07-fix-and-retest.md +121 -0
  260. package/src/xmc/workflows/4-implementation/auto-story-pipeline/steps/step-08-complete-story.md +115 -0
  261. package/src/xmc/workflows/4-implementation/auto-story-pipeline/steps/step-09-cycle-check.md +135 -0
  262. package/src/xmc/workflows/4-implementation/auto-story-pipeline/workflow.md +91 -0
  263. package/src/xmc/workflows/4-implementation/auto-story-pipeline/xiaoma-skill-manifest.yaml +3 -0
  264. package/src/xmc/workflows/4-implementation/xiaoma-code-review/SKILL.md +6 -0
  265. package/src/xmc/workflows/4-implementation/xiaoma-code-review/SKILL.md.bak +6 -0
  266. package/src/xmc/workflows/4-implementation/xiaoma-code-review/workflow.md +261 -0
  267. package/src/xmc/workflows/4-implementation/xiaoma-code-review/xiaoma-skill-manifest.yaml +1 -0
  268. package/src/xmc/workflows/4-implementation/xiaoma-correct-course/SKILL.md +6 -0
  269. package/src/xmc/workflows/4-implementation/xiaoma-correct-course/SKILL.md.bak +6 -0
  270. package/src/xmc/workflows/4-implementation/xiaoma-correct-course/checklist.md +288 -0
  271. package/src/xmc/workflows/4-implementation/xiaoma-correct-course/workflow.md +267 -0
  272. package/src/xmc/workflows/4-implementation/xiaoma-correct-course/xiaoma-skill-manifest.yaml +1 -0
  273. package/src/xmc/workflows/4-implementation/xiaoma-create-story/SKILL.md +6 -0
  274. package/src/xmc/workflows/4-implementation/xiaoma-create-story/SKILL.md.bak +6 -0
  275. package/src/xmc/workflows/4-implementation/xiaoma-create-story/checklist.md +357 -0
  276. package/src/xmc/workflows/4-implementation/xiaoma-create-story/workflow.md +380 -0
  277. package/src/xmc/workflows/4-implementation/xiaoma-create-story/xiaoma-skill-manifest.yaml +1 -0
  278. package/src/xmc/workflows/4-implementation/xiaoma-dev-story/SKILL.md +6 -0
  279. package/src/xmc/workflows/4-implementation/xiaoma-dev-story/SKILL.md.bak +6 -0
  280. package/src/xmc/workflows/4-implementation/xiaoma-dev-story/workflow.md +450 -0
  281. package/src/xmc/workflows/4-implementation/xiaoma-dev-story/xiaoma-skill-manifest.yaml +1 -0
  282. package/src/xmc/workflows/4-implementation/xiaoma-retrospective/SKILL.md +6 -0
  283. package/src/xmc/workflows/4-implementation/xiaoma-retrospective/SKILL.md.bak +6 -0
  284. package/src/xmc/workflows/4-implementation/xiaoma-retrospective/workflow.md +1479 -0
  285. package/src/xmc/workflows/4-implementation/xiaoma-retrospective/xiaoma-skill-manifest.yaml +1 -0
  286. package/src/xmc/workflows/4-implementation/xiaoma-sprint-planning/SKILL.md +6 -0
  287. package/src/xmc/workflows/4-implementation/xiaoma-sprint-planning/SKILL.md.bak +6 -0
  288. package/src/xmc/workflows/4-implementation/xiaoma-sprint-planning/workflow.md +263 -0
  289. package/src/xmc/workflows/4-implementation/xiaoma-sprint-planning/xiaoma-skill-manifest.yaml +1 -0
  290. package/src/xmc/workflows/4-implementation/xiaoma-sprint-status/SKILL.md +6 -0
  291. package/src/xmc/workflows/4-implementation/xiaoma-sprint-status/SKILL.md.bak +6 -0
  292. package/src/xmc/workflows/4-implementation/xiaoma-sprint-status/workflow.md +261 -0
  293. package/src/xmc/workflows/4-implementation/xiaoma-sprint-status/xiaoma-skill-manifest.yaml +1 -0
  294. package/src/xmc/workflows/xiaoma-document-project/SKILL.md +6 -0
  295. package/src/xmc/workflows/xiaoma-document-project/SKILL.md.bak +6 -0
  296. package/src/xmc/workflows/xiaoma-document-project/instructions.md +128 -0
  297. package/src/xmc/workflows/xiaoma-document-project/templates/index-template.md +169 -0
  298. package/src/xmc/workflows/xiaoma-document-project/templates/project-overview-template.md +103 -0
  299. package/src/xmc/workflows/xiaoma-document-project/templates/source-tree-template.md +135 -0
  300. package/src/xmc/workflows/xiaoma-document-project/workflow.md +27 -0
  301. package/src/xmc/workflows/xiaoma-document-project/workflows/deep-dive-instructions.md +299 -0
  302. package/src/xmc/workflows/xiaoma-document-project/workflows/deep-dive-workflow.md +34 -0
  303. package/src/xmc/workflows/xiaoma-document-project/workflows/full-scan-instructions.md +1107 -0
  304. package/src/xmc/workflows/xiaoma-document-project/workflows/full-scan-workflow.md +34 -0
  305. package/src/xmc/workflows/xiaoma-document-project/xiaoma-skill-manifest.yaml +1 -0
  306. package/src/xmc/workflows/xiaoma-generate-project-context/SKILL.md +6 -0
  307. package/src/xmc/workflows/xiaoma-generate-project-context/SKILL.md.bak +6 -0
  308. package/src/xmc/workflows/xiaoma-generate-project-context/steps/step-01-discover.md +184 -0
  309. package/src/xmc/workflows/xiaoma-generate-project-context/steps/step-02-generate.md +319 -0
  310. package/src/xmc/workflows/xiaoma-generate-project-context/workflow.md +43 -0
  311. package/src/xmc/workflows/xiaoma-generate-project-context/xiaoma-skill-manifest.yaml +1 -0
  312. package/src/xmc/workflows/xiaoma-qa-generate-e2e-tests/SKILL.md +6 -0
  313. package/src/xmc/workflows/xiaoma-qa-generate-e2e-tests/SKILL.md.bak +6 -0
  314. package/src/xmc/workflows/xiaoma-qa-generate-e2e-tests/checklist.md +33 -0
  315. package/src/xmc/workflows/xiaoma-qa-generate-e2e-tests/workflow.md +136 -0
  316. package/src/xmc/workflows/xiaoma-qa-generate-e2e-tests/xiaoma-skill-manifest.yaml +1 -0
  317. package/src/xmc/workflows/xiaoma-quick-flow/xiaoma-quick-dev/SKILL.md +6 -0
  318. package/src/xmc/workflows/xiaoma-quick-flow/xiaoma-quick-dev/SKILL.md.bak +6 -0
  319. package/src/xmc/workflows/xiaoma-quick-flow/xiaoma-quick-dev/steps/step-01-mode-detection.md +169 -0
  320. package/src/xmc/workflows/xiaoma-quick-flow/xiaoma-quick-dev/steps/step-02-context-gathering.md +114 -0
  321. package/src/xmc/workflows/xiaoma-quick-flow/xiaoma-quick-dev/steps/step-03-execute.md +107 -0
  322. package/src/xmc/workflows/xiaoma-quick-flow/xiaoma-quick-dev/steps/step-04-self-check.md +107 -0
  323. package/src/xmc/workflows/xiaoma-quick-flow/xiaoma-quick-dev/steps/step-05-adversarial-review.md +94 -0
  324. package/src/xmc/workflows/xiaoma-quick-flow/xiaoma-quick-dev/steps/step-06-resolve-findings.md +144 -0
  325. package/src/xmc/workflows/xiaoma-quick-flow/xiaoma-quick-dev/workflow.md +38 -0
  326. package/src/xmc/workflows/xiaoma-quick-flow/xiaoma-quick-dev/xiaoma-skill-manifest.yaml +1 -0
  327. package/src/xmc/workflows/xiaoma-quick-flow/xiaoma-quick-dev-new-preview/SKILL.md +1 -1
  328. package/src/xmc/workflows/xiaoma-quick-flow/xiaoma-quick-dev-new-preview/SKILL.md.bak +6 -0
  329. package/src/xmc/workflows/xiaoma-quick-flow/xiaoma-quick-dev-new-preview/steps/step-01-clarify-and-route.md +2 -5
  330. package/src/xmc/workflows/xiaoma-quick-flow/xiaoma-quick-dev-new-preview/steps/step-02-plan.md +2 -6
  331. package/src/xmc/workflows/xiaoma-quick-flow/xiaoma-quick-dev-new-preview/steps/step-03-implement.md +1 -3
  332. package/src/xmc/workflows/xiaoma-quick-flow/xiaoma-quick-dev-new-preview/steps/step-04-review.md +3 -8
  333. package/src/xmc/workflows/xiaoma-quick-flow/xiaoma-quick-dev-new-preview/steps/step-05-present.md +2 -4
  334. package/src/xmc/workflows/xiaoma-quick-flow/xiaoma-quick-dev-new-preview/workflow.md +0 -5
  335. package/src/xmc/workflows/xiaoma-quick-flow/xiaoma-quick-spec/SKILL.md +6 -0
  336. package/src/xmc/workflows/xiaoma-quick-flow/xiaoma-quick-spec/SKILL.md.bak +6 -0
  337. package/src/xmc/workflows/xiaoma-quick-flow/xiaoma-quick-spec/steps/step-01-understand.md +185 -0
  338. package/src/xmc/workflows/xiaoma-quick-flow/xiaoma-quick-spec/steps/step-02-investigate.md +140 -0
  339. package/src/xmc/workflows/xiaoma-quick-flow/xiaoma-quick-spec/steps/step-03-generate.md +123 -0
  340. package/src/xmc/workflows/xiaoma-quick-flow/xiaoma-quick-spec/steps/step-04-review.md +195 -0
  341. package/src/xmc/workflows/xiaoma-quick-flow/xiaoma-quick-spec/workflow.md +72 -0
  342. package/src/xmc/workflows/xiaoma-quick-flow/xiaoma-quick-spec/xiaoma-skill-manifest.yaml +1 -0
  343. package/tools/cli/README.md +4 -4
  344. package/tools/cli/commands/install.js +1 -1
  345. package/tools/cli/commands/status.js +4 -4
  346. package/tools/cli/commands/uninstall.js +9 -9
  347. package/tools/cli/external-official-modules.yaml +50 -47
  348. package/tools/cli/installers/install-messages.yaml +3 -3
  349. package/tools/cli/installers/lib/core/config-collector.js +2 -2
  350. package/tools/cli/installers/lib/core/dependency-resolver.js +2 -2
  351. package/tools/cli/installers/lib/core/detector.js +9 -9
  352. package/tools/cli/installers/lib/core/ide-config-manager.js +7 -7
  353. package/tools/cli/installers/lib/core/installer.js +74 -57
  354. package/tools/cli/installers/lib/core/manifest-generator.js +6 -6
  355. package/tools/cli/installers/lib/core/manifest.js +6 -4
  356. package/tools/cli/installers/lib/custom/handler.js +5 -5
  357. package/tools/cli/installers/lib/ide/_base-ide.js +15 -16
  358. package/tools/cli/installers/lib/ide/_config-driven.js +40 -35
  359. package/tools/cli/installers/lib/ide/manager.js +11 -11
  360. package/tools/cli/installers/lib/ide/platform-codes.yaml +3 -3
  361. package/tools/cli/installers/lib/ide/shared/agent-command-generator.js +5 -5
  362. package/tools/cli/installers/lib/ide/shared/path-utils.js +3 -3
  363. package/tools/cli/installers/lib/ide/shared/skill-manifest.js +2 -2
  364. package/tools/cli/installers/lib/ide/shared/task-tool-command-generator.js +18 -18
  365. package/tools/cli/installers/lib/ide/shared/workflow-command-generator.js +2 -2
  366. package/tools/cli/installers/lib/ide/shared/xiaoma-artifacts.js +5 -5
  367. package/tools/cli/installers/lib/ide/templates/agent-command-template.md +1 -1
  368. package/tools/cli/installers/lib/ide/templates/combined/antigravity.md +1 -1
  369. package/tools/cli/installers/lib/ide/templates/combined/default-agent.md +1 -1
  370. package/tools/cli/installers/lib/ide/templates/combined/default-task.md +1 -1
  371. package/tools/cli/installers/lib/ide/templates/combined/default-tool.md +1 -1
  372. package/tools/cli/installers/lib/ide/templates/combined/default-workflow.md +1 -1
  373. package/tools/cli/installers/lib/ide/templates/combined/gemini-agent.toml +5 -5
  374. package/tools/cli/installers/lib/ide/templates/combined/gemini-task.toml +4 -4
  375. package/tools/cli/installers/lib/ide/templates/combined/gemini-tool.toml +4 -4
  376. package/tools/cli/installers/lib/ide/templates/combined/gemini-workflow-yaml.toml +3 -3
  377. package/tools/cli/installers/lib/ide/templates/combined/gemini-workflow.toml +3 -3
  378. package/tools/cli/installers/lib/ide/templates/combined/kiro-agent.md +1 -1
  379. package/tools/cli/installers/lib/ide/templates/combined/kiro-task.md +1 -1
  380. package/tools/cli/installers/lib/ide/templates/combined/kiro-tool.md +1 -1
  381. package/tools/cli/installers/lib/ide/templates/combined/kiro-workflow.md +1 -1
  382. package/tools/cli/installers/lib/ide/templates/combined/opencode-agent.md +1 -1
  383. package/tools/cli/installers/lib/ide/templates/combined/opencode-task.md +3 -3
  384. package/tools/cli/installers/lib/ide/templates/combined/opencode-tool.md +3 -3
  385. package/tools/cli/installers/lib/ide/templates/combined/opencode-workflow-yaml.md +3 -3
  386. package/tools/cli/installers/lib/ide/templates/combined/opencode-workflow.md +3 -3
  387. package/tools/cli/installers/lib/ide/templates/combined/rovodev.md +1 -1
  388. package/tools/cli/installers/lib/ide/templates/combined/trae.md +1 -1
  389. package/tools/cli/installers/lib/ide/templates/combined/windsurf-workflow.md +1 -1
  390. package/tools/cli/installers/lib/modules/manager.js +22 -22
  391. package/tools/cli/lib/agent/compiler.js +4 -4
  392. package/tools/cli/lib/agent/installer.js +9 -9
  393. package/tools/cli/lib/agent/template-engine.js +1 -1
  394. package/tools/cli/lib/agent-party-generator.js +4 -4
  395. package/tools/cli/lib/cli-utils.js +1 -1
  396. package/tools/cli/lib/project-root.js +5 -5
  397. package/tools/cli/lib/prompts.js +1 -1
  398. package/tools/cli/lib/ui.js +49 -29
  399. package/tools/cli/lib/xml-handler.js +1 -1
  400. package/tools/cli/lib/yaml-format.js +1 -1
  401. package/tools/cli/lib/yaml-xml-builder.js +2 -2
  402. package/tools/cli/xiaoma-cli.js +3 -3
  403. package/tools/format-workflow-md.js +2 -2
  404. package/tools/migrate-custom-module-paths.js +0 -0
  405. package/tools/platform-codes.yaml +2 -2
  406. package/tools/schema/agent.js +1 -1
  407. package/tools/skill-validator.md +322 -0
  408. package/tools/xiaoma-npx-wrapper.js +1 -1
  409. package/.github/workflows/quality.yaml +0 -116
  410. package/.husky/pre-commit +0 -26
  411. package/.markdownlint-cli2.yaml +0 -41
  412. package/.prettierignore +0 -12
  413. package/.vscode/settings.json +0 -96
  414. package/XiaoMa-Cli.iml +0 -9
  415. package/custom/src/agents/commit-poet/commit-poet.agent.yaml +0 -129
  416. package/custom/src/agents/commit-poet/installation-guide.md +0 -36
  417. package/custom/src/agents/toolsmith/installation-guide.md +0 -36
  418. package/custom/src/agents/toolsmith/toolsmith-sidecar/instructions.md +0 -70
  419. package/custom/src/agents/toolsmith/toolsmith-sidecar/knowledge/bundlers.md +0 -111
  420. package/custom/src/agents/toolsmith/toolsmith-sidecar/knowledge/deploy.md +0 -70
  421. package/custom/src/agents/toolsmith/toolsmith-sidecar/knowledge/docs.md +0 -114
  422. package/custom/src/agents/toolsmith/toolsmith-sidecar/knowledge/installers.md +0 -134
  423. package/custom/src/agents/toolsmith/toolsmith-sidecar/knowledge/modules.md +0 -160
  424. package/custom/src/agents/toolsmith/toolsmith-sidecar/knowledge/tests.md +0 -103
  425. package/custom/src/agents/toolsmith/toolsmith-sidecar/memories.md +0 -17
  426. package/custom/src/agents/toolsmith/toolsmith.agent.yaml +0 -108
  427. package/docs/BUNDLE_DISTRIBUTION_SETUP.md +0 -95
  428. package/docs/agent-customization-guide.md +0 -208
  429. package/docs/custom-agent-installation.md +0 -183
  430. package/docs/document-sharding-guide.md +0 -449
  431. package/docs/explanation/advanced-elicitation.md +0 -49
  432. package/docs/explanation/adversarial-review.md +0 -59
  433. package/docs/explanation/brainstorming.md +0 -33
  434. package/docs/explanation/established-projects-faq.md +0 -50
  435. package/docs/explanation/party-mode.md +0 -59
  436. package/docs/explanation/preventing-agent-conflicts.md +0 -112
  437. package/docs/explanation/project-context.md +0 -157
  438. package/docs/explanation/quick-dev-new-preview.md +0 -73
  439. package/docs/explanation/quick-flow.md +0 -77
  440. package/docs/explanation/why-solutioning-matters.md +0 -77
  441. package/docs/how-to/customize-xiaoma.md +0 -172
  442. package/docs/how-to/established-projects.md +0 -117
  443. package/docs/how-to/get-answers-about-xiaoma.md +0 -134
  444. package/docs/how-to/install-xiaoma.md +0 -107
  445. package/docs/how-to/non-interactive-installation.md +0 -171
  446. package/docs/how-to/project-context.md +0 -136
  447. package/docs/how-to/quick-fixes.md +0 -123
  448. package/docs/how-to/shard-large-documents.md +0 -78
  449. package/docs/how-to/upgrade-to-v6.md +0 -100
  450. package/docs/ide-info/auggie.md +0 -31
  451. package/docs/ide-info/claude-code.md +0 -25
  452. package/docs/ide-info/cline.md +0 -31
  453. package/docs/ide-info/codex.md +0 -21
  454. package/docs/ide-info/crush.md +0 -30
  455. package/docs/ide-info/cursor.md +0 -25
  456. package/docs/ide-info/gemini.md +0 -25
  457. package/docs/ide-info/github-copilot.md +0 -26
  458. package/docs/ide-info/iflow.md +0 -33
  459. package/docs/ide-info/kilo.md +0 -24
  460. package/docs/ide-info/opencode.md +0 -24
  461. package/docs/ide-info/qwen.md +0 -25
  462. package/docs/ide-info/roo.md +0 -27
  463. package/docs/ide-info/rovo-dev.md +0 -388
  464. package/docs/ide-info/trae.md +0 -25
  465. package/docs/ide-info/windsurf.md +0 -22
  466. package/docs/index.md +0 -60
  467. package/docs/installers-bundlers/ide-injections.md +0 -186
  468. package/docs/installers-bundlers/installers-modules-platforms-reference.md +0 -379
  469. package/docs/rag/rag.md +0 -856
  470. package/docs/reference/agents.md +0 -28
  471. package/docs/reference/commands.md +0 -145
  472. package/docs/reference/modules.md +0 -76
  473. package/docs/reference/testing.md +0 -106
  474. package/docs/reference/workflow-map.md +0 -89
  475. package/docs/roadmap.mdx +0 -136
  476. package/docs/superpowers/plans/2026-03-11-upstream-sync-with-branding.md +0 -586
  477. package/docs/tutorials/getting-started.md +0 -273
  478. package/docs/v4-to-v6-upgrade.md +0 -220
  479. package/docs/v6-open-items.md +0 -17
  480. package/docs/web-bundles-gemini-gpt-guide.md +0 -468
  481. package/docs/zh-cn/404.md +0 -9
  482. package/docs/zh-cn/_STYLE_GUIDE.md +0 -370
  483. package/docs/zh-cn/explanation/advanced-elicitation.md +0 -62
  484. package/docs/zh-cn/explanation/adversarial-review.md +0 -71
  485. package/docs/zh-cn/explanation/brainstorming.md +0 -43
  486. package/docs/zh-cn/explanation/established-projects-faq.md +0 -60
  487. package/docs/zh-cn/explanation/party-mode.md +0 -79
  488. package/docs/zh-cn/explanation/preventing-agent-conflicts.md +0 -137
  489. package/docs/zh-cn/explanation/project-context.md +0 -176
  490. package/docs/zh-cn/explanation/quick-flow.md +0 -93
  491. package/docs/zh-cn/explanation/why-solutioning-matters.md +0 -90
  492. package/docs/zh-cn/how-to/customize-xiaoma.md +0 -182
  493. package/docs/zh-cn/how-to/established-projects.md +0 -134
  494. package/docs/zh-cn/how-to/get-answers-about-xiaoma.md +0 -144
  495. package/docs/zh-cn/how-to/install-xiaoma.md +0 -105
  496. package/docs/zh-cn/how-to/non-interactive-installation.md +0 -181
  497. package/docs/zh-cn/how-to/project-context.md +0 -152
  498. package/docs/zh-cn/how-to/quick-fixes.md +0 -140
  499. package/docs/zh-cn/how-to/shard-large-documents.md +0 -86
  500. package/docs/zh-cn/how-to/upgrade-to-v6.md +0 -120
  501. package/docs/zh-cn/index.md +0 -69
  502. package/docs/zh-cn/reference/agents.md +0 -41
  503. package/docs/zh-cn/reference/commands.md +0 -166
  504. package/docs/zh-cn/reference/modules.md +0 -94
  505. package/docs/zh-cn/reference/testing.md +0 -122
  506. package/docs/zh-cn/reference/workflow-map.md +0 -104
  507. package/docs/zh-cn/roadmap.mdx +0 -152
  508. package/docs/zh-cn/tutorials/getting-started.md +0 -300
  509. package/eslint.config.mjs +0 -144
  510. package/prettier.config.mjs +0 -32
  511. package/src/core/_module-installer/install-config.yaml +0 -29
  512. package/src/core/_module-installer/installer.js +0 -60
  513. package/src/core/agents/xiaoma-master.agent.yaml +0 -30
  514. package/src/core/agents/xiaoma-skill-manifest.yaml +0 -3
  515. package/src/core/agents/xiaoma-web-orchestrator.agent.xml +0 -113
  516. package/src/core/resources/excalidraw/README.md +0 -160
  517. package/src/core/resources/excalidraw/excalidraw-helpers.md +0 -127
  518. package/src/core/resources/excalidraw/library-loader.md +0 -50
  519. package/src/core/resources/excalidraw/validate-json-instructions.md +0 -79
  520. package/src/core/tasks/advanced-elicitation-methods.csv +0 -51
  521. package/src/core/tasks/advanced-elicitation.xml +0 -116
  522. package/src/core/tasks/editorial-review-prose.xml +0 -102
  523. package/src/core/tasks/editorial-review-structure.xml +0 -208
  524. package/src/core/tasks/help.md +0 -92
  525. package/src/core/tasks/index-docs.xml +0 -65
  526. package/src/core/tasks/review-adversarial-general.xml +0 -49
  527. package/src/core/tasks/review-edge-case-hunter.xml +0 -63
  528. package/src/core/tasks/shard-doc.xml +0 -108
  529. package/src/core/tasks/validate-workflow.xml +0 -89
  530. package/src/core/tasks/workflow.xml +0 -235
  531. package/src/core/tasks/xiaoma-help/workflow.md +0 -88
  532. package/src/core/tasks/xiaoma-skill-manifest.yaml +0 -19
  533. package/src/core/tools/shard-doc.xml +0 -109
  534. package/src/core/workflows/advanced-elicitation/workflow.md +0 -138
  535. package/src/core/workflows/advanced-elicitation/workflow.xml +0 -118
  536. package/src/core/workflows/advanced-elicitation/xiaoma-skill-manifest.yaml +0 -3
  537. package/src/core/workflows/brainstorming/steps/step-01-session-setup.md +0 -210
  538. package/src/core/workflows/brainstorming/steps/step-03-technique-execution.md +0 -399
  539. package/src/core/workflows/brainstorming/workflow.md +0 -60
  540. package/src/core/workflows/brainstorming/xiaoma-skill-manifest.yaml +0 -3
  541. package/src/core/workflows/party-mode/steps/step-01-agent-loading.md +0 -138
  542. package/src/core/workflows/party-mode/steps/step-02-discussion-orchestration.md +0 -187
  543. package/src/core/workflows/party-mode/steps/step-03-graceful-exit.md +0 -168
  544. package/src/core/workflows/party-mode/workflow.md +0 -194
  545. package/src/core/workflows/party-mode/xiaoma-skill-manifest.yaml +0 -3
  546. package/src/utility/agent-components/handler-validate-workflow.txt +0 -7
  547. package/src/utility/agent-components/handler-workflow.txt +0 -10
  548. package/src/utility/models/action-command-header.md +0 -0
  549. package/src/utility/models/agent-activation-ide.xml +0 -51
  550. package/src/utility/models/agent-activation-web.xml +0 -50
  551. package/src/utility/models/agent-command-header.md +0 -1
  552. package/src/utility/models/agent-config-template.md +0 -23
  553. package/src/utility/models/agent-in-team-activation.xml +0 -3
  554. package/src/utility/models/fragments/activation-rules.xml +0 -7
  555. package/src/utility/models/fragments/activation-steps.xml +0 -16
  556. package/src/utility/models/fragments/handler-action.xml +0 -4
  557. package/src/utility/models/fragments/handler-data.xml +0 -5
  558. package/src/utility/models/fragments/handler-exec.xml +0 -6
  559. package/src/utility/models/fragments/handler-multi.xml +0 -14
  560. package/src/utility/models/fragments/handler-tmpl.xml +0 -5
  561. package/src/utility/models/fragments/handler-validate-workflow.xml +0 -7
  562. package/src/utility/models/fragments/handler-workflow.xml +0 -9
  563. package/src/utility/models/fragments/menu-handlers.xml +0 -6
  564. package/src/utility/models/fragments/web-bundle-activation-steps.xml +0 -32
  565. package/src/utility/templates/agent.customize.template.yaml +0 -42
  566. package/src/xmc/_module-installer/install-config.yaml +0 -53
  567. package/src/xmc/_module-installer/installer.js +0 -131
  568. package/src/xmc/_module-installer/platform-specifics/claude-code.js +0 -35
  569. package/src/xmc/_module-installer/platform-specifics/windsurf.js +0 -32
  570. package/src/xmc/sub-modules/claude-code/config.yaml +0 -5
  571. package/src/xmc/sub-modules/claude-code/injections.yaml +0 -242
  572. package/src/xmc/sub-modules/claude-code/readme.md +0 -87
  573. package/src/xmc/sub-modules/claude-code/sub-agents/xiaoma-analysis/api-documenter.md +0 -102
  574. package/src/xmc/sub-modules/claude-code/sub-agents/xiaoma-analysis/codebase-analyzer.md +0 -82
  575. package/src/xmc/sub-modules/claude-code/sub-agents/xiaoma-analysis/data-analyst.md +0 -101
  576. package/src/xmc/sub-modules/claude-code/sub-agents/xiaoma-analysis/pattern-detector.md +0 -84
  577. package/src/xmc/sub-modules/claude-code/sub-agents/xiaoma-planning/dependency-mapper.md +0 -83
  578. package/src/xmc/sub-modules/claude-code/sub-agents/xiaoma-planning/epic-optimizer.md +0 -81
  579. package/src/xmc/sub-modules/claude-code/sub-agents/xiaoma-planning/requirements-analyst.md +0 -61
  580. package/src/xmc/sub-modules/claude-code/sub-agents/xiaoma-planning/technical-decisions-curator.md +0 -168
  581. package/src/xmc/sub-modules/claude-code/sub-agents/xiaoma-planning/trend-spotter.md +0 -115
  582. package/src/xmc/sub-modules/claude-code/sub-agents/xiaoma-planning/user-journey-mapper.md +0 -123
  583. package/src/xmc/sub-modules/claude-code/sub-agents/xiaoma-planning/user-researcher.md +0 -72
  584. package/src/xmc/sub-modules/claude-code/sub-agents/xiaoma-research/market-researcher.md +0 -51
  585. package/src/xmc/sub-modules/claude-code/sub-agents/xiaoma-research/tech-debt-auditor.md +0 -106
  586. package/src/xmc/sub-modules/claude-code/sub-agents/xiaoma-review/document-reviewer.md +0 -102
  587. package/src/xmc/sub-modules/claude-code/sub-agents/xiaoma-review/technical-evaluator.md +0 -68
  588. package/src/xmc/sub-modules/claude-code/sub-agents/xiaoma-review/test-coverage-analyzer.md +0 -108
  589. package/src/xmc/testarch/knowledge/api-request.md +0 -303
  590. package/src/xmc/testarch/knowledge/auth-session.md +0 -356
  591. package/src/xmc/testarch/knowledge/burn-in.md +0 -273
  592. package/src/xmc/testarch/knowledge/ci-burn-in.md +0 -675
  593. package/src/xmc/testarch/knowledge/component-tdd.md +0 -486
  594. package/src/xmc/testarch/knowledge/contract-testing.md +0 -957
  595. package/src/xmc/testarch/knowledge/data-factories.md +0 -500
  596. package/src/xmc/testarch/knowledge/email-auth.md +0 -721
  597. package/src/xmc/testarch/knowledge/error-handling.md +0 -725
  598. package/src/xmc/testarch/knowledge/feature-flags.md +0 -750
  599. package/src/xmc/testarch/knowledge/file-utils.md +0 -260
  600. package/src/xmc/testarch/knowledge/fixture-architecture.md +0 -401
  601. package/src/xmc/testarch/knowledge/fixtures-composition.md +0 -382
  602. package/src/xmc/testarch/knowledge/intercept-network-call.md +0 -280
  603. package/src/xmc/testarch/knowledge/log.md +0 -294
  604. package/src/xmc/testarch/knowledge/network-error-monitor.md +0 -272
  605. package/src/xmc/testarch/knowledge/network-first.md +0 -486
  606. package/src/xmc/testarch/knowledge/network-recorder.md +0 -265
  607. package/src/xmc/testarch/knowledge/nfr-criteria.md +0 -670
  608. package/src/xmc/testarch/knowledge/overview.md +0 -284
  609. package/src/xmc/testarch/knowledge/playwright-config.md +0 -730
  610. package/src/xmc/testarch/knowledge/probability-impact.md +0 -601
  611. package/src/xmc/testarch/knowledge/recurse.md +0 -296
  612. package/src/xmc/testarch/knowledge/risk-governance.md +0 -615
  613. package/src/xmc/testarch/knowledge/selective-testing.md +0 -732
  614. package/src/xmc/testarch/knowledge/selector-resilience.md +0 -527
  615. package/src/xmc/testarch/knowledge/test-healing-patterns.md +0 -644
  616. package/src/xmc/testarch/knowledge/test-levels-framework.md +0 -473
  617. package/src/xmc/testarch/knowledge/test-priorities-matrix.md +0 -373
  618. package/src/xmc/testarch/knowledge/test-quality.md +0 -664
  619. package/src/xmc/testarch/knowledge/timing-debugging.md +0 -372
  620. package/src/xmc/testarch/knowledge/visual-debugging.md +0 -524
  621. package/src/xmc/testarch/tea-index.csv +0 -33
  622. package/src/xmc/workflows/1-analysis/create-product-brief/product-brief.template.md +0 -10
  623. package/src/xmc/workflows/1-analysis/create-product-brief/steps/step-01-init.md +0 -177
  624. package/src/xmc/workflows/1-analysis/create-product-brief/steps/step-01b-continue.md +0 -161
  625. package/src/xmc/workflows/1-analysis/create-product-brief/steps/step-02-vision.md +0 -199
  626. package/src/xmc/workflows/1-analysis/create-product-brief/steps/step-03-users.md +0 -202
  627. package/src/xmc/workflows/1-analysis/create-product-brief/steps/step-04-metrics.md +0 -205
  628. package/src/xmc/workflows/1-analysis/create-product-brief/steps/step-05-scope.md +0 -219
  629. package/src/xmc/workflows/1-analysis/create-product-brief/steps/step-06-complete.md +0 -162
  630. package/src/xmc/workflows/1-analysis/create-product-brief/workflow.md +0 -57
  631. package/src/xmc/workflows/1-analysis/create-product-brief/xiaoma-skill-manifest.yaml +0 -3
  632. package/src/xmc/workflows/1-analysis/research/domain-steps/step-01-init.md +0 -137
  633. package/src/xmc/workflows/1-analysis/research/domain-steps/step-02-domain-analysis.md +0 -229
  634. package/src/xmc/workflows/1-analysis/research/domain-steps/step-03-competitive-landscape.md +0 -238
  635. package/src/xmc/workflows/1-analysis/research/domain-steps/step-04-regulatory-focus.md +0 -206
  636. package/src/xmc/workflows/1-analysis/research/domain-steps/step-05-technical-trends.md +0 -234
  637. package/src/xmc/workflows/1-analysis/research/technical-steps/step-01-init.md +0 -137
  638. package/src/xmc/workflows/1-analysis/research/technical-steps/step-02-technical-overview.md +0 -239
  639. package/src/xmc/workflows/1-analysis/research/technical-steps/step-03-integration-patterns.md +0 -248
  640. package/src/xmc/workflows/1-analysis/research/technical-steps/step-04-architectural-patterns.md +0 -202
  641. package/src/xmc/workflows/1-analysis/research/technical-steps/step-05-implementation-research.md +0 -233
  642. package/src/xmc/workflows/1-analysis/research/workflow-domain-research.md +0 -54
  643. package/src/xmc/workflows/1-analysis/research/workflow-market-research.md +0 -54
  644. package/src/xmc/workflows/1-analysis/research/workflow-technical-research.md +0 -54
  645. package/src/xmc/workflows/1-analysis/research/xiaoma-skill-manifest.yaml +0 -14
  646. package/src/xmc/workflows/2-plan-workflows/create-prd/steps-c/step-01-init.md +0 -191
  647. package/src/xmc/workflows/2-plan-workflows/create-prd/steps-c/step-01b-continue.md +0 -152
  648. package/src/xmc/workflows/2-plan-workflows/create-prd/steps-c/step-02-discovery.md +0 -224
  649. package/src/xmc/workflows/2-plan-workflows/create-prd/steps-c/step-02b-vision.md +0 -154
  650. package/src/xmc/workflows/2-plan-workflows/create-prd/steps-c/step-02c-executive-summary.md +0 -170
  651. package/src/xmc/workflows/2-plan-workflows/create-prd/steps-c/step-03-success.md +0 -226
  652. package/src/xmc/workflows/2-plan-workflows/create-prd/steps-c/step-04-journeys.md +0 -213
  653. package/src/xmc/workflows/2-plan-workflows/create-prd/steps-c/step-05-domain.md +0 -207
  654. package/src/xmc/workflows/2-plan-workflows/create-prd/steps-c/step-06-innovation.md +0 -226
  655. package/src/xmc/workflows/2-plan-workflows/create-prd/steps-c/step-07-project-type.md +0 -237
  656. package/src/xmc/workflows/2-plan-workflows/create-prd/steps-c/step-08-scoping.md +0 -228
  657. package/src/xmc/workflows/2-plan-workflows/create-prd/steps-c/step-09-functional.md +0 -231
  658. package/src/xmc/workflows/2-plan-workflows/create-prd/steps-c/step-10-nonfunctional.md +0 -242
  659. package/src/xmc/workflows/2-plan-workflows/create-prd/steps-c/step-11-polish.md +0 -217
  660. package/src/xmc/workflows/2-plan-workflows/create-prd/steps-c/step-12-complete.md +0 -124
  661. package/src/xmc/workflows/2-plan-workflows/create-prd/steps-e/step-e-01-discovery.md +0 -247
  662. package/src/xmc/workflows/2-plan-workflows/create-prd/steps-e/step-e-01b-legacy-conversion.md +0 -208
  663. package/src/xmc/workflows/2-plan-workflows/create-prd/steps-e/step-e-02-review.md +0 -249
  664. package/src/xmc/workflows/2-plan-workflows/create-prd/steps-e/step-e-03-edit.md +0 -253
  665. package/src/xmc/workflows/2-plan-workflows/create-prd/steps-e/step-e-04-complete.md +0 -168
  666. package/src/xmc/workflows/2-plan-workflows/create-prd/workflow-create-prd.md +0 -63
  667. package/src/xmc/workflows/2-plan-workflows/create-prd/workflow-edit-prd.md +0 -65
  668. package/src/xmc/workflows/2-plan-workflows/create-prd/xiaoma-skill-manifest.yaml +0 -14
  669. package/src/xmc/workflows/2-plan-workflows/create-ux-design/steps/step-01-init.md +0 -135
  670. package/src/xmc/workflows/2-plan-workflows/create-ux-design/steps/step-01b-continue.md +0 -127
  671. package/src/xmc/workflows/2-plan-workflows/create-ux-design/steps/step-02-discovery.md +0 -190
  672. package/src/xmc/workflows/2-plan-workflows/create-ux-design/steps/step-03-core-experience.md +0 -216
  673. package/src/xmc/workflows/2-plan-workflows/create-ux-design/steps/step-04-emotional-response.md +0 -219
  674. package/src/xmc/workflows/2-plan-workflows/create-ux-design/steps/step-05-inspiration.md +0 -234
  675. package/src/xmc/workflows/2-plan-workflows/create-ux-design/steps/step-06-design-system.md +0 -252
  676. package/src/xmc/workflows/2-plan-workflows/create-ux-design/steps/step-07-defining-experience.md +0 -254
  677. package/src/xmc/workflows/2-plan-workflows/create-ux-design/steps/step-08-visual-foundation.md +0 -224
  678. package/src/xmc/workflows/2-plan-workflows/create-ux-design/steps/step-09-design-directions.md +0 -224
  679. package/src/xmc/workflows/2-plan-workflows/create-ux-design/steps/step-10-user-journeys.md +0 -241
  680. package/src/xmc/workflows/2-plan-workflows/create-ux-design/steps/step-11-component-strategy.md +0 -248
  681. package/src/xmc/workflows/2-plan-workflows/create-ux-design/steps/step-12-ux-patterns.md +0 -237
  682. package/src/xmc/workflows/2-plan-workflows/create-ux-design/steps/step-13-responsive-accessibility.md +0 -264
  683. package/src/xmc/workflows/2-plan-workflows/create-ux-design/steps/step-14-complete.md +0 -171
  684. package/src/xmc/workflows/2-plan-workflows/create-ux-design/workflow.md +0 -42
  685. package/src/xmc/workflows/2-plan-workflows/create-ux-design/xiaoma-skill-manifest.yaml +0 -3
  686. package/src/xmc/workflows/3-solutioning/check-implementation-readiness/steps/step-01-document-discovery.md +0 -184
  687. package/src/xmc/workflows/3-solutioning/check-implementation-readiness/steps/step-02-prd-analysis.md +0 -172
  688. package/src/xmc/workflows/3-solutioning/check-implementation-readiness/steps/step-03-epic-coverage-validation.md +0 -173
  689. package/src/xmc/workflows/3-solutioning/check-implementation-readiness/steps/step-04-ux-alignment.md +0 -133
  690. package/src/xmc/workflows/3-solutioning/check-implementation-readiness/steps/step-05-epic-quality-review.md +0 -245
  691. package/src/xmc/workflows/3-solutioning/check-implementation-readiness/steps/step-06-final-assessment.md +0 -129
  692. package/src/xmc/workflows/3-solutioning/check-implementation-readiness/workflow.md +0 -54
  693. package/src/xmc/workflows/3-solutioning/check-implementation-readiness/xiaoma-skill-manifest.yaml +0 -3
  694. package/src/xmc/workflows/3-solutioning/create-architecture/steps/step-01-init.md +0 -153
  695. package/src/xmc/workflows/3-solutioning/create-architecture/steps/step-01b-continue.md +0 -173
  696. package/src/xmc/workflows/3-solutioning/create-architecture/steps/step-02-context.md +0 -224
  697. package/src/xmc/workflows/3-solutioning/create-architecture/steps/step-03-starter.md +0 -329
  698. package/src/xmc/workflows/3-solutioning/create-architecture/steps/step-04-decisions.md +0 -318
  699. package/src/xmc/workflows/3-solutioning/create-architecture/steps/step-05-patterns.md +0 -359
  700. package/src/xmc/workflows/3-solutioning/create-architecture/steps/step-06-structure.md +0 -379
  701. package/src/xmc/workflows/3-solutioning/create-architecture/steps/step-07-validation.md +0 -359
  702. package/src/xmc/workflows/3-solutioning/create-architecture/workflow.md +0 -49
  703. package/src/xmc/workflows/3-solutioning/create-architecture/xiaoma-skill-manifest.yaml +0 -3
  704. package/src/xmc/workflows/3-solutioning/create-epics-and-stories/steps/step-01-validate-prerequisites.md +0 -259
  705. package/src/xmc/workflows/3-solutioning/create-epics-and-stories/steps/step-02-design-epics.md +0 -233
  706. package/src/xmc/workflows/3-solutioning/create-epics-and-stories/steps/step-03-create-stories.md +0 -272
  707. package/src/xmc/workflows/3-solutioning/create-epics-and-stories/steps/step-04-final-validation.md +0 -149
  708. package/src/xmc/workflows/3-solutioning/create-epics-and-stories/templates/epics-template.md +0 -57
  709. package/src/xmc/workflows/3-solutioning/create-epics-and-stories/workflow.md +0 -58
  710. package/src/xmc/workflows/3-solutioning/create-epics-and-stories/xiaoma-skill-manifest.yaml +0 -3
  711. package/src/xmc/workflows/4-implementation/code-review/workflow.md +0 -271
  712. package/src/xmc/workflows/4-implementation/code-review/xiaoma-skill-manifest.yaml +0 -3
  713. package/src/xmc/workflows/4-implementation/correct-course/checklist.md +0 -288
  714. package/src/xmc/workflows/4-implementation/correct-course/workflow.md +0 -274
  715. package/src/xmc/workflows/4-implementation/correct-course/xiaoma-skill-manifest.yaml +0 -3
  716. package/src/xmc/workflows/4-implementation/create-story/checklist.md +0 -357
  717. package/src/xmc/workflows/4-implementation/create-story/workflow.md +0 -388
  718. package/src/xmc/workflows/4-implementation/create-story/xiaoma-skill-manifest.yaml +0 -3
  719. package/src/xmc/workflows/4-implementation/dev-story/workflow.md +0 -457
  720. package/src/xmc/workflows/4-implementation/dev-story/xiaoma-skill-manifest.yaml +0 -3
  721. package/src/xmc/workflows/4-implementation/retrospective/workflow.md +0 -1485
  722. package/src/xmc/workflows/4-implementation/retrospective/xiaoma-skill-manifest.yaml +0 -3
  723. package/src/xmc/workflows/4-implementation/sprint-planning/workflow.md +0 -271
  724. package/src/xmc/workflows/4-implementation/sprint-planning/xiaoma-skill-manifest.yaml +0 -3
  725. package/src/xmc/workflows/4-implementation/sprint-status/workflow.md +0 -267
  726. package/src/xmc/workflows/4-implementation/sprint-status/xiaoma-skill-manifest.yaml +0 -3
  727. package/src/xmc/workflows/document-project/instructions.md +0 -128
  728. package/src/xmc/workflows/document-project/templates/index-template.md +0 -169
  729. package/src/xmc/workflows/document-project/templates/project-overview-template.md +0 -103
  730. package/src/xmc/workflows/document-project/templates/source-tree-template.md +0 -135
  731. package/src/xmc/workflows/document-project/workflow.md +0 -39
  732. package/src/xmc/workflows/document-project/workflows/deep-dive-instructions.md +0 -297
  733. package/src/xmc/workflows/document-project/workflows/deep-dive-workflow.md +0 -42
  734. package/src/xmc/workflows/document-project/workflows/full-scan-instructions.md +0 -1105
  735. package/src/xmc/workflows/document-project/workflows/full-scan-workflow.md +0 -42
  736. package/src/xmc/workflows/document-project/xiaoma-skill-manifest.yaml +0 -3
  737. package/src/xmc/workflows/generate-project-context/steps/step-01-discover.md +0 -184
  738. package/src/xmc/workflows/generate-project-context/steps/step-02-generate.md +0 -318
  739. package/src/xmc/workflows/generate-project-context/workflow.md +0 -49
  740. package/src/xmc/workflows/generate-project-context/xiaoma-skill-manifest.yaml +0 -3
  741. package/src/xmc/workflows/qa-generate-e2e-tests/checklist.md +0 -33
  742. package/src/xmc/workflows/qa-generate-e2e-tests/workflow.md +0 -143
  743. package/src/xmc/workflows/qa-generate-e2e-tests/xiaoma-skill-manifest.yaml +0 -3
  744. package/src/xmc/workflows/xiaoma-quick-flow/quick-dev/steps/step-01-mode-detection.md +0 -174
  745. package/src/xmc/workflows/xiaoma-quick-flow/quick-dev/steps/step-02-context-gathering.md +0 -118
  746. package/src/xmc/workflows/xiaoma-quick-flow/quick-dev/steps/step-03-execute.md +0 -111
  747. package/src/xmc/workflows/xiaoma-quick-flow/quick-dev/steps/step-04-self-check.md +0 -111
  748. package/src/xmc/workflows/xiaoma-quick-flow/quick-dev/steps/step-05-adversarial-review.md +0 -98
  749. package/src/xmc/workflows/xiaoma-quick-flow/quick-dev/steps/step-06-resolve-findings.md +0 -146
  750. package/src/xmc/workflows/xiaoma-quick-flow/quick-dev/workflow.md +0 -50
  751. package/src/xmc/workflows/xiaoma-quick-flow/quick-dev/xiaoma-skill-manifest.yaml +0 -3
  752. package/src/xmc/workflows/xiaoma-quick-flow/quick-spec/steps/step-01-understand.md +0 -189
  753. package/src/xmc/workflows/xiaoma-quick-flow/quick-spec/steps/step-02-investigate.md +0 -143
  754. package/src/xmc/workflows/xiaoma-quick-flow/quick-spec/steps/step-03-generate.md +0 -126
  755. package/src/xmc/workflows/xiaoma-quick-flow/quick-spec/steps/step-04-review.md +0 -198
  756. package/src/xmc/workflows/xiaoma-quick-flow/quick-spec/workflow.md +0 -79
  757. package/src/xmc/workflows/xiaoma-quick-flow/quick-spec/xiaoma-skill-manifest.yaml +0 -3
  758. package/test/README.md +0 -295
  759. package/test/adversarial-review-tests/README.md +0 -56
  760. package/test/adversarial-review-tests/sample-content.md +0 -46
  761. package/test/adversarial-review-tests/test-cases.yaml +0 -103
  762. package/test/fixtures/agent-schema/invalid/critical-actions/actions-as-string.agent.yaml +0 -27
  763. package/test/fixtures/agent-schema/invalid/critical-actions/empty-string-in-actions.agent.yaml +0 -30
  764. package/test/fixtures/agent-schema/invalid/menu/empty-menu.agent.yaml +0 -22
  765. package/test/fixtures/agent-schema/invalid/menu/missing-menu.agent.yaml +0 -20
  766. package/test/fixtures/agent-schema/invalid/menu-commands/empty-command-target.agent.yaml +0 -25
  767. package/test/fixtures/agent-schema/invalid/menu-commands/no-command-target.agent.yaml +0 -24
  768. package/test/fixtures/agent-schema/invalid/menu-triggers/camel-case.agent.yaml +0 -25
  769. package/test/fixtures/agent-schema/invalid/menu-triggers/compound-invalid-format.agent.yaml +0 -25
  770. package/test/fixtures/agent-schema/invalid/menu-triggers/compound-mismatched-kebab.agent.yaml +0 -25
  771. package/test/fixtures/agent-schema/invalid/menu-triggers/duplicate-triggers.agent.yaml +0 -31
  772. package/test/fixtures/agent-schema/invalid/menu-triggers/empty-trigger.agent.yaml +0 -25
  773. package/test/fixtures/agent-schema/invalid/menu-triggers/leading-asterisk.agent.yaml +0 -25
  774. package/test/fixtures/agent-schema/invalid/menu-triggers/snake-case.agent.yaml +0 -25
  775. package/test/fixtures/agent-schema/invalid/menu-triggers/trigger-with-spaces.agent.yaml +0 -25
  776. package/test/fixtures/agent-schema/invalid/metadata/empty-module-string.agent.yaml +0 -26
  777. package/test/fixtures/agent-schema/invalid/metadata/empty-name.agent.yaml +0 -24
  778. package/test/fixtures/agent-schema/invalid/metadata/extra-metadata-fields.agent.yaml +0 -27
  779. package/test/fixtures/agent-schema/invalid/metadata/missing-id.agent.yaml +0 -23
  780. package/test/fixtures/agent-schema/invalid/persona/empty-principles-array.agent.yaml +0 -24
  781. package/test/fixtures/agent-schema/invalid/persona/empty-string-in-principles.agent.yaml +0 -27
  782. package/test/fixtures/agent-schema/invalid/persona/extra-persona-fields.agent.yaml +0 -27
  783. package/test/fixtures/agent-schema/invalid/persona/missing-role.agent.yaml +0 -24
  784. package/test/fixtures/agent-schema/invalid/prompts/empty-content.agent.yaml +0 -29
  785. package/test/fixtures/agent-schema/invalid/prompts/extra-prompt-fields.agent.yaml +0 -31
  786. package/test/fixtures/agent-schema/invalid/prompts/missing-content.agent.yaml +0 -28
  787. package/test/fixtures/agent-schema/invalid/prompts/missing-id.agent.yaml +0 -28
  788. package/test/fixtures/agent-schema/invalid/top-level/empty-file.agent.yaml +0 -5
  789. package/test/fixtures/agent-schema/invalid/top-level/extra-top-level-keys.agent.yaml +0 -28
  790. package/test/fixtures/agent-schema/invalid/top-level/missing-agent-key.agent.yaml +0 -11
  791. package/test/fixtures/agent-schema/invalid/yaml-errors/invalid-indentation.agent.yaml +0 -19
  792. package/test/fixtures/agent-schema/invalid/yaml-errors/malformed-yaml.agent.yaml +0 -18
  793. package/test/fixtures/agent-schema/valid/critical-actions/empty-critical-actions.agent.yaml +0 -24
  794. package/test/fixtures/agent-schema/valid/critical-actions/no-critical-actions.agent.yaml +0 -22
  795. package/test/fixtures/agent-schema/valid/critical-actions/valid-critical-actions.agent.yaml +0 -27
  796. package/test/fixtures/agent-schema/valid/menu/multiple-menu-items.agent.yaml +0 -31
  797. package/test/fixtures/agent-schema/valid/menu/single-menu-item.agent.yaml +0 -22
  798. package/test/fixtures/agent-schema/valid/menu-commands/all-command-types.agent.yaml +0 -38
  799. package/test/fixtures/agent-schema/valid/menu-commands/multiple-commands.agent.yaml +0 -23
  800. package/test/fixtures/agent-schema/valid/menu-triggers/compound-triggers.agent.yaml +0 -31
  801. package/test/fixtures/agent-schema/valid/menu-triggers/kebab-case-triggers.agent.yaml +0 -34
  802. package/test/fixtures/agent-schema/valid/metadata/core-agent-with-module.agent.yaml +0 -24
  803. package/test/fixtures/agent-schema/valid/metadata/empty-module-name-in-path.agent.yaml +0 -24
  804. package/test/fixtures/agent-schema/valid/metadata/malformed-path-treated-as-core.agent.yaml +0 -24
  805. package/test/fixtures/agent-schema/valid/metadata/module-agent-correct.agent.yaml +0 -24
  806. package/test/fixtures/agent-schema/valid/metadata/module-agent-missing-module.agent.yaml +0 -23
  807. package/test/fixtures/agent-schema/valid/metadata/wrong-module-value.agent.yaml +0 -24
  808. package/test/fixtures/agent-schema/valid/persona/complete-persona.agent.yaml +0 -24
  809. package/test/fixtures/agent-schema/valid/prompts/empty-prompts.agent.yaml +0 -24
  810. package/test/fixtures/agent-schema/valid/prompts/no-prompts.agent.yaml +0 -22
  811. package/test/fixtures/agent-schema/valid/prompts/valid-prompts-minimal.agent.yaml +0 -28
  812. package/test/fixtures/agent-schema/valid/prompts/valid-prompts-with-description.agent.yaml +0 -30
  813. package/test/fixtures/agent-schema/valid/top-level/minimal-core-agent.agent.yaml +0 -24
  814. package/test/fixtures/file-refs-csv/invalid/all-empty-workflow.csv +0 -3
  815. package/test/fixtures/file-refs-csv/invalid/empty-data.csv +0 -1
  816. package/test/fixtures/file-refs-csv/invalid/no-workflow-column.csv +0 -3
  817. package/test/fixtures/file-refs-csv/invalid/unresolvable-vars.csv +0 -3
  818. package/test/fixtures/file-refs-csv/valid/core-style.csv +0 -3
  819. package/test/fixtures/file-refs-csv/valid/minimal.csv +0 -2
  820. package/test/fixtures/file-refs-csv/valid/xmc-style.csv +0 -3
  821. package/test/test-agent-schema.js +0 -387
  822. package/test/test-cli-integration.sh +0 -159
  823. package/test/test-file-refs-csv.js +0 -133
  824. package/test/test-install-to-xiaoma.js +0 -154
  825. package/test/test-installation-components.js +0 -1802
  826. package/test/test-rehype-plugins.mjs +0 -1050
  827. package/test/test-workflow-path-regex.js +0 -88
  828. package/test/unit-test-schema.js +0 -133
  829. package/tools/build-docs.mjs +0 -464
  830. package/tools/cli/bundlers/bundle-web.js +0 -179
  831. package/tools/cli/bundlers/bundlers/bundle-web.js +0 -179
  832. package/tools/cli/bundlers/bundlers/test-analyst.js +0 -28
  833. package/tools/cli/bundlers/bundlers/test-bundler.js +0 -119
  834. package/tools/cli/bundlers/bundlers/web-bundler.js +0 -1754
  835. package/tools/cli/bundlers/test-analyst.js +0 -28
  836. package/tools/cli/bundlers/test-bundler.js +0 -119
  837. package/tools/cli/bundlers/web-bundler.js +0 -1754
  838. package/tools/cli/commands/agent-install.js +0 -409
  839. package/tools/cli/commands/build.js +0 -458
  840. package/tools/cli/commands/cleanup.js +0 -144
  841. package/tools/cli/commands/list.js +0 -43
  842. package/tools/cli/commands/update.js +0 -28
  843. package/tools/cli/installers/lib/ide/antigravity.js +0 -510
  844. package/tools/cli/installers/lib/ide/auggie.js +0 -232
  845. package/tools/cli/installers/lib/ide/claude-code.js +0 -512
  846. package/tools/cli/installers/lib/ide/cline.js +0 -269
  847. package/tools/cli/installers/lib/ide/codex.js +0 -440
  848. package/tools/cli/installers/lib/ide/crush.js +0 -287
  849. package/tools/cli/installers/lib/ide/cursor.js +0 -400
  850. package/tools/cli/installers/lib/ide/gemini.js +0 -253
  851. package/tools/cli/installers/lib/ide/github-copilot.js +0 -699
  852. package/tools/cli/installers/lib/ide/iflow.js +0 -172
  853. package/tools/cli/installers/lib/ide/kilo.js +0 -269
  854. package/tools/cli/installers/lib/ide/opencode.js +0 -257
  855. package/tools/cli/installers/lib/ide/qwen.js +0 -372
  856. package/tools/cli/installers/lib/ide/roo.js +0 -324
  857. package/tools/cli/installers/lib/ide/rovo-dev.js +0 -290
  858. package/tools/cli/installers/lib/ide/rovodev.js +0 -257
  859. package/tools/cli/installers/lib/ide/templates/combined/default-workflow-yaml.md +0 -14
  860. package/tools/cli/installers/lib/ide/templates/combined/kiro-workflow-yaml.md +0 -15
  861. package/tools/cli/installers/lib/ide/templates/gemini-agent-command.toml +0 -14
  862. package/tools/cli/installers/lib/ide/templates/gemini-task-command.toml +0 -12
  863. package/tools/cli/installers/lib/ide/templates/workflow-command-template.md +0 -13
  864. package/tools/cli/installers/lib/ide/templates/workflow-commander.md +0 -5
  865. package/tools/cli/installers/lib/ide/trae.js +0 -313
  866. package/tools/cli/installers/lib/ide/windsurf.js +0 -258
  867. package/tools/cli/lib/replace-project-root.js +0 -239
  868. package/tools/cli/regenerate-manifests.js +0 -28
  869. package/tools/cli/test-yaml-builder.js +0 -43
  870. package/tools/docs/_prompt-external-modules-page.md +0 -59
  871. package/tools/docs/fix-refs.md +0 -91
  872. package/tools/docs/native-skills-migration-checklist.md +0 -281
  873. package/tools/fix-doc-links.js +0 -285
  874. package/tools/flattener/aggregate.js +0 -76
  875. package/tools/flattener/binary.js +0 -80
  876. package/tools/flattener/discovery.js +0 -71
  877. package/tools/flattener/files.js +0 -35
  878. package/tools/flattener/flattener/aggregate.js +0 -76
  879. package/tools/flattener/flattener/binary.js +0 -80
  880. package/tools/flattener/flattener/discovery.js +0 -71
  881. package/tools/flattener/flattener/files.js +0 -35
  882. package/tools/flattener/flattener/ignoreRules.js +0 -172
  883. package/tools/flattener/flattener/main.js +0 -483
  884. package/tools/flattener/flattener/projectRoot.js +0 -201
  885. package/tools/flattener/flattener/prompts.js +0 -44
  886. package/tools/flattener/flattener/stats.helpers.js +0 -368
  887. package/tools/flattener/flattener/stats.js +0 -75
  888. package/tools/flattener/flattener/test-matrix.js +0 -409
  889. package/tools/flattener/flattener/xml.js +0 -88
  890. package/tools/flattener/ignoreRules.js +0 -172
  891. package/tools/flattener/main.js +0 -483
  892. package/tools/flattener/projectRoot.js +0 -201
  893. package/tools/flattener/prompts.js +0 -44
  894. package/tools/flattener/stats.helpers.js +0 -368
  895. package/tools/flattener/stats.js +0 -75
  896. package/tools/flattener/test-matrix.js +0 -409
  897. package/tools/flattener/xml.js +0 -88
  898. package/tools/validate-agent-schema.js +0 -110
  899. package/tools/validate-bundles.js +0 -87
  900. package/tools/validate-doc-links.js +0 -409
  901. package/tools/validate-file-refs.js +0 -556
  902. package/web-bundles/xmc/agents/analyst.xml +0 -109
  903. package/web-bundles/xmc/agents/architect.xml +0 -101
  904. package/web-bundles/xmc/agents/dev.xml +0 -106
  905. package/web-bundles/xmc/agents/pm.xml +0 -112
  906. package/web-bundles/xmc/agents/qa.xml +0 -126
  907. package/web-bundles/xmc/agents/quick-flow-solo-dev.xml +0 -104
  908. package/web-bundles/xmc/agents/sm.xml +0 -109
  909. package/web-bundles/xmc/agents/ux-designer.xml +0 -100
  910. package/web-bundles/xmc/teams/team-fullstack.xml +0 -1192
  911. /package/src/core/{workflows/advanced-elicitation → skills/xiaoma-advanced-elicitation}/methods.csv +0 -0
  912. /package/src/core/{tasks/xiaoma-help → skills/xiaoma-advanced-elicitation}/xiaoma-skill-manifest.yaml +0 -0
  913. /package/src/core/{workflows/brainstorming → skills/xiaoma-brainstorming}/brain-methods.csv +0 -0
  914. /package/src/core/{workflows/brainstorming → skills/xiaoma-brainstorming}/steps/step-01b-continue.md +0 -0
  915. /package/src/core/{workflows/brainstorming → skills/xiaoma-brainstorming}/steps/step-02a-user-selected.md +0 -0
  916. /package/src/core/{workflows/brainstorming → skills/xiaoma-brainstorming}/steps/step-02b-ai-recommended.md +0 -0
  917. /package/src/core/{workflows/brainstorming → skills/xiaoma-brainstorming}/steps/step-02c-random-selection.md +0 -0
  918. /package/src/core/{workflows/brainstorming → skills/xiaoma-brainstorming}/steps/step-02d-progressive-flow.md +0 -0
  919. /package/src/core/{workflows/brainstorming → skills/xiaoma-brainstorming}/steps/step-04-idea-organization.md +0 -0
  920. /package/src/core/{workflows/brainstorming → skills/xiaoma-brainstorming}/template.md +0 -0
  921. /package/src/core/{tasks/xiaoma-review-adversarial-general → skills/xiaoma-brainstorming}/xiaoma-skill-manifest.yaml +0 -0
  922. /package/src/core/{tasks/xiaoma-review-edge-case-hunter → skills/xiaoma-editorial-review-prose}/xiaoma-skill-manifest.yaml +0 -0
  923. /package/src/core/{tasks → skills}/xiaoma-help/SKILL.md +0 -0
  924. /package/src/core/{tasks → skills}/xiaoma-review-adversarial-general/SKILL.md +0 -0
  925. /package/src/core/{tasks → skills}/xiaoma-review-adversarial-general/workflow.md +0 -0
  926. /package/src/core/{tasks → skills}/xiaoma-review-edge-case-hunter/SKILL.md +0 -0
  927. /package/src/core/{tasks → skills}/xiaoma-review-edge-case-hunter/workflow.md +0 -0
  928. /package/src/{xmc/workflows/2-plan-workflows/create-prd → core/tasks/xiaoma-create-prd}/templates/prd-template.md +0 -0
  929. /package/src/xmc/workflows/1-analysis/research/{domain-steps → xiaoma-domain-research/domain-steps}/step-06-research-synthesis.md +0 -0
  930. /package/src/xmc/workflows/1-analysis/research/{technical-steps → xiaoma-technical-research/technical-steps}/step-06-research-synthesis.md +0 -0
  931. /package/src/xmc/workflows/2-plan-workflows/{create-ux-design → xiaoma-create-ux-design}/ux-design-template.md +0 -0
  932. /package/src/xmc/workflows/3-solutioning/{check-implementation-readiness → xiaoma-check-implementation-readiness}/templates/readiness-report-template.md +0 -0
  933. /package/src/xmc/workflows/3-solutioning/{create-architecture → xiaoma-create-architecture}/architecture-decision-template.md +0 -0
  934. /package/src/xmc/workflows/3-solutioning/{create-architecture → xiaoma-create-architecture}/data/domain-complexity.csv +0 -0
  935. /package/src/xmc/workflows/3-solutioning/{create-architecture → xiaoma-create-architecture}/data/project-types.csv +0 -0
  936. /package/src/xmc/workflows/3-solutioning/{create-architecture → xiaoma-create-architecture}/steps/step-08-complete.md +0 -0
  937. /package/src/xmc/workflows/4-implementation/{code-review → xiaoma-code-review}/checklist.md +0 -0
  938. /package/src/xmc/workflows/4-implementation/{code-review → xiaoma-code-review}/discover-inputs.md +0 -0
  939. /package/src/xmc/workflows/4-implementation/{create-story → xiaoma-create-story}/discover-inputs.md +0 -0
  940. /package/src/xmc/workflows/4-implementation/{create-story → xiaoma-create-story}/template.md +0 -0
  941. /package/src/xmc/workflows/4-implementation/{dev-story → xiaoma-dev-story}/checklist.md +0 -0
  942. /package/src/xmc/workflows/4-implementation/{sprint-planning → xiaoma-sprint-planning}/checklist.md +0 -0
  943. /package/src/xmc/workflows/4-implementation/{sprint-planning → xiaoma-sprint-planning}/sprint-status-template.yaml +0 -0
  944. /package/src/xmc/workflows/{document-project → xiaoma-document-project}/checklist.md +0 -0
  945. /package/src/xmc/workflows/{document-project → xiaoma-document-project}/documentation-requirements.csv +0 -0
  946. /package/src/xmc/workflows/{document-project → xiaoma-document-project}/templates/deep-dive-template.md +0 -0
  947. /package/src/xmc/workflows/{document-project → xiaoma-document-project}/templates/project-scan-report-schema.json +0 -0
  948. /package/src/xmc/workflows/{generate-project-context → xiaoma-generate-project-context}/project-context-template.md +0 -0
  949. /package/src/xmc/workflows/{generate-project-context → xiaoma-generate-project-context}/steps/step-03-complete.md +0 -0
  950. /package/src/xmc/workflows/xiaoma-quick-flow/{quick-spec → xiaoma-quick-spec}/tech-spec-template.md +0 -0
@@ -1,1802 +0,0 @@
1
- /**
2
- * Installation Component Tests
3
- *
4
- * Tests individual installation components in isolation:
5
- * - Agent YAML → XML compilation
6
- * - Manifest generation
7
- * - Path resolution
8
- * - Customization merging
9
- *
10
- * These are deterministic unit tests that don't require full installation.
11
- * Usage: node test/test-installation-components.js
12
- */
13
-
14
- const path = require('node:path');
15
- const os = require('node:os');
16
- const fs = require('fs-extra');
17
- const { YamlXmlBuilder } = require('../tools/cli/lib/yaml-xml-builder');
18
- const { ManifestGenerator } = require('../tools/cli/installers/lib/core/manifest-generator');
19
- const { IdeManager } = require('../tools/cli/installers/lib/ide/manager');
20
- const { clearCache, loadPlatformCodes } = require('../tools/cli/installers/lib/ide/platform-codes');
21
-
22
- // ANSI colors
23
- const colors = {
24
- reset: '\u001B[0m',
25
- green: '\u001B[32m',
26
- red: '\u001B[31m',
27
- yellow: '\u001B[33m',
28
- cyan: '\u001B[36m',
29
- dim: '\u001B[2m',
30
- };
31
-
32
- let passed = 0;
33
- let failed = 0;
34
-
35
- /**
36
- * Test helper: Assert condition
37
- */
38
- function assert(condition, testName, errorMessage = '') {
39
- if (condition) {
40
- console.log(`${colors.green}✓${colors.reset} ${testName}`);
41
- passed++;
42
- } else {
43
- console.log(`${colors.red}✗${colors.reset} ${testName}`);
44
- if (errorMessage) {
45
- console.log(` ${colors.dim}${errorMessage}${colors.reset}`);
46
- }
47
- failed++;
48
- }
49
- }
50
-
51
- async function createTestXiaoMaFixture() {
52
- const fixtureDir = await fs.mkdtemp(path.join(os.tmpdir(), 'xiaoma-fixture-'));
53
-
54
- // Minimal workflow manifest (generators check for this)
55
- await fs.ensureDir(path.join(fixtureDir, '_config'));
56
- await fs.writeFile(path.join(fixtureDir, '_config', 'workflow-manifest.csv'), '');
57
-
58
- // Minimal compiled agent for core/agents (contains <agent tag and frontmatter)
59
- const minimalAgent = [
60
- '---',
61
- 'name: "test agent"',
62
- 'description: "Minimal test agent fixture"',
63
- '---',
64
- '',
65
- 'You are a test agent.',
66
- '',
67
- '<agent id="test-agent.agent.yaml" name="Test Agent" title="Test Agent">',
68
- '<persona>Test persona</persona>',
69
- '</agent>',
70
- ].join('\n');
71
-
72
- await fs.ensureDir(path.join(fixtureDir, 'core', 'agents'));
73
- await fs.writeFile(path.join(fixtureDir, 'core', 'agents', 'xiaoma-master.md'), minimalAgent);
74
- // Skill manifest so the installer uses 'xiaoma-master' as the canonical skill name
75
- await fs.writeFile(
76
- path.join(fixtureDir, 'core', 'agents', 'xiaoma-skill-manifest.yaml'),
77
- 'xiaoma-master.md:\n canonicalId: xiaoma-master\n',
78
- );
79
-
80
- // Minimal compiled agent for xmc module (tests use selectedModules: ['xmc'])
81
- await fs.ensureDir(path.join(fixtureDir, 'xmc', 'agents'));
82
- await fs.writeFile(path.join(fixtureDir, 'xmc', 'agents', 'test-xmc-agent.md'), minimalAgent);
83
-
84
- return fixtureDir;
85
- }
86
-
87
- /**
88
- * Test Suite
89
- */
90
- async function runTests() {
91
- console.log(`${colors.cyan}========================================`);
92
- console.log('Installation Component Tests');
93
- console.log(`========================================${colors.reset}\n`);
94
-
95
- const projectRoot = path.join(__dirname, '..');
96
-
97
- // ============================================================
98
- // Test 1: YAML → XML Agent Compilation (In-Memory)
99
- // ============================================================
100
- console.log(`${colors.yellow}Test Suite 1: Agent Compilation${colors.reset}\n`);
101
-
102
- try {
103
- const builder = new YamlXmlBuilder();
104
- const pmAgentPath = path.join(projectRoot, 'src/xmc/agents/pm.agent.yaml');
105
-
106
- // Create temp output path
107
- const tempOutput = path.join(__dirname, 'temp-pm-agent.md');
108
-
109
- try {
110
- const result = await builder.buildAgent(pmAgentPath, null, tempOutput, { includeMetadata: true });
111
-
112
- assert(result && result.outputPath === tempOutput, 'Agent compilation returns result object with outputPath');
113
-
114
- // Read the output
115
- const compiled = await fs.readFile(tempOutput, 'utf8');
116
-
117
- assert(compiled.includes('<agent'), 'Compiled agent contains <agent> tag');
118
-
119
- assert(compiled.includes('<persona>'), 'Compiled agent contains <persona> tag');
120
-
121
- assert(compiled.includes('<menu>'), 'Compiled agent contains <menu> tag');
122
-
123
- assert(compiled.includes('Product Manager'), 'Compiled agent contains agent title');
124
-
125
- // Cleanup
126
- await fs.remove(tempOutput);
127
- } catch (error) {
128
- assert(false, 'Agent compilation succeeds', error.message);
129
- }
130
- } catch (error) {
131
- assert(false, 'YamlXmlBuilder instantiates', error.message);
132
- }
133
-
134
- console.log('');
135
-
136
- // ============================================================
137
- // Test 2: Customization Merging
138
- // ============================================================
139
- console.log(`${colors.yellow}Test Suite 2: Customization Merging${colors.reset}\n`);
140
-
141
- try {
142
- const builder = new YamlXmlBuilder();
143
-
144
- // Test deepMerge function
145
- const base = {
146
- agent: {
147
- metadata: { name: 'John', title: 'PM' },
148
- persona: { role: 'Product Manager', style: 'Analytical' },
149
- },
150
- };
151
-
152
- const customize = {
153
- agent: {
154
- metadata: { name: 'Sarah' }, // Override name only
155
- persona: { style: 'Concise' }, // Override style only
156
- },
157
- };
158
-
159
- const merged = builder.deepMerge(base, customize);
160
-
161
- assert(merged.agent.metadata.name === 'Sarah', 'Deep merge overrides customized name');
162
-
163
- assert(merged.agent.metadata.title === 'PM', 'Deep merge preserves non-overridden title');
164
-
165
- assert(merged.agent.persona.role === 'Product Manager', 'Deep merge preserves non-overridden role');
166
-
167
- assert(merged.agent.persona.style === 'Concise', 'Deep merge overrides customized style');
168
- } catch (error) {
169
- assert(false, 'Customization merging works', error.message);
170
- }
171
-
172
- console.log('');
173
-
174
- // ============================================================
175
- // Test 3: Path Resolution
176
- // ============================================================
177
- console.log(`${colors.yellow}Test Suite 3: Path Variable Resolution${colors.reset}\n`);
178
-
179
- try {
180
- const builder = new YamlXmlBuilder();
181
-
182
- // Test path resolution logic (if exposed)
183
- // This would test {project-root}, {installed_path}, {config_source} resolution
184
-
185
- const testPath = '{project-root}/xiaoma/xmc/config.yaml';
186
- const expectedPattern = /\/xiaoma\/xmc\/config\.yaml$/;
187
-
188
- assert(
189
- true, // Placeholder - would test actual resolution
190
- 'Path variable resolution pattern matches expected format',
191
- 'Note: This test validates path resolution logic exists',
192
- );
193
- } catch (error) {
194
- assert(false, 'Path resolution works', error.message);
195
- }
196
-
197
- console.log('');
198
-
199
- // ============================================================
200
- // Test 4: Windsurf Native Skills Install
201
- // ============================================================
202
- console.log(`${colors.yellow}Test Suite 4: Windsurf Native Skills${colors.reset}\n`);
203
-
204
- try {
205
- clearCache();
206
- const platformCodes = await loadPlatformCodes();
207
- const windsurfInstaller = platformCodes.platforms.windsurf?.installer;
208
-
209
- assert(windsurfInstaller?.target_dir === '.windsurf/skills', 'Windsurf target_dir uses native skills path');
210
-
211
- assert(windsurfInstaller?.skill_format === true, 'Windsurf installer enables native skill output');
212
-
213
- assert(
214
- Array.isArray(windsurfInstaller?.legacy_targets) && windsurfInstaller.legacy_targets.includes('.windsurf/workflows'),
215
- 'Windsurf installer cleans legacy workflow output',
216
- );
217
-
218
- const tempProjectDir = await fs.mkdtemp(path.join(os.tmpdir(), 'xiaoma-windsurf-test-'));
219
- const installedXiaoMaDir = await createTestXiaoMaFixture();
220
- const legacyDir = path.join(tempProjectDir, '.windsurf', 'workflows', 'xiaoma-legacy-dir');
221
- await fs.ensureDir(legacyDir);
222
- await fs.writeFile(path.join(tempProjectDir, '.windsurf', 'workflows', 'xiaoma-legacy.md'), 'legacy\n');
223
- await fs.writeFile(path.join(legacyDir, 'SKILL.md'), 'legacy\n');
224
-
225
- const ideManager = new IdeManager();
226
- await ideManager.ensureInitialized();
227
- const result = await ideManager.setup('windsurf', tempProjectDir, installedXiaoMaDir, {
228
- silent: true,
229
- selectedModules: ['xmc'],
230
- });
231
-
232
- assert(result.success === true, 'Windsurf setup succeeds against temp project');
233
-
234
- const skillFile = path.join(tempProjectDir, '.windsurf', 'skills', 'xiaoma-master', 'SKILL.md');
235
- assert(await fs.pathExists(skillFile), 'Windsurf install writes SKILL.md directory output');
236
-
237
- assert(!(await fs.pathExists(path.join(tempProjectDir, '.windsurf', 'workflows'))), 'Windsurf setup removes legacy workflows dir');
238
-
239
- await fs.remove(tempProjectDir);
240
- await fs.remove(installedXiaoMaDir);
241
- } catch (error) {
242
- assert(false, 'Windsurf native skills migration test succeeds', error.message);
243
- }
244
-
245
- console.log('');
246
-
247
- // ============================================================
248
- // Test 5: Kiro Native Skills Install
249
- // ============================================================
250
- console.log(`${colors.yellow}Test Suite 5: Kiro Native Skills${colors.reset}\n`);
251
-
252
- try {
253
- clearCache();
254
- const platformCodes = await loadPlatformCodes();
255
- const kiroInstaller = platformCodes.platforms.kiro?.installer;
256
-
257
- assert(kiroInstaller?.target_dir === '.kiro/skills', 'Kiro target_dir uses native skills path');
258
-
259
- assert(kiroInstaller?.skill_format === true, 'Kiro installer enables native skill output');
260
-
261
- assert(
262
- Array.isArray(kiroInstaller?.legacy_targets) && kiroInstaller.legacy_targets.includes('.kiro/steering'),
263
- 'Kiro installer cleans legacy steering output',
264
- );
265
-
266
- const tempProjectDir = await fs.mkdtemp(path.join(os.tmpdir(), 'xiaoma-kiro-test-'));
267
- const installedXiaoMaDir = await createTestXiaoMaFixture();
268
- const legacyDir = path.join(tempProjectDir, '.kiro', 'steering', 'xiaoma-legacy-dir');
269
- await fs.ensureDir(legacyDir);
270
- await fs.writeFile(path.join(tempProjectDir, '.kiro', 'steering', 'xiaoma-legacy.md'), 'legacy\n');
271
- await fs.writeFile(path.join(legacyDir, 'SKILL.md'), 'legacy\n');
272
-
273
- const ideManager = new IdeManager();
274
- await ideManager.ensureInitialized();
275
- const result = await ideManager.setup('kiro', tempProjectDir, installedXiaoMaDir, {
276
- silent: true,
277
- selectedModules: ['xmc'],
278
- });
279
-
280
- assert(result.success === true, 'Kiro setup succeeds against temp project');
281
-
282
- const skillFile = path.join(tempProjectDir, '.kiro', 'skills', 'xiaoma-master', 'SKILL.md');
283
- assert(await fs.pathExists(skillFile), 'Kiro install writes SKILL.md directory output');
284
-
285
- assert(!(await fs.pathExists(path.join(tempProjectDir, '.kiro', 'steering'))), 'Kiro setup removes legacy steering dir');
286
-
287
- await fs.remove(tempProjectDir);
288
- await fs.remove(installedXiaoMaDir);
289
- } catch (error) {
290
- assert(false, 'Kiro native skills migration test succeeds', error.message);
291
- }
292
-
293
- console.log('');
294
-
295
- // ============================================================
296
- // Test 6: Antigravity Native Skills Install
297
- // ============================================================
298
- console.log(`${colors.yellow}Test Suite 6: Antigravity Native Skills${colors.reset}\n`);
299
-
300
- try {
301
- clearCache();
302
- const platformCodes = await loadPlatformCodes();
303
- const antigravityInstaller = platformCodes.platforms.antigravity?.installer;
304
-
305
- assert(antigravityInstaller?.target_dir === '.agent/skills', 'Antigravity target_dir uses native skills path');
306
-
307
- assert(antigravityInstaller?.skill_format === true, 'Antigravity installer enables native skill output');
308
-
309
- assert(
310
- Array.isArray(antigravityInstaller?.legacy_targets) && antigravityInstaller.legacy_targets.includes('.agent/workflows'),
311
- 'Antigravity installer cleans legacy workflow output',
312
- );
313
-
314
- const tempProjectDir = await fs.mkdtemp(path.join(os.tmpdir(), 'xiaoma-antigravity-test-'));
315
- const installedXiaoMaDir = await createTestXiaoMaFixture();
316
- const legacyDir = path.join(tempProjectDir, '.agent', 'workflows', 'xiaoma-legacy-dir');
317
- await fs.ensureDir(legacyDir);
318
- await fs.writeFile(path.join(tempProjectDir, '.agent', 'workflows', 'xiaoma-legacy.md'), 'legacy\n');
319
- await fs.writeFile(path.join(legacyDir, 'SKILL.md'), 'legacy\n');
320
-
321
- const ideManager = new IdeManager();
322
- await ideManager.ensureInitialized();
323
- const result = await ideManager.setup('antigravity', tempProjectDir, installedXiaoMaDir, {
324
- silent: true,
325
- selectedModules: ['xmc'],
326
- });
327
-
328
- assert(result.success === true, 'Antigravity setup succeeds against temp project');
329
-
330
- const skillFile = path.join(tempProjectDir, '.agent', 'skills', 'xiaoma-master', 'SKILL.md');
331
- assert(await fs.pathExists(skillFile), 'Antigravity install writes SKILL.md directory output');
332
-
333
- assert(!(await fs.pathExists(path.join(tempProjectDir, '.agent', 'workflows'))), 'Antigravity setup removes legacy workflows dir');
334
-
335
- await fs.remove(tempProjectDir);
336
- await fs.remove(installedXiaoMaDir);
337
- } catch (error) {
338
- assert(false, 'Antigravity native skills migration test succeeds', error.message);
339
- }
340
-
341
- console.log('');
342
-
343
- // ============================================================
344
- // Test 7: Auggie Native Skills Install
345
- // ============================================================
346
- console.log(`${colors.yellow}Test Suite 7: Auggie Native Skills${colors.reset}\n`);
347
-
348
- try {
349
- clearCache();
350
- const platformCodes = await loadPlatformCodes();
351
- const auggieInstaller = platformCodes.platforms.auggie?.installer;
352
-
353
- assert(auggieInstaller?.target_dir === '.augment/skills', 'Auggie target_dir uses native skills path');
354
-
355
- assert(auggieInstaller?.skill_format === true, 'Auggie installer enables native skill output');
356
-
357
- assert(
358
- Array.isArray(auggieInstaller?.legacy_targets) && auggieInstaller.legacy_targets.includes('.augment/commands'),
359
- 'Auggie installer cleans legacy command output',
360
- );
361
-
362
- assert(
363
- auggieInstaller?.ancestor_conflict_check !== true,
364
- 'Auggie installer does not enable ancestor conflict checks without verified inheritance',
365
- );
366
-
367
- const tempProjectDir = await fs.mkdtemp(path.join(os.tmpdir(), 'xiaoma-auggie-test-'));
368
- const installedXiaoMaDir = await createTestXiaoMaFixture();
369
- const legacyDir = path.join(tempProjectDir, '.augment', 'commands', 'xiaoma-legacy-dir');
370
- await fs.ensureDir(legacyDir);
371
- await fs.writeFile(path.join(tempProjectDir, '.augment', 'commands', 'xiaoma-legacy.md'), 'legacy\n');
372
- await fs.writeFile(path.join(legacyDir, 'SKILL.md'), 'legacy\n');
373
-
374
- const ideManager = new IdeManager();
375
- await ideManager.ensureInitialized();
376
- const result = await ideManager.setup('auggie', tempProjectDir, installedXiaoMaDir, {
377
- silent: true,
378
- selectedModules: ['xmc'],
379
- });
380
-
381
- assert(result.success === true, 'Auggie setup succeeds against temp project');
382
-
383
- const skillFile = path.join(tempProjectDir, '.augment', 'skills', 'xiaoma-master', 'SKILL.md');
384
- assert(await fs.pathExists(skillFile), 'Auggie install writes SKILL.md directory output');
385
-
386
- assert(!(await fs.pathExists(path.join(tempProjectDir, '.augment', 'commands'))), 'Auggie setup removes legacy commands dir');
387
-
388
- await fs.remove(tempProjectDir);
389
- await fs.remove(installedXiaoMaDir);
390
- } catch (error) {
391
- assert(false, 'Auggie native skills migration test succeeds', error.message);
392
- }
393
-
394
- console.log('');
395
-
396
- // ============================================================
397
- // Test 8: OpenCode Native Skills Install
398
- // ============================================================
399
- console.log(`${colors.yellow}Test Suite 8: OpenCode Native Skills${colors.reset}\n`);
400
-
401
- try {
402
- clearCache();
403
- const platformCodes = await loadPlatformCodes();
404
- const opencodeInstaller = platformCodes.platforms.opencode?.installer;
405
-
406
- assert(opencodeInstaller?.target_dir === '.opencode/skills', 'OpenCode target_dir uses native skills path');
407
-
408
- assert(opencodeInstaller?.skill_format === true, 'OpenCode installer enables native skill output');
409
-
410
- assert(opencodeInstaller?.ancestor_conflict_check === true, 'OpenCode installer enables ancestor conflict checks');
411
-
412
- assert(
413
- Array.isArray(opencodeInstaller?.legacy_targets) &&
414
- ['.opencode/agents', '.opencode/commands', '.opencode/agent', '.opencode/command'].every((legacyTarget) =>
415
- opencodeInstaller.legacy_targets.includes(legacyTarget),
416
- ),
417
- 'OpenCode installer cleans split legacy agent and command output',
418
- );
419
-
420
- const tempProjectDir = await fs.mkdtemp(path.join(os.tmpdir(), 'xiaoma-opencode-test-'));
421
- const installedXiaoMaDir = await createTestXiaoMaFixture();
422
- const legacyDirs = [
423
- path.join(tempProjectDir, '.opencode', 'agents', 'xiaoma-legacy-agent'),
424
- path.join(tempProjectDir, '.opencode', 'commands', 'xiaoma-legacy-command'),
425
- path.join(tempProjectDir, '.opencode', 'agent', 'xiaoma-legacy-agent-singular'),
426
- path.join(tempProjectDir, '.opencode', 'command', 'xiaoma-legacy-command-singular'),
427
- ];
428
-
429
- for (const legacyDir of legacyDirs) {
430
- await fs.ensureDir(legacyDir);
431
- await fs.writeFile(path.join(legacyDir, 'SKILL.md'), 'legacy\n');
432
- await fs.writeFile(path.join(path.dirname(legacyDir), `${path.basename(legacyDir)}.md`), 'legacy\n');
433
- }
434
-
435
- const ideManager = new IdeManager();
436
- await ideManager.ensureInitialized();
437
- const result = await ideManager.setup('opencode', tempProjectDir, installedXiaoMaDir, {
438
- silent: true,
439
- selectedModules: ['xmc'],
440
- });
441
-
442
- assert(result.success === true, 'OpenCode setup succeeds against temp project');
443
-
444
- const skillFile = path.join(tempProjectDir, '.opencode', 'skills', 'xiaoma-master', 'SKILL.md');
445
- assert(await fs.pathExists(skillFile), 'OpenCode install writes SKILL.md directory output');
446
-
447
- for (const legacyDir of ['agents', 'commands', 'agent', 'command']) {
448
- assert(
449
- !(await fs.pathExists(path.join(tempProjectDir, '.opencode', legacyDir))),
450
- `OpenCode setup removes legacy .opencode/${legacyDir} dir`,
451
- );
452
- }
453
-
454
- await fs.remove(tempProjectDir);
455
- await fs.remove(installedXiaoMaDir);
456
- } catch (error) {
457
- assert(false, 'OpenCode native skills migration test succeeds', error.message);
458
- }
459
-
460
- console.log('');
461
-
462
- // ============================================================
463
- // Test 9: Claude Code Native Skills Install
464
- // ============================================================
465
- console.log(`${colors.yellow}Test Suite 9: Claude Code Native Skills${colors.reset}\n`);
466
-
467
- try {
468
- clearCache();
469
- const platformCodes9 = await loadPlatformCodes();
470
- const claudeInstaller = platformCodes9.platforms['claude-code']?.installer;
471
-
472
- assert(claudeInstaller?.target_dir === '.claude/skills', 'Claude Code target_dir uses native skills path');
473
-
474
- assert(claudeInstaller?.skill_format === true, 'Claude Code installer enables native skill output');
475
-
476
- assert(claudeInstaller?.ancestor_conflict_check === true, 'Claude Code installer enables ancestor conflict checks');
477
-
478
- assert(
479
- Array.isArray(claudeInstaller?.legacy_targets) && claudeInstaller.legacy_targets.includes('.claude/commands'),
480
- 'Claude Code installer cleans legacy command output',
481
- );
482
-
483
- const tempProjectDir9 = await fs.mkdtemp(path.join(os.tmpdir(), 'xiaoma-claude-code-test-'));
484
- const installedXiaoMaDir9 = await createTestXiaoMaFixture();
485
- const legacyDir9 = path.join(tempProjectDir9, '.claude', 'commands');
486
- await fs.ensureDir(legacyDir9);
487
- await fs.writeFile(path.join(legacyDir9, 'xiaoma-legacy.md'), 'legacy\n');
488
-
489
- const ideManager9 = new IdeManager();
490
- await ideManager9.ensureInitialized();
491
- const result9 = await ideManager9.setup('claude-code', tempProjectDir9, installedXiaoMaDir9, {
492
- silent: true,
493
- selectedModules: ['xmc'],
494
- });
495
-
496
- assert(result9.success === true, 'Claude Code setup succeeds against temp project');
497
-
498
- const skillFile9 = path.join(tempProjectDir9, '.claude', 'skills', 'xiaoma-master', 'SKILL.md');
499
- assert(await fs.pathExists(skillFile9), 'Claude Code install writes SKILL.md directory output');
500
-
501
- // Verify name frontmatter matches directory name
502
- const skillContent9 = await fs.readFile(skillFile9, 'utf8');
503
- const nameMatch9 = skillContent9.match(/^name:\s*(.+)$/m);
504
- assert(nameMatch9 && nameMatch9[1].trim() === 'xiaoma-master', 'Claude Code skill name frontmatter matches directory name exactly');
505
-
506
- assert(!(await fs.pathExists(legacyDir9)), 'Claude Code setup removes legacy commands dir');
507
-
508
- await fs.remove(tempProjectDir9);
509
- await fs.remove(installedXiaoMaDir9);
510
- } catch (error) {
511
- assert(false, 'Claude Code native skills migration test succeeds', error.message);
512
- }
513
-
514
- console.log('');
515
-
516
- // ============================================================
517
- // Test 10: Claude Code Ancestor Conflict
518
- // ============================================================
519
- console.log(`${colors.yellow}Test Suite 10: Claude Code Ancestor Conflict${colors.reset}\n`);
520
-
521
- try {
522
- const tempRoot10 = await fs.mkdtemp(path.join(os.tmpdir(), 'xiaoma-claude-code-ancestor-test-'));
523
- const parentProjectDir10 = path.join(tempRoot10, 'parent');
524
- const childProjectDir10 = path.join(parentProjectDir10, 'child');
525
- const installedXiaoMaDir10 = await createTestXiaoMaFixture();
526
-
527
- await fs.ensureDir(path.join(parentProjectDir10, '.git'));
528
- await fs.ensureDir(path.join(parentProjectDir10, '.claude', 'skills', 'xiaoma-existing'));
529
- await fs.ensureDir(childProjectDir10);
530
- await fs.writeFile(path.join(parentProjectDir10, '.claude', 'skills', 'xiaoma-existing', 'SKILL.md'), 'legacy\n');
531
-
532
- const ideManager10 = new IdeManager();
533
- await ideManager10.ensureInitialized();
534
- const result10 = await ideManager10.setup('claude-code', childProjectDir10, installedXiaoMaDir10, {
535
- silent: true,
536
- selectedModules: ['xmc'],
537
- });
538
- const expectedConflictDir10 = await fs.realpath(path.join(parentProjectDir10, '.claude', 'skills'));
539
-
540
- assert(result10.success === false, 'Claude Code setup refuses install when ancestor skills already exist');
541
- assert(result10.handlerResult?.reason === 'ancestor-conflict', 'Claude Code ancestor rejection reports ancestor-conflict reason');
542
- assert(
543
- result10.handlerResult?.conflictDir === expectedConflictDir10,
544
- 'Claude Code ancestor rejection points at ancestor .claude/skills dir',
545
- );
546
-
547
- await fs.remove(tempRoot10);
548
- await fs.remove(installedXiaoMaDir10);
549
- } catch (error) {
550
- assert(false, 'Claude Code ancestor conflict protection test succeeds', error.message);
551
- }
552
-
553
- console.log('');
554
-
555
- // ============================================================
556
- // Test 11: Codex Native Skills Install
557
- // ============================================================
558
- console.log(`${colors.yellow}Test Suite 11: Codex Native Skills${colors.reset}\n`);
559
-
560
- try {
561
- clearCache();
562
- const platformCodes11 = await loadPlatformCodes();
563
- const codexInstaller = platformCodes11.platforms.codex?.installer;
564
-
565
- assert(codexInstaller?.target_dir === '.agents/skills', 'Codex target_dir uses native skills path');
566
-
567
- assert(codexInstaller?.skill_format === true, 'Codex installer enables native skill output');
568
-
569
- assert(codexInstaller?.ancestor_conflict_check === true, 'Codex installer enables ancestor conflict checks');
570
-
571
- assert(
572
- Array.isArray(codexInstaller?.legacy_targets) && codexInstaller.legacy_targets.includes('.codex/prompts'),
573
- 'Codex installer cleans legacy prompt output',
574
- );
575
-
576
- const tempProjectDir11 = await fs.mkdtemp(path.join(os.tmpdir(), 'xiaoma-codex-test-'));
577
- const installedXiaoMaDir11 = await createTestXiaoMaFixture();
578
- const legacyDir11 = path.join(tempProjectDir11, '.codex', 'prompts');
579
- await fs.ensureDir(legacyDir11);
580
- await fs.writeFile(path.join(legacyDir11, 'xiaoma-legacy.md'), 'legacy\n');
581
-
582
- const ideManager11 = new IdeManager();
583
- await ideManager11.ensureInitialized();
584
- const result11 = await ideManager11.setup('codex', tempProjectDir11, installedXiaoMaDir11, {
585
- silent: true,
586
- selectedModules: ['xmc'],
587
- });
588
-
589
- assert(result11.success === true, 'Codex setup succeeds against temp project');
590
-
591
- const skillFile11 = path.join(tempProjectDir11, '.agents', 'skills', 'xiaoma-master', 'SKILL.md');
592
- assert(await fs.pathExists(skillFile11), 'Codex install writes SKILL.md directory output');
593
-
594
- // Verify name frontmatter matches directory name
595
- const skillContent11 = await fs.readFile(skillFile11, 'utf8');
596
- const nameMatch11 = skillContent11.match(/^name:\s*(.+)$/m);
597
- assert(nameMatch11 && nameMatch11[1].trim() === 'xiaoma-master', 'Codex skill name frontmatter matches directory name exactly');
598
-
599
- assert(!(await fs.pathExists(legacyDir11)), 'Codex setup removes legacy prompts dir');
600
-
601
- await fs.remove(tempProjectDir11);
602
- await fs.remove(installedXiaoMaDir11);
603
- } catch (error) {
604
- assert(false, 'Codex native skills migration test succeeds', error.message);
605
- }
606
-
607
- console.log('');
608
-
609
- // ============================================================
610
- // Test 12: Codex Ancestor Conflict
611
- // ============================================================
612
- console.log(`${colors.yellow}Test Suite 12: Codex Ancestor Conflict${colors.reset}\n`);
613
-
614
- try {
615
- const tempRoot12 = await fs.mkdtemp(path.join(os.tmpdir(), 'xiaoma-codex-ancestor-test-'));
616
- const parentProjectDir12 = path.join(tempRoot12, 'parent');
617
- const childProjectDir12 = path.join(parentProjectDir12, 'child');
618
- const installedXiaoMaDir12 = await createTestXiaoMaFixture();
619
-
620
- await fs.ensureDir(path.join(parentProjectDir12, '.git'));
621
- await fs.ensureDir(path.join(parentProjectDir12, '.agents', 'skills', 'xiaoma-existing'));
622
- await fs.ensureDir(childProjectDir12);
623
- await fs.writeFile(path.join(parentProjectDir12, '.agents', 'skills', 'xiaoma-existing', 'SKILL.md'), 'legacy\n');
624
-
625
- const ideManager12 = new IdeManager();
626
- await ideManager12.ensureInitialized();
627
- const result12 = await ideManager12.setup('codex', childProjectDir12, installedXiaoMaDir12, {
628
- silent: true,
629
- selectedModules: ['xmc'],
630
- });
631
- const expectedConflictDir12 = await fs.realpath(path.join(parentProjectDir12, '.agents', 'skills'));
632
-
633
- assert(result12.success === false, 'Codex setup refuses install when ancestor skills already exist');
634
- assert(result12.handlerResult?.reason === 'ancestor-conflict', 'Codex ancestor rejection reports ancestor-conflict reason');
635
- assert(result12.handlerResult?.conflictDir === expectedConflictDir12, 'Codex ancestor rejection points at ancestor .agents/skills dir');
636
-
637
- await fs.remove(tempRoot12);
638
- await fs.remove(installedXiaoMaDir12);
639
- } catch (error) {
640
- assert(false, 'Codex ancestor conflict protection test succeeds', error.message);
641
- }
642
-
643
- console.log('');
644
-
645
- // ============================================================
646
- // Test 13: Cursor Native Skills Install
647
- // ============================================================
648
- console.log(`${colors.yellow}Test Suite 13: Cursor Native Skills${colors.reset}\n`);
649
-
650
- try {
651
- clearCache();
652
- const platformCodes13 = await loadPlatformCodes();
653
- const cursorInstaller = platformCodes13.platforms.cursor?.installer;
654
-
655
- assert(cursorInstaller?.target_dir === '.cursor/skills', 'Cursor target_dir uses native skills path');
656
-
657
- assert(cursorInstaller?.skill_format === true, 'Cursor installer enables native skill output');
658
-
659
- assert(
660
- Array.isArray(cursorInstaller?.legacy_targets) && cursorInstaller.legacy_targets.includes('.cursor/commands'),
661
- 'Cursor installer cleans legacy command output',
662
- );
663
-
664
- assert(!cursorInstaller?.ancestor_conflict_check, 'Cursor installer does not enable ancestor conflict checks');
665
-
666
- const tempProjectDir13c = await fs.mkdtemp(path.join(os.tmpdir(), 'xiaoma-cursor-test-'));
667
- const installedXiaoMaDir13c = await createTestXiaoMaFixture();
668
- const legacyDir13c = path.join(tempProjectDir13c, '.cursor', 'commands');
669
- await fs.ensureDir(legacyDir13c);
670
- await fs.writeFile(path.join(legacyDir13c, 'xiaoma-legacy.md'), 'legacy\n');
671
-
672
- const ideManager13c = new IdeManager();
673
- await ideManager13c.ensureInitialized();
674
- const result13c = await ideManager13c.setup('cursor', tempProjectDir13c, installedXiaoMaDir13c, {
675
- silent: true,
676
- selectedModules: ['xmc'],
677
- });
678
-
679
- assert(result13c.success === true, 'Cursor setup succeeds against temp project');
680
-
681
- const skillFile13c = path.join(tempProjectDir13c, '.cursor', 'skills', 'xiaoma-master', 'SKILL.md');
682
- assert(await fs.pathExists(skillFile13c), 'Cursor install writes SKILL.md directory output');
683
-
684
- // Verify name frontmatter matches directory name
685
- const skillContent13c = await fs.readFile(skillFile13c, 'utf8');
686
- const nameMatch13c = skillContent13c.match(/^name:\s*(.+)$/m);
687
- assert(nameMatch13c && nameMatch13c[1].trim() === 'xiaoma-master', 'Cursor skill name frontmatter matches directory name exactly');
688
-
689
- assert(!(await fs.pathExists(legacyDir13c)), 'Cursor setup removes legacy commands dir');
690
-
691
- await fs.remove(tempProjectDir13c);
692
- await fs.remove(installedXiaoMaDir13c);
693
- } catch (error) {
694
- assert(false, 'Cursor native skills migration test succeeds', error.message);
695
- }
696
-
697
- console.log('');
698
-
699
- // ============================================================
700
- // Test 14: Roo Code Native Skills Install
701
- // ============================================================
702
- console.log(`${colors.yellow}Test Suite 14: Roo Code Native Skills${colors.reset}\n`);
703
-
704
- try {
705
- clearCache();
706
- const platformCodes13 = await loadPlatformCodes();
707
- const rooInstaller = platformCodes13.platforms.roo?.installer;
708
-
709
- assert(rooInstaller?.target_dir === '.roo/skills', 'Roo target_dir uses native skills path');
710
-
711
- assert(rooInstaller?.skill_format === true, 'Roo installer enables native skill output');
712
-
713
- assert(
714
- Array.isArray(rooInstaller?.legacy_targets) && rooInstaller.legacy_targets.includes('.roo/commands'),
715
- 'Roo installer cleans legacy command output',
716
- );
717
-
718
- const tempProjectDir13 = await fs.mkdtemp(path.join(os.tmpdir(), 'xiaoma-roo-test-'));
719
- const installedXiaoMaDir13 = await createTestXiaoMaFixture();
720
- const legacyDir13 = path.join(tempProjectDir13, '.roo', 'commands', 'xiaoma-legacy-dir');
721
- await fs.ensureDir(legacyDir13);
722
- await fs.writeFile(path.join(tempProjectDir13, '.roo', 'commands', 'xiaoma-legacy.md'), 'legacy\n');
723
- await fs.writeFile(path.join(legacyDir13, 'SKILL.md'), 'legacy\n');
724
-
725
- const ideManager13 = new IdeManager();
726
- await ideManager13.ensureInitialized();
727
- const result13 = await ideManager13.setup('roo', tempProjectDir13, installedXiaoMaDir13, {
728
- silent: true,
729
- selectedModules: ['xmc'],
730
- });
731
-
732
- assert(result13.success === true, 'Roo setup succeeds against temp project');
733
-
734
- const skillFile13 = path.join(tempProjectDir13, '.roo', 'skills', 'xiaoma-master', 'SKILL.md');
735
- assert(await fs.pathExists(skillFile13), 'Roo install writes SKILL.md directory output');
736
-
737
- // Verify name frontmatter matches directory name (Roo constraint: lowercase alphanumeric + hyphens)
738
- const skillContent13 = await fs.readFile(skillFile13, 'utf8');
739
- const nameMatch13 = skillContent13.match(/^name:\s*(.+)$/m);
740
- assert(
741
- nameMatch13 && nameMatch13[1].trim() === 'xiaoma-master',
742
- 'Roo skill name frontmatter matches directory name exactly (lowercase alphanumeric + hyphens)',
743
- );
744
-
745
- assert(!(await fs.pathExists(path.join(tempProjectDir13, '.roo', 'commands'))), 'Roo setup removes legacy commands dir');
746
-
747
- // Reinstall/upgrade: run setup again over existing skills output
748
- const result13b = await ideManager13.setup('roo', tempProjectDir13, installedXiaoMaDir13, {
749
- silent: true,
750
- selectedModules: ['xmc'],
751
- });
752
-
753
- assert(result13b.success === true, 'Roo reinstall/upgrade succeeds over existing skills');
754
- assert(await fs.pathExists(skillFile13), 'Roo reinstall preserves SKILL.md output');
755
-
756
- await fs.remove(tempProjectDir13);
757
- await fs.remove(installedXiaoMaDir13);
758
- } catch (error) {
759
- assert(false, 'Roo native skills migration test succeeds', error.message);
760
- }
761
-
762
- console.log('');
763
-
764
- // ============================================================
765
- // Test 15: OpenCode Ancestor Conflict
766
- // ============================================================
767
- console.log(`${colors.yellow}Test Suite 15: OpenCode Ancestor Conflict${colors.reset}\n`);
768
-
769
- try {
770
- const tempRoot = await fs.mkdtemp(path.join(os.tmpdir(), 'xiaoma-opencode-ancestor-test-'));
771
- const parentProjectDir = path.join(tempRoot, 'parent');
772
- const childProjectDir = path.join(parentProjectDir, 'child');
773
- const installedXiaoMaDir = await createTestXiaoMaFixture();
774
-
775
- await fs.ensureDir(path.join(parentProjectDir, '.git'));
776
- await fs.ensureDir(path.join(parentProjectDir, '.opencode', 'skills', 'xiaoma-existing'));
777
- await fs.ensureDir(childProjectDir);
778
- await fs.writeFile(path.join(parentProjectDir, '.opencode', 'skills', 'xiaoma-existing', 'SKILL.md'), 'legacy\n');
779
-
780
- const ideManager = new IdeManager();
781
- await ideManager.ensureInitialized();
782
- const result = await ideManager.setup('opencode', childProjectDir, installedXiaoMaDir, {
783
- silent: true,
784
- selectedModules: ['xmc'],
785
- });
786
- const expectedConflictDir = await fs.realpath(path.join(parentProjectDir, '.opencode', 'skills'));
787
-
788
- assert(result.success === false, 'OpenCode setup refuses install when ancestor skills already exist');
789
- assert(result.handlerResult?.reason === 'ancestor-conflict', 'OpenCode ancestor rejection reports ancestor-conflict reason');
790
- assert(
791
- result.handlerResult?.conflictDir === expectedConflictDir,
792
- 'OpenCode ancestor rejection points at ancestor .opencode/skills dir',
793
- );
794
-
795
- await fs.remove(tempRoot);
796
- await fs.remove(installedXiaoMaDir);
797
- } catch (error) {
798
- assert(false, 'OpenCode ancestor conflict protection test succeeds', error.message);
799
- }
800
-
801
- console.log('');
802
-
803
- // ============================================================
804
- // Test 16: QA Agent Compilation
805
- // ============================================================
806
- console.log(`${colors.yellow}Test Suite 16: QA Agent Compilation${colors.reset}\n`);
807
-
808
- try {
809
- const builder = new YamlXmlBuilder();
810
- const qaAgentPath = path.join(projectRoot, 'src/xmc/agents/qa.agent.yaml');
811
- const tempOutput = path.join(__dirname, 'temp-qa-agent.md');
812
-
813
- try {
814
- const result = await builder.buildAgent(qaAgentPath, null, tempOutput, { includeMetadata: true });
815
- const compiled = await fs.readFile(tempOutput, 'utf8');
816
-
817
- assert(compiled.includes('QA Engineer'), 'QA agent compilation includes agent title');
818
-
819
- assert(compiled.includes('qa-generate-e2e-tests'), 'QA agent menu includes automate workflow');
820
-
821
- // Cleanup
822
- await fs.remove(tempOutput);
823
- } catch (error) {
824
- assert(false, 'QA agent compiles successfully', error.message);
825
- }
826
- } catch (error) {
827
- assert(false, 'QA compilation test setup', error.message);
828
- }
829
-
830
- console.log('');
831
-
832
- // ============================================================
833
- // Test 17: GitHub Copilot Native Skills Install
834
- // ============================================================
835
- console.log(`${colors.yellow}Test Suite 17: GitHub Copilot Native Skills${colors.reset}\n`);
836
-
837
- try {
838
- clearCache();
839
- const platformCodes17 = await loadPlatformCodes();
840
- const copilotInstaller = platformCodes17.platforms['github-copilot']?.installer;
841
-
842
- assert(copilotInstaller?.target_dir === '.github/skills', 'GitHub Copilot target_dir uses native skills path');
843
-
844
- assert(copilotInstaller?.skill_format === true, 'GitHub Copilot installer enables native skill output');
845
-
846
- assert(
847
- Array.isArray(copilotInstaller?.legacy_targets) && copilotInstaller.legacy_targets.includes('.github/agents'),
848
- 'GitHub Copilot installer cleans legacy agents output',
849
- );
850
-
851
- assert(
852
- Array.isArray(copilotInstaller?.legacy_targets) && copilotInstaller.legacy_targets.includes('.github/prompts'),
853
- 'GitHub Copilot installer cleans legacy prompts output',
854
- );
855
-
856
- const tempProjectDir17 = await fs.mkdtemp(path.join(os.tmpdir(), 'xiaoma-copilot-test-'));
857
- const installedXiaoMaDir17 = await createTestXiaoMaFixture();
858
-
859
- // Create legacy .github/agents/ and .github/prompts/ files
860
- const legacyAgentsDir17 = path.join(tempProjectDir17, '.github', 'agents');
861
- const legacyPromptsDir17 = path.join(tempProjectDir17, '.github', 'prompts');
862
- await fs.ensureDir(legacyAgentsDir17);
863
- await fs.ensureDir(legacyPromptsDir17);
864
- await fs.writeFile(path.join(legacyAgentsDir17, 'xiaoma-legacy.agent.md'), 'legacy agent\n');
865
- await fs.writeFile(path.join(legacyPromptsDir17, 'xiaoma-legacy.prompt.md'), 'legacy prompt\n');
866
-
867
- // Create legacy copilot-instructions.md with XiaoMa markers
868
- const copilotInstructionsPath17 = path.join(tempProjectDir17, '.github', 'copilot-instructions.md');
869
- await fs.writeFile(
870
- copilotInstructionsPath17,
871
- 'User content before\n<!-- XiaoMa:START -->\nXiaoMa generated content\n<!-- XiaoMa:END -->\nUser content after\n',
872
- );
873
-
874
- const ideManager17 = new IdeManager();
875
- await ideManager17.ensureInitialized();
876
- const result17 = await ideManager17.setup('github-copilot', tempProjectDir17, installedXiaoMaDir17, {
877
- silent: true,
878
- selectedModules: ['xmc'],
879
- });
880
-
881
- assert(result17.success === true, 'GitHub Copilot setup succeeds against temp project');
882
-
883
- const skillFile17 = path.join(tempProjectDir17, '.github', 'skills', 'xiaoma-master', 'SKILL.md');
884
- assert(await fs.pathExists(skillFile17), 'GitHub Copilot install writes SKILL.md directory output');
885
-
886
- // Verify name frontmatter matches directory name
887
- const skillContent17 = await fs.readFile(skillFile17, 'utf8');
888
- const nameMatch17 = skillContent17.match(/^name:\s*(.+)$/m);
889
- assert(
890
- nameMatch17 && nameMatch17[1].trim() === 'xiaoma-master',
891
- 'GitHub Copilot skill name frontmatter matches directory name exactly',
892
- );
893
-
894
- assert(!(await fs.pathExists(legacyAgentsDir17)), 'GitHub Copilot setup removes legacy agents dir');
895
-
896
- assert(!(await fs.pathExists(legacyPromptsDir17)), 'GitHub Copilot setup removes legacy prompts dir');
897
-
898
- // Verify copilot-instructions.md XiaoMa markers were stripped but user content preserved
899
- const cleanedInstructions17 = await fs.readFile(copilotInstructionsPath17, 'utf8');
900
- assert(
901
- !cleanedInstructions17.includes('XiaoMa:START') && !cleanedInstructions17.includes('XiaoMa generated content'),
902
- 'GitHub Copilot setup strips XiaoMa markers from copilot-instructions.md',
903
- );
904
- assert(
905
- cleanedInstructions17.includes('User content before') && cleanedInstructions17.includes('User content after'),
906
- 'GitHub Copilot setup preserves user content in copilot-instructions.md',
907
- );
908
-
909
- await fs.remove(tempProjectDir17);
910
- await fs.remove(installedXiaoMaDir17);
911
- } catch (error) {
912
- assert(false, 'GitHub Copilot native skills migration test succeeds', error.message);
913
- }
914
-
915
- console.log('');
916
-
917
- // ============================================================
918
- // Test 18: Cline Native Skills Install
919
- // ============================================================
920
- console.log(`${colors.yellow}Test Suite 18: Cline Native Skills${colors.reset}\n`);
921
-
922
- try {
923
- clearCache();
924
- const platformCodes18 = await loadPlatformCodes();
925
- const clineInstaller = platformCodes18.platforms.cline?.installer;
926
-
927
- assert(clineInstaller?.target_dir === '.cline/skills', 'Cline target_dir uses native skills path');
928
-
929
- assert(clineInstaller?.skill_format === true, 'Cline installer enables native skill output');
930
-
931
- assert(
932
- Array.isArray(clineInstaller?.legacy_targets) && clineInstaller.legacy_targets.includes('.clinerules/workflows'),
933
- 'Cline installer cleans legacy workflow output',
934
- );
935
-
936
- const tempProjectDir18 = await fs.mkdtemp(path.join(os.tmpdir(), 'xiaoma-cline-test-'));
937
- const installedXiaoMaDir18 = await createTestXiaoMaFixture();
938
- const legacyDir18 = path.join(tempProjectDir18, '.clinerules', 'workflows', 'xiaoma-legacy-dir');
939
- await fs.ensureDir(legacyDir18);
940
- await fs.writeFile(path.join(tempProjectDir18, '.clinerules', 'workflows', 'xiaoma-legacy.md'), 'legacy\n');
941
- await fs.writeFile(path.join(legacyDir18, 'SKILL.md'), 'legacy\n');
942
-
943
- const ideManager18 = new IdeManager();
944
- await ideManager18.ensureInitialized();
945
- const result18 = await ideManager18.setup('cline', tempProjectDir18, installedXiaoMaDir18, {
946
- silent: true,
947
- selectedModules: ['xmc'],
948
- });
949
-
950
- assert(result18.success === true, 'Cline setup succeeds against temp project');
951
-
952
- const skillFile18 = path.join(tempProjectDir18, '.cline', 'skills', 'xiaoma-master', 'SKILL.md');
953
- assert(await fs.pathExists(skillFile18), 'Cline install writes SKILL.md directory output');
954
-
955
- // Verify name frontmatter matches directory name
956
- const skillContent18 = await fs.readFile(skillFile18, 'utf8');
957
- const nameMatch18 = skillContent18.match(/^name:\s*(.+)$/m);
958
- assert(nameMatch18 && nameMatch18[1].trim() === 'xiaoma-master', 'Cline skill name frontmatter matches directory name exactly');
959
-
960
- assert(!(await fs.pathExists(path.join(tempProjectDir18, '.clinerules', 'workflows'))), 'Cline setup removes legacy workflows dir');
961
-
962
- // Reinstall/upgrade: run setup again over existing skills output
963
- const result18b = await ideManager18.setup('cline', tempProjectDir18, installedXiaoMaDir18, {
964
- silent: true,
965
- selectedModules: ['xmc'],
966
- });
967
-
968
- assert(result18b.success === true, 'Cline reinstall/upgrade succeeds over existing skills');
969
- assert(await fs.pathExists(skillFile18), 'Cline reinstall preserves SKILL.md output');
970
-
971
- await fs.remove(tempProjectDir18);
972
- await fs.remove(installedXiaoMaDir18);
973
- } catch (error) {
974
- assert(false, 'Cline native skills migration test succeeds', error.message);
975
- }
976
-
977
- console.log('');
978
-
979
- // ============================================================
980
- // Test 19: CodeBuddy Native Skills Install
981
- // ============================================================
982
- console.log(`${colors.yellow}Test Suite 19: CodeBuddy Native Skills${colors.reset}\n`);
983
-
984
- try {
985
- clearCache();
986
- const platformCodes19 = await loadPlatformCodes();
987
- const codebuddyInstaller = platformCodes19.platforms.codebuddy?.installer;
988
-
989
- assert(codebuddyInstaller?.target_dir === '.codebuddy/skills', 'CodeBuddy target_dir uses native skills path');
990
-
991
- assert(codebuddyInstaller?.skill_format === true, 'CodeBuddy installer enables native skill output');
992
-
993
- assert(
994
- Array.isArray(codebuddyInstaller?.legacy_targets) && codebuddyInstaller.legacy_targets.includes('.codebuddy/commands'),
995
- 'CodeBuddy installer cleans legacy command output',
996
- );
997
-
998
- const tempProjectDir19 = await fs.mkdtemp(path.join(os.tmpdir(), 'xiaoma-codebuddy-test-'));
999
- const installedXiaoMaDir19 = await createTestXiaoMaFixture();
1000
- const legacyDir19 = path.join(tempProjectDir19, '.codebuddy', 'commands', 'xiaoma-legacy-dir');
1001
- await fs.ensureDir(legacyDir19);
1002
- await fs.writeFile(path.join(tempProjectDir19, '.codebuddy', 'commands', 'xiaoma-legacy.md'), 'legacy\n');
1003
- await fs.writeFile(path.join(legacyDir19, 'SKILL.md'), 'legacy\n');
1004
-
1005
- const ideManager19 = new IdeManager();
1006
- await ideManager19.ensureInitialized();
1007
- const result19 = await ideManager19.setup('codebuddy', tempProjectDir19, installedXiaoMaDir19, {
1008
- silent: true,
1009
- selectedModules: ['xmc'],
1010
- });
1011
-
1012
- assert(result19.success === true, 'CodeBuddy setup succeeds against temp project');
1013
-
1014
- const skillFile19 = path.join(tempProjectDir19, '.codebuddy', 'skills', 'xiaoma-master', 'SKILL.md');
1015
- assert(await fs.pathExists(skillFile19), 'CodeBuddy install writes SKILL.md directory output');
1016
-
1017
- const skillContent19 = await fs.readFile(skillFile19, 'utf8');
1018
- const nameMatch19 = skillContent19.match(/^name:\s*(.+)$/m);
1019
- assert(nameMatch19 && nameMatch19[1].trim() === 'xiaoma-master', 'CodeBuddy skill name frontmatter matches directory name exactly');
1020
-
1021
- assert(!(await fs.pathExists(path.join(tempProjectDir19, '.codebuddy', 'commands'))), 'CodeBuddy setup removes legacy commands dir');
1022
-
1023
- const result19b = await ideManager19.setup('codebuddy', tempProjectDir19, installedXiaoMaDir19, {
1024
- silent: true,
1025
- selectedModules: ['xmc'],
1026
- });
1027
-
1028
- assert(result19b.success === true, 'CodeBuddy reinstall/upgrade succeeds over existing skills');
1029
- assert(await fs.pathExists(skillFile19), 'CodeBuddy reinstall preserves SKILL.md output');
1030
-
1031
- await fs.remove(tempProjectDir19);
1032
- await fs.remove(installedXiaoMaDir19);
1033
- } catch (error) {
1034
- assert(false, 'CodeBuddy native skills migration test succeeds', error.message);
1035
- }
1036
-
1037
- console.log('');
1038
-
1039
- // ============================================================
1040
- // Test 20: Crush Native Skills Install
1041
- // ============================================================
1042
- console.log(`${colors.yellow}Test Suite 20: Crush Native Skills${colors.reset}\n`);
1043
-
1044
- try {
1045
- clearCache();
1046
- const platformCodes20 = await loadPlatformCodes();
1047
- const crushInstaller = platformCodes20.platforms.crush?.installer;
1048
-
1049
- assert(crushInstaller?.target_dir === '.crush/skills', 'Crush target_dir uses native skills path');
1050
-
1051
- assert(crushInstaller?.skill_format === true, 'Crush installer enables native skill output');
1052
-
1053
- assert(
1054
- Array.isArray(crushInstaller?.legacy_targets) && crushInstaller.legacy_targets.includes('.crush/commands'),
1055
- 'Crush installer cleans legacy command output',
1056
- );
1057
-
1058
- const tempProjectDir20 = await fs.mkdtemp(path.join(os.tmpdir(), 'xiaoma-crush-test-'));
1059
- const installedXiaoMaDir20 = await createTestXiaoMaFixture();
1060
- const legacyDir20 = path.join(tempProjectDir20, '.crush', 'commands', 'xiaoma-legacy-dir');
1061
- await fs.ensureDir(legacyDir20);
1062
- await fs.writeFile(path.join(tempProjectDir20, '.crush', 'commands', 'xiaoma-legacy.md'), 'legacy\n');
1063
- await fs.writeFile(path.join(legacyDir20, 'SKILL.md'), 'legacy\n');
1064
-
1065
- const ideManager20 = new IdeManager();
1066
- await ideManager20.ensureInitialized();
1067
- const result20 = await ideManager20.setup('crush', tempProjectDir20, installedXiaoMaDir20, {
1068
- silent: true,
1069
- selectedModules: ['xmc'],
1070
- });
1071
-
1072
- assert(result20.success === true, 'Crush setup succeeds against temp project');
1073
-
1074
- const skillFile20 = path.join(tempProjectDir20, '.crush', 'skills', 'xiaoma-master', 'SKILL.md');
1075
- assert(await fs.pathExists(skillFile20), 'Crush install writes SKILL.md directory output');
1076
-
1077
- const skillContent20 = await fs.readFile(skillFile20, 'utf8');
1078
- const nameMatch20 = skillContent20.match(/^name:\s*(.+)$/m);
1079
- assert(nameMatch20 && nameMatch20[1].trim() === 'xiaoma-master', 'Crush skill name frontmatter matches directory name exactly');
1080
-
1081
- assert(!(await fs.pathExists(path.join(tempProjectDir20, '.crush', 'commands'))), 'Crush setup removes legacy commands dir');
1082
-
1083
- const result20b = await ideManager20.setup('crush', tempProjectDir20, installedXiaoMaDir20, {
1084
- silent: true,
1085
- selectedModules: ['xmc'],
1086
- });
1087
-
1088
- assert(result20b.success === true, 'Crush reinstall/upgrade succeeds over existing skills');
1089
- assert(await fs.pathExists(skillFile20), 'Crush reinstall preserves SKILL.md output');
1090
-
1091
- await fs.remove(tempProjectDir20);
1092
- await fs.remove(installedXiaoMaDir20);
1093
- } catch (error) {
1094
- assert(false, 'Crush native skills migration test succeeds', error.message);
1095
- }
1096
-
1097
- console.log('');
1098
-
1099
- // ============================================================
1100
- // Test 21: Trae Native Skills Install
1101
- // ============================================================
1102
- console.log(`${colors.yellow}Test Suite 21: Trae Native Skills${colors.reset}\n`);
1103
-
1104
- try {
1105
- clearCache();
1106
- const platformCodes21 = await loadPlatformCodes();
1107
- const traeInstaller = platformCodes21.platforms.trae?.installer;
1108
-
1109
- assert(traeInstaller?.target_dir === '.trae/skills', 'Trae target_dir uses native skills path');
1110
-
1111
- assert(traeInstaller?.skill_format === true, 'Trae installer enables native skill output');
1112
-
1113
- assert(
1114
- Array.isArray(traeInstaller?.legacy_targets) && traeInstaller.legacy_targets.includes('.trae/rules'),
1115
- 'Trae installer cleans legacy rules output',
1116
- );
1117
-
1118
- const tempProjectDir21 = await fs.mkdtemp(path.join(os.tmpdir(), 'xiaoma-trae-test-'));
1119
- const installedXiaoMaDir21 = await createTestXiaoMaFixture();
1120
- const legacyDir21 = path.join(tempProjectDir21, '.trae', 'rules');
1121
- await fs.ensureDir(legacyDir21);
1122
- await fs.writeFile(path.join(legacyDir21, 'xiaoma-legacy.md'), 'legacy\n');
1123
-
1124
- const ideManager21 = new IdeManager();
1125
- await ideManager21.ensureInitialized();
1126
- const result21 = await ideManager21.setup('trae', tempProjectDir21, installedXiaoMaDir21, {
1127
- silent: true,
1128
- selectedModules: ['xmc'],
1129
- });
1130
-
1131
- assert(result21.success === true, 'Trae setup succeeds against temp project');
1132
-
1133
- const skillFile21 = path.join(tempProjectDir21, '.trae', 'skills', 'xiaoma-master', 'SKILL.md');
1134
- assert(await fs.pathExists(skillFile21), 'Trae install writes SKILL.md directory output');
1135
-
1136
- const skillContent21 = await fs.readFile(skillFile21, 'utf8');
1137
- const nameMatch21 = skillContent21.match(/^name:\s*(.+)$/m);
1138
- assert(nameMatch21 && nameMatch21[1].trim() === 'xiaoma-master', 'Trae skill name frontmatter matches directory name exactly');
1139
-
1140
- assert(!(await fs.pathExists(path.join(tempProjectDir21, '.trae', 'rules'))), 'Trae setup removes legacy rules dir');
1141
-
1142
- const result21b = await ideManager21.setup('trae', tempProjectDir21, installedXiaoMaDir21, {
1143
- silent: true,
1144
- selectedModules: ['xmc'],
1145
- });
1146
-
1147
- assert(result21b.success === true, 'Trae reinstall/upgrade succeeds over existing skills');
1148
- assert(await fs.pathExists(skillFile21), 'Trae reinstall preserves SKILL.md output');
1149
-
1150
- await fs.remove(tempProjectDir21);
1151
- await fs.remove(installedXiaoMaDir21);
1152
- } catch (error) {
1153
- assert(false, 'Trae native skills migration test succeeds', error.message);
1154
- }
1155
-
1156
- console.log('');
1157
-
1158
- // ============================================================
1159
- // Suite 22: KiloCoder Suspended
1160
- // ============================================================
1161
- console.log(`${colors.yellow}Test Suite 22: KiloCoder Suspended${colors.reset}\n`);
1162
-
1163
- try {
1164
- clearCache();
1165
- const platformCodes22 = await loadPlatformCodes();
1166
- const kiloConfig22 = platformCodes22.platforms.kilo;
1167
-
1168
- assert(typeof kiloConfig22?.suspended === 'string', 'KiloCoder has a suspended message in platform config');
1169
-
1170
- assert(kiloConfig22?.installer?.target_dir === '.kilocode/skills', 'KiloCoder retains target_dir config for future use');
1171
-
1172
- const ideManager22 = new IdeManager();
1173
- await ideManager22.ensureInitialized();
1174
-
1175
- // Should not appear in available IDEs
1176
- const availableIdes22 = ideManager22.getAvailableIdes();
1177
- assert(!availableIdes22.some((ide) => ide.value === 'kilo'), 'KiloCoder is hidden from IDE selection');
1178
-
1179
- // Setup should be blocked but legacy files should be cleaned up
1180
- const tempProjectDir22 = await fs.mkdtemp(path.join(os.tmpdir(), 'xiaoma-kilo-test-'));
1181
- const installedXiaoMaDir22 = await createTestXiaoMaFixture();
1182
-
1183
- // Pre-populate legacy Kilo artifacts that should be cleaned up
1184
- const legacyDir22 = path.join(tempProjectDir22, '.kilocode', 'workflows');
1185
- await fs.ensureDir(legacyDir22);
1186
- await fs.writeFile(path.join(legacyDir22, 'xiaoma-legacy.md'), 'legacy\n');
1187
-
1188
- const result22 = await ideManager22.setup('kilo', tempProjectDir22, installedXiaoMaDir22, {
1189
- silent: true,
1190
- selectedModules: ['xmc'],
1191
- });
1192
-
1193
- assert(result22.success === false, 'KiloCoder setup is blocked when suspended');
1194
- assert(result22.error === 'suspended', 'KiloCoder setup returns suspended error');
1195
-
1196
- // Should not write new skill files
1197
- assert(
1198
- !(await fs.pathExists(path.join(tempProjectDir22, '.kilocode', 'skills'))),
1199
- 'KiloCoder does not create skills directory when suspended',
1200
- );
1201
-
1202
- // Legacy files should be cleaned up
1203
- assert(
1204
- !(await fs.pathExists(path.join(tempProjectDir22, '.kilocode', 'workflows'))),
1205
- 'KiloCoder legacy workflows are cleaned up even when suspended',
1206
- );
1207
-
1208
- await fs.remove(tempProjectDir22);
1209
- await fs.remove(installedXiaoMaDir22);
1210
- } catch (error) {
1211
- assert(false, 'KiloCoder suspended test succeeds', error.message);
1212
- }
1213
-
1214
- console.log('');
1215
-
1216
- // ============================================================
1217
- // Suite 23: Gemini CLI Native Skills
1218
- // ============================================================
1219
- console.log(`${colors.yellow}Test Suite 23: Gemini CLI Native Skills${colors.reset}\n`);
1220
-
1221
- try {
1222
- clearCache();
1223
- const platformCodes23 = await loadPlatformCodes();
1224
- const geminiInstaller = platformCodes23.platforms.gemini?.installer;
1225
-
1226
- assert(geminiInstaller?.target_dir === '.gemini/skills', 'Gemini target_dir uses native skills path');
1227
-
1228
- assert(geminiInstaller?.skill_format === true, 'Gemini installer enables native skill output');
1229
-
1230
- assert(
1231
- Array.isArray(geminiInstaller?.legacy_targets) && geminiInstaller.legacy_targets.includes('.gemini/commands'),
1232
- 'Gemini installer cleans legacy commands output',
1233
- );
1234
-
1235
- const tempProjectDir23 = await fs.mkdtemp(path.join(os.tmpdir(), 'xiaoma-gemini-test-'));
1236
- const installedXiaoMaDir23 = await createTestXiaoMaFixture();
1237
- const legacyDir23 = path.join(tempProjectDir23, '.gemini', 'commands');
1238
- await fs.ensureDir(legacyDir23);
1239
- await fs.writeFile(path.join(legacyDir23, 'xiaoma-legacy.toml'), 'legacy\n');
1240
-
1241
- const ideManager23 = new IdeManager();
1242
- await ideManager23.ensureInitialized();
1243
- const result23 = await ideManager23.setup('gemini', tempProjectDir23, installedXiaoMaDir23, {
1244
- silent: true,
1245
- selectedModules: ['xmc'],
1246
- });
1247
-
1248
- assert(result23.success === true, 'Gemini setup succeeds against temp project');
1249
-
1250
- const skillFile23 = path.join(tempProjectDir23, '.gemini', 'skills', 'xiaoma-master', 'SKILL.md');
1251
- assert(await fs.pathExists(skillFile23), 'Gemini install writes SKILL.md directory output');
1252
-
1253
- const skillContent23 = await fs.readFile(skillFile23, 'utf8');
1254
- const nameMatch23 = skillContent23.match(/^name:\s*(.+)$/m);
1255
- assert(nameMatch23 && nameMatch23[1].trim() === 'xiaoma-master', 'Gemini skill name frontmatter matches directory name exactly');
1256
-
1257
- assert(!(await fs.pathExists(path.join(tempProjectDir23, '.gemini', 'commands'))), 'Gemini setup removes legacy commands dir');
1258
-
1259
- const result23b = await ideManager23.setup('gemini', tempProjectDir23, installedXiaoMaDir23, {
1260
- silent: true,
1261
- selectedModules: ['xmc'],
1262
- });
1263
-
1264
- assert(result23b.success === true, 'Gemini reinstall/upgrade succeeds over existing skills');
1265
- assert(await fs.pathExists(skillFile23), 'Gemini reinstall preserves SKILL.md output');
1266
-
1267
- await fs.remove(tempProjectDir23);
1268
- await fs.remove(installedXiaoMaDir23);
1269
- } catch (error) {
1270
- assert(false, 'Gemini native skills migration test succeeds', error.message);
1271
- }
1272
-
1273
- console.log('');
1274
-
1275
- // ============================================================
1276
- // Suite 24: iFlow Native Skills
1277
- // ============================================================
1278
- console.log(`${colors.yellow}Test Suite 24: iFlow Native Skills${colors.reset}\n`);
1279
-
1280
- try {
1281
- clearCache();
1282
- const platformCodes24 = await loadPlatformCodes();
1283
- const iflowInstaller = platformCodes24.platforms.iflow?.installer;
1284
-
1285
- assert(iflowInstaller?.target_dir === '.iflow/skills', 'iFlow target_dir uses native skills path');
1286
- assert(iflowInstaller?.skill_format === true, 'iFlow installer enables native skill output');
1287
- assert(
1288
- Array.isArray(iflowInstaller?.legacy_targets) && iflowInstaller.legacy_targets.includes('.iflow/commands'),
1289
- 'iFlow installer cleans legacy commands output',
1290
- );
1291
-
1292
- const tempProjectDir24 = await fs.mkdtemp(path.join(os.tmpdir(), 'xiaoma-iflow-test-'));
1293
- const installedXiaoMaDir24 = await createTestXiaoMaFixture();
1294
- const legacyDir24 = path.join(tempProjectDir24, '.iflow', 'commands');
1295
- await fs.ensureDir(legacyDir24);
1296
- await fs.writeFile(path.join(legacyDir24, 'xiaoma-legacy.md'), 'legacy\n');
1297
-
1298
- const ideManager24 = new IdeManager();
1299
- await ideManager24.ensureInitialized();
1300
- const result24 = await ideManager24.setup('iflow', tempProjectDir24, installedXiaoMaDir24, {
1301
- silent: true,
1302
- selectedModules: ['xmc'],
1303
- });
1304
-
1305
- assert(result24.success === true, 'iFlow setup succeeds against temp project');
1306
-
1307
- const skillFile24 = path.join(tempProjectDir24, '.iflow', 'skills', 'xiaoma-master', 'SKILL.md');
1308
- assert(await fs.pathExists(skillFile24), 'iFlow install writes SKILL.md directory output');
1309
-
1310
- // Verify name frontmatter matches directory name
1311
- const skillContent24 = await fs.readFile(skillFile24, 'utf8');
1312
- const nameMatch24 = skillContent24.match(/^name:\s*(.+)$/m);
1313
- assert(nameMatch24 && nameMatch24[1].trim() === 'xiaoma-master', 'iFlow skill name frontmatter matches directory name exactly');
1314
-
1315
- assert(!(await fs.pathExists(path.join(tempProjectDir24, '.iflow', 'commands'))), 'iFlow setup removes legacy commands dir');
1316
-
1317
- await fs.remove(tempProjectDir24);
1318
- await fs.remove(installedXiaoMaDir24);
1319
- } catch (error) {
1320
- assert(false, 'iFlow native skills migration test succeeds', error.message);
1321
- }
1322
-
1323
- console.log('');
1324
-
1325
- // ============================================================
1326
- // Suite 25: QwenCoder Native Skills
1327
- // ============================================================
1328
- console.log(`${colors.yellow}Test Suite 25: QwenCoder Native Skills${colors.reset}\n`);
1329
-
1330
- try {
1331
- clearCache();
1332
- const platformCodes25 = await loadPlatformCodes();
1333
- const qwenInstaller = platformCodes25.platforms.qwen?.installer;
1334
-
1335
- assert(qwenInstaller?.target_dir === '.qwen/skills', 'QwenCoder target_dir uses native skills path');
1336
- assert(qwenInstaller?.skill_format === true, 'QwenCoder installer enables native skill output');
1337
- assert(
1338
- Array.isArray(qwenInstaller?.legacy_targets) && qwenInstaller.legacy_targets.includes('.qwen/commands'),
1339
- 'QwenCoder installer cleans legacy commands output',
1340
- );
1341
-
1342
- const tempProjectDir25 = await fs.mkdtemp(path.join(os.tmpdir(), 'xiaoma-qwen-test-'));
1343
- const installedXiaoMaDir25 = await createTestXiaoMaFixture();
1344
- const legacyDir25 = path.join(tempProjectDir25, '.qwen', 'commands');
1345
- await fs.ensureDir(legacyDir25);
1346
- await fs.writeFile(path.join(legacyDir25, 'xiaoma-legacy.md'), 'legacy\n');
1347
-
1348
- const ideManager25 = new IdeManager();
1349
- await ideManager25.ensureInitialized();
1350
- const result25 = await ideManager25.setup('qwen', tempProjectDir25, installedXiaoMaDir25, {
1351
- silent: true,
1352
- selectedModules: ['xmc'],
1353
- });
1354
-
1355
- assert(result25.success === true, 'QwenCoder setup succeeds against temp project');
1356
-
1357
- const skillFile25 = path.join(tempProjectDir25, '.qwen', 'skills', 'xiaoma-master', 'SKILL.md');
1358
- assert(await fs.pathExists(skillFile25), 'QwenCoder install writes SKILL.md directory output');
1359
-
1360
- // Verify name frontmatter matches directory name
1361
- const skillContent25 = await fs.readFile(skillFile25, 'utf8');
1362
- const nameMatch25 = skillContent25.match(/^name:\s*(.+)$/m);
1363
- assert(nameMatch25 && nameMatch25[1].trim() === 'xiaoma-master', 'QwenCoder skill name frontmatter matches directory name exactly');
1364
-
1365
- assert(!(await fs.pathExists(path.join(tempProjectDir25, '.qwen', 'commands'))), 'QwenCoder setup removes legacy commands dir');
1366
-
1367
- await fs.remove(tempProjectDir25);
1368
- await fs.remove(installedXiaoMaDir25);
1369
- } catch (error) {
1370
- assert(false, 'QwenCoder native skills migration test succeeds', error.message);
1371
- }
1372
-
1373
- console.log('');
1374
-
1375
- // ============================================================
1376
- // Suite 26: Rovo Dev Native Skills
1377
- // ============================================================
1378
- console.log(`${colors.yellow}Test Suite 26: Rovo Dev Native Skills${colors.reset}\n`);
1379
-
1380
- try {
1381
- clearCache();
1382
- const platformCodes26 = await loadPlatformCodes();
1383
- const rovoInstaller = platformCodes26.platforms['rovo-dev']?.installer;
1384
-
1385
- assert(rovoInstaller?.target_dir === '.rovodev/skills', 'Rovo Dev target_dir uses native skills path');
1386
- assert(rovoInstaller?.skill_format === true, 'Rovo Dev installer enables native skill output');
1387
- assert(
1388
- Array.isArray(rovoInstaller?.legacy_targets) && rovoInstaller.legacy_targets.includes('.rovodev/workflows'),
1389
- 'Rovo Dev installer cleans legacy workflows output',
1390
- );
1391
-
1392
- const tempProjectDir26 = await fs.mkdtemp(path.join(os.tmpdir(), 'xiaoma-rovodev-test-'));
1393
- const installedXiaoMaDir26 = await createTestXiaoMaFixture();
1394
- const legacyDir26 = path.join(tempProjectDir26, '.rovodev', 'workflows');
1395
- await fs.ensureDir(legacyDir26);
1396
- await fs.writeFile(path.join(legacyDir26, 'xiaoma-legacy.md'), 'legacy\n');
1397
-
1398
- // Create a prompts.yml with XiaoMa entries and a user entry
1399
- const yaml26 = require('yaml');
1400
- const promptsPath26 = path.join(tempProjectDir26, '.rovodev', 'prompts.yml');
1401
- const promptsContent26 = yaml26.stringify({
1402
- prompts: [
1403
- { name: 'xiaoma-xmc-create-prd', description: 'XiaoMa workflow', content_file: 'workflows/xiaoma-xmc-create-prd.md' },
1404
- { name: 'my-custom-prompt', description: 'User prompt', content_file: 'custom.md' },
1405
- ],
1406
- });
1407
- await fs.writeFile(promptsPath26, promptsContent26);
1408
-
1409
- const ideManager26 = new IdeManager();
1410
- await ideManager26.ensureInitialized();
1411
- const result26 = await ideManager26.setup('rovo-dev', tempProjectDir26, installedXiaoMaDir26, {
1412
- silent: true,
1413
- selectedModules: ['xmc'],
1414
- });
1415
-
1416
- assert(result26.success === true, 'Rovo Dev setup succeeds against temp project');
1417
-
1418
- const skillFile26 = path.join(tempProjectDir26, '.rovodev', 'skills', 'xiaoma-master', 'SKILL.md');
1419
- assert(await fs.pathExists(skillFile26), 'Rovo Dev install writes SKILL.md directory output');
1420
-
1421
- // Verify name frontmatter matches directory name
1422
- const skillContent26 = await fs.readFile(skillFile26, 'utf8');
1423
- const nameMatch26 = skillContent26.match(/^name:\s*(.+)$/m);
1424
- assert(nameMatch26 && nameMatch26[1].trim() === 'xiaoma-master', 'Rovo Dev skill name frontmatter matches directory name exactly');
1425
-
1426
- assert(!(await fs.pathExists(path.join(tempProjectDir26, '.rovodev', 'workflows'))), 'Rovo Dev setup removes legacy workflows dir');
1427
-
1428
- // Verify prompts.yml cleanup: XiaoMa entries removed, user entry preserved
1429
- const cleanedPrompts26 = yaml26.parse(await fs.readFile(promptsPath26, 'utf8'));
1430
- assert(
1431
- Array.isArray(cleanedPrompts26.prompts) && cleanedPrompts26.prompts.length === 1,
1432
- 'Rovo Dev cleanup removes XiaoMa entries from prompts.yml',
1433
- );
1434
- assert(cleanedPrompts26.prompts[0].name === 'my-custom-prompt', 'Rovo Dev cleanup preserves non-XiaoMa entries in prompts.yml');
1435
-
1436
- await fs.remove(tempProjectDir26);
1437
- await fs.remove(installedXiaoMaDir26);
1438
- } catch (error) {
1439
- assert(false, 'Rovo Dev native skills migration test succeeds', error.message);
1440
- }
1441
-
1442
- console.log('');
1443
-
1444
- // ============================================================
1445
- // Suite 27: Cleanup preserves xiaoma-os-* skills
1446
- // ============================================================
1447
- console.log(`${colors.yellow}Test Suite 27: Cleanup preserves xiaoma-os-* skills${colors.reset}\n`);
1448
-
1449
- try {
1450
- const tempProjectDir27 = await fs.mkdtemp(path.join(os.tmpdir(), 'xiaoma-os-preserve-test-'));
1451
- const installedXiaoMaDir27 = await createTestXiaoMaFixture();
1452
-
1453
- // Pre-populate .claude/skills with xiaoma-os-* skills (version-controlled repo skills)
1454
- const osSkillDir27 = path.join(tempProjectDir27, '.claude', 'skills', 'xiaoma-os-review-pr');
1455
- await fs.ensureDir(osSkillDir27);
1456
- await fs.writeFile(
1457
- path.join(osSkillDir27, 'SKILL.md'),
1458
- '---\nname: xiaoma-os-review-pr\ndescription: Review PRs\n---\nOS skill content\n',
1459
- );
1460
-
1461
- const osSkillDir27b = path.join(tempProjectDir27, '.claude', 'skills', 'xiaoma-os-release-module');
1462
- await fs.ensureDir(osSkillDir27b);
1463
- await fs.writeFile(
1464
- path.join(osSkillDir27b, 'SKILL.md'),
1465
- '---\nname: xiaoma-os-release-module\ndescription: Release module\n---\nOS skill content\n',
1466
- );
1467
-
1468
- // Also add a regular xiaoma skill that SHOULD be cleaned up
1469
- const regularSkillDir27 = path.join(tempProjectDir27, '.claude', 'skills', 'xiaoma-architect');
1470
- await fs.ensureDir(regularSkillDir27);
1471
- await fs.writeFile(
1472
- path.join(regularSkillDir27, 'SKILL.md'),
1473
- '---\nname: xiaoma-architect\ndescription: Architect\n---\nOld skill content\n',
1474
- );
1475
-
1476
- // Run Claude Code setup (which triggers cleanup then install)
1477
- const ideManager27 = new IdeManager();
1478
- await ideManager27.ensureInitialized();
1479
- const result27 = await ideManager27.setup('claude-code', tempProjectDir27, installedXiaoMaDir27, {
1480
- silent: true,
1481
- selectedModules: ['xmc'],
1482
- });
1483
-
1484
- assert(result27.success === true, 'Claude Code setup succeeds with xiaoma-os-* skills present');
1485
-
1486
- // xiaoma-os-* skills must survive
1487
- assert(await fs.pathExists(osSkillDir27), 'Cleanup preserves xiaoma-os-review-pr skill');
1488
- assert(await fs.pathExists(osSkillDir27b), 'Cleanup preserves xiaoma-os-release-module skill');
1489
-
1490
- // xiaoma-os skill content must be untouched
1491
- const osContent27 = await fs.readFile(path.join(osSkillDir27, 'SKILL.md'), 'utf8');
1492
- assert(osContent27.includes('OS skill content'), 'xiaoma-os-review-pr skill content is unchanged');
1493
-
1494
- // Regular xiaoma skill should have been replaced by fresh install
1495
- const newSkillFile27 = path.join(tempProjectDir27, '.claude', 'skills', 'xiaoma-master', 'SKILL.md');
1496
- assert(await fs.pathExists(newSkillFile27), 'Fresh xiaoma skills are installed alongside preserved xiaoma-os-* skills');
1497
-
1498
- // Stale non-xiaoma-os skill must have been removed by cleanup
1499
- assert(!(await fs.pathExists(regularSkillDir27)), 'Cleanup removes stale non-xiaoma-os skills');
1500
-
1501
- await fs.remove(tempProjectDir27);
1502
- await fs.remove(installedXiaoMaDir27);
1503
- } catch (error) {
1504
- assert(false, 'xiaoma-os-* skill preservation test succeeds', error.message);
1505
- }
1506
-
1507
- console.log('');
1508
-
1509
- // ============================================================
1510
- // Suite 28: Pi Native Skills
1511
- // ============================================================
1512
- console.log(`${colors.yellow}Test Suite 28: Pi Native Skills${colors.reset}\n`);
1513
-
1514
- let tempProjectDir28;
1515
- let installedXiaoMaDir28;
1516
- try {
1517
- clearCache();
1518
- const platformCodes28 = await loadPlatformCodes();
1519
- const piInstaller = platformCodes28.platforms.pi?.installer;
1520
-
1521
- assert(piInstaller?.target_dir === '.pi/skills', 'Pi target_dir uses native skills path');
1522
- assert(piInstaller?.skill_format === true, 'Pi installer enables native skill output');
1523
- assert(piInstaller?.template_type === 'default', 'Pi installer uses default skill template');
1524
-
1525
- tempProjectDir28 = await fs.mkdtemp(path.join(os.tmpdir(), 'xiaoma-pi-test-'));
1526
- installedXiaoMaDir28 = await createTestXiaoMaFixture();
1527
-
1528
- const ideManager28 = new IdeManager();
1529
- await ideManager28.ensureInitialized();
1530
-
1531
- // Verify Pi is selectable in available IDEs list
1532
- const availableIdes28 = ideManager28.getAvailableIdes();
1533
- assert(
1534
- availableIdes28.some((ide) => ide.value === 'pi'),
1535
- 'Pi appears in available IDEs list',
1536
- );
1537
-
1538
- // Verify Pi is NOT detected before install
1539
- const detectedBefore28 = await ideManager28.detectInstalledIdes(tempProjectDir28);
1540
- assert(!detectedBefore28.includes('pi'), 'Pi is not detected before install');
1541
-
1542
- const result28 = await ideManager28.setup('pi', tempProjectDir28, installedXiaoMaDir28, {
1543
- silent: true,
1544
- selectedModules: ['xmc'],
1545
- });
1546
-
1547
- assert(result28.success === true, 'Pi setup succeeds against temp project');
1548
-
1549
- // Verify Pi IS detected after install
1550
- const detectedAfter28 = await ideManager28.detectInstalledIdes(tempProjectDir28);
1551
- assert(detectedAfter28.includes('pi'), 'Pi is detected after install');
1552
-
1553
- const skillFile28 = path.join(tempProjectDir28, '.pi', 'skills', 'xiaoma-master', 'SKILL.md');
1554
- assert(await fs.pathExists(skillFile28), 'Pi install writes SKILL.md directory output');
1555
-
1556
- // Parse YAML frontmatter between --- markers
1557
- const skillContent28 = await fs.readFile(skillFile28, 'utf8');
1558
- const fmMatch28 = skillContent28.match(/^---\n([\s\S]*?)\n---\n?([\s\S]*)$/);
1559
- assert(fmMatch28, 'Pi SKILL.md contains valid frontmatter delimiters');
1560
-
1561
- const frontmatter28 = fmMatch28[1];
1562
- const body28 = fmMatch28[2];
1563
-
1564
- // Verify name in frontmatter matches directory name
1565
- const fmName28 = frontmatter28.match(/^name:\s*(.+)$/m);
1566
- assert(fmName28 && fmName28[1].trim() === 'xiaoma-master', 'Pi skill name frontmatter matches directory name exactly');
1567
-
1568
- // Verify description exists and is non-empty
1569
- const fmDesc28 = frontmatter28.match(/^description:\s*(.+)$/m);
1570
- assert(fmDesc28 && fmDesc28[1].trim().length > 0, 'Pi skill description frontmatter is present and non-empty');
1571
-
1572
- // Verify frontmatter contains only name and description keys
1573
- const fmKeys28 = [...frontmatter28.matchAll(/^([a-zA-Z0-9_-]+):/gm)].map((m) => m[1]);
1574
- assert(
1575
- fmKeys28.length === 2 && fmKeys28.includes('name') && fmKeys28.includes('description'),
1576
- 'Pi skill frontmatter contains only name and description keys',
1577
- );
1578
-
1579
- // Verify body content is non-empty and contains expected activation instructions
1580
- assert(body28.trim().length > 0, 'Pi skill body content is non-empty');
1581
- assert(body28.includes('agent-activation'), 'Pi skill body contains expected agent activation instructions');
1582
-
1583
- // Reinstall/upgrade: run setup again over existing output
1584
- const result28b = await ideManager28.setup('pi', tempProjectDir28, installedXiaoMaDir28, {
1585
- silent: true,
1586
- selectedModules: ['xmc'],
1587
- });
1588
- assert(result28b.success === true, 'Pi reinstall/upgrade succeeds over existing skills');
1589
- assert(await fs.pathExists(skillFile28), 'Pi reinstall preserves SKILL.md output');
1590
- } catch (error) {
1591
- assert(false, 'Pi native skills test succeeds', error.message);
1592
- } finally {
1593
- if (tempProjectDir28) await fs.remove(tempProjectDir28).catch(() => {});
1594
- if (installedXiaoMaDir28) await fs.remove(installedXiaoMaDir28).catch(() => {});
1595
- }
1596
-
1597
- console.log('');
1598
-
1599
- // ============================================================
1600
- // Suite 29: Unified Skill Scanner — collectSkills
1601
- // ============================================================
1602
- console.log(`${colors.yellow}Test Suite 29: Unified Skill Scanner${colors.reset}\n`);
1603
-
1604
- let tempFixture29;
1605
- try {
1606
- tempFixture29 = await fs.mkdtemp(path.join(os.tmpdir(), 'xiaoma-skill-scanner-'));
1607
-
1608
- // Create _config dir (required by manifest generator)
1609
- await fs.ensureDir(path.join(tempFixture29, '_config'));
1610
-
1611
- // --- Skill at unusual path: core/custom-area/my-skill/ ---
1612
- const skillDir29 = path.join(tempFixture29, 'core', 'custom-area', 'my-skill');
1613
- await fs.ensureDir(skillDir29);
1614
- await fs.writeFile(path.join(skillDir29, 'xiaoma-skill-manifest.yaml'), 'type: skill\n');
1615
- await fs.writeFile(
1616
- path.join(skillDir29, 'SKILL.md'),
1617
- '---\nname: my-skill\ndescription: A skill at an unusual path\n---\n\nFollow the instructions in [workflow.md](workflow.md).\n',
1618
- );
1619
- await fs.writeFile(path.join(skillDir29, 'workflow.md'), '# My Custom Skill\n\nSkill body content\n');
1620
-
1621
- // --- Regular workflow dir: core/workflows/regular-wf/ (type: workflow) ---
1622
- const wfDir29 = path.join(tempFixture29, 'core', 'workflows', 'regular-wf');
1623
- await fs.ensureDir(wfDir29);
1624
- await fs.writeFile(path.join(wfDir29, 'xiaoma-skill-manifest.yaml'), 'type: workflow\ncanonicalId: regular-wf\n');
1625
- await fs.writeFile(
1626
- path.join(wfDir29, 'workflow.md'),
1627
- '---\nname: Regular Workflow\ndescription: A regular workflow not a skill\n---\n\nWorkflow body\n',
1628
- );
1629
-
1630
- // --- Skill inside workflows/ dir: core/workflows/wf-skill/ (exercises findWorkflows skip logic) ---
1631
- const wfSkillDir29 = path.join(tempFixture29, 'core', 'workflows', 'wf-skill');
1632
- await fs.ensureDir(wfSkillDir29);
1633
- await fs.writeFile(path.join(wfSkillDir29, 'xiaoma-skill-manifest.yaml'), 'type: skill\n');
1634
- await fs.writeFile(
1635
- path.join(wfSkillDir29, 'SKILL.md'),
1636
- '---\nname: wf-skill\ndescription: A skill inside workflows dir\n---\n\nFollow the instructions in [workflow.md](workflow.md).\n',
1637
- );
1638
- await fs.writeFile(path.join(wfSkillDir29, 'workflow.md'), '# Workflow Skill\n\nSkill in workflows\n');
1639
-
1640
- // --- Skill inside tasks/ dir: core/tasks/task-skill/ ---
1641
- const taskSkillDir29 = path.join(tempFixture29, 'core', 'tasks', 'task-skill');
1642
- await fs.ensureDir(taskSkillDir29);
1643
- await fs.writeFile(path.join(taskSkillDir29, 'xiaoma-skill-manifest.yaml'), 'type: skill\n');
1644
- await fs.writeFile(
1645
- path.join(taskSkillDir29, 'SKILL.md'),
1646
- '---\nname: task-skill\ndescription: A skill inside tasks dir\n---\n\nFollow the instructions in [workflow.md](workflow.md).\n',
1647
- );
1648
- await fs.writeFile(path.join(taskSkillDir29, 'workflow.md'), '# Task Skill\n\nSkill in tasks\n');
1649
-
1650
- // Minimal agent so core module is detected
1651
- await fs.ensureDir(path.join(tempFixture29, 'core', 'agents'));
1652
- const minimalAgent29 = '<agent name="Test" title="T"><persona>p</persona></agent>';
1653
- await fs.writeFile(path.join(tempFixture29, 'core', 'agents', 'test.md'), minimalAgent29);
1654
-
1655
- const generator29 = new ManifestGenerator();
1656
- await generator29.generateManifests(tempFixture29, ['core'], [], { ides: [] });
1657
-
1658
- // Skill at unusual path should be in skills
1659
- const skillEntry29 = generator29.skills.find((s) => s.canonicalId === 'my-skill');
1660
- assert(skillEntry29 !== undefined, 'Skill at unusual path appears in skills[]');
1661
- assert(skillEntry29 && skillEntry29.name === 'my-skill', 'Skill has correct name from frontmatter');
1662
- assert(
1663
- skillEntry29 && skillEntry29.path.includes('custom-area/my-skill/SKILL.md'),
1664
- 'Skill path includes relative path from module root',
1665
- );
1666
-
1667
- // Skill should NOT be in workflows
1668
- const inWorkflows29 = generator29.workflows.find((w) => w.name === 'my-skill');
1669
- assert(inWorkflows29 === undefined, 'Skill at unusual path does NOT appear in workflows[]');
1670
-
1671
- // Skill in tasks/ dir should be in skills
1672
- const taskSkillEntry29 = generator29.skills.find((s) => s.canonicalId === 'task-skill');
1673
- assert(taskSkillEntry29 !== undefined, 'Skill in tasks/ dir appears in skills[]');
1674
-
1675
- // Skill in tasks/ should NOT appear in tasks[]
1676
- const inTasks29 = generator29.tasks.find((t) => t.name === 'task-skill');
1677
- assert(inTasks29 === undefined, 'Skill in tasks/ dir does NOT appear in tasks[]');
1678
-
1679
- // Regular workflow should be in workflows, NOT in skills
1680
- const regularWf29 = generator29.workflows.find((w) => w.name === 'Regular Workflow');
1681
- assert(regularWf29 !== undefined, 'Regular type:workflow appears in workflows[]');
1682
-
1683
- const regularInSkills29 = generator29.skills.find((s) => s.canonicalId === 'regular-wf');
1684
- assert(regularInSkills29 === undefined, 'Regular type:workflow does NOT appear in skills[]');
1685
-
1686
- // Skill inside workflows/ should be in skills[], NOT in workflows[] (exercises findWorkflows skip at lines 311/322)
1687
- const wfSkill29 = generator29.skills.find((s) => s.canonicalId === 'wf-skill');
1688
- assert(wfSkill29 !== undefined, 'Skill in workflows/ dir appears in skills[]');
1689
- const wfSkillInWorkflows29 = generator29.workflows.find((w) => w.name === 'wf-skill');
1690
- assert(wfSkillInWorkflows29 === undefined, 'Skill in workflows/ dir does NOT appear in workflows[]');
1691
-
1692
- // Test scanInstalledModules recognizes skill-only modules
1693
- const skillOnlyModDir29 = path.join(tempFixture29, 'skill-only-mod');
1694
- await fs.ensureDir(path.join(skillOnlyModDir29, 'deep', 'nested', 'my-skill'));
1695
- await fs.writeFile(path.join(skillOnlyModDir29, 'deep', 'nested', 'my-skill', 'xiaoma-skill-manifest.yaml'), 'type: skill\n');
1696
- await fs.writeFile(
1697
- path.join(skillOnlyModDir29, 'deep', 'nested', 'my-skill', 'SKILL.md'),
1698
- '---\nname: my-skill\ndescription: desc\n---\n\nFollow the instructions in [workflow.md](workflow.md).\n',
1699
- );
1700
- await fs.writeFile(path.join(skillOnlyModDir29, 'deep', 'nested', 'my-skill', 'workflow.md'), '# Nested Skill\n\nbody\n');
1701
-
1702
- const scannedModules29 = await generator29.scanInstalledModules(tempFixture29);
1703
- assert(scannedModules29.includes('skill-only-mod'), 'scanInstalledModules recognizes skill-only module');
1704
- } catch (error) {
1705
- assert(false, 'Unified skill scanner test succeeds', error.message);
1706
- } finally {
1707
- if (tempFixture29) await fs.remove(tempFixture29).catch(() => {});
1708
- }
1709
-
1710
- console.log('');
1711
-
1712
- // ============================================================
1713
- // Suite 30: parseSkillMd validation (negative cases)
1714
- // ============================================================
1715
- console.log(`${colors.yellow}Test Suite 30: parseSkillMd Validation${colors.reset}\n`);
1716
-
1717
- let tempFixture30;
1718
- try {
1719
- tempFixture30 = await fs.mkdtemp(path.join(os.tmpdir(), 'xiaoma-test-30-'));
1720
-
1721
- const generator30 = new ManifestGenerator();
1722
- generator30.xiaomaFolderName = '_xiaoma';
1723
-
1724
- // Case 1: Missing SKILL.md entirely
1725
- const noSkillDir = path.join(tempFixture30, 'no-skill-md');
1726
- await fs.ensureDir(noSkillDir);
1727
- const result1 = await generator30.parseSkillMd(path.join(noSkillDir, 'SKILL.md'), noSkillDir, 'no-skill-md');
1728
- assert(result1 === null, 'parseSkillMd returns null when SKILL.md is missing');
1729
-
1730
- // Case 2: SKILL.md with no frontmatter
1731
- const noFmDir = path.join(tempFixture30, 'no-frontmatter');
1732
- await fs.ensureDir(noFmDir);
1733
- await fs.writeFile(path.join(noFmDir, 'SKILL.md'), '# Just a heading\n\nNo frontmatter here.\n');
1734
- const result2 = await generator30.parseSkillMd(path.join(noFmDir, 'SKILL.md'), noFmDir, 'no-frontmatter');
1735
- assert(result2 === null, 'parseSkillMd returns null when SKILL.md has no frontmatter');
1736
-
1737
- // Case 3: SKILL.md missing description
1738
- const noDescDir = path.join(tempFixture30, 'no-desc');
1739
- await fs.ensureDir(noDescDir);
1740
- await fs.writeFile(path.join(noDescDir, 'SKILL.md'), '---\nname: no-desc\n---\n\nBody.\n');
1741
- const result3 = await generator30.parseSkillMd(path.join(noDescDir, 'SKILL.md'), noDescDir, 'no-desc');
1742
- assert(result3 === null, 'parseSkillMd returns null when description is missing');
1743
-
1744
- // Case 4: SKILL.md missing name
1745
- const noNameDir = path.join(tempFixture30, 'no-name');
1746
- await fs.ensureDir(noNameDir);
1747
- await fs.writeFile(path.join(noNameDir, 'SKILL.md'), '---\ndescription: has desc but no name\n---\n\nBody.\n');
1748
- const result4 = await generator30.parseSkillMd(path.join(noNameDir, 'SKILL.md'), noNameDir, 'no-name');
1749
- assert(result4 === null, 'parseSkillMd returns null when name is missing');
1750
-
1751
- // Case 5: Name mismatch
1752
- const mismatchDir = path.join(tempFixture30, 'actual-dir-name');
1753
- await fs.ensureDir(mismatchDir);
1754
- await fs.writeFile(path.join(mismatchDir, 'SKILL.md'), '---\nname: wrong-name\ndescription: A skill\n---\n\nBody.\n');
1755
- const result5 = await generator30.parseSkillMd(path.join(mismatchDir, 'SKILL.md'), mismatchDir, 'actual-dir-name');
1756
- assert(result5 === null, 'parseSkillMd returns null when name does not match directory name');
1757
-
1758
- // Case 6: Valid SKILL.md (positive control)
1759
- const validDir = path.join(tempFixture30, 'valid-skill');
1760
- await fs.ensureDir(validDir);
1761
- await fs.writeFile(path.join(validDir, 'SKILL.md'), '---\nname: valid-skill\ndescription: A valid skill\n---\n\nBody.\n');
1762
- const result6 = await generator30.parseSkillMd(path.join(validDir, 'SKILL.md'), validDir, 'valid-skill');
1763
- assert(result6 !== null && result6.name === 'valid-skill', 'parseSkillMd returns metadata for valid SKILL.md');
1764
-
1765
- // Case 7: Malformed YAML (non-object)
1766
- const malformedDir = path.join(tempFixture30, 'malformed');
1767
- await fs.ensureDir(malformedDir);
1768
- await fs.writeFile(path.join(malformedDir, 'SKILL.md'), '---\njust a string\n---\n\nBody.\n');
1769
- const result7 = await generator30.parseSkillMd(path.join(malformedDir, 'SKILL.md'), malformedDir, 'malformed');
1770
- assert(result7 === null, 'parseSkillMd returns null for non-object YAML frontmatter');
1771
- } catch (error) {
1772
- assert(false, 'parseSkillMd validation test succeeds', error.message);
1773
- } finally {
1774
- if (tempFixture30) await fs.remove(tempFixture30).catch(() => {});
1775
- }
1776
-
1777
- console.log('');
1778
-
1779
- // ============================================================
1780
- // Summary
1781
- // ============================================================
1782
- console.log(`${colors.cyan}========================================`);
1783
- console.log('Test Results:');
1784
- console.log(` Passed: ${colors.green}${passed}${colors.reset}`);
1785
- console.log(` Failed: ${colors.red}${failed}${colors.reset}`);
1786
- console.log(`========================================${colors.reset}\n`);
1787
-
1788
- if (failed === 0) {
1789
- console.log(`${colors.green}✨ All installation component tests passed!${colors.reset}\n`);
1790
- process.exit(0);
1791
- } else {
1792
- console.log(`${colors.red}❌ Some installation component tests failed${colors.reset}\n`);
1793
- process.exit(1);
1794
- }
1795
- }
1796
-
1797
- // Run tests
1798
- runTests().catch((error) => {
1799
- console.error(`${colors.red}Test runner failed:${colors.reset}`, error.message);
1800
- console.error(error.stack);
1801
- process.exit(1);
1802
- });