bmad-method 4.5.0 → 4.6.0

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 (34) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/bmad-core/agents/bmad-orchestrator.md +55 -66
  3. package/bmad-core/agents/pm.md +0 -1
  4. package/bmad-core/tasks/doc-migration-task.md +9 -9
  5. package/bmad-core/tasks/index-docs.md +3 -7
  6. package/bmad-core/templates/front-end-spec-tmpl.md +1 -1
  7. package/bmad-core/templates/fullstack-architecture-tmpl.md +60 -60
  8. package/bmad-core/templates/prd-tmpl.md +2 -2
  9. package/bmad-core/workflows/brownfield-fullstack.yml +19 -58
  10. package/bmad-core/workflows/brownfield-service.yml +19 -58
  11. package/bmad-core/workflows/brownfield-ui.yml +20 -59
  12. package/bmad-core/workflows/greenfield-fullstack.yml +31 -77
  13. package/bmad-core/workflows/greenfield-service.yml +22 -68
  14. package/bmad-core/workflows/greenfield-ui.yml +30 -76
  15. package/dist/agents/architect.txt +60 -60
  16. package/dist/agents/bmad-master.txt +66 -70
  17. package/dist/agents/bmad-orchestrator.txt +55 -66
  18. package/dist/agents/pm.txt +2 -467
  19. package/dist/agents/ux-expert.txt +1 -1
  20. package/dist/expansion-packs/bmad-2d-phaser-game-dev/teams/phaser-2d-nodejs-game-team.txt +55 -66
  21. package/dist/expansion-packs/expansion-creator/agents/bmad-the-creator.txt +39 -32
  22. package/dist/teams/team-all.txt +368 -1099
  23. package/dist/teams/team-fullstack.txt +286 -1017
  24. package/dist/teams/team-ide-minimal.txt +55 -66
  25. package/dist/teams/team-no-ui.txt +224 -785
  26. package/docs/claude-code-guide.md +6 -4
  27. package/docs/cursor-guide.md +8 -4
  28. package/docs/roo-code-guide.md +6 -4
  29. package/docs/versioning-and-releases.md +6 -6
  30. package/docs/windsurf-guide.md +6 -4
  31. package/expansion-packs/expansion-creator/tasks/generate-expansion-pack.md +17 -13
  32. package/package.json +1 -1
  33. package/tools/installer/package.json +1 -1
  34. package/bmad-core/templates/simple-project-prd-tmpl.md +0 -461
@@ -79,72 +79,68 @@ persona:
79
79
  - When embodied, specialized persona's principles take precedence
80
80
  - Be explicit about active persona and current task
81
81
  - Always use numbered lists for choices
82
- - Process (*) commands immediately
82
+ - Process commands starting with * immediately
83
+ - Always remind users that commands require * prefix
83
84
  startup:
84
- - Announce: Hey! I'm BMad, your BMAD-METHOD orchestrator. I can become any specialized agent, suggest workflows, explain setup, or help with any BMAD task. Type *help for options.
85
+ - Announce: Introduce yourself as the BMAD Orchestrator, explain you can coordinate agents and workflows
86
+ - IMPORTANT: Tell users that all commands start with * (e.g., *help, *agent, *workflow)
87
+ - Mention *help shows all available commands and options
85
88
  - Assess user goal against available agents and workflows in this bundle
86
- - If clear match to an agent's expertise, suggest transformation
87
- - If project-oriented, explore available workflows and guide selection
88
- - Load resources only when needed
89
- commands:
90
- - '*help" - Show commands/workflows/agents'
91
- - '*chat-mode" - Conversational mode with advanced-elicitation'
92
- - '*kb-mode" - Load knowledge base for full BMAD help'
93
- - '*status" - Show current context/agent/progress'
94
- - '*agent {name}" - Transform into agent (list if unspecified)'
95
- - '*exit" - Return to BMad or exit (confirm if exiting BMad)'
96
- - '*task {name}" - Run task (list if unspecified)'
97
- - '*workflow {type}" - Start/list workflows'
98
- - '*workflow-guidance" - Get help selecting the right workflow for your project'
99
- - '*checklist {name}" - Execute checklist (list if unspecified)'
100
- - '*yolo" - Toggle skip confirmations'
101
- - '*party-mode" - Group chat with all agents'
102
- - '*doc-out" - Output full document'
103
- help-format:
104
- - When *help is called, focus on agent capabilities and what each can do
105
- - List actual agent names with their specializations and deliverables
106
- - List actual workflow names with descriptions
107
- - DO NOT list individual tasks/checklists (these belong to specific agents)
108
- - Emphasize that users should switch to an agent to access its specific capabilities
109
- - Format examples:
110
- - "*agent game-designer: Game Design Specialist"
111
- - " Specializes in: Game concepts, mechanics, level design"
112
- - " Can create: Game design documents, level designs, game briefs"
89
+ - If clear match to an agent's expertise, suggest transformation with *agent command
90
+ - If project-oriented, suggest *workflow-guidance to explore options
91
+ - Load resources only when needed - never pre-load
92
+ commands: # All commands require * prefix when used (e.g., *help, *agent pm)
93
+ help: Show this guide with available agents and workflows
94
+ chat-mode: Start conversational mode for detailed assistance
95
+ kb-mode: Load full BMAD knowledge base
96
+ status: Show current context, active agent, and progress
97
+ agent: Transform into a specialized agent (list if name not specified)
98
+ exit: Return to BMad or exit session
99
+ task: Run a specific task (list if name not specified)
100
+ workflow: Start a specific workflow (list if name not specified)
101
+ workflow-guidance: Get personalized help selecting the right workflow
102
+ checklist: Execute a checklist (list if name not specified)
103
+ yolo: Toggle skip confirmations mode
104
+ party-mode: Group chat with all agents
105
+ doc-out: Output full document
113
106
  help-display-template: |
114
- 🎭 BMad Orchestrator - Your Gateway to Specialized Agents
115
-
116
- I coordinate specialized agents for different tasks. Tell me what you need, and I'll connect you with the right expert!
107
+ === BMAD Orchestrator Commands ===
108
+ All commands must start with * (asterisk)
117
109
 
118
- Orchestrator Commands:
119
- *help: Show this guide
120
- *chat-mode: Start conversational mode for detailed assistance
121
- *kb-mode: Load full BMAD knowledge base
122
- *status: Show current context, active agent, and progress
123
- *yolo: Toggle skip confirmations mode
124
- *party-mode: Group chat with all agents
125
- *doc-out: Output full document
126
- *exit: Return to BMad or exit session
110
+ Core Commands:
111
+ *help ............... Show this guide
112
+ *chat-mode .......... Start conversational mode for detailed assistance
113
+ *kb-mode ............ Load full BMAD knowledge base
114
+ *status ............. Show current context, active agent, and progress
115
+ *exit ............... Return to BMad or exit session
127
116
 
128
- Agent Management:
129
- *agent {name}: Transform into a specialized agent
130
- *task {name}: Run a specific task (when in an agent)
131
- *checklist {name}: Execute a checklist (when in an agent)
117
+ Agent & Task Management:
118
+ *agent [name] ....... Transform into specialized agent (list if no name)
119
+ *task [name] ........ Run specific task (list if no name, requires agent)
120
+ *checklist [name] ... Execute checklist (list if no name, requires agent)
132
121
 
133
122
  Workflow Commands:
134
- *workflow {name}: Start a specific workflow directly
135
- *workflow-guidance: Get personalized help selecting the right workflow for your project
123
+ *workflow [name] .... Start specific workflow (list if no name)
124
+ *workflow-guidance .. Get personalized help selecting the right workflow
136
125
 
