Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

5 дней назад
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  1. ---
  2. name: bmad-sprint-planning
  3. description: 'Generate sprint status tracking from epics. Use when the user says "run sprint planning" or "generate sprint plan"'
  4. ---
  5. # Sprint Planning Workflow
  6. **Goal:** Generate sprint status tracking from epics, detecting current story statuses and building a complete sprint-status.yaml file.
  7. **Your Role:** You are a Developer generating and maintaining sprint tracking. Parse epic files, detect story statuses, and produce a structured sprint-status.yaml.
  8. ## Conventions
  9. - Bare paths (e.g. `checklist.md`) resolve from the skill root.
  10. - `{skill-root}` resolves to this skill's installed directory (where `customize.toml` lives).
  11. - `{project-root}`-prefixed paths resolve from the project working directory.
  12. - `{skill-name}` resolves to the skill directory's basename.
  13. ## On Activation
  14. ### Step 1: Resolve the Workflow Block
  15. Run: `python3 {project-root}/_bmad/scripts/resolve_customization.py --skill {skill-root} --key workflow`
  16. **If the script fails**, resolve the `workflow` block yourself by reading these three files in base → team → user order and applying the same structural merge rules as the resolver:
  17. 1. `{skill-root}/customize.toml` — defaults
  18. 2. `{project-root}/_bmad/custom/{skill-name}.toml` — team overrides
  19. 3. `{project-root}/_bmad/custom/{skill-name}.user.toml` — personal overrides
  20. Any missing file is skipped. Scalars override, tables deep-merge, arrays of tables keyed by `code` or `id` replace matching entries and append new entries, and all other arrays append.
  21. ### Step 2: Execute Prepend Steps
  22. Execute each entry in `{workflow.activation_steps_prepend}` in order before proceeding.
  23. ### Step 3: Load Persistent Facts
  24. Treat every entry in `{workflow.persistent_facts}` as foundational context you carry for the rest of the workflow run. Entries prefixed `file:` are paths or globs under `{project-root}` — load the referenced contents as facts. All other entries are facts verbatim.
  25. ### Step 4: Load Config
  26. Load config from `{project-root}/_bmad/bmm/config.yaml` and resolve:
  27. - `project_name`, `user_name`
  28. - `communication_language`, `document_output_language`
  29. - `implementation_artifacts`
  30. - `planning_artifacts`
  31. - `date` as system-generated current datetime
  32. - YOU MUST ALWAYS SPEAK OUTPUT in your Agent communication style with the config `{communication_language}`
  33. - Generate all documents in `{document_output_language}`
  34. ### Step 5: Greet the User
  35. Greet `{user_name}`, speaking in `{communication_language}`.
  36. ### Step 6: Execute Append Steps
  37. Execute each entry in `{workflow.activation_steps_append}` in order.
  38. Activation is complete. Begin the workflow below.
  39. ## Paths
  40. - `tracking_system` = `file-system`
  41. - `project_key` = `NOKEY`
  42. - `story_location` = `{implementation_artifacts}`
  43. - `story_location_absolute` = `{implementation_artifacts}`
  44. - `epics_location` = `{planning_artifacts}`
  45. - `epics_pattern` = `*epic*.md`
  46. - `status_file` = `{implementation_artifacts}/sprint-status.yaml`
  47. ## Input Files
  48. | Input | Path | Load Strategy |
  49. |-------|------|---------------|
  50. | Epics | `{planning_artifacts}/*epic*.md` (whole) or `{planning_artifacts}/*epic*/*.md` (sharded) | FULL_LOAD |
  51. ## Execution
  52. ### Document Discovery - Full Epic Loading
  53. **Strategy**: Sprint planning needs ALL epics and stories to build complete status tracking.
  54. **Epic Discovery Process:**
  55. 1. **Search for whole document first** - Look for `epics.md`, `bmm-epics.md`, or any `*epic*.md` file
  56. 2. **Check for sharded version** - If whole document not found, look for `epics/index.md`
  57. 3. **If sharded version found**:
  58. - Read `index.md` to understand the document structure
  59. - Read ALL epic section files listed in the index (e.g., `epic-1.md`, `epic-2.md`, etc.)
  60. - Process all epics and their stories from the combined content
  61. - This ensures complete sprint status coverage
  62. 4. **Priority**: If both whole and sharded versions exist, use the whole document
  63. **Fuzzy matching**: Be flexible with document names - users may use variations like `epics.md`, `bmm-epics.md`, `user-stories.md`, etc.
  64. <workflow>
  65. <step n="1" goal="Parse epic files and extract all work items">
  66. <action>Load {project_context} for project-wide patterns and conventions (if exists)</action>
  67. <action>Communicate in {communication_language} with {user_name}</action>
  68. <action>Look for all files matching `{epics_pattern}` in {epics_location}</action>
  69. <action>Could be a single `epics.md` file or multiple `epic-1.md`, `epic-2.md` files</action>
  70. <action>For each epic file found, extract:</action>
  71. - Epic numbers from headers like `## Epic 1:` or `## Epic 2:`
  72. - Story IDs and titles from patterns like `### Story 1.1: User Authentication`
  73. - Convert story format from `Epic.Story: Title` to kebab-case key: `epic-story-title`
  74. **Story ID Conversion Rules:**
  75. - Original: `### Story 1.1: User Authentication`
  76. - Replace period with dash: `1-1`
  77. - Convert title to kebab-case: `user-authentication`
  78. - Final key: `1-1-user-authentication`
  79. <action>Build complete inventory of all epics and stories from all epic files</action>
  80. </step>
  81. <step n="2" goal="Build sprint status structure">
  82. <action>For each epic found, create entries in this order:</action>
  83. 1. **Epic entry** - Key: `epic-{num}`, Default status: `backlog`
  84. 2. **Story entries** - Key: `{epic}-{story}-{title}`, Default status: `backlog`
  85. 3. **Retrospective entry** - Key: `epic-{num}-retrospective`, Default status: `optional`
  86. **Example structure:**
  87. ```yaml
  88. development_status:
  89. epic-1: backlog
  90. 1-1-user-authentication: backlog
  91. 1-2-account-management: backlog
  92. epic-1-retrospective: optional
  93. ```
  94. </step>
  95. <step n="3" goal="Apply intelligent status detection">
  96. <action>For each story, detect current status by checking files:</action>
  97. **Story file detection:**
  98. - Check: `{story_location_absolute}/{story-key}.md` (e.g., `stories/1-1-user-authentication.md`)
  99. - If exists → upgrade status to at least `ready-for-dev`
  100. **Preservation rule:**
  101. - If existing `{status_file}` exists and has more advanced status, preserve it
  102. - Never downgrade status (e.g., don't change `done` to `ready-for-dev`)
  103. **Status Flow Reference:**
  104. - Epic: `backlog` → `in-progress` → `done`
  105. - Story: `backlog` → `ready-for-dev` → `in-progress` → `review` → `done`
  106. - Retrospective: `optional` ↔ `done`
  107. </step>
  108. <step n="4" goal="Generate sprint status file">
  109. <action>Create or update {status_file} with:</action>
  110. **File Structure:**
  111. ```yaml
  112. # generated: {date}
  113. # last_updated: {date}
  114. # project: {project_name}
  115. # project_key: {project_key}
  116. # tracking_system: {tracking_system}
  117. # story_location: {story_location}
  118. # STATUS DEFINITIONS:
  119. # ==================
  120. # Epic Status:
  121. # - backlog: Epic not yet started
  122. # - in-progress: Epic actively being worked on
  123. # - done: All stories in epic completed
  124. #
  125. # Epic Status Transitions:
  126. # - backlog → in-progress: Automatically when first story is created (via create-story)
  127. # - in-progress → done: Manually when all stories reach 'done' status
  128. #
  129. # Story Status:
  130. # - backlog: Story only exists in epic file
  131. # - ready-for-dev: Story file created in stories folder
  132. # - in-progress: Developer actively working on implementation
  133. # - review: Ready for code review (via Dev's code-review workflow)
  134. # - done: Story completed
  135. #
  136. # Retrospective Status:
  137. # - optional: Can be completed but not required
  138. # - done: Retrospective has been completed
  139. #
  140. # WORKFLOW NOTES:
  141. # ===============
  142. # - Epic transitions to 'in-progress' automatically when first story is created
  143. # - Stories can be worked in parallel if team capacity allows
  144. # - Developer typically creates next story after previous one is 'done' to incorporate learnings
  145. # - Dev moves story to 'review', then runs code-review (fresh context, different LLM recommended)
  146. generated: { date }
  147. last_updated: { date }
  148. project: { project_name }
  149. project_key: { project_key }
  150. tracking_system: { tracking_system }
  151. story_location: { story_location }
  152. development_status:
  153. # All epics, stories, and retrospectives in order
  154. ```
  155. <action>Write the complete sprint status YAML to {status_file}</action>
  156. <action>CRITICAL: Metadata appears TWICE - once as comments (#) for documentation, once as YAML key:value fields for parsing</action>
  157. <action>Ensure all items are ordered: epic, its stories, its retrospective, next epic...</action>
  158. </step>
  159. <step n="5" goal="Validate and report">
  160. <action>Perform validation checks:</action>
  161. - [ ] Every epic in epic files appears in {status_file}
  162. - [ ] Every story in epic files appears in {status_file}
  163. - [ ] Every epic has a corresponding retrospective entry
  164. - [ ] No items in {status_file} that don't exist in epic files
  165. - [ ] All status values are legal (match state machine definitions)
  166. - [ ] File is valid YAML syntax
  167. <action>Count totals:</action>
  168. - Total epics: {{epic_count}}
  169. - Total stories: {{story_count}}
  170. - Epics in-progress: {{in_progress_count}}
  171. - Stories done: {{done_count}}
  172. <action>Display completion summary to {user_name} in {communication_language}:</action>
  173. **Sprint Status Generated Successfully**
  174. - **File Location:** {status_file}
  175. - **Total Epics:** {{epic_count}}
  176. - **Total Stories:** {{story_count}}
  177. - **Epics In Progress:** {{in_progress_count}}
  178. - **Stories Completed:** {{done_count}}
  179. **Next Steps:**
  180. 1. Review the generated {status_file}
  181. 2. Use this file to track development progress
  182. 3. Agents will update statuses as they work
  183. 4. Re-run this workflow to refresh auto-detected statuses
  184. <action>Run: `python3 {project-root}/_bmad/scripts/resolve_customization.py --skill {skill-root} --key workflow.on_complete` — if the resolved value is non-empty, follow it as the final terminal instruction before exiting.</action>
  185. </step>
  186. </workflow>
  187. ## Additional Documentation
  188. ### Status State Machine
  189. **Epic Status Flow:**
  190. ```
  191. backlog → in-progress → done
  192. ```
  193. - **backlog**: Epic not yet started
  194. - **in-progress**: Epic actively being worked on (stories being created/implemented)
  195. - **done**: All stories in epic completed
  196. **Story Status Flow:**
  197. ```
  198. backlog → ready-for-dev → in-progress → review → done
  199. ```
  200. - **backlog**: Story only exists in epic file
  201. - **ready-for-dev**: Story file created (e.g., `stories/1-3-plant-naming.md`)
  202. - **in-progress**: Developer actively working
  203. - **review**: Ready for code review (via Dev's code-review workflow)
  204. - **done**: Completed
  205. **Retrospective Status:**
  206. ```
  207. optional ↔ done
  208. ```
  209. - **optional**: Ready to be conducted but not required
  210. - **done**: Finished
  211. ### Guidelines
  212. 1. **Epic Activation**: Mark epic as `in-progress` when starting work on its first story
  213. 2. **Sequential Default**: Stories are typically worked in order, but parallel work is supported
  214. 3. **Parallel Work Supported**: Multiple stories can be `in-progress` if team capacity allows
  215. 4. **Review Before Done**: Stories should pass through `review` before `done`
  216. 5. **Learning Transfer**: Developer typically creates next story after previous one is `done` to incorporate learnings