2
0

brownfield-fullstack.yaml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298
  1. # <!-- Powered by BMAD™ Core -->
  2. workflow:
  3. id: brownfield-fullstack
  4. name: Brownfield Full-Stack Enhancement
  5. description: >-
  6. Agent workflow for enhancing existing full-stack applications with new features,
  7. modernization, or significant changes. Handles existing system analysis and safe integration.
  8. type: brownfield
  9. project_types:
  10. - feature-addition
  11. - refactoring
  12. - modernization
  13. - integration-enhancement
  14. sequence:
  15. - step: enhancement_classification
  16. agent: analyst
  17. action: classify enhancement scope
  18. notes: |
  19. Determine enhancement complexity to route to appropriate path:
  20. - Single story (< 4 hours) → Use brownfield-create-story task
  21. - Small feature (1-3 stories) → Use brownfield-create-epic task
  22. - Major enhancement (multiple epics) → Continue with full workflow
  23. Ask user: "Can you describe the enhancement scope? Is this a small fix, a feature addition, or a major enhancement requiring architectural changes?"
  24. - step: routing_decision
  25. condition: based_on_classification
  26. routes:
  27. single_story:
  28. agent: pm
  29. uses: brownfield-create-story
  30. notes: "Create single story for immediate implementation. Exit workflow after story creation."
  31. small_feature:
  32. agent: pm
  33. uses: brownfield-create-epic
  34. notes: "Create focused epic with 1-3 stories. Exit workflow after epic creation."
  35. major_enhancement:
  36. continue: to_next_step
  37. notes: "Continue with comprehensive planning workflow below."
  38. - step: documentation_check
  39. agent: analyst
  40. action: check existing documentation
  41. condition: major_enhancement_path
  42. notes: |
  43. Check if adequate project documentation exists:
  44. - Look for existing architecture docs, API specs, coding standards
  45. - Assess if documentation is current and comprehensive
  46. - If adequate: Skip document-project, proceed to PRD
  47. - If inadequate: Run document-project first
  48. - step: project_analysis
  49. agent: architect
  50. action: analyze existing project and use task document-project
  51. creates: brownfield-architecture.md (or multiple documents)
  52. condition: documentation_inadequate
  53. notes: "Run document-project to capture current system state, technical debt, and constraints. Pass findings to PRD creation."
  54. - agent: pm
  55. creates: prd.md
  56. uses: brownfield-prd-tmpl
  57. requires: existing_documentation_or_analysis
  58. notes: |
  59. Creates PRD for major enhancement. If document-project was run, reference its output to avoid re-analysis.
  60. If skipped, use existing project documentation.
  61. SAVE OUTPUT: Copy final prd.md to your project's docs/ folder.
  62. - step: architecture_decision
  63. agent: pm/architect
  64. action: determine if architecture document needed
  65. condition: after_prd_creation
  66. notes: |
  67. Review PRD to determine if architectural planning is needed:
  68. - New architectural patterns → Create architecture doc
  69. - New libraries/frameworks → Create architecture doc
  70. - Platform/infrastructure changes → Create architecture doc
  71. - Following existing patterns → Skip to story creation
  72. - agent: architect
  73. creates: architecture.md
  74. uses: brownfield-architecture-tmpl
  75. requires: prd.md
  76. condition: architecture_changes_needed
  77. notes: "Creates architecture ONLY for significant architectural changes. SAVE OUTPUT: Copy final architecture.md to your project's docs/ folder."
  78. - agent: po
  79. validates: all_artifacts
  80. uses: po-master-checklist
  81. notes: "Validates all documents for integration safety and completeness. May require updates to any document."
  82. - agent: various
  83. updates: any_flagged_documents
  84. condition: po_checklist_issues
  85. notes: "If PO finds issues, return to relevant agent to fix and re-export updated documents to docs/ folder."
  86. - agent: po
  87. action: shard_documents
  88. creates: sharded_docs
  89. requires: all_artifacts_in_project
  90. notes: |
  91. Shard documents for IDE development:
  92. - Option A: Use PO agent to shard: @po then ask to shard docs/prd.md
  93. - Option B: Manual: Drag shard-doc task + docs/prd.md into chat
  94. - Creates docs/prd/ and docs/architecture/ folders with sharded content
  95. - agent: sm
  96. action: create_story
  97. creates: story.md
  98. requires: sharded_docs_or_brownfield_docs
  99. repeats: for_each_epic_or_enhancement
  100. notes: |
  101. Story creation cycle:
  102. - For sharded PRD: @sm → *create (uses create-next-story)
  103. - For brownfield docs: @sm → use create-brownfield-story task
  104. - Creates story from available documentation
  105. - Story starts in "Draft" status
  106. - May require additional context gathering for brownfield
  107. - agent: analyst/pm
  108. action: review_draft_story
  109. updates: story.md
  110. requires: story.md
  111. optional: true
  112. condition: user_wants_story_review
  113. notes: |
  114. OPTIONAL: Review and approve draft story
  115. - NOTE: story-review task coming soon
  116. - Review story completeness and alignment
  117. - Update story status: Draft → Approved
  118. - agent: dev
  119. action: implement_story
  120. creates: implementation_files
  121. requires: story.md
  122. notes: |
  123. Dev Agent (New Chat): @dev
  124. - Implements approved story
  125. - Updates File List with all changes
  126. - Marks story as "Review" when complete
  127. - agent: qa
  128. action: review_implementation
  129. updates: implementation_files
  130. requires: implementation_files
  131. optional: true
  132. notes: |
  133. OPTIONAL: QA Agent (New Chat): @qa → review-story
  134. - Senior dev review with refactoring ability
  135. - Fixes small issues directly
  136. - Leaves checklist for remaining items
  137. - Updates story status (Review → Done or stays Review)
  138. - agent: dev
  139. action: address_qa_feedback
  140. updates: implementation_files
  141. condition: qa_left_unchecked_items
  142. notes: |
  143. If QA left unchecked items:
  144. - Dev Agent (New Chat): Address remaining items
  145. - Return to QA for final approval
  146. - step: repeat_development_cycle
  147. action: continue_for_all_stories
  148. notes: |
  149. Repeat story cycle (SM → Dev → QA) for all epic stories
  150. Continue until all stories in PRD are complete
  151. - agent: po
  152. action: epic_retrospective
  153. creates: epic-retrospective.md
  154. condition: epic_complete
  155. optional: true
  156. notes: |
  157. OPTIONAL: After epic completion
  158. - NOTE: epic-retrospective task coming soon
  159. - Validate epic was completed correctly
  160. - Document learnings and improvements
  161. - step: workflow_end
  162. action: project_complete
  163. notes: |
  164. All stories implemented and reviewed!
  165. Project development phase complete.
  166. Reference: .bmad-core/data/bmad-kb.md#IDE Development Workflow
  167. flow_diagram: |
  168. ```mermaid
  169. graph TD
  170. A[Start: Brownfield Enhancement] --> B[analyst: classify enhancement scope]
  171. B --> C{Enhancement Size?}
  172. C -->|Single Story| D[pm: brownfield-create-story]
  173. C -->|1-3 Stories| E[pm: brownfield-create-epic]
  174. C -->|Major Enhancement| F[analyst: check documentation]
  175. D --> END1[To Dev Implementation]
  176. E --> END2[To Story Creation]
  177. F --> G{Docs Adequate?}
  178. G -->|No| H[architect: document-project]
  179. G -->|Yes| I[pm: brownfield PRD]
  180. H --> I
  181. I --> J{Architecture Needed?}
  182. J -->|Yes| K[architect: architecture.md]
  183. J -->|No| L[po: validate artifacts]
  184. K --> L
  185. L --> M{PO finds issues?}
  186. M -->|Yes| N[Fix issues]
  187. M -->|No| O[po: shard documents]
  188. N --> L
  189. O --> P[sm: create story]
  190. P --> Q{Story Type?}
  191. Q -->|Sharded PRD| R[create-next-story]
  192. Q -->|Brownfield Docs| S[create-brownfield-story]
  193. R --> T{Review draft?}
  194. S --> T
  195. T -->|Yes| U[review & approve]
  196. T -->|No| V[dev: implement]
  197. U --> V
  198. V --> W{QA review?}
  199. W -->|Yes| X[qa: review]
  200. W -->|No| Y{More stories?}
  201. X --> Z{Issues?}
  202. Z -->|Yes| AA[dev: fix]
  203. Z -->|No| Y
  204. AA --> X
  205. Y -->|Yes| P
  206. Y -->|No| AB{Retrospective?}
  207. AB -->|Yes| AC[po: retrospective]
  208. AB -->|No| AD[Complete]
  209. AC --> AD
  210. style AD fill:#90EE90
  211. style END1 fill:#90EE90
  212. style END2 fill:#90EE90
  213. style D fill:#87CEEB
  214. style E fill:#87CEEB
  215. style I fill:#FFE4B5
  216. style K fill:#FFE4B5
  217. style O fill:#ADD8E6
  218. style P fill:#ADD8E6
  219. style V fill:#ADD8E6
  220. style U fill:#F0E68C
  221. style X fill:#F0E68C
  222. style AC fill:#F0E68C
  223. ```
  224. decision_guidance:
  225. when_to_use:
  226. - Enhancement requires coordinated stories
  227. - Architectural changes are needed
  228. - Significant integration work required
  229. - Risk assessment and mitigation planning necessary
  230. - Multiple team members will work on related changes
  231. handoff_prompts:
  232. classification_complete: |
  233. Enhancement classified as: {{enhancement_type}}
  234. {{if single_story}}: Proceeding with brownfield-create-story task for immediate implementation.
  235. {{if small_feature}}: Creating focused epic with brownfield-create-epic task.
  236. {{if major_enhancement}}: Continuing with comprehensive planning workflow.
  237. documentation_assessment: |
  238. Documentation assessment complete:
  239. {{if adequate}}: Existing documentation is sufficient. Proceeding directly to PRD creation.
  240. {{if inadequate}}: Running document-project to capture current system state before PRD.
  241. document_project_to_pm: |
  242. Project analysis complete. Key findings documented in:
  243. - {{document_list}}
  244. Use these findings to inform PRD creation and avoid re-analyzing the same aspects.
  245. pm_to_architect_decision: |
  246. PRD complete and saved as docs/prd.md.
  247. Architectural changes identified: {{yes/no}}
  248. {{if yes}}: Proceeding to create architecture document for: {{specific_changes}}
  249. {{if no}}: No architectural changes needed. Proceeding to validation.
  250. architect_to_po: "Architecture complete. Save it as docs/architecture.md. Please validate all artifacts for integration safety."
  251. po_to_sm: |
  252. All artifacts validated.
  253. Documentation type available: {{sharded_prd / brownfield_docs}}
  254. {{if sharded}}: Use standard create-next-story task.
  255. {{if brownfield}}: Use create-brownfield-story task to handle varied documentation formats.
  256. sm_story_creation: |
  257. Creating story from {{documentation_type}}.
  258. {{if missing_context}}: May need to gather additional context from user during story creation.
  259. complete: "All planning artifacts validated and development can begin. Stories will be created based on available documentation format."