137
- Available Specialist Agents:
138
- [For each agent in bundle, show:
139
- *agent {name}: {role/title}
140
- Specializes in: {key capabilities from agent's whenToUse}
141
- Can create: {list of documents/deliverables this agent produces}]
126
+ Other Commands:
127
+ *yolo ............... Toggle skip confirmations mode
128
+ *party-mode ......... Group chat with all agents
129
+ *doc-out ............ Output full document
142
130
 
143
- Available Workflows:
144
- [For each workflow in bundle, show:
145
- *workflow {name}: {workflow description}]
131
+ === Available Specialist Agents ===
132
+ [Dynamically list each agent in bundle with format:
133
+ *agent {id}: {title}
134
+ When to use: {whenToUse}
135
+ Key deliverables: {main outputs/documents}]
146
136
 
147
- 💡 Tip: Each agent has their own tasks, templates, and checklists. Switch to an agent to see what they can do!
137
+ === Available Workflows ===
138
+ [Dynamically list each workflow in bundle with format:
139
+ *workflow {id}: {name}
140
+ Purpose: {description}]
141
+
142
+ 💡 Tip: Each agent has unique tasks, templates, and checklists. Switch to an agent to access their capabilities!
143
+
148
144
  fuzzy-matching:
149
145
  - 85% confidence threshold
150
146
  - Show numbered list if unsure
@@ -155,24 +151,17 @@ transformation:
155
151
  loading:
156
152
  - KB: Only for *kb-mode or BMAD questions
157
153
  - Agents: Only when transforming
158
- - 'Templates/Tasks: Only when executing'
154
+ - Templates/Tasks: Only when executing
159
155
  - Always indicate loading
160
156
  workflow-guidance:
161
157
  - Discover available workflows in the bundle at runtime
162
158
  - Understand each workflow's purpose, options, and decision points
163
159
  - Ask clarifying questions based on the workflow's structure
164
160
  - Guide users through workflow selection when multiple options exist
165
- - For workflows with divergent paths (e.g., simple vs complex), help users choose the right path
161
+ - For workflows with divergent paths, help users choose the right path
166
162
  - Adapt questions to the specific domain (e.g., game dev vs infrastructure vs web dev)
167
163
  - Only recommend workflows that actually exist in the current bundle
168
- workflow-guidance-command:
169
- - When *workflow-guidance is called, start an interactive session
170
- - First, list all available workflows with brief descriptions
171
- - Ask about the user's project goals and constraints
172
- - Based on answers, recommend the most suitable workflow
173
- - If a workflow has multiple paths, help choose between them (e.g., complex vs simple project flow)
174
- - Explain what documents will be created and which agents will be involved
175
- - Offer to start the recommended workflow immediately
164
+ - When *workflow-guidance is called, start an interactive session and list all available workflows with brief descriptions
176
165
  dependencies:
177
166
  tasks:
178
167
  - advanced-elicitation
@@ -298,7 +287,6 @@ dependencies:
298
287
  templates:
299
288
  - prd-tmpl
300
289
  - brownfield-prd-tmpl
301
- - simple-project-prd-tmpl
302
290
  checklists:
303
291
  - pm-checklist
304
292
  - change-checklist
@@ -3029,7 +3017,7 @@ Document sharded successfully:
3029
3017
  CRITICAL: Epics MUST be logically sequential following agile best practices:
3030
3018
 
3031
3019
  - Each epic should deliver a significant, end-to-end, fully deployable increment of testable functionality
3032
- - Epic 1 must establish foundational project infrastructure (app setup, Git, CI/CD, core services) unless we are adding new functionality to an existing app, while also delivering an initial piece of functionality, even as simple as a health-check route or display of a simple canary page
3020
+ - Epic 1 must establish foundational project infrastructure (app setup, Git, CI/CD, core services) unless we are adding new functionality to an existing app, while also delivering an initial piece of functionality, even as simple as a health-check route or display of a simple canary page - remember this when we produce the stories for the first epic!
3033
3021
  - Each subsequent epic builds upon previous epics' functionality delivering major blocks of functionality that provide tangible value to users or business when deployed
3034
3022
  - Not every project needs multiple epics, an epic needs to deliver value. For example, an API completed can deliver value even if a UI is not complete and planned for a separate epic.
3035
3023
  - Err on the side of less epics, but let the user know your rationale and offer options for splitting them if it seems some are too large or focused on disparate things.
@@ -3061,7 +3049,7 @@ CRITICAL: Epics MUST be logically sequential following agile best practices:
3061
3049
  [[LLM: CRITICAL STORY SEQUENCING REQUIREMENTS:
3062
3050
 
3063
3051
  - Stories within each epic MUST be logically sequential
3064
- - Each story should be a "vertical slice" delivering complete functionality
3052
+ - Each story should be a "vertical slice" delivering complete functionality aside from early enabler stories for project foundation
3065
3053
  - No story should depend on work from a later story or epic
3066
3054
  - Identify and note any direct prerequisite stories
3067
3055
  - Focus on "what" and "why" not "how" (leave technical implementation to Architect) yet be precise enough to support a logical sequential order of operations from story to story.
@@ -3241,554 +3229,95 @@ Do not proceed with any recommendations until the user has validated your unders
3241
3229
 
3242
3230
  [[LLM: List only the screens/views that will be modified or added]]
3243
3231
 
3244
- ### UI Consistency Requirements
3245
-
3246
- [[LLM: Specific requirements for maintaining visual and interaction consistency with existing application]]
3247
-
3248
- ^^/CONDITION: has_ui^^
3249
-
3250
- ## Technical Constraints and Integration Requirements
3251
-
3252
- [[LLM: This section replaces separate architecture documentation. Gather detailed technical constraints from existing project analysis.]]
3253
-
3254
- ### Existing Technology Stack
3255
-
3256
- [[LLM: Document the current technology stack that must be maintained or integrated with]]
3257
-
3258
- **Languages**: [[LLM: Current programming languages in use]]
3259
- **Frameworks**: [[LLM: Current frameworks and their versions]]
3260
- **Database**: [[LLM: Current database technology and schema considerations]]
3261
- **Infrastructure**: [[LLM: Current deployment and hosting infrastructure]]
3262
- **External Dependencies**: [[LLM: Current third-party services and APIs]]
3263
-
3264
- ### Integration Approach
3265
-
3266
- [[LLM: Define how the enhancement will integrate with existing architecture]]
3267
-
3268
- **Database Integration Strategy**: [[LLM: How new features will interact with existing database]]
3269
- **API Integration Strategy**: [[LLM: How new APIs will integrate with existing API structure]]
3270
- **Frontend Integration Strategy**: [[LLM: How new UI components will integrate with existing frontend]]
3271
- **Testing Integration Strategy**: [[LLM: How new tests will integrate with existing test suite]]
3272
-
3273
- ### Code Organization and Standards
3274
-
3275
- [[LLM: Based on existing project analysis, define how new code will fit existing patterns]]
3276
-
3277
- **File Structure Approach**: [[LLM: How new files will fit existing project structure]]
3278
- **Naming Conventions**: [[LLM: Existing naming conventions that must be followed]]
3279
- **Coding Standards**: [[LLM: Existing coding standards and linting rules]]
3280
- **Documentation Standards**: [[LLM: How new code documentation will match existing patterns]]
3281
-
3282
- ### Deployment and Operations
3283
-
3284
- [[LLM: How the enhancement fits existing deployment pipeline]]
3285
-
3286
- **Build Process Integration**: [[LLM: How enhancement builds with existing process]]
3287
- **Deployment Strategy**: [[LLM: How enhancement will be deployed alongside existing features]]
3288
- **Monitoring and Logging**: [[LLM: How enhancement will integrate with existing monitoring]]
3289
- **Configuration Management**: [[LLM: How new configuration will integrate with existing config]]
3290
-
3291
- ### Risk Assessment and Mitigation
3292
-
3293
- [[LLM: Identify risks specific to working with existing codebase]]
3294
-
3295
- **Technical Risks**: [[LLM: Risks related to modifying existing code]]
3296
- **Integration Risks**: [[LLM: Risks in integrating with existing systems]]
3297
- **Deployment Risks**: [[LLM: Risks in deploying alongside existing features]]
3298
- **Mitigation Strategies**: [[LLM: Specific strategies to address identified risks]]
3299
-
3300
- ## Epic and Story Structure
3301
-
3302
- [[LLM: 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?" Then present the epic structure and immediately execute tasks#advanced-elicitation display.]]
3303
-
3304
- ### Epic Approach
3305
-
3306
- [[LLM: Explain the rationale for epic structure - typically single epic for brownfield unless multiple unrelated features]]
3307
-
3308
- **Epic Structure Decision**: [[LLM: Single Epic or Multiple Epics with rationale]]
3309
-
3310
- ## Epic 1: {{enhancement_title}}
3311
-
3312
- [[LLM: Comprehensive epic that delivers the brownfield enhancement while maintaining existing functionality]]
3313
-
3314
- **Epic Goal**: [[LLM: 2-3 sentences describing the complete enhancement objective and value]]
3315
-
3316
- **Integration Requirements**: [[LLM: Key integration points with existing system]]
3317
-
3318
- [[LLM: CRITICAL STORY SEQUENCING FOR BROWNFIELD:
3319
-
3320
- - Stories must ensure existing functionality remains intact
3321
- - Each story should include verification that existing features still work
3322
- - Stories should be sequenced to minimize risk to existing system
3323
- - Include rollback considerations for each story
3324
- - Focus on incremental integration rather than big-bang changes
3325
- - Size stories for AI agent execution in existing codebase context
3326
- - 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?"
3327
- - Stories must be logically sequential with clear dependencies identified
3328
- - Each story must deliver value while maintaining system integrity]]
3329
-
3330
- <<REPEAT: story>>
3331
-
3332
- ### Story 1.{{story_number}} {{story_title}}
3333
-
3334
- As a {{user_type}},
3335
- I want {{action}},
3336
- so that {{benefit}}.
3337
-
3338
- #### Acceptance Criteria
3339
-
3340
- [[LLM: Define criteria that include both new functionality and existing system integrity]]
3341
-
3342
- <<REPEAT: criteria>>
3343
-
3344
- - {{criterion number}}: {{criteria}}
3345
-
3346
- <</REPEAT>>
3347
-
3348
- #### Integration Verification
3349
-
3350
- [[LLM: Specific verification steps to ensure existing functionality remains intact]]
3351
-
3352
- - IV1: [[LLM: Existing functionality verification requirement]]
3353
- - IV2: [[LLM: Integration point verification requirement]]
3354
- - IV3: [[LLM: Performance impact verification requirement]]
3355
-
3356
- <</REPEAT>>
3357
- ==================== END: templates#brownfield-prd-tmpl ====================
3358
-
3359
- ==================== START: templates#simple-project-prd-tmpl ====================
3360
- # {{Project Name}} Product Requirements Document (PRD)
3361
-
3362
- [[LLM: If available, review any provided document or ask if any are optionally available: Project Brief]]
3363
-
3364
- ## Goals and Background Context
3365
-
3366
- [[LLM: Populate the 2 child sections based on what we have received from user description or the provided brief. Allow user to review the 2 sections and offer changes before proceeding]]
3367
-
3368
- ### Goals
3369
-
3370
- [[LLM: Bullet list of 1 line desired outcomes the PRD will deliver if successful - user and project desires]]
3371
-
3372
- ### Background Context
3373
-
3374
- [[LLM: 1-2 short paragraphs summarizing the background context, such as what we learned in the brief without being redundant with the goals, what and why this solves a problem, what the current landscape or need is etc...]]
3375
-
3376
- ### Change Log
3377
-
3378
- [[LLM: Track document versions and changes]]
3379
-
3380
- | Date | Version | Description | Author |
3381
- | :--- | :------ | :---------- | :----- |
3382
-
3383
- ## Requirements
3384
-
3385
- [[LLM: Draft the list of functional and non functional requirements under the two child sections, and immediately execute tasks#advanced-elicitation display]]
3386
-
3387
- ### Functional
3388
-
3389
- [[LLM: Each Requirement will be a bullet markdown and an identifier sequence starting with FR`.]]
3390
- @{example: - FR6: The Todo List uses AI to detect and warn against adding potentially duplicate todo items that are worded differently.}
3391
-
3392
- ### Non Functional
3393
-
3394
- [[LLM: Each Requirement will be a bullet markdown and an identifier sequence starting with NFR`.]]
3395
- @{example: - NFR1: AWS service usage **must** aim to stay within free-tier limits where feasible.}
3396
-
3397
- ^^CONDITION: has_ui^^
3398
-
3399
- ## User Interface Design Goals
3400
-
3401
- [[LLM: Capture high-level UI/UX vision to inform story creation and also generate a prompt for Lovable or V0 if the user would like either. Steps:
3402
-
3403
- 1. Pre-fill all subsections with educated guesses based on project context
3404
- 2. Present the complete rendered section to user
3405
- 3. Clearly let the user know where assumptions were made
3406
- 4. Ask targeted questions for unclear/missing elements or areas needing more specification
3407
- 5. This is NOT detailed UI spec - focus on product vision and user goals
3408
- 6. After section completion, immediately apply `tasks#advanced-elicitation` protocol]]
3409
-
3410
- ### Overall UX Vision
3411
-
3412
- ### Key Interaction Paradigms
3413
-
3414
- ### Core Screens and Views
3415
-
3416
- [[LLM: From a product perspective, what are the most critical screens or views necessary to deliver the the PRD values and goals? This is meant to be Conceptual High Level to Drive Rough Epic or User Stories]]
3417
-
3418
- @{example}
3419
-
3420
- - Login Screen
3421
- - Main Dashboard
3422
- - Item Detail Page
3423
- - Settings Page
3424
- @{/example}
3425
-
3426
- ### Accessibility: { None, WCAG, etc }
3427
-
3428
- ### Branding
3429
-
3430
- [[LLM: Any known branding elements or style guides that must be incorporated?]]
3431
-
3432
- @{example}
3433
-
3434
- - Replicate the look and feel of early 1900s black and white cinema, including animated effects replicating film damage or projector glitches during page or state transitions.
3435
- - Attached is the full color pallet and tokens for our corporate branding.
3436
- @{/example}
3437
-
3438
- ### Target Device and Platforms
3439
-
3440
- @{example}
3441
- "Web Responsive, and all mobile platforms", "IPhone Only", "ASCII Windows Desktop"
3442
- @{/example}
3443
-
3444
- ^^/CONDITION: has_ui^^
3445
-
3446
- ## Technical Assumptions
3447
-
3448
- [[LLM: Gather technical decisions that will be used for this simple technical PRD that includes architecture decisions. Steps:
3449
-
3450
- 1. Check if `data#technical-preferences` or an attached `technical-preferences` file exists - use it to pre-populate choices
3451
- 2. Ask user about: languages, frameworks, starter templates, libraries, APIs, deployment targets
3452
- 3. For unknowns, offer guidance based on project goals and MVP scope
3453
- 4. Document ALL technical choices with rationale (why this choice fits the project)
3454
- 5. These become constraints for the Architect - be specific and complete
3455
- 6. After section completion, apply `tasks#advanced-elicitation` protocol.]]
3456
-
3457
- ### Repository Structure: { Monorepo, Polyrepo, etc...}
3458
-
3459
- ### Service Architecture
3460
-
3461
- [[LLM: CRITICAL DECISION - Document the high-level service architecture (e.g., Monolith, Microservices, Serverless functions within a Monorepo).]]
3462
-
3463
- ## Testing requirements
3464
-
3465
- [[LLM: CRITICAL DECISION - Document the testing requirements, unit only, integration, e2e, manual, need for manual testing convenience methods).]]
3466
-
3467
- ### Additional Technical Assumptions and Requests
3468
-
3469
- [[LLM: Throughout the entire process of drafting this document, if any other technical assumptions are raised or discovered appropriate for the architect, add them here as additional bulleted items]]
3470
-
3471
- ## Data Models
3472
-
3473
- [[LLM: Define the core data models/entities that will be used in the front end (if there is one), core application or back end, and if both, shared between frontend and backend:
3474
-
3475
- 1. Review PRD requirements and identify key business entities
3476
- 2. For each model, explain its purpose and relationships
3477
- 3. Include key attributes and data types
3478
- 4. Show relationships between models
3479
- 5. Create TypeScript interfaces that can be shared
3480
- 6. Discuss design decisions with user
3481
-
3482
- Create a clear conceptual model before moving to database schema.
3483
-
3484
- After presenting all data models, apply `tasks#advanced-elicitation` protocol]]
3485
-
3486
- <<REPEAT: data_model>>
3487
-
3488
- ### {{model_name}}
3489
-
3490
- **Purpose:** {{model_purpose}}
3491
-
3492
- **Key Attributes:**
3493
-
3494
- - {{attribute_1}}: {{type_1}} - {{description_1}}
3495
- - {{attribute_2}}: {{type_2}} - {{description_2}}
3496
-
3497
- **TypeScript Interface:**
3498
-
3499
- ````typescript
3500
- {
3501
- {
3502
- model_interface;
3503
- }
3504
- }
3505
- ```text
3506
-
3507
- **Relationships:**
3508
-
3509
- - {{relationship_1}}
3510
- - {{relationship_2}}
3511
- <</REPEAT>>
3512
-
3513
- @{example: data_model}
3514
-
3515
- ### User
3516
-
3517
- **Purpose:** Represents authenticated users in the system
3518
-
3519
- **Key Attributes:**
3520
-
3521
- - id: string - Unique identifier
3522
- - email: string - User's email address
3523
- - name: string - Display name
3524
- - role: enum - User permission level
3525
- - timestamps: Date - Created and updated times
3526
-
3527
- **TypeScript Interface:**
3528
-
3529
- ```typescript
3530
- interface User {
3531
- id: string;
3532
- email: string;
3533
- name: string;
3534
- role: "admin" | "user" | "guest";
3535
- createdAt: Date;
3536
- updatedAt: Date;
3537
- profile?: UserProfile;
3538
- }
3539
-
3540
- interface UserProfile {
3541
- avatarUrl?: string;
3542
- bio?: string;
3543
- preferences: Record<string, any>;
3544
- }
3545
- ````
3546
-
3547
- **Relationships:**
3548
-
3549
- - Has many Posts (1:n)
3550
- - Has one Profile (1:1)
3551
- @{/example}
3552
-
3553
- ## REST API Spec
3554
-
3555
- [[LLM: Based on the chosen API style from Tech Stack:
3556
-
3557
- 1. If REST API, create an OpenAPI 3.0 specification
3558
- 2. If GraphQL, provide the GraphQL schema
3559
- 3. If tRPC, show router definitions
3560
- 4. Include all endpoints from epics/stories
3561
- 5. Define request/response schemas based on data models
3562
- 6. Document authentication requirements
3563
- 7. Include example requests/responses
3564
-
3565
- Use appropriate format for the chosen API style. If no API (e.g., static site), skip this section.]]
3566
-
3567
- ^^CONDITION: has_rest_api^^
3568
-
3569
- ````yml
3570
- openapi: 3.0.0
3571
- info:
3572
- title:
3573
- '[object Object]': null
3574
- version:
3575
- '[object Object]': null
3576
- description:
3577
- '[object Object]': null
3578
- servers:
3579
- - url:
3580
- '[object Object]': null
3581
- description:
3582
- '[object Object]': null
3583
- ```text
3584
-
3585
- ^^/CONDITION: has_rest_api^^
3586
-
3587
- ^^CONDITION: has_graphql_api^^
3588
-
3589
- ```graphql
3590
- # GraphQL Schema
3591
- {{graphql_schema}}
3592
- ````
3593
-
3594
- ^^/CONDITION: has_graphql_api^^
3595
-
3596
- ^^CONDITION: has_trpc_api^^
3597
-
3598
- ```typescript
3599
- // tRPC Router Definitions
3600
- {
3601
- {
3602
- trpc_routers;
3603
- }
3604
- }
3605
- ```
3606
-
3607
- ^^/CONDITION: has_trpc_api^^
3608
-
3609
- [[LLM: After presenting the API spec (or noting its absence if not applicable), apply `tasks#advanced-elicitation` protocol]]
3610
-
3611
- ## Components
3612
-
3613
- [[LLM: Based on the architectural patterns, tech stack, and data models from above:
3614
-
3615
- 1. Identify major logical components/services across the fullstack
3616
- 2. Consider both frontend and backend components
3617
- 3. Define clear boundaries and interfaces between components
3618
- 4. For each component, specify:
3619
-
3620
- - Primary responsibility
3621
- - Key interfaces/APIs exposed
3622
- - Dependencies on other components
3623
- - Technology specifics based on tech stack choices
3624
-
3625
- 5. Create component diagrams where helpful
3626
- 6. After presenting all components, apply `tasks#advanced-elicitation` protocol]]
3627
-
3628
- <<REPEAT: component>>
3629
-
3630
- ### {{component_name}}
3631
-
3632
- **Responsibility:** {{component_description}}
3633
-
3634
- **Key Interfaces:**
3635
-
3636
- - {{interface_1}}
3637
- - {{interface_2}}
3638
-
3639
- **Dependencies:** {{dependencies}}
3640
-
3641
- **Technology Stack:** {{component_tech_details}}
3642
- <</REPEAT>>
3643
-
3644
- ### Component Diagrams
3645
-
3646
- [[LLM: Create Mermaid diagrams to visualize component relationships. Options:
3647
-
3648
- - C4 Container diagram for high-level view
3649
- - Component diagram for detailed internal structure
3650
- - Sequence diagrams for complex interactions
3651
- Choose the most appropriate for clarity
3652
-
3653
- After presenting the diagrams, apply `tasks#advanced-elicitation` protocol]]
3654
-
3655
- ## External APIs
3656
-
3657
- [[LLM: For each external service integration:
3658
-
3659
- 1. Identify APIs needed based on PRD requirements and component design
3660
- 2. If documentation URLs are unknown, ask user for specifics
3661
- 3. Document authentication methods and security considerations
3662
- 4. List specific endpoints that will be used
3663
- 5. Note any rate limits or usage constraints
3664
-
3665
- If no external APIs are needed, state this explicitly and skip to next section.]]
3666
-
3667
- ^^CONDITION: has_external_apis^^
3668
-
3669
- <<REPEAT: external_api>>
3670
-
3671
- ### {{api_name}} API
3672
-
3673
- - **Purpose:** {{api_purpose}}
3674
- - **Documentation:** {{api_docs_url}}
3675
- - **Base URL(s):** {{api_base_url}}
3676
- - **Authentication:** {{auth_method}}
3677
- - **Rate Limits:** {{rate_limits}}
3678
-
3679
- **Key Endpoints Used:**
3680
- <<REPEAT: endpoint>>
3681
-
3682
- - `{{method}} {{endpoint_path}}` - {{endpoint_purpose}}
3683
- <</REPEAT>>
3684
-
3685
- **Integration Notes:** {{integration_considerations}}
3686
- <</REPEAT>>
3687
-
3688
- @{example: external_api}
3689
-
3690
- ### Stripe API
3691
-
3692
- - **Purpose:** Payment processing and subscription management
3693
- - **Documentation:** https://stripe.com/docs/api
3694
- - **Base URL(s):** `https://api.stripe.com/v1`
3695
- - **Authentication:** Bearer token with secret key
3696
- - **Rate Limits:** 100 requests per second
3697
-
3698
- **Key Endpoints Used:**
3232
+ ### UI Consistency Requirements
3699
3233
 
3700
- - `POST /customers` - Create customer profiles
3701
- - `POST /payment_intents` - Process payments
3702
- - `POST /subscriptions` - Manage subscriptions
3703
- @{/example}
3234
+ [[LLM: Specific requirements for maintaining visual and interaction consistency with existing application]]
3704
3235
 
3705
- ^^/CONDITION: has_external_apis^^
3236
+ ^^/CONDITION: has_ui^^
3706
3237
 
3707
- [[LLM: After presenting external APIs (or noting their absence), apply `tasks#advanced-elicitation` protocol]]
3238
+ ## Technical Constraints and Integration Requirements
3708
3239
 
3709
- ## Coding Standards
3240
+ [[LLM: This section replaces separate architecture documentation. Gather detailed technical constraints from existing project analysis.]]
3710
3241
 
3711
- [[LLM: Define MINIMAL but CRITICAL standards for AI agents. Focus only on project-specific rules that prevent common mistakes. These will be used by dev agents.
3242
+ ### Existing Technology Stack
3712
3243
 
3713
- After presenting this section, apply `tasks#advanced-elicitation` protocol]]
3244
+ [[LLM: Document the current technology stack that must be maintained or integrated with]]
3714
3245
 
3715
- ### Critical Fullstack Rules
3246
+ **Languages**: [[LLM: Current programming languages in use]]
3247
+ **Frameworks**: [[LLM: Current frameworks and their versions]]
3248
+ **Database**: [[LLM: Current database technology and schema considerations]]
3249
+ **Infrastructure**: [[LLM: Current deployment and hosting infrastructure]]
3250
+ **External Dependencies**: [[LLM: Current third-party services and APIs]]
3716
3251
 
3717
- <<REPEAT: critical_rule>>
3252
+ ### Integration Approach
3718
3253
 
3719
- - **{{rule_name}}:** {{rule_description}}
3720
- <</REPEAT>>
3254
+ [[LLM: Define how the enhancement will integrate with existing architecture]]
3721
3255
 
3722
- @{example: critical_rules}
3256
+ **Database Integration Strategy**: [[LLM: How new features will interact with existing database]]
3257
+ **API Integration Strategy**: [[LLM: How new APIs will integrate with existing API structure]]
3258
+ **Frontend Integration Strategy**: [[LLM: How new UI components will integrate with existing frontend]]
3259
+ **Testing Integration Strategy**: [[LLM: How new tests will integrate with existing test suite]]
3723
3260
 
3724
- - **Type Sharing:** Always define types in packages/shared and import from there
3725
- - **API Calls:** Never make direct HTTP calls - use the service layer
3726
- - **Environment Variables:** Access only through config objects, never process.env directly
3727
- - **Error Handling:** All API routes must use the standard error handler
3728
- - **State Updates:** Never mutate state directly - use proper state management patterns
3729
- @{/example}
3261
+ ### Code Organization and Standards
3730
3262
 
3731
- ### Naming Conventions
3263
+ [[LLM: Based on existing project analysis, define how new code will fit existing patterns]]
3732
3264
 
3733
- | Element | Frontend | Backend | Example |
3734
- | :-------------- | :------------------- | :--------- | :------------------ |
3735
- | Components | PascalCase | - | `UserProfile.tsx` |
3736
- | Hooks | camelCase with 'use' | - | `useAuth.ts` |
3737
- | API Routes | - | kebab-case | `/api/user-profile` |
3738
- | Database Tables | - | snake_case | `user_profiles` |
3265
+ **File Structure Approach**: [[LLM: How new files will fit existing project structure]]
3266
+ **Naming Conventions**: [[LLM: Existing naming conventions that must be followed]]
3267
+ **Coding Standards**: [[LLM: Existing coding standards and linting rules]]
3268
+ **Documentation Standards**: [[LLM: How new code documentation will match existing patterns]]
3739
3269
 
3740
- ## Epics
3270
+ ### Deployment and Operations
3741
3271
 
3742
- [[LLM: First, present a high-level list of all epics for user approval, the epic_list and immediately execute tasks#advanced-elicitation display. Each epic should have a title and a short (1 sentence) goal statement. This allows the user to review the overall structure before diving into details.
3272
+ [[LLM: How the enhancement fits existing deployment pipeline]]
3743
3273
 
3744
- CRITICAL: Epics MUST be logically sequential following agile best practices:
3274
+ **Build Process Integration**: [[LLM: How enhancement builds with existing process]]
3275
+ **Deployment Strategy**: [[LLM: How enhancement will be deployed alongside existing features]]
3276
+ **Monitoring and Logging**: [[LLM: How enhancement will integrate with existing monitoring]]
3277
+ **Configuration Management**: [[LLM: How new configuration will integrate with existing config]]
3745
3278
 
3746
- - Each epic should deliver a significant, end-to-end, fully deployable increment of testable functionality
3747
- - Epic 1 must establish foundational project infrastructure (app setup, Git, CI/CD, core services) unless we are adding new functionality to an existing app, while also delivering an initial piece of functionality, even as simple as a health-check route or display of a simple canary page
3748
- - Each subsequent epic builds upon previous epics' functionality delivering major blocks of functionality that provide tangible value to users or business when deployed
3749
- - Not every project needs multiple epics, an epic needs to deliver value. For example, an API completed can deliver value even if a UI is not complete and planned for a separate epic.
3750
- - Err on the side of less epics, but let the user know your rationale and offer options for splitting them if it seems some are too large or focused on disparate things.
3751
- - Cross Cutting Concerns should flow through epics and stories and not be final stories. For example, adding a logging framework as a last story of an epic, or at the end of a project as a final epic or story would be terrible as we would not have logging from the beginning.]]
3279
+ ### Risk Assessment and Mitigation
3752
3280
 
3753
- <<REPEAT: epic_list>>
3281
+ [[LLM: Identify risks specific to working with existing codebase]]
3754
3282
 
3755
- - Epic{{epic_number}} {{epic_title}}: {{short_goal}}
3283
+ **Technical Risks**: [[LLM: Risks related to modifying existing code]]
3284
+ **Integration Risks**: [[LLM: Risks in integrating with existing systems]]
3285
+ **Deployment Risks**: [[LLM: Risks in deploying alongside existing features]]
3286
+ **Mitigation Strategies**: [[LLM: Specific strategies to address identified risks]]
3756
3287
 
3757
- <</REPEAT>>
3288
+ ## Epic and Story Structure
3758
3289
 
3759
- @{example: epic_list}
3290
+ [[LLM: 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?" Then present the epic structure and immediately execute tasks#advanced-elicitation display.]]
3760
3291
 
3761
- 1. Foundation & Core Infrastructure: Establish project setup, authentication, and basic user management
3762
- 2. Core Business Entities: Create and manage primary domain objects with CRUD operations
3763
- 3. User Workflows & Interactions: Enable key user journeys and business processes
3764
- 4. Reporting & Analytics: Provide insights and data visualization for users
3292
+ ### Epic Approach
3765
3293
 
3766
- @{/example}
3294
+ [[LLM: Explain the rationale for epic structure - typically single epic for brownfield unless multiple unrelated features]]
3767
3295
 
3768
- [[LLM: After the epic list is approved, present each `epic_details` with all its stories and acceptance criteria as a complete review unit and immediately execute tasks#advanced-elicitation display, before moving on to the next epic.]]
3296
+ **Epic Structure Decision**: [[LLM: Single Epic or Multiple Epics with rationale]]
3769
3297
 
3770
- <<REPEAT: epic_details>>
3298
+ ## Epic 1: {{enhancement_title}}
3771
3299
 
3772
- ## Epic {{epic_number}} {{epic_title}}
3300
+ [[LLM: Comprehensive epic that delivers the brownfield enhancement while maintaining existing functionality]]
3773
3301
 
3774
- {{epic_goal}} [[LLM: Expanded goal - 2-3 sentences describing the objective and value all the stories will achieve]]
3302
+ **Epic Goal**: [[LLM: 2-3 sentences describing the complete enhancement objective and value]]
3775
3303
 
3776
- [[LLM: CRITICAL STORY SEQUENCING REQUIREMENTS:
3304
+ **Integration Requirements**: [[LLM: Key integration points with existing system]]
3777
3305
 
3778
- - Stories within each epic MUST be logically sequential
3779
- - Each story should be a "vertical slice" delivering complete functionality
3780
- - No story should depend on work from a later story or epic
3781
- - Identify and note any direct prerequisite stories
3782
- - Focus on "what" and "why" not "how" (leave technical implementation to Architect) yet be precise enough to support a logical sequential order of operations from story to story.
3783
- - Ensure each story delivers clear user or business value, try to avoid enablers and build them into stories that deliver value.
3784
- - Size stories for AI agent execution: Each story must be completable by a single AI agent in one focused session without context overflow
3785
- - Think "junior developer working for 2-4 hours" - stories must be small, focused, and self-contained
3786
- - If a story seems complex, break it down further as long as it can deliver a vertical slice
3787
- - Each story should result in working, testable code before the agent's context window fills]]
3306
+ [[LLM: CRITICAL STORY SEQUENCING FOR BROWNFIELD:
3307
+
3308
+ - Stories must ensure existing functionality remains intact
3309
+ - Each story should include verification that existing features still work
3310
+ - Stories should be sequenced to minimize risk to existing system
3311
+ - Include rollback considerations for each story
3312
+ - Focus on incremental integration rather than big-bang changes
3313
+ - Size stories for AI agent execution in existing codebase context
3314
+ - 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?"
3315
+ - Stories must be logically sequential with clear dependencies identified
3316
+ - Each story must deliver value while maintaining system integrity]]
3788
3317
 
3789
3318
  <<REPEAT: story>>
3790
3319
 
3791
- ### Story {{epic_number}}.{{story_number}} {{story_title}}
3320
+ ### Story 1.{{story_number}} {{story_title}}
3792
3321
 
3793
3322
  As a {{user_type}},
3794
3323
  I want {{action}},
@@ -3796,29 +3325,24 @@ so that {{benefit}}.
3796
3325
 
3797
3326
  #### Acceptance Criteria
3798
3327
 
3799
- [[LLM: Define clear, comprehensive, and testable acceptance criteria that:
3800
-
3801
- - Precisely define what "done" means from a functional perspective
3802
- - Are unambiguous and serve as basis for verification
3803
- - Include any critical non-functional requirements from the PRD
3804
- - Consider local testability for backend/data components
3805
- - Specify UI/UX requirements and framework adherence where applicable
3806
- - Avoid cross-cutting concerns that should be in other stories or PRD sections]]
3328
+ [[LLM: Define criteria that include both new functionality and existing system integrity]]
3807
3329
 
3808
3330
  <<REPEAT: criteria>>
3809
3331
 
3810
3332
  - {{criterion number}}: {{criteria}}
3811
3333
 
3812
- <</REPEAT>>
3813
- <</REPEAT>>
3814
3334
  <</REPEAT>>
3815
3335
 
3816
- ## Next Steps
3336
+ #### Integration Verification
3817
3337
 
3818
- ### Design Architect Prompt
3338
+ [[LLM: Specific verification steps to ensure existing functionality remains intact]]
3819
3339
 
3820
- [[LLM: This section will contain the prompt for the Design Architect, keep it short and to the point to initiate create architecture mode using this document as input.]]
3821
- ==================== END: templates#simple-project-prd-tmpl ====================
3340
+ - IV1: [[LLM: Existing functionality verification requirement]]
3341
+ - IV2: [[LLM: Integration point verification requirement]]
3342
+ - IV3: [[LLM: Performance impact verification requirement]]
3343
+
3344
+ <</REPEAT>>
3345
+ ==================== END: templates#brownfield-prd-tmpl ====================
3822
3346
 
3823
3347
  ==================== START: checklists#pm-checklist ====================
3824
3348
  # Product Manager (PM) Requirements Checklist
@@ -5821,7 +5345,7 @@ Document the choice and key services that will be used.]]
5821
5345
 
5822
5346
  ### Repository Structure
5823
5347
 
5824
- [[LLM: Define the repository approach based on PRD requirements and platform choice:
5348
+ [[LLM: Define the repository approach based on PRD requirements and platform choice, explain your rationale or ask quetsions to the user if unsure:
5825
5349
 
5826
5350
  1. For modern fullstack apps, monorepo is often preferred
5827
5351
  2. Consider tooling (Nx, Turborepo, Lerna, npm workspaces)
@@ -5846,9 +5370,9 @@ Document the choice and key services that will be used.]]
5846
5370
 
5847
5371
  Use appropriate diagram type for clarity.]]
5848
5372
 
5849
- ````mermaid
5373
+ ```mermaid
5850
5374
  {{architecture_diagram}}
5851
- ```text
5375
+ ```
5852
5376
 
5853
5377
  ### Architectural Patterns
5854
5378
 
@@ -5959,7 +5483,7 @@ After presenting all data models, apply `tasks#advanced-elicitation` protocol]]
5959
5483
  model_interface;
5960
5484
  }
5961
5485
  }
5962
- ````
5486
+ ```
5963
5487
 
5964
5488
  **Relationships:**
5965
5489
 
@@ -5983,7 +5507,7 @@ After presenting all data models, apply `tasks#advanced-elicitation` protocol]]
5983
5507
 
5984
5508
  **TypeScript Interface:**
5985
5509
 
5986
- ````typescript
5510
+ ```typescript
5987
5511
  interface User {
5988
5512
  id: string;
5989
5513
  email: string;
@@ -5999,7 +5523,7 @@ interface UserProfile {
5999
5523
  bio?: string;
6000
5524
  preferences: Record<string, any>;
6001
5525
  }
6002
- ```text
5526
+ ```
6003
5527
 
6004
5528
  **Relationships:**
6005
5529
 
@@ -6037,16 +5561,16 @@ servers:
6037
5561
  '[object Object]': null
6038
5562
  description:
6039
5563
  '[object Object]': null
6040
- ````
5564
+ ```
6041
5565
 
6042
5566
  ^^/CONDITION: has_rest_api^^
6043
5567
 
6044
5568
  ^^CONDITION: has_graphql_api^^
6045
5569
 
6046
- ````graphql
5570
+ ```graphql
6047
5571
  # GraphQL Schema
6048
5572
  {{graphql_schema}}
6049
- ```text
5573
+ ```
6050
5574
 
6051
5575
  ^^/CONDITION: has_graphql_api^^
6052
5576
 
@@ -6059,7 +5583,7 @@ servers:
6059
5583
  trpc_routers;
6060
5584
  }
6061
5585
  }
6062
- ````
5586
+ ```
6063
5587
 
6064
5588
  ^^/CONDITION: has_trpc_api^^
6065
5589
 
@@ -6204,19 +5728,19 @@ After presenting this section, apply `tasks#advanced-elicitation` protocol]]
6204
5728
 
6205
5729
  **Component Organization:**
6206
5730
 
6207
- `````text
6208
- {{component_structure}}
6209
5731
  ```text
5732
+ {{component_structure}}
5733
+ ```
6210
5734
 
6211
5735
  **Component Template:**
6212
5736
 
6213
- ````typescript
5737
+ ```typescript
6214
5738
  {
6215
5739
  {
6216
5740
  component_template;
6217
5741
  }
6218
5742
  }
6219
- ```text
5743
+ ```
6220
5744
 
6221
5745
  ### State Management Architecture
6222
5746
 
@@ -6230,7 +5754,7 @@ After presenting this section, apply `tasks#advanced-elicitation` protocol]]
6230
5754
  state_structure;
6231
5755
  }
6232
5756
  }
6233
- `````
5757
+ ```
6234
5758
 
6235
5759
  **State Management Patterns:**
6236
5760
 
@@ -6245,17 +5769,17 @@ After presenting this section, apply `tasks#advanced-elicitation` protocol]]
6245
5769
 
