@zeyue0329/xiaoma-cli 1.0.8 → 1.0.9

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 (315) hide show
  1. package/CHANGELOG.md +686 -0
  2. package/LICENSE +6 -1
  3. package/README.md +173 -460
  4. package/common/tasks/create-doc.md +3 -1
  5. package/common/tasks/execute-checklist.md +2 -7
  6. package/common/utils/bmad-doc-template.md +7 -5
  7. package/common/utils/workflow-management.md +2 -0
  8. package/dist/agents/analyst.txt +1143 -1118
  9. package/dist/agents/architect.txt +1555 -1531
  10. package/dist/agents/dev.txt +170 -22
  11. package/dist/agents/pm.txt +1103 -1106
  12. package/dist/agents/po.txt +329 -334
  13. package/dist/agents/qa.txt +1773 -154
  14. package/dist/agents/sm.txt +101 -102
  15. package/dist/agents/ux-expert.txt +93 -91
  16. package/dist/agents/xiaoma-master.txt +745 -673
  17. package/dist/agents/xiaoma-orchestrator.txt +107 -77
  18. package/dist/expansion-packs/bmad-2d-phaser-game-dev/agents/game-designer.txt +2386 -0
  19. package/dist/expansion-packs/bmad-2d-phaser-game-dev/agents/game-developer.txt +1627 -0
  20. package/dist/expansion-packs/bmad-2d-phaser-game-dev/agents/game-sm.txt +822 -0
  21. package/dist/expansion-packs/bmad-2d-phaser-game-dev/teams/phaser-2d-nodejs-game-team.txt +11008 -0
  22. package/dist/expansion-packs/bmad-2d-unity-game-dev/agents/game-architect.txt +4031 -0
  23. package/dist/expansion-packs/bmad-2d-unity-game-dev/agents/game-designer.txt +3717 -0
  24. package/dist/expansion-packs/bmad-2d-unity-game-dev/agents/game-developer.txt +456 -0
  25. package/dist/expansion-packs/bmad-2d-unity-game-dev/agents/game-sm.txt +982 -0
  26. package/dist/expansion-packs/bmad-2d-unity-game-dev/teams/unity-2d-game-team.txt +15450 -0
  27. package/dist/expansion-packs/bmad-creative-writing/agents/beta-reader.txt +921 -0
  28. package/dist/expansion-packs/bmad-creative-writing/agents/book-critic.txt +81 -0
  29. package/dist/expansion-packs/bmad-creative-writing/agents/character-psychologist.txt +886 -0
  30. package/dist/expansion-packs/bmad-creative-writing/agents/cover-designer.txt +85 -0
  31. package/dist/expansion-packs/bmad-creative-writing/agents/dialog-specialist.txt +903 -0
  32. package/dist/expansion-packs/bmad-creative-writing/agents/editor.txt +837 -0
  33. package/dist/expansion-packs/bmad-creative-writing/agents/genre-specialist.txt +989 -0
  34. package/dist/expansion-packs/bmad-creative-writing/agents/narrative-designer.txt +888 -0
  35. package/dist/expansion-packs/bmad-creative-writing/agents/plot-architect.txt +1173 -0
  36. package/dist/expansion-packs/bmad-creative-writing/agents/world-builder.txt +914 -0
  37. package/dist/expansion-packs/bmad-creative-writing/teams/agent-team.txt +6511 -0
  38. package/dist/expansion-packs/bmad-infrastructure-devops/agents/infra-devops-platform.txt +2087 -0
  39. package/dist/teams/team-all.txt +5710 -3857
  40. package/dist/teams/team-fullstack.txt +3242 -3157
  41. package/dist/teams/team-ide-minimal.txt +2330 -534
  42. package/dist/teams/team-no-ui.txt +2935 -2857
  43. package/docs/GUIDING-PRINCIPLES.md +91 -0
  44. package/docs/core-architecture.md +219 -0
  45. package/docs/enhanced-ide-development-workflow.md +248 -0
  46. package/docs/expansion-packs.md +200 -0
  47. package/docs/how-to-contribute-with-pull-requests.md +158 -0
  48. package/docs/user-guide.md +530 -0
  49. package/docs/versioning-and-releases.md +155 -0
  50. package/docs/versions.md +48 -0
  51. package/docs/working-in-the-brownfield.md +597 -0
  52. package/expansion-packs/bmad-2d-phaser-game-dev/agent-teams/phaser-2d-nodejs-game-team.yaml +14 -0
  53. package/expansion-packs/bmad-2d-phaser-game-dev/agents/game-designer.md +73 -0
  54. package/expansion-packs/bmad-2d-phaser-game-dev/agents/game-developer.md +80 -0
  55. package/expansion-packs/bmad-2d-phaser-game-dev/agents/game-sm.md +66 -0
  56. package/expansion-packs/bmad-2d-phaser-game-dev/checklists/game-design-checklist.md +203 -0
  57. package/expansion-packs/bmad-2d-phaser-game-dev/checklists/game-story-dod-checklist.md +162 -0
  58. package/expansion-packs/bmad-2d-phaser-game-dev/config.yaml +9 -0
  59. package/expansion-packs/bmad-2d-phaser-game-dev/data/bmad-kb.md +252 -0
  60. package/expansion-packs/bmad-2d-phaser-game-dev/data/development-guidelines.md +649 -0
  61. package/expansion-packs/bmad-2d-phaser-game-dev/tasks/advanced-elicitation.md +112 -0
  62. package/expansion-packs/bmad-2d-phaser-game-dev/tasks/create-game-story.md +218 -0
  63. package/expansion-packs/bmad-2d-phaser-game-dev/tasks/game-design-brainstorming.md +292 -0
  64. package/expansion-packs/bmad-2d-phaser-game-dev/templates/game-architecture-tmpl.yaml +614 -0
  65. package/expansion-packs/bmad-2d-phaser-game-dev/templates/game-brief-tmpl.yaml +357 -0
  66. package/expansion-packs/bmad-2d-phaser-game-dev/templates/game-design-doc-tmpl.yaml +344 -0
  67. package/expansion-packs/bmad-2d-phaser-game-dev/templates/game-story-tmpl.yaml +254 -0
  68. package/expansion-packs/bmad-2d-phaser-game-dev/templates/level-design-doc-tmpl.yaml +485 -0
  69. package/expansion-packs/bmad-2d-phaser-game-dev/workflows/game-dev-greenfield.yaml +184 -0
  70. package/expansion-packs/bmad-2d-phaser-game-dev/workflows/game-prototype.yaml +176 -0
  71. package/expansion-packs/bmad-2d-unity-game-dev/agent-teams/unity-2d-game-team.yaml +15 -0
  72. package/expansion-packs/bmad-2d-unity-game-dev/agents/game-architect.md +82 -0
  73. package/expansion-packs/bmad-2d-unity-game-dev/agents/game-designer.md +79 -0
  74. package/expansion-packs/bmad-2d-unity-game-dev/agents/game-developer.md +80 -0
  75. package/expansion-packs/bmad-2d-unity-game-dev/agents/game-sm.md +67 -0
  76. package/expansion-packs/bmad-2d-unity-game-dev/checklists/game-architect-checklist.md +393 -0
  77. package/expansion-packs/bmad-2d-unity-game-dev/checklists/game-change-checklist.md +205 -0
  78. package/expansion-packs/bmad-2d-unity-game-dev/checklists/game-design-checklist.md +203 -0
  79. package/expansion-packs/bmad-2d-unity-game-dev/checklists/game-story-dod-checklist.md +126 -0
  80. package/expansion-packs/bmad-2d-unity-game-dev/config.yaml +7 -0
  81. package/expansion-packs/bmad-2d-unity-game-dev/data/bmad-kb.md +771 -0
  82. package/expansion-packs/bmad-2d-unity-game-dev/data/development-guidelines.md +588 -0
  83. package/expansion-packs/bmad-2d-unity-game-dev/tasks/advanced-elicitation.md +112 -0
  84. package/expansion-packs/bmad-2d-unity-game-dev/tasks/correct-course-game.md +143 -0
  85. package/expansion-packs/bmad-2d-unity-game-dev/tasks/create-game-story.md +186 -0
  86. package/expansion-packs/bmad-2d-unity-game-dev/tasks/game-design-brainstorming.md +292 -0
  87. package/expansion-packs/bmad-2d-unity-game-dev/tasks/validate-game-story.md +202 -0
  88. package/expansion-packs/bmad-2d-unity-game-dev/templates/game-architecture-tmpl.yaml +1031 -0
  89. package/expansion-packs/bmad-2d-unity-game-dev/templates/game-brief-tmpl.yaml +357 -0
  90. package/expansion-packs/bmad-2d-unity-game-dev/templates/game-design-doc-tmpl.yaml +706 -0
  91. package/expansion-packs/bmad-2d-unity-game-dev/templates/game-story-tmpl.yaml +257 -0
  92. package/expansion-packs/bmad-2d-unity-game-dev/templates/level-design-doc-tmpl.yaml +485 -0
  93. package/expansion-packs/bmad-2d-unity-game-dev/workflows/game-dev-greenfield.yaml +184 -0
  94. package/expansion-packs/bmad-2d-unity-game-dev/workflows/game-prototype.yaml +176 -0
  95. package/expansion-packs/bmad-creative-writing/README.md +146 -0
  96. package/expansion-packs/bmad-creative-writing/agent-teams/agent-team.yaml +20 -0
  97. package/expansion-packs/bmad-creative-writing/agents/beta-reader.md +94 -0
  98. package/expansion-packs/bmad-creative-writing/agents/book-critic.md +40 -0
  99. package/expansion-packs/bmad-creative-writing/agents/character-psychologist.md +93 -0
  100. package/expansion-packs/bmad-creative-writing/agents/cover-designer.md +46 -0
  101. package/expansion-packs/bmad-creative-writing/agents/dialog-specialist.md +92 -0
  102. package/expansion-packs/bmad-creative-writing/agents/editor.md +93 -0
  103. package/expansion-packs/bmad-creative-writing/agents/genre-specialist.md +95 -0
  104. package/expansion-packs/bmad-creative-writing/agents/narrative-designer.md +93 -0
  105. package/expansion-packs/bmad-creative-writing/agents/plot-architect.md +95 -0
  106. package/expansion-packs/bmad-creative-writing/agents/world-builder.md +94 -0
  107. package/expansion-packs/bmad-creative-writing/checklists/beta-feedback-closure-checklist.md +23 -0
  108. package/expansion-packs/bmad-creative-writing/checklists/character-consistency-checklist.md +23 -0
  109. package/expansion-packs/bmad-creative-writing/checklists/comedic-timing-checklist.md +23 -0
  110. package/expansion-packs/bmad-creative-writing/checklists/cyberpunk-aesthetic-checklist.md +23 -0
  111. package/expansion-packs/bmad-creative-writing/checklists/ebook-formatting-checklist.md +21 -0
  112. package/expansion-packs/bmad-creative-writing/checklists/epic-poetry-meter-checklist.md +23 -0
  113. package/expansion-packs/bmad-creative-writing/checklists/fantasy-magic-system-checklist.md +23 -0
  114. package/expansion-packs/bmad-creative-writing/checklists/foreshadowing-payoff-checklist.md +22 -0
  115. package/expansion-packs/bmad-creative-writing/checklists/genre-tropes-checklist.md +22 -0
  116. package/expansion-packs/bmad-creative-writing/checklists/historical-accuracy-checklist.md +23 -0
  117. package/expansion-packs/bmad-creative-writing/checklists/horror-suspense-checklist.md +23 -0
  118. package/expansion-packs/bmad-creative-writing/checklists/kdp-cover-ready-checklist.md +25 -0
  119. package/expansion-packs/bmad-creative-writing/checklists/line-edit-quality-checklist.md +23 -0
  120. package/expansion-packs/bmad-creative-writing/checklists/marketing-copy-checklist.md +23 -0
  121. package/expansion-packs/bmad-creative-writing/checklists/mystery-clue-trail-checklist.md +23 -0
  122. package/expansion-packs/bmad-creative-writing/checklists/orbital-mechanics-checklist.md +23 -0
  123. package/expansion-packs/bmad-creative-writing/checklists/plot-structure-checklist.md +59 -0
  124. package/expansion-packs/bmad-creative-writing/checklists/publication-readiness-checklist.md +23 -0
  125. package/expansion-packs/bmad-creative-writing/checklists/romance-emotional-beats-checklist.md +23 -0
  126. package/expansion-packs/bmad-creative-writing/checklists/scene-quality-checklist.md +23 -0
  127. package/expansion-packs/bmad-creative-writing/checklists/scifi-technology-plausibility-checklist.md +22 -0
  128. package/expansion-packs/bmad-creative-writing/checklists/sensitivity-representation-checklist.md +23 -0
  129. package/expansion-packs/bmad-creative-writing/checklists/steampunk-gadget-checklist.md +23 -0
  130. package/expansion-packs/bmad-creative-writing/checklists/thriller-pacing-stakes-checklist.md +23 -0
  131. package/expansion-packs/bmad-creative-writing/checklists/timeline-continuity-checklist.md +23 -0
  132. package/expansion-packs/bmad-creative-writing/checklists/world-building-continuity-checklist.md +23 -0
  133. package/expansion-packs/bmad-creative-writing/checklists/ya-appropriateness-checklist.md +23 -0
  134. package/expansion-packs/bmad-creative-writing/config.yaml +12 -0
  135. package/expansion-packs/bmad-creative-writing/data/bmad-kb.md +209 -0
  136. package/expansion-packs/bmad-creative-writing/data/story-structures.md +67 -0
  137. package/expansion-packs/bmad-creative-writing/docs/brief.md +212 -0
  138. package/expansion-packs/bmad-creative-writing/tasks/advanced-elicitation.md +119 -0
  139. package/expansion-packs/bmad-creative-writing/tasks/analyze-reader-feedback.md +23 -0
  140. package/expansion-packs/bmad-creative-writing/tasks/analyze-story-structure.md +67 -0
  141. package/expansion-packs/bmad-creative-writing/tasks/assemble-kdp-package.md +29 -0
  142. package/expansion-packs/bmad-creative-writing/tasks/brainstorm-premise.md +23 -0
  143. package/expansion-packs/bmad-creative-writing/tasks/build-world.md +24 -0
  144. package/expansion-packs/bmad-creative-writing/tasks/character-depth-pass.md +22 -0
  145. package/expansion-packs/bmad-creative-writing/tasks/create-doc.md +103 -0
  146. package/expansion-packs/bmad-creative-writing/tasks/create-draft-section.md +26 -0
  147. package/expansion-packs/bmad-creative-writing/tasks/critical-review.md +26 -0
  148. package/expansion-packs/bmad-creative-writing/tasks/develop-character.md +24 -0
  149. package/expansion-packs/bmad-creative-writing/tasks/execute-checklist.md +88 -0
  150. package/expansion-packs/bmad-creative-writing/tasks/expand-premise.md +23 -0
  151. package/expansion-packs/bmad-creative-writing/tasks/expand-synopsis.md +23 -0
  152. package/expansion-packs/bmad-creative-writing/tasks/final-polish.md +23 -0
  153. package/expansion-packs/bmad-creative-writing/tasks/generate-cover-brief.md +25 -0
  154. package/expansion-packs/bmad-creative-writing/tasks/generate-cover-prompts.md +26 -0
  155. package/expansion-packs/bmad-creative-writing/tasks/generate-scene-list.md +23 -0
  156. package/expansion-packs/bmad-creative-writing/tasks/incorporate-feedback.md +25 -0
  157. package/expansion-packs/bmad-creative-writing/tasks/outline-scenes.md +23 -0
  158. package/expansion-packs/bmad-creative-writing/tasks/provide-feedback.md +24 -0
  159. package/expansion-packs/bmad-creative-writing/tasks/publish-chapter.md +23 -0
  160. package/expansion-packs/bmad-creative-writing/tasks/quick-feedback.md +22 -0
  161. package/expansion-packs/bmad-creative-writing/tasks/select-next-arc.md +23 -0
  162. package/expansion-packs/bmad-creative-writing/tasks/workshop-dialog.md +64 -0
  163. package/expansion-packs/bmad-creative-writing/templates/beta-feedback-form.yaml +97 -0
  164. package/expansion-packs/bmad-creative-writing/templates/chapter-draft-tmpl.yaml +82 -0
  165. package/expansion-packs/bmad-creative-writing/templates/character-profile-tmpl.yaml +92 -0
  166. package/expansion-packs/bmad-creative-writing/templates/cover-design-brief-tmpl.yaml +98 -0
  167. package/expansion-packs/bmad-creative-writing/templates/premise-brief-tmpl.yaml +78 -0
  168. package/expansion-packs/bmad-creative-writing/templates/scene-list-tmpl.yaml +55 -0
  169. package/expansion-packs/bmad-creative-writing/templates/story-outline-tmpl.yaml +96 -0
  170. package/expansion-packs/bmad-creative-writing/templates/world-guide-tmpl.yaml +89 -0
  171. package/expansion-packs/bmad-creative-writing/workflows/book-cover-design-workflow.md +218 -0
  172. package/expansion-packs/bmad-creative-writing/workflows/novel-greenfield-workflow.yaml +56 -0
  173. package/expansion-packs/bmad-creative-writing/workflows/novel-serial-workflow.yaml +50 -0
  174. package/expansion-packs/bmad-creative-writing/workflows/novel-snowflake-workflow.yaml +69 -0
  175. package/expansion-packs/bmad-creative-writing/workflows/novel-writing.yaml +91 -0
  176. package/expansion-packs/bmad-creative-writing/workflows/screenplay-development.yaml +85 -0
  177. package/expansion-packs/bmad-creative-writing/workflows/series-planning.yaml +78 -0
  178. package/expansion-packs/bmad-creative-writing/workflows/short-story-creation.yaml +64 -0
  179. package/expansion-packs/bmad-infrastructure-devops/README.md +147 -0
  180. package/expansion-packs/bmad-infrastructure-devops/agents/infra-devops-platform.md +73 -0
  181. package/expansion-packs/bmad-infrastructure-devops/checklists/infrastructure-checklist.md +486 -0
  182. package/expansion-packs/bmad-infrastructure-devops/config.yaml +10 -0
  183. package/expansion-packs/bmad-infrastructure-devops/data/bmad-kb.md +307 -0
  184. package/expansion-packs/bmad-infrastructure-devops/tasks/review-infrastructure.md +161 -0
  185. package/expansion-packs/bmad-infrastructure-devops/tasks/validate-infrastructure.md +155 -0
  186. package/expansion-packs/bmad-infrastructure-devops/templates/infrastructure-architecture-tmpl.yaml +425 -0
  187. package/expansion-packs/bmad-infrastructure-devops/templates/infrastructure-platform-from-arch-tmpl.yaml +630 -0
  188. package/implement-fork-friendly-ci.sh +229 -0
  189. package/package.json +75 -45
  190. package/prettier.config.mjs +32 -0
  191. package/test.md +1 -0
  192. package/tools/builders/web-builder.js +128 -129
  193. package/tools/bump-all-versions.js +42 -33
  194. package/tools/bump-expansion-version.js +23 -16
  195. package/tools/cli.js +15 -15
  196. package/tools/flattener/aggregate.js +76 -0
  197. package/tools/flattener/binary.js +80 -0
  198. package/tools/flattener/discovery.js +71 -0
  199. package/tools/flattener/files.js +35 -0
  200. package/tools/flattener/ignoreRules.js +176 -0
  201. package/tools/flattener/main.js +458 -460
  202. package/tools/flattener/projectRoot.js +206 -0
  203. package/tools/flattener/prompts.js +44 -0
  204. package/tools/flattener/stats.helpers.js +395 -0
  205. package/tools/flattener/stats.js +80 -0
  206. package/tools/flattener/test-matrix.js +413 -0
  207. package/tools/flattener/xml.js +88 -0
  208. package/tools/installer/README.md +1 -1
  209. package/tools/installer/bin/xiaoma.js +377 -137
  210. package/tools/installer/config/ide-agent-config.yaml +3 -3
  211. package/tools/installer/config/install.config.yaml +73 -22
  212. package/tools/installer/lib/config-loader.js +48 -44
  213. package/tools/installer/lib/file-manager.js +91 -116
  214. package/tools/installer/lib/ide-base-setup.js +57 -56
  215. package/tools/installer/lib/ide-setup.js +816 -407
  216. package/tools/installer/lib/installer.js +915 -690
  217. package/tools/installer/lib/memory-profiler.js +54 -53
  218. package/tools/installer/lib/module-manager.js +19 -15
  219. package/tools/installer/lib/resource-locator.js +26 -28
  220. package/tools/installer/package-lock.json +67 -56
  221. package/tools/installer/package.json +24 -23
  222. package/tools/lib/dependency-resolver.js +30 -34
  223. package/tools/lib/yaml-utils.js +7 -7
  224. package/tools/md-assets/web-agent-startup-instructions.md +1 -1
  225. package/tools/preview-release-notes.js +66 -0
  226. package/tools/setup-hooks.sh +37 -0
  227. package/tools/shared/bannerArt.js +105 -0
  228. package/tools/sync-installer-version.js +7 -9
  229. package/tools/sync-version.sh +23 -0
  230. package/tools/update-expansion-version.js +14 -15
  231. package/tools/upgraders/v3-to-v4-upgrader.js +208 -299
  232. package/tools/version-bump.js +41 -26
  233. package/tools/xiaoma-npx-wrapper.js +11 -11
  234. package/tools/yaml-format.js +56 -43
  235. package/xiaoma-core/agent-teams/team-all.yaml +2 -1
  236. package/xiaoma-core/agent-teams/team-fullstack.yaml +1 -0
  237. package/xiaoma-core/agent-teams/team-ide-minimal.yaml +1 -0
  238. package/xiaoma-core/agent-teams/team-no-ui.yaml +1 -0
  239. package/xiaoma-core/agents/analyst.md +20 -17
  240. package/xiaoma-core/agents/architect.md +15 -14
  241. package/xiaoma-core/agents/dev.md +23 -18
  242. package/xiaoma-core/agents/pm.md +18 -15
  243. package/xiaoma-core/agents/po.md +13 -10
  244. package/xiaoma-core/agents/qa.md +46 -24
  245. package/xiaoma-core/agents/sm.md +11 -8
  246. package/xiaoma-core/agents/ux-expert.md +10 -7
  247. package/xiaoma-core/agents/xiaoma-master.md +24 -22
  248. package/xiaoma-core/agents/xiaoma-orchestrator.md +30 -33
  249. package/xiaoma-core/checklists/architect-checklist.md +2 -5
  250. package/xiaoma-core/checklists/change-checklist.md +4 -2
  251. package/xiaoma-core/checklists/pm-checklist.md +2 -5
  252. package/xiaoma-core/checklists/po-master-checklist.md +2 -9
  253. package/xiaoma-core/checklists/story-dod-checklist.md +2 -7
  254. package/xiaoma-core/checklists/story-draft-checklist.md +2 -3
  255. package/xiaoma-core/core-config.yaml +4 -1
  256. package/xiaoma-core/data/{xiaoma-kb.md → bmad-kb.md} +43 -37
  257. package/xiaoma-core/data/brainstorming-techniques.md +2 -0
  258. package/xiaoma-core/data/elicitation-methods.md +22 -0
  259. package/xiaoma-core/data/technical-preferences.md +2 -0
  260. package/xiaoma-core/data/test-levels-framework.md +148 -0
  261. package/xiaoma-core/data/test-priorities-matrix.md +174 -0
  262. package/xiaoma-core/tasks/advanced-elicitation.md +2 -0
  263. package/xiaoma-core/tasks/apply-qa-fixes.md +150 -0
  264. package/xiaoma-core/tasks/brownfield-create-epic.md +2 -0
  265. package/xiaoma-core/tasks/brownfield-create-story.md +2 -0
  266. package/xiaoma-core/tasks/correct-course.md +2 -0
  267. package/xiaoma-core/tasks/create-brownfield-story.md +14 -4
  268. package/xiaoma-core/tasks/create-deep-research-prompt.md +2 -11
  269. package/xiaoma-core/tasks/create-next-story.md +3 -1
  270. package/xiaoma-core/tasks/document-project.md +17 -13
  271. package/xiaoma-core/tasks/facilitate-brainstorming-session.md +5 -3
  272. package/xiaoma-core/tasks/generate-ai-frontend-prompt.md +2 -0
  273. package/xiaoma-core/tasks/index-docs.md +2 -6
  274. package/xiaoma-core/tasks/kb-mode-interaction.md +17 -15
  275. package/xiaoma-core/tasks/nfr-assess.md +345 -0
  276. package/xiaoma-core/tasks/qa-gate.md +163 -0
  277. package/xiaoma-core/tasks/review-story.md +245 -74
  278. package/xiaoma-core/tasks/risk-profile.md +355 -0
  279. package/xiaoma-core/tasks/shard-doc.md +2 -2
  280. package/xiaoma-core/tasks/test-design.md +176 -0
  281. package/xiaoma-core/tasks/trace-requirements.md +266 -0
  282. package/xiaoma-core/tasks/validate-next-story.md +2 -0
  283. package/xiaoma-core/templates/architecture-tmpl.yaml +50 -49
  284. package/xiaoma-core/templates/brainstorming-output-tmpl.yaml +5 -5
  285. package/xiaoma-core/templates/brownfield-architecture-tmpl.yaml +32 -31
  286. package/xiaoma-core/templates/brownfield-prd-tmpl.yaml +14 -13
  287. package/xiaoma-core/templates/competitor-analysis-tmpl.yaml +20 -6
  288. package/xiaoma-core/templates/front-end-architecture-tmpl.yaml +22 -9
  289. package/xiaoma-core/templates/front-end-spec-tmpl.yaml +25 -24
  290. package/xiaoma-core/templates/fullstack-architecture-tmpl.yaml +123 -104
  291. package/xiaoma-core/templates/market-research-tmpl.yaml +3 -2
  292. package/xiaoma-core/templates/prd-tmpl.yaml +10 -9
  293. package/xiaoma-core/templates/project-brief-tmpl.yaml +5 -4
  294. package/xiaoma-core/templates/qa-gate-tmpl.yaml +103 -0
  295. package/xiaoma-core/templates/story-tmpl.yaml +13 -12
  296. package/xiaoma-core/workflows/brownfield-fullstack.yaml +13 -12
  297. package/xiaoma-core/workflows/brownfield-service.yaml +5 -4
  298. package/xiaoma-core/workflows/brownfield-ui.yaml +5 -4
  299. package/xiaoma-core/workflows/greenfield-fullstack.yaml +7 -6
  300. package/xiaoma-core/workflows/greenfield-service.yaml +5 -4
  301. package/xiaoma-core/workflows/greenfield-ui.yaml +6 -5
  302. package/.releaserc.json +0 -18
  303. package/.vscode/settings.json +0 -44
  304. package/XiaoMa-Web/345/244/232/346/231/272/350/203/275/344/275/2230-1/351/241/271/347/233/256/345/274/200/345/217/221/345/256/214/346/225/264/346/214/207/345/215/227.md +0 -977
  305. package/XiaoMa-Web/347/216/260/346/234/211/351/241/271/347/233/256/351/234/200/346/261/202/345/274/200/345/217/221/345/256/214/346/225/264/346/214/207/345/215/227.md +0 -873
  306. package/XiaoMa-Web/347/272/257/345/211/215/347/253/257/351/241/271/347/233/256Claude-Code/345/274/200/345/217/221/345/256/214/346/225/264/346/214/207/345/215/227.md +0 -372
  307. package/XiaoMa-Web/351/241/271/347/233/256/346/200/273/347/273/223/346/212/245/345/221/212.md +0 -310
  308. package/dist/agents/dev-cn.txt +0 -428
  309. package/docs/quick-start.md +0 -179
  310. package/tools/bmad-npx-wrapper.js +0 -39
  311. package/tools/semantic-release-sync-installer.js +0 -30
  312. package/xiaoma-core/bmad-core/user-guide.md +0 -0
  313. package/xiaoma-core/enhanced-ide-development-workflow.md +0 -43
  314. package/xiaoma-core/user-guide.md +0 -251
  315. package/xiaoma-core/working-in-the-brownfield.md +0 -364
