diff --git a/src/modules/bmm/agents/sm.agent.yaml b/src/modules/bmm/agents/sm.agent.yaml index cb71525e..311aa714 100644 --- a/src/modules/bmm/agents/sm.agent.yaml +++ b/src/modules/bmm/agents/sm.agent.yaml @@ -29,31 +29,6 @@ agent: workflow: "{project-root}/bmad/bmm/workflows/4-implementation/sprint-planning/workflow.yaml" description: Generate or update sprint-status.yaml from epic files - - trigger: create-story - workflow: "{project-root}/bmad/bmm/workflows/4-implementation/create-story/workflow.yaml" - description: Create a Draft Story with Context - - - trigger: story-ready - workflow: "{project-root}/bmad/bmm/workflows/4-implementation/story-ready/workflow.yaml" - description: Mark drafted story ready for development - - - trigger: story-context - workflow: "{project-root}/bmad/bmm/workflows/4-implementation/story-context/workflow.yaml" - description: Assemble dynamic Story Context (XML) from latest docs and code - - - trigger: validate-story-context - validate-workflow: "{project-root}/bmad/bmm/workflows/4-implementation/story-context/workflow.yaml" - description: Validate latest Story Context XML against checklist - - - trigger: retrospective - workflow: "{project-root}/bmad/bmm/workflows/4-implementation/retrospective/workflow.yaml" - data: "{project-root}/bmad/_cfg/agent-manifest.csv" - description: Facilitate team retrospective after epic/sprint - - - trigger: correct-course - workflow: "{project-root}/bmad/bmm/workflows/4-implementation/correct-course/workflow.yaml" - description: Execute correct-course task - - trigger: epic-tech-context workflow: "{project-root}/bmad/bmm/workflows/4-implementation/epic-tech-context/workflow.yaml" description: Use the PRD and Architecture to create a Tech-Spec for a specific epic @@ -61,3 +36,32 @@ agent: - trigger: validate-epic-tech-context validate-workflow: "{project-root}/bmad/bmm/workflows/4-implementation/epic-tech-context/workflow.yaml" description: Validate latest Tech Spec against checklist + + - trigger: create-story + workflow: "{project-root}/bmad/bmm/workflows/4-implementation/create-story/workflow.yaml" + description: Create a Draft Story + + - trigger: validate-create-story + validate-workflow: "{project-root}/bmad/bmm/workflows/4-implementation/create-story/workflow.yaml" + description: Validate Story Draft with Independent Review + + - trigger: story-context + workflow: "{project-root}/bmad/bmm/workflows/4-implementation/story-context/workflow.yaml" + description: Assemble dynamic Story Context (XML) from latest docs and code and mark story ready for dev + + - trigger: validate-story-context + validate-workflow: "{project-root}/bmad/bmm/workflows/4-implementation/story-context/workflow.yaml" + description: Validate latest Story Context XML against checklist + + - trigger: story-ready-for-dev + workflow: "{project-root}/bmad/bmm/workflows/4-implementation/story-ready/workflow.yaml" + description: Mark drafted story ready for dev without generating Story Context + + - trigger: epic-retrospective + workflow: "{project-root}/bmad/bmm/workflows/4-implementation/retrospective/workflow.yaml" + data: "{project-root}/bmad/_cfg/agent-manifest.csv" + description: Facilitate team retrospective after an epic is completed + + - trigger: correct-course + workflow: "{project-root}/bmad/bmm/workflows/4-implementation/correct-course/workflow.yaml" + description: Execute correct-course task diff --git a/src/modules/bmm/workflows/4-implementation/code-review/instructions.md b/src/modules/bmm/workflows/4-implementation/code-review/instructions.md index fc586894..d2a812d0 100644 --- a/src/modules/bmm/workflows/4-implementation/code-review/instructions.md +++ b/src/modules/bmm/workflows/4-implementation/code-review/instructions.md @@ -1,6 +1,6 @@ # Senior Developer Review - Workflow Instructions -```xml +````xml The workflow execution engine is governed by: {project-root}/bmad/core/tasks/workflow.xml You MUST have already loaded and processed: {installed_path}/workflow.yaml Communicate all responses in {communication_language} and language MUST be tailored to {user_skill_level} @@ -206,9 +206,24 @@ Your input: 8. **Security Notes**: Security findings if any 9. **Best-Practices and References**: With links 10. **Action Items**: - - Imperative phrasing - - Map to related ACs or files + - CRITICAL: ALL action items requiring code changes MUST have checkboxes for tracking + - Format for actionable items: `- [ ] [Severity] Description (AC #X) [file: path:line]` + - Format for informational notes: `- Note: Description (no action required)` + - Imperative phrasing for action items + - Map to related ACs or files with specific line references - Include suggested owners if clear + - Example format: + ``` + ### Action Items + + **Code Changes Required:** + - [ ] [High] Add input validation on login endpoint (AC #1) [file: src/routes/auth.js:23-45] + - [ ] [Med] Add unit test for invalid email format [file: tests/unit/auth.test.js] + + **Advisory Notes:** + - Note: Consider adding rate limiting for production deployment + - Note: Document the JWT expiration policy in README + ``` The AC validation checklist and task validation checklist MUST be included in the review - this is the evidence trail @@ -257,7 +272,11 @@ Your input: - Architectural Alignment - Security Notes - Best-Practices and References (with links) - - Action Items (with severity and file references) + - Action Items: + * CRITICAL: Format with checkboxes for tracking resolution + * Code changes required: `- [ ] [Severity] Description [file: path:line]` + * Advisory notes: `- Note: Description (no action required)` + * Group by type: "Code Changes Required" and "Advisory Notes" Add a Change Log entry with date, version bump if applicable, and description: "Senior Developer Review notes appended". If {{update_status_on_result}} is true: update Status to {{status_on_approve}} when approved; to {{status_on_changes_requested}} when changes requested; otherwise leave unchanged. @@ -369,4 +388,4 @@ Review was saved to story file, but sprint-status.yaml may be out of sync. -``` +```` diff --git a/src/modules/bmm/workflows/4-implementation/create-story/checklist.md b/src/modules/bmm/workflows/4-implementation/create-story/checklist.md index 11f009f1..6d9f1460 100644 --- a/src/modules/bmm/workflows/4-implementation/create-story/checklist.md +++ b/src/modules/bmm/workflows/4-implementation/create-story/checklist.md @@ -1,39 +1,240 @@ ---- -title: 'Create Story Checklist' -validation-target: 'Newly generated story markdown file' -required-inputs: - - 'epics.md (preferred) or PRD' -optional-inputs: - - 'architecture document for architecture context' -validation-rules: - - 'Story structure matches sections: Status, Story, Acceptance Criteria, Tasks/Subtasks, Dev Notes, Change Log, Dev Agent Record' - - 'Dev Notes include Project Structure Notes and References subsections' - - 'All non-trivial technical notes include a source citation' - - 'Tasks include explicit testing subtasks based on testing strategy' ---- +# Create Story Quality Validation Checklist -# Create Story Checklist +```xml +This validation runs in a FRESH CONTEXT by an independent validator agent +The validator audits story quality and offers to improve if issues are found +Load only the story file and necessary source documents - do NOT load workflow instructions -## Document Structure + -- [ ] Title includes story id and title -- [ ] Status set to Draft -- [ ] Story section present with As a / I want / so that -- [ ] Acceptance Criteria is a numbered list -- [ ] Tasks/Subtasks present with checkboxes -- [ ] Dev Notes includes architecture/testing context -- [ ] Change Log table initialized -- [ ] Dev Agent Record sections present (Context Reference, Agent Model Used, Debug Log References, Completion Notes, File List) + +**What create-story workflow should have accomplished:** -## Content Quality +1. **Previous Story Continuity:** If a previous story exists (status: done/review/in-progress), current story should have "Learnings from Previous Story" subsection in Dev Notes that references: new files created, completion notes, architectural decisions, unresolved review items +2. **Source Document Coverage:** Story should cite tech spec (if exists), epics, PRD, and relevant architecture docs (architecture.md, testing-strategy.md, coding-standards.md, unified-project-structure.md) +3. **Requirements Traceability:** ACs sourced from tech spec (preferred) or epics, not invented +4. **Dev Notes Quality:** Specific guidance with citations, not generic advice +5. **Task-AC Mapping:** Every AC has tasks, every task references AC, testing subtasks present +6. **Structure:** Status="drafted", proper story statement, Dev Agent Record sections initialized + -- [ ] Acceptance Criteria sourced from epics/PRD (or explicitly confirmed by user) -- [ ] Tasks reference AC numbers where applicable -- [ ] Dev Notes do not invent details; cite sources where possible -- [ ] File saved to stories directory from config (dev_story_location) -- [ ] If creating a new story number, epics.md explicitly enumerates this story under the target epic; otherwise generation HALTED with instruction to run PM/SM `*correct-course` (open `{project-root}/bmad/bmm/agents/pm.md` or `{project-root}/bmad/bmm/agents/sm.md` and execute `*correct-course`) +## Validation Steps -## Optional Post-Generation +### 1. Load Story and Extract Metadata +- [ ] Load story file: {{story_file_path}} +- [ ] Parse sections: Status, Story, ACs, Tasks, Dev Notes, Dev Agent Record, Change Log +- [ ] Extract: epic_num, story_num, story_key, story_title +- [ ] Initialize issue tracker (Critical/Major/Minor) -- [ ] Story Context generation run (if auto_run_context) -- [ ] Context Reference recorded in story +### 2. Previous Story Continuity Check + +**Find previous story:** +- [ ] Load {output_folder}/sprint-status.yaml +- [ ] Find current {{story_key}} in development_status +- [ ] Identify story entry immediately above (previous story) +- [ ] Check previous story status + +**If previous story status is done/review/in-progress:** +- [ ] Load previous story file: {story_dir}/{{previous_story_key}}.md +- [ ] Extract: Dev Agent Record (Completion Notes, File List with NEW/MODIFIED) +- [ ] Extract: Senior Developer Review section if present +- [ ] Count unchecked [ ] items in Review Action Items +- [ ] Count unchecked [ ] items in Review Follow-ups (AI) + +**Validate current story captured continuity:** +- [ ] Check: "Learnings from Previous Story" subsection exists in Dev Notes + - If MISSING and previous story has content → **CRITICAL ISSUE** +- [ ] If subsection exists, verify it includes: + - [ ] References to NEW files from previous story → If missing → **MAJOR ISSUE** + - [ ] Mentions completion notes/warnings → If missing → **MAJOR ISSUE** + - [ ] Calls out unresolved review items (if any exist) → If missing → **CRITICAL ISSUE** + - [ ] Cites previous story: [Source: stories/{{previous_story_key}}.md] + +**If previous story status is backlog/drafted:** +- [ ] No continuity expected (note this) + +**If no previous story exists:** +- [ ] First story in epic, no continuity expected + +### 3. Source Document Coverage Check + +**Build available docs list:** +- [ ] Check exists: tech-spec-epic-{{epic_num}}*.md in {tech_spec_search_dir} +- [ ] Check exists: {output_folder}/epics.md +- [ ] Check exists: {output_folder}/PRD.md +- [ ] Check exists in {output_folder}/ or {project-root}/docs/: + - architecture.md, testing-strategy.md, coding-standards.md + - unified-project-structure.md, tech-stack.md + - backend-architecture.md, frontend-architecture.md, data-models.md + +**Validate story references available docs:** +- [ ] Extract all [Source: ...] citations from story Dev Notes +- [ ] Tech spec exists but not cited → **CRITICAL ISSUE** +- [ ] Epics exists but not cited → **CRITICAL ISSUE** +- [ ] Architecture.md exists → Read for relevance → If relevant but not cited → **MAJOR ISSUE** +- [ ] Testing-strategy.md exists → Check Dev Notes mentions testing standards → If not → **MAJOR ISSUE** +- [ ] Testing-strategy.md exists → Check Tasks have testing subtasks → If not → **MAJOR ISSUE** +- [ ] Coding-standards.md exists → Check Dev Notes references standards → If not → **MAJOR ISSUE** +- [ ] Unified-project-structure.md exists → Check Dev Notes has "Project Structure Notes" subsection → If not → **MAJOR ISSUE** + +**Validate citation quality:** +- [ ] Verify cited file paths are correct and files exist → Bad citations → **MAJOR ISSUE** +- [ ] Check citations include section names, not just file paths → Vague citations → **MINOR ISSUE** + +### 4. Acceptance Criteria Quality Check + +- [ ] Extract Acceptance Criteria from story +- [ ] Count ACs: {{ac_count}} (if 0 → **CRITICAL ISSUE** and halt) +- [ ] Check story indicates AC source (tech spec, epics, PRD) + +**If tech spec exists:** +- [ ] Load tech spec +- [ ] Search for this story number +- [ ] Extract tech spec ACs for this story +- [ ] Compare story ACs vs tech spec ACs → If mismatch → **MAJOR ISSUE** + +**If no tech spec but epics.md exists:** +- [ ] Load epics.md +- [ ] Search for Epic {{epic_num}}, Story {{story_num}} +- [ ] Story not found in epics → **CRITICAL ISSUE** (should have halted) +- [ ] Extract epics ACs +- [ ] Compare story ACs vs epics ACs → If mismatch without justification → **MAJOR ISSUE** + +**Validate AC quality:** +- [ ] Each AC is testable (measurable outcome) +- [ ] Each AC is specific (not vague) +- [ ] Each AC is atomic (single concern) +- [ ] Vague ACs found → **MINOR ISSUE** + +### 5. Task-AC Mapping Check + +- [ ] Extract Tasks/Subtasks from story +- [ ] For each AC: Search tasks for "(AC: #{{ac_num}})" reference + - [ ] AC has no tasks → **MAJOR ISSUE** +- [ ] For each task: Check if references an AC number + - [ ] Tasks without AC refs (and not testing/setup) → **MINOR ISSUE** +- [ ] Count tasks with testing subtasks + - [ ] Testing subtasks < ac_count → **MAJOR ISSUE** + +### 6. Dev Notes Quality Check + +**Check required subsections exist:** +- [ ] Architecture patterns and constraints +- [ ] References (with citations) +- [ ] Project Structure Notes (if unified-project-structure.md exists) +- [ ] Learnings from Previous Story (if previous story has content) +- [ ] Missing required subsections → **MAJOR ISSUE** + +**Validate content quality:** +- [ ] Architecture guidance is specific (not generic "follow architecture docs") → If generic → **MAJOR ISSUE** +- [ ] Count citations in References subsection + - [ ] No citations → **MAJOR ISSUE** + - [ ] < 3 citations and multiple arch docs exist → **MINOR ISSUE** +- [ ] Scan for suspicious specifics without citations: + - API endpoints, schema details, business rules, tech choices + - [ ] Likely invented details found → **MAJOR ISSUE** + +### 7. Story Structure Check + +- [ ] Status = "drafted" → If not → **MAJOR ISSUE** +- [ ] Story section has "As a / I want / so that" format → If malformed → **MAJOR ISSUE** +- [ ] Dev Agent Record has required sections: + - Context Reference, Agent Model Used, Debug Log References, Completion Notes List, File List + - [ ] Missing sections → **MAJOR ISSUE** +- [ ] Change Log initialized → If missing → **MINOR ISSUE** +- [ ] File in correct location: {story_dir}/{{story_key}}.md → If not → **MAJOR ISSUE** + +### 8. Unresolved Review Items Alert + +**CRITICAL CHECK for incomplete review items from previous story:** + +- [ ] If previous story has "Senior Developer Review (AI)" section: + - [ ] Count unchecked [ ] items in "Action Items" + - [ ] Count unchecked [ ] items in "Review Follow-ups (AI)" + - [ ] If unchecked items > 0: + - [ ] Check current story "Learnings from Previous Story" mentions these + - [ ] If NOT mentioned → **CRITICAL ISSUE** with details: + - List all unchecked items with severity + - Note: "These may represent epic-wide concerns" + - Required: Add to Learnings section with note about pending items + +## Validation Report Generation + +**Calculate severity counts:** +- Critical: {{critical_count}} +- Major: {{major_count}} +- Minor: {{minor_count}} + +**Determine outcome:** +- Critical > 0 OR Major > 3 → **FAIL** +- Major ≤ 3 and Critical = 0 → **PASS with issues** +- All = 0 → **PASS** + +**Generate report:** +``` + +# Story Quality Validation Report + +Story: {{story_key}} - {{story_title}} +Outcome: {{outcome}} (Critical: {{critical_count}}, Major: {{major_count}}, Minor: {{minor_count}}) + +## Critical Issues (Blockers) + +{{list_each_with_description_and_evidence}} + +## Major Issues (Should Fix) + +{{list_each_with_description_and_evidence}} + +## Minor Issues (Nice to Have) + +{{list_each_with_description}} + +## Successes + +{{list_what_was_done_well}} + +``` + +## User Alert and Remediation + +**If FAIL:** +- Show issues summary and top 3 issues +- Offer options: (1) Auto-improve story, (2) Show detailed findings, (3) Fix manually, (4) Accept as-is +- If option 1: Re-load source docs, regenerate affected sections, re-run validation + +**If PASS with issues:** +- Show issues list +- Ask: "Improve story? (y/n)" +- If yes: Enhance story with missing items + +**If PASS:** +- Confirm: All quality standards met +- List successes +- Ready for story-context generation + + +``` + +## Quick Reference + +**Validation runs in fresh context and checks:** + +1. ✅ Previous story continuity captured (files, notes, **unresolved review items**) +2. ✅ All relevant source docs discovered and cited +3. ✅ ACs match tech spec/epics exactly +4. ✅ Tasks cover all ACs with testing +5. ✅ Dev Notes have specific guidance with citations (not generic) +6. ✅ Structure and metadata complete + +**Severity Levels:** + +- **CRITICAL** = Missing previous story reference, missing tech spec cite, unresolved review items not called out, story not in epics +- **MAJOR** = Missing arch docs, missing files from previous story, vague Dev Notes, ACs don't match source, no testing subtasks +- **MINOR** = Vague citations, orphan tasks, missing Change Log + +**Outcome Triggers:** + +- **FAIL** = Any critical OR >3 major issues +- **PASS with issues** = ≤3 major issues, no critical +- **PASS** = All checks passed diff --git a/src/modules/bmm/workflows/4-implementation/create-story/instructions.md b/src/modules/bmm/workflows/4-implementation/create-story/instructions.md index f98f26ef..1e9182a8 100644 --- a/src/modules/bmm/workflows/4-implementation/create-story/instructions.md +++ b/src/modules/bmm/workflows/4-implementation/create-story/instructions.md @@ -1,6 +1,6 @@ # Create Story - Workflow Instructions (Spec-compliant, non-interactive by default) -```xml +````xml The workflow execution engine is governed by: {project_root}/bmad/core/tasks/workflow.xml You MUST have already loaded and processed: {installed_path}/workflow.yaml Generate all documents in {document_output_language} @@ -17,6 +17,74 @@ + PREVIOUS STORY CONTINUITY: Essential for maintaining context and learning from prior development + + Find the previous completed story to extract dev agent learnings and review findings: + 1. Load {{output_folder}}/sprint-status.yaml COMPLETELY + 2. Find current {{story_key}} in development_status section + 3. Identify the story entry IMMEDIATELY ABOVE current story (previous row in file order) + 4. If previous story exists: + - Extract {{previous_story_key}} + - Check previous story status (done, in-progress, review, etc.) + - If status is "done", "review", or "in-progress" (has some completion): + * Construct path: {{story_dir}}/{{previous_story_key}}.md + * Load the COMPLETE previous story file + * Parse ALL sections comprehensively: + + A) Dev Agent Record → Completion Notes List: + - New patterns/services created (to reuse, not recreate) + - Architectural deviations or decisions made + - Technical debt deferred to future stories + - Warnings or recommendations for next story + - Interfaces/methods created for reuse + + B) Dev Agent Record → Debug Log References: + - Issues encountered and solutions + - Gotchas or unexpected challenges + - Workarounds applied + + C) Dev Agent Record → File List: + - Files created (NEW) - understand new capabilities + - Files modified (MODIFIED) - track evolving components + - Files deleted (DELETED) - removed functionality + + D) Dev Notes: + - Any "future story" notes or TODOs + - Patterns established + - Constraints discovered + + E) Senior Developer Review (AI) section (if present): + - Review outcome (Approve/Changes Requested/Blocked) + - Unresolved action items (unchecked [ ] items) + - Key findings that might affect this story + - Architectural concerns raised + + F) Senior Developer Review → Action Items (if present): + - Check for unchecked [ ] items still pending + - Note any systemic issues that apply to multiple stories + + G) Review Follow-ups (AI) tasks (if present): + - Check for unchecked [ ] review tasks still pending + - Determine if they're epic-wide concerns + + H) Story Status: + - If "review" or "in-progress" - incomplete, note what's pending + - If "done" - confirmed complete + * Store ALL findings as {{previous_story_learnings}} with structure: + - new_files: [list] + - modified_files: [list] + - new_services: [list with descriptions] + - architectural_decisions: [list] + - technical_debt: [list] + - warnings_for_next: [list] + - review_findings: [list if review exists] + - pending_items: [list of unchecked action items] + - If status is "backlog" or "drafted": + * Set {{previous_story_learnings}} = "Previous story not yet implemented" + 5. If no previous story exists (first story in epic): + - Set {{previous_story_learnings}} = "First story in epic - no predecessor context" + + If {{tech_spec_file}} empty: derive from {{tech_spec_glob_template}} with {{epic_num}} and search {{tech_spec_search_dir}} recursively. If multiple, pick most recent by modified time. Build a prioritized document set for this epic: 1) tech_spec_file (epic-scoped) @@ -82,8 +150,20 @@ Will update existing story file rather than creating new one. - If a previous story exists, scan its "Dev Agent Record" for completion notes and known deviations; summarize any carry-overs relevant to this story. + Review {{previous_story_learnings}} and extract actionable intelligence: + - New patterns/services created → Note for reuse (DO NOT recreate) + - Architectural deviations → Understand and maintain consistency + - Technical debt items → Assess if this story should address them + - Files modified → Understand current state of evolving components + - Warnings/recommendations → Apply to this story's approach + - Review findings → Learn from issues found in previous story + - Pending action items → Determine if epic-wide concerns affect this story + + If unified-project-structure.md present: align expected file paths, module names, and component locations; note any potential conflicts. + + Cross-reference {{previous_story_learnings}}.new_files with project structure to understand where new capabilities are located. + structure_alignment_summary @@ -101,6 +181,32 @@ Will update existing story file rather than creating new one. story_header story_body dev_notes_with_citations + + If {{previous_story_learnings}} contains actionable items (not "First story" or "not yet implemented"): + - Add "Learnings from Previous Story" subsection to Dev Notes + - Include relevant completion notes, new files/patterns, deviations + - Cite previous story file as reference [Source: stories/{{previous_story_key}}.md] + - Highlight interfaces/services to REUSE (not recreate) + - Note any technical debt to address in this story + - List pending review items that affect this story (if any) + - Reference specific files created: "Use {{file_path}} for {{purpose}}" + - Format example: + ``` + ### Learnings from Previous Story + + **From Story {{previous_story_key}} (Status: {{previous_status}})** + + - **New Service Created**: `AuthService` base class available at `src/services/AuthService.js` - use `AuthService.register()` method + - **Architectural Change**: Switched from session-based to JWT authentication + - **Schema Changes**: User model now includes `passwordHash` field, migration applied + - **Technical Debt**: Email verification skipped, should be included in this or subsequent story + - **Testing Setup**: Auth test suite initialized at `tests/integration/auth.test.js` - follow patterns established there + - **Pending Review Items**: Rate limiting mentioned in review - consider for this story + + [Source: stories/{{previous_story_key}}.md#Dev-Agent-Record] + ``` + + change_log @@ -120,11 +226,10 @@ Will update existing story file rather than creating new one. ⚠️ Could not update story status: {{story_key}} not found in sprint-status.yaml Story file was created successfully, but sprint-status.yaml was not updated. -You may need to run sprint-planning to refresh tracking. +You may need to run sprint-planning to refresh tracking, or manually set the story row status to `drafted`. - If {{auto_run_context}} == true → Pass {{story_path}} = {default_output_file} Report created/updated story path **✅ Story Created Successfully, {user_name}!** @@ -144,4 +249,4 @@ You may need to run sprint-planning to refresh tracking. -``` +```` diff --git a/src/modules/bmm/workflows/4-implementation/create-story/workflow.yaml b/src/modules/bmm/workflows/4-implementation/create-story/workflow.yaml index 160bce6e..77f0dded 100644 --- a/src/modules/bmm/workflows/4-implementation/create-story/workflow.yaml +++ b/src/modules/bmm/workflows/4-implementation/create-story/workflow.yaml @@ -33,7 +33,6 @@ variables: story_title: "" # Will be elicited if not derivable epic_num: 1 story_num: 1 - auto_run_context: true # Optionally run story-context after creation non_interactive: true # Generate without elicitation; avoid interactive prompts # Output configuration diff --git a/src/modules/bmm/workflows/4-implementation/dev-story/instructions.md b/src/modules/bmm/workflows/4-implementation/dev-story/instructions.md index e254f648..bb165afe 100644 --- a/src/modules/bmm/workflows/4-implementation/dev-story/instructions.md +++ b/src/modules/bmm/workflows/4-implementation/dev-story/instructions.md @@ -72,7 +72,47 @@ Proceeding with story file only. For better context, consider running `story-con ASK user to clarify or HALT - + + Determine if this is a fresh start or continuation after code review + + Check if "Senior Developer Review (AI)" section exists in the story file + Check if "Review Follow-ups (AI)" subsection exists under Tasks/Subtasks + + + Set review_continuation = true + Extract from "Senior Developer Review (AI)" section: + - Review outcome (Approve/Changes Requested/Blocked) + - Review date + - Total action items with checkboxes (count checked vs unchecked) + - Severity breakdown (High/Med/Low counts) + + Count unchecked [ ] review follow-up tasks in "Review Follow-ups (AI)" subsection + Store list of unchecked review items as {{pending_review_items}} + + ⏯️ **Resuming Story After Code Review** ({{review_date}}) + +**Review Outcome:** {{review_outcome}} +**Action Items:** {{unchecked_review_count}} remaining to address +**Priorities:** {{high_count}} High, {{med_count}} Medium, {{low_count}} Low + +**Strategy:** Will prioritize review follow-up tasks (marked [AI-Review]) before continuing with regular tasks. + + + + + Set review_continuation = false + Set {{pending_review_items}} = empty + + 🚀 **Starting Fresh Implementation** + +Story: {{story_key}} +Context file: {{context_available}} +First incomplete task: {{first_task_description}} + + + + + Load the FULL file: {{output_folder}}/sprint-status.yaml Read all development_status entries to find {{story_key}} Get current status value for development_status[{{story_key}}] @@ -126,10 +166,34 @@ Expected ready-for-dev or in-progress. Continuing anyway... STOP and fix before continuing - + + If task is a review follow-up, must mark BOTH the task checkbox AND the corresponding action item in the review section + + Check if completed task has [AI-Review] prefix (indicates review follow-up task) + + + Extract review item details (severity, description, related AC/file) + Add to resolution tracking list: {{resolved_review_items}} + + + Mark task checkbox [x] in "Tasks/Subtasks → Review Follow-ups (AI)" section + + + Find matching action item in "Senior Developer Review (AI) → Action Items" section by matching description + Mark that action item checkbox [x] as resolved + + Add to Dev Agent Record → Completion Notes: "✅ Resolved review finding [{{severity}}]: {{description}}" + + ONLY mark the task (and subtasks) checkbox with [x] if ALL tests pass and validation succeeds Update File List section with any new, modified, or deleted files (paths relative to repo root) Add completion notes to Dev Agent Record if significant changes were made (summarize intent, approach, and any follow-ups) + + + Count total resolved review items in this session + Add Change Log entry: "Addressed code review findings - {{resolved_count}} items resolved (Date: {{date}})" + + Save the story file Determine if more incomplete tasks remain Next task