6246
5770
  ```text
6247
5771
  {{route_structure}}
6248
- ```text
5772
+ ```
6249
5773
 
6250
5774
  **Protected Route Pattern:**
6251
5775
 
6252
- ````typescript
5776
+ ```typescript
6253
5777
  {
6254
5778
  {
6255
5779
  protected_route_example;
6256
5780
  }
6257
5781
  }
6258
- ```text
5782
+ ```
6259
5783
 
6260
5784
  ### Frontend Services Layer
6261
5785
 
@@ -6269,17 +5793,17 @@ After presenting this section, apply `tasks#advanced-elicitation` protocol]]
6269
5793
  api_client_setup;
6270
5794
  }
6271
5795
  }
6272
- ````
5796
+ ```
6273
5797
 
6274
5798
  **Service Example:**
6275
5799
 
6276
- ````typescript
5800
+ ```typescript
6277
5801
  {
6278
5802
  {
6279
5803
  service_example;
6280
5804
  }
6281
5805
  }
6282
- ```text
5806
+ ```
6283
5807
 
6284
5808
  ## Backend Architecture
6285
5809
 
@@ -6294,11 +5818,11 @@ After presenting this section, apply `tasks#advanced-elicitation` protocol]]
6294
5818
  ^^CONDITION: serverless^^