@@ -1,23 +1,23 @@
1
- const fs = require("node:fs").promises;
2
- const path = require("node:path");
3
- const DependencyResolver = require("../lib/dependency-resolver");
4
- const yamlUtils = require("../lib/yaml-utils");
1
+ const fs = require('node:fs').promises;
2
+ const path = require('node:path');
3
+ const DependencyResolver = require('../lib/dependency-resolver');
4
+ const yamlUtilities = require('../lib/yaml-utils');
5
5
 
6
6
  class WebBuilder {
7
7
  constructor(options = {}) {
8
8
  this.rootDir = options.rootDir || process.cwd();
9
- this.outputDirs = options.outputDirs || [path.join(this.rootDir, "dist")];
9
+ this.outputDirs = options.outputDirs || [path.join(this.rootDir, 'dist')];
10
10
  this.resolver = new DependencyResolver(this.rootDir);
11
11
  this.templatePath = path.join(
12
12
  this.rootDir,
13
- "tools",
14
- "md-assets",
15
- "web-agent-startup-instructions.md"
13
+ 'tools',
14
+ 'md-assets',
15
+ 'web-agent-startup-instructions.md',
16
16
  );
17
17
  }
18
18
 
19
19
  parseYaml(content) {
20
- const yaml = require("js-yaml");
20
+ const yaml = require('js-yaml');
21
21
  return yaml.load(content);
22
22
  }
23
23
 
@@ -26,7 +26,7 @@ class WebBuilder {
26
26
  // All resources get installed under the bundle root, so use that path
27
27
  const relativePath = path.relative(this.rootDir, filePath);
28
28
  const pathParts = relativePath.split(path.sep);
29
-
29
+
30
30
  let resourcePath;
31
31
  if (pathParts[0] === 'expansion-packs') {
32
32
  // For expansion packs, remove 'expansion-packs/packname' and use the rest
@@ -35,22 +35,32 @@ class WebBuilder {
35
35
  // For xiaoma-core, common, etc., remove the first part
36
36
  resourcePath = pathParts.slice(1).join('/');
37
37
  }
38
-
38
+
39
39
  return `.${bundleRoot}/${resourcePath}`;
40
40
  }
41
41
 
42
42
  generateWebInstructions(bundleType, packName = null) {
43
43
  // Generate dynamic web instructions based on bundle type
44
44
  const rootExample = packName ? `.${packName}` : '.xiaoma-core';
45
- const examplePath = packName ? `.${packName}/folder/filename.md` : '.xiaoma-core/folder/filename.md';
46
- const personasExample = packName ? `.${packName}/personas/analyst.md` : '.xiaoma-core/personas/analyst.md';
47
- const tasksExample = packName ? `.${packName}/tasks/create-story.md` : '.xiaoma-core/tasks/create-story.md';
48
- const utilsExample = packName ? `.${packName}/utils/template-format.md` : '.xiaoma-core/utils/template-format.md';
49
- const tasksRef = packName ? `.${packName}/tasks/create-story.md` : '.xiaoma-core/tasks/create-story.md';
45
+ const examplePath = packName
46
+ ? `.${packName}/folder/filename.md`
47
+ : '.xiaoma-core/folder/filename.md';
48
+ const personasExample = packName
49
+ ? `.${packName}/personas/analyst.md`
50
+ : '.xiaoma-core/personas/analyst.md';
51
+ const tasksExample = packName
52
+ ? `.${packName}/tasks/create-story.md`
53
+ : '.xiaoma-core/tasks/create-story.md';
54
+ const utilitiesExample = packName
55
+ ? `.${packName}/utils/template-format.md`
56
+ : '.xiaoma-core/utils/template-format.md';
57
+ const tasksReference = packName
58
+ ? `.${packName}/tasks/create-story.md`
59
+ : '.xiaoma-core/tasks/create-story.md';
50
60
 
51
61
  return `# Web Agent Bundle Instructions
52
62
 
53
- You are now operating as a specialized AI agent from the XiaoMa-Method framework. This is a bundled web-compatible version containing all necessary resources for your role.
63
+ You are now operating as a specialized AI agent from the BMad-Method framework. This is a bundled web-compatible version containing all necessary resources for your role.
54
64
 
55
65
  ## Important Instructions
56
66
 
@@ -79,12 +89,12 @@ dependencies:
79
89
 
80
90
  These references map directly to bundle sections:
81
91
 
82
- - \`utils: template-format\` → Look for \`==================== START: ${utilsExample} ====================\`
83
- - \`tasks: create-story\` → Look for \`==================== START: ${tasksRef} ====================\`
92
+ - \`utils: template-format\` → Look for \`==================== START: ${utilitiesExample} ====================\`
93
+ - \`tasks: create-story\` → Look for \`==================== START: ${tasksReference} ====================\`
84
94
 
85
95
  3. **Execution Context**: You are operating in a web environment. All your capabilities and knowledge are contained within this bundle. Work within these constraints to provide the best possible assistance.
86
96
 
87
- 4. **Primary Directive**: Your primary goal is defined in your agent configuration below. Focus on fulfilling your designated role according to the XiaoMa-Method framework.
97
+ 4. **Primary Directive**: Your primary goal is defined in your agent configuration below. Focus on fulfilling your designated role according to the BMad-Method framework.
88
98
 
89
99
  ---
90
100
 
@@ -112,10 +122,10 @@ These references map directly to bundle sections:
112
122
 
113
123
  // Write to all output directories
114
124
  for (const outputDir of this.outputDirs) {
115
- const outputPath = path.join(outputDir, "agents");
125
+ const outputPath = path.join(outputDir, 'agents');
116
126
  await fs.mkdir(outputPath, { recursive: true });
117
127
  const outputFile = path.join(outputPath, `${agentId}.txt`);
118
- await fs.writeFile(outputFile, bundle, "utf8");
128
+ await fs.writeFile(outputFile, bundle, 'utf8');
119
129
  }
120
130
  }
121
131
 
@@ -131,10 +141,10 @@ These references map directly to bundle sections:
131
141
 
132
142
  // Write to all output directories
133
143
  for (const outputDir of this.outputDirs) {
134
- const outputPath = path.join(outputDir, "teams");
144
+ const outputPath = path.join(outputDir, 'teams');
135
145
  await fs.mkdir(outputPath, { recursive: true });
136
146
  const outputFile = path.join(outputPath, `${teamId}.txt`);
137
- await fs.writeFile(outputFile, bundle, "utf8");
147
+ await fs.writeFile(outputFile, bundle, 'utf8');
138
148
  }
139
149
  }
140
150
 
@@ -157,7 +167,7 @@ These references map directly to bundle sections:
157
167
  sections.push(this.formatSection(resourcePath, resource.content, 'xiaoma-core'));
158
168
  }
159
169
 
160
- return sections.join("\n");
170
+ return sections.join('\n');
161
171
  }
162
172
 
163
173
  async buildTeamBundle(teamId) {
@@ -182,40 +192,40 @@ These references map directly to bundle sections:
182
192
  sections.push(this.formatSection(resourcePath, resource.content, 'xiaoma-core'));
183
193
  }
184
194
 
185
- return sections.join("\n");
195
+ return sections.join('\n');
186
196
  }
187
197
 
188
198
  processAgentContent(content) {
189
199
  // First, replace content before YAML with the template
190
- const yamlContent = yamlUtils.extractYamlFromAgent(content);
200
+ const yamlContent = yamlUtilities.extractYamlFromAgent(content);
191
201
  if (!yamlContent) return content;
192
202
 
193
203
  const yamlMatch = content.match(/```ya?ml\n([\s\S]*?)\n```/);
194
204
  if (!yamlMatch) return content;
195
-
205
+
196
206
  const yamlStartIndex = content.indexOf(yamlMatch[0]);
197
207
  const yamlEndIndex = yamlStartIndex + yamlMatch[0].length;
198
208
 
199
209
  // Parse YAML and remove root and IDE-FILE-RESOLUTION properties
200
210
  try {
201
- const yaml = require("js-yaml");
211
+ const yaml = require('js-yaml');
202
212
  const parsed = yaml.load(yamlContent);
203
213
 
204
214
  // Remove the properties if they exist at root level
205
215
  delete parsed.root;
206
- delete parsed["IDE-FILE-RESOLUTION"];
207
- delete parsed["REQUEST-RESOLUTION"];
216
+ delete parsed['IDE-FILE-RESOLUTION'];
217
+ delete parsed['REQUEST-RESOLUTION'];
208
218
 
209
219
  // Also remove from activation-instructions if they exist
210
- if (parsed["activation-instructions"] && Array.isArray(parsed["activation-instructions"])) {
211
- parsed["activation-instructions"] = parsed["activation-instructions"].filter(
220
+ if (parsed['activation-instructions'] && Array.isArray(parsed['activation-instructions'])) {
221
+ parsed['activation-instructions'] = parsed['activation-instructions'].filter(
212
222
  (instruction) => {
213
223
  return (
214
224
  typeof instruction === 'string' &&
215
- !instruction.startsWith("IDE-FILE-RESOLUTION:") &&
216
- !instruction.startsWith("REQUEST-RESOLUTION:")
225
+ !instruction.startsWith('IDE-FILE-RESOLUTION:') &&
226
+ !instruction.startsWith('REQUEST-RESOLUTION:')
217
227
  );
218
- }
228
+ },
219
229
  );
220
230
  }
221
231
 
@@ -223,25 +233,25 @@ These references map directly to bundle sections:
223
233
  const cleanedYaml = yaml.dump(parsed, { lineWidth: -1 });
224
234
 
225
235
  // Get the agent name from the YAML for the header
226
- const agentName = parsed.agent?.id || "agent";
236
+ const agentName = parsed.agent?.id || 'agent';
227
237
 
228
238
  // Build the new content with just the agent header and YAML
229
239
  const newHeader = `# ${agentName}\n\nCRITICAL: 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`;
230
- const afterYaml = content.substring(yamlEndIndex);
240
+ const afterYaml = content.slice(Math.max(0, yamlEndIndex));
231
241
 
232
- return newHeader + "```yaml\n" + cleanedYaml.trim() + "\n```" + afterYaml;
242
+ return newHeader + '```yaml\n' + cleanedYaml.trim() + '\n```' + afterYaml;
233
243
  } catch (error) {
234
- console.warn("Failed to process agent YAML:", error.message);
244
+ console.warn('Failed to process agent YAML:', error.message);
235
245
  // If parsing fails, return original content
236
246
  return content;
237
247
  }
238
248
  }
239
249
 
240
250
  formatSection(path, content, bundleRoot = 'xiaoma-core') {
241
- const separator = "====================";
251
+ const separator = '====================';
242
252
 
243
253
  // Process agent content if this is an agent file
244
- if (path.includes("/agents/")) {
254
+ if (path.includes('/agents/')) {
245
255
  content = this.processAgentContent(content);
246
256
  }
247
257
 
@@ -252,17 +262,17 @@ These references map directly to bundle sections:
252
262
  `${separator} START: ${path} ${separator}`,
253
263
  content.trim(),
254
264
  `${separator} END: ${path} ${separator}`,
255
- "",
256
- ].join("\n");
265
+ '',
266
+ ].join('\n');
257
267
  }
