Level 1 - Epic and Stories Generation

This generates epic and user stories for Level 1 projects after tech-spec completion This is a lightweight story breakdown - not a full PRD Level 1 = coherent feature, 1-10 stories (prefer 2-3), 1 epic This workflow runs AFTER tech-spec.md has been completed Story format MUST match create-story template for compatibility with story-context and dev-story workflows

Read the completed tech-spec.md file from {output_folder}/tech-spec.md Load bmm-workflow-status.md from {output_folder}/bmm-workflow-status.md Extract dev_story_location from config (where stories are stored) Identify all implementation tasks from the “Implementation Guide” section Identify the overall feature goal from “Technical Approach” section Extract time estimates for each implementation phase Identify any dependencies between implementation tasks

Create 1 epic that represents the entire feature Epic title should be user-facing value statement Epic goal should describe why this matters to users

Epic Best Practices: - Title format: User-focused outcome (not implementation detail) - Good: “JS Library Icon Reliability” - Bad: “Update recommendedLibraries.ts file” - Scope: Clearly define what’s included/excluded - Success criteria: Measurable outcomes that define “done”

Epic: JS Library Icon Reliability

Goal: Eliminate external dependencies for JS library icons to ensure consistent, reliable display and improve application performance.

Scope: Migrate all 14 recommended JS library icons from third-party CDN URLs (GitHub, jsDelivr) to internal static asset hosting.

Success Criteria:

Derive epic slug from epic title (kebab-case, 2-3 words max)

Initialize epic-stories.md summary document using epic_stories_template

<template-output file=“{output_folder}/epic-stories.md”>epic_title</template-output> <template-output file=“{output_folder}/epic-stories.md”>epic_slug</template-output> <template-output file=“{output_folder}/epic-stories.md”>epic_goal</template-output> <template-output file=“{output_folder}/epic-stories.md”>epic_scope</template-output> <template-output file=“{output_folder}/epic-stories.md”>epic_success_criteria</template-output> <template-output file=“{output_folder}/epic-stories.md”>epic_dependencies</template-output>

Level 1 should have 2-3 stories maximum - prefer longer stories over more stories

Analyze tech spec implementation tasks and time estimates Group related tasks into logical story boundaries

Story Count Decision Matrix:

2 Stories (preferred for most Level 1):

3 Stories (only if necessary):

Never exceed 3 stories for Level 1:

Determine story_count = 2 or 3 based on tech spec complexity

For each story (2-3 total), generate separate story file Story filename format: “story-{epic_slug}-{n}.md” where n = 1, 2, or 3 Each story should represent a deliverable unit of work Stories should have clear acceptance criteria from tech spec Estimate story points based on time estimates in tech spec

Story Generation Guidelines: - Each story = multiple implementation tasks from tech spec - Story title format: User-focused deliverable (not implementation steps) - Include technical acceptance criteria from tech spec tasks - Link back to tech spec sections for implementation details

Story Point Estimation:

Level 1 Typical Totals:

Story Structure (MUST match create-story format):

For story 1: Set story_path_1 = “{dev_story_location}/story-{epic_slug}-1.md” Initialize from user_story_template

<template-output file=“{story_path_1}”>story_title</template-output> <template-output file=“{story_path_1}”>role</template-output> <template-output file=“{story_path_1}”>capability</template-output> <template-output file=“{story_path_1}”>benefit</template-output> <template-output file=“{story_path_1}”>acceptance_criteria</template-output> <template-output file=“{story_path_1}”>tasks_subtasks</template-output> <template-output file=“{story_path_1}”>technical_summary</template-output> <template-output file=“{story_path_1}”>files_to_modify</template-output> <template-output file=“{story_path_1}”>test_locations</template-output> <template-output file=“{story_path_1}”>story_points</template-output> <template-output file=“{story_path_1}”>time_estimate</template-output> <template-output file=“{story_path_1}”>architecture_references</template-output>

For story 2: Set story_path_2 = “{dev_story_location}/story-{epic_slug}-2.md” Initialize from user_story_template

<template-output file=“{story_path_2}”>story_title</template-output> <template-output file=“{story_path_2}”>role</template-output> <template-output file=“{story_path_2}”>capability</template-output> <template-output file=“{story_path_2}”>benefit</template-output> <template-output file=“{story_path_2}”>acceptance_criteria</template-output> <template-output file=“{story_path_2}”>tasks_subtasks</template-output> <template-output file=“{story_path_2}”>technical_summary</template-output> <template-output file=“{story_path_2}”>files_to_modify</template-output> <template-output file=“{story_path_2}”>test_locations</template-output> <template-output file=“{story_path_2}”>story_points</template-output> <template-output file=“{story_path_2}”>time_estimate</template-output> <template-output file=“{story_path_2}”>architecture_references</template-output>

For story 3: Set story_path_3 = “{dev_story_location}/story-{epic_slug}-3.md” Initialize from user_story_template