6295
5819
  **Function Organization:**
6296
5820
 
6297
- ````
5821
+ ```text
6298
5822
 
6299
5823
  {{function_structure}}
6300
5824
 
6301
- ````text
5825
+ ```
6302
5826
 
6303
5827
  **Function Template:**
6304
5828
 
@@ -6308,26 +5832,26 @@ After presenting this section, apply `tasks#advanced-elicitation` protocol]]
6308
5832
  function_template;
6309
5833
  }
6310
5834
  }
6311
- ````
5835
+ ```
6312
5836
 
6313
5837
  ^^/CONDITION: serverless^^
6314
5838
 
6315
5839
  ^^CONDITION: traditional_server^^
6316
5840
  **Controller/Route Organization:**
6317
5841
 
6318
- `````text
6319
- {{controller_structure}}
6320
5842
  ```text
5843
+ {{controller_structure}}
5844
+ ```
6321
5845
 
6322
5846
  **Controller Template:**
6323
5847
 
6324
- ````typescript
5848
+ ```typescript
6325
5849
  {
6326
5850
  {
6327
5851
  controller_template;
6328
5852
  }
6329
5853
  }
6330
- ```text
5854
+ ```
6331
5855
 
6332
5856
  ^^/CONDITION: traditional_server^^
6333
5857
 
@@ -6339,17 +5863,17 @@ After presenting this section, apply `tasks#advanced-elicitation` protocol]]
6339
5863
 
