bmad-method 4.26.0 → 4.27.1

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 (109) hide show
  1. package/.vscode/settings.json +2 -0
  2. package/CHANGELOG.md +22 -0
  3. package/README.md +29 -282
  4. package/bmad-core/agent-teams/team-all.yaml +6 -6
  5. package/bmad-core/agent-teams/team-fullstack.yaml +6 -6
  6. package/bmad-core/agent-teams/team-no-ui.yaml +2 -2
  7. package/bmad-core/agents/analyst.md +17 -18
  8. package/bmad-core/agents/architect.md +15 -18
  9. package/bmad-core/agents/bmad-master.md +56 -53
  10. package/bmad-core/agents/bmad-orchestrator.md +24 -23
  11. package/bmad-core/agents/dev.md +10 -10
  12. package/bmad-core/agents/pm.md +17 -20
  13. package/bmad-core/agents/po.md +12 -15
  14. package/bmad-core/agents/qa.md +7 -8
  15. package/bmad-core/agents/sm.md +8 -13
  16. package/bmad-core/agents/ux-expert.md +7 -11
  17. package/bmad-core/core-config.yaml +1 -1
  18. package/bmad-core/data/bmad-kb.md +74 -15
  19. package/bmad-core/data/brainstorming-techniques.md +36 -0
  20. package/bmad-core/data/elicitation-methods.md +134 -0
  21. package/bmad-core/tasks/advanced-elicitation.md +82 -57
  22. package/bmad-core/tasks/facilitate-brainstorming-session.md +136 -0
  23. package/bmad-core/templates/architecture-tmpl.yaml +658 -0
  24. package/bmad-core/templates/brainstorming-output-tmpl.yaml +156 -0
  25. package/bmad-core/templates/brownfield-architecture-tmpl.yaml +476 -0
  26. package/bmad-core/templates/brownfield-prd-tmpl.yaml +280 -0
  27. package/bmad-core/templates/competitor-analysis-tmpl.yaml +293 -0
  28. package/bmad-core/templates/front-end-architecture-tmpl.yaml +206 -0
  29. package/bmad-core/templates/front-end-spec-tmpl.yaml +349 -0
  30. package/bmad-core/templates/fullstack-architecture-tmpl.yaml +805 -0
  31. package/bmad-core/templates/market-research-tmpl.yaml +252 -0
  32. package/bmad-core/templates/prd-tmpl.yaml +202 -0
  33. package/bmad-core/templates/project-brief-tmpl.yaml +221 -0
  34. package/bmad-core/templates/story-tmpl.yaml +137 -0
  35. package/bmad-core/utils/plan-management.md +9 -13
  36. package/bmad-core/workflows/greenfield-service.yaml +1 -1
  37. package/common/tasks/create-doc.md +55 -67
  38. package/common/utils/bmad-doc-template.md +325 -0
  39. package/dist/agents/analyst.txt +1312 -1193
  40. package/dist/agents/architect.txt +2484 -2895
  41. package/dist/agents/bmad-master.txt +4680 -4897
  42. package/dist/agents/bmad-orchestrator.txt +400 -195
  43. package/dist/agents/dev.txt +21 -24
  44. package/dist/agents/pm.txt +590 -619
  45. package/dist/agents/po.txt +178 -130
  46. package/dist/agents/qa.txt +159 -48
  47. package/dist/agents/sm.txt +166 -120
  48. package/dist/agents/ux-expert.txt +436 -544
  49. package/dist/expansion-packs/bmad-2d-phaser-game-dev/agents/game-designer.txt +1283 -1260
  50. package/dist/expansion-packs/bmad-2d-phaser-game-dev/agents/game-developer.txt +642 -591
  51. package/dist/expansion-packs/bmad-2d-phaser-game-dev/agents/game-sm.txt +284 -268
  52. package/dist/expansion-packs/bmad-2d-phaser-game-dev/teams/phaser-2d-nodejs-game-team.txt +9258 -4977
  53. package/dist/expansion-packs/bmad-creator-tools/agents/bmad-the-creator.txt +388 -325
  54. package/dist/expansion-packs/bmad-infrastructure-devops/agents/infra-devops-platform.txt +1144 -1165
  55. package/dist/teams/team-all.txt +4885 -4967
  56. package/dist/teams/team-fullstack.txt +5621 -5693
  57. package/dist/teams/team-ide-minimal.txt +604 -333
  58. package/dist/teams/team-no-ui.txt +5209 -5213
  59. package/docs/agentic-tools/github-copilot-guide.md +29 -9
  60. package/docs/bmad-workflow-guide.md +2 -2
  61. package/expansion-packs/bmad-2d-phaser-game-dev/agent-teams/phaser-2d-nodejs-game-team.yaml +2 -2
  62. package/expansion-packs/bmad-2d-phaser-game-dev/agents/game-designer.md +17 -15
  63. package/expansion-packs/bmad-2d-phaser-game-dev/agents/game-developer.md +13 -11
  64. package/expansion-packs/bmad-2d-phaser-game-dev/agents/game-sm.md +13 -11
  65. package/expansion-packs/bmad-2d-phaser-game-dev/config.yaml +1 -1
  66. package/expansion-packs/bmad-2d-phaser-game-dev/tasks/create-game-story.md +2 -2
  67. package/expansion-packs/bmad-2d-phaser-game-dev/templates/game-architecture-tmpl.yaml +613 -0
  68. package/expansion-packs/bmad-2d-phaser-game-dev/templates/game-brief-tmpl.yaml +356 -0
  69. package/expansion-packs/bmad-2d-phaser-game-dev/templates/game-design-doc-tmpl.yaml +343 -0
  70. package/expansion-packs/bmad-2d-phaser-game-dev/templates/game-story-tmpl.yaml +253 -0
  71. package/expansion-packs/bmad-2d-phaser-game-dev/templates/level-design-doc-tmpl.yaml +484 -0
  72. package/expansion-packs/bmad-creator-tools/agents/bmad-the-creator.md +14 -12
  73. package/expansion-packs/bmad-creator-tools/config.yaml +1 -1
  74. package/expansion-packs/bmad-creator-tools/templates/agent-teams-tmpl.yaml +178 -0
  75. package/expansion-packs/bmad-creator-tools/templates/agent-tmpl.yaml +154 -0
  76. package/expansion-packs/bmad-creator-tools/templates/expansion-pack-plan-tmpl.yaml +120 -0
  77. package/expansion-packs/bmad-infrastructure-devops/agents/infra-devops-platform.md +14 -14
  78. package/expansion-packs/bmad-infrastructure-devops/config.yaml +1 -1
  79. package/expansion-packs/bmad-infrastructure-devops/templates/infrastructure-architecture-tmpl.yaml +424 -0
  80. package/expansion-packs/bmad-infrastructure-devops/templates/infrastructure-platform-from-arch-tmpl.yaml +629 -0
  81. package/package.json +1 -1
  82. package/tools/builders/web-builder.js +170 -95
  83. package/tools/installer/config/install.config.yaml +2 -2
  84. package/tools/installer/lib/ide-setup.js +2 -2
  85. package/tools/installer/package.json +1 -1
  86. package/tools/lib/dependency-resolver.js +11 -22
  87. package/tools/md-assets/web-agent-startup-instructions.md +10 -10
  88. package/bmad-core/tasks/brainstorming-techniques.md +0 -238
  89. package/bmad-core/templates/architecture-tmpl.md +0 -776
  90. package/bmad-core/templates/brownfield-architecture-tmpl.md +0 -544
  91. package/bmad-core/templates/brownfield-prd-tmpl.md +0 -266
  92. package/bmad-core/templates/competitor-analysis-tmpl.md +0 -291
  93. package/bmad-core/templates/front-end-architecture-tmpl.md +0 -175
  94. package/bmad-core/templates/front-end-spec-tmpl.md +0 -413
  95. package/bmad-core/templates/fullstack-architecture-tmpl.md +0 -1018
  96. package/bmad-core/templates/market-research-tmpl.md +0 -263
  97. package/bmad-core/templates/prd-tmpl.md +0 -202
  98. package/bmad-core/templates/project-brief-tmpl.md +0 -232
  99. package/bmad-core/templates/story-tmpl.md +0 -58
  100. package/expansion-packs/bmad-2d-phaser-game-dev/templates/game-architecture-tmpl.md +0 -560
  101. package/expansion-packs/bmad-2d-phaser-game-dev/templates/game-brief-tmpl.md +0 -345
  102. package/expansion-packs/bmad-2d-phaser-game-dev/templates/game-design-doc-tmpl.md +0 -331
  103. package/expansion-packs/bmad-2d-phaser-game-dev/templates/game-story-tmpl.md +0 -235
  104. package/expansion-packs/bmad-2d-phaser-game-dev/templates/level-design-doc-tmpl.md +0 -470
  105. package/expansion-packs/bmad-creator-tools/templates/agent-teams-tmpl.md +0 -154
  106. package/expansion-packs/bmad-creator-tools/templates/agent-tmpl.md +0 -143
  107. package/expansion-packs/bmad-creator-tools/templates/expansion-pack-plan-tmpl.md +0 -91
  108. package/expansion-packs/bmad-infrastructure-devops/templates/infrastructure-architecture-tmpl.md +0 -415
  109. package/expansion-packs/bmad-infrastructure-devops/templates/infrastructure-platform-from-arch-tmpl.md +0 -0
