2
0

brownfield-prd-tmpl.yaml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  1. # <!-- Powered by BMAD™ Core -->
  2. template:
  3. id: brownfield-prd-template-v2
  4. name: Brownfield Enhancement PRD
  5. version: 2.0
  6. output:
  7. format: markdown
  8. filename: docs/prd.md
  9. title: "{{project_name}} Brownfield Enhancement PRD"
  10. workflow:
  11. mode: interactive
  12. elicitation: advanced-elicitation
  13. sections:
  14. - id: intro-analysis
  15. title: Intro Project Analysis and Context
  16. instruction: |
  17. IMPORTANT - SCOPE ASSESSMENT REQUIRED:
  18. This PRD is for SIGNIFICANT enhancements to existing projects that require comprehensive planning and multiple stories. Before proceeding:
  19. 1. **Assess Enhancement Complexity**: If this is a simple feature addition or bug fix that could be completed in 1-2 focused development sessions, STOP and recommend: "For simpler changes, consider using the brownfield-create-epic or brownfield-create-story task with the Product Owner instead. This full PRD process is designed for substantial enhancements that require architectural planning and multiple coordinated stories."
  20. 2. **Project Context**: Determine if we're working in an IDE with the project already loaded or if the user needs to provide project information. If project files are available, analyze existing documentation in the docs folder. If insufficient documentation exists, recommend running the document-project task first.
  21. 3. **Deep Assessment Requirement**: You MUST thoroughly analyze the existing project structure, patterns, and constraints before making ANY suggestions. Every recommendation must be grounded in actual project analysis, not assumptions.
  22. Gather comprehensive information about the existing project. This section must be completed before proceeding with requirements.
  23. CRITICAL: Throughout this analysis, explicitly confirm your understanding with the user. For every assumption you make about the existing project, ask: "Based on my analysis, I understand that [assumption]. Is this correct?"
  24. Do not proceed with any recommendations until the user has validated your understanding of the existing system.
  25. sections:
  26. - id: existing-project-overview
  27. title: Existing Project Overview
  28. instruction: Check if document-project analysis was already performed. If yes, reference that output instead of re-analyzing.
  29. sections:
  30. - id: analysis-source
  31. title: Analysis Source
  32. instruction: |
  33. Indicate one of the following:
  34. - Document-project output available at: {{path}}
  35. - IDE-based fresh analysis
  36. - User-provided information
  37. - id: current-state
  38. title: Current Project State
  39. instruction: |
  40. - If document-project output exists: Extract summary from "High Level Architecture" and "Technical Summary" sections
  41. - Otherwise: Brief description of what the project currently does and its primary purpose
  42. - id: documentation-analysis
  43. title: Available Documentation Analysis
  44. instruction: |
  45. If document-project was run:
  46. - Note: "Document-project analysis available - using existing technical documentation"
  47. - List key documents created by document-project
  48. - Skip the missing documentation check below
  49. Otherwise, check for existing documentation:
  50. sections:
  51. - id: available-docs
  52. title: Available Documentation
  53. type: checklist
  54. items:
  55. - Tech Stack Documentation [[LLM: If from document-project, check ✓]]
  56. - Source Tree/Architecture [[LLM: If from document-project, check ✓]]
  57. - Coding Standards [[LLM: If from document-project, may be partial]]
  58. - API Documentation [[LLM: If from document-project, check ✓]]
  59. - External API Documentation [[LLM: If from document-project, check ✓]]
  60. - UX/UI Guidelines [[LLM: May not be in document-project]]
  61. - Technical Debt Documentation [[LLM: If from document-project, check ✓]]
  62. - "Other: {{other_docs}}"
  63. instruction: |
  64. - If document-project was already run: "Using existing project analysis from document-project output."
  65. - If critical documentation is missing and no document-project: "I recommend running the document-project task first..."
  66. - id: enhancement-scope
  67. title: Enhancement Scope Definition
  68. instruction: Work with user to clearly define what type of enhancement this is. This is critical for scoping and approach.
  69. sections:
  70. - id: enhancement-type
  71. title: Enhancement Type
  72. type: checklist
  73. instruction: Determine with user which applies
  74. items:
  75. - New Feature Addition
  76. - Major Feature Modification
  77. - Integration with New Systems
  78. - Performance/Scalability Improvements
  79. - UI/UX Overhaul
  80. - Technology Stack Upgrade
  81. - Bug Fix and Stability Improvements
  82. - "Other: {{other_type}}"
  83. - id: enhancement-description
  84. title: Enhancement Description
  85. instruction: 2-3 sentences describing what the user wants to add or change
  86. - id: impact-assessment
  87. title: Impact Assessment
  88. type: checklist
  89. instruction: Assess the scope of impact on existing codebase
  90. items:
  91. - Minimal Impact (isolated additions)
  92. - Moderate Impact (some existing code changes)
  93. - Significant Impact (substantial existing code changes)
  94. - Major Impact (architectural changes required)
  95. - id: goals-context
  96. title: Goals and Background Context
  97. sections:
  98. - id: goals
  99. title: Goals
  100. type: bullet-list
  101. instruction: Bullet list of 1-line desired outcomes this enhancement will deliver if successful
  102. - id: background
  103. title: Background Context
  104. type: paragraphs
  105. instruction: 1-2 short paragraphs explaining why this enhancement is needed, what problem it solves, and how it fits with the existing project
  106. - id: changelog
  107. title: Change Log
  108. type: table
  109. columns: [Change, Date, Version, Description, Author]
  110. - id: requirements
  111. title: Requirements
  112. instruction: |
  113. Draft functional and non-functional requirements based on your validated understanding of the existing project. Before presenting requirements, confirm: "These requirements are based on my understanding of your existing system. Please review carefully and confirm they align with your project's reality."
  114. elicit: true
  115. sections:
  116. - id: functional
  117. title: Functional
  118. type: numbered-list
  119. prefix: FR
  120. instruction: Each Requirement will be a bullet markdown with identifier starting with FR
  121. examples:
  122. - "FR1: The existing Todo List will integrate with the new AI duplicate detection service without breaking current functionality."
  123. - id: non-functional
  124. title: Non Functional
  125. type: numbered-list
  126. prefix: NFR
  127. instruction: Each Requirement will be a bullet markdown with identifier starting with NFR. Include constraints from existing system
  128. examples:
  129. - "NFR1: Enhancement must maintain existing performance characteristics and not exceed current memory usage by more than 20%."
  130. - id: compatibility
  131. title: Compatibility Requirements
  132. instruction: Critical for brownfield - what must remain compatible
  133. type: numbered-list
  134. prefix: CR
  135. template: "{{requirement}}: {{description}}"
  136. items:
  137. - id: cr1
  138. template: "CR1: {{existing_api_compatibility}}"
  139. - id: cr2
  140. template: "CR2: {{database_schema_compatibility}}"
  141. - id: cr3
  142. template: "CR3: {{ui_ux_consistency}}"
  143. - id: cr4
  144. template: "CR4: {{integration_compatibility}}"
  145. - id: ui-enhancement-goals
  146. title: User Interface Enhancement Goals
  147. condition: Enhancement includes UI changes
  148. instruction: For UI changes, capture how they will integrate with existing UI patterns and design systems
  149. sections:
  150. - id: existing-ui-integration
  151. title: Integration with Existing UI
  152. instruction: Describe how new UI elements will fit with existing design patterns, style guides, and component libraries
  153. - id: modified-screens
  154. title: Modified/New Screens and Views
  155. instruction: List only the screens/views that will be modified or added
  156. - id: ui-consistency
  157. title: UI Consistency Requirements
  158. instruction: Specific requirements for maintaining visual and interaction consistency with existing application
  159. - id: technical-constraints
  160. title: Technical Constraints and Integration Requirements
  161. instruction: This section replaces separate architecture documentation. Gather detailed technical constraints from existing project analysis.
  162. sections:
  163. - id: existing-tech-stack
  164. title: Existing Technology Stack
  165. instruction: |
  166. If document-project output available:
  167. - Extract from "Actual Tech Stack" table in High Level Architecture section
  168. - Include version numbers and any noted constraints
  169. Otherwise, document the current technology stack:
  170. template: |
  171. **Languages**: {{languages}}
  172. **Frameworks**: {{frameworks}}
  173. **Database**: {{database}}
  174. **Infrastructure**: {{infrastructure}}
  175. **External Dependencies**: {{external_dependencies}}
  176. - id: integration-approach
  177. title: Integration Approach
  178. instruction: Define how the enhancement will integrate with existing architecture
  179. template: |
  180. **Database Integration Strategy**: {{database_integration}}
  181. **API Integration Strategy**: {{api_integration}}
  182. **Frontend Integration Strategy**: {{frontend_integration}}
  183. **Testing Integration Strategy**: {{testing_integration}}
  184. - id: code-organization
  185. title: Code Organization and Standards
  186. instruction: Based on existing project analysis, define how new code will fit existing patterns
  187. template: |
  188. **File Structure Approach**: {{file_structure}}
  189. **Naming Conventions**: {{naming_conventions}}
  190. **Coding Standards**: {{coding_standards}}
  191. **Documentation Standards**: {{documentation_standards}}
  192. - id: deployment-operations
  193. title: Deployment and Operations
  194. instruction: How the enhancement fits existing deployment pipeline
  195. template: |
  196. **Build Process Integration**: {{build_integration}}
  197. **Deployment Strategy**: {{deployment_strategy}}
  198. **Monitoring and Logging**: {{monitoring_logging}}
  199. **Configuration Management**: {{config_management}}
  200. - id: risk-assessment
  201. title: Risk Assessment and Mitigation
  202. instruction: |
  203. If document-project output available:
  204. - Reference "Technical Debt and Known Issues" section
  205. - Include "Workarounds and Gotchas" that might impact enhancement
  206. - Note any identified constraints from "Critical Technical Debt"
  207. Build risk assessment incorporating existing known issues:
  208. template: |
  209. **Technical Risks**: {{technical_risks}}
  210. **Integration Risks**: {{integration_risks}}
  211. **Deployment Risks**: {{deployment_risks}}
  212. **Mitigation Strategies**: {{mitigation_strategies}}
  213. - id: epic-structure
  214. title: Epic and Story Structure
  215. instruction: |
  216. For brownfield projects, favor a single comprehensive epic unless the user is clearly requesting multiple unrelated enhancements. Before presenting the epic structure, confirm: "Based on my analysis of your existing project, I believe this enhancement should be structured as [single epic/multiple epics] because [rationale based on actual project analysis]. Does this align with your understanding of the work required?"
  217. elicit: true
  218. sections:
  219. - id: epic-approach
  220. title: Epic Approach
  221. instruction: Explain the rationale for epic structure - typically single epic for brownfield unless multiple unrelated features
  222. template: "**Epic Structure Decision**: {{epic_decision}} with rationale"
  223. - id: epic-details
  224. title: "Epic 1: {{enhancement_title}}"
  225. instruction: |
  226. Comprehensive epic that delivers the brownfield enhancement while maintaining existing functionality
  227. CRITICAL STORY SEQUENCING FOR BROWNFIELD:
  228. - Stories must ensure existing functionality remains intact
  229. - Each story should include verification that existing features still work
  230. - Stories should be sequenced to minimize risk to existing system
  231. - Include rollback considerations for each story
  232. - Focus on incremental integration rather than big-bang changes
  233. - Size stories for AI agent execution in existing codebase context
  234. - MANDATORY: Present the complete story sequence and ask: "This story sequence is designed to minimize risk to your existing system. Does this order make sense given your project's architecture and constraints?"
  235. - Stories must be logically sequential with clear dependencies identified
  236. - Each story must deliver value while maintaining system integrity
  237. template: |
  238. **Epic Goal**: {{epic_goal}}
  239. **Integration Requirements**: {{integration_requirements}}
  240. sections:
  241. - id: story
  242. title: "Story 1.{{story_number}} {{story_title}}"
  243. repeatable: true
  244. template: |
  245. As a {{user_type}},
  246. I want {{action}},
  247. so that {{benefit}}.
  248. sections:
  249. - id: acceptance-criteria
  250. title: Acceptance Criteria
  251. type: numbered-list
  252. instruction: Define criteria that include both new functionality and existing system integrity
  253. item_template: "{{criterion_number}}: {{criteria}}"
  254. - id: integration-verification
  255. title: Integration Verification
  256. instruction: Specific verification steps to ensure existing functionality remains intact
  257. type: numbered-list
  258. prefix: IV
  259. items:
  260. - template: "IV1: {{existing_functionality_verification}}"
  261. - template: "IV2: {{integration_point_verification}}"
  262. - template: "IV3: {{performance_impact_verification}}"