6340
5864
  ```sql
6341
5865
  {{database_schema}}
6342
- `````
5866
+ ```
6343
5867
 
6344
5868
  **Data Access Layer:**
6345
5869
 
6346
- ````typescript
5870
+ ```typescript
6347
5871
  {
6348
5872
  {
6349
5873
  repository_pattern;
6350
5874
  }
6351
5875
  }
6352
- ```text
5876
+ ```
6353
5877
 
6354
5878
  ### Authentication and Authorization
6355
5879
 
@@ -6359,17 +5883,17 @@ After presenting this section, apply `tasks#advanced-elicitation` protocol]]
6359
5883
 
6360
5884
  ```mermaid
6361
5885
  {{auth_flow_diagram}}
6362
- ````
5886
+ ```
6363
5887
 
6364
5888
  **Middleware/Guards:**
6365
5889
 
6366
- ````typescript
5890
+ ```typescript
6367
5891
  {
6368
5892
  {
6369
5893
  auth_middleware;
6370
5894
  }
6371
5895
  }
6372
- ```text
5896
+ ```
6373
5897
 
6374
5898
  ## Unified Project Structure
6375
5899
 
@@ -6429,7 +5953,7 @@ After presenting this section, apply `tasks#advanced-elicitation` protocol]]
6429
5953
  ├── package.json # Root package.json
