@zeyue0329/xiaoma-cli 1.0.48 → 6.0.0-alpha.13

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 (914) hide show
  1. package/README.md +0 -2
  2. package/custom/src/agents/commit-poet/commit-poet.agent.yaml +129 -0
  3. package/custom/src/agents/commit-poet/installation-guide.md +36 -0
  4. package/custom/src/agents/toolsmith/installation-guide.md +36 -0
  5. package/custom/src/agents/toolsmith/toolsmith-sidecar/instructions.md +70 -0
  6. package/custom/src/agents/toolsmith/toolsmith-sidecar/knowledge/bundlers.md +111 -0
  7. package/custom/src/agents/toolsmith/toolsmith-sidecar/knowledge/deploy.md +70 -0
  8. package/custom/src/agents/toolsmith/toolsmith-sidecar/knowledge/docs.md +114 -0
  9. package/custom/src/agents/toolsmith/toolsmith-sidecar/knowledge/installers.md +134 -0
  10. package/custom/src/agents/toolsmith/toolsmith-sidecar/knowledge/modules.md +160 -0
  11. package/custom/src/agents/toolsmith/toolsmith-sidecar/knowledge/tests.md +103 -0
  12. package/custom/src/agents/toolsmith/toolsmith-sidecar/memories.md +17 -0
  13. package/custom/src/agents/toolsmith/toolsmith.agent.yaml +108 -0
  14. package/docs/BUNDLE_DISTRIBUTION_SETUP.md +95 -0
  15. package/docs/agent-customization-guide.md +208 -0
  16. package/docs/custom-agent-installation.md +183 -0
  17. package/docs/document-sharding-guide.md +449 -0
  18. package/docs/ide-info/auggie.md +31 -0
  19. package/docs/ide-info/claude-code.md +25 -0
  20. package/docs/ide-info/cline.md +31 -0
  21. package/docs/ide-info/codex.md +21 -0
  22. package/docs/ide-info/crush.md +30 -0
  23. package/docs/ide-info/cursor.md +25 -0
  24. package/docs/ide-info/gemini.md +25 -0
  25. package/docs/ide-info/github-copilot.md +26 -0
  26. package/docs/ide-info/iflow.md +33 -0
  27. package/docs/ide-info/kilo.md +24 -0
  28. package/docs/ide-info/opencode.md +24 -0
  29. package/docs/ide-info/qwen.md +25 -0
  30. package/docs/ide-info/roo.md +27 -0
  31. package/docs/ide-info/rovo-dev.md +388 -0
  32. package/docs/ide-info/trae.md +25 -0
  33. package/docs/ide-info/windsurf.md +22 -0
  34. package/docs/index.md +144 -0
  35. package/docs/installers-bundlers/ide-injections.md +186 -0
  36. package/docs/installers-bundlers/installers-modules-platforms-reference.md +379 -0
  37. package/docs/rag/rag.md +812 -0
  38. package/docs/v4-to-v6-upgrade.md +220 -0
  39. package/docs/v6-open-items.md +17 -0
  40. package/docs/web-bundles-gemini-gpt-guide.md +468 -0
  41. package/eslint.config.mjs +133 -0
  42. package/package.json +41 -51
  43. package/prettier.config.mjs +32 -0
  44. package/src/core/_module-installer/install-config.yaml +29 -0
  45. package/src/core/_module-installer/installer.js +60 -0
  46. package/src/core/agents/xiaoma-master.agent.yaml +39 -0
  47. package/src/core/agents/xiaoma-web-orchestrator.agent.xml +113 -0
  48. package/src/core/resources/excalidraw/README.md +160 -0
  49. package/src/core/resources/excalidraw/excalidraw-helpers.md +127 -0
  50. package/src/core/resources/excalidraw/library-loader.md +50 -0
  51. package/src/core/resources/excalidraw/validate-json-instructions.md +79 -0
  52. package/src/core/tasks/advanced-elicitation-methods.csv +51 -0
  53. package/src/core/tasks/advanced-elicitation.xml +116 -0
  54. package/src/core/tasks/index-docs.xml +65 -0
  55. package/src/core/tasks/validate-workflow.xml +89 -0
  56. package/src/core/tasks/workflow.xml +235 -0
  57. package/src/core/tools/shard-doc.xml +109 -0
  58. package/src/core/workflows/brainstorming/brain-methods.csv +62 -0
  59. package/src/core/workflows/brainstorming/steps/step-01-session-setup.md +196 -0
  60. package/src/core/workflows/brainstorming/steps/step-01b-continue.md +121 -0
  61. package/src/core/workflows/brainstorming/steps/step-02a-user-selected.md +224 -0
  62. package/src/core/workflows/brainstorming/steps/step-02b-ai-recommended.md +236 -0
  63. package/src/core/workflows/brainstorming/steps/step-02c-random-selection.md +208 -0
  64. package/src/core/workflows/brainstorming/steps/step-02d-progressive-flow.md +263 -0
  65. package/src/core/workflows/brainstorming/steps/step-03-technique-execution.md +339 -0
  66. package/src/core/workflows/brainstorming/steps/step-04-idea-organization.md +302 -0
  67. package/src/core/workflows/brainstorming/template.md +15 -0
  68. package/src/core/workflows/brainstorming/workflow.md +51 -0
  69. package/src/core/workflows/party-mode/steps/step-01-agent-loading.md +138 -0
  70. package/src/core/workflows/party-mode/steps/step-02-discussion-orchestration.md +203 -0
  71. package/src/core/workflows/party-mode/steps/step-03-graceful-exit.md +159 -0
  72. package/src/core/workflows/party-mode/workflow.md +207 -0
  73. package/src/modules/cis/_module-installer/install-config.yaml +16 -0
  74. package/src/modules/cis/_module-installer/installer.js +92 -0
  75. package/src/modules/cis/agents/README.md +104 -0
  76. package/src/modules/cis/agents/brainstorming-coach.agent.yaml +29 -0
  77. package/src/modules/cis/agents/creative-problem-solver.agent.yaml +29 -0
  78. package/src/modules/cis/agents/design-thinking-coach.agent.yaml +29 -0
  79. package/src/modules/cis/agents/innovation-strategist.agent.yaml +29 -0
  80. package/src/modules/cis/agents/presentation-master.agent.yaml +61 -0
  81. package/src/modules/cis/agents/storyteller.agent.yaml +29 -0
  82. package/src/modules/cis/readme.md +153 -0
  83. package/src/modules/cis/teams/creative-squad.yaml +7 -0
  84. package/src/modules/cis/teams/default-party.csv +12 -0
  85. package/src/modules/cis/workflows/README.md +139 -0
  86. package/src/modules/cis/workflows/design-thinking/README.md +56 -0
  87. package/src/modules/cis/workflows/design-thinking/design-methods.csv +31 -0
  88. package/src/modules/cis/workflows/design-thinking/instructions.md +202 -0
  89. package/src/modules/cis/workflows/design-thinking/template.md +111 -0
  90. package/src/modules/cis/workflows/design-thinking/workflow.yaml +38 -0
  91. package/src/modules/cis/workflows/innovation-strategy/README.md +56 -0
  92. package/src/modules/cis/workflows/innovation-strategy/innovation-frameworks.csv +31 -0
  93. package/src/modules/cis/workflows/innovation-strategy/instructions.md +276 -0
  94. package/src/modules/cis/workflows/innovation-strategy/template.md +189 -0
  95. package/src/modules/cis/workflows/innovation-strategy/workflow.yaml +38 -0
  96. package/src/modules/cis/workflows/problem-solving/README.md +56 -0
  97. package/src/modules/cis/workflows/problem-solving/instructions.md +252 -0
  98. package/src/modules/cis/workflows/problem-solving/solving-methods.csv +31 -0
  99. package/src/modules/cis/workflows/problem-solving/template.md +165 -0
  100. package/src/modules/cis/workflows/problem-solving/workflow.yaml +38 -0
  101. package/src/modules/cis/workflows/storytelling/README.md +58 -0
  102. package/src/modules/cis/workflows/storytelling/instructions.md +293 -0
  103. package/src/modules/cis/workflows/storytelling/story-types.csv +26 -0
  104. package/src/modules/cis/workflows/storytelling/template.md +113 -0
  105. package/src/modules/cis/workflows/storytelling/workflow.yaml +38 -0
  106. package/src/modules/xmb/README.md +261 -0
  107. package/src/modules/xmb/_module-installer/install-config.yaml +28 -0
  108. package/src/modules/xmb/agents/xiaoma-builder.agent.yaml +71 -0
  109. package/src/modules/xmb/docs/agents/agent-compilation.md +340 -0
  110. package/src/modules/xmb/docs/agents/agent-menu-patterns.md +524 -0
  111. package/src/modules/xmb/docs/agents/expert-agent-architecture.md +364 -0
  112. package/src/modules/xmb/docs/agents/index.md +55 -0
  113. package/src/modules/xmb/docs/agents/kb.csv +0 -0
  114. package/src/modules/xmb/docs/agents/module-agent-architecture.md +367 -0
  115. package/src/modules/xmb/docs/agents/simple-agent-architecture.md +288 -0
  116. package/src/modules/xmb/docs/agents/understanding-agent-types.md +184 -0
  117. package/src/modules/xmb/docs/workflows/architecture.md +220 -0
  118. package/src/modules/xmb/docs/workflows/common-workflow-tools.csv +19 -0
  119. package/src/modules/xmb/docs/workflows/csv-data-file-standards.md +206 -0
  120. package/src/modules/xmb/docs/workflows/index.md +45 -0
  121. package/src/modules/xmb/docs/workflows/intent-vs-prescriptive-spectrum.md +220 -0
  122. package/src/modules/xmb/docs/workflows/kb.csv +0 -0
  123. package/src/modules/xmb/docs/workflows/step-template.md +283 -0
  124. package/src/modules/xmb/docs/workflows/terms.md +97 -0
  125. package/src/modules/xmb/docs/workflows/workflow-template.md +152 -0
  126. package/src/modules/xmb/reference/agents/expert-examples/journal-keeper/README.md +242 -0
  127. package/src/modules/xmb/reference/agents/expert-examples/journal-keeper/journal-keeper-sidecar/breakthroughs.md +24 -0
  128. package/src/modules/xmb/reference/agents/expert-examples/journal-keeper/journal-keeper-sidecar/instructions.md +108 -0
  129. package/src/modules/xmb/reference/agents/expert-examples/journal-keeper/journal-keeper-sidecar/memories.md +46 -0
  130. package/src/modules/xmb/reference/agents/expert-examples/journal-keeper/journal-keeper-sidecar/mood-patterns.md +39 -0
  131. package/src/modules/xmb/reference/agents/expert-examples/journal-keeper/journal-keeper.agent.yaml +152 -0
  132. package/src/modules/xmb/reference/agents/module-examples/README.md +50 -0
  133. package/src/modules/xmb/reference/agents/module-examples/security-engineer.agent.yaml +53 -0
  134. package/src/modules/xmb/reference/agents/module-examples/trend-analyst.agent.yaml +57 -0
  135. package/src/modules/xmb/reference/agents/simple-examples/README.md +223 -0
  136. package/src/modules/xmb/reference/agents/simple-examples/commit-poet.agent.yaml +126 -0
  137. package/src/modules/xmb/reference/readme.md +3 -0
  138. package/src/modules/xmb/reference/workflows/meal-prep-nutrition/data/dietary-restrictions.csv +18 -0
  139. package/src/modules/xmb/reference/workflows/meal-prep-nutrition/data/macro-calculator.csv +16 -0
  140. package/src/modules/xmb/reference/workflows/meal-prep-nutrition/data/recipe-database.csv +28 -0
  141. package/src/modules/xmb/reference/workflows/meal-prep-nutrition/steps/step-01-init.md +177 -0
  142. package/src/modules/xmb/reference/workflows/meal-prep-nutrition/steps/step-01b-continue.md +150 -0
  143. package/src/modules/xmb/reference/workflows/meal-prep-nutrition/steps/step-02-profile.md +164 -0
  144. package/src/modules/xmb/reference/workflows/meal-prep-nutrition/steps/step-03-assessment.md +152 -0
  145. package/src/modules/xmb/reference/workflows/meal-prep-nutrition/steps/step-04-strategy.md +182 -0
  146. package/src/modules/xmb/reference/workflows/meal-prep-nutrition/steps/step-05-shopping.md +167 -0
  147. package/src/modules/xmb/reference/workflows/meal-prep-nutrition/steps/step-06-prep-schedule.md +194 -0
  148. package/src/modules/xmb/reference/workflows/meal-prep-nutrition/templates/assessment-section.md +25 -0
  149. package/src/modules/xmb/reference/workflows/meal-prep-nutrition/templates/nutrition-plan.md +68 -0
  150. package/src/modules/xmb/reference/workflows/meal-prep-nutrition/templates/prep-schedule-section.md +29 -0
  151. package/src/modules/xmb/reference/workflows/meal-prep-nutrition/templates/profile-section.md +47 -0
  152. package/src/modules/xmb/reference/workflows/meal-prep-nutrition/templates/shopping-section.md +37 -0
  153. package/src/modules/xmb/reference/workflows/meal-prep-nutrition/templates/strategy-section.md +18 -0
  154. package/src/modules/xmb/reference/workflows/meal-prep-nutrition/workflow.md +58 -0
  155. package/src/modules/xmb/workflows/create-agent/data/agent-validation-checklist.md +174 -0
  156. package/src/modules/xmb/workflows/create-agent/data/brainstorm-context.md +153 -0
  157. package/src/modules/xmb/workflows/create-agent/data/communication-presets.csv +61 -0
  158. package/src/modules/xmb/workflows/create-agent/data/info-and-installation-guide.md +17 -0
  159. package/src/modules/xmb/workflows/create-agent/data/reference/README.md +3 -0
  160. package/src/modules/xmb/workflows/create-agent/data/reference/agents/expert-examples/journal-keeper/README.md +242 -0
  161. package/src/modules/xmb/workflows/create-agent/data/reference/agents/expert-examples/journal-keeper/journal-keeper-sidecar/breakthroughs.md +24 -0
  162. package/src/modules/xmb/workflows/create-agent/data/reference/agents/expert-examples/journal-keeper/journal-keeper-sidecar/instructions.md +108 -0
  163. package/src/modules/xmb/workflows/create-agent/data/reference/agents/expert-examples/journal-keeper/journal-keeper-sidecar/memories.md +46 -0
  164. package/src/modules/xmb/workflows/create-agent/data/reference/agents/expert-examples/journal-keeper/journal-keeper-sidecar/mood-patterns.md +39 -0
  165. package/src/modules/xmb/workflows/create-agent/data/reference/agents/expert-examples/journal-keeper/journal-keeper.agent.yaml +152 -0
  166. package/src/modules/xmb/workflows/create-agent/data/reference/agents/module-examples/README.md +50 -0
  167. package/src/modules/xmb/workflows/create-agent/data/reference/agents/module-examples/security-engineer.agent.yaml +53 -0
  168. package/src/modules/xmb/workflows/create-agent/data/reference/agents/module-examples/trend-analyst.agent.yaml +57 -0
  169. package/src/modules/xmb/workflows/create-agent/data/reference/agents/simple-examples/README.md +223 -0
  170. package/src/modules/xmb/workflows/create-agent/data/reference/agents/simple-examples/commit-poet.agent.yaml +126 -0
  171. package/src/modules/xmb/workflows/create-agent/data/reference/workflows/meal-prep-nutrition/data/dietary-restrictions.csv +18 -0
  172. package/src/modules/xmb/workflows/create-agent/data/reference/workflows/meal-prep-nutrition/data/macro-calculator.csv +16 -0
  173. package/src/modules/xmb/workflows/create-agent/data/reference/workflows/meal-prep-nutrition/data/recipe-database.csv +28 -0
  174. package/src/modules/xmb/workflows/create-agent/data/reference/workflows/meal-prep-nutrition/steps/step-01-init.md +177 -0
  175. package/src/modules/xmb/workflows/create-agent/data/reference/workflows/meal-prep-nutrition/steps/step-01b-continue.md +150 -0
  176. package/src/modules/xmb/workflows/create-agent/data/reference/workflows/meal-prep-nutrition/steps/step-02-profile.md +164 -0
  177. package/src/modules/xmb/workflows/create-agent/data/reference/workflows/meal-prep-nutrition/steps/step-03-assessment.md +152 -0
  178. package/src/modules/xmb/workflows/create-agent/data/reference/workflows/meal-prep-nutrition/steps/step-04-strategy.md +182 -0
  179. package/src/modules/xmb/workflows/create-agent/data/reference/workflows/meal-prep-nutrition/steps/step-05-shopping.md +167 -0
  180. package/src/modules/xmb/workflows/create-agent/data/reference/workflows/meal-prep-nutrition/steps/step-06-prep-schedule.md +194 -0
  181. package/src/modules/xmb/workflows/create-agent/data/reference/workflows/meal-prep-nutrition/templates/assessment-section.md +25 -0
  182. package/src/modules/xmb/workflows/create-agent/data/reference/workflows/meal-prep-nutrition/templates/nutrition-plan.md +68 -0
  183. package/src/modules/xmb/workflows/create-agent/data/reference/workflows/meal-prep-nutrition/templates/prep-schedule-section.md +29 -0
  184. package/src/modules/xmb/workflows/create-agent/data/reference/workflows/meal-prep-nutrition/templates/profile-section.md +47 -0
  185. package/src/modules/xmb/workflows/create-agent/data/reference/workflows/meal-prep-nutrition/templates/shopping-section.md +37 -0
  186. package/src/modules/xmb/workflows/create-agent/data/reference/workflows/meal-prep-nutrition/templates/strategy-section.md +18 -0
  187. package/src/modules/xmb/workflows/create-agent/data/reference/workflows/meal-prep-nutrition/workflow.md +58 -0
  188. package/src/modules/xmb/workflows/create-agent/data/validation-complete.md +305 -0
  189. package/src/modules/xmb/workflows/create-agent/steps/step-01-brainstorm.md +145 -0
  190. package/src/modules/xmb/workflows/create-agent/steps/step-02-discover.md +210 -0
  191. package/src/modules/xmb/workflows/create-agent/steps/step-03-persona.md +260 -0
  192. package/src/modules/xmb/workflows/create-agent/steps/step-04-commands.md +237 -0
  193. package/src/modules/xmb/workflows/create-agent/steps/step-05-name.md +231 -0
  194. package/src/modules/xmb/workflows/create-agent/steps/step-06-build.md +224 -0
  195. package/src/modules/xmb/workflows/create-agent/steps/step-07-validate.md +234 -0
  196. package/src/modules/xmb/workflows/create-agent/steps/step-08-setup.md +179 -0
  197. package/src/modules/xmb/workflows/create-agent/steps/step-09-customize.md +197 -0
  198. package/src/modules/xmb/workflows/create-agent/steps/step-10-build-tools.md +180 -0
  199. package/src/modules/xmb/workflows/create-agent/steps/step-11-celebrate.md +222 -0
  200. package/src/modules/xmb/workflows/create-agent/templates/agent_commands.md +21 -0
  201. package/src/modules/xmb/workflows/create-agent/templates/agent_persona.md +25 -0
  202. package/src/modules/xmb/workflows/create-agent/templates/agent_purpose_and_type.md +23 -0
  203. package/src/modules/xmb/workflows/create-agent/workflow.md +91 -0
  204. package/src/modules/xmb/workflows/create-workflow/steps/step-01-init.md +168 -0
  205. package/src/modules/xmb/workflows/create-workflow/steps/step-02-gather.md +233 -0
  206. package/src/modules/xmb/workflows/create-workflow/steps/step-03-tools-overview.md +127 -0
  207. package/src/modules/xmb/workflows/create-workflow/steps/step-04-core-tools.md +145 -0
  208. package/src/modules/xmb/workflows/create-workflow/steps/step-05-memory-requirements.md +136 -0
  209. package/src/modules/xmb/workflows/create-workflow/steps/step-06-external-tools.md +154 -0
  210. package/src/modules/xmb/workflows/create-workflow/steps/step-07-installation-guidance.md +159 -0
  211. package/src/modules/xmb/workflows/create-workflow/steps/step-08-tools-summary.md +167 -0
  212. package/src/modules/xmb/workflows/create-workflow/steps/step-09-design.md +239 -0
  213. package/src/modules/xmb/workflows/create-workflow/steps/step-10-plan-review.md +215 -0
  214. package/src/modules/xmb/workflows/create-workflow/steps/step-11-build.md +262 -0
  215. package/src/modules/xmb/workflows/create-workflow/steps/step-12-review.md +270 -0
  216. package/src/modules/xmb/workflows/create-workflow/templates/build-summary.md +36 -0
  217. package/src/modules/xmb/workflows/create-workflow/templates/completion-section.md +39 -0
  218. package/src/modules/xmb/workflows/create-workflow/templates/content-template.md +21 -0
  219. package/src/modules/xmb/workflows/create-workflow/templates/design-section.md +53 -0
  220. package/src/modules/xmb/workflows/create-workflow/templates/project-info.md +18 -0
  221. package/src/modules/xmb/workflows/create-workflow/templates/requirements-section.md +47 -0
  222. package/src/modules/xmb/workflows/create-workflow/templates/review-section.md +56 -0
  223. package/src/modules/xmb/workflows/create-workflow/templates/step-file.md +139 -0
  224. package/src/modules/xmb/workflows/create-workflow/templates/workflow-plan.md +54 -0
  225. package/src/modules/xmb/workflows/create-workflow/templates/workflow.md +58 -0
  226. package/src/modules/xmb/workflows/create-workflow/workflow.md +58 -0
  227. package/src/modules/xmb/workflows/edit-agent/steps/step-01-discover-intent.md +134 -0
  228. package/src/modules/xmb/workflows/edit-agent/steps/step-02-analyze-agent.md +202 -0
  229. package/src/modules/xmb/workflows/edit-agent/steps/step-03-propose-changes.md +157 -0
  230. package/src/modules/xmb/workflows/edit-agent/steps/step-04-apply-changes.md +150 -0
  231. package/src/modules/xmb/workflows/edit-agent/steps/step-05-validate.md +150 -0
  232. package/src/modules/xmb/workflows/edit-agent/workflow.md +58 -0
  233. package/src/modules/xmb/workflows/edit-workflow/steps/step-01-analyze.md +221 -0
  234. package/src/modules/xmb/workflows/edit-workflow/steps/step-02-discover.md +253 -0
  235. package/src/modules/xmb/workflows/edit-workflow/steps/step-03-improve.md +217 -0
  236. package/src/modules/xmb/workflows/edit-workflow/steps/step-04-validate.md +193 -0
  237. package/src/modules/xmb/workflows/edit-workflow/steps/step-05-compliance-check.md +245 -0
  238. package/src/modules/xmb/workflows/edit-workflow/templates/completion-summary.md +75 -0
  239. package/src/modules/xmb/workflows/edit-workflow/templates/improvement-goals.md +68 -0
  240. package/src/modules/xmb/workflows/edit-workflow/templates/improvement-log.md +40 -0
  241. package/src/modules/xmb/workflows/edit-workflow/templates/validation-results.md +51 -0
  242. package/src/modules/xmb/workflows/edit-workflow/templates/workflow-analysis.md +56 -0
  243. package/src/modules/xmb/workflows/edit-workflow/workflow.md +58 -0
  244. package/src/modules/xmb/workflows/workflow-compliance-check/steps/step-01-validate-goal.md +152 -0
  245. package/src/modules/xmb/workflows/workflow-compliance-check/steps/step-02-workflow-validation.md +243 -0
  246. package/src/modules/xmb/workflows/workflow-compliance-check/steps/step-03-step-validation.md +274 -0
  247. package/src/modules/xmb/workflows/workflow-compliance-check/steps/step-04-file-validation.md +295 -0
  248. package/src/modules/xmb/workflows/workflow-compliance-check/steps/step-05-intent-spectrum-validation.md +264 -0
  249. package/src/modules/xmb/workflows/workflow-compliance-check/steps/step-06-web-subprocess-validation.md +360 -0
  250. package/src/modules/xmb/workflows/workflow-compliance-check/steps/step-07-holistic-analysis.md +258 -0
  251. package/src/modules/xmb/workflows/workflow-compliance-check/steps/step-08-generate-report.md +301 -0
  252. package/src/modules/xmb/workflows/workflow-compliance-check/templates/compliance-report.md +140 -0
  253. package/src/modules/xmb/workflows/workflow-compliance-check/workflow.md +58 -0
  254. package/src/modules/xmb/workflows-legacy/create-module/README.md +229 -0
  255. package/src/modules/xmb/workflows-legacy/create-module/brainstorm-context.md +137 -0
  256. package/src/modules/xmb/workflows-legacy/create-module/checklist.md +235 -0
  257. package/src/modules/xmb/workflows-legacy/create-module/installer-templates/install-config.yaml +92 -0
  258. package/src/modules/xmb/workflows-legacy/create-module/installer-templates/installer.js +231 -0
  259. package/src/modules/xmb/workflows-legacy/create-module/instructions.md +577 -0
  260. package/src/modules/xmb/workflows-legacy/create-module/module-structure.md +400 -0
  261. package/src/modules/xmb/workflows-legacy/create-module/workflow.yaml +52 -0
  262. package/src/modules/xmb/workflows-legacy/edit-module/README.md +187 -0
  263. package/src/modules/xmb/workflows-legacy/edit-module/checklist.md +165 -0
  264. package/src/modules/xmb/workflows-legacy/edit-module/instructions.md +341 -0
  265. package/src/modules/xmb/workflows-legacy/edit-module/workflow.yaml +34 -0
  266. package/src/modules/xmb/workflows-legacy/module-brief/README.md +264 -0
  267. package/src/modules/xmb/workflows-legacy/module-brief/checklist.md +116 -0
  268. package/src/modules/xmb/workflows-legacy/module-brief/instructions.md +268 -0
  269. package/src/modules/xmb/workflows-legacy/module-brief/template.md +275 -0
  270. package/src/modules/xmb/workflows-legacy/module-brief/workflow.yaml +36 -0
  271. package/src/modules/xmc/README.md +128 -0
  272. package/src/modules/xmc/_module-installer/install-config.yaml +53 -0
  273. package/src/modules/xmc/_module-installer/installer.js +131 -0
  274. package/src/modules/xmc/_module-installer/platform-specifics/claude-code.js +35 -0
  275. package/src/modules/xmc/_module-installer/platform-specifics/windsurf.js +32 -0
  276. package/src/modules/xmc/agents/analyst.agent.yaml +49 -0
  277. package/src/modules/xmc/agents/architect.agent.yaml +52 -0
  278. package/src/modules/xmc/agents/auto-iteration-orchestrator.agent.yaml +115 -0
  279. package/src/modules/xmc/agents/dev.agent.yaml +44 -0
  280. package/src/modules/xmc/agents/pm.agent.yaml +50 -0
  281. package/src/modules/xmc/agents/quick-flow-solo-dev.agent.yaml +36 -0
  282. package/src/modules/xmc/agents/sm.agent.yaml +55 -0
  283. package/src/modules/xmc/agents/tea.agent.yaml +70 -0
  284. package/src/modules/xmc/agents/tech-writer.agent.yaml +67 -0
  285. package/src/modules/xmc/agents/ux-designer.agent.yaml +45 -0
  286. package/src/modules/xmc/data/README.md +29 -0
  287. package/src/modules/xmc/data/documentation-standards.md +262 -0
  288. package/src/modules/xmc/data/project-context-template.md +40 -0
  289. package/src/modules/xmc/docs/README.md +252 -0
  290. package/src/modules/xmc/docs/agents-guide.md +952 -0
  291. package/src/modules/xmc/docs/brownfield-guide.md +750 -0
  292. package/src/modules/xmc/docs/enterprise-agentic-development.md +686 -0
  293. package/src/modules/xmc/docs/faq.md +561 -0
  294. package/src/modules/xmc/docs/glossary.md +303 -0
  295. package/src/modules/xmc/docs/images/workflow-method-greenfield.excalidraw +5174 -0
  296. package/src/modules/xmc/docs/images/workflow-method-greenfield.svg +2 -0
  297. package/src/modules/xmc/docs/iteration-development-guide.md +752 -0
  298. package/src/modules/xmc/docs/party-mode.md +224 -0
  299. package/src/modules/xmc/docs/quick-flow-solo-dev.md +337 -0
  300. package/src/modules/xmc/docs/quick-start.md +367 -0
  301. package/src/modules/xmc/docs/scale-adaptive-system.md +618 -0
  302. package/src/modules/xmc/docs/test-architecture.md +462 -0
  303. package/src/modules/xmc/docs/workflow-architecture-reference.md +366 -0
  304. package/src/modules/xmc/docs/workflow-document-project-reference.md +489 -0
  305. package/src/modules/xmc/docs/workflows-analysis.md +266 -0
  306. package/src/modules/xmc/docs/workflows-implementation.md +171 -0
  307. package/src/modules/xmc/docs/workflows-planning.md +451 -0
  308. package/src/modules/xmc/docs/workflows-solutioning.md +509 -0
  309. package/src/modules/xmc/docs/xiaoma-quick-flow.md +528 -0
  310. package/src/modules/xmc/sub-modules/claude-code/config.yaml +5 -0
  311. package/src/modules/xmc/sub-modules/claude-code/injections.yaml +242 -0
  312. package/src/modules/xmc/sub-modules/claude-code/readme.md +87 -0
  313. package/src/modules/xmc/sub-modules/claude-code/sub-agents/bmad-analysis/api-documenter.md +102 -0
  314. package/src/modules/xmc/sub-modules/claude-code/sub-agents/bmad-analysis/codebase-analyzer.md +82 -0
  315. package/src/modules/xmc/sub-modules/claude-code/sub-agents/bmad-analysis/data-analyst.md +101 -0
  316. package/src/modules/xmc/sub-modules/claude-code/sub-agents/bmad-analysis/pattern-detector.md +84 -0
  317. package/src/modules/xmc/sub-modules/claude-code/sub-agents/bmad-planning/dependency-mapper.md +83 -0
  318. package/src/modules/xmc/sub-modules/claude-code/sub-agents/bmad-planning/epic-optimizer.md +81 -0
  319. package/src/modules/xmc/sub-modules/claude-code/sub-agents/bmad-planning/requirements-analyst.md +61 -0
  320. package/src/modules/xmc/sub-modules/claude-code/sub-agents/bmad-planning/technical-decisions-curator.md +168 -0
  321. package/src/modules/xmc/sub-modules/claude-code/sub-agents/bmad-planning/trend-spotter.md +115 -0
  322. package/src/modules/xmc/sub-modules/claude-code/sub-agents/bmad-planning/user-journey-mapper.md +123 -0
  323. package/src/modules/xmc/sub-modules/claude-code/sub-agents/bmad-planning/user-researcher.md +72 -0
  324. package/src/modules/xmc/sub-modules/claude-code/sub-agents/bmad-research/market-researcher.md +51 -0
  325. package/src/modules/xmc/sub-modules/claude-code/sub-agents/bmad-research/tech-debt-auditor.md +106 -0
  326. package/src/modules/xmc/sub-modules/claude-code/sub-agents/bmad-review/document-reviewer.md +102 -0
  327. package/src/modules/xmc/sub-modules/claude-code/sub-agents/bmad-review/technical-evaluator.md +68 -0
  328. package/src/modules/xmc/sub-modules/claude-code/sub-agents/bmad-review/test-coverage-analyzer.md +108 -0
  329. package/src/modules/xmc/teams/default-party.csv +21 -0
  330. package/src/modules/xmc/teams/team-fullstack.yaml +12 -0
  331. package/src/modules/xmc/testarch/knowledge/api-request.md +303 -0
  332. package/src/modules/xmc/testarch/knowledge/auth-session.md +356 -0
  333. package/src/modules/xmc/testarch/knowledge/burn-in.md +273 -0
  334. package/src/modules/xmc/testarch/knowledge/ci-burn-in.md +675 -0
  335. package/src/modules/xmc/testarch/knowledge/component-tdd.md +486 -0
  336. package/src/modules/xmc/testarch/knowledge/contract-testing.md +957 -0
  337. package/src/modules/xmc/testarch/knowledge/data-factories.md +500 -0
  338. package/src/modules/xmc/testarch/knowledge/email-auth.md +721 -0
  339. package/src/modules/xmc/testarch/knowledge/error-handling.md +725 -0
  340. package/src/modules/xmc/testarch/knowledge/feature-flags.md +750 -0
  341. package/src/modules/xmc/testarch/knowledge/file-utils.md +260 -0
  342. package/src/modules/xmc/testarch/knowledge/fixture-architecture.md +401 -0
  343. package/src/modules/xmc/testarch/knowledge/fixtures-composition.md +382 -0
  344. package/src/modules/xmc/testarch/knowledge/intercept-network-call.md +280 -0
  345. package/src/modules/xmc/testarch/knowledge/log.md +294 -0
  346. package/src/modules/xmc/testarch/knowledge/network-error-monitor.md +272 -0
  347. package/src/modules/xmc/testarch/knowledge/network-first.md +486 -0
  348. package/src/modules/xmc/testarch/knowledge/network-recorder.md +265 -0
  349. package/src/modules/xmc/testarch/knowledge/nfr-criteria.md +670 -0
  350. package/src/modules/xmc/testarch/knowledge/overview.md +284 -0
  351. package/src/modules/xmc/testarch/knowledge/playwright-config.md +730 -0
  352. package/src/modules/xmc/testarch/knowledge/probability-impact.md +601 -0
  353. package/src/modules/xmc/testarch/knowledge/recurse.md +296 -0
  354. package/src/modules/xmc/testarch/knowledge/risk-governance.md +615 -0
  355. package/src/modules/xmc/testarch/knowledge/selective-testing.md +732 -0
  356. package/src/modules/xmc/testarch/knowledge/selector-resilience.md +527 -0
  357. package/src/modules/xmc/testarch/knowledge/test-healing-patterns.md +644 -0
  358. package/src/modules/xmc/testarch/knowledge/test-levels-framework.md +473 -0
  359. package/src/modules/xmc/testarch/knowledge/test-priorities-matrix.md +373 -0
  360. package/src/modules/xmc/testarch/knowledge/test-quality.md +664 -0
  361. package/src/modules/xmc/testarch/knowledge/timing-debugging.md +372 -0
  362. package/src/modules/xmc/testarch/knowledge/visual-debugging.md +524 -0
  363. package/src/modules/xmc/testarch/tea-index.csv +33 -0
  364. package/src/modules/xmc/workflows/1-analysis/product-brief/product-brief.template.md +8 -0
  365. package/src/modules/xmc/workflows/1-analysis/product-brief/steps/step-01-init.md +192 -0
  366. package/src/modules/xmc/workflows/1-analysis/product-brief/steps/step-01b-continue.md +167 -0
  367. package/src/modules/xmc/workflows/1-analysis/product-brief/steps/step-02-vision.md +203 -0
  368. package/src/modules/xmc/workflows/1-analysis/product-brief/steps/step-03-users.md +206 -0
  369. package/src/modules/xmc/workflows/1-analysis/product-brief/steps/step-04-metrics.md +209 -0
  370. package/src/modules/xmc/workflows/1-analysis/product-brief/steps/step-05-scope.md +223 -0
  371. package/src/modules/xmc/workflows/1-analysis/product-brief/steps/step-06-complete.md +199 -0
  372. package/src/modules/xmc/workflows/1-analysis/product-brief/workflow.md +58 -0
  373. package/src/modules/xmc/workflows/1-analysis/research/domain-steps/step-01-init.md +136 -0
  374. package/src/modules/xmc/workflows/1-analysis/research/domain-steps/step-02-domain-analysis.md +228 -0
  375. package/src/modules/xmc/workflows/1-analysis/research/domain-steps/step-03-competitive-landscape.md +237 -0
  376. package/src/modules/xmc/workflows/1-analysis/research/domain-steps/step-04-regulatory-focus.md +205 -0
  377. package/src/modules/xmc/workflows/1-analysis/research/domain-steps/step-05-technical-trends.md +233 -0
  378. package/src/modules/xmc/workflows/1-analysis/research/domain-steps/step-06-research-synthesis.md +443 -0
  379. package/src/modules/xmc/workflows/1-analysis/research/market-steps/step-01-init.md +182 -0
  380. package/src/modules/xmc/workflows/1-analysis/research/market-steps/step-02-customer-behavior.md +235 -0
  381. package/src/modules/xmc/workflows/1-analysis/research/market-steps/step-02-customer-insights.md +198 -0
  382. package/src/modules/xmc/workflows/1-analysis/research/market-steps/step-03-customer-pain-points.md +247 -0
  383. package/src/modules/xmc/workflows/1-analysis/research/market-steps/step-04-customer-decisions.md +257 -0
  384. package/src/modules/xmc/workflows/1-analysis/research/market-steps/step-05-competitive-analysis.md +175 -0
  385. package/src/modules/xmc/workflows/1-analysis/research/market-steps/step-06-research-completion.md +475 -0
  386. package/src/modules/xmc/workflows/1-analysis/research/research.template.md +16 -0
  387. package/src/modules/xmc/workflows/1-analysis/research/technical-steps/step-01-init.md +136 -0
  388. package/src/modules/xmc/workflows/1-analysis/research/technical-steps/step-02-technical-overview.md +237 -0
  389. package/src/modules/xmc/workflows/1-analysis/research/technical-steps/step-03-integration-patterns.md +246 -0
  390. package/src/modules/xmc/workflows/1-analysis/research/technical-steps/step-04-architectural-patterns.md +200 -0
  391. package/src/modules/xmc/workflows/1-analysis/research/technical-steps/step-05-implementation-research.md +237 -0
  392. package/src/modules/xmc/workflows/1-analysis/research/technical-steps/step-06-research-synthesis.md +486 -0
  393. package/src/modules/xmc/workflows/1-analysis/research/workflow.md +198 -0
  394. package/src/modules/xmc/workflows/2-plan-workflows/create-ux-design/steps/step-01-init.md +159 -0
  395. package/src/modules/xmc/workflows/2-plan-workflows/create-ux-design/steps/step-01b-continue.md +126 -0
  396. package/src/modules/xmc/workflows/2-plan-workflows/create-ux-design/steps/step-02-discovery.md +209 -0
  397. package/src/modules/xmc/workflows/2-plan-workflows/create-ux-design/steps/step-03-core-experience.md +215 -0
  398. package/src/modules/xmc/workflows/2-plan-workflows/create-ux-design/steps/step-04-emotional-response.md +218 -0
  399. package/src/modules/xmc/workflows/2-plan-workflows/create-ux-design/steps/step-05-inspiration.md +233 -0
  400. package/src/modules/xmc/workflows/2-plan-workflows/create-ux-design/steps/step-06-design-system.md +251 -0
  401. package/src/modules/xmc/workflows/2-plan-workflows/create-ux-design/steps/step-07-defining-experience.md +253 -0
  402. package/src/modules/xmc/workflows/2-plan-workflows/create-ux-design/steps/step-08-visual-foundation.md +223 -0
  403. package/src/modules/xmc/workflows/2-plan-workflows/create-ux-design/steps/step-09-design-directions.md +223 -0
  404. package/src/modules/xmc/workflows/2-plan-workflows/create-ux-design/steps/step-10-user-journeys.md +240 -0
  405. package/src/modules/xmc/workflows/2-plan-workflows/create-ux-design/steps/step-11-component-strategy.md +247 -0
  406. package/src/modules/xmc/workflows/2-plan-workflows/create-ux-design/steps/step-12-ux-patterns.md +236 -0
  407. package/src/modules/xmc/workflows/2-plan-workflows/create-ux-design/steps/step-13-responsive-accessibility.md +263 -0
  408. package/src/modules/xmc/workflows/2-plan-workflows/create-ux-design/steps/step-14-complete.md +226 -0
  409. package/src/modules/xmc/workflows/2-plan-workflows/create-ux-design/ux-design-template.md +13 -0
  410. package/src/modules/xmc/workflows/2-plan-workflows/create-ux-design/workflow.md +53 -0
  411. package/src/modules/xmc/workflows/2-plan-workflows/prd/domain-complexity.csv +13 -0
  412. package/src/modules/xmc/workflows/2-plan-workflows/prd/prd-template.md +9 -0
  413. package/src/modules/xmc/workflows/2-plan-workflows/prd/project-types.csv +11 -0
  414. package/src/modules/xmc/workflows/2-plan-workflows/prd/steps/step-01-init.md +161 -0
  415. package/src/modules/xmc/workflows/2-plan-workflows/prd/steps/step-01b-continue.md +123 -0
  416. package/src/modules/xmc/workflows/2-plan-workflows/prd/steps/step-02-discovery.md +275 -0
  417. package/src/modules/xmc/workflows/2-plan-workflows/prd/steps/step-03-success.md +271 -0
  418. package/src/modules/xmc/workflows/2-plan-workflows/prd/steps/step-04-journeys.md +272 -0
  419. package/src/modules/xmc/workflows/2-plan-workflows/prd/steps/step-05-domain.md +249 -0
  420. package/src/modules/xmc/workflows/2-plan-workflows/prd/steps/step-06-innovation.md +240 -0
  421. package/src/modules/xmc/workflows/2-plan-workflows/prd/steps/step-07-project-type.md +236 -0
  422. package/src/modules/xmc/workflows/2-plan-workflows/prd/steps/step-08-scoping.md +280 -0
  423. package/src/modules/xmc/workflows/2-plan-workflows/prd/steps/step-09-functional.md +251 -0
  424. package/src/modules/xmc/workflows/2-plan-workflows/prd/steps/step-10-nonfunctional.md +275 -0
  425. package/src/modules/xmc/workflows/2-plan-workflows/prd/steps/step-11-complete.md +210 -0
  426. package/src/modules/xmc/workflows/2-plan-workflows/prd/workflow.md +61 -0
  427. package/src/modules/xmc/workflows/3-solutioning/architecture/architecture-decision-template.md +13 -0
  428. package/src/modules/xmc/workflows/3-solutioning/architecture/data/domain-complexity.csv +11 -0
  429. package/src/modules/xmc/workflows/3-solutioning/architecture/data/project-types.csv +7 -0
  430. package/src/modules/xmc/workflows/3-solutioning/architecture/steps/step-01-init.md +194 -0
  431. package/src/modules/xmc/workflows/3-solutioning/architecture/steps/step-01b-continue.md +163 -0
  432. package/src/modules/xmc/workflows/3-solutioning/architecture/steps/step-02-context.md +223 -0
  433. package/src/modules/xmc/workflows/3-solutioning/architecture/steps/step-03-starter.md +330 -0
  434. package/src/modules/xmc/workflows/3-solutioning/architecture/steps/step-04-decisions.md +317 -0
  435. package/src/modules/xmc/workflows/3-solutioning/architecture/steps/step-05-patterns.md +358 -0
  436. package/src/modules/xmc/workflows/3-solutioning/architecture/steps/step-06-structure.md +378 -0
  437. package/src/modules/xmc/workflows/3-solutioning/architecture/steps/step-07-validation.md +358 -0
  438. package/src/modules/xmc/workflows/3-solutioning/architecture/steps/step-08-complete.md +351 -0
  439. package/src/modules/xmc/workflows/3-solutioning/architecture/workflow.md +48 -0
  440. package/src/modules/xmc/workflows/3-solutioning/create-epics-and-stories/epics-template.md +80 -0
  441. package/src/modules/xmc/workflows/3-solutioning/create-epics-and-stories/instructions.md +387 -0
  442. package/src/modules/xmc/workflows/3-solutioning/create-epics-and-stories/workflow.yaml +53 -0
  443. package/src/modules/xmc/workflows/3-solutioning/implementation-readiness/checklist.md +169 -0
  444. package/src/modules/xmc/workflows/3-solutioning/implementation-readiness/instructions.md +332 -0
  445. package/src/modules/xmc/workflows/3-solutioning/implementation-readiness/template.md +146 -0
  446. package/src/modules/xmc/workflows/3-solutioning/implementation-readiness/workflow.yaml +64 -0
  447. package/src/modules/xmc/workflows/4-implementation/code-review/instructions.xml +176 -0
  448. package/src/modules/xmc/workflows/4-implementation/code-review/workflow.yaml +54 -0
  449. package/src/modules/xmc/workflows/4-implementation/correct-course/checklist.md +279 -0
  450. package/src/modules/xmc/workflows/4-implementation/correct-course/instructions.md +206 -0
  451. package/src/modules/xmc/workflows/4-implementation/correct-course/workflow.yaml +58 -0
  452. package/src/modules/xmc/workflows/4-implementation/create-story/checklist.md +358 -0
  453. package/src/modules/xmc/workflows/4-implementation/create-story/instructions.xml +354 -0
  454. package/src/modules/xmc/workflows/4-implementation/create-story/template.md +51 -0
  455. package/src/modules/xmc/workflows/4-implementation/create-story/workflow.yaml +60 -0
  456. package/src/modules/xmc/workflows/4-implementation/dev-story/checklist.md +80 -0
  457. package/src/modules/xmc/workflows/4-implementation/dev-story/instructions.xml +406 -0
  458. package/src/modules/xmc/workflows/4-implementation/dev-story/workflow.yaml +27 -0
  459. package/src/modules/xmc/workflows/4-implementation/retrospective/instructions.md +1443 -0
  460. package/src/modules/xmc/workflows/4-implementation/retrospective/workflow.yaml +57 -0
  461. package/src/modules/xmc/workflows/4-implementation/sprint-planning/checklist.md +33 -0
  462. package/src/modules/xmc/workflows/4-implementation/sprint-planning/instructions.md +232 -0
  463. package/src/modules/xmc/workflows/4-implementation/sprint-planning/sprint-status-template.yaml +56 -0
  464. package/src/modules/xmc/workflows/4-implementation/sprint-planning/workflow.yaml +53 -0
  465. package/src/modules/xmc/workflows/auto-iteration/full-auto-workflow.md +692 -0
  466. package/src/modules/xmc/workflows/auto-iteration/knowledge-base/kb-call-points.md +595 -0
  467. package/src/modules/xmc/workflows/auto-iteration/knowledge-base/kb-interface.md +347 -0
  468. package/src/modules/xmc/workflows/auto-iteration/knowledge-base/kb-query.md +368 -0
  469. package/src/modules/xmc/workflows/auto-iteration/knowledge-base/kb-setup.md +343 -0
  470. package/src/modules/xmc/workflows/auto-iteration/phases/phase-1-analyze.md +406 -0
  471. package/src/modules/xmc/workflows/auto-iteration/phases/phase-2-plan.md +574 -0
  472. package/src/modules/xmc/workflows/auto-iteration/phases/phase-3-design.md +628 -0
  473. package/src/modules/xmc/workflows/auto-iteration/phases/phase-4-develop.md +622 -0
  474. package/src/modules/xmc/workflows/auto-iteration/phases/phase-5-test.md +538 -0
  475. package/src/modules/xmc/workflows/auto-iteration/resume.md +254 -0
  476. package/src/modules/xmc/workflows/auto-iteration/status.md +194 -0
  477. package/src/modules/xmc/workflows/auto-iteration/templates/auto-iteration-status.template.yaml +142 -0
  478. package/src/modules/xmc/workflows/bmad-quick-flow/create-tech-spec/instructions.md +115 -0
  479. package/src/modules/xmc/workflows/bmad-quick-flow/create-tech-spec/workflow.yaml +26 -0
  480. package/src/modules/xmc/workflows/bmad-quick-flow/quick-dev/checklist.md +25 -0
  481. package/src/modules/xmc/workflows/bmad-quick-flow/quick-dev/instructions.md +105 -0
  482. package/src/modules/xmc/workflows/bmad-quick-flow/quick-dev/workflow.yaml +29 -0
  483. package/src/modules/xmc/workflows/diagrams/_shared/excalidraw-library.json +90 -0
  484. package/src/modules/xmc/workflows/diagrams/_shared/excalidraw-templates.yaml +127 -0
  485. package/src/modules/xmc/workflows/diagrams/create-dataflow/checklist.md +39 -0
  486. package/src/modules/xmc/workflows/diagrams/create-dataflow/instructions.md +130 -0
  487. package/src/modules/xmc/workflows/diagrams/create-dataflow/workflow.yaml +27 -0
  488. package/src/modules/xmc/workflows/diagrams/create-diagram/checklist.md +43 -0
  489. package/src/modules/xmc/workflows/diagrams/create-diagram/instructions.md +141 -0
  490. package/src/modules/xmc/workflows/diagrams/create-diagram/workflow.yaml +27 -0
  491. package/src/modules/xmc/workflows/diagrams/create-flowchart/checklist.md +49 -0
  492. package/src/modules/xmc/workflows/diagrams/create-flowchart/instructions.md +241 -0
  493. package/src/modules/xmc/workflows/diagrams/create-flowchart/workflow.yaml +27 -0
  494. package/src/modules/xmc/workflows/diagrams/create-wireframe/checklist.md +38 -0
  495. package/src/modules/xmc/workflows/diagrams/create-wireframe/instructions.md +133 -0
  496. package/src/modules/xmc/workflows/diagrams/create-wireframe/workflow.yaml +27 -0
  497. package/src/modules/xmc/workflows/document-project/checklist.md +245 -0
  498. package/src/modules/xmc/workflows/document-project/documentation-requirements.csv +12 -0
  499. package/src/modules/xmc/workflows/document-project/instructions.md +222 -0
  500. package/src/modules/xmc/workflows/document-project/templates/deep-dive-template.md +345 -0
  501. package/src/modules/xmc/workflows/document-project/templates/index-template.md +169 -0
  502. package/src/modules/xmc/workflows/document-project/templates/project-overview-template.md +103 -0
  503. package/src/modules/xmc/workflows/document-project/templates/project-scan-report-schema.json +160 -0
  504. package/src/modules/xmc/workflows/document-project/templates/source-tree-template.md +135 -0
  505. package/src/modules/xmc/workflows/document-project/workflow.yaml +31 -0
  506. package/src/modules/xmc/workflows/document-project/workflows/deep-dive-instructions.md +298 -0
  507. package/src/modules/xmc/workflows/document-project/workflows/deep-dive.yaml +31 -0
  508. package/src/modules/xmc/workflows/document-project/workflows/full-scan-instructions.md +1106 -0
  509. package/src/modules/xmc/workflows/document-project/workflows/full-scan.yaml +31 -0
  510. package/src/modules/xmc/workflows/generate-project-context/project-context-template.md +20 -0
  511. package/src/modules/xmc/workflows/generate-project-context/steps/step-01-discover.md +193 -0
  512. package/src/modules/xmc/workflows/generate-project-context/steps/step-02-generate.md +317 -0
  513. package/src/modules/xmc/workflows/generate-project-context/steps/step-03-complete.md +277 -0
  514. package/src/modules/xmc/workflows/generate-project-context/workflow.md +48 -0
  515. package/src/modules/xmc/workflows/testarch/atdd/atdd-checklist-template.md +363 -0
  516. package/src/modules/xmc/workflows/testarch/atdd/checklist.md +373 -0
  517. package/src/modules/xmc/workflows/testarch/atdd/instructions.md +805 -0
  518. package/src/modules/xmc/workflows/testarch/atdd/workflow.yaml +47 -0
  519. package/src/modules/xmc/workflows/testarch/automate/checklist.md +580 -0
  520. package/src/modules/xmc/workflows/testarch/automate/instructions.md +1324 -0
  521. package/src/modules/xmc/workflows/testarch/automate/workflow.yaml +54 -0
  522. package/src/modules/xmc/workflows/testarch/ci/checklist.md +246 -0
  523. package/src/modules/xmc/workflows/testarch/ci/github-actions-template.yaml +165 -0
  524. package/src/modules/xmc/workflows/testarch/ci/gitlab-ci-template.yaml +128 -0
  525. package/src/modules/xmc/workflows/testarch/ci/instructions.md +534 -0
  526. package/src/modules/xmc/workflows/testarch/ci/workflow.yaml +47 -0
  527. package/src/modules/xmc/workflows/testarch/framework/checklist.md +321 -0
  528. package/src/modules/xmc/workflows/testarch/framework/instructions.md +481 -0
  529. package/src/modules/xmc/workflows/testarch/framework/workflow.yaml +49 -0
  530. package/src/modules/xmc/workflows/testarch/nfr-assess/checklist.md +405 -0
  531. package/src/modules/xmc/workflows/testarch/nfr-assess/instructions.md +722 -0
  532. package/src/modules/xmc/workflows/testarch/nfr-assess/nfr-report-template.md +443 -0
  533. package/src/modules/xmc/workflows/testarch/nfr-assess/workflow.yaml +49 -0
  534. package/src/modules/xmc/workflows/testarch/test-design/checklist.md +234 -0
  535. package/src/modules/xmc/workflows/testarch/test-design/instructions.md +788 -0
  536. package/src/modules/xmc/workflows/testarch/test-design/test-design-template.md +285 -0
  537. package/src/modules/xmc/workflows/testarch/test-design/workflow.yaml +50 -0
  538. package/src/modules/xmc/workflows/testarch/test-review/checklist.md +470 -0
  539. package/src/modules/xmc/workflows/testarch/test-review/instructions.md +628 -0
  540. package/src/modules/xmc/workflows/testarch/test-review/test-review-template.md +388 -0
  541. package/src/modules/xmc/workflows/testarch/test-review/workflow.yaml +48 -0
  542. package/src/modules/xmc/workflows/testarch/trace/checklist.md +654 -0
  543. package/src/modules/xmc/workflows/testarch/trace/instructions.md +1045 -0
  544. package/src/modules/xmc/workflows/testarch/trace/trace-template.md +673 -0
  545. package/src/modules/xmc/workflows/testarch/trace/workflow.yaml +57 -0
  546. package/src/modules/xmc/workflows/workflow-status/init/instructions.md +331 -0
  547. package/src/modules/xmc/workflows/workflow-status/init/workflow.yaml +29 -0
  548. package/src/modules/xmc/workflows/workflow-status/instructions.md +395 -0
  549. package/src/modules/xmc/workflows/workflow-status/paths/enterprise-brownfield.yaml +127 -0
  550. package/src/modules/xmc/workflows/workflow-status/paths/enterprise-greenfield.yaml +115 -0
  551. package/src/modules/xmc/workflows/workflow-status/paths/method-brownfield.yaml +111 -0
  552. package/src/modules/xmc/workflows/workflow-status/paths/method-greenfield.yaml +102 -0
  553. package/src/modules/xmc/workflows/workflow-status/project-levels.yaml +59 -0
  554. package/src/modules/xmc/workflows/workflow-status/workflow-status-template.yaml +24 -0
  555. package/src/modules/xmc/workflows/workflow-status/workflow.yaml +30 -0
  556. package/src/utility/models/action-command-header.md +0 -0
  557. package/src/utility/models/agent-activation-ide.xml +51 -0
  558. package/src/utility/models/agent-activation-web.xml +50 -0
  559. package/src/utility/models/agent-command-header.md +1 -0
  560. package/src/utility/models/agent-config-template.md +23 -0
  561. package/src/utility/models/agent-in-team-activation.xml +3 -0
  562. package/src/utility/models/fragments/activation-rules.xml +7 -0
  563. package/src/utility/models/fragments/activation-steps.xml +16 -0
  564. package/src/utility/models/fragments/handler-action.xml +4 -0
  565. package/src/utility/models/fragments/handler-data.xml +5 -0
  566. package/src/utility/models/fragments/handler-exec.xml +6 -0
  567. package/src/utility/models/fragments/handler-multi.xml +14 -0
  568. package/src/utility/models/fragments/handler-tmpl.xml +5 -0
  569. package/src/utility/models/fragments/handler-validate-workflow.xml +7 -0
  570. package/src/utility/models/fragments/handler-workflow.xml +9 -0
  571. package/src/utility/models/fragments/menu-handlers.xml +6 -0
  572. package/src/utility/models/fragments/web-bundle-activation-steps.xml +32 -0
  573. package/src/utility/templates/agent.customize.template.yaml +42 -0
  574. package/test/README.md +295 -0
  575. package/test/fixtures/agent-schema/invalid/critical-actions/actions-as-string.agent.yaml +26 -0
  576. package/test/fixtures/agent-schema/invalid/critical-actions/empty-string-in-actions.agent.yaml +29 -0
  577. package/test/fixtures/agent-schema/invalid/menu/empty-menu.agent.yaml +21 -0
  578. package/test/fixtures/agent-schema/invalid/menu/missing-menu.agent.yaml +19 -0
  579. package/test/fixtures/agent-schema/invalid/menu-commands/empty-command-target.agent.yaml +24 -0
  580. package/test/fixtures/agent-schema/invalid/menu-commands/no-command-target.agent.yaml +23 -0
  581. package/test/fixtures/agent-schema/invalid/menu-triggers/camel-case.agent.yaml +24 -0
  582. package/test/fixtures/agent-schema/invalid/menu-triggers/duplicate-triggers.agent.yaml +30 -0
  583. package/test/fixtures/agent-schema/invalid/menu-triggers/empty-trigger.agent.yaml +24 -0
  584. package/test/fixtures/agent-schema/invalid/menu-triggers/leading-asterisk.agent.yaml +24 -0
  585. package/test/fixtures/agent-schema/invalid/menu-triggers/snake-case.agent.yaml +24 -0
  586. package/test/fixtures/agent-schema/invalid/menu-triggers/trigger-with-spaces.agent.yaml +24 -0
  587. package/test/fixtures/agent-schema/invalid/metadata/core-agent-with-module.agent.yaml +26 -0
  588. package/test/fixtures/agent-schema/invalid/metadata/empty-module-string.agent.yaml +26 -0
  589. package/test/fixtures/agent-schema/invalid/metadata/empty-name.agent.yaml +24 -0
  590. package/test/fixtures/agent-schema/invalid/metadata/extra-metadata-fields.agent.yaml +26 -0
  591. package/test/fixtures/agent-schema/invalid/metadata/missing-id.agent.yaml +23 -0
  592. package/test/fixtures/agent-schema/invalid/metadata/module-agent-missing-module.agent.yaml +25 -0
  593. package/test/fixtures/agent-schema/invalid/metadata/wrong-module-value.agent.yaml +26 -0
  594. package/test/fixtures/agent-schema/invalid/persona/empty-principles-array.agent.yaml +23 -0
  595. package/test/fixtures/agent-schema/invalid/persona/empty-string-in-principles.agent.yaml +26 -0
  596. package/test/fixtures/agent-schema/invalid/persona/extra-persona-fields.agent.yaml +26 -0
  597. package/test/fixtures/agent-schema/invalid/persona/missing-role.agent.yaml +23 -0
  598. package/test/fixtures/agent-schema/invalid/prompts/empty-content.agent.yaml +28 -0
  599. package/test/fixtures/agent-schema/invalid/prompts/extra-prompt-fields.agent.yaml +30 -0
  600. package/test/fixtures/agent-schema/invalid/prompts/missing-content.agent.yaml +27 -0
  601. package/test/fixtures/agent-schema/invalid/prompts/missing-id.agent.yaml +27 -0
  602. package/test/fixtures/agent-schema/invalid/top-level/empty-file.agent.yaml +5 -0
  603. package/test/fixtures/agent-schema/invalid/top-level/extra-top-level-keys.agent.yaml +27 -0
  604. package/test/fixtures/agent-schema/invalid/top-level/missing-agent-key.agent.yaml +11 -0
  605. package/test/fixtures/agent-schema/invalid/yaml-errors/invalid-indentation.agent.yaml +19 -0
  606. package/test/fixtures/agent-schema/invalid/yaml-errors/malformed-yaml.agent.yaml +18 -0
  607. package/test/fixtures/agent-schema/valid/critical-actions/empty-critical-actions.agent.yaml +23 -0
  608. package/test/fixtures/agent-schema/valid/critical-actions/no-critical-actions.agent.yaml +21 -0
  609. package/test/fixtures/agent-schema/valid/critical-actions/valid-critical-actions.agent.yaml +26 -0
  610. package/test/fixtures/agent-schema/valid/menu/multiple-menu-items.agent.yaml +30 -0
  611. package/test/fixtures/agent-schema/valid/menu/single-menu-item.agent.yaml +21 -0
  612. package/test/fixtures/agent-schema/valid/menu-commands/all-command-types.agent.yaml +37 -0
  613. package/test/fixtures/agent-schema/valid/menu-commands/multiple-commands.agent.yaml +23 -0
  614. package/test/fixtures/agent-schema/valid/menu-triggers/kebab-case-triggers.agent.yaml +33 -0
  615. package/test/fixtures/agent-schema/valid/metadata/empty-module-name-in-path.agent.yaml +23 -0
  616. package/test/fixtures/agent-schema/valid/metadata/malformed-path-treated-as-core.agent.yaml +23 -0
  617. package/test/fixtures/agent-schema/valid/metadata/module-agent-correct.agent.yaml +23 -0
  618. package/test/fixtures/agent-schema/valid/persona/complete-persona.agent.yaml +23 -0
  619. package/test/fixtures/agent-schema/valid/prompts/empty-prompts.agent.yaml +23 -0
  620. package/test/fixtures/agent-schema/valid/prompts/no-prompts.agent.yaml +21 -0
  621. package/test/fixtures/agent-schema/valid/prompts/valid-prompts-minimal.agent.yaml +27 -0
  622. package/test/fixtures/agent-schema/valid/prompts/valid-prompts-with-description.agent.yaml +29 -0
  623. package/test/fixtures/agent-schema/valid/top-level/minimal-core-agent.agent.yaml +23 -0
  624. package/test/test-agent-schema.js +387 -0
  625. package/test/test-cli-integration.sh +159 -0
  626. package/test/test-installation-components.js +214 -0
  627. package/test/unit-test-schema.js +133 -0
  628. package/tools/cli/README.md +609 -0
  629. package/tools/cli/bundlers/bundle-web.js +179 -0
  630. package/tools/cli/bundlers/test-analyst.js +28 -0
  631. package/tools/cli/bundlers/test-bundler.js +119 -0
  632. package/tools/cli/bundlers/web-bundler.js +1764 -0
  633. package/tools/cli/commands/agent-install.js +409 -0
  634. package/tools/cli/commands/build.js +458 -0
  635. package/tools/cli/commands/cleanup.js +141 -0
  636. package/tools/cli/commands/install.js +124 -0
  637. package/tools/cli/commands/list.js +28 -0
  638. package/tools/cli/commands/status.js +47 -0
  639. package/tools/cli/commands/uninstall.js +44 -0
  640. package/tools/cli/commands/update.js +28 -0
  641. package/tools/cli/installers/lib/core/config-collector.js +876 -0
  642. package/tools/cli/installers/lib/core/dependency-resolver.js +725 -0
  643. package/tools/cli/installers/lib/core/detector.js +329 -0
  644. package/tools/cli/installers/lib/core/ide-config-manager.js +154 -0
  645. package/tools/cli/installers/lib/core/installer.js +2956 -0
  646. package/tools/cli/installers/lib/core/manifest-generator.js +692 -0
  647. package/tools/cli/installers/lib/core/manifest.js +540 -0
  648. package/tools/cli/installers/lib/ide/_base-ide.js +651 -0
  649. package/tools/cli/installers/lib/ide/antigravity.js +510 -0
  650. package/tools/cli/installers/lib/ide/auggie.js +232 -0
  651. package/tools/cli/installers/lib/ide/claude-code.js +512 -0
  652. package/tools/cli/installers/lib/ide/cline.js +269 -0
  653. package/tools/cli/installers/lib/ide/codex.js +388 -0
  654. package/tools/cli/installers/lib/ide/crush.js +287 -0
  655. package/tools/cli/installers/lib/ide/cursor.js +400 -0
  656. package/tools/cli/installers/lib/ide/gemini.js +253 -0
  657. package/tools/cli/installers/lib/ide/github-copilot.js +387 -0
  658. package/tools/cli/installers/lib/ide/iflow.js +172 -0
  659. package/tools/cli/installers/lib/ide/kilo.js +249 -0
  660. package/tools/cli/installers/lib/ide/manager.js +245 -0
  661. package/tools/cli/installers/lib/ide/opencode.js +257 -0
  662. package/tools/cli/installers/lib/ide/qwen.js +372 -0
  663. package/tools/cli/installers/lib/ide/roo.js +324 -0
  664. package/tools/cli/installers/lib/ide/rovo-dev.js +290 -0
  665. package/tools/cli/installers/lib/ide/shared/agent-command-generator.js +90 -0
  666. package/tools/cli/installers/lib/ide/shared/module-injections.js +133 -0
  667. package/tools/cli/installers/lib/ide/shared/task-tool-command-generator.js +119 -0
  668. package/tools/cli/installers/lib/ide/shared/workflow-command-generator.js +237 -0
  669. package/tools/cli/installers/lib/ide/shared/xiaoma-artifacts.js +143 -0
  670. package/tools/cli/installers/lib/ide/templates/agent-command-template.md +14 -0
  671. package/tools/cli/installers/lib/ide/templates/gemini-agent-command.toml +14 -0
  672. package/tools/cli/installers/lib/ide/templates/gemini-task-command.toml +12 -0
  673. package/tools/cli/installers/lib/ide/templates/workflow-command-template.md +13 -0
  674. package/tools/cli/installers/lib/ide/trae.js +313 -0
  675. package/tools/cli/installers/lib/ide/windsurf.js +258 -0
  676. package/tools/cli/installers/lib/modules/manager.js +751 -0
  677. package/tools/cli/lib/activation-builder.js +168 -0
  678. package/tools/cli/lib/agent/compiler.js +524 -0
  679. package/tools/cli/lib/agent/installer.js +735 -0
  680. package/tools/cli/lib/agent/template-engine.js +152 -0
  681. package/tools/cli/lib/agent-analyzer.js +109 -0
  682. package/tools/cli/lib/agent-party-generator.js +206 -0
  683. package/tools/cli/lib/cli-utils.js +210 -0
  684. package/tools/cli/lib/config.js +212 -0
  685. package/tools/cli/lib/file-ops.js +204 -0
  686. package/tools/cli/lib/platform-codes.js +116 -0
  687. package/tools/cli/lib/project-root.js +71 -0
  688. package/tools/cli/lib/replace-project-root.js +239 -0
  689. package/tools/cli/lib/ui.js +769 -0
  690. package/tools/cli/lib/xml-handler.js +229 -0
  691. package/tools/cli/lib/xml-to-markdown.js +82 -0
  692. package/tools/{yaml-format.js → cli/lib/yaml-format.js} +36 -66
  693. package/tools/cli/lib/yaml-xml-builder.js +606 -0
  694. package/tools/cli/regenerate-manifests.js +28 -0
  695. package/tools/cli/test-yaml-builder.js +43 -0
  696. package/tools/cli/xiaoma-cli.js +40 -0
  697. package/tools/flattener/aggregate.js +12 -30
  698. package/tools/flattener/binary.js +43 -46
  699. package/tools/flattener/discovery.js +15 -23
  700. package/tools/flattener/files.js +6 -6
  701. package/tools/flattener/ignoreRules.js +122 -127
  702. package/tools/flattener/main.js +140 -330
  703. package/tools/flattener/projectRoot.js +71 -81
  704. package/tools/flattener/prompts.js +10 -12
  705. package/tools/flattener/stats.helpers.js +63 -119
  706. package/tools/flattener/stats.js +2 -7
  707. package/tools/flattener/test-matrix.js +169 -228
  708. package/tools/flattener/xml.js +23 -31
  709. package/tools/format-workflow-md.js +263 -0
  710. package/tools/platform-codes.yaml +145 -0
  711. package/tools/schema/agent.js +389 -0
  712. package/tools/validate-agent-schema.js +110 -0
  713. package/tools/validate-bundles.js +87 -0
  714. package/tools/xiaoma-npx-wrapper.js +18 -24
  715. package/.claude/agents/tech-translator.md +0 -124
  716. package/.claude/settings.local.json +0 -37
  717. package/.idea/XiaoMa-Cli.iml +0 -9
  718. package/.idea/inspectionProfiles/Project_Default.xml +0 -6
  719. package/.idea/misc.xml +0 -6
  720. package/.idea/modules.xml +0 -8
  721. package/.idea/prettier.xml +0 -6
  722. package/.idea/vcs.xml +0 -7
  723. package/.idea/workspace.xml +0 -114
  724. package/.xiaoma-core/.coordinator-state.json +0 -19
  725. package/CLAUDE.md +0 -283
  726. package/JAVA-BACKEND-COMMANDS-REFERENCE.md +0 -300
  727. package/JAVA-BACKEND-ITERATION-GUIDE.md +0 -2116
  728. package/common/tasks/create-doc.md +0 -103
  729. package/common/tasks/execute-checklist.md +0 -88
  730. package/common/utils/bmad-doc-template.md +0 -327
  731. package/common/utils/workflow-management.md +0 -71
  732. package/dist/agents/analyst.txt +0 -6308
  733. package/dist/agents/architect.txt +0 -3911
  734. package/dist/agents/automation-orchestrator.txt +0 -396
  735. package/dist/agents/dev.txt +0 -576
  736. package/dist/agents/full-requirement-orchestrator.txt +0 -505
  737. package/dist/agents/pm.txt +0 -2224
  738. package/dist/agents/po.txt +0 -1358
  739. package/dist/agents/qa.txt +0 -2002
  740. package/dist/agents/sm.txt +0 -2061
  741. package/dist/agents/ux-expert.txt +0 -707
  742. package/dist/agents/workflow-executor.txt +0 -1029
  743. package/dist/agents/workflow-helper.txt +0 -93
  744. package/dist/agents/xiaoma-master.txt +0 -9008
  745. package/dist/agents/xiaoma-orchestrator.txt +0 -1523
  746. package/dist/teams/team-all.txt +0 -19525
  747. package/dist/teams/team-fullstack-with-database.txt +0 -21500
  748. package/dist/teams/team-fullstack.txt +0 -13831
  749. package/dist/teams/team-ide-minimal.txt +0 -6698
  750. package/dist/teams/team-no-ui.txt +0 -12379
  751. package/docs/GUIDING-PRINCIPLES.md +0 -91
  752. package/docs/architecture/workflow-coordinator-implementation.md +0 -1188
  753. package/docs/architecture-sharding-modification.md +0 -623
  754. package/docs/automated-requirements-analysis-outputs.md +0 -896
  755. package/docs/core-architecture.md +0 -219
  756. package/docs/enhanced-ide-development-workflow.md +0 -248
  757. package/docs/prd/workflow-coordinator-prd.md +0 -1214
  758. package/docs/user-guide.md +0 -530
  759. package/docs/versioning-and-releases.md +0 -155
  760. package/docs/versions.md +0 -48
  761. package/docs/working-in-the-brownfield.md +0 -597
  762. package/tools/api-server.js +0 -367
  763. package/tools/builders/web-builder.js +0 -830
  764. package/tools/bump-all-versions.js +0 -133
  765. package/tools/cli.js +0 -157
  766. package/tools/installer/README.md +0 -8
  767. package/tools/installer/bin/xiaoma.js +0 -477
  768. package/tools/installer/config/ide-agent-config.yaml +0 -58
  769. package/tools/installer/config/install.config.yaml +0 -164
  770. package/tools/installer/lib/config-loader.js +0 -286
  771. package/tools/installer/lib/file-manager.js +0 -446
  772. package/tools/installer/lib/ide-base-setup.js +0 -238
  773. package/tools/installer/lib/ide-setup.js +0 -2027
  774. package/tools/installer/lib/installer.js +0 -2333
  775. package/tools/installer/lib/memory-profiler.js +0 -235
  776. package/tools/installer/lib/module-manager.js +0 -116
  777. package/tools/installer/lib/resource-locator.js +0 -334
  778. package/tools/installer/package-lock.json +0 -715
  779. package/tools/installer/package.json +0 -44
  780. package/tools/lib/dependency-resolver.js +0 -186
  781. package/tools/lib/yaml-utils.js +0 -34
  782. package/tools/md-assets/web-agent-startup-instructions.md +0 -39
  783. package/tools/preview-release-notes.js +0 -74
  784. package/tools/setup-hooks.sh +0 -37
  785. package/tools/shared/bannerArt.js +0 -105
  786. package/tools/sync-installer-version.js +0 -41
  787. package/tools/sync-version.sh +0 -23
  788. package/tools/upgraders/v3-to-v4-upgrader.js +0 -753
  789. package/tools/version-bump.js +0 -100
  790. package/tools/workflow-coordinator/README.md +0 -38
  791. package/tools/workflow-coordinator/USAGE.md +0 -548
  792. package/tools/workflow-coordinator/package-lock.json +0 -4868
  793. package/tools/workflow-coordinator/package.json +0 -35
  794. package/tools/workflow-coordinator/src/api/server.js +0 -207
  795. package/tools/workflow-coordinator/src/controller/workflow-controller.js +0 -263
  796. package/tools/workflow-coordinator/src/index.js +0 -113
  797. package/tools/workflow-coordinator/src/parser/workflow-parser.js +0 -144
  798. package/tools/workflow-coordinator/src/utils/state-manager.js +0 -59
  799. package/tools/workflow-coordinator/src/utils/validator.js +0 -86
  800. package/tools/workflow-coordinator/test/integration-test.js +0 -266
  801. package/tools/workflow-coordinator/test/quick-test.js +0 -127
  802. package/xiaoma-core/agent-teams/team-all.yaml +0 -15
  803. package/xiaoma-core/agent-teams/team-fullstack-with-database.yaml +0 -27
  804. package/xiaoma-core/agent-teams/team-fullstack.yaml +0 -19
  805. package/xiaoma-core/agent-teams/team-ide-minimal.yaml +0 -11
  806. package/xiaoma-core/agent-teams/team-no-ui.yaml +0 -14
  807. package/xiaoma-core/agents/analyst.md +0 -91
  808. package/xiaoma-core/agents/architect.md +0 -85
  809. package/xiaoma-core/agents/automated-fix-validator.yaml +0 -579
  810. package/xiaoma-core/agents/automated-quality-validator.yaml +0 -549
  811. package/xiaoma-core/agents/automation-orchestrator.md +0 -353
  812. package/xiaoma-core/agents/dev.md +0 -79
  813. package/xiaoma-core/agents/enhanced-workflow-orchestrator.yaml +0 -304
  814. package/xiaoma-core/agents/full-requirement-orchestrator.md +0 -462
  815. package/xiaoma-core/agents/global-requirements-auditor.yaml +0 -520
  816. package/xiaoma-core/agents/intelligent-template-adapter.yaml +0 -389
  817. package/xiaoma-core/agents/issue-dispatcher.yaml +0 -627
  818. package/xiaoma-core/agents/master-execution-engine.yaml +0 -543
  819. package/xiaoma-core/agents/pm.md +0 -82
  820. package/xiaoma-core/agents/po.md +0 -77
  821. package/xiaoma-core/agents/qa.md +0 -88
  822. package/xiaoma-core/agents/requirements-coverage-auditor.yaml +0 -373
  823. package/xiaoma-core/agents/sm.md +0 -67
  824. package/xiaoma-core/agents/ux-expert.md +0 -67
  825. package/xiaoma-core/agents/workflow-executor.md +0 -1031
  826. package/xiaoma-core/agents/workflow-helper.md +0 -481
  827. package/xiaoma-core/agents/xiaoma-master.md +0 -108
  828. package/xiaoma-core/agents/xiaoma-orchestrator.md +0 -145
  829. package/xiaoma-core/checklists/architect-checklist.md +0 -440
  830. package/xiaoma-core/checklists/change-checklist.md +0 -184
  831. package/xiaoma-core/checklists/dev-completion-checklist.md +0 -324
  832. package/xiaoma-core/checklists/pm-checklist.md +0 -372
  833. package/xiaoma-core/checklists/po-master-checklist.md +0 -434
  834. package/xiaoma-core/checklists/po-story-validation-checklist.md +0 -219
  835. package/xiaoma-core/checklists/qa-approval-checklist.md +0 -393
  836. package/xiaoma-core/checklists/story-dod-checklist.md +0 -96
  837. package/xiaoma-core/checklists/story-draft-checklist.md +0 -155
  838. package/xiaoma-core/core-config.yaml +0 -23
  839. package/xiaoma-core/data/bmad-kb.md +0 -809
  840. package/xiaoma-core/data/brainstorming-techniques.md +0 -38
  841. package/xiaoma-core/data/elicitation-methods.md +0 -156
  842. package/xiaoma-core/data/technical-preferences.md +0 -5
  843. package/xiaoma-core/data/test-levels-framework.md +0 -148
  844. package/xiaoma-core/data/test-priorities-matrix.md +0 -174
  845. package/xiaoma-core/scripts/build-validation/pre-dev-validation.sh +0 -71
  846. package/xiaoma-core/scripts/build-validation/progressive-validation.sh +0 -88
  847. package/xiaoma-core/scripts/build-validation/quick-check.sh +0 -69
  848. package/xiaoma-core/tasks/advanced-elicitation.md +0 -119
  849. package/xiaoma-core/tasks/analyze-existing-database.md +0 -155
  850. package/xiaoma-core/tasks/apply-qa-fixes.md +0 -150
  851. package/xiaoma-core/tasks/automated-story-cycle.md +0 -370
  852. package/xiaoma-core/tasks/batch-story-generation.md +0 -354
  853. package/xiaoma-core/tasks/brownfield-create-epic.md +0 -162
  854. package/xiaoma-core/tasks/brownfield-create-story.md +0 -149
  855. package/xiaoma-core/tasks/correct-course.md +0 -72
  856. package/xiaoma-core/tasks/create-brownfield-story.md +0 -314
  857. package/xiaoma-core/tasks/create-database-design.md +0 -161
  858. package/xiaoma-core/tasks/create-deep-research-prompt.md +0 -280
  859. package/xiaoma-core/tasks/create-enhanced-story-with-database.md +0 -250
  860. package/xiaoma-core/tasks/create-next-story.md +0 -114
  861. package/xiaoma-core/tasks/document-project.md +0 -345
  862. package/xiaoma-core/tasks/facilitate-brainstorming-session.md +0 -138
  863. package/xiaoma-core/tasks/generate-ai-frontend-prompt.md +0 -53
  864. package/xiaoma-core/tasks/generate-database-ddl.md +0 -240
  865. package/xiaoma-core/tasks/generate-database-entities.md +0 -501
  866. package/xiaoma-core/tasks/generate-rag-questions.md +0 -312
  867. package/xiaoma-core/tasks/index-docs.md +0 -175
  868. package/xiaoma-core/tasks/kb-mode-interaction.md +0 -77
  869. package/xiaoma-core/tasks/nfr-assess.md +0 -345
  870. package/xiaoma-core/tasks/project-integration-testing.md +0 -477
  871. package/xiaoma-core/tasks/qa-gate.md +0 -163
  872. package/xiaoma-core/tasks/requirement-analysis-with-rag.md +0 -1318
  873. package/xiaoma-core/tasks/requirements-coverage-audit.md +0 -198
  874. package/xiaoma-core/tasks/review-story.md +0 -316
  875. package/xiaoma-core/tasks/risk-profile.md +0 -355
  876. package/xiaoma-core/tasks/serial-development-orchestration.md +0 -426
  877. package/xiaoma-core/tasks/shard-doc.md +0 -187
  878. package/xiaoma-core/tasks/test-design.md +0 -176
  879. package/xiaoma-core/tasks/trace-requirements.md +0 -266
  880. package/xiaoma-core/tasks/validate-next-story.md +0 -136
  881. package/xiaoma-core/templates/api-design-tmpl.yaml +0 -704
  882. package/xiaoma-core/templates/architecture-tmpl.yaml +0 -650
  883. package/xiaoma-core/templates/brainstorming-output-tmpl.yaml +0 -156
  884. package/xiaoma-core/templates/brownfield-architecture-tmpl.yaml +0 -476
  885. package/xiaoma-core/templates/brownfield-prd-tmpl.yaml +0 -280
  886. package/xiaoma-core/templates/competitor-analysis-tmpl.yaml +0 -336
  887. package/xiaoma-core/templates/database-design-tmpl.yaml +0 -266
  888. package/xiaoma-core/templates/enhanced-story-with-database-tmpl.yaml +0 -428
  889. package/xiaoma-core/templates/front-end-architecture-tmpl.yaml +0 -272
  890. package/xiaoma-core/templates/front-end-spec-tmpl.yaml +0 -354
  891. package/xiaoma-core/templates/fullstack-architecture-tmpl.yaml +0 -925
  892. package/xiaoma-core/templates/global-qa-monitoring-tmpl.yaml +0 -443
  893. package/xiaoma-core/templates/market-research-tmpl.yaml +0 -252
  894. package/xiaoma-core/templates/maven-lombok-template.xml +0 -111
  895. package/xiaoma-core/templates/prd-tmpl.yaml +0 -202
  896. package/xiaoma-core/templates/project-brief-tmpl.yaml +0 -221
  897. package/xiaoma-core/templates/qa-gate-tmpl.yaml +0 -102
  898. package/xiaoma-core/templates/rag-knowledge-tmpl.yaml +0 -569
  899. package/xiaoma-core/templates/rag-questions-tmpl.yaml +0 -949
  900. package/xiaoma-core/templates/requirements-coverage-audit.yaml +0 -330
  901. package/xiaoma-core/templates/start-enhanced-workflow.yaml +0 -347
  902. package/xiaoma-core/templates/story-tmpl.yaml +0 -137
  903. package/xiaoma-core/workflows/automated-requirements-analysis.yaml +0 -2149
  904. package/xiaoma-core/workflows/automated-requirements-development.yaml +0 -739
  905. package/xiaoma-core/workflows/automated-story-development.yaml +0 -1264
  906. package/xiaoma-core/workflows/brownfield-fullstack.yaml +0 -298
  907. package/xiaoma-core/workflows/brownfield-service.yaml +0 -188
  908. package/xiaoma-core/workflows/brownfield-ui.yaml +0 -198
  909. package/xiaoma-core/workflows/enhanced-fullstack-with-database.yaml +0 -427
  910. package/xiaoma-core/workflows/enhanced-fullstack-with-qa-loop.yaml +0 -766
  911. package/xiaoma-core/workflows/full-requirement-automation.yaml +0 -1305
  912. package/xiaoma-core/workflows/greenfield-fullstack.yaml +0 -241
  913. package/xiaoma-core/workflows/greenfield-service.yaml +0 -207
  914. package/xiaoma-core/workflows/greenfield-ui.yaml +0 -236
