UNPKG

@cloudkinetix/bmad-enhanced

Version:

Cloud-Kinetix enhanced fork of BMAD-METHOD - Breakthrough Method of Agile AI-driven Development with robust versioning and unified validation.

263 lines (173 loc) 5.93 kB
# Prepare Stories for BMAD Method > **Works with any IDE** - This task provides BMAD story validation steps ## Purpose Validate and prepare user stories for parallel execution using BMAD Method dev agents. Ensures stories follow the exact BMAD story template format and contain all required sections for autonomous developer agent execution. ## Prerequisites - User stories exist in `docs/stories/` or specified directory - Access to BMAD story-tmpl.md template - Access to architecture sharded documents - Scrum Master (SM) agent available for validation ## Execution Steps ### 1. Story Format Validation For each story file: #### 1.1 Check Required Sections ```markdown Required sections in order: - # Story {EpicNum}.{StoryNum}: {Title} - ## Status: {Draft|Approved|InProgress|Review|Done} - ## Story (As a... I want... so that...) - ## Acceptance Criteria (ACs) - ## Tasks / Subtasks - ## Dev Notes - ### Testing - ## Dev Agent Record ``` #### 1.2 Validate Story Format - Story MUST use: "As a {role}, I want {action}, so that {benefit}" - Each line on separate bullet point - No variations allowed #### 1.3 Check Acceptance Criteria - Must be numbered list (1., 2., 3., etc.) - Each AC must be specific and testable - No placeholder text allowed #### 1.4 Validate Tasks Structure ```markdown - [ ] Task 1 (AC: # if applicable) - [ ] Subtask 1.1 - [ ] Subtask 1.2 - [ ] Task 2 (AC: # if applicable) ``` ### 2. Dev Notes Enhancement #### 2.1 Check for Missing Information - Relevant source tree paths - Dependencies and imports needed - Configuration requirements - Integration points #### 2.2 Gather from Sharded Docs If Dev Notes are incomplete: 1. Read architecture index.md 2. Identify relevant shards for story 3. Extract specific implementation details 4. Add to Dev Notes (no PRD/Architecture references) #### 2.3 Previous Story Context - Check previous story's Completion Notes - Extract relevant insights - Add to current story's Dev Notes ### 3. Testing Requirements #### 3.1 Validate Testing Section Format ```markdown Dev Note: Story Requires the following tests: - [ ] Jest Unit Tests: (nextToFile: true), coverage requirement: 80% - [ ] Jest Integration Test: location: /tests/integration/story-name.spec.js - [ ] Cypress E2E: location: /e2e/epic-name/story.test.js Manual Test Steps: - Step 1: ... - Step 2: ... ``` #### 3.2 Add Missing Test Requirements - Default to 80% coverage if not specified - Add test locations based on project structure - Include manual test steps for UI changes ### 4. Dev Agent Record Preparation #### 4.1 Ensure All Sections Present ```markdown ### Agent Model Used: {blank for dev to fill} ### Debug Log References [[LLM: (Dev Agent) If the debug is logged to...]] ### Completion Notes List [[LLM: (Dev Agent) Anything the SM needs to know...]] ### Change Log | Date | Version | Description | Author | | :--- | :------ | :---------- | :----- | ``` #### 4.2 Add SM Instructions Keep the [[LLM: ...]] prompts for dev agent guidance ### 5. Story Readiness Validation (3-Tier System) #### 5.1 Execute Comprehensive Validation ```markdown [[LLM: Run validate-story-readiness.md for each story]] For each story: 1. Load validation rules based on story type 2. Execute critical, warning, and suggestion checks 3. Generate detailed validation report ``` #### 5.2 Handle Validation Results **Critical Issues (Cannot Override):** - Missing title, description, or invalid format - Block story immediately - Require fixes before proceeding **Warnings (Can Override with Justification):** - Missing dev notes, acceptance criteria, test specs - Present specific risks for parallel development - Allow override but log justification **Suggestions (Informational):** - Large story size, potential duplication - Display but don't block - Track for process insights #### 5.3 Interactive Warning Resolution When warnings are found: ```markdown ⚠️ VALIDATION WARNING: Story has risks for parallel development Story: {{story_title}} Issues found: - Missing detailed dev notes (increases merge conflict risk) - No acceptance criteria (unclear completion definition) Options: [1] Fix issues and re-validate [2] Override and proceed (requires justification) [3] Skip this story Your choice: \_ ``` ### 6. Self-Containment Verification #### 6.1 No External Dependencies Story must NOT reference: - PRD documents - Architecture documents - Other stories (except previous for context) #### 6.2 Complete Information Story MUST contain: - All technical details needed - Clear task breakdown - Specific file paths - Test requirements - Configuration needs ### 7. Batch Validation Report After checking all stories: ```markdown ## BMAD Story Validation Report ### Summary - Total Stories: X - Valid Format: Y - Need Updates: Z ### Issues Found 1. Story 1.1: Missing Dev Notes for API endpoints 2. Story 1.2: Invalid Status (should be Draft) 3. Story 2.1: Missing test requirements ### Recommendations 1. Run SM agent to complete Dev Notes 2. Update story statuses 3. Add missing test specifications ### Ready for Parallel Execution - [x] Story 1.3 - [x] Story 1.4 - [ ] Story 1.1 (needs Dev Notes) - [ ] Story 1.2 (needs status update) ``` ## Integration with Parallel Development This task should be run: 1. Before `/stories` command execution 2. As part of `/stories:analyze` mode 3. When `--bmad-mode` flag is enabled (default) ## Error Handling - Missing required sections: Block and report - Invalid format: Suggest corrections - Incomplete Dev Notes: Offer to gather from shards - Wrong status: Recommend SM review ## Success Criteria Story is BMAD-ready when: - All sections present and formatted correctly - Status is "Approved" (or Draft with override) - Dev Notes contain all implementation details - Testing requirements specified - Dev Agent Record sections ready - No external document dependencies