6430
5954
  ├── {{monorepo_config}} # Monorepo configuration
6431
5955
  └── README.md
6432
- ````
5956
+ ```
6433
5957
 
6434
5958
  @{example: vercel_structure}
6435
5959
  apps/
@@ -6451,19 +5975,19 @@ After presenting this section, apply `tasks#advanced-elicitation` protocol]]
6451
5975
 
6452
5976
  **Prerequisites:**
6453
5977
 
6454
- ````bash
5978
+ ```bash
6455
5979
  {{prerequisites_commands}}
6456
- ```text
5980
+ ```
6457
5981
 
6458
5982
  **Initial Setup:**
6459
5983
 
6460
5984
  ```bash
6461
5985
  {{setup_commands}}
6462
- ````
5986
+ ```
6463
5987
 
6464
5988
  **Development Commands:**
6465
5989
 
6466
- ````bash
5990
+ ```bash
6467
5991
  # Start all services
6468
5992
  {{start_all_command}}
6469
5993
 
@@ -6475,7 +5999,7 @@ After presenting this section, apply `tasks#advanced-elicitation` protocol]]
6475
5999
 
6476
6000
  # Run tests
6477
6001
  {{test_commands}}
6478
- ```text
6002
+ ```
6479
6003
 
6480
6004
  ### Environment Configuration