@@ -0,0 +1,137 @@
1
+ template:
2
+ id: story-template-v2
3
+ name: Story Document
4
+ version: 2.0
5
+ output:
6
+ format: markdown
7
+ filename: docs/stories/{{epic_num}}.{{story_num}}.{{story_title_short}}.md
8
+ title: "Story {{epic_num}}.{{story_num}}: {{story_title_short}}"
9
+
10
+ workflow:
11
+ mode: interactive
12
+ elicitation: advanced-elicitation
13
+
14
+ agent_config:
15
+ editable_sections:
16
+ - Status
17
+ - Story
18
+ - Acceptance Criteria
19
+ - Tasks / Subtasks
20
+ - Dev Notes
21
+ - Testing
22
+ - Change Log
23
+
24
+ sections:
25
+ - id: status
26
+ title: Status
27
+ type: choice
28
+ choices: [Draft, Approved, InProgress, Review, Done]
29
+ instruction: Select the current status of the story
30
+ owner: scrum-master
31
+ editors: [scrum-master, dev-agent]
32
+
33
+ - id: story
34
+ title: Story
35
+ type: template-text
36
+ template: |
37
+ **As a** {{role}},
38
+ **I want** {{action}},
39
+ **so that** {{benefit}}
40
+ instruction: Define the user story using the standard format with role, action, and benefit
41
+ elicit: true
42
+ owner: scrum-master
43
+ editors: [scrum-master]
44
+
45
+ - id: acceptance-criteria
46
+ title: Acceptance Criteria
47
+ type: numbered-list
48
+ instruction: Copy the acceptance criteria numbered list from the epic file
49
+ elicit: true
50
+ owner: scrum-master
51
+ editors: [scrum-master]
52
+
53
+ - id: tasks-subtasks
54
+ title: Tasks / Subtasks
55
+ type: bullet-list
56
+ instruction: |
57
+ Break down the story into specific tasks and subtasks needed for implementation.
58
+ Reference applicable acceptance criteria numbers where relevant.
59
+ template: |
60
+ - [ ] Task 1 (AC: # if applicable)
61
+ - [ ] Subtask1.1...
62
+ - [ ] Task 2 (AC: # if applicable)
63
+ - [ ] Subtask 2.1...
64
+ - [ ] Task 3 (AC: # if applicable)
65
+ - [ ] Subtask 3.1...
66
+ elicit: true
67
+ owner: scrum-master
68
+ editors: [scrum-master, dev-agent]
69
+
70
+ - id: dev-notes
71
+ title: Dev Notes
72
+ instruction: |
73
+ Populate relevant information, only what was pulled from actual artifacts from docs folder, relevant to this story:
74
+ - Do not invent information
75
+ - If known add Relevant Source Tree info that relates to this story
76
+ - If there were important notes from previous story that are relevant to this one, include them here
77
+ - Put enough information in this section so that the dev agent should NEVER need to read the architecture documents, these notes along with the tasks and subtasks must give the Dev Agent the complete context it needs to comprehend with the least amount of overhead the information to complete the story, meeting all AC and completing all tasks+subtasks
78
+ elicit: true
79
+ owner: scrum-master
80
+ editors: [scrum-master]
81
+ sections:
82
+ - id: testing-standards
83
+ title: Testing
84
+ instruction: |
85
+ List Relevant Testing Standards from Architecture the Developer needs to conform to:
86
+ - Test file location
87
+ - Test standards
88
+ - Testing frameworks and patterns to use
89
+ - Any specific testing requirements for this story
90
+ elicit: true
91
+ owner: scrum-master
92
+ editors: [scrum-master]
93
+
94
+ - id: change-log
95
+ title: Change Log
96
+ type: table
97
+ columns: [Date, Version, Description, Author]
98
+ instruction: Track changes made to this story document
99
+ owner: scrum-master
100
+ editors: [scrum-master, dev-agent, qa-agent]
101
+
102
+ - id: dev-agent-record
103
+ title: Dev Agent Record
104
+ instruction: This section is populated by the development agent during implementation
105
+ owner: dev-agent
106
+ editors: [dev-agent]
107
+ sections:
108
+ - id: agent-model
109
+ title: Agent Model Used
110
+ template: "{{agent_model_name_version}}"
111
+ instruction: Record the specific AI agent model and version used for development
112
+ owner: dev-agent
113
+ editors: [dev-agent]
114
+
115
+ - id: debug-log-references
116
+ title: Debug Log References
117
+ instruction: Reference any debug logs or traces generated during development
118
+ owner: dev-agent
119
+ editors: [dev-agent]
120
+
121
+ - id: completion-notes
122
+ title: Completion Notes List
123
+ instruction: Notes about the completion of tasks and any issues encountered
124
+ owner: dev-agent
125
+ editors: [dev-agent]
126
+
127
+ - id: file-list
128
+ title: File List
129
+ instruction: List all files created, modified, or affected during story implementation
130
+ owner: dev-agent
131
+ editors: [dev-agent]
132
+
133
+ - id: qa-results
134
+ title: QA Results
135
+ instruction: Results from QA Agent QA review of the completed story implementation
136
+ owner: qa-agent
137
+ editors: [qa-agent]
@@ -8,14 +8,10 @@ Provides utilities for agents and tasks to interact with workflow plans, check p
8
8
 
9
9
  ### 1. Check Plan Existence
10
10
 
11
- [[LLM: When any agent starts or task begins, check if a workflow plan exists]]
12
-
13
- ```
14
11
  Check for workflow plan:
12
+
15
13
  1. Look for docs/workflow-plan.md (default location)
16
- 2. Check core-config.yaml for custom plan location
17
- 3. Return plan status (exists/not exists)
18
- ```
14
+ 2. Return plan status to user (exists/not exists) - if not exists then HALT.
19
15
 
20
16
  ### 2. Parse Plan Status
21
17
 
@@ -56,7 +52,7 @@ Check for workflow plan:
56
52
 
57
53
  **Warning Templates:**
58
54
 
59
- ```
55
+ ```text
60
56
  SEQUENCE WARNING:
61
57
  The workflow plan shows you should complete "{expected_step}" next.
62
58
  You're attempting to: "{requested_action}"
@@ -90,7 +86,7 @@ In flexible mode: Allow with confirmation
90
86
 
91
87
  **For Agents (startup sequence)**:
92
88
 
93
- ```
89
+ ```text
94
90
  1. Check if plan exists using this utility
95
91
  2. If exists:
96
92
  - Parse current status
@@ -101,7 +97,7 @@ In flexible mode: Allow with confirmation
101
97
 
102
98
  **For Tasks (pre-execution)**:
103
99
 
104
- ```
100
+ ```text
105
101
  1. Check if plan exists
106
102
  2. If exists:
107
103
  - Verify this task aligns with plan
@@ -117,7 +113,7 @@ In flexible mode: Allow with confirmation
117
113
 
118
114
  [[LLM: Standard format for showing plan status]]
119
115
 
120
- ```
116
+ ```text
121
117
  📋 Workflow Plan Status
122
118
  ━━━━━━━━━━━━━━━━━━━━
123
119
  Workflow: {workflow_name}
@@ -170,7 +166,7 @@ If user wants to abandon plan:
170
166
 
171
167
  ### Example 1: Agent Startup Check
172
168
 
173
- ```
169
+ ```text
174
170
  BMad Master starting...
175
171
 
176
172
  [Check for plan]
@@ -184,7 +180,7 @@ Use *agent pm to switch, or *plan-status to see full progress.
184
180
 
185
181
  ### Example 2: Task Sequence Warning
186
182
 
187
- ```
183
+ ```text
188
184
  User: *task create-next-story
189
185
 
190
186
  [Plan check triggered]
@@ -200,7 +196,7 @@ Would you like to:
200
196
 
201
197
  ### Example 3: Automatic Plan Update
202
198
 
203
- ```
199
+ ```text
204
200
  [After completing create-doc task for PRD]
205
201
 
206
202
  ✅ Plan Updated: Marked "Create PRD" as complete
@@ -136,7 +136,7 @@ workflow:
136
136
  All stories implemented and reviewed!
137
137
  Service development phase complete.
138
138
 
139
- Reference: data#bmad-kb:IDE Development Workflow
139
+ Reference: {root}/data/bmad-kb.md#IDE Development Workflow
140
140
 
141
141
  flow_diagram: |
142
142
  ```mermaid
@@ -1,91 +1,79 @@
1
- # Create Document from Template Task
1
+ # Create Document from Template (YAML Driven)
2
2
 
3
- ## Purpose
3
+ ## CRITICAL: Mandatory Elicitation Format
4
4
 
5
- Generate documents from templates by EXECUTING (not just reading) embedded instructions from the perspective of the selected agent persona.
5
+ **When `elicit: true`, ALWAYS use this exact format:**
6
6
 
7
- ## CRITICAL RULES
7
+ 1. Present section content
8
+ 2. Provide detailed rationale (explain trade-offs, assumptions, decisions made)
9
+ 3. Present numbered options 1-9:
10
+ - **Option 1:** Always "Proceed to next section"
11
+ - **Options 2-9:** Select 8 methods from data/elicitation-methods
12
+ - End with: "Select 1-9 or just type your question/feedback:"
8
13
 
9
- 1. **Templates are PROGRAMS** - Execute every [[LLM:]] instruction exactly as written
10
- 2. **NEVER show markup** - Hide all [[LLM:]], {{placeholders}}, @{examples}, and template syntax
11
- 3. **STOP and EXECUTE** - When you see "apply tasks#" or "execute tasks#", STOP and run that task immediately
12
- 4. **WAIT for user input** - At review points and after elicitation tasks
14
+ **NEVER ask yes/no questions or use any other format.**
13
15
 
14
- ## Execution Flow
16
+ ## Processing Flow
15
17
 
16
- ### 0. Check Workflow Plan (if configured)
18
+ 1. **Parse YAML template** - Load template metadata and sections
19
+ 2. **Set preferences** - Show current mode (Interactive), confirm output file
20
+ 3. **Process each section:**
21
+ - Skip if condition unmet
22
+ - Check agent permissions (owner/editors) - note if section is restricted to specific agents
23
+ - Draft content using section instruction
24
+ - Present content + detailed rationale
25
+ - **IF elicit: true** → MANDATORY 1-9 options format
26
+ - Save to file if possible
27
+ 4. **Continue until complete**
17
28
 
18
- [[LLM: Check if plan tracking is enabled in core-config.yaml]]
29
+ ## Detailed Rationale Requirements
19
30
 
20
- - If `workflow.trackProgress: true`, check for active plan using utils#plan-management
21
- - If plan exists and this document creation is part of the plan:
22
- - Verify this is the expected next step
23
- - If out of sequence and `enforceSequence: true`, warn user and halt without user override
24
- - If out of sequence and `enforceSequence: false`, ask for confirmation
25
- - Continue with normal execution after plan check
31
+ When presenting section content, ALWAYS include rationale that explains:
26
32
 
27
- ### 1. Identify Template
33
+ - Trade-offs and choices made (what was chosen over alternatives and why)
34
+ - Key assumptions made during drafting
35
+ - Interesting or questionable decisions that need user attention
36
+ - Areas that might need validation
28
37
 
29
- - Load from `templates#*` or `{root}/templates directory`
30
- - Agent-specific templates are listed in agent's dependencies
31
- - If agent has `templates: [prd-tmpl, architecture-tmpl]` for example, then offer to create "PRD" and "Architecture" documents
38
+ ## Elicitation Results Flow
32
39
 
33
- ### 2. Ask Interaction Mode
40
+ After user selects elicitation method (2-9):
34
41
 
35
- > 1. **Incremental** - Section by section with reviews
36
- > 2. **YOLO Mode** - Complete draft then review (user can type `/yolo` anytime to switch)
42
+ 1. Execute method from data/elicitation-methods
43
+ 2. Present results with insights
44
+ 3. Offer options:
45
+ - **1. Apply changes and update section**
46
+ - **2. Return to elicitation menu**
47
+ - **3. Ask any questions or engage further with this elicitation**
37
48
 
38
- ### 3. Execute Template
49
+ ## Agent Permissions
39
50
 
40
- - Replace {{placeholders}} with real content
41
- - Execute [[LLM:]] instructions as you encounter them
42
- - Process <<REPEAT>> loops and ^^CONDITIONS^^
43
- - Use @{examples} for guidance but never output them
51
+ When processing sections with agent permission fields:
44
52
 
45
- ### 4. Key Execution Patterns
53
+ - **owner**: Note which agent role initially creates/populates the section
54
+ - **editors**: List agent roles allowed to modify the section
55
+ - **readonly**: Mark sections that cannot be modified after creation
46
56
 
47
- **When you see:** `[[LLM: Draft X and immediately execute tasks#advanced-elicitation]]`
57
+ **For sections with restricted access:**
48
58
 
49
- - Draft the content
50
- - Present it to user
51
- - IMMEDIATELY execute the task
52
- - Wait for completion before continuing
59
+ - Include a note in the generated document indicating the responsible agent
60
+ - Example: "_(This section is owned by dev-agent and can only be modified by dev-agent)_"
53
61
 
54
- **When you see:** `[[LLM: After section completion, apply tasks#Y]]`
62
+ ## YOLO Mode
55
63
 
56
- - Finish the section
57
- - STOP and execute the task
58
- - Wait for user input
64
+ User can type `#yolo` to toggle to YOLO mode (process all sections at once).
59
65
 
60
- ### 5. Validation & Final Presentation
66
+ ## CRITICAL REMINDERS
61
67
 
62
- - Run any specified checklists
63
- - Present clean, formatted content only
64
- - No truncation or summarization
65
- - Begin directly with content (no preamble)
66
- - Include any handoff prompts from template
68
+ **❌ NEVER:**
67
69
 
68
- ### 6. Update Workflow Plan (if applicable)
70
+ - Ask yes/no questions for elicitation
71
+ - Use any format other than 1-9 numbered options
72
+ - Create new elicitation methods
69
73
 
70
- [[LLM: After successful document creation]]
74
+ **✅ ALWAYS:**
71
75
 
72
- - If plan tracking is enabled and document was part of plan:
73
- - Call update-workflow-plan task to mark step complete
74
- - Parameters: task: create-doc, step_id: {from plan}, status: complete
75
- - Show next recommended step from plan
76
-
77
- ## Common Mistakes to Avoid
78
-
79
- ❌ Skipping elicitation tasks
80
- ❌ Showing template markup to users
81
- ❌ Continuing past STOP signals
82
- ❌ Combining multiple review points
83
-
84
- ✅ Execute ALL instructions in sequence
85
- ✅ Present only clean, formatted content
86
- ✅ Stop at every elicitation point
87
- ✅ Wait for user confirmation when instructed
88
-
89
- ## Remember
90
-
91
- Templates contain precise instructions for a reason. Follow them exactly to ensure document quality and completeness.
76
+ - Use exact 1-9 format when elicit: true
77
+ - Select options 2-9 from data/elicitation-methods only
78
+ - Provide detailed rationale explaining decisions
79
+ - End with "Select 1-9 or just type your question/feedback:"
@@ -0,0 +1,325 @@
1
+ # BMad Document Template Specification
2
+
3
+ ## Overview
4
+
5
+ BMad document templates are defined in YAML format to drive interactive document generation and agent interaction. Templates separate structure definition from content generation, making them both human and LLM-agent-friendly.
6
+
7
+ ## Template Structure
8
+
9
+ ```yaml
10
+ template:
11
+ id: template-identifier
12
+ name: Human Readable Template Name
13
+ version: 1.0
14
+ output:
15
+ format: markdown
16
+ filename: default-path/to/{{filename}}.md
17
+ title: "{{variable}} Document Title"
18
+
19
+ workflow:
20
+ mode: interactive
21
+ elicitation: advanced-elicitation
22
+
23
+ sections:
24
+ - id: section-id
25
+ title: Section Title
26
+ instruction: |
27
+ Detailed instructions for the LLM on how to handle this section
28
+ # ... additional section properties
29
+ ```
30
+
31
+ ## Core Fields
32
+
33
+ ### Template Metadata
34
+
35
+ - **id**: Unique identifier for the template
36
+ - **name**: Human-readable name displayed in UI
37
+ - **version**: Template version for tracking changes
38
+ - **output.format**: Default "markdown" for document templates
39
+ - **output.filename**: Default output file path (can include variables)
40
+ - **output.title**: Document title (becomes H1 in markdown)
41
+
42
+ ### Workflow Configuration
43
+
44
+ - **workflow.mode**: Default interaction mode ("interactive" or "yolo")
45
+ - **workflow.elicitation**: Elicitation task to use ("advanced-elicitation")
46
+
47
+ ## Section Properties
48
+
49
+ ### Required Fields
50
+
51
+ - **id**: Unique section identifier
52
+ - **title**: Section heading text
53
+ - **instruction**: Detailed guidance for LLM on handling this section
54
+
55
+ ### Optional Fields
56
+
57
+ #### Content Control
58
+
59
+ - **type**: Content type hint for structured sections
60
+ - **template**: Fixed template text for section content
61
+ - **item_template**: Template for repeatable items within section
62
+ - **prefix**: Prefix for numbered items (e.g., "FR", "NFR")
63
+
64
+ #### Behavior Flags
65
+
66
+ - **elicit**: Boolean - Apply elicitation after section rendered
67
+ - **repeatable**: Boolean - Section can be repeated multiple times
68
+ - **condition**: String - Condition for including section (e.g., "has ui requirements")
69
+
70
+ #### Agent Permissions
71
+
72
+ - **owner**: String - Agent role that initially creates/populates this section
73
+ - **editors**: Array - List of agent roles allowed to modify this section
74
+ - **readonly**: Boolean - Section cannot be modified after initial creation
75
+
76
+ #### Content Guidance
77
+
78
+ - **examples**: Array of example content (not included in output)
79
+ - **choices**: Object with choice options for common decisions
80
+ - **placeholder**: Default placeholder text
81
+
82
+ #### Structure
83
+
84
+ - **sections**: Array of nested child sections
85
+
86
+ ## Supported Types
87
+
88
+ ### Content Types
89
+
90
+ - **bullet-list**: Unordered list items
91
+ - **numbered-list**: Ordered list with optional prefix
92
+ - **paragraphs**: Free-form paragraph text
93
+ - **table**: Structured table data
94
+ - **code-block**: Code or configuration blocks
95
+ - **template-text**: Fixed template with variable substitution
96
+ - **mermaid**: Mermaid diagram with specified type and details
97
+
98
+ ### Special Types
99
+
100
+ - **repeatable-container**: Container for multiple instances
101
+ - **conditional-block**: Content shown based on conditions
102
+ - **choice-selector**: Present choices to user
103
+
104
+ ## Advanced Features
105
+
106
+ ### Variable Substitution
107
+
108
+ Use `{{variable_name}}` in titles, templates, and content:
109
+
110
+ ```yaml
111
+ title: "Epic {{epic_number}} {{epic_title}}"
112
+ template: "As a {{user_type}}, I want {{action}}, so that {{benefit}}."
113
+ ```
114
+
115
+ ### Conditional Sections
116
+
117
+ ```yaml
118
+ - id: ui-section
119
+ title: User Interface Design
120
+ condition: Project has UX/UI Requirements
121
+ instruction: Only include if project has UI components
122
+ ```
123
+
124
+ ### Choice Integration
125
+
126
+ ```yaml
127
+ choices:
128
+ architecture: [Monolith, Microservices, Serverless]
129
+ testing: [Unit Only, Unit + Integration, Full Pyramid]
130
+ ```
131
+
132
+ ### Mermaid Diagrams
133
+
134
+ ```yaml
135
+ - id: system-architecture
136
+ title: System Architecture Diagram
137
+ type: mermaid
138
+ instruction: Create a system architecture diagram showing key components and data flow
139
+ mermaid_type: flowchart
140
+ details: |
141
+ Show the following components:
142
+ - User interface layer
143
+ - API gateway
144
+ - Core services
145
+ - Database layer
146
+ - External integrations
147
+ ```
148
+
149
+ **Supported mermaid_type values:**
150
+
151
+ **Core Diagram Types:**
152
+
153
+ - `flowchart` - Flow charts and process diagrams
154
+ - `sequenceDiagram` - Sequence diagrams for interactions
155
+ - `classDiagram` - Class relationship diagrams (UML)
156
+ - `stateDiagram` - State transition diagrams
157
+ - `erDiagram` - Entity relationship diagrams
158
+ - `gantt` - Gantt charts for timelines
159
+ - `pie` - Pie charts for data visualization
160
+
161
+ **Advanced Diagram Types:**
162
+
163
+ - `journey` - User journey maps
164
+ - `mindmap` - Mindmaps for brainstorming
165
+ - `timeline` - Timeline diagrams for chronological events
166
+ - `quadrantChart` - Quadrant charts for data categorization
167
+ - `xyChart` - XY charts (bar charts, line charts)
168
+ - `sankey` - Sankey diagrams for flow visualization
169
+
170
+ **Specialized Types:**
171
+
172
+ - `c4Context` - C4 context diagrams (experimental)
173
+ - `requirement` - Requirement diagrams
174
+ - `packet` - Network packet diagrams
175
+ - `block` - Block diagrams
176
+ - `kanban` - Kanban boards
177
+
178
+ ### Agent Permissions Example
179
+
180
+ ```yaml
181
+ - id: story-details
182
+ title: Story
183
+ owner: scrum-master
184
+ editors: [scrum-master]
185
+ readonly: false
186
+ sections:
187
+ - id: dev-notes
188
+ title: Dev Notes
189
+ owner: dev-agent
190
+ editors: [dev-agent]
191
+ readonly: false
192
+ instruction: Implementation notes and technical details
193
+ - id: qa-results
194
+ title: QA Results
195
+ owner: qa-agent
196
+ editors: [qa-agent]
197
+ readonly: true
198
+ instruction: Quality assurance test results
199
+ ```
200
+
201
+ ### Repeatable Sections
202
+
203
+ ```yaml
204
+ - id: epic-details
205
+ title: Epic {{epic_number}} {{epic_title}}
206
+ repeatable: true
207
+ sections:
208
+ - id: story
209
+ title: Story {{epic_number}}.{{story_number}} {{story_title}}
210
+ repeatable: true
211
+ sections:
212
+ - id: criteria
213
+ title: Acceptance Criteria
214
+ type: numbered-list
215
+ item_template: "{{criterion_number}}: {{criteria}}"
216
+ repeatable: true
217
+ ```
218
+
219
+ ### Examples with Code Blocks
220
+
221
+ ````yaml
222
+ examples:
223
+ - "FR6: The system must authenticate users within 2 seconds"
224
+ - |
225
+ ```mermaid
226
+ sequenceDiagram
227
+ participant User
228
+ participant API
229
+ participant DB
230
+ User->>API: POST /login
231
+ API->>DB: Validate credentials
232
+ DB-->>API: User data
233
+ API-->>User: JWT token
234
+ ```
235
+ - |
236
+ **Architecture Decision Record**
237
+
238
+ **Decision**: Use PostgreSQL for primary database
239
+ **Rationale**: ACID compliance and JSON support needed
240
+ **Consequences**: Requires database management expertise
241
+ ````
242
+
243
+ ## Section Hierarchy
244
+
245
+ Templates define the complete document structure starting with the first H2 - each level in is the next H#:
246
+
247
+ ```yaml
248
+ sections:
249
+ - id: overview
250
+ title: Project Overview
251
+ sections:
252
+ - id: goals
253
+ title: Goals
254
+ - id: scope
255
+ title: Scope
256
+ sections:
257
+ - id: in-scope
258
+ title: In Scope
259
+ - id: out-scope
260
+ title: Out of Scope
261
+ ```
262
+
263
+ ## Processing Flow
264
+
265
+ 1. **Parse Template**: Load and validate YAML structure
266
+ 2. **Initialize Workflow**: Set interaction mode and elicitation
267
+ 3. **Process Sections**: Handle each section in order:
268
+ - Check conditions
269
+ - Apply instructions
270
+ - Generate content
271
+ - Handle choices and variables
272
+ - Apply elicitation if specified
273
+ - Process nested sections
274
+ 4. **Generate Output**: Create clean markdown document
275
+
276
+ ## Best Practices
277
+
278
+ ### Template Design
279
+
280
+ - Keep instructions clear and specific
281
+ - Use examples for complex content
282
+ - Structure sections logically
283
+ - Include all necessary guidance for LLM
284
+
285
+ ### Content Instructions
286
+
287
+ - Be explicit about expected format
288
+ - Include reasoning for decisions
289
+ - Specify interaction patterns
290
+ - Reference other documents when needed
291
+
292
+ ### Variable Naming
293
+
294
+ - Use descriptive variable names
295
+ - Follow consistent naming conventions
296
+ - Document expected variable values
297
+
298
+ ### Examples Usage
299
+
300
+ - Provide concrete examples for complex sections
301
+ - Include both simple and complex cases
302
+ - Use realistic project scenarios
303
+ - Include code blocks and diagrams when helpful
304
+
305
+ ## Validation
306
+
307
+ Templates should be validated for:
308
+
309
+ - Valid YAML syntax
310
+ - Required fields present
311
+ - Consistent section IDs
312
+ - Proper nesting structure
313
+ - Valid variable references
314
+
315
+ ## Migration from Legacy
316
+
317
+ When converting from markdown+frontmatter templates:
318
+
319
+ 1. Extract embedded `[[LLM:]]` instructions to `instruction` fields
320
+ 2. Convert `<<REPEAT>>` blocks to `repeatable: true` sections
321
+ 3. Extract `^^CONDITIONS^^` to `condition` fields
322
+ 4. Move `@{examples}` to `examples` arrays
323
+ 5. Convert `{{placeholders}}` to proper variable syntax
324
+
325
+ This specification ensures templates are both human-readable and machine-processable while maintaining the flexibility needed for complex document generation.