brownfield-service.yaml 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. # <!-- Powered by BMAD™ Core -->
  2. workflow:
  3. id: brownfield-service
  4. name: Brownfield Service/API Enhancement
  5. description: >-
  6. Agent workflow for enhancing existing backend services and APIs with new features,
  7. modernization, or performance improvements. Handles existing system analysis and safe integration.
  8. type: brownfield
  9. project_types:
  10. - service-modernization
  11. - api-enhancement
  12. - microservice-extraction
  13. - performance-optimization
  14. - integration-enhancement
  15. sequence:
  16. - step: service_analysis
  17. agent: architect
  18. action: analyze existing project and use task document-project
  19. creates: multiple documents per the document-project template
  20. notes: "Review existing service documentation, codebase, performance metrics, and identify integration dependencies."
  21. - agent: pm
  22. creates: prd.md
  23. uses: brownfield-prd-tmpl
  24. requires: existing_service_analysis
  25. notes: "Creates comprehensive PRD focused on service enhancement with existing system analysis. SAVE OUTPUT: Copy final prd.md to your project's docs/ folder."
  26. - agent: architect
  27. creates: architecture.md
  28. uses: brownfield-architecture-tmpl
  29. requires: prd.md
  30. notes: "Creates architecture with service integration strategy and API evolution planning. SAVE OUTPUT: Copy final architecture.md to your project's docs/ folder."
  31. - agent: po
  32. validates: all_artifacts
  33. uses: po-master-checklist
  34. notes: "Validates all documents for service integration safety and API compatibility. May require updates to any document."
  35. - agent: various
  36. updates: any_flagged_documents
  37. condition: po_checklist_issues
  38. notes: "If PO finds issues, return to relevant agent to fix and re-export updated documents to docs/ folder."
  39. - agent: po
  40. action: shard_documents
  41. creates: sharded_docs
  42. requires: all_artifacts_in_project
  43. notes: |
  44. Shard documents for IDE development:
  45. - Option A: Use PO agent to shard: @po then ask to shard docs/prd.md
  46. - Option B: Manual: Drag shard-doc task + docs/prd.md into chat
  47. - Creates docs/prd/ and docs/architecture/ folders with sharded content
  48. - agent: sm
  49. action: create_story
  50. creates: story.md
  51. requires: sharded_docs
  52. repeats: for_each_epic
  53. notes: |
  54. Story creation cycle:
  55. - SM Agent (New Chat): @sm → *create
  56. - Creates next story from sharded docs
  57. - Story starts in "Draft" status
  58. - agent: analyst/pm
  59. action: review_draft_story
  60. updates: story.md
  61. requires: story.md
  62. optional: true
  63. condition: user_wants_story_review
  64. notes: |
  65. OPTIONAL: Review and approve draft story
  66. - NOTE: story-review task coming soon
  67. - Review story completeness and alignment
  68. - Update story status: Draft → Approved
  69. - agent: dev
  70. action: implement_story
  71. creates: implementation_files
  72. requires: story.md
  73. notes: |
  74. Dev Agent (New Chat): @dev
  75. - Implements approved story
  76. - Updates File List with all changes
  77. - Marks story as "Review" when complete
  78. - agent: qa
  79. action: review_implementation
  80. updates: implementation_files
  81. requires: implementation_files
  82. optional: true
  83. notes: |
  84. OPTIONAL: QA Agent (New Chat): @qa → review-story
  85. - Senior dev review with refactoring ability
  86. - Fixes small issues directly
  87. - Leaves checklist for remaining items
  88. - Updates story status (Review → Done or stays Review)
  89. - agent: dev
  90. action: address_qa_feedback
  91. updates: implementation_files
  92. condition: qa_left_unchecked_items
  93. notes: |
  94. If QA left unchecked items:
  95. - Dev Agent (New Chat): Address remaining items
  96. - Return to QA for final approval
  97. - step: repeat_development_cycle
  98. action: continue_for_all_stories
  99. notes: |
  100. Repeat story cycle (SM → Dev → QA) for all epic stories
  101. Continue until all stories in PRD are complete
  102. - agent: po
  103. action: epic_retrospective
  104. creates: epic-retrospective.md
  105. condition: epic_complete
  106. optional: true
  107. notes: |
  108. OPTIONAL: After epic completion
  109. - NOTE: epic-retrospective task coming soon
  110. - Validate epic was completed correctly
  111. - Document learnings and improvements
  112. - step: workflow_end
  113. action: project_complete
  114. notes: |
  115. All stories implemented and reviewed!
  116. Project development phase complete.
  117. Reference: .bmad-core/data/bmad-kb.md#IDE Development Workflow
  118. flow_diagram: |
  119. ```mermaid
  120. graph TD
  121. A[Start: Service Enhancement] --> B[analyst: analyze existing service]
  122. B --> C[pm: prd.md]
  123. C --> D[architect: architecture.md]
  124. D --> E[po: validate with po-master-checklist]
  125. E --> F{PO finds issues?}
  126. F -->|Yes| G[Return to relevant agent for fixes]
  127. F -->|No| H[po: shard documents]
  128. G --> E
  129. H --> I[sm: create story]
  130. I --> J{Review draft story?}
  131. J -->|Yes| K[analyst/pm: review & approve story]
  132. J -->|No| L[dev: implement story]
  133. K --> L
  134. L --> M{QA review?}
  135. M -->|Yes| N[qa: review implementation]
  136. M -->|No| O{More stories?}
  137. N --> P{QA found issues?}
  138. P -->|Yes| Q[dev: address QA feedback]
  139. P -->|No| O
  140. Q --> N
  141. O -->|Yes| I
  142. O -->|No| R{Epic retrospective?}
  143. R -->|Yes| S[po: epic retrospective]
  144. R -->|No| T[Project Complete]
  145. S --> T
  146. style T fill:#90EE90
  147. style H fill:#ADD8E6
  148. style I fill:#ADD8E6
  149. style L fill:#ADD8E6
  150. style C fill:#FFE4B5
  151. style D fill:#FFE4B5
  152. style K fill:#F0E68C
  153. style N fill:#F0E68C
  154. style S fill:#F0E68C
  155. ```
  156. decision_guidance:
  157. when_to_use:
  158. - Service enhancement requires coordinated stories
  159. - API versioning or breaking changes needed
  160. - Database schema changes required
  161. - Performance or scalability improvements needed
  162. - Multiple integration points affected
  163. handoff_prompts:
  164. analyst_to_pm: "Service analysis complete. Create comprehensive PRD with service integration strategy."
  165. pm_to_architect: "PRD ready. Save it as docs/prd.md, then create the service architecture."
  166. architect_to_po: "Architecture complete. Save it as docs/architecture.md. Please validate all artifacts for service integration safety."
  167. po_issues: "PO found issues with [document]. Please return to [agent] to fix and re-save the updated document."
  168. complete: "All planning artifacts validated and saved in docs/ folder. Move to IDE environment to begin development."