6481
6005
 
@@ -6490,7 +6014,7 @@ After presenting this section, apply `tasks#advanced-elicitation` protocol]]
6490
6014
 
6491
6015
  # Shared
6492
6016
  {{shared_env_vars}}
6493
- ````
6017
+ ```
6494
6018
 
6495
6019
  ## Deployment Architecture
6496
6020
 
@@ -6513,9 +6037,9 @@ After presenting this section, apply `tasks#advanced-elicitation` protocol]]
6513
6037
 
6514
6038
  ### CI/CD Pipeline
6515
6039
 
6516
- ````yaml
6040
+ ```yaml
6517
6041
  '[object Object]': null
6518
- ```text
6042
+ ```
6519
6043
 
6520
6044
  ### Environments
6521
6045
 
@@ -6573,7 +6097,7 @@ After presenting this section, apply `tasks#advanced-elicitation` protocol]]
6573
6097
 
6574
6098
  ### Testing Pyramid
6575
6099
 
6576
- ````
6100
+ ```text
6577
6101
 
6578
6102
  E2E Tests
6579
6103
  / \
@@ -6582,17 +6106,17 @@ After presenting this section, apply `tasks#advanced-elicitation` protocol]]
6582
6106
  / \
6583
6107
  Frontend Unit Backend Unit
6584
6108
 
6585
- ```text
6109
+ ```
6586
6110
 
6587
6111
  ### Test Organization
6588
6112
 
6589
6113
  **Frontend Tests:**
6590
6114
 
6591
- ```
6115
+ ```text
6592
6116
 
6593
6117
  {{frontend_test_structure}}
6594
6118
 
6595
- ````text
6119
+ ```
6596
6120
 
6597
6121
  **Backend Tests:**
6598
6122
 
@@ -6600,15 +6124,15 @@ After presenting this section, apply `tasks#advanced-elicitation` protocol]]
6600
6124
 
6601
6125
  {{backend_test_structure}}
6602
6126
 
6603
- ```text
6127
+ ```
6604
6128
 
6605
6129
  **E2E Tests:**
6606
6130
 
6607
- ````
6131
+ ```text
6608
6132
 
6609
6133
  {{e2e_test_structure}}
6610
6134
 
6611
- ````text
6135
+ ```
6612
6136
 
6613
6137
  ### Test Examples
6614
6138
 
@@ -6620,17 +6144,17 @@ After presenting this section, apply `tasks#advanced-elicitation` protocol]]
6620
6144
  frontend_test_example;
6621
6145
  }
6622
6146
  }
6623
- ````
6147
+ ```
6624
6148
 
6625
6149
  **Backend API Test:**
6626
6150
 
6627
- ````typescript
6151
+ ```typescript
6628
6152
  {
6629
6153
  {
6630
6154
  backend_test_example;
6631
6155
  }
6632
6156
  }
6633
- ```text
6157
+ ```
6634
6158
 
6635
6159
  **E2E Test:**
6636
6160
 
@@ -6640,7 +6164,7 @@ After presenting this section, apply `tasks#advanced-elicitation` protocol]]
6640
6164
  e2e_test_example;
6641
6165
  }
6642
6166
  }
6643
- ````
6167
+ ```
6644
6168
 
6645
6169
  ## Coding Standards
6646
6170
 
@@ -6681,9 +6205,9 @@ After presenting this section, apply `tasks#advanced-elicitation` protocol]]
6681
6205
 
6682
6206
  ### Error Flow
6683
6207
 
6684
- ````mermaid
6208
+ ```mermaid
6685
6209
  {{error_flow_diagram}}
6686
- ```text
6210
+ ```
6687
6211
 
6688
6212
  ### Error Response Format
6689
6213
 
@@ -6697,17 +6221,17 @@ interface ApiError {
6697
6221
  requestId: string;
6698
6222
  };
6699
6223
  }
6700
- ````
6224
+ ```
6701
6225
 
6702
6226
  ### Frontend Error Handling
6703
6227
 
6704
- ````typescript
6228
+ ```typescript
6705
6229
  {
6706
6230
  {
6707
6231
  frontend_error_handler;
6708
6232
  }
6709
6233
  }
6710
- ```text
6234
+ ```
6711
6235
 
6712
6236
  ### Backend Error Handling
6713
6237
 
@@ -6717,7 +6241,7 @@ interface ApiError {
6717
6241
  backend_error_handler;
6718
6242
  }
6719
6243
  }
6720
- ````
6244
+ ```
6721
6245
 
6722
6246
  ## Monitoring and Observability
6723
6247
 
@@ -8268,8 +7792,7 @@ workflow:
8268
7792
  - api-prototype
8269
7793
  - simple-service
8270
7794
 
8271
- # For Complex Services (Production APIs, Multiple Endpoints)
8272
- complex_service_sequence:
7795
+ sequence:
8273
7796
  - agent: analyst
8274
7797
  creates: project-brief.md
8275
7798
  optional_steps:
@@ -8309,65 +7832,33 @@ workflow:
8309
7832
  action: move_to_ide
8310
7833
  notes: "All planning artifacts complete. Move to IDE environment to begin development. Explain to the user the IDE Development Workflow next steps: data#bmad-kb:IDE Development Workflow"
8311
7834
 
8312
- # For Simple Services (Simple APIs, Single Purpose Services)
8313
- simple_service_sequence:
8314
- - step: service_scope
8315
- action: assess complexity
8316
- notes: "First, assess if this needs full planning (use complex_service_sequence) or can be a simple API/service."
8317
-
8318
- - agent: analyst
8319
- creates: project-brief.md
8320
- optional_steps:
8321
- - brainstorming_session
8322
- notes: "Creates focused project brief for simple service. SAVE OUTPUT: Copy final project-brief.md to your project's docs/ folder."
8323
-
8324
- - agent: pm
8325
- creates: simple_epic OR single_story
8326
- uses: create-epic OR create-story
8327
- requires: project-brief.md
8328
- notes: "Create simple epic or story for API endpoints instead of full PRD for rapid development."
8329
-
8330
- - workflow_end:
8331
- action: move_to_ide
8332
- notes: "Simple service defined. Move to IDE environment to begin development. Explain to the user the IDE Development Workflow next steps: data#bmad-kb:IDE Development Workflow"
8333
-
8334
7835
  flow_diagram: |
8335
7836
  ```mermaid
8336
7837
  graph TD
8337
- A[Start: Service Development] --> B{Service Complexity?}
8338
- B -->|Complex/Production| C[analyst: project-brief.md]
8339
- B -->|Simple/Prototype| D[analyst: focused project-brief.md]
8340
-
8341
- C --> E[pm: prd.md]
8342
- E --> F[architect: architecture.md]
8343
- F --> G{Architecture suggests PRD changes?}
8344
- G -->|Yes| H[pm: update prd.md]
8345
- G -->|No| I[po: validate all artifacts]
8346
- H --> I
8347
- I --> J{PO finds issues?}
8348
- J -->|Yes| K[Return to relevant agent for fixes]
8349
- J -->|No| L[Move to IDE Environment]
8350
- K --> I
8351
-
8352
- D --> M[pm: simple epic or story]
8353
- M --> N[Move to IDE Environment]
8354
-
8355
- C -.-> C1[Optional: brainstorming]
8356
- C -.-> C2[Optional: market research]
8357
- F -.-> F1[Optional: technical research]
8358
- D -.-> D1[Optional: brainstorming]
8359
-
8360
- style L fill:#90EE90
8361
- style N fill:#90EE90
7838
+ A[Start: Service Development] --> B[analyst: project-brief.md]
7839
+ B --> C[pm: prd.md]
7840
+ C --> D[architect: architecture.md]
7841
+ D --> E{Architecture suggests PRD changes?}
7842
+ E -->|Yes| F[pm: update prd.md]
7843
+ E -->|No| G[po: validate all artifacts]
7844
+ F --> G
7845
+ G --> H{PO finds issues?}
7846
+ H -->|Yes| I[Return to relevant agent for fixes]
7847
+ H -->|No| J[Move to IDE Environment]
7848
+ I --> G
7849
+
7850
+ B -.-> B1[Optional: brainstorming]
7851
+ B -.-> B2[Optional: market research]
7852
+ D -.-> D1[Optional: technical research]
7853
+
7854
+ style J fill:#90EE90
7855
+ style B fill:#FFE4B5
8362
7856
  style C fill:#FFE4B5
8363
- style E fill:#FFE4B5
8364
- style F fill:#FFE4B5
8365
- style D fill:#FFB6C1
8366
- style M fill:#FFB6C1
7857
+ style D fill:#FFE4B5
8367
7858
  ```