258
268
 
259
269
  replaceRootReferences(content, bundleRoot) {
260
270
  // Replace {root} with the appropriate bundle root path
261
- return content.replace(/\{root\}/g, `.${bundleRoot}`);
271
+ return content.replaceAll('{root}', `.${bundleRoot}`);
262
272
  }
263
273
 
264
274
  async validate() {
265
- console.log("Validating agent configurations...");
275
+ console.log('Validating agent configurations...');
266
276
  const agents = await this.resolver.listAgents();
267
277
  for (const agentId of agents) {
268
278
  try {
@@ -274,7 +284,7 @@ These references map directly to bundle sections:
274
284
  }
275
285
  }
276
286
 
277
- console.log("\nValidating team configurations...");
287
+ console.log('\nValidating team configurations...');
278
288
  const teams = await this.resolver.listTeams();
279
289
  for (const teamId of teams) {
280
290
  try {
@@ -299,54 +309,54 @@ These references map directly to bundle sections:
299
309
  }
300
310
 
301
311
  async buildExpansionPack(packName, options = {}) {
302
- const packDir = path.join(this.rootDir, "expansion-packs", packName);
303
- const outputDirs = [path.join(this.rootDir, "dist", "expansion-packs", packName)];
312
+ const packDir = path.join(this.rootDir, 'expansion-packs', packName);
313
+ const outputDirectories = [path.join(this.rootDir, 'dist', 'expansion-packs', packName)];
304
314
 
305
315
  // Clean output directories if requested
306
316
  if (options.clean !== false) {
307
- for (const outputDir of outputDirs) {
317
+ for (const outputDir of outputDirectories) {
308
318
  try {
309
319
  await fs.rm(outputDir, { recursive: true, force: true });
310
- } catch (error) {
320
+ } catch {
311
321
  // Directory might not exist, that's fine
312
322
  }
313
323
  }
314
324
  }
315
325
 
316
326
  // Build individual agents first
317
- const agentsDir = path.join(packDir, "agents");
327
+ const agentsDir = path.join(packDir, 'agents');
318
328
  try {
319
329
  const agentFiles = await fs.readdir(agentsDir);
320
- const agentMarkdownFiles = agentFiles.filter((f) => f.endsWith(".md"));
330
+ const agentMarkdownFiles = agentFiles.filter((f) => f.endsWith('.md'));
321
331
 
322
332
  if (agentMarkdownFiles.length > 0) {
323
333
  console.log(` Building individual agents for ${packName}:`);
324
334
 
325
335
  for (const agentFile of agentMarkdownFiles) {
326
- const agentName = agentFile.replace(".md", "");
336
+ const agentName = agentFile.replace('.md', '');
327
337
  console.log(` - ${agentName}`);
328
338
 
329
339
  // Build individual agent bundle
330
340
  const bundle = await this.buildExpansionAgentBundle(packName, packDir, agentName);
331
341
 
332
342
  // Write to all output directories
333
- for (const outputDir of outputDirs) {
334
- const agentsOutputDir = path.join(outputDir, "agents");
343
+ for (const outputDir of outputDirectories) {
344
+ const agentsOutputDir = path.join(outputDir, 'agents');
335
345
  await fs.mkdir(agentsOutputDir, { recursive: true });
336
346
  const outputFile = path.join(agentsOutputDir, `${agentName}.txt`);
337
- await fs.writeFile(outputFile, bundle, "utf8");
347
+ await fs.writeFile(outputFile, bundle, 'utf8');
338
348
  }
339
349
  }
340
350
  }
341
- } catch (error) {
351
+ } catch {
342
352
  console.debug(` No agents directory found for ${packName}`);
343
353
  }
344
354
 
345
355
  // Build team bundle
346
- const agentTeamsDir = path.join(packDir, "agent-teams");
356
+ const agentTeamsDir = path.join(packDir, 'agent-teams');
347
357
  try {
348
358
  const teamFiles = await fs.readdir(agentTeamsDir);
349
- const teamFile = teamFiles.find((f) => f.endsWith(".yaml"));
359
+ const teamFile = teamFiles.find((f) => f.endsWith('.yaml'));
350
360
 
351
361
  if (teamFile) {
352
362
  console.log(` Building team bundle for ${packName}`);
@@ -356,17 +366,17 @@ These references map directly to bundle sections:
356
366
  const bundle = await this.buildExpansionTeamBundle(packName, packDir, teamConfigPath);
357
367
 
358
368
  // Write to all output directories
359
- for (const outputDir of outputDirs) {
360
- const teamsOutputDir = path.join(outputDir, "teams");
369
+ for (const outputDir of outputDirectories) {
370
+ const teamsOutputDir = path.join(outputDir, 'teams');
361
371
  await fs.mkdir(teamsOutputDir, { recursive: true });
362
- const outputFile = path.join(teamsOutputDir, teamFile.replace(".yaml", ".txt"));
363
- await fs.writeFile(outputFile, bundle, "utf8");
372
+ const outputFile = path.join(teamsOutputDir, teamFile.replace('.yaml', '.txt'));
373
+ await fs.writeFile(outputFile, bundle, 'utf8');
364
374
  console.log(` ✓ Created bundle: ${path.relative(this.rootDir, outputFile)}`);
365
375
  }
366
376
  } else {
367
377
  console.warn(` ⚠ No team configuration found in ${packName}/agent-teams/`);
368
378
  }
369
- } catch (error) {
379
+ } catch {
370
380
  console.warn(` ⚠ No agent-teams directory found for ${packName}`);
371
381
  }
372
382
  }
@@ -376,16 +386,16 @@ These references map directly to bundle sections:
376
386
  const sections = [template];
377
387
 
378
388
  // Add agent configuration
379
- const agentPath = path.join(packDir, "agents", `${agentName}.md`);
380
- const agentContent = await fs.readFile(agentPath, "utf8");
389
+ const agentPath = path.join(packDir, 'agents', `${agentName}.md`);
390
+ const agentContent = await fs.readFile(agentPath, 'utf8');
381
391
  const agentWebPath = this.convertToWebPath(agentPath, packName);
382
392
  sections.push(this.formatSection(agentWebPath, agentContent, packName));
383
393
 
384
394
  // Resolve and add agent dependencies
385
- const yamlContent = yamlUtils.extractYamlFromAgent(agentContent);
395
+ const yamlContent = yamlUtilities.extractYamlFromAgent(agentContent);
386
396
  if (yamlContent) {
387
397
  try {
388
- const yaml = require("js-yaml");
398
+ const yaml = require('js-yaml');
389
399
  const agentConfig = yaml.load(yamlContent);
390
400
 
391
401
  if (agentConfig.dependencies) {
@@ -398,13 +408,11 @@ These references map directly to bundle sections:
398
408
  // Try expansion pack first
399
409
  const resourcePath = path.join(packDir, resourceType, resourceName);
400
410
  try {
401
- const resourceContent = await fs.readFile(resourcePath, "utf8");
411
+ const resourceContent = await fs.readFile(resourcePath, 'utf8');
402
412
  const resourceWebPath = this.convertToWebPath(resourcePath, packName);
403
- sections.push(
404
- this.formatSection(resourceWebPath, resourceContent, packName)
405
- );
413
+ sections.push(this.formatSection(resourceWebPath, resourceContent, packName));
406
414
  found = true;
407
- } catch (error) {
415
+ } catch {
408
416
  // Not in expansion pack, continue
409
417
  }
410
418
 
@@ -412,45 +420,36 @@ These references map directly to bundle sections:
412
420
  if (!found) {
413
421
  const corePath = path.join(
414
422
  this.rootDir,
415
- "xiaoma-core",
423
+ 'xiaoma-core',
416
424
  resourceType,
417
- resourceName
425
+ resourceName,
418
426
  );
419
427
  try {
420
- const coreContent = await fs.readFile(corePath, "utf8");
428
+ const coreContent = await fs.readFile(corePath, 'utf8');
421
429
  const coreWebPath = this.convertToWebPath(corePath, packName);
422
- sections.push(
423
- this.formatSection(coreWebPath, coreContent, packName)
424
- );
430
+ sections.push(this.formatSection(coreWebPath, coreContent, packName));
425
431
  found = true;
426
- } catch (error) {
432
+ } catch {
427
433
  // Not in core either, continue
428
434
  }
429
435
  }
430
436
 
431
437
  // If not found in core, try common folder
432
438
  if (!found) {
433
- const commonPath = path.join(
434
- this.rootDir,
435
- "common",
436
- resourceType,
437
- resourceName
438
- );
439
+ const commonPath = path.join(this.rootDir, 'common', resourceType, resourceName);
439
440
  try {
440
- const commonContent = await fs.readFile(commonPath, "utf8");
441
+ const commonContent = await fs.readFile(commonPath, 'utf8');
441
442
  const commonWebPath = this.convertToWebPath(commonPath, packName);
442
- sections.push(
443
- this.formatSection(commonWebPath, commonContent, packName)
444
- );
443
+ sections.push(this.formatSection(commonWebPath, commonContent, packName));
445
444
  found = true;
446
- } catch (error) {
445
+ } catch {
447
446
  // Not in common either, continue
448
447
  }
449
448
  }
450
449
 
451
450
  if (!found) {
452
451
  console.warn(
453
- ` ⚠ Dependency ${resourceType}#${resourceName} not found in expansion pack or core`
452
+ ` ⚠ Dependency ${resourceType}#${resourceName} not found in expansion pack or core`,
454
453
  );
455
454
  }
456
455
  }
@@ -462,7 +461,7 @@ These references map directly to bundle sections:
462
461
  }
463
462
  }
464
463
 
465
- return sections.join("\n");
464
+ return sections.join('\n');
466
465
  }
467
466
 
468
467
  async buildExpansionTeamBundle(packName, packDir, teamConfigPath) {
@@ -471,38 +470,38 @@ These references map directly to bundle sections:
471
470
  const sections = [template];
472
471
 
473
472
  // Add team configuration and parse to get agent list
474
- const teamContent = await fs.readFile(teamConfigPath, "utf8");
475
- const teamFileName = path.basename(teamConfigPath, ".yaml");
473
+ const teamContent = await fs.readFile(teamConfigPath, 'utf8');
474
+ const teamFileName = path.basename(teamConfigPath, '.yaml');
476
475
  const teamConfig = this.parseYaml(teamContent);
477
476
  const teamWebPath = this.convertToWebPath(teamConfigPath, packName);
478
477
  sections.push(this.formatSection(teamWebPath, teamContent, packName));
479
478
 
480
479
  // Get list of expansion pack agents
481
480
  const expansionAgents = new Set();
482
- const agentsDir = path.join(packDir, "agents");
481
+ const agentsDir = path.join(packDir, 'agents');
483
482
  try {
484
483
  const agentFiles = await fs.readdir(agentsDir);
485
- for (const agentFile of agentFiles.filter((f) => f.endsWith(".md"))) {
486
- const agentName = agentFile.replace(".md", "");
484
+ for (const agentFile of agentFiles.filter((f) => f.endsWith('.md'))) {
485
+ const agentName = agentFile.replace('.md', '');
487
486
  expansionAgents.add(agentName);
488
487
  }
489
- } catch (error) {
488
+ } catch {
490
489
  console.warn(` ⚠ No agents directory found in ${packName}`);
491
490
  }
492
491
 
493
492
  // Build a map of all available expansion pack resources for override checking
494
493
  const expansionResources = new Map();
495
- const resourceDirs = ["templates", "tasks", "checklists", "workflows", "data"];
496
- for (const resourceDir of resourceDirs) {
494
+ const resourceDirectories = ['templates', 'tasks', 'checklists', 'workflows', 'data'];
495
+ for (const resourceDir of resourceDirectories) {
497
496
  const resourcePath = path.join(packDir, resourceDir);
498
497
  try {
499
498
  const resourceFiles = await fs.readdir(resourcePath);
500
499
  for (const resourceFile of resourceFiles.filter(
501
- (f) => f.endsWith(".md") || f.endsWith(".yaml")
500
+ (f) => f.endsWith('.md') || f.endsWith('.yaml'),
502
501
  )) {
503
502
  expansionResources.set(`${resourceDir}#${resourceFile}`, true);
504
503
  }
505
- } catch (error) {
504
+ } catch {
506
505
  // Directory might not exist, that's fine
507
506
  }
508
507
  }
@@ -511,9 +510,9 @@ These references map directly to bundle sections:
511
510
  const agentsToProcess = teamConfig.agents || [];
512
511
 
513
512
  // Ensure xiaoma-orchestrator is always included for teams
514
- if (!agentsToProcess.includes("xiaoma-orchestrator")) {
513
+ if (!agentsToProcess.includes('xiaoma-orchestrator')) {
515
514
  console.warn(` ⚠ Team ${teamFileName} missing xiaoma-orchestrator, adding automatically`);
516
- agentsToProcess.unshift("xiaoma-orchestrator");
515
+ agentsToProcess.unshift('xiaoma-orchestrator');
517
516
  }
518
517
 
519
518
  // Track all dependencies from all agents (deduplicated)
@@ -523,7 +522,7 @@ These references map directly to bundle sections:
523
522
  if (expansionAgents.has(agentId)) {
524
523
  // Use expansion pack version (override)
525
524
  const agentPath = path.join(agentsDir, `${agentId}.md`);
526
- const agentContent = await fs.readFile(agentPath, "utf8");
525
+ const agentContent = await fs.readFile(agentPath, 'utf8');
527
526
  const expansionAgentWebPath = this.convertToWebPath(agentPath, packName);
528
527
  sections.push(this.formatSection(expansionAgentWebPath, agentContent, packName));
529
528
 
@@ -549,15 +548,15 @@ These references map directly to bundle sections:
549
548
  }
550
549
  }
551
550
  } else {
552
- // Use core XiaoMa version
551
+ // Use core BMad version
553
552
  try {
554
- const coreAgentPath = path.join(this.rootDir, "xiaoma-core", "agents", `${agentId}.md`);
555
- const coreAgentContent = await fs.readFile(coreAgentPath, "utf8");
553
+ const coreAgentPath = path.join(this.rootDir, 'xiaoma-core', 'agents', `${agentId}.md`);
554
+ const coreAgentContent = await fs.readFile(coreAgentPath, 'utf8');
556
555
  const coreAgentWebPath = this.convertToWebPath(coreAgentPath, packName);
557
556
  sections.push(this.formatSection(coreAgentWebPath, coreAgentContent, packName));
558
557
 
559
558
  // Parse and collect dependencies from core agent
560
- const yamlContent = yamlUtils.extractYamlFromAgent(coreAgentContent, true);
559
+ const yamlContent = yamlUtilities.extractYamlFromAgent(coreAgentContent, true);
561
560
  if (yamlContent) {
562
561
  try {
563
562
  const agentConfig = this.parseYaml(yamlContent);
@@ -577,7 +576,7 @@ These references map directly to bundle sections:
577
576
  console.debug(`Failed to parse agent YAML for ${agentId}:`, error.message);
578
577
  }
579
578
  }
580
- } catch (error) {
579
+ } catch {
581
580
  console.warn(` ⚠ Agent ${agentId} not found in core or expansion pack`);
582
581
  }
583
582
  }
@@ -593,38 +592,38 @@ These references map directly to bundle sections:
593
592
  // We know it exists in expansion pack, find and load it
594
593
  const expansionPath = path.join(packDir, dep.type, dep.name);
595
594
  try {
596
- const content = await fs.readFile(expansionPath, "utf8");
595
+ const content = await fs.readFile(expansionPath, 'utf8');
597
596
  const expansionWebPath = this.convertToWebPath(expansionPath, packName);
598
597
  sections.push(this.formatSection(expansionWebPath, content, packName));
599
598
  console.log(` ✓ Using expansion override for ${key}`);
600
599
  found = true;
601
- } catch (error) {
600
+ } catch {
602
601
  // Try next extension
603
602
  }
604
603
  }
605
604
 
606
605
  // If not found in expansion pack (or doesn't exist there), try core
607
606
  if (!found) {
608
- const corePath = path.join(this.rootDir, "xiaoma-core", dep.type, dep.name);
607
+ const corePath = path.join(this.rootDir, 'xiaoma-core', dep.type, dep.name);
609
608
  try {
610
- const content = await fs.readFile(corePath, "utf8");
609
+ const content = await fs.readFile(corePath, 'utf8');
611
610
  const coreWebPath = this.convertToWebPath(corePath, packName);
612
611
  sections.push(this.formatSection(coreWebPath, content, packName));
613
612
  found = true;
614
- } catch (error) {
613
+ } catch {
615
614
  // Not in core either, continue
616
615
  }
617
616
  }
618
617
 
619
618
  // If not found in core, try common folder
620
619
  if (!found) {
621
- const commonPath = path.join(this.rootDir, "common", dep.type, dep.name);
620
+ const commonPath = path.join(this.rootDir, 'common', dep.type, dep.name);
622
621
  try {
623
- const content = await fs.readFile(commonPath, "utf8");
622
+ const content = await fs.readFile(commonPath, 'utf8');
624
623
  const commonWebPath = this.convertToWebPath(commonPath, packName);
625
624
  sections.push(this.formatSection(commonWebPath, content, packName));
626
625
  found = true;
627
- } catch (error) {
626
+ } catch {
628
627
  // Not in common either, continue
629
628
  }
630
629
  }
@@ -635,16 +634,16 @@ These references map directly to bundle sections:
635
634
  }
636
635
 
637
636
  // Add remaining expansion pack resources not already included as dependencies
638
- for (const resourceDir of resourceDirs) {
637
+ for (const resourceDir of resourceDirectories) {
639
638
  const resourcePath = path.join(packDir, resourceDir);
640
639
  try {
641
640
  const resourceFiles = await fs.readdir(resourcePath);
642
641
  for (const resourceFile of resourceFiles.filter(
643
- (f) => f.endsWith(".md") || f.endsWith(".yaml")
642
+ (f) => f.endsWith('.md') || f.endsWith('.yaml'),
644
643
  )) {
645
644
  const filePath = path.join(resourcePath, resourceFile);
646
- const fileContent = await fs.readFile(filePath, "utf8");
647
- const fileName = resourceFile.replace(/\.(md|yaml)$/, "");
645
+ const fileContent = await fs.readFile(filePath, 'utf8');
646
+ const fileName = resourceFile.replace(/\.(md|yaml)$/, '');
648
647
 
649
648
  // Only add if not already included as a dependency
650
649
  const resourceKey = `${resourceDir}#${fileName}`;
@@ -654,21 +653,21 @@ These references map directly to bundle sections:
654
653
  sections.push(this.formatSection(resourceWebPath, fileContent, packName));
655
654
  }
656
655
  }
657
- } catch (error) {
656
+ } catch {
658
657
  // Directory might not exist, that's fine
659
658
  }
660
659
  }
661
660
 
662
- return sections.join("\n");
661
+ return sections.join('\n');
663
662
  }
664
663
 
665
664
  async listExpansionPacks() {
666
- const expansionPacksDir = path.join(this.rootDir, "expansion-packs");
665
+ const expansionPacksDir = path.join(this.rootDir, 'expansion-packs');
667
666
  try {
668
667
  const entries = await fs.readdir(expansionPacksDir, { withFileTypes: true });
669
668
  return entries.filter((entry) => entry.isDirectory()).map((entry) => entry.name);
670
- } catch (error) {
671
- console.warn("No expansion-packs directory found");
669
+ } catch {
670
+ console.warn('No expansion-packs directory found');
672
671
  return [];
673
672
  }
674
673
  }