<template-output file=“{story_path_3}”>story_title</template-output> <template-output file=“{story_path_3}”>role</template-output> <template-output file=“{story_path_3}”>capability</template-output> <template-output file=“{story_path_3}”>benefit</template-output> <template-output file=“{story_path_3}”>acceptance_criteria</template-output> <template-output file=“{story_path_3}”>tasks_subtasks</template-output> <template-output file=“{story_path_3}”>technical_summary</template-output> <template-output file=“{story_path_3}”>files_to_modify</template-output> <template-output file=“{story_path_3}”>test_locations</template-output> <template-output file=“{story_path_3}”>story_points</template-output> <template-output file=“{story_path_3}”>time_estimate</template-output> <template-output file=“{story_path_3}”>architecture_references</template-output>

Generate visual story map showing epic → stories hierarchy Calculate total story points across all stories Estimate timeline based on total points (1-2 points per day typical) Define implementation sequence considering dependencies

Story Map

Epic: Icon Reliability
├── Story 1: Build Icon Infrastructure (3 points)
└── Story 2: Test and Deploy Icons (2 points)

Total Story Points: 5 Estimated Timeline: 1 sprint (1 week)

Implementation Sequence

  1. Story 1 → Build icon infrastructure (setup, download, configure)
  2. Story 2 → Test and deploy (depends on Story 1)

<template-output file=“{output_folder}/epic-stories.md”>story_summaries</template-output> <template-output file=“{output_folder}/epic-stories.md”>story_map</template-output> <template-output file=“{output_folder}/epic-stories.md”>total_points</template-output> <template-output file=“{output_folder}/epic-stories.md”>estimated_timeline</template-output> <template-output file=“{output_folder}/epic-stories.md”>implementation_sequence</template-output>

Open {output_folder}/bmm-workflow-status.md

Update “Workflow Status Tracker” section:

Populate story backlog in “### Implementation Progress (Phase 4 Only)” section:

BACKLOG (Not Yet Drafted)

Ordered story sequence - populated at Phase 4 start:

| Epic | Story | ID | Title | File | | —- | —– | — | —– | —- |

{{#if story_2}} | 1 | 2 | {epic_slug}-2 | {{story_2_title}} | story-{epic_slug}-2.md | {{/if}} {{#if story_3}} | 1 | 3 | {epic_slug}-3 | {{story_3_title}} | story-{epic_slug}-3.md | {{/if}}

Total in backlog: {{story_count - 1}} stories

NOTE: Level 1 uses slug-based IDs like “{epic_slug}-1”, “{epic_slug}-2” instead of numeric “1.1”, “1.2”

TODO (Needs Drafting)

Initialize with FIRST story (already drafted):

IN PROGRESS (Approved for Development)

Leave empty initially:

(Story will be moved here by SM agent story-ready workflow after user approves story-{epic_slug}-1.md)

DONE (Completed Stories)

Initialize empty table:

Story ID File Completed Date Points
(none yet)

Total completed: 0 stories Total points completed: 0 points

Add to Artifacts Generated table:

| tech-spec.md | Complete | {output_folder}/tech-spec.md | {{date}} |
| epic-stories.md | Complete | {output_folder}/epic-stories.md | {{date}} |
| story-{epic_slug}-1.md | Draft | {dev_story_location}/story-{epic_slug}-1.md | {{date}} |
| story-{epic_slug}-2.md | Draft | {dev_story_location}/story-{epic_slug}-2.md | {{date}} |
{{#if story_3}}
| story-{epic_slug}-3.md | Draft | {dev_story_location}/story-{epic_slug}-3.md | {{date}} |
{{/if}}

Update “Next Action Required”:

**What to do next:** Review drafted story-{epic_slug}-1.md, then mark it ready for development

**Command to run:** Load SM agent and run 'story-ready' workflow (confirms story-{epic_slug}-1.md is ready)

**Agent to load:** bmad/bmm/agents/sm.md

Add to Decision Log:

- **{{date}}**: Level 1 tech-spec and epic/stories generation completed. {{story_count}} stories created. Skipping Phase 3 (solutioning) - moving directly to Phase 4 (implementation). Story backlog populated. First story (story-{epic_slug}-1.md) drafted and ready for review.

Save bmm-workflow-status.md

Confirm all stories map to tech spec implementation tasks Verify total story points align with tech spec time estimates Verify stories are properly sequenced with dependencies noted Confirm all stories have measurable acceptance criteria

Level 1 Planning Complete!

Epic: {{epic_title}} Total Stories: {{story_count}} Total Story Points: {{total_points}} Estimated Timeline: {{estimated_timeline}}

Generated Artifacts:

Story Location: {dev_story_location}/

Next Steps - Iterative Implementation:

1. Start with Story 1: a. Load SM agent: {project-root}/bmad/bmm/agents/sm.md b. Run story-context workflow (select story-{epic_slug}-1.md) c. Load DEV agent: {project-root}/bmad/bmm/agents/dev.md d. Run dev-story workflow to implement story 1

2. After Story 1 Complete:

3. After Story 2 Complete: {{#if story_3}}

Progress Tracking:

Ready to proceed? Choose your path:

  1. Generate context for story 1 (recommended - run story-context)
  2. Go directly to dev-story for story 1 (faster)
  3. Exit for now

Select option (1-3):