@@ -1,2027 +0,0 @@
1
- const path = require("node:path");
2
- const fs = require("fs-extra");
3
- const yaml = require("js-yaml");
4
- const chalk = require("chalk");
5
- const inquirer = require("inquirer");
6
- const fileManager = require("./file-manager");
7
- const configLoader = require("./config-loader");
8
- const { extractYamlFromAgent } = require("../../lib/yaml-utils");
9
- const BaseIdeSetup = require("./ide-base-setup");
10
- const resourceLocator = require("./resource-locator");
11
-
12
- class IdeSetup extends BaseIdeSetup {
13
- constructor() {
14
- super();
15
- this.ideAgentConfig = null;
16
- }
17
-
18
- async loadIdeAgentConfig() {
19
- if (this.ideAgentConfig) return this.ideAgentConfig;
20
-
21
- try {
22
- const configPath = path.join(
23
- __dirname,
24
- "..",
25
- "config",
26
- "ide-agent-config.yaml",
27
- );
28
- const configContent = await fs.readFile(configPath, "utf8");
29
- this.ideAgentConfig = yaml.load(configContent);
30
- return this.ideAgentConfig;
31
- } catch {
32
- console.warn("Failed to load IDE agent configuration, using defaults");
33
- return {
34
- "roo-permissions": {},
35
- "cline-order": {},
36
- };
37
- }
38
- }
39
-
40
- async setup(
41
- ide,
42
- installDir,
43
- selectedAgent = null,
44
- spinner = null,
45
- preConfiguredSettings = null,
46
- ) {
47
- const ideConfig = await configLoader.getIdeConfiguration(ide);
48
-
49
- if (!ideConfig) {
50
- console.log(chalk.yellow(`\nNo configuration available for ${ide}`));
51
- return false;
52
- }
53
-
54
- switch (ide) {
55
- case "cursor": {
56
- return this.setupCursor(installDir, selectedAgent);
57
- }
58
- case "claude-code": {
59
- return this.setupClaudeCode(installDir, selectedAgent);
60
- }
61
- case "crush": {
62
- return this.setupCrush(installDir, selectedAgent);
63
- }
64
- case "windsurf": {
65
- return this.setupWindsurf(installDir, selectedAgent);
66
- }
67
- case "trae": {
68
- return this.setupTrae(installDir, selectedAgent);
69
- }
70
- case "roo": {
71
- return this.setupRoo(installDir, selectedAgent);
72
- }
73
- case "cline": {
74
- return this.setupCline(installDir, selectedAgent);
75
- }
76
- case "kilo": {
77
- return this.setupKilocode(installDir, selectedAgent);
78
- }
79
- case "gemini": {
80
- return this.setupGeminiCli(installDir, selectedAgent);
81
- }
82
- case "github-copilot": {
83
- return this.setupGitHubCopilot(
84
- installDir,
85
- selectedAgent,
86
- spinner,
87
- preConfiguredSettings,
88
- );
89
- }
90
- case "qwen-code": {
91
- return this.setupQwenCode(installDir, selectedAgent);
92
- }
93
- case "auggie-cli": {
94
- return this.setupAuggieCLI(
95
- installDir,
96
- selectedAgent,
97
- spinner,
98
- preConfiguredSettings,
99
- );
100
- }
101
- case "codex": {
102
- return this.setupCodex(installDir, selectedAgent, {
103
- webEnabled: false,
104
- });
105
- }
106
- case "codex-web": {
107
- return this.setupCodex(installDir, selectedAgent, { webEnabled: true });
108
- }
109
- default: {
110
- console.log(chalk.yellow(`\nIDE ${ide} not yet supported`));
111
- return false;
112
- }
113
- }
114
- }
115
-
116
- async setupCodex(installDir, selectedAgent, options) {
117
- options = options ?? { webEnabled: false };
118
- // Codex reads AGENTS.md at the project root as project memory (CLI & Web).
119
- // Inject/update a XIAOMAMA section with guidance, directory, and details.
120
- const filePath = path.join(installDir, "AGENTS.md");
121
- const startMarker = "<!-- BEGIN: XIAOMAMA-AGENTS -->";
122
- const endMarker = "<!-- END: XIAOMAMA-AGENTS -->";
123
-
124
- const agents = selectedAgent
125
- ? [selectedAgent]
126
- : await this.getAllAgentIds(installDir);
127
- const tasks = await this.getAllTaskIds(installDir);
128
-
129
- // Build XIAOMAMA section content
130
- let section = "";
131
- section += `${startMarker}\n`;
132
- section += `# XIAOMA-CLI Agents and Tasks\n\n`;
133
- section += `This section is auto-generated by XIAOMA-CLI for Codex. Codex merges this AGENTS.md into context.\n\n`;
134
- section += `## How To Use With Codex\n\n`;
135
- section += `- Codex CLI: run \`codex\` in this project. Reference an agent naturally, e.g., "As dev, implement ...".\n`;
136
- section += `- Codex Web: open this repo and reference roles the same way; Codex reads \`AGENTS.md\`.\n`;
137
- section += `- Commit \`.xiaoma-core\` and this \`AGENTS.md\` file to your repo so Codex (Web/CLI) can read full agent definitions.\n`;
138
- section += `- Refresh this section after agent updates: \`npx xiaoma-cli install -f -i codex\`.\n\n`;
139
-
140
- section += `### Helpful Commands\n\n`;
141
- section += `- List agents: \`npx xiaoma-cli list:agents\`\n`;
142
- section += `- Reinstall XIAOMAMA core and regenerate AGENTS.md: \`npx xiaoma-cli install -f -i codex\`\n`;
143
- section += `- Validate configuration: \`npx xiaoma-cli validate\`\n\n`;
144
-
145
- // Agents directory table
146
- section += `## Agents\n\n`;
147
- section += `### Directory\n\n`;
148
- section += `| Title | ID | When To Use |\n|---|---|---|\n`;
149
- const agentSummaries = [];
150
- for (const agentId of agents) {
151
- const agentPath = await this.findAgentPath(agentId, installDir);
152
- if (!agentPath) continue;
153
- const raw = await fileManager.readFile(agentPath);
154
- const yamlMatch = raw.match(/```ya?ml\r?\n([\s\S]*?)```/);
155
- const yamlBlock = yamlMatch ? yamlMatch[1].trim() : null;
156
- const title = await this.getAgentTitle(agentId, installDir);
157
- const whenToUse =
158
- yamlBlock?.match(/whenToUse:\s*"?([^\n"]+)"?/i)?.[1]?.trim() || "";
159
- agentSummaries.push({
160
- agentId,
161
- title,
162
- whenToUse,
163
- yamlBlock,
164
- raw,
165
- path: agentPath,
166
- });
167
- section += `| ${title} | ${agentId} | ${whenToUse || "—"} |\n`;
168
- }
169
- section += `\n`;
170
-
171
- // Detailed agent sections
172
- for (const {
173
- agentId,
174
- title,
175
- whenToUse,
176
- yamlBlock,
177
- raw,
178
- path: agentPath,
179
- } of agentSummaries) {
180
- const relativePath = path
181
- .relative(installDir, agentPath)
182
- .replaceAll("\\", "/");
183
- section += `### ${title} (id: ${agentId})\n`;
184
- section += `Source: ${relativePath}\n\n`;
185
- if (whenToUse) section += `- When to use: ${whenToUse}\n`;
186
- section += `- How to activate: Mention "As ${agentId}, ..." or "Use ${title} to ..."\n\n`;
187
- if (yamlBlock) {
188
- section += "```yaml\n" + yamlBlock + "\n```\n\n";
189
- } else {
190
- section += "```md\n" + raw.trim() + "\n```\n\n";
191
- }
192
- }
193
-
194
- // Tasks
195
- if (tasks && tasks.length > 0) {
196
- section += `## Tasks\n\n`;
197
- section += `These are reusable task briefs you can reference directly in Codex.\n\n`;
198
- for (const taskId of tasks) {
199
- const taskPath = await this.findTaskPath(taskId, installDir);
200
- if (!taskPath) continue;
201
- const raw = await fileManager.readFile(taskPath);
202
- const relativePath = path
203
- .relative(installDir, taskPath)
204
- .replaceAll("\\", "/");
205
- section += `### Task: ${taskId}\n`;
206
- section += `Source: ${relativePath}\n`;
207
- section += `- How to use: "Use task ${taskId} with the appropriate agent" and paste relevant parts as needed.\n\n`;
208
- section += "```md\n" + raw.trim() + "\n```\n\n";
209
- }
210
- }
211
-
212
- section += `${endMarker}\n`;
213
-
214
- // Write or update AGENTS.md
215
- let finalContent = "";
216
- if (await fileManager.pathExists(filePath)) {
217
- const existing = await fileManager.readFile(filePath);
218
- if (existing.includes(startMarker) && existing.includes(endMarker)) {
219
- // Replace existing XIAOMAMA block
220
- const pattern = String.raw`${startMarker}[\s\S]*?${endMarker}`;
221
- const replaced = existing.replace(new RegExp(pattern, "m"), section);
222
- finalContent = replaced;
223
- } else {
224
- // Append XIAOMAMA block to existing file
225
- finalContent = existing.trimEnd() + `\n\n` + section;
226
- }
227
- } else {
228
- // Create fresh AGENTS.md with a small header and XIAOMAMA block
229
- finalContent += "# Project Agents\n\n";
230
- finalContent +=
231
- "This file provides guidance and memory for Codex CLI.\n\n";
232
- finalContent += section;
233
- }
234
-
235
- await fileManager.writeFile(filePath, finalContent);
236
- console.log(
237
- chalk.green("✓ Created/updated AGENTS.md for Codex CLI integration"),
238
- );
239
- console.log(
240
- chalk.dim(
241
- "Codex reads AGENTS.md automatically. Run `codex` in this project to use XIAOMAMA agents.",
242
- ),
243
- );
244
-
245
- // Optionally add helpful npm scripts if a package.json exists
246
- try {
247
- const pkgPath = path.join(installDir, "package.json");
248
- if (await fileManager.pathExists(pkgPath)) {
249
- const pkgRaw = await fileManager.readFile(pkgPath);
250
- const pkg = JSON.parse(pkgRaw);
251
- pkg.scripts = pkg.scripts || {};
252
- const updated = { ...pkg.scripts };
253
- if (!updated["bmad:refresh"])
254
- updated["bmad:refresh"] = "xiaoma-cli install -f -i codex";
255
- if (!updated["bmad:list"])
256
- updated["bmad:list"] = "xiaoma-cli list:agents";
257
- if (!updated["bmad:validate"])
258
- updated["bmad:validate"] = "xiaoma-cli validate";
259
- const changed = JSON.stringify(updated) !== JSON.stringify(pkg.scripts);
260
- if (changed) {
261
- const newPkg = { ...pkg, scripts: updated };
262
- await fileManager.writeFile(
263
- pkgPath,
264
- JSON.stringify(newPkg, null, 2) + "\n",
265
- );
266
- console.log(
267
- chalk.green(
268
- "✓ Added npm scripts: bmad:refresh, bmad:list, bmad:validate",
269
- ),
270
- );
271
- }
272
- }
273
- } catch {
274
- console.log(
275
- chalk.yellow(
276
- "⚠︎ Skipped adding npm scripts (package.json not writable or invalid)",
277
- ),
278
- );
279
- }
280
-
281
- // Adjust .gitignore behavior depending on Codex mode
282
- try {
283
- const gitignorePath = path.join(installDir, ".gitignore");
284
- const ignoreLines = [
285
- "# XIAOMAMA (local only)",
286
- ".xiaoma-core/",
287
- ".bmad-*/",
288
- ];
289
- const exists = await fileManager.pathExists(gitignorePath);
290
- if (options.webEnabled) {
291
- if (exists) {
292
- let gi = await fileManager.readFile(gitignorePath);
293
- // Remove lines that ignore XIAOMAMA dot-folders
294
- const updated = gi
295
- .split(/\r?\n/)
296
- .filter(
297
- (l) =>
298
- !/^\s*\.xiaoma-core\/?\s*$/.test(l) &&
299
- !/^\s*\.bmad-\*\/?\s*$/.test(l),
300
- )
301
- .join("\n");
302
- if (updated !== gi) {
303
- await fileManager.writeFile(
304
- gitignorePath,
305
- updated.trimEnd() + "\n",
306
- );
307
- console.log(
308
- chalk.green(
309
- "✓ Updated .gitignore to include .xiaoma-core in commits",
310
- ),
311
- );
312
- }
313
- }
314
- } else {
315
- // Local-only: add ignores if missing
316
- let base = exists ? await fileManager.readFile(gitignorePath) : "";
317
- const haveCore = base.includes(".xiaoma-core/");
318
- const haveStar = base.includes(".bmad-*/");
319
- if (!haveCore || !haveStar) {
320
- const sep = base.endsWith("\n") || base.length === 0 ? "" : "\n";
321
- const add = [!haveCore || !haveStar ? ignoreLines.join("\n") : ""]
322
- .filter(Boolean)
323
- .join("\n");
324
- const out = base + sep + add + "\n";
325
- await fileManager.writeFile(gitignorePath, out);
326
- console.log(
327
- chalk.green(
328
- "✓ Added .xiaoma-core/* to .gitignore for local-only Codex setup",
329
- ),
330
- );
331
- }
332
- }
333
- } catch {
334
- console.log(chalk.yellow("⚠︎ Could not update .gitignore (skipping)"));
335
- }
336
-
337
- return true;
338
- }
339
-
340
- async setupCursor(installDir, selectedAgent) {
341
- const cursorRulesDir = path.join(installDir, ".cursor", "rules", "bmad");
342
- const agents = selectedAgent
343
- ? [selectedAgent]
344
- : await this.getAllAgentIds(installDir);
345
-
346
- await fileManager.ensureDirectory(cursorRulesDir);
347
-
348
- for (const agentId of agents) {
349
- const agentPath = await this.findAgentPath(agentId, installDir);
350
-
351
- if (agentPath) {
352
- const mdcContent = await this.createAgentRuleContent(
353
- agentId,
354
- agentPath,
355
- installDir,
356
- "mdc",
357
- );
358
- const mdcPath = path.join(cursorRulesDir, `${agentId}.mdc`);
359
- await fileManager.writeFile(mdcPath, mdcContent);
360
- console.log(chalk.green(`✓ Created rule: ${agentId}.mdc`));
361
- }
362
- }
363
-
364
- console.log(chalk.green(`\n✓ Created Cursor rules in ${cursorRulesDir}`));
365
- return true;
366
- }
367
-
368
- async setupCrush(installDir, selectedAgent) {
369
- // Setup xiaoma-core commands
370
- const coreSlashPrefix = await this.getCoreSlashPrefix(installDir);
371
- const coreAgents = selectedAgent
372
- ? [selectedAgent]
373
- : await this.getCoreAgentIds(installDir);
374
- const coreTasks = await this.getCoreTaskIds(installDir);
375
- await this.setupCrushForPackage(
376
- installDir,
377
- "core",
378
- coreSlashPrefix,
379
- coreAgents,
380
- coreTasks,
381
- ".xiaoma-core",
382
- );
383
-
384
- // Setup expansion pack commands
385
- const expansionPacks = await this.getInstalledExpansionPacks(installDir);
386
- for (const packInfo of expansionPacks) {
387
- const packSlashPrefix = await this.getExpansionPackSlashPrefix(
388
- packInfo.path,
389
- );
390
- const packAgents = await this.getExpansionPackAgents(packInfo.path);
391
- const packTasks = await this.getExpansionPackTasks(packInfo.path);
392
-
393
- if (packAgents.length > 0 || packTasks.length > 0) {
394
- // Use the actual directory name where the expansion pack is installed
395
- const rootPath = path.relative(installDir, packInfo.path);
396
- await this.setupCrushForPackage(
397
- installDir,
398
- packInfo.name,
399
- packSlashPrefix,
400
- packAgents,
401
- packTasks,
402
- rootPath,
403
- );
404
- }
405
- }
406
-
407
- return true;
408
- }
409
-
410
- async setupClaudeCode(installDir, selectedAgent) {
411
- // Setup xiaoma-core commands
412
- const coreSlashPrefix = await this.getCoreSlashPrefix(installDir);
413
- const coreAgents = selectedAgent
414
- ? [selectedAgent]
415
- : await this.getCoreAgentIds(installDir);
416
- const coreTasks = await this.getCoreTaskIds(installDir);
417
- await this.setupClaudeCodeForPackage(
418
- installDir,
419
- "core",
420
- coreSlashPrefix,
421
- coreAgents,
422
- coreTasks,
423
- ".xiaoma-core",
424
- );
425
-
426
- // Setup expansion pack commands
427
- const expansionPacks = await this.getInstalledExpansionPacks(installDir);
428
- for (const packInfo of expansionPacks) {
429
- const packSlashPrefix = await this.getExpansionPackSlashPrefix(
430
- packInfo.path,
431
- );
432
- const packAgents = await this.getExpansionPackAgents(packInfo.path);
433
- const packTasks = await this.getExpansionPackTasks(packInfo.path);
434
-
435
- if (packAgents.length > 0 || packTasks.length > 0) {
436
- // Use the actual directory name where the expansion pack is installed
437
- const rootPath = path.relative(installDir, packInfo.path);
438
- await this.setupClaudeCodeForPackage(
439
- installDir,
440
- packInfo.name,
441
- packSlashPrefix,
442
- packAgents,
443
- packTasks,
444
- rootPath,
445
- );
446
- }
447
- }
448
-
449
- return true;
450
- }
451
-
452
- async setupClaudeCodeForPackage(
453
- installDir,
454
- packageName,
455
- slashPrefix,
456
- agentIds,
457
- taskIds,
458
- rootPath,
459
- ) {
460
- const commandsBaseDir = path.join(
461
- installDir,
462
- ".claude",
463
- "commands",
464
- slashPrefix,
465
- );
466
- const agentsDir = path.join(commandsBaseDir, "agents");
467
- const tasksDir = path.join(commandsBaseDir, "tasks");
468
-
469
- // Ensure directories exist
470
- await fileManager.ensureDirectory(agentsDir);
471
- await fileManager.ensureDirectory(tasksDir);
472
-
473
- // Setup agents
474
- for (const agentId of agentIds) {
475
- // Find the agent file - for expansion packs, prefer the expansion pack version
476
- let agentPath;
477
- if (packageName === "core") {
478
- // For core, use the normal search
479
- agentPath = await this.findAgentPath(agentId, installDir);
480
- } else {
481
- // For expansion packs, first try to find the agent in the expansion pack directory
482
- const expansionPackPath = path.join(
483
- installDir,
484
- rootPath,
485
- "agents",
486
- `${agentId}.md`,
487
- );
488
- if (await fileManager.pathExists(expansionPackPath)) {
489
- agentPath = expansionPackPath;
490
- } else {
491
- // Fall back to core if not found in expansion pack
492
- agentPath = await this.findAgentPath(agentId, installDir);
493
- }
494
- }
495
-
496
- const commandPath = path.join(agentsDir, `${agentId}.md`);
497
-
498
- if (agentPath) {
499
- // Create command file with agent content
500
- let agentContent = await fileManager.readFile(agentPath);
501
-
502
- // Replace {root} placeholder with the appropriate root path for this context
503
- agentContent = agentContent.replaceAll("{root}", rootPath);
504
-
505
- // Add command header
506
- let commandContent = `# /${agentId} Command\n\n`;
507
- commandContent += `When this command is used, adopt the following agent persona:\n\n`;
508
- commandContent += agentContent;
509
-
510
- await fileManager.writeFile(commandPath, commandContent);
511
- console.log(chalk.green(`✓ Created agent command: /${agentId}`));
512
- }
513
- }
514
-
515
- // Setup tasks
516
- for (const taskId of taskIds) {
517
- // Find the task file - for expansion packs, prefer the expansion pack version
518
- let taskPath;
519
- if (packageName === "core") {
520
- // For core, use the normal search
521
- taskPath = await this.findTaskPath(taskId, installDir);
522
- } else {
523
- // For expansion packs, first try to find the task in the expansion pack directory
524
- const expansionPackPath = path.join(
525
- installDir,
526
- rootPath,
527
- "tasks",
528
- `${taskId}.md`,
529
- );
530
- if (await fileManager.pathExists(expansionPackPath)) {
531
- taskPath = expansionPackPath;
532
- } else {
533
- // Fall back to core if not found in expansion pack
534
- taskPath = await this.findTaskPath(taskId, installDir);
535
- }
536
- }
537
-
538
- const commandPath = path.join(tasksDir, `${taskId}.md`);
539
-
540
- if (taskPath) {
541
- // Create command file with task content
542
- let taskContent = await fileManager.readFile(taskPath);
543
-
544
- // Replace {root} placeholder with the appropriate root path for this context
545
- taskContent = taskContent.replaceAll("{root}", rootPath);
546
-
547
- // Add command header
548
- let commandContent = `# /${taskId} Task\n\n`;
549
- commandContent += `When this command is used, execute the following task:\n\n`;
550
- commandContent += taskContent;
551
-
552
- await fileManager.writeFile(commandPath, commandContent);
553
- console.log(chalk.green(`✓ Created task command: /${taskId}`));
554
- }
555
- }
556
-
557
- console.log(
558
- chalk.green(
559
- `\n✓ Created Claude Code commands for ${packageName} in ${commandsBaseDir}`,
560
- ),
561
- );
562
- console.log(chalk.dim(` - Agents in: ${agentsDir}`));
563
- console.log(chalk.dim(` - Tasks in: ${tasksDir}`));
564
- }
565
-
566
- async setupCrushForPackage(
567
- installDir,
568
- packageName,
569
- slashPrefix,
570
- agentIds,
571
- taskIds,
572
- rootPath,
573
- ) {
574
- const commandsBaseDir = path.join(
575
- installDir,
576
- ".crush",
577
- "commands",
578
- slashPrefix,
579
- );
580
- const agentsDir = path.join(commandsBaseDir, "agents");
581
- const tasksDir = path.join(commandsBaseDir, "tasks");
582
-
583
- // Ensure directories exist
584
- await fileManager.ensureDirectory(agentsDir);
585
- await fileManager.ensureDirectory(tasksDir);
586
-
587
- // Setup agents
588
- for (const agentId of agentIds) {
589
- // Find the agent file - for expansion packs, prefer the expansion pack version
590
- let agentPath;
591
- if (packageName === "core") {
592
- // For core, use the normal search
593
- agentPath = await this.findAgentPath(agentId, installDir);
594
- } else {
595
- // For expansion packs, first try to find the agent in the expansion pack directory
596
- const expansionPackPath = path.join(
597
- installDir,
598
- rootPath,
599
- "agents",
600
- `${agentId}.md`,
601
- );
602
- if (await fileManager.pathExists(expansionPackPath)) {
603
- agentPath = expansionPackPath;
604
- } else {
605
- // Fall back to core if not found in expansion pack
606
- agentPath = await this.findAgentPath(agentId, installDir);
607
- }
608
- }
609
-
610
- const commandPath = path.join(agentsDir, `${agentId}.md`);
611
-
612
- if (agentPath) {
613
- // Create command file with agent content
614
- let agentContent = await fileManager.readFile(agentPath);
615
-
616
- // Replace {root} placeholder with the appropriate root path for this context
617
- agentContent = agentContent.replaceAll("{root}", rootPath);
618
-
619
- // Add command header
620
- let commandContent = `# /${agentId} Command\n\n`;
621
- commandContent += `When this command is used, adopt the following agent persona:\n\n`;
622
- commandContent += agentContent;
623
-
624
- await fileManager.writeFile(commandPath, commandContent);
625
- console.log(chalk.green(`✓ Created agent command: /${agentId}`));
626
- }
627
- }
628
-
629
- // Setup tasks
630
- for (const taskId of taskIds) {
631
- // Find the task file - for expansion packs, prefer the expansion pack version
632
- let taskPath;
633
- if (packageName === "core") {
634
- // For core, use the normal search
635
- taskPath = await this.findTaskPath(taskId, installDir);
636
- } else {
637
- // For expansion packs, first try to find the task in the expansion pack directory
638
- const expansionPackPath = path.join(
639
- installDir,
640
- rootPath,
641
- "tasks",
642
- `${taskId}.md`,
643
- );
644
- if (await fileManager.pathExists(expansionPackPath)) {
645
- taskPath = expansionPackPath;
646
- } else {
647
- // Fall back to core if not found in expansion pack
648
- taskPath = await this.findTaskPath(taskId, installDir);
649
- }
650
- }
651
-
652
- const commandPath = path.join(tasksDir, `${taskId}.md`);
653
-
654
- if (taskPath) {
655
- // Create command file with task content
656
- let taskContent = await fileManager.readFile(taskPath);
657
-
658
- // Replace {root} placeholder with the appropriate root path for this context
659
- taskContent = taskContent.replaceAll("{root}", rootPath);
660
-
661
- // Add command header
662
- let commandContent = `# /${taskId} Task\n\n`;
663
- commandContent += `When this command is used, execute the following task:\n\n`;
664
- commandContent += taskContent;
665
-
666
- await fileManager.writeFile(commandPath, commandContent);
667
- console.log(chalk.green(`✓ Created task command: /${taskId}`));
668
- }
669
- }
670
-
671
- console.log(
672
- chalk.green(
673
- `\n✓ Created Crush commands for ${packageName} in ${commandsBaseDir}`,
674
- ),
675
- );
676
- console.log(chalk.dim(` - Agents in: ${agentsDir}`));
677
- console.log(chalk.dim(` - Tasks in: ${tasksDir}`));
678
- }
679
-
680
- async setupWindsurf(installDir, selectedAgent) {
681
- const windsurfWorkflowDir = path.join(installDir, ".windsurf", "workflows");
682
- const agents = selectedAgent
683
- ? [selectedAgent]
684
- : await this.getAllAgentIds(installDir);
685
-
686
- await fileManager.ensureDirectory(windsurfWorkflowDir);
687
-
688
- for (const agentId of agents) {
689
- // Find the agent file
690
- const agentPath = await this.findAgentPath(agentId, installDir);
691
-
692
- if (agentPath) {
693
- const agentContent = await fileManager.readFile(agentPath);
694
- const mdPath = path.join(windsurfWorkflowDir, `${agentId}.md`);
695
-
696
- // Write the agent file contents prefixed with Windsurf frontmatter
697
- let mdContent = `---\n`;
698
- mdContent += `description: ${agentId}\n`;
699
- mdContent += `auto_execution_mode: 3\n`;
700
- mdContent += `---\n\n`;
701
- mdContent += agentContent;
702
-
703
- await fileManager.writeFile(mdPath, mdContent);
704
- console.log(chalk.green(`✓ Created workflow: ${agentId}.md`));
705
- }
706
- }
707
-
708
- console.log(
709
- chalk.green(`\n✓ Created Windsurf workflows in ${windsurfWorkflowDir}`),
710
- );
711
-
712
- return true;
713
- }
714
-
715
- async setupTrae(installDir, selectedAgent) {
716
- const traeRulesDir = path.join(installDir, ".trae", "rules");
717
- const agents = selectedAgent
718
- ? [selectedAgent]
719
- : await this.getAllAgentIds(installDir);
720
-
721
- await fileManager.ensureDirectory(traeRulesDir);
722
-
723
- for (const agentId of agents) {
724
- // Find the agent file
725
- const agentPath = await this.findAgentPath(agentId, installDir);
726
-
727
- if (agentPath) {
728
- const agentContent = await fileManager.readFile(agentPath);
729
- const mdPath = path.join(traeRulesDir, `${agentId}.md`);
730
-
731
- // Create MD content (similar to Cursor but without frontmatter)
732
- let mdContent = `# ${agentId.toUpperCase()} Agent Rule\n\n`;
733
- mdContent += `This rule is triggered when the user types \`@${agentId}\` and activates the ${await this.getAgentTitle(
734
- agentId,
735
- installDir,
736
- )} agent persona.\n\n`;
737
- mdContent += "## Agent Activation\n\n";
738
- mdContent +=
739
- "CRITICAL: Read the full YAML, start activation to alter your state of being, follow startup section instructions, stay in this being until told to exit this mode:\n\n";
740
- mdContent += "```yaml\n";
741
- // Extract just the YAML content from the agent file
742
- const yamlContent = extractYamlFromAgent(agentContent);
743
- if (yamlContent) {
744
- mdContent += yamlContent;
745
- } else {
746
- // If no YAML found, include the whole content minus the header
747
- mdContent += agentContent.replace(/^#.*$/m, "").trim();
748
- }
749
- mdContent += "\n```\n\n";
750
- mdContent += "## File Reference\n\n";
751
- const relativePath = path
752
- .relative(installDir, agentPath)
753
- .replaceAll("\\", "/");
754
- mdContent += `The complete agent definition is available in [${relativePath}](${relativePath}).\n\n`;
755
- mdContent += "## Usage\n\n";
756
- mdContent += `When the user types \`@${agentId}\`, activate this ${await this.getAgentTitle(
757
- agentId,
758
- installDir,
759
- )} persona and follow all instructions defined in the YAML configuration above.\n`;
760
-
761
- await fileManager.writeFile(mdPath, mdContent);
762
- console.log(chalk.green(`✓ Created rule: ${agentId}.md`));
763
- }
764
- }
765
- }
766
-
767
- async findAgentPath(agentId, installDir) {
768
- // Try to find the agent file in various locations
769
- const possiblePaths = [
770
- path.join(installDir, ".xiaoma-core", "agents", `${agentId}.md`),
771
- path.join(installDir, "agents", `${agentId}.md`),
772
- ];
773
-
774
- // Also check expansion pack directories
775
- const glob = require("glob");
776
- const expansionDirectories = glob.sync(".*/agents", { cwd: installDir });
777
- for (const expDir of expansionDirectories) {
778
- possiblePaths.push(path.join(installDir, expDir, `${agentId}.md`));
779
- }
780
-
781
- for (const agentPath of possiblePaths) {
782
- if (await fileManager.pathExists(agentPath)) {
783
- return agentPath;
784
- }
785
- }
786
-
787
- return null;
788
- }
789
-
790
- async getAllAgentIds(installDir) {
791
- const glob = require("glob");
792
- const allAgentIds = [];
793
-
794
- // Check core agents in .xiaoma-core or root
795
- let agentsDir = path.join(installDir, ".xiaoma-core", "agents");
796
- if (!(await fileManager.pathExists(agentsDir))) {
797
- agentsDir = path.join(installDir, "agents");
798
- }
799
-
800
- if (await fileManager.pathExists(agentsDir)) {
801
- const agentFiles = glob.sync("*.md", { cwd: agentsDir });
802
- allAgentIds.push(...agentFiles.map((file) => path.basename(file, ".md")));
803
- }
804
-
805
- // Also check for expansion pack agents in dot folders
806
- const expansionDirectories = glob.sync(".*/agents", { cwd: installDir });
807
- for (const expDir of expansionDirectories) {
808
- const fullExpDir = path.join(installDir, expDir);
809
- const expAgentFiles = glob.sync("*.md", { cwd: fullExpDir });
810
- allAgentIds.push(
811
- ...expAgentFiles.map((file) => path.basename(file, ".md")),
812
- );
813
- }
814
-
815
- // Remove duplicates
816
- return [...new Set(allAgentIds)];
817
- }
818
-
819
- async getCoreAgentIds(installDir) {
820
- const allAgentIds = [];
821
-
822
- // Check core agents in .xiaoma-core or root only
823
- let agentsDir = path.join(installDir, ".xiaoma-core", "agents");
824
- if (!(await fileManager.pathExists(agentsDir))) {
825
- agentsDir = path.join(installDir, "xiaoma-core", "agents");
826
- }
827
-
828
- if (await fileManager.pathExists(agentsDir)) {
829
- const glob = require("glob");
830
- const agentFiles = glob.sync("*.md", { cwd: agentsDir });
831
- allAgentIds.push(...agentFiles.map((file) => path.basename(file, ".md")));
832
- }
833
-
834
- return [...new Set(allAgentIds)];
835
- }
836
-
837
- async getCoreTaskIds(installDir) {
838
- const allTaskIds = [];
839
-
840
- // Check core tasks in .xiaoma-core or root only
841
- let tasksDir = path.join(installDir, ".xiaoma-core", "tasks");
842
- if (!(await fileManager.pathExists(tasksDir))) {
843
- tasksDir = path.join(installDir, "xiaoma-core", "tasks");
844
- }
845
-
846
- if (await fileManager.pathExists(tasksDir)) {
847
- const glob = require("glob");
848
- const taskFiles = glob.sync("*.md", { cwd: tasksDir });
849
- allTaskIds.push(...taskFiles.map((file) => path.basename(file, ".md")));
850
- }
851
-
852
- // Check common tasks
853
- const commonTasksDir = path.join(installDir, "common", "tasks");
854
- if (await fileManager.pathExists(commonTasksDir)) {
855
- const commonTaskFiles = glob.sync("*.md", { cwd: commonTasksDir });
856
- allTaskIds.push(
857
- ...commonTaskFiles.map((file) => path.basename(file, ".md")),
858
- );
859
- }
860
-
861
- return [...new Set(allTaskIds)];
862
- }
863
-
864
- async getAgentTitle(agentId, installDir) {
865
- // Try to find the agent file in various locations
866
- const possiblePaths = [
867
- path.join(installDir, ".xiaoma-core", "agents", `${agentId}.md`),
868
- path.join(installDir, "agents", `${agentId}.md`),
869
- ];
870
-
871
- // Also check expansion pack directories
872
- const glob = require("glob");
873
- const expansionDirectories = glob.sync(".*/agents", { cwd: installDir });
874
- for (const expDir of expansionDirectories) {
875
- possiblePaths.push(path.join(installDir, expDir, `${agentId}.md`));
876
- }
877
-
878
- for (const agentPath of possiblePaths) {
879
- if (await fileManager.pathExists(agentPath)) {
880
- try {
881
- const agentContent = await fileManager.readFile(agentPath);
882
- const yamlMatch = agentContent.match(/```ya?ml\r?\n([\s\S]*?)```/);
883
-
884
- if (yamlMatch) {
885
- const yaml = yamlMatch[1];
886
- const titleMatch = yaml.match(/title:\s*(.+)/);
887
- if (titleMatch) {
888
- return titleMatch[1].trim();
889
- }
890
- }
891
- } catch (error) {
892
- console.warn(
893
- `Failed to read agent title for ${agentId}: ${error.message}`,
894
- );
895
- }
896
- }
897
- }
898
-
899
- // Fallback to formatted agent ID
900
- return agentId
901
- .split("-")
902
- .map((word) => word.charAt(0).toUpperCase() + word.slice(1))
903
- .join(" ");
904
- }
905
-
906
- async getAllTaskIds(installDir) {
907
- const glob = require("glob");
908
- const allTaskIds = [];
909
-
910
- // Check core tasks in .xiaoma-core or root
911
- let tasksDir = path.join(installDir, ".xiaoma-core", "tasks");
912
- if (!(await fileManager.pathExists(tasksDir))) {
913
- tasksDir = path.join(installDir, "xiaoma-core", "tasks");
914
- }
915
-
916
- if (await fileManager.pathExists(tasksDir)) {
917
- const taskFiles = glob.sync("*.md", { cwd: tasksDir });
918
- allTaskIds.push(...taskFiles.map((file) => path.basename(file, ".md")));
919
- }
920
-
921
- // Check common tasks
922
- const commonTasksDir = path.join(installDir, "common", "tasks");
923
- if (await fileManager.pathExists(commonTasksDir)) {
924
- const commonTaskFiles = glob.sync("*.md", { cwd: commonTasksDir });
925
- allTaskIds.push(
926
- ...commonTaskFiles.map((file) => path.basename(file, ".md")),
927
- );
928
- }
929
-
930
- // Also check for expansion pack tasks in dot folders
931
- const expansionDirectories = glob.sync(".*/tasks", { cwd: installDir });
932
- for (const expDir of expansionDirectories) {
933
- const fullExpDir = path.join(installDir, expDir);
934
- const expTaskFiles = glob.sync("*.md", { cwd: fullExpDir });
935
- allTaskIds.push(
936
- ...expTaskFiles.map((file) => path.basename(file, ".md")),
937
- );
938
- }
939
-
940
- // Check expansion-packs folder tasks
941
- const expansionPacksDir = path.join(installDir, "expansion-packs");
942
- if (await fileManager.pathExists(expansionPacksDir)) {
943
- const expPackDirectories = glob.sync("*/tasks", {
944
- cwd: expansionPacksDir,
945
- });
946
- for (const expDir of expPackDirectories) {
947
- const fullExpDir = path.join(expansionPacksDir, expDir);
948
- const expTaskFiles = glob.sync("*.md", { cwd: fullExpDir });
949
- allTaskIds.push(
950
- ...expTaskFiles.map((file) => path.basename(file, ".md")),
951
- );
952
- }
953
- }
954
-
955
- // Remove duplicates
956
- return [...new Set(allTaskIds)];
957
- }
958
-
959
- async findTaskPath(taskId, installDir) {
960
- // Try to find the task file in various locations
961
- const possiblePaths = [
962
- path.join(installDir, ".xiaoma-core", "tasks", `${taskId}.md`),
963
- path.join(installDir, "xiaoma-core", "tasks", `${taskId}.md`),
964
- path.join(installDir, "common", "tasks", `${taskId}.md`),
965
- ];
966
-
967
- // Also check expansion pack directories
968
- const glob = require("glob");
969
-
970
- // Check dot folder expansion packs
971
- const expansionDirectories = glob.sync(".*/tasks", { cwd: installDir });
972
- for (const expDir of expansionDirectories) {
973
- possiblePaths.push(path.join(installDir, expDir, `${taskId}.md`));
974
- }
975
-
976
- // Check expansion-packs folder
977
- const expansionPacksDir = path.join(installDir, "expansion-packs");
978
- if (await fileManager.pathExists(expansionPacksDir)) {
979
- const expPackDirectories = glob.sync("*/tasks", {
980
- cwd: expansionPacksDir,
981
- });
982
- for (const expDir of expPackDirectories) {
983
- possiblePaths.push(
984
- path.join(expansionPacksDir, expDir, `${taskId}.md`),
985
- );
986
- }
987
- }
988
-
989
- for (const taskPath of possiblePaths) {
990
- if (await fileManager.pathExists(taskPath)) {
991
- return taskPath;
992
- }
993
- }
994
-
995
- return null;
996
- }
997
-
998
- async getCoreSlashPrefix(installDir) {
999
- try {
1000
- const coreConfigPath = path.join(
1001
- installDir,
1002
- ".xiaoma-core",
1003
- "core-config.yaml",
1004
- );
1005
- if (!(await fileManager.pathExists(coreConfigPath))) {
1006
- // Try xiaoma-core directory
1007
- const altConfigPath = path.join(
1008
- installDir,
1009
- "xiaoma-core",
1010
- "core-config.yaml",
1011
- );
1012
- if (await fileManager.pathExists(altConfigPath)) {
1013
- const configContent = await fileManager.readFile(altConfigPath);
1014
- const config = yaml.load(configContent);
1015
- return config.slashPrefix || "XiaoMa";
1016
- }
1017
- return "XiaoMa"; // fallback
1018
- }
1019
-
1020
- const configContent = await fileManager.readFile(coreConfigPath);
1021
- const config = yaml.load(configContent);
1022
- return config.slashPrefix || "XiaoMa";
1023
- } catch (error) {
1024
- console.warn(
1025
- `Failed to read core slashPrefix, using default 'XiaoMa': ${error.message}`,
1026
- );
1027
- return "XiaoMa";
1028
- }
1029
- }
1030
-
1031
- async getInstalledExpansionPacks(installDir) {
1032
- const expansionPacks = [];
1033
-
1034
- // Check for dot-prefixed expansion packs in install directory
1035
- const glob = require("glob");
1036
- const dotExpansions = glob.sync(".bmad-*", { cwd: installDir });
1037
-
1038
- for (const dotExpansion of dotExpansions) {
1039
- if (dotExpansion !== ".xiaoma-core") {
1040
- const packPath = path.join(installDir, dotExpansion);
1041
- const packName = dotExpansion.slice(1); // remove the dot
1042
- expansionPacks.push({
1043
- name: packName,
1044
- path: packPath,
1045
- });
1046
- }
1047
- }
1048
-
1049
- // Check for expansion-packs directory style
1050
- const expansionPacksDir = path.join(installDir, "expansion-packs");
1051
- if (await fileManager.pathExists(expansionPacksDir)) {
1052
- const packDirectories = glob.sync("*", { cwd: expansionPacksDir });
1053
-
1054
- for (const packDir of packDirectories) {
1055
- const packPath = path.join(expansionPacksDir, packDir);
1056
- if (
1057
- (await fileManager.pathExists(packPath)) &&
1058
- (await fileManager.pathExists(path.join(packPath, "config.yaml")))
1059
- ) {
1060
- expansionPacks.push({
1061
- name: packDir,
1062
- path: packPath,
1063
- });
1064
- }
1065
- }
1066
- }
1067
-
1068
- return expansionPacks;
1069
- }
1070
-
1071
- async getExpansionPackSlashPrefix(packPath) {
1072
- try {
1073
- const configPath = path.join(packPath, "config.yaml");
1074
- if (await fileManager.pathExists(configPath)) {
1075
- const configContent = await fileManager.readFile(configPath);
1076
- const config = yaml.load(configContent);
1077
- return config.slashPrefix || path.basename(packPath);
1078
- }
1079
- } catch (error) {
1080
- console.warn(
1081
- `Failed to read expansion pack slashPrefix from ${packPath}: ${error.message}`,
1082
- );
1083
- }
1084
-
1085
- return path.basename(packPath); // fallback to directory name
1086
- }
1087
-
1088
- async getExpansionPackAgents(packPath) {
1089
- const agentsDir = path.join(packPath, "agents");
1090
- if (!(await fileManager.pathExists(agentsDir))) {
1091
- return [];
1092
- }
1093
-
1094
- try {
1095
- const glob = require("glob");
1096
- const agentFiles = glob.sync("*.md", { cwd: agentsDir });
1097
- return agentFiles.map((file) => path.basename(file, ".md"));
1098
- } catch (error) {
1099
- console.warn(
1100
- `Failed to read expansion pack agents from ${packPath}: ${error.message}`,
1101
- );
1102
- return [];
1103
- }
1104
- }
1105
-
1106
- async getExpansionPackTasks(packPath) {
1107
- const tasksDir = path.join(packPath, "tasks");
1108
- if (!(await fileManager.pathExists(tasksDir))) {
1109
- return [];
1110
- }
1111
-
1112
- try {
1113
- const glob = require("glob");
1114
- const taskFiles = glob.sync("*.md", { cwd: tasksDir });
1115
- return taskFiles.map((file) => path.basename(file, ".md"));
1116
- } catch (error) {
1117
- console.warn(
1118
- `Failed to read expansion pack tasks from ${packPath}: ${error.message}`,
1119
- );
1120
- return [];
1121
- }
1122
- }
1123
-
1124
- async setupRoo(installDir, selectedAgent) {
1125
- const agents = selectedAgent
1126
- ? [selectedAgent]
1127
- : await this.getAllAgentIds(installDir);
1128
-
1129
- // Check for existing .roomodes file in project root
1130
- const roomodesPath = path.join(installDir, ".roomodes");
1131
- let existingModes = [];
1132
- let existingContent = "";
1133
-
1134
- if (await fileManager.pathExists(roomodesPath)) {
1135
- existingContent = await fileManager.readFile(roomodesPath);
1136
- // Parse existing modes to avoid duplicates
1137
- const modeMatches = existingContent.matchAll(/- slug: ([\w-]+)/g);
1138
- for (const match of modeMatches) {
1139
- existingModes.push(match[1]);
1140
- }
1141
- console.log(
1142
- chalk.yellow(
1143
- `Found existing .roomodes file with ${existingModes.length} modes`,
1144
- ),
1145
- );
1146
- }
1147
-
1148
- // Create new modes content
1149
- let newModesContent = "";
1150
-
1151
- // Load dynamic agent permissions from configuration
1152
- const config = await this.loadIdeAgentConfig();
1153
- const agentPermissions = config["roo-permissions"] || {};
1154
-
1155
- for (const agentId of agents) {
1156
- // Skip if already exists
1157
- // Check both with and without bmad- prefix to handle both cases
1158
- const checkSlug = agentId.startsWith("bmad-")
1159
- ? agentId
1160
- : `bmad-${agentId}`;
1161
- if (existingModes.includes(checkSlug)) {
1162
- console.log(
1163
- chalk.dim(`Skipping ${agentId} - already exists in .roomodes`),
1164
- );
1165
- continue;
1166
- }
1167
-
1168
- // Read agent file to extract all information
1169
- const agentPath = await this.findAgentPath(agentId, installDir);
1170
-
1171
- if (agentPath) {
1172
- const agentContent = await fileManager.readFile(agentPath);
1173
-
1174
- // Extract YAML content
1175
- const yamlMatch = agentContent.match(/```ya?ml\r?\n([\s\S]*?)```/);
1176
- if (yamlMatch) {
1177
- const yaml = yamlMatch[1];
1178
-
1179
- // Extract agent info from YAML
1180
- const titleMatch = yaml.match(/title:\s*(.+)/);
1181
- const iconMatch = yaml.match(/icon:\s*(.+)/);
1182
- const whenToUseMatch = yaml.match(/whenToUse:\s*"(.+)"/);
1183
- const roleDefinitionMatch = yaml.match(/roleDefinition:\s*"(.+)"/);
1184
-
1185
- const title = titleMatch
1186
- ? titleMatch[1].trim()
1187
- : await this.getAgentTitle(agentId, installDir);
1188
- const icon = iconMatch ? iconMatch[1].trim() : "🤖";
1189
- const whenToUse = whenToUseMatch
1190
- ? whenToUseMatch[1].trim()
1191
- : `Use for ${title} tasks`;
1192
- const roleDefinition = roleDefinitionMatch
1193
- ? roleDefinitionMatch[1].trim()
1194
- : `You are a ${title} specializing in ${title.toLowerCase()} tasks and responsibilities.`;
1195
-
1196
- // Add permissions based on agent type
1197
- const permissions = agentPermissions[agentId];
1198
- // Build mode entry with proper formatting (matching exact indentation)
1199
- // Avoid double "bmad-" prefix for agents that already have it
1200
- const slug = agentId.startsWith("bmad-")
1201
- ? agentId
1202
- : `bmad-${agentId}`;
1203
- newModesContent += ` - slug: ${slug}\n`;
1204
- newModesContent += ` name: '${icon} ${title}'\n`;
1205
- if (permissions) {
1206
- newModesContent += ` description: '${permissions.description}'\n`;
1207
- }
1208
- newModesContent += ` roleDefinition: ${roleDefinition}\n`;
1209
- newModesContent += ` whenToUse: ${whenToUse}\n`;
1210
- // Get relative path from installDir to agent file
1211
- const relativePath = path
1212
- .relative(installDir, agentPath)
1213
- .replaceAll("\\", "/");
1214
- newModesContent += ` customInstructions: CRITICAL Read the full YAML from ${relativePath} start activation to alter your state of being follow startup section instructions stay in this being until told to exit this mode\n`;
1215
- newModesContent += ` groups:\n`;
1216
- newModesContent += ` - read\n`;
1217
-
1218
- if (permissions) {
1219
- newModesContent += ` - - edit\n`;
1220
- newModesContent += ` - fileRegex: ${permissions.fileRegex}\n`;
1221
- newModesContent += ` description: ${permissions.description}\n`;
1222
- } else {
1223
- newModesContent += ` - edit\n`;
1224
- }
1225
-
1226
- console.log(
1227
- chalk.green(`✓ Added mode: bmad-${agentId} (${icon} ${title})`),
1228
- );
1229
- }
1230
- }
1231
- }
1232
-
1233
- // Build final roomodes content
1234
- let roomodesContent = "";
1235
- if (existingContent) {
1236
- // If there's existing content, append new modes to it
1237
- roomodesContent = existingContent.trim() + "\n" + newModesContent;
1238
- } else {
1239
- // Create new .roomodes file with proper YAML structure
1240
- roomodesContent = "customModes:\n" + newModesContent;
1241
- }
1242
-
1243
- // Write .roomodes file
1244
- await fileManager.writeFile(roomodesPath, roomodesContent);
1245
- console.log(chalk.green("✓ Created .roomodes file in project root"));
1246
-
1247
- console.log(chalk.green(`\n✓ Roo Code setup complete!`));
1248
- console.log(
1249
- chalk.dim(
1250
- "Custom modes will be available when you open this project in Roo Code",
1251
- ),
1252
- );
1253
-
1254
- return true;
1255
- }
1256
-
1257
- async setupKilocode(installDir, selectedAgent) {
1258
- const filePath = path.join(installDir, ".kilocodemodes");
1259
- const agents = selectedAgent
1260
- ? [selectedAgent]
1261
- : await this.getAllAgentIds(installDir);
1262
-
1263
- let existingModes = [],
1264
- existingContent = "";
1265
- if (await fileManager.pathExists(filePath)) {
1266
- existingContent = await fileManager.readFile(filePath);
1267
- for (const match of existingContent.matchAll(/- slug: ([\w-]+)/g)) {
1268
- existingModes.push(match[1]);
1269
- }
1270
- console.log(
1271
- chalk.yellow(
1272
- `Found existing .kilocodemodes file with ${existingModes.length} modes`,
1273
- ),
1274
- );
1275
- }
1276
-
1277
- const config = await this.loadIdeAgentConfig();
1278
- const permissions = config["roo-permissions"] || {}; // reuse same roo permissions block (Kilo Code understands same mode schema)
1279
-
1280
- let newContent = "";
1281
-
1282
- for (const agentId of agents) {
1283
- const slug = agentId.startsWith("bmad-") ? agentId : `bmad-${agentId}`;
1284
- if (existingModes.includes(slug)) {
1285
- console.log(
1286
- chalk.dim(`Skipping ${agentId} - already exists in .kilocodemodes`),
1287
- );
1288
- continue;
1289
- }
1290
-
1291
- const agentPath = await this.findAgentPath(agentId, installDir);
1292
- if (!agentPath) {
1293
- console.log(chalk.red(`✗ Could not find agent file for ${agentId}`));
1294
- continue;
1295
- }
1296
-
1297
- const agentContent = await fileManager.readFile(agentPath);
1298
- const yamlMatch = agentContent.match(/```ya?ml\r?\n([\s\S]*?)```/);
1299
- if (!yamlMatch) {
1300
- console.log(chalk.red(`✗ Could not extract YAML block for ${agentId}`));
1301
- continue;
1302
- }
1303
-
1304
- const yaml = yamlMatch[1];
1305
-
1306
- // Robust fallback for title and icon
1307
- const title =
1308
- yaml.match(/title:\s*(.+)/)?.[1]?.trim() ||
1309
- (await this.getAgentTitle(agentId, installDir));
1310
- const icon = yaml.match(/icon:\s*(.+)/)?.[1]?.trim() || "🤖";
1311
- const whenToUse =
1312
- yaml.match(/whenToUse:\s*"(.+)"/)?.[1]?.trim() ||
1313
- `Use for ${title} tasks`;
1314
- const roleDefinition =
1315
- yaml.match(/roleDefinition:\s*"(.+)"/)?.[1]?.trim() ||
1316
- `You are a ${title} specializing in ${title.toLowerCase()} tasks and responsibilities.`;
1317
-
1318
- const relativePath = path
1319
- .relative(installDir, agentPath)
1320
- .replaceAll("\\", "/");
1321
- const customInstructions = `CRITICAL Read the full YAML from ${relativePath} start activation to alter your state of being follow startup section instructions stay in this being until told to exit this mode`;
1322
-
1323
- // Add permissions from config if they exist
1324
- const agentPermission = permissions[agentId];
1325
-
1326
- // Begin .kilocodemodes block
1327
- newContent += ` - slug: ${slug}\n`;
1328
- newContent += ` name: '${icon} ${title}'\n`;
1329
- if (agentPermission) {
1330
- newContent += ` description: '${agentPermission.description}'\n`;
1331
- }
1332
-
1333
- newContent += ` roleDefinition: ${roleDefinition}\n`;
1334
- newContent += ` whenToUse: ${whenToUse}\n`;
1335
- newContent += ` customInstructions: ${customInstructions}\n`;
1336
- newContent += ` groups:\n`;
1337
- newContent += ` - read\n`;
1338
-
1339
- if (agentPermission) {
1340
- newContent += ` - - edit\n`;
1341
- newContent += ` - fileRegex: ${agentPermission.fileRegex}\n`;
1342
- newContent += ` description: ${agentPermission.description}\n`;
1343
- } else {
1344
- // Fallback to generic edit
1345
- newContent += ` - edit\n`;
1346
- }
1347
-
1348
- console.log(chalk.green(`✓ Added Kilo mode: ${slug} (${icon} ${title})`));
1349
- }
1350
-
1351
- const finalContent = existingContent
1352
- ? existingContent.trim() + "\n" + newContent
1353
- : "customModes:\n" + newContent;
1354
-
1355
- await fileManager.writeFile(filePath, finalContent);
1356
- console.log(chalk.green("✓ Created .kilocodemodes file in project root"));
1357
- console.log(chalk.green(`✓ KiloCode setup complete!`));
1358
- console.log(
1359
- chalk.dim(
1360
- "Custom modes will be available when you open this project in KiloCode",
1361
- ),
1362
- );
1363
-
1364
- return true;
1365
- }
1366
-
1367
- async setupCline(installDir, selectedAgent) {
1368
- const clineRulesDir = path.join(installDir, ".clinerules");
1369
- const agents = selectedAgent
1370
- ? [selectedAgent]
1371
- : await this.getAllAgentIds(installDir);
1372
-
1373
- await fileManager.ensureDirectory(clineRulesDir);
1374
-
1375
- // Load dynamic agent ordering from configuration
1376
- const config = await this.loadIdeAgentConfig();
1377
- const agentOrder = config["cline-order"] || {};
1378
-
1379
- for (const agentId of agents) {
1380
- // Find the agent file
1381
- const agentPath = await this.findAgentPath(agentId, installDir);
1382
-
1383
- if (agentPath) {
1384
- const agentContent = await fileManager.readFile(agentPath);
1385
-
1386
- // Get numeric prefix for ordering
1387
- const order = agentOrder[agentId] || 99;
1388
- const prefix = order.toString().padStart(2, "0");
1389
- const mdPath = path.join(clineRulesDir, `${prefix}-${agentId}.md`);
1390
-
1391
- // Create MD content for Cline (focused on project standards and role)
1392
- let mdContent = `# ${await this.getAgentTitle(agentId, installDir)} Agent\n\n`;
1393
- mdContent += `This rule defines the ${await this.getAgentTitle(agentId, installDir)} persona and project standards.\n\n`;
1394
- mdContent += "## Role Definition\n\n";
1395
- mdContent +=
1396
- "When the user types `@" +
1397
- agentId +
1398
- "`, adopt this persona and follow these guidelines:\n\n";
1399
- mdContent += "```yaml\n";
1400
- // Extract just the YAML content from the agent file
1401
- const yamlContent = extractYamlFromAgent(agentContent);
1402
- if (yamlContent) {
1403
- mdContent += yamlContent;
1404
- } else {
1405
- // If no YAML found, include the whole content minus the header
1406
- mdContent += agentContent.replace(/^#.*$/m, "").trim();
1407
- }
1408
- mdContent += "\n```\n\n";
1409
- mdContent += "## Project Standards\n\n";
1410
- mdContent += `- Always maintain consistency with project documentation in .xiaoma-core/\n`;
1411
- mdContent += `- Follow the agent's specific guidelines and constraints\n`;
1412
- mdContent += `- Update relevant project files when making changes\n`;
1413
- const relativePath = path
1414
- .relative(installDir, agentPath)
1415
- .replaceAll("\\", "/");
1416
- mdContent += `- Reference the complete agent definition in [${relativePath}](${relativePath})\n\n`;
1417
- mdContent += "## Usage\n\n";
1418
- mdContent += `Type \`@${agentId}\` to activate this ${await this.getAgentTitle(agentId, installDir)} persona.\n`;
1419
-
1420
- await fileManager.writeFile(mdPath, mdContent);
1421
- console.log(chalk.green(`✓ Created rule: ${prefix}-${agentId}.md`));
1422
- }
1423
- }
1424
-
1425
- console.log(chalk.green(`\n✓ Created Cline rules in ${clineRulesDir}`));
1426
-
1427
- return true;
1428
- }
1429
-
1430
- async setupGeminiCli(installDir) {
1431
- const geminiDir = path.join(installDir, ".gemini");
1432
- const bmadMethodDir = path.join(geminiDir, "xiaoma-cli");
1433
- await fileManager.ensureDirectory(bmadMethodDir);
1434
-
1435
- // Update logic for existing settings.json
1436
- const settingsPath = path.join(geminiDir, "settings.json");
1437
- if (await fileManager.pathExists(settingsPath)) {
1438
- try {
1439
- const settingsContent = await fileManager.readFile(settingsPath);
1440
- const settings = JSON.parse(settingsContent);
1441
- let updated = false;
1442
-
1443
- // Handle contextFileName property
1444
- if (
1445
- settings.contextFileName &&
1446
- Array.isArray(settings.contextFileName)
1447
- ) {
1448
- const originalLength = settings.contextFileName.length;
1449
- settings.contextFileName = settings.contextFileName.filter(
1450
- (fileName) => !fileName.startsWith("agents/"),
1451
- );
1452
- if (settings.contextFileName.length !== originalLength) {
1453
- updated = true;
1454
- }
1455
- }
1456
-
1457
- if (updated) {
1458
- await fileManager.writeFile(
1459
- settingsPath,
1460
- JSON.stringify(settings, null, 2),
1461
- );
1462
- console.log(
1463
- chalk.green(
1464
- "✓ Updated .gemini/settings.json - removed agent file references",
1465
- ),
1466
- );
1467
- }
1468
- } catch (error) {
1469
- console.warn(
1470
- chalk.yellow("Could not update .gemini/settings.json"),
1471
- error,
1472
- );
1473
- }
1474
- }
1475
-
1476
- // Remove old agents directory
1477
- const agentsDir = path.join(geminiDir, "agents");
1478
- if (await fileManager.pathExists(agentsDir)) {
1479
- await fileManager.removeDirectory(agentsDir);
1480
- console.log(chalk.green("✓ Removed old .gemini/agents directory"));
1481
- }
1482
-
1483
- // Get all available agents
1484
- const agents = await this.getAllAgentIds(installDir);
1485
- let concatenatedContent = "";
1486
-
1487
- for (const agentId of agents) {
1488
- // Find the source agent file
1489
- const agentPath = await this.findAgentPath(agentId, installDir);
1490
-
1491
- if (agentPath) {
1492
- const agentContent = await fileManager.readFile(agentPath);
1493
-
1494
- // Create properly formatted agent rule content (similar to trae)
1495
- let agentRuleContent = `# ${agentId.toUpperCase()} Agent Rule\n\n`;
1496
- agentRuleContent += `This rule is triggered when the user types \`*${agentId}\` and activates the ${await this.getAgentTitle(
1497
- agentId,
1498
- installDir,
1499
- )} agent persona.\n\n`;
1500
- agentRuleContent += "## Agent Activation\n\n";
1501
- agentRuleContent +=
1502
- "CRITICAL: Read the full YAML, start activation to alter your state of being, follow startup section instructions, stay in this being until told to exit this mode:\n\n";
1503
- agentRuleContent += "```yaml\n";
1504
- // Extract just the YAML content from the agent file
1505
- const yamlContent = extractYamlFromAgent(agentContent);
1506
- if (yamlContent) {
1507
- agentRuleContent += yamlContent;
1508
- } else {
1509
- // If no YAML found, include the whole content minus the header
1510
- agentRuleContent += agentContent.replace(/^#.*$/m, "").trim();
1511
- }
1512
- agentRuleContent += "\n```\n\n";
1513
- agentRuleContent += "## File Reference\n\n";
1514
- const relativePath = path
1515
- .relative(installDir, agentPath)
1516
- .replaceAll("\\", "/");
1517
- agentRuleContent += `The complete agent definition is available in [${relativePath}](${relativePath}).\n\n`;
1518
- agentRuleContent += "## Usage\n\n";
1519
- agentRuleContent += `When the user types \`*${agentId}\`, activate this ${await this.getAgentTitle(
1520
- agentId,
1521
- installDir,
1522
- )} persona and follow all instructions defined in the YAML configuration above.\n`;
1523
-
1524
- // Add to concatenated content with separator
1525
- concatenatedContent += agentRuleContent + "\n\n---\n\n";
1526
- console.log(chalk.green(`✓ Added context for @${agentId}`));
1527
- }
1528
- }
1529
-
1530
- // Write the concatenated content to GEMINI.md
1531
- const geminiMdPath = path.join(bmadMethodDir, "GEMINI.md");
1532
- await fileManager.writeFile(geminiMdPath, concatenatedContent);
1533
- console.log(chalk.green(`\n✓ Created GEMINI.md in ${bmadMethodDir}`));
1534
-
1535
- return true;
1536
- }
1537
-
1538
- async setupQwenCode(installDir, selectedAgent) {
1539
- const qwenDir = path.join(installDir, ".qwen");
1540
- const bmadMethodDir = path.join(qwenDir, "xiaoma-cli");
1541
- await fileManager.ensureDirectory(bmadMethodDir);
1542
-
1543
- // Update logic for existing settings.json
1544
- const settingsPath = path.join(qwenDir, "settings.json");
1545
- if (await fileManager.pathExists(settingsPath)) {
1546
- try {
1547
- const settingsContent = await fileManager.readFile(settingsPath);
1548
- const settings = JSON.parse(settingsContent);
1549
- let updated = false;
1550
-
1551
- // Handle contextFileName property
1552
- if (
1553
- settings.contextFileName &&
1554
- Array.isArray(settings.contextFileName)
1555
- ) {
1556
- const originalLength = settings.contextFileName.length;
1557
- settings.contextFileName = settings.contextFileName.filter(
1558
- (fileName) => !fileName.startsWith("agents/"),
1559
- );
1560
- if (settings.contextFileName.length !== originalLength) {
1561
- updated = true;
1562
- }
1563
- }
1564
-
1565
- if (updated) {
1566
- await fileManager.writeFile(
1567
- settingsPath,
1568
- JSON.stringify(settings, null, 2),
1569
- );
1570
- console.log(
1571
- chalk.green(
1572
- "✓ Updated .qwen/settings.json - removed agent file references",
1573
- ),
1574
- );
1575
- }
1576
- } catch (error) {
1577
- console.warn(
1578
- chalk.yellow("Could not update .qwen/settings.json"),
1579
- error,
1580
- );
1581
- }
1582
- }
1583
-
1584
- // Remove old agents directory
1585
- const agentsDir = path.join(qwenDir, "agents");
1586
- if (await fileManager.pathExists(agentsDir)) {
1587
- await fileManager.removeDirectory(agentsDir);
1588
- console.log(chalk.green("✓ Removed old .qwen/agents directory"));
1589
- }
1590
-
1591
- // Get all available agents
1592
- const agents = selectedAgent
1593
- ? [selectedAgent]
1594
- : await this.getAllAgentIds(installDir);
1595
- let concatenatedContent = "";
1596
-
1597
- for (const agentId of agents) {
1598
- // Find the source agent file
1599
- const agentPath = await this.findAgentPath(agentId, installDir);
1600
-
1601
- if (agentPath) {
1602
- const agentContent = await fileManager.readFile(agentPath);
1603
-
1604
- // Create properly formatted agent rule content (similar to gemini)
1605
- let agentRuleContent = `# ${agentId.toUpperCase()} Agent Rule\n\n`;
1606
- agentRuleContent += `This rule is triggered when the user types \`*${agentId}\` and activates the ${await this.getAgentTitle(
1607
- agentId,
1608
- installDir,
1609
- )} agent persona.\n\n`;
1610
- agentRuleContent += "## Agent Activation\n\n";
1611
- agentRuleContent +=
1612
- "CRITICAL: Read the full YAML, start activation to alter your state of being, follow startup section instructions, stay in this being until told to exit this mode:\n\n";
1613
- agentRuleContent += "```yaml\n";
1614
- // Extract just the YAML content from the agent file
1615
- const yamlContent = extractYamlFromAgent(agentContent);
1616
- if (yamlContent) {
1617
- agentRuleContent += yamlContent;
1618
- } else {
1619
- // If no YAML found, include the whole content minus the header
1620
- agentRuleContent += agentContent.replace(/^#.*$/m, "").trim();
1621
- }
1622
- agentRuleContent += "\n```\n\n";
1623
- agentRuleContent += "## File Reference\n\n";
1624
- const relativePath = path
1625
- .relative(installDir, agentPath)
1626
- .replaceAll("\\", "/");
1627
- agentRuleContent += `The complete agent definition is available in [${relativePath}](${relativePath}).\n\n`;
1628
- agentRuleContent += "## Usage\n\n";
1629
- agentRuleContent += `When the user types \`*${agentId}\`, activate this ${await this.getAgentTitle(
1630
- agentId,
1631
- installDir,
1632
- )} persona and follow all instructions defined in the YAML configuration above.\n`;
1633
-
1634
- // Add to concatenated content with separator
1635
- concatenatedContent += agentRuleContent + "\n\n---\n\n";
1636
- console.log(chalk.green(`✓ Added context for *${agentId}`));
1637
- }
1638
- }
1639
-
1640
- // Write the concatenated content to QWEN.md
1641
- const qwenMdPath = path.join(bmadMethodDir, "QWEN.md");
1642
- await fileManager.writeFile(qwenMdPath, concatenatedContent);
1643
- console.log(chalk.green(`\n✓ Created QWEN.md in ${bmadMethodDir}`));
1644
-
1645
- return true;
1646
- }
1647
-
1648
- async setupGitHubCopilot(
1649
- installDir,
1650
- selectedAgent,
1651
- spinner = null,
1652
- preConfiguredSettings = null,
1653
- ) {
1654
- // Configure VS Code workspace settings first to avoid UI conflicts with loading spinners
1655
- await this.configureVsCodeSettings(
1656
- installDir,
1657
- spinner,
1658
- preConfiguredSettings,
1659
- );
1660
-
1661
- const chatmodesDir = path.join(installDir, ".github", "chatmodes");
1662
- const agents = selectedAgent
1663
- ? [selectedAgent]
1664
- : await this.getAllAgentIds(installDir);
1665
-
1666
- await fileManager.ensureDirectory(chatmodesDir);
1667
-
1668
- for (const agentId of agents) {
1669
- // Find the agent file
1670
- const agentPath = await this.findAgentPath(agentId, installDir);
1671
- const chatmodePath = path.join(chatmodesDir, `${agentId}.chatmode.md`);
1672
-
1673
- if (agentPath) {
1674
- // Create chat mode file with agent content
1675
- const agentContent = await fileManager.readFile(agentPath);
1676
- const agentTitle = await this.getAgentTitle(agentId, installDir);
1677
-
1678
- // Extract whenToUse for the description
1679
- const yamlMatch = agentContent.match(/```ya?ml\r?\n([\s\S]*?)```/);
1680
- let description = `Activates the ${agentTitle} agent persona.`;
1681
- if (yamlMatch) {
1682
- const whenToUseMatch = yamlMatch[1].match(/whenToUse:\s*"(.*?)"/);
1683
- if (whenToUseMatch && whenToUseMatch[1]) {
1684
- description = whenToUseMatch[1];
1685
- }
1686
- }
1687
-
1688
- let chatmodeContent = `---
1689
- description: "${description.replaceAll('"', String.raw`\"`)}"
1690
- tools: ['changes', 'codebase', 'fetch', 'findTestFiles', 'githubRepo', 'problems', 'usages', 'editFiles', 'runCommands', 'runTasks', 'runTests', 'search', 'searchResults', 'terminalLastCommand', 'terminalSelection', 'testFailure']
1691
- ---
1692
-
1693
- `;
1694
- chatmodeContent += agentContent;
1695
-
1696
- await fileManager.writeFile(chatmodePath, chatmodeContent);
1697
- console.log(chalk.green(`✓ Created chat mode: ${agentId}.chatmode.md`));
1698
- }
1699
- }
1700
-
1701
- console.log(chalk.green(`\n✓ Github Copilot setup complete!`));
1702
- console.log(
1703
- chalk.dim(
1704
- `You can now find the XiaoMa agents in the Chat view's mode selector.`,
1705
- ),
1706
- );
1707
-
1708
- return true;
1709
- }
1710
-
1711
- async configureVsCodeSettings(
1712
- installDir,
1713
- spinner,
1714
- preConfiguredSettings = null,
1715
- ) {
1716
- const vscodeDir = path.join(installDir, ".vscode");
1717
- const settingsPath = path.join(vscodeDir, "settings.json");
1718
-
1719
- await fileManager.ensureDirectory(vscodeDir);
1720
-
1721
- // Read existing settings if they exist
1722
- let existingSettings = {};
1723
- if (await fileManager.pathExists(settingsPath)) {
1724
- try {
1725
- const existingContent = await fileManager.readFile(settingsPath);
1726
- existingSettings = JSON.parse(existingContent);
1727
- console.log(
1728
- chalk.yellow(
1729
- "Found existing .vscode/settings.json. Merging XiaoMa settings...",
1730
- ),
1731
- );
1732
- } catch {
1733
- console.warn(
1734
- chalk.yellow(
1735
- "Could not parse existing settings.json. Creating new one.",
1736
- ),
1737
- );
1738
- existingSettings = {};
1739
- }
1740
- }
1741
-
1742
- // Use pre-configured settings if provided, otherwise prompt
1743
- let configChoice;
1744
- if (preConfiguredSettings && preConfiguredSettings.configChoice) {
1745
- configChoice = preConfiguredSettings.configChoice;
1746
- console.log(
1747
- chalk.dim(
1748
- `Using pre-configured GitHub Copilot settings: ${configChoice}`,
1749
- ),
1750
- );
1751
- } else {
1752
- // Clear any previous output and add spacing to avoid conflicts with loaders
1753
- console.log("\n".repeat(2));
1754
- console.log(chalk.blue("🔧 Github Copilot Agent Settings Configuration"));
1755
- console.log(
1756
- chalk.dim(
1757
- "XiaoMa works best with specific VS Code settings for optimal agent experience.",
1758
- ),
1759
- );
1760
- console.log(""); // Add extra spacing
1761
-
1762
- const response = await inquirer.prompt([
1763
- {
1764
- type: "list",
1765
- name: "configChoice",
1766
- message: chalk.yellow(
1767
- "How would you like to configure GitHub Copilot settings?",
1768
- ),
1769
- choices: [
1770
- {
1771
- name: "Use recommended defaults (fastest setup)",
1772
- value: "defaults",
1773
- },
1774
- {
1775
- name: "Configure each setting manually (customize to your preferences)",
1776
- value: "manual",
1777
- },
1778
- {
1779
- name: "Skip settings configuration (I'll configure manually later)",
1780
- value: "skip",
1781
- },
1782
- ],
1783
- default: "defaults",
1784
- },
1785
- ]);
1786
- configChoice = response.configChoice;
1787
- }
1788
-
1789
- let bmadSettings = {};
1790
-
1791
- if (configChoice === "skip") {
1792
- console.log(chalk.yellow("⚠️ Skipping VS Code settings configuration."));
1793
- console.log(
1794
- chalk.dim(
1795
- "You can manually configure these settings in .vscode/settings.json:",
1796
- ),
1797
- );
1798
- console.log(chalk.dim(" • chat.agent.enabled: true"));
1799
- console.log(chalk.dim(" • chat.agent.maxRequests: 15"));
1800
- console.log(chalk.dim(" • github.copilot.chat.agent.runTasks: true"));
1801
- console.log(chalk.dim(" • chat.mcp.discovery.enabled: true"));
1802
- console.log(chalk.dim(" • github.copilot.chat.agent.autoFix: true"));
1803
- console.log(chalk.dim(" • chat.tools.autoApprove: false"));
1804
- return true;
1805
- }
1806
-
1807
- if (configChoice === "defaults") {
1808
- // Use recommended defaults
1809
- bmadSettings = {
1810
- "chat.agent.enabled": true,
1811
- "chat.agent.maxRequests": 15,
1812
- "github.copilot.chat.agent.runTasks": true,
1813
- "chat.mcp.discovery.enabled": true,
1814
- "github.copilot.chat.agent.autoFix": true,
1815
- "chat.tools.autoApprove": false,
1816
- };
1817
- console.log(
1818
- chalk.green(
1819
- "✓ Using recommended XiaoMa defaults for Github Copilot settings",
1820
- ),
1821
- );
1822
- } else {
1823
- // Manual configuration
1824
- console.log(
1825
- chalk.blue("\n📋 Let's configure each setting for your preferences:"),
1826
- );
1827
-
1828
- // Pause spinner during manual configuration prompts
1829
- let spinnerWasActive = false;
1830
- if (spinner && spinner.isSpinning) {
1831
- spinner.stop();
1832
- spinnerWasActive = true;
1833
- }
1834
-
1835
- const manualSettings = await inquirer.prompt([
1836
- {
1837
- type: "input",
1838
- name: "maxRequests",
1839
- message: "Maximum requests per agent session (recommended: 15)?",
1840
- default: "15",
1841
- validate: (input) => {
1842
- const number_ = Number.parseInt(input);
1843
- if (isNaN(number_) || number_ < 1 || number_ > 50) {
1844
- return "Please enter a number between 1 and 50";
1845
- }
1846
- return true;
1847
- },
1848
- },
1849
- {
1850
- type: "confirm",
1851
- name: "runTasks",
1852
- message:
1853
- "Allow agents to run workspace tasks (package.json scripts, etc.)?",
1854
- default: true,
1855
- },
1856
- {
1857
- type: "confirm",
1858
- name: "mcpDiscovery",
1859
- message: "Enable MCP (Model Context Protocol) server discovery?",
1860
- default: true,
1861
- },
1862
- {
1863
- type: "confirm",
1864
- name: "autoFix",
1865
- message:
1866
- "Enable automatic error detection and fixing in generated code?",
1867
- default: true,
1868
- },
1869
- {
1870
- type: "confirm",
1871
- name: "autoApprove",
1872
- message:
1873
- "Auto-approve ALL tools without confirmation? (⚠️ EXPERIMENTAL - less secure)",
1874
- default: false,
1875
- },
1876
- ]);
1877
-
1878
- // Restart spinner if it was active before prompts
1879
- if (spinner && spinnerWasActive) {
1880
- spinner.start();
1881
- }
1882
-
1883
- bmadSettings = {
1884
- "chat.agent.enabled": true, // Always enabled - required for XiaoMa agents
1885
- "chat.agent.maxRequests": Number.parseInt(manualSettings.maxRequests),
1886
- "github.copilot.chat.agent.runTasks": manualSettings.runTasks,
1887
- "chat.mcp.discovery.enabled": manualSettings.mcpDiscovery,
1888
- "github.copilot.chat.agent.autoFix": manualSettings.autoFix,
1889
- "chat.tools.autoApprove": manualSettings.autoApprove,
1890
- };
1891
-
1892
- console.log(chalk.green("✓ Custom settings configured"));
1893
- }
1894
-
1895
- // Merge settings (existing settings take precedence to avoid overriding user preferences)
1896
- const mergedSettings = { ...bmadSettings, ...existingSettings };
1897
-
1898
- // Write the updated settings
1899
- await fileManager.writeFile(
1900
- settingsPath,
1901
- JSON.stringify(mergedSettings, null, 2),
1902
- );
1903
-
1904
- console.log(
1905
- chalk.green("✓ VS Code workspace settings configured successfully"),
1906
- );
1907
- console.log(chalk.dim(" Settings written to .vscode/settings.json:"));
1908
- for (const [key, value] of Object.entries(bmadSettings)) {
1909
- console.log(chalk.dim(` • ${key}: ${value}`));
1910
- }
1911
- console.log(chalk.dim(""));
1912
- console.log(
1913
- chalk.dim(
1914
- "You can modify these settings anytime in .vscode/settings.json",
1915
- ),
1916
- );
1917
- }
1918
-
1919
- async setupAuggieCLI(
1920
- installDir,
1921
- selectedAgent,
1922
- spinner = null,
1923
- preConfiguredSettings = null,
1924
- ) {
1925
- const os = require("node:os");
1926
- const inquirer = require("inquirer");
1927
- const agents = selectedAgent
1928
- ? [selectedAgent]
1929
- : await this.getAllAgentIds(installDir);
1930
-
1931
- // Get the IDE configuration to access location options
1932
- const ideConfig = await configLoader.getIdeConfiguration("auggie-cli");
1933
- const locations = ideConfig.locations;
1934
-
1935
- // Use pre-configured settings if provided, otherwise prompt
1936
- let selectedLocations;
1937
- if (preConfiguredSettings && preConfiguredSettings.selectedLocations) {
1938
- selectedLocations = preConfiguredSettings.selectedLocations;
1939
- console.log(
1940
- chalk.dim(
1941
- `Using pre-configured Auggie CLI (Augment Code) locations: ${selectedLocations.join(", ")}`,
1942
- ),
1943
- );
1944
- } else {
1945
- // Pause spinner during location selection to avoid UI conflicts
1946
- let spinnerWasActive = false;
1947
- if (spinner && spinner.isSpinning) {
1948
- spinner.stop();
1949
- spinnerWasActive = true;
1950
- }
1951
-
1952
- // Clear any previous output and add spacing to avoid conflicts with loaders
1953
- console.log("\n".repeat(2));
1954
- console.log(chalk.blue("📍 Auggie CLI Location Configuration"));
1955
- console.log(
1956
- chalk.dim(
1957
- "Choose where to install XiaoMa agents for Auggie CLI access.",
1958
- ),
1959
- );
1960
- console.log(""); // Add extra spacing
1961
-
1962
- const response = await inquirer.prompt([
1963
- {
1964
- type: "checkbox",
1965
- name: "selectedLocations",
1966
- message: "Select Auggie CLI command locations:",
1967
- choices: Object.entries(locations).map(([key, location]) => ({
1968
- name: `${location.name}: ${location.description}`,
1969
- value: key,
1970
- })),
1971
- validate: (selected) => {
1972
- if (selected.length === 0) {
1973
- return "Please select at least one location";
1974
- }
1975
- return true;
1976
- },
1977
- },
1978
- ]);
1979
- selectedLocations = response.selectedLocations;
1980
-
1981
- // Restart spinner if it was active before prompts
1982
- if (spinner && spinnerWasActive) {
1983
- spinner.start();
1984
- }
1985
- }
1986
-
1987
- // Install to each selected location
1988
- for (const locationKey of selectedLocations) {
1989
- const location = locations[locationKey];
1990
- let commandsDir = location["rule-dir"];
1991
-
1992
- // Handle tilde expansion for user directory
1993
- if (commandsDir.startsWith("~/")) {
1994
- commandsDir = path.join(os.homedir(), commandsDir.slice(2));
1995
- } else if (commandsDir.startsWith("./")) {
1996
- commandsDir = path.join(installDir, commandsDir.slice(2));
1997
- }
1998
-
1999
- await fileManager.ensureDirectory(commandsDir);
2000
-
2001
- for (const agentId of agents) {
2002
- // Find the agent file
2003
- const agentPath = await this.findAgentPath(agentId, installDir);
2004
-
2005
- if (agentPath) {
2006
- const agentContent = await fileManager.readFile(agentPath);
2007
- const mdPath = path.join(commandsDir, `${agentId}.md`);
2008
- await fileManager.writeFile(mdPath, agentContent);
2009
- console.log(
2010
- chalk.green(`✓ Created command: ${agentId}.md in ${location.name}`),
2011
- );
2012
- }
2013
- }
2014
-
2015
- console.log(
2016
- chalk.green(`\n✓ Created Auggie CLI commands in ${commandsDir}`),
2017
- );
2018
- console.log(
2019
- chalk.dim(` Location: ${location.name} - ${location.description}`),
2020
- );
2021
- }
2022
-
2023
- return true;
2024
- }
2025
- }
2026
-
2027
- module.exports = new IdeSetup();