8368
7859
 
8369
7860
  decision_guidance:
8370
- use_complex_sequence_when:
7861
+ when_to_use:
8371
7862
  - Building production APIs or microservices
8372
7863
  - Multiple endpoints and complex business logic
8373
7864
  - Need comprehensive documentation and testing
@@ -8375,27 +7866,14 @@ workflow:
8375
7866
  - Long-term maintenance expected
8376
7867
  - Enterprise or external-facing APIs
8377
7868
 
8378
- use_simple_sequence_when:
8379
- - Building simple APIs or single-purpose services
8380
- - Few endpoints with straightforward logic
8381
- - Prototyping or proof-of-concept APIs
8382
- - Solo developer or small team
8383
- - Internal tools or utilities
8384
- - Learning or experimental projects
8385
-
8386
7869
  handoff_prompts:
8387
- # Complex sequence prompts
8388
7870
  analyst_to_pm: "Project brief is complete. Save it as docs/project-brief.md in your project, then create the PRD."
8389
7871
  pm_to_architect: "PRD is ready. Save it as docs/prd.md in your project, then create the service architecture."
8390
7872
  architect_review: "Architecture complete. Save it as docs/architecture.md. Do you suggest any changes to the PRD stories or need new stories added?"
8391
7873
  architect_to_pm: "Please update the PRD with the suggested story changes, then re-export the complete prd.md to docs/."
8392
7874
  updated_to_po: "All documents ready in docs/ folder. Please validate all artifacts for consistency."
8393
7875
  po_issues: "PO found issues with [document]. Please return to [agent] to fix and re-save the updated document."
8394
- complex_complete: "All planning artifacts validated and saved in docs/ folder. Move to IDE environment to begin development."
8395
-
8396
- # Simple sequence prompts
8397
- simple_analyst_to_pm: "Focused project brief complete. Save it as docs/project-brief.md, then create simple epic or story for API development."
8398
- simple_complete: "Simple service defined. Move to IDE environment to begin development."
7876
+ complete: "All planning artifacts validated and saved in docs/ folder. Move to IDE environment to begin development."
8399
7877
  ==================== END: workflows#greenfield-service ====================
8400
7878
 
8401
7879
  ==================== START: workflows#brownfield-service ====================
@@ -8413,16 +7891,11 @@ workflow:
8413
7891
  - performance-optimization
8414
7892
  - integration-enhancement
8415
7893
 
8416
- # For Complex Service Enhancements (Multiple Stories, Architectural Changes)
8417
- complex_enhancement_sequence:
8418
- - step: scope_assessment
8419
- agent: any
8420
- action: assess complexity
8421
- notes: "First, assess if this is a simple service change (use simple_enhancement_sequence) or complex enhancement requiring full planning."
8422
-
7894
+ sequence:
8423
7895
  - step: service_analysis
8424
- agent: analyst
8425
- action: analyze existing service
7896
+ agent: architect
7897
+ action: analyze existing project and use task document-project
7898
+ creates: multiple documents per the document-project template
8426
7899
  notes: "Review existing service documentation, codebase, performance metrics, and identify integration dependencies."
8427
7900
 
8428
7901
  - agent: pm
@@ -8451,69 +7924,35 @@ workflow:
8451
7924
  action: move_to_ide
8452
7925
  notes: "All planning artifacts complete. Move to IDE environment to begin development. Explain to the user the IDE Development Workflow next steps: data#bmad-kb:IDE Development Workflow"
8453
7926
 
8454
- # For Simple Service Enhancements (1-3 Stories, Following Existing Patterns)
8455
- simple_enhancement_sequence:
8456
- - step: enhancement_type
8457
- action: choose approach
8458
- notes: "Choose between creating single story (simple API endpoint) or epic (1-3 related service changes)."
8459
-
8460
- - agent: pm|po|sm
8461
- creates: brownfield_epic OR brownfield_story
8462
- uses: brownfield-create-epic OR brownfield-create-story
8463
- notes: "Create focused service enhancement with existing API integration. Choose agent based on team preference and context."
8464
-
8465
- - workflow_end:
8466
- action: move_to_ide
8467
- notes: "Service enhancement defined. Move to IDE environment to begin development. Explain to the user the IDE Development Workflow next steps: data#bmad-kb:IDE Development Workflow"
8468
-
8469
7927
  flow_diagram: |
8470
7928
  ```mermaid
8471
7929
  graph TD
8472
- A[Start: Service Enhancement] --> B{Enhancement Complexity?}
8473
- B -->|Complex/Significant| C[analyst: analyze existing service]
8474
- B -->|Simple| D{1 Story or 2-3 Stories?}
8475
-
8476
- C --> E[pm: brownfield-prd.md]
8477
- E --> F[architect: brownfield-architecture.md]
8478
- F --> G[po: validate with po-master-checklist]
8479
- G --> H{PO finds issues?}
8480
- H -->|Yes| I[Return to relevant agent for fixes]
8481
- H -->|No| J[Move to IDE Environment]
8482
- I --> G
8483
-
8484
- D -->|1 Story| K[pm/po/sm: brownfield-create-story]
8485
- D -->|2-3 Stories| L[pm/po/sm: brownfield-create-epic]
8486
- K --> M[Move to IDE Environment]
8487
- L --> M
8488
-
8489
- style J fill:#90EE90
8490
- style M fill:#90EE90
8491
- style E fill:#FFE4B5
8492
- style F fill:#FFE4B5
8493
- style K fill:#FFB6C1
8494
- style L fill:#FFB6C1
7930
+ A[Start: Service Enhancement] --> B[analyst: analyze existing service]
7931
+ B --> C[pm: brownfield-prd.md]
7932
+ C --> D[architect: brownfield-architecture.md]
7933
+ D --> E[po: validate with po-master-checklist]
7934
+ E --> F{PO finds issues?}
7935
+ F -->|Yes| G[Return to relevant agent for fixes]
7936
+ F -->|No| H[Move to IDE Environment]
7937
+ G --> E
7938
+
7939
+ style H fill:#90EE90
7940
+ style C fill:#FFE4B5
7941
+ style D fill:#FFE4B5
8495
7942
  ```
8496
7943
 
8497
7944
  decision_guidance:
8498
- use_complex_sequence_when:
8499
- - Service enhancement requires multiple coordinated stories (4+)
7945
+ when_to_use:
7946
+ - Service enhancement requires coordinated stories
8500
7947
  - API versioning or breaking changes needed
8501
7948
  - Database schema changes required
8502
7949
  - Performance or scalability improvements needed
8503
7950
  - Multiple integration points affected
8504
7951
 
8505
- use_simple_sequence_when:
8506
- - Adding simple endpoints or modifying existing ones
8507
- - Enhancement follows existing service patterns
8508
- - API compatibility maintained
8509
- - Risk to existing service is low
8510
- - Change is isolated with clear boundaries
8511
-
8512
7952
  handoff_prompts:
8513
7953
  analyst_to_pm: "Service analysis complete. Create comprehensive brownfield PRD with service integration strategy."
8514
7954
  pm_to_architect: "Brownfield PRD ready. Save it as docs/brownfield-prd.md, then create the service architecture."
8515
7955
  architect_to_po: "Architecture complete. Save it as docs/brownfield-architecture.md. Please validate all artifacts for service integration safety."
8516
7956
  po_issues: "PO found issues with [document]. Please return to [agent] to fix and re-save the updated document."
8517
- simple_to_ide: "Service enhancement defined with existing API integration. Move to IDE environment to begin development."
8518
- complex_complete: "All brownfield planning artifacts validated and saved in docs/ folder. Move to IDE environment to begin development."
7957
+ complete: "All brownfield planning artifacts validated and saved in docs/ folder. Move to IDE environment to begin development."
8519
7958
  ==================== END: workflows#brownfield-service ====================