greenfield-service.yaml 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. # <!-- Powered by BMAD™ Core -->
  2. workflow:
  3. id: greenfield-service
  4. name: Greenfield Service/API Development
  5. description: >-
  6. Agent workflow for building backend services from concept to development.
  7. Supports both comprehensive planning for complex services and rapid prototyping for simple APIs.
  8. type: greenfield
  9. project_types:
  10. - rest-api
  11. - graphql-api
  12. - microservice
  13. - backend-service
  14. - api-prototype
  15. - simple-service
  16. sequence:
  17. - agent: analyst
  18. creates: project-brief.md
  19. optional_steps:
  20. - brainstorming_session
  21. - market_research_prompt
  22. notes: "Can do brainstorming first, then optional deep research before creating project brief. SAVE OUTPUT: Copy final project-brief.md to your project's docs/ folder."
  23. - agent: pm
  24. creates: prd.md
  25. requires: project-brief.md
  26. notes: "Creates PRD from project brief using prd-tmpl, focused on API/service requirements. SAVE OUTPUT: Copy final prd.md to your project's docs/ folder."
  27. - agent: architect
  28. creates: architecture.md
  29. requires: prd.md
  30. optional_steps:
  31. - technical_research_prompt
  32. notes: "Creates backend/service architecture using architecture-tmpl. May suggest changes to PRD stories or new stories. SAVE OUTPUT: Copy final architecture.md to your project's docs/ folder."
  33. - agent: pm
  34. updates: prd.md (if needed)
  35. requires: architecture.md
  36. condition: architecture_suggests_prd_changes
  37. notes: "If architect suggests story changes, update PRD and re-export the complete unredacted prd.md to docs/ folder."
  38. - agent: po
  39. validates: all_artifacts
  40. uses: po-master-checklist
  41. notes: "Validates all documents for consistency and completeness. May require updates to any document."
  42. - agent: various
  43. updates: any_flagged_documents
  44. condition: po_checklist_issues
  45. notes: "If PO finds issues, return to relevant agent to fix and re-export updated documents to docs/ folder."
  46. - agent: po
  47. action: shard_documents
  48. creates: sharded_docs
  49. requires: all_artifacts_in_project
  50. notes: |
  51. Shard documents for IDE development:
  52. - Option A: Use PO agent to shard: @po then ask to shard docs/prd.md
  53. - Option B: Manual: Drag shard-doc task + docs/prd.md into chat
  54. - Creates docs/prd/ and docs/architecture/ folders with sharded content
  55. - agent: sm
  56. action: create_story
  57. creates: story.md
  58. requires: sharded_docs
  59. repeats: for_each_epic
  60. notes: |
  61. Story creation cycle:
  62. - SM Agent (New Chat): @sm → *create
  63. - Creates next story from sharded docs
  64. - Story starts in "Draft" status
  65. - agent: analyst/pm
  66. action: review_draft_story
  67. updates: story.md
  68. requires: story.md
  69. optional: true
  70. condition: user_wants_story_review
  71. notes: |
  72. OPTIONAL: Review and approve draft story
  73. - NOTE: story-review task coming soon
  74. - Review story completeness and alignment
  75. - Update story status: Draft → Approved
  76. - agent: dev
  77. action: implement_story
  78. creates: implementation_files
  79. requires: story.md
  80. notes: |
  81. Dev Agent (New Chat): @dev
  82. - Implements approved story
  83. - Updates File List with all changes
  84. - Marks story as "Review" when complete
  85. - agent: qa
  86. action: review_implementation
  87. updates: implementation_files
  88. requires: implementation_files
  89. optional: true
  90. notes: |
  91. OPTIONAL: QA Agent (New Chat): @qa → review-story
  92. - Senior dev review with refactoring ability
  93. - Fixes small issues directly
  94. - Leaves checklist for remaining items
  95. - Updates story status (Review → Done or stays Review)
  96. - agent: dev
  97. action: address_qa_feedback
  98. updates: implementation_files
  99. condition: qa_left_unchecked_items
  100. notes: |
  101. If QA left unchecked items:
  102. - Dev Agent (New Chat): Address remaining items
  103. - Return to QA for final approval
  104. - step: repeat_development_cycle
  105. action: continue_for_all_stories
  106. notes: |
  107. Repeat story cycle (SM → Dev → QA) for all epic stories
  108. Continue until all stories in PRD are complete
  109. - agent: po
  110. action: epic_retrospective
  111. creates: epic-retrospective.md
  112. condition: epic_complete
  113. optional: true
  114. notes: |
  115. OPTIONAL: After epic completion
  116. - NOTE: epic-retrospective task coming soon
  117. - Validate epic was completed correctly
  118. - Document learnings and improvements
  119. - step: workflow_end
  120. action: project_complete
  121. notes: |
  122. All stories implemented and reviewed!
  123. Service development phase complete.
  124. Reference: .bmad-core/data/bmad-kb.md#IDE Development Workflow
  125. flow_diagram: |
  126. ```mermaid
  127. graph TD
  128. A[Start: Service Development] --> B[analyst: project-brief.md]
  129. B --> C[pm: prd.md]
  130. C --> D[architect: architecture.md]
  131. D --> E{Architecture suggests PRD changes?}
  132. E -->|Yes| F[pm: update prd.md]
  133. E -->|No| G[po: validate all artifacts]
  134. F --> G
  135. G --> H{PO finds issues?}
  136. H -->|Yes| I[Return to relevant agent for fixes]
  137. H -->|No| J[po: shard documents]
  138. I --> G
  139. J --> K[sm: create story]
  140. K --> L{Review draft story?}
  141. L -->|Yes| M[analyst/pm: review & approve story]
  142. L -->|No| N[dev: implement story]
  143. M --> N
  144. N --> O{QA review?}
  145. O -->|Yes| P[qa: review implementation]
  146. O -->|No| Q{More stories?}
  147. P --> R{QA found issues?}
  148. R -->|Yes| S[dev: address QA feedback]
  149. R -->|No| Q
  150. S --> P
  151. Q -->|Yes| K
  152. Q -->|No| T{Epic retrospective?}
  153. T -->|Yes| U[po: epic retrospective]
  154. T -->|No| V[Project Complete]
  155. U --> V
  156. B -.-> B1[Optional: brainstorming]
  157. B -.-> B2[Optional: market research]
  158. D -.-> D1[Optional: technical research]
  159. style V fill:#90EE90
  160. style J fill:#ADD8E6
  161. style K fill:#ADD8E6
  162. style N fill:#ADD8E6
  163. style B fill:#FFE4B5
  164. style C fill:#FFE4B5
  165. style D fill:#FFE4B5
  166. style M fill:#F0E68C
  167. style P fill:#F0E68C
  168. style U fill:#F0E68C
  169. ```
  170. decision_guidance:
  171. when_to_use:
  172. - Building production APIs or microservices
  173. - Multiple endpoints and complex business logic
  174. - Need comprehensive documentation and testing
  175. - Multiple team members will be involved
  176. - Long-term maintenance expected
  177. - Enterprise or external-facing APIs
  178. handoff_prompts:
  179. analyst_to_pm: "Project brief is complete. Save it as docs/project-brief.md in your project, then create the PRD."
  180. pm_to_architect: "PRD is ready. Save it as docs/prd.md in your project, then create the service architecture."
  181. architect_review: "Architecture complete. Save it as docs/architecture.md. Do you suggest any changes to the PRD stories or need new stories added?"
  182. architect_to_pm: "Please update the PRD with the suggested story changes, then re-export the complete prd.md to docs/."
  183. updated_to_po: "All documents ready in docs/ folder. Please validate all artifacts for consistency."
  184. po_issues: "PO found issues with [document]. Please return to [agent] to fix and re-save the updated document."
  185. complete: "All planning artifacts validated and saved in docs/ folder. Move to IDE environment to begin development."