@zeyue0329/xiaoma-cli 1.0.8 → 1.0.10

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 (326) hide show
  1. package/.github/FORK_GUIDE.md +106 -0
  2. package/.github/FUNDING.yaml +15 -0
  3. package/.github/ISSUE_TEMPLATE/bug_report.md +32 -0
  4. package/.github/ISSUE_TEMPLATE/feature_request.md +22 -0
  5. package/.github/workflows/discord.yaml +26 -0
  6. package/.github/workflows/format-check.yaml +44 -0
  7. package/.github/workflows/manual-release.yaml +174 -0
  8. package/.github/workflows/pr-validation.yaml +55 -0
  9. package/.husky/pre-commit +3 -0
  10. package/.vscode/settings.json +26 -1
  11. package/CHANGELOG.md +686 -0
  12. package/CONTRIBUTING.md +250 -0
  13. package/LICENSE +6 -1
  14. package/common/tasks/create-doc.md +2 -0
  15. package/common/tasks/execute-checklist.md +2 -7
  16. package/common/utils/bmad-doc-template.md +7 -5
  17. package/common/utils/workflow-management.md +2 -0
  18. package/dist/expansion-packs/bmad-2d-phaser-game-dev/agents/game-designer.txt +2103 -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 +8486 -0
  22. package/dist/expansion-packs/bmad-2d-unity-game-dev/agents/game-architect.txt +3210 -0
  23. package/dist/expansion-packs/bmad-2d-unity-game-dev/agents/game-designer.txt +3244 -0
  24. package/dist/expansion-packs/bmad-2d-unity-game-dev/agents/game-developer.txt +317 -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 +12854 -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 +6071 -0
  38. package/dist/expansion-packs/bmad-infrastructure-devops/agents/infra-devops-platform.txt +2079 -0
  39. package/docs/GUIDING-PRINCIPLES.md +91 -0
  40. package/docs/core-architecture.md +219 -0
  41. package/docs/enhanced-ide-development-workflow.md +248 -0
  42. package/docs/expansion-packs.md +200 -0
  43. package/docs/how-to-contribute-with-pull-requests.md +158 -0
  44. package/docs/user-guide.md +530 -0
  45. package/docs/versioning-and-releases.md +155 -0
  46. package/docs/versions.md +48 -0
  47. package/docs/working-in-the-brownfield.md +597 -0
  48. package/eslint.config.mjs +119 -0
  49. package/expansion-packs/bmad-2d-phaser-game-dev/agent-teams/phaser-2d-nodejs-game-team.yaml +14 -0
  50. package/expansion-packs/bmad-2d-phaser-game-dev/agents/game-designer.md +73 -0
  51. package/expansion-packs/bmad-2d-phaser-game-dev/agents/game-developer.md +80 -0
  52. package/expansion-packs/bmad-2d-phaser-game-dev/agents/game-sm.md +66 -0
  53. package/expansion-packs/bmad-2d-phaser-game-dev/checklists/game-design-checklist.md +203 -0
  54. package/expansion-packs/bmad-2d-phaser-game-dev/checklists/game-story-dod-checklist.md +162 -0
  55. package/expansion-packs/bmad-2d-phaser-game-dev/config.yaml +9 -0
  56. package/expansion-packs/bmad-2d-phaser-game-dev/data/bmad-kb.md +252 -0
  57. package/expansion-packs/bmad-2d-phaser-game-dev/data/development-guidelines.md +649 -0
  58. package/expansion-packs/bmad-2d-phaser-game-dev/tasks/advanced-elicitation.md +112 -0
  59. package/expansion-packs/bmad-2d-phaser-game-dev/tasks/create-game-story.md +218 -0
  60. package/expansion-packs/bmad-2d-phaser-game-dev/tasks/game-design-brainstorming.md +292 -0
  61. package/expansion-packs/bmad-2d-phaser-game-dev/templates/game-architecture-tmpl.yaml +614 -0
  62. package/expansion-packs/bmad-2d-phaser-game-dev/templates/game-brief-tmpl.yaml +357 -0
  63. package/expansion-packs/bmad-2d-phaser-game-dev/templates/game-design-doc-tmpl.yaml +344 -0
  64. package/expansion-packs/bmad-2d-phaser-game-dev/templates/game-story-tmpl.yaml +254 -0
  65. package/expansion-packs/bmad-2d-phaser-game-dev/templates/level-design-doc-tmpl.yaml +485 -0
  66. package/expansion-packs/bmad-2d-phaser-game-dev/workflows/game-dev-greenfield.yaml +184 -0
  67. package/expansion-packs/bmad-2d-phaser-game-dev/workflows/game-prototype.yaml +176 -0
  68. package/expansion-packs/bmad-2d-unity-game-dev/agent-teams/unity-2d-game-team.yaml +15 -0
  69. package/expansion-packs/bmad-2d-unity-game-dev/agents/game-architect.md +82 -0
  70. package/expansion-packs/bmad-2d-unity-game-dev/agents/game-designer.md +79 -0
  71. package/expansion-packs/bmad-2d-unity-game-dev/agents/game-developer.md +80 -0
  72. package/expansion-packs/bmad-2d-unity-game-dev/agents/game-sm.md +67 -0
  73. package/expansion-packs/bmad-2d-unity-game-dev/checklists/game-architect-checklist.md +393 -0
  74. package/expansion-packs/bmad-2d-unity-game-dev/checklists/game-change-checklist.md +205 -0
  75. package/expansion-packs/bmad-2d-unity-game-dev/checklists/game-design-checklist.md +203 -0
  76. package/expansion-packs/bmad-2d-unity-game-dev/checklists/game-story-dod-checklist.md +126 -0
  77. package/expansion-packs/bmad-2d-unity-game-dev/config.yaml +7 -0
  78. package/expansion-packs/bmad-2d-unity-game-dev/data/bmad-kb.md +771 -0
  79. package/expansion-packs/bmad-2d-unity-game-dev/data/development-guidelines.md +588 -0
  80. package/expansion-packs/bmad-2d-unity-game-dev/tasks/advanced-elicitation.md +112 -0
  81. package/expansion-packs/bmad-2d-unity-game-dev/tasks/correct-course-game.md +143 -0
  82. package/expansion-packs/bmad-2d-unity-game-dev/tasks/create-game-story.md +186 -0
  83. package/expansion-packs/bmad-2d-unity-game-dev/tasks/game-design-brainstorming.md +292 -0
  84. package/expansion-packs/bmad-2d-unity-game-dev/tasks/validate-game-story.md +202 -0
  85. package/expansion-packs/bmad-2d-unity-game-dev/templates/game-architecture-tmpl.yaml +1031 -0
  86. package/expansion-packs/bmad-2d-unity-game-dev/templates/game-brief-tmpl.yaml +357 -0
  87. package/expansion-packs/bmad-2d-unity-game-dev/templates/game-design-doc-tmpl.yaml +706 -0
  88. package/expansion-packs/bmad-2d-unity-game-dev/templates/game-story-tmpl.yaml +257 -0
  89. package/expansion-packs/bmad-2d-unity-game-dev/templates/level-design-doc-tmpl.yaml +485 -0
  90. package/expansion-packs/bmad-2d-unity-game-dev/workflows/game-dev-greenfield.yaml +184 -0
  91. package/expansion-packs/bmad-2d-unity-game-dev/workflows/game-prototype.yaml +176 -0
  92. package/expansion-packs/bmad-creative-writing/README.md +146 -0
  93. package/expansion-packs/bmad-creative-writing/agent-teams/agent-team.yaml +20 -0
  94. package/expansion-packs/bmad-creative-writing/agents/beta-reader.md +94 -0
  95. package/expansion-packs/bmad-creative-writing/agents/book-critic.md +40 -0
  96. package/expansion-packs/bmad-creative-writing/agents/character-psychologist.md +93 -0
  97. package/expansion-packs/bmad-creative-writing/agents/cover-designer.md +46 -0
  98. package/expansion-packs/bmad-creative-writing/agents/dialog-specialist.md +92 -0
  99. package/expansion-packs/bmad-creative-writing/agents/editor.md +93 -0
  100. package/expansion-packs/bmad-creative-writing/agents/genre-specialist.md +95 -0
  101. package/expansion-packs/bmad-creative-writing/agents/narrative-designer.md +93 -0
  102. package/expansion-packs/bmad-creative-writing/agents/plot-architect.md +95 -0
  103. package/expansion-packs/bmad-creative-writing/agents/world-builder.md +94 -0
  104. package/expansion-packs/bmad-creative-writing/checklists/beta-feedback-closure-checklist.md +23 -0
  105. package/expansion-packs/bmad-creative-writing/checklists/character-consistency-checklist.md +23 -0
  106. package/expansion-packs/bmad-creative-writing/checklists/comedic-timing-checklist.md +23 -0
  107. package/expansion-packs/bmad-creative-writing/checklists/cyberpunk-aesthetic-checklist.md +23 -0
  108. package/expansion-packs/bmad-creative-writing/checklists/ebook-formatting-checklist.md +21 -0
  109. package/expansion-packs/bmad-creative-writing/checklists/epic-poetry-meter-checklist.md +23 -0
  110. package/expansion-packs/bmad-creative-writing/checklists/fantasy-magic-system-checklist.md +23 -0
  111. package/expansion-packs/bmad-creative-writing/checklists/foreshadowing-payoff-checklist.md +22 -0
  112. package/expansion-packs/bmad-creative-writing/checklists/genre-tropes-checklist.md +22 -0
  113. package/expansion-packs/bmad-creative-writing/checklists/historical-accuracy-checklist.md +23 -0
  114. package/expansion-packs/bmad-creative-writing/checklists/horror-suspense-checklist.md +23 -0
  115. package/expansion-packs/bmad-creative-writing/checklists/kdp-cover-ready-checklist.md +25 -0
  116. package/expansion-packs/bmad-creative-writing/checklists/line-edit-quality-checklist.md +23 -0
  117. package/expansion-packs/bmad-creative-writing/checklists/marketing-copy-checklist.md +23 -0
  118. package/expansion-packs/bmad-creative-writing/checklists/mystery-clue-trail-checklist.md +23 -0
  119. package/expansion-packs/bmad-creative-writing/checklists/orbital-mechanics-checklist.md +23 -0
  120. package/expansion-packs/bmad-creative-writing/checklists/plot-structure-checklist.md +59 -0
  121. package/expansion-packs/bmad-creative-writing/checklists/publication-readiness-checklist.md +23 -0
  122. package/expansion-packs/bmad-creative-writing/checklists/romance-emotional-beats-checklist.md +23 -0
  123. package/expansion-packs/bmad-creative-writing/checklists/scene-quality-checklist.md +23 -0
  124. package/expansion-packs/bmad-creative-writing/checklists/scifi-technology-plausibility-checklist.md +22 -0
  125. package/expansion-packs/bmad-creative-writing/checklists/sensitivity-representation-checklist.md +23 -0
  126. package/expansion-packs/bmad-creative-writing/checklists/steampunk-gadget-checklist.md +23 -0
  127. package/expansion-packs/bmad-creative-writing/checklists/thriller-pacing-stakes-checklist.md +23 -0
  128. package/expansion-packs/bmad-creative-writing/checklists/timeline-continuity-checklist.md +23 -0
  129. package/expansion-packs/bmad-creative-writing/checklists/world-building-continuity-checklist.md +23 -0
  130. package/expansion-packs/bmad-creative-writing/checklists/ya-appropriateness-checklist.md +23 -0
  131. package/expansion-packs/bmad-creative-writing/config.yaml +12 -0
  132. package/expansion-packs/bmad-creative-writing/data/bmad-kb.md +209 -0
  133. package/expansion-packs/bmad-creative-writing/data/story-structures.md +67 -0
  134. package/expansion-packs/bmad-creative-writing/docs/brief.md +212 -0
  135. package/expansion-packs/bmad-creative-writing/tasks/advanced-elicitation.md +119 -0
  136. package/expansion-packs/bmad-creative-writing/tasks/analyze-reader-feedback.md +23 -0
  137. package/expansion-packs/bmad-creative-writing/tasks/analyze-story-structure.md +67 -0
  138. package/expansion-packs/bmad-creative-writing/tasks/assemble-kdp-package.md +29 -0
  139. package/expansion-packs/bmad-creative-writing/tasks/brainstorm-premise.md +23 -0
  140. package/expansion-packs/bmad-creative-writing/tasks/build-world.md +24 -0
  141. package/expansion-packs/bmad-creative-writing/tasks/character-depth-pass.md +22 -0
  142. package/expansion-packs/bmad-creative-writing/tasks/create-doc.md +103 -0
  143. package/expansion-packs/bmad-creative-writing/tasks/create-draft-section.md +26 -0
  144. package/expansion-packs/bmad-creative-writing/tasks/critical-review.md +26 -0
  145. package/expansion-packs/bmad-creative-writing/tasks/develop-character.md +24 -0
  146. package/expansion-packs/bmad-creative-writing/tasks/execute-checklist.md +88 -0
  147. package/expansion-packs/bmad-creative-writing/tasks/expand-premise.md +23 -0
  148. package/expansion-packs/bmad-creative-writing/tasks/expand-synopsis.md +23 -0
  149. package/expansion-packs/bmad-creative-writing/tasks/final-polish.md +23 -0
  150. package/expansion-packs/bmad-creative-writing/tasks/generate-cover-brief.md +25 -0
  151. package/expansion-packs/bmad-creative-writing/tasks/generate-cover-prompts.md +26 -0
  152. package/expansion-packs/bmad-creative-writing/tasks/generate-scene-list.md +23 -0
  153. package/expansion-packs/bmad-creative-writing/tasks/incorporate-feedback.md +25 -0
  154. package/expansion-packs/bmad-creative-writing/tasks/outline-scenes.md +23 -0
  155. package/expansion-packs/bmad-creative-writing/tasks/provide-feedback.md +24 -0
  156. package/expansion-packs/bmad-creative-writing/tasks/publish-chapter.md +23 -0
  157. package/expansion-packs/bmad-creative-writing/tasks/quick-feedback.md +22 -0
  158. package/expansion-packs/bmad-creative-writing/tasks/select-next-arc.md +23 -0
  159. package/expansion-packs/bmad-creative-writing/tasks/workshop-dialog.md +64 -0
  160. package/expansion-packs/bmad-creative-writing/templates/beta-feedback-form.yaml +97 -0
  161. package/expansion-packs/bmad-creative-writing/templates/chapter-draft-tmpl.yaml +82 -0
  162. package/expansion-packs/bmad-creative-writing/templates/character-profile-tmpl.yaml +92 -0
  163. package/expansion-packs/bmad-creative-writing/templates/cover-design-brief-tmpl.yaml +98 -0
  164. package/expansion-packs/bmad-creative-writing/templates/premise-brief-tmpl.yaml +78 -0
  165. package/expansion-packs/bmad-creative-writing/templates/scene-list-tmpl.yaml +55 -0
  166. package/expansion-packs/bmad-creative-writing/templates/story-outline-tmpl.yaml +96 -0
  167. package/expansion-packs/bmad-creative-writing/templates/world-guide-tmpl.yaml +89 -0
  168. package/expansion-packs/bmad-creative-writing/workflows/book-cover-design-workflow.md +218 -0
  169. package/expansion-packs/bmad-creative-writing/workflows/novel-greenfield-workflow.yaml +56 -0
  170. package/expansion-packs/bmad-creative-writing/workflows/novel-serial-workflow.yaml +50 -0
  171. package/expansion-packs/bmad-creative-writing/workflows/novel-snowflake-workflow.yaml +69 -0
  172. package/expansion-packs/bmad-creative-writing/workflows/novel-writing.yaml +91 -0
  173. package/expansion-packs/bmad-creative-writing/workflows/screenplay-development.yaml +85 -0
  174. package/expansion-packs/bmad-creative-writing/workflows/series-planning.yaml +78 -0
  175. package/expansion-packs/bmad-creative-writing/workflows/short-story-creation.yaml +64 -0
  176. package/expansion-packs/bmad-infrastructure-devops/README.md +147 -0
  177. package/expansion-packs/bmad-infrastructure-devops/agents/infra-devops-platform.md +73 -0
  178. package/expansion-packs/bmad-infrastructure-devops/checklists/infrastructure-checklist.md +486 -0
  179. package/expansion-packs/bmad-infrastructure-devops/config.yaml +10 -0
  180. package/expansion-packs/bmad-infrastructure-devops/data/bmad-kb.md +307 -0
  181. package/expansion-packs/bmad-infrastructure-devops/tasks/review-infrastructure.md +161 -0
  182. package/expansion-packs/bmad-infrastructure-devops/tasks/validate-infrastructure.md +155 -0
  183. package/expansion-packs/bmad-infrastructure-devops/templates/infrastructure-architecture-tmpl.yaml +425 -0
  184. package/expansion-packs/bmad-infrastructure-devops/templates/infrastructure-platform-from-arch-tmpl.yaml +630 -0
  185. package/implement-fork-friendly-ci.sh +229 -0
  186. package/package.json +75 -45
  187. package/prettier.config.mjs +32 -0
  188. package/test.md +1 -0
  189. package/tools/builders/web-builder.js +143 -149
  190. package/tools/bump-all-versions.js +42 -33
  191. package/tools/bump-expansion-version.js +23 -16
  192. package/tools/cli.js +15 -15
  193. package/tools/flattener/aggregate.js +76 -0
  194. package/tools/flattener/binary.js +80 -0
  195. package/tools/flattener/discovery.js +71 -0
  196. package/tools/flattener/files.js +35 -0
  197. package/tools/flattener/ignoreRules.js +176 -0
  198. package/tools/flattener/main.js +458 -460
  199. package/tools/flattener/projectRoot.js +206 -0
  200. package/tools/flattener/prompts.js +44 -0
  201. package/tools/flattener/stats.helpers.js +395 -0
  202. package/tools/flattener/stats.js +80 -0
  203. package/tools/flattener/test-matrix.js +413 -0
  204. package/tools/flattener/xml.js +88 -0
  205. package/tools/installer/README.md +1 -1
  206. package/tools/installer/bin/xiaoma.js +390 -150
  207. package/tools/installer/config/ide-agent-config.yaml +1 -1
  208. package/tools/installer/config/install.config.yaml +60 -9
  209. package/tools/installer/lib/config-loader.js +55 -51
  210. package/tools/installer/lib/file-manager.js +92 -117
  211. package/tools/installer/lib/ide-base-setup.js +57 -56
  212. package/tools/installer/lib/ide-setup.js +821 -414
  213. package/tools/installer/lib/installer.js +924 -699
  214. package/tools/installer/lib/memory-profiler.js +54 -53
  215. package/tools/installer/lib/module-manager.js +19 -15
  216. package/tools/installer/lib/resource-locator.js +31 -33
  217. package/tools/installer/package.json +24 -23
  218. package/tools/lib/dependency-resolver.js +39 -43
  219. package/tools/lib/yaml-utils.js +7 -7
  220. package/tools/md-assets/web-agent-startup-instructions.md +6 -6
  221. package/tools/preview-release-notes.js +66 -0
  222. package/tools/setup-hooks.sh +37 -0
  223. package/tools/shared/bannerArt.js +105 -0
  224. package/tools/sync-installer-version.js +7 -9
  225. package/tools/sync-version.sh +23 -0
  226. package/tools/update-expansion-version.js +14 -15
  227. package/tools/upgraders/v3-to-v4-upgrader.js +203 -294
  228. package/tools/version-bump.js +41 -26
  229. package/tools/xiaoma-npx-wrapper.js +14 -14
  230. package/tools/yaml-format.js +56 -43
  231. package/xiaoma-core/agent-teams/team-all.yaml +3 -2
  232. package/xiaoma-core/agent-teams/team-fullstack.yaml +2 -1
  233. package/xiaoma-core/agent-teams/team-ide-minimal.yaml +1 -0
  234. package/xiaoma-core/agent-teams/team-no-ui.yaml +2 -1
  235. package/xiaoma-core/agents/analyst.md +20 -17
  236. package/xiaoma-core/agents/architect.md +15 -14
  237. package/xiaoma-core/agents/{xiaoma-master.md → bmad-master.md} +29 -27
  238. package/xiaoma-core/agents/{xiaoma-orchestrator.md → bmad-orchestrator.md} +36 -39
  239. package/xiaoma-core/agents/dev.md +23 -18
  240. package/xiaoma-core/agents/pm.md +18 -15
  241. package/xiaoma-core/agents/po.md +13 -10
  242. package/xiaoma-core/agents/qa.md +46 -24
  243. package/xiaoma-core/agents/sm.md +11 -8
  244. package/xiaoma-core/agents/ux-expert.md +10 -7
  245. package/xiaoma-core/checklists/architect-checklist.md +2 -5
  246. package/xiaoma-core/checklists/change-checklist.md +4 -2
  247. package/xiaoma-core/checklists/pm-checklist.md +2 -5
  248. package/xiaoma-core/checklists/po-master-checklist.md +2 -9
  249. package/xiaoma-core/checklists/story-dod-checklist.md +2 -7
  250. package/xiaoma-core/checklists/story-draft-checklist.md +2 -3
  251. package/xiaoma-core/core-config.yaml +4 -1
  252. package/xiaoma-core/data/{xiaoma-kb.md → bmad-kb.md} +48 -42
  253. package/xiaoma-core/data/brainstorming-techniques.md +2 -0
  254. package/xiaoma-core/data/elicitation-methods.md +22 -0
  255. package/xiaoma-core/data/technical-preferences.md +2 -0
  256. package/xiaoma-core/data/test-levels-framework.md +148 -0
  257. package/xiaoma-core/data/test-priorities-matrix.md +174 -0
  258. package/xiaoma-core/tasks/advanced-elicitation.md +2 -0
  259. package/xiaoma-core/tasks/apply-qa-fixes.md +150 -0
  260. package/xiaoma-core/tasks/brownfield-create-epic.md +2 -0
  261. package/xiaoma-core/tasks/brownfield-create-story.md +2 -0
  262. package/xiaoma-core/tasks/correct-course.md +2 -0
  263. package/xiaoma-core/tasks/create-brownfield-story.md +14 -4
  264. package/xiaoma-core/tasks/create-deep-research-prompt.md +2 -11
  265. package/xiaoma-core/tasks/create-next-story.md +3 -1
  266. package/xiaoma-core/tasks/document-project.md +17 -13
  267. package/xiaoma-core/tasks/facilitate-brainstorming-session.md +5 -3
  268. package/xiaoma-core/tasks/generate-ai-frontend-prompt.md +2 -0
  269. package/xiaoma-core/tasks/index-docs.md +2 -6
  270. package/xiaoma-core/tasks/kb-mode-interaction.md +17 -15
  271. package/xiaoma-core/tasks/nfr-assess.md +345 -0
  272. package/xiaoma-core/tasks/qa-gate.md +163 -0
  273. package/xiaoma-core/tasks/review-story.md +245 -74
  274. package/xiaoma-core/tasks/risk-profile.md +355 -0
  275. package/xiaoma-core/tasks/shard-doc.md +2 -2
  276. package/xiaoma-core/tasks/test-design.md +176 -0
  277. package/xiaoma-core/tasks/trace-requirements.md +266 -0
  278. package/xiaoma-core/tasks/validate-next-story.md +5 -3
  279. package/xiaoma-core/templates/architecture-tmpl.yaml +50 -49
  280. package/xiaoma-core/templates/brainstorming-output-tmpl.yaml +5 -5
  281. package/xiaoma-core/templates/brownfield-architecture-tmpl.yaml +32 -31
  282. package/xiaoma-core/templates/brownfield-prd-tmpl.yaml +14 -13
  283. package/xiaoma-core/templates/competitor-analysis-tmpl.yaml +20 -6
  284. package/xiaoma-core/templates/front-end-architecture-tmpl.yaml +22 -9
  285. package/xiaoma-core/templates/front-end-spec-tmpl.yaml +25 -24
  286. package/xiaoma-core/templates/fullstack-architecture-tmpl.yaml +123 -104
  287. package/xiaoma-core/templates/market-research-tmpl.yaml +3 -2
  288. package/xiaoma-core/templates/prd-tmpl.yaml +10 -9
  289. package/xiaoma-core/templates/project-brief-tmpl.yaml +5 -4
  290. package/xiaoma-core/templates/qa-gate-tmpl.yaml +103 -0
  291. package/xiaoma-core/templates/story-tmpl.yaml +13 -12
  292. package/xiaoma-core/workflows/brownfield-fullstack.yaml +13 -12
  293. package/xiaoma-core/workflows/brownfield-service.yaml +5 -4
  294. package/xiaoma-core/workflows/brownfield-ui.yaml +5 -4
  295. package/xiaoma-core/workflows/greenfield-fullstack.yaml +7 -6
  296. package/xiaoma-core/workflows/greenfield-service.yaml +5 -4
  297. package/xiaoma-core/workflows/greenfield-ui.yaml +6 -5
  298. package/.releaserc.json +0 -18
  299. package/README.md +0 -532
  300. 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
  301. 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
  302. 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
  303. package/XiaoMa-Web/351/241/271/347/233/256/346/200/273/347/273/223/346/212/245/345/221/212.md +0 -310
  304. package/dist/agents/analyst.txt +0 -2882
  305. package/dist/agents/architect.txt +0 -3543
  306. package/dist/agents/dev-cn.txt +0 -428
  307. package/dist/agents/dev.txt +0 -428
  308. package/dist/agents/pm.txt +0 -2229
  309. package/dist/agents/po.txt +0 -1364
  310. package/dist/agents/qa.txt +0 -386
  311. package/dist/agents/sm.txt +0 -668
  312. package/dist/agents/ux-expert.txt +0 -701
  313. package/dist/agents/xiaoma-master.txt +0 -8756
  314. package/dist/agents/xiaoma-orchestrator.txt +0 -1490
  315. package/dist/teams/team-all.txt +0 -11062
  316. package/dist/teams/team-fullstack.txt +0 -10392
  317. package/dist/teams/team-ide-minimal.txt +0 -3507
  318. package/dist/teams/team-no-ui.txt +0 -8951
  319. package/docs/quick-start.md +0 -179
  320. package/tools/bmad-npx-wrapper.js +0 -39
  321. package/tools/installer/package-lock.json +0 -704
  322. package/tools/semantic-release-sync-installer.js +0 -30
  323. package/xiaoma-core/bmad-core/user-guide.md +0 -0
  324. package/xiaoma-core/enhanced-ide-development-workflow.md +0 -43
  325. package/xiaoma-core/user-guide.md +0 -251
  326. package/xiaoma-core/working-in-the-brownfield.md +0 -364
@@ -1,30 +0,0 @@
1
- /**
2
- * Semantic-release plugin to sync installer package.json version
3
- */
4
-
5
- const fs = require('fs');
6
- const path = require('path');
7
-
8
- // This function runs during the "prepare" step of semantic-release
9
- function prepare(_, { nextRelease, logger }) {
10
- // Define the path to the installer package.json file
11
- const file = path.join(process.cwd(), 'tools/installer/package.json');
12
-
13
- // If the file does not exist, skip syncing and log a message
14
- if (!fs.existsSync(file)) return logger.log('Installer package.json not found, skipping');
15
-
16
- // Read and parse the package.json file
17
- const pkg = JSON.parse(fs.readFileSync(file, 'utf8'));
18
-
19
- // Update the version field with the next release version
20
- pkg.version = nextRelease.version;
21
-
22
- // Write the updated JSON back to the file
23
- fs.writeFileSync(file, JSON.stringify(pkg, null, 2) + '\n');
24
-
25
- // Log success message
26
- logger.log(`Synced installer package.json to version ${nextRelease.version}`);
27
- }
28
-
29
- // Export the prepare function so semantic-release can use it
30
- module.exports = { prepare };
File without changes
@@ -1,43 +0,0 @@
1
- # Enhanced Development Workflow
2
-
3
- This is a simple step-by-step guide to help you efficiently manage your development workflow using the XiaoMa Method. Refer to the **[<ins>User Guide</ins>](user-guide.md)** for any scenario that is not covered here.
4
-
5
- ## Create new Branch
6
-
7
- 1. **Start new branch**
8
-
9
- ## Story Creation (Scrum Master)
10
-
11
- 1. **Start new chat/conversation**
12
- 2. **Load SM agent**
13
- 3. **Execute**: `*draft` (runs create-next-story task)
14
- 4. **Review generated story** in `docs/stories/`
15
- 5. **Update status**: Change from "Draft" to "Approved"
16
-
17
- ## Story Implementation (Developer)
18
-
19
- 1. **Start new chat/conversation**
20
- 2. **Load Dev agent**
21
- 3. **Execute**: `*develop-story {selected-story}` (runs execute-checklist task)
22
- 4. **Review generated report** in `{selected-story}`
23
-
24
- ## Story Review (Quality Assurance)
25
-
26
- 1. **Start new chat/conversation**
27
- 2. **Load QA agent**
28
- 3. **Execute**: `*review {selected-story}` (runs review-story task)
29
- 4. **Review generated report** in `{selected-story}`
30
-
31
- ## Commit Changes and Push
32
-
33
- 1. **Commit changes**
34
- 2. **Push to remote**
35
-
36
- ## Repeat Until Complete
37
-
38
- - **SM**: Create next story → Review → Approve
39
- - **Dev**: Implement story → Complete → Mark Ready for Review
40
- - **QA**: Review story → Mark done
41
- - **Commit**: All changes
42
- - **Push**: To remote
43
- - **Continue**: Until all features implemented
@@ -1,251 +0,0 @@
1
- # XiaoMa Web User Guide
2
-
3
- This guide will help you understand and effectively use the XiaoMa Method for agile AI driven planning and development.
4
-
5
- ## The XiaoMa Plan and Execute Workflow
6
-
7
- First, here is the full standard Greenfield Planning + Execution Workflow. Brownfield is very similar, but it's suggested to understand this greenfield first, even if on a simple project before tackling a brownfield project. The XiaoMa Method needs to be installed to the root of your new project folder. For the planning phase, you can optionally perform it with powerful web agents, potentially resulting in higher quality results at a fraction of the cost it would take to complete if providing your own API key or credits in some Agentic tools. For planning, powerful thinking models and larger context - along with working as a partner with the agents will net the best results.
8
-
9
- If you are going to use the XiaoMa Method with a Brownfield project (an existing project), review **[Working in the Brownfield](./working-in-the-brownfield.md)**.
10
-
11
- If you do not see the diagrams that following rendering, you can install Markdown All in One along with the Markdown Preview Mermaid Support plugins to VSCode (or one of the forked clones). With these plugin's, if you right click on the tab when open, there should be a Open Preview option, or check the IDE documentation.
12
-
13
- ### The Planning Workflow (Web UI or Powerful IDE Agents)
14
-
15
- Before development begins, XiaoMa follows a structured planning workflow that's ideally done in web UI for cost efficiency:
16
-
17
- ```mermaid
18
- graph TD
19
- A["Start: Project Idea"] --> B{"Optional: Analyst Research"}
20
- B -->|Yes| C["Analyst: Brainstorming (Optional)"]
21
- B -->|No| G{"Project Brief Available?"}
22
- C --> C2["Analyst: Market Research (Optional)"]
23
- C2 --> C3["Analyst: Competitor Analysis (Optional)"]
24
- C3 --> D["Analyst: Create Project Brief"]
25
- D --> G
26
- G -->|Yes| E["PM: Create PRD from Brief (Fast Track)"]
27
- G -->|No| E2["PM: Interactive PRD Creation (More Questions)"]
28
- E --> F["PRD Created with FRs, NFRs, Epics & Stories"]
29
- E2 --> F
30
- F --> F2{"UX Required?"}
31
- F2 -->|Yes| F3["UX Expert: Create Front End Spec"]
32
- F2 -->|No| H["Architect: Create Architecture from PRD"]
33
- F3 --> F4["UX Expert: Generate UI Prompt for Lovable/V0 (Optional)"]
34
- F4 --> H2["Architect: Create Architecture from PRD + UX Spec"]
35
- H --> I["PO: Run Master Checklist"]
36
- H2 --> I
37
- I --> J{"Documents Aligned?"}
38
- J -->|Yes| K["Planning Complete"]
39
- J -->|No| L["PO: Update Epics & Stories"]
40
- L --> M["Update PRD/Architecture as needed"]
41
- M --> I
42
- K --> N["📁 Switch to IDE (If in a Web Agent Platform)"]
43
- N --> O["PO: Shard Documents"]
44
- O --> P["Ready for SM/Dev Cycle"]
45
-
46
- style A fill:#f5f5f5,color:#000
47
- style B fill:#e3f2fd,color:#000
48
- style C fill:#e8f5e9,color:#000
49
- style C2 fill:#e8f5e9,color:#000
50
- style C3 fill:#e8f5e9,color:#000
51
- style D fill:#e8f5e9,color:#000
52
- style E fill:#fff3e0,color:#000
53
- style E2 fill:#fff3e0,color:#000
54
- style F fill:#fff3e0,color:#000
55
- style F2 fill:#e3f2fd,color:#000
56
- style F3 fill:#e1f5fe,color:#000
57
- style F4 fill:#e1f5fe,color:#000
58
- style G fill:#e3f2fd,color:#000
59
- style H fill:#f3e5f5,color:#000
60
- style H2 fill:#f3e5f5,color:#000
61
- style I fill:#f9ab00,color:#fff
62
- style J fill:#e3f2fd,color:#000
63
- style K fill:#34a853,color:#fff
64
- style L fill:#f9ab00,color:#fff
65
- style M fill:#fff3e0,color:#000
66
- style N fill:#1a73e8,color:#fff
67
- style O fill:#f9ab00,color:#fff
68
- style P fill:#34a853,color:#fff
69
- ```
70
-
71
- #### Web UI to IDE Transition
72
-
73
- **Critical Transition Point**: Once the PO confirms document alignment, you must switch from web UI to IDE to begin the development workflow:
74
-
75
- 1. **Copy Documents to Project**: Ensure `docs/prd.md` and `docs/architecture.md` are in your project's docs folder (or a custom location you can specify during installation)
76
- 2. **Switch to IDE**: Open your project in your preferred Agentic IDE
77
- 3. **Document Sharding**: Use the PO agent to shard the PRD and then the Architecture
78
- 4. **Begin Development**: Start the Core Development Cycle that follows
79
-
80
- ### The Core Development Cycle (IDE)
81
-
82
- Once planning is complete and documents are sharded, XiaoMa follows a structured development workflow:
83
-
84
- ```mermaid
85
- graph TD
86
- A["Development Phase Start"] --> B["SM: Reviews Previous Story Dev/QA Notes"]
87
- B --> B2["SM: Drafts Next Story from Sharded Epic + Architecture"]
88
- B2 --> B3{"PO: Validate Story Draft (Optional)"}
89
- B3 -->|Validation Requested| B4["PO: Validate Story Against Artifacts"]
90
- B3 -->|Skip Validation| C{"User Approval"}
91
- B4 --> C
92
- C -->|Approved| D["Dev: Sequential Task Execution"]
93
- C -->|Needs Changes| B2
94
- D --> E["Dev: Implement Tasks + Tests"]
95
- E --> F["Dev: Run All Validations"]
96
- F --> G["Dev: Mark Ready for Review + Add Notes"]
97
- G --> H{"User Verification"}
98
- H -->|Request QA Review| I["QA: Senior Dev Review + Active Refactoring"]
99
- H -->|Approve Without QA| M["IMPORTANT: Verify All Regression Tests and Linting are Passing"]
100
- I --> J["QA: Review, Refactor Code, Add Tests, Document Notes"]
101
- J --> L{"QA Decision"}
102
- L -->|Needs Dev Work| D
103
- L -->|Approved| M
104
- H -->|Needs Fixes| D
105
- M --> N["IMPORTANT: COMMIT YOUR CHANGES BEFORE PROCEEDING!"]
106
- N --> K["Mark Story as Done"]
107
- K --> B
108
-
109
- style A fill:#f5f5f5,color:#000
110
- style B fill:#e8f5e9,color:#000
111
- style B2 fill:#e8f5e9,color:#000
112
- style B3 fill:#e3f2fd,color:#000
113
- style B4 fill:#fce4ec,color:#000
114
- style C fill:#e3f2fd,color:#000
115
- style D fill:#e3f2fd,color:#000
116
- style E fill:#e3f2fd,color:#000
117
- style F fill:#e3f2fd,color:#000
118
- style G fill:#e3f2fd,color:#000
119
- style H fill:#e3f2fd,color:#000
120
- style I fill:#f9ab00,color:#fff
121
- style J fill:#ffd54f,color:#000
122
- style K fill:#34a853,color:#fff
123
- style L fill:#e3f2fd,color:#000
124
- style M fill:#ff5722,color:#fff
125
- style N fill:#d32f2f,color:#fff
126
- ```
127
-
128
- ## Installation
129
-
130
- ### Optional
131
-
132
- If you want to do the planning in the Web with Claude (Sonnet 4 or Opus), Gemini Gem (2.5 Pro), or Custom GPT's:
133
-
134
- 1. Navigate to `dist/teams/`
135
- 2. Copy `team-fullstack.txt`
136
- 3. Create new Gemini Gem or CustomGPT
137
- 4. Upload file with instructions: "Your critical operating instructions are attached, do not break character as directed"
138
- 5. Type `/help` to see available commands
139
-
140
- ### IDE Project Setup
141
-
142
- ```bash
143
- # Interactive installation (recommended)
144
- npx xiaoma-web install
145
- ```
146
-
147
- ## Special Agents
148
-
149
- There are two xiaoma agents - in the future they will be consolidated into the single xiaoma-master.
150
-
151
- ### XiaoMa-Master
152
-
153
- This agent can do any task or command that all other agents can do, aside from actual story implementation. Additionally, this agent can help explain the XiaoMa Method when in the web by accessing the knowledge base and explaining anything to you about the process.
154
-
155
- If you don't want to bother switching between different agents aside from the dev, this is the agent for you. Just remember that as the context grows, the performance of the agent degrades, therefore it is important to instruct the agent to compact the conversation and start a new conversation with the compacted conversation as the initial message. Do this often, preferably after each story is implemented.
156
-
157
- ### XiaoMa-Orchestrator
158
-
159
- This agent should NOT be used within the IDE, it is a heavy weight special purpose agent that utilizes a lot of context and can morph into any other agent. This exists solely to facilitate the team's within the web bundles. If you use a web bundle you will be greeted by the XiaoMa Orchestrator.
160
-
161
- ### How Agents Work
162
-
163
- #### Dependencies System
164
-
165
- Each agent has a YAML section that defines its dependencies:
166
-
167
- ```yaml
168
- dependencies:
169
- templates:
170
- - prd-template.md
171
- - user-story-template.md
172
- tasks:
173
- - create-doc.md
174
- - shard-doc.md
175
- data:
176
- - xiaoma-kb.md
177
- ```
178
-
179
- **Key Points:**
180
-
181
- - Agents only load resources they need (lean context)
182
- - Dependencies are automatically resolved during bundling
183
- - Resources are shared across agents to maintain consistency
184
-
185
- #### Agent Interaction
186
-
187
- **In IDE:**
188
-
189
- ```bash
190
- # Some Ide's, like Cursor or Windsurf for example, utilize manual rules so interaction is done with the '@' symbol
191
- @pm Create a PRD for a task management app
192
- @architect Design the system architecture
193
- @dev Implement the user authentication
194
-
195
- # Some, like Claude Code use slash commands instead
196
- /pm Create user stories
197
- /dev Fix the login bug
198
- ```
199
-
200
- #### Interactive Modes
201
-
202
- - **Incremental Mode**: Step-by-step with user input
203
- - **YOLO Mode**: Rapid generation with minimal interaction
204
-
205
- ## IDE Integration
206
-
207
- ### IDE Best Practices
208
-
209
- - **Context Management**: Keep relevant files only in context, keep files as lean and focused as necessary
210
- - **Agent Selection**: Use appropriate agent for task
211
- - **Iterative Development**: Work in small, focused tasks
212
- - **File Organization**: Maintain clean project structure
213
- - **Commit Regularly**: Save your work frequently
214
-
215
- ## Technical Preferences System
216
-
217
- XiaoMa includes a personalization system through the `technical-preferences.md` file located in `.xiaoma-core/data/` - this can help bias the PM and Architect to recommend your preferences for design patterns, technology selection, or anything else you would like to put in here.
218
-
219
- ### Using with Web Bundles
220
-
221
- When creating custom web bundles or uploading to AI platforms, include your `technical-preferences.md` content to ensure agents have your preferences from the start of any conversation.
222
-
223
- ## Core Configuration
224
-
225
- The `xiaoma-core/core-config.yaml` file is a critical config that enables XiaoMa to work seamlessly with differing project structures, more options will be made available in the future. Currently the most important is the devLoadAlwaysFiles list section in the yaml.
226
-
227
- ### Developer Context Files
228
-
229
- Define which files the dev agent should always load:
230
-
231
- ```yaml
232
- devLoadAlwaysFiles:
233
- - docs/architecture/coding-standards.md
234
- - docs/architecture/tech-stack.md
235
- - docs/architecture/project-structure.md
236
- ```
237
-
238
- You will want to verify from sharding your architecture that these documents exist, that they are as lean as possible, and contain exactly the information you want your dev agent to ALWAYS load into it's context. These are the rules the agent will follow.
239
-
240
- As your project grows and the code starts to build consistent patterns, coding standards should be reduced to include only the standards that the agent still makes with. The agent will look at surrounding code in files to infer the coding standards that are relevant to the current task.
241
-
242
- ## Getting Help
243
-
244
- - **Discord Community**: [Join Discord](https://discord.gg/gk8jAdXWmj)
245
- - **GitHub Issues**: [Report bugs](https://github.com/zqyl-xiaoma/xiaoma-cli/issues)
246
- - **Documentation**: [Browse docs](https://github.com/zqyl-xiaoma/xiaoma-cli/docs)
247
- - **YouTube**: [XiaoMaCode Channel](https://www.youtube.com/@XiaoMaCode)
248
-
249
- ## Conclusion
250
-
251
- Remember: XiaoMa is designed to enhance your development process, not replace your expertise. Use it as a powerful tool to accelerate your projects while maintaining control over design decisions and implementation details.
@@ -1,364 +0,0 @@
1
- # Working in the Brownfield: A Complete Guide
2
-
3
- > **HIGHLY RECOMMENDED: Use Gemini Web or Gemini CLI for Brownfield Documentation Generation!**
4
- >
5
- > Gemini Web's 1M+ token context window or Gemini CLI (when it's working) can analyze your ENTIRE codebase, or critical sections of it, all at once (obviously within reason):
6
- >
7
- > - Upload via GitHub URL or use gemini cli in the project folder
8
- > - If working in the web: use `npx xiaoma-web flatten` to flatten your project into a single file, then upload that file to your web agent.
9
-
10
- ## What is Brownfield Development?
11
-
12
- Brownfield development refers to adding features, fixing bugs, or modernizing existing software projects. Unlike greenfield (new) projects, brownfield work requires understanding existing code, respecting constraints, and ensuring new changes integrate seamlessly without breaking existing functionality.
13
-
14
- ## When to Use XiaoMa for Brownfield
15
-
16
- - Add significant new features to existing applications
17
- - Modernize legacy codebases
18
- - Integrate new technologies or services
19
- - Refactor complex systems
20
- - Fix bugs that require architectural understanding
21
- - Document undocumented systems
22
-
23
- ## When NOT to use a Brownfield Flow
24
-
25
- If you have just completed an MVP with XiaoMa, and you want to continue with post-MVP, its easier to just talk to the PM and ask it to work with you to create a new epic to add into the PRD, shard out the epic, update any architecture documents with the architect, and just go from there.
26
-
27
- ## The Complete Brownfield Workflow
28
-
29
- 1. **Follow the [<ins>User Guide - Installation</ins>](user-guide.md#installation) steps to setup your agent in the web.**
30
- 2. **Generate a 'flattened' single file of your entire codebase** run: ```npx xiaoma-web flatten```
31
-
32
- ### Choose Your Approach
33
-
34
- #### Approach A: PRD-First (Recommended if adding very large and complex new features, single or multiple epics or massive changes)
35
-
36
- **Best for**: Large codebases, monorepos, or when you know exactly what you want to build
37
-
38
- 1. **Create PRD First** to define requirements
39
- 2. **Document only relevant areas** based on PRD needs
40
- 3. **More efficient** - avoids documenting unused code
41
-
42
- #### Approach B: Document-First (Good for Smaller Projects)
43
-
44
- **Best for**: Smaller codebases, unknown systems, or exploratory changes
45
-
46
- 1. **Document entire system** first
47
- 2. **Create PRD** with full context
48
- 3. **More thorough** - captures everything
49
-
50
- ### Approach A: PRD-First Workflow (Recommended)
51
-
52
- #### Phase 1: Define Requirements First
53
-
54
- **In Gemini Web (with your flattened-codebase.xml uploaded):**
55
-
56
- ```bash
57
- @pm
58
- *create-brownfield-prd
59
- ```
60
-
61
- The PM will:
62
-
63
- - **Ask about your enhancement** requirements
64
- - **Explore the codebase** to understand current state
65
- - **Identify affected areas** that need documentation
66
- - **Create focused PRD** with clear scope
67
-
68
- **Key Advantage**: The PRD identifies which parts of your monorepo/large codebase actually need documentation!
69
-
70
- #### Phase 2: Focused Documentation
71
-
72
- **Still in Gemini Web, now with PRD context:**
73
-
74
- ```bash
75
- @architect
76
- *document-project
77
- ```
78
-
79
- The analyst will:
80
-
81
- - **Ask about your focus** if no PRD was provided
82
- - **Offer options**: Create PRD, provide requirements, or describe the enhancement
83
- - **Reference the PRD/description** to understand scope
84
- - **Focus on relevant modules** identified in PRD or your description
85
- - **Skip unrelated areas** to keep docs lean
86
- - **Generate ONE architecture document** for all environments
87
-
88
- The analyst creates:
89
-
90
- - **One comprehensive architecture document** following fullstack-architecture template
91
- - **Covers all system aspects** in a single file
92
- - **Easy to copy and save** as `docs/project-architecture.md`
93
- - **Can be sharded later** in IDE if desired
94
-
95
- For example, if you say "Add payment processing to user service":
96
-
97
- - Documents only: user service, API endpoints, database schemas, payment integrations
98
- - Creates focused source tree showing only payment-related code paths
99
- - Skips: admin panels, reporting modules, unrelated microservices
100
-
101
- ### Approach B: Document-First Workflow
102
-
103
- #### Phase 1: Document the Existing System
104
-
105
- **Best Approach - Gemini Web with 1M+ Context**:
106
-
107
- 1. **Go to Gemini Web** (gemini.google.com)
108
- 2. **Upload your project**:
109
- - **Option A**: Paste your GitHub repository URL directly
110
- - **Option B**: Upload your flattened-codebase.xml file
111
- 3. **Load the analyst agent**: Upload `dist/agents/architect.txt`
112
- 4. **Run documentation**: Type `*document-project`
113
-
114
- The analyst will generate comprehensive documentation of everything.
115
-
116
- #### Phase 2: Plan Your Enhancement
117
-
118
- ##### Option A: Full Brownfield Workflow (Recommended for Major Changes)
119
-
120
- **1. Create Brownfield PRD**:
121
-
122
- ```bash
123
- @pm
124
- *create-brownfield-prd
125
- ```
126
-
127
- The PM agent will:
128
-
129
- - **Analyze existing documentation** from Phase 1
130
- - **Request specific enhancement details** from you
131
- - **Assess complexity** and recommend approach
132
- - **Create epic/story structure** for the enhancement
133
- - **Identify risks and integration points**
134
-
135
- **How PM Agent Gets Project Context**:
136
-
137
- - In Gemini Web: Already has full project context from Phase 1 documentation
138
- - In IDE: Will ask "Please provide the path to your existing project documentation"
139
-
140
- **Key Prompts You'll Encounter**:
141
-
142
- - "What specific enhancement or feature do you want to add?"
143
- - "Are there any existing systems or APIs this needs to integrate with?"
144
- - "What are the critical constraints we must respect?"
145
- - "What is your timeline and team size?"
146
-
147
- **2. Create Brownfield Architecture**:
148
-
149
- ```bash
150
- @architect
151
- *create-brownfield-architecture
152
- ```
153
-
154
- The architect will:
155
-
156
- - **Review the brownfield PRD**
157
- - **Design integration strategy**
158
- - **Plan migration approach** if needed
159
- - **Identify technical risks**
160
- - **Define compatibility requirements**
161
-
162
- ##### Option B: Quick Enhancement (For Focused Changes)
163
-
164
- **For Single Epic Without Full PRD**:
165
-
166
- ```bash
167
- @pm
168
- *create-brownfield-epic
169
- ```
170
-
171
- Use when:
172
-
173
- - Enhancement is well-defined and isolated
174
- - Existing documentation is comprehensive
175
- - Changes don't impact multiple systems
176
- - You need quick turnaround
177
-
178
- **For Single Story**:
179
-
180
- ```bash
181
- @pm
182
- *create-brownfield-story
183
- ```
184
-
185
- Use when:
186
-
187
- - Bug fix or tiny feature
188
- - Very isolated change
189
- - No architectural impact
190
- - Clear implementation path
191
-
192
- ### Phase 3: Validate Planning Artifacts
193
-
194
- ```bash
195
- @po
196
- *execute-checklist-po
197
- ```
198
-
199
- The PO ensures:
200
-
201
- - Compatibility with existing system
202
- - No breaking changes planned
203
- - Risk mitigation strategies in place
204
- - Clear integration approach
205
-
206
- ### Phase 4: Save and Shard Documents
207
-
208
- 1. Save your PRD and Architecture as:
209
- docs/brownfield-prd.md
210
- docs/brownfield-architecture.md
211
- 2. Shard your docs:
212
- In your IDE
213
-
214
- ```bash
215
- @po
216
- shard docs/brownfield-prd.md
217
- ```
218
-
219
- ```bash
220
- @po
221
- shard docs/brownfield-architecture.md
222
- ```
223
-
224
- ### Phase 5: Transition to Development
225
-
226
- **Follow the [<ins>Enhanced IDE Development Workflow</ins>](enhanced-ide-development-workflow.md)**
227
-
228
- ## Brownfield Best Practices
229
-
230
- ### 1. Always Document First
231
-
232
- Even if you think you know the codebase:
233
-
234
- - Run `document-project` to capture current state
235
- - AI agents need this context
236
- - Discovers undocumented patterns
237
-
238
- ### 2. Respect Existing Patterns
239
-
240
- The brownfield templates specifically look for:
241
-
242
- - Current coding conventions
243
- - Existing architectural patterns
244
- - Technology constraints
245
- - Team preferences
246
-
247
- ### 3. Plan for Gradual Rollout
248
-
249
- Brownfield changes should:
250
-
251
- - Support feature flags
252
- - Plan rollback strategies
253
- - Include migration scripts
254
- - Maintain backwards compatibility
255
-
256
- ### 4. Test Integration Thoroughly
257
-
258
- Focus testing on:
259
-
260
- - Integration points
261
- - Existing functionality (regression)
262
- - Performance impact
263
- - Data migrations
264
-
265
- ### 5. Communicate Changes
266
-
267
- Document:
268
-
269
- - What changed and why
270
- - Migration instructions
271
- - New patterns introduced
272
- - Deprecation notices
273
-
274
- ## Common Brownfield Scenarios
275
-
276
- ### Scenario 1: Adding a New Feature
277
-
278
- 1. Document existing system
279
- 2. Create brownfield PRD focusing on integration
280
- 3. Architecture emphasizes compatibility
281
- 4. Stories include integration tasks
282
-
283
- ### Scenario 2: Modernizing Legacy Code
284
-
285
- 1. Extensive documentation phase
286
- 2. PRD includes migration strategy
287
- 3. Architecture plans gradual transition
288
- 4. Stories follow strangler fig pattern
289
-
290
- ### Scenario 3: Bug Fix in Complex System
291
-
292
- 1. Document relevant subsystems
293
- 2. Use `create-brownfield-story` for focused fix
294
- 3. Include regression test requirements
295
- 4. QA validates no side effects
296
-
297
- ### Scenario 4: API Integration
298
-
299
- 1. Document existing API patterns
300
- 2. PRD defines integration requirements
301
- 3. Architecture ensures consistent patterns
302
- 4. Stories include API documentation updates
303
-
304
- ## Troubleshooting
305
-
306
- ### "The AI doesn't understand my codebase"
307
-
308
- **Solution**: Re-run `document-project` with more specific paths to critical files
309
-
310
- ### "Generated plans don't fit our patterns"
311
-
312
- **Solution**: Update generated documentation with your specific conventions before planning phase
313
-
314
- ### "Too much boilerplate for small changes"
315
-
316
- **Solution**: Use `create-brownfield-story` instead of full workflow
317
-
318
- ### "Integration points unclear"
319
-
320
- **Solution**: Provide more context during PRD creation, specifically highlighting integration systems
321
-
322
- ## Quick Reference
323
-
324
- ### Brownfield-Specific Commands
325
-
326
- ```bash
327
- # Document existing project
328
- @architect → *document-project
329
-
330
- # Create enhancement PRD
331
- @pm → *create-brownfield-prd
332
-
333
- # Create architecture with integration focus
334
- @architect → *create-brownfield-architecture
335
-
336
- # Quick epic creation
337
- @pm → *create-brownfield-epic
338
-
339
- # Single story creation
340
- @pm → *create-brownfield-story
341
- ```
342
-
343
- ### Decision Tree
344
-
345
- ```text
346
- Do you have a large codebase or monorepo?
347
- ├─ Yes → PRD-First Approach
348
- │ └─ Create PRD → Document only affected areas
349
- └─ No → Is the codebase well-known to you?
350
- ├─ Yes → PRD-First Approach
351
- └─ No → Document-First Approach
352
-
353
- Is this a major enhancement affecting multiple systems?
354
- ├─ Yes → Full Brownfield Workflow
355
- └─ No → Is this more than a simple bug fix?
356
- ├─ Yes → brownfield-create-epic
357
- └─ No → brownfield-create-story
358
- ```
359
-
360
- ## Conclusion
361
-
362
- Brownfield development with XiaoMa-Method provides structure and safety when modifying existing systems. The key is providing comprehensive context through documentation, using specialized templates that consider integration requirements, and following workflows that respect existing constraints while enabling progress.
363
-
364
- Remember: **Document First, Plan Carefully, Integrate Safely**