BMAD-METHOD/src/modules/bmm/workflows/4-implementation/story-done/instructions.md

4.2 KiB

Story Approved Workflow Instructions (DEV Agent)

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} Generate all documents in {document_output_language}

This workflow is run by DEV agent AFTER user confirms a story is approved (Definition of Done is complete) Workflow: Update story file status to Done

If {{story_path}} is provided → use it directly; extract story_key from filename or metadata; GOTO mark_done

MUST read COMPLETE sprint-status.yaml file from start to end to preserve order Load the FULL file: {{output_folder}}/sprint-status.yaml Read ALL lines from beginning to end - do not skip any content Parse the development_status section completely

Find ALL stories (reading in order from top to bottom) where:

  • Key matches pattern: number-number-name (e.g., "1-2-user-auth")
  • NOT an epic key (epic-X) or retrospective (epic-X-retrospective)
  • Status value equals "review"

Collect up to 10 review story keys in order (limit for display purposes) Count total review stories found

📋 No stories in review status found

All stories are either still in development or already done.

Options:

  1. Run dev-story to implement stories
  2. Run review-story if stories need review first
  3. Check sprint-status.yaml for current story states HALT

Display available reviewed stories:

Stories Ready to Mark Done ({{review_count}} found):

{{list_of_review_story_keys}}

Select the story to mark as Done (enter story key or number):

Resolve selected story_key from user input Find matching story file in {{story_dir}} using story_key pattern

Read the story file from resolved path Extract story_id and story_title from the file

Find the "Status:" line (usually at the top) Update story file: Change Status to "Done"

Add completion notes to Dev Agent Record section: Find "## Dev Agent Record" section and add:

### Completion Notes
**Completed:** {{date}}
**Definition of Done:** All acceptance criteria met, code reviewed, tests passing

Save the story file

Load the FULL file: {{output_folder}}/sprint-status.yaml Find development_status key matching {{story_key}} Verify current status is "review" (expected previous state) Update development_status[{{story_key}}] = "done" Save file, preserving ALL comments and structure including STATUS DEFINITIONS ⚠️ Story file updated, but could not update sprint-status: {{story_key}} not found

Story is marked Done in file, but sprint-status.yaml may be out of sync.

Story Approved and Marked Done, {user_name}!

Story file updated: {{story_file}} → Status: Done Sprint status updated: review → done

Completed Story:

  • ID: {{story_id}}
  • Key: {{story_key}}
  • Title: {{story_title}}
  • File: {{story_file}}
  • Completed: {{date}}

Next Steps:

  1. Continue with next story in your backlog
    • Run create-story for next backlog story
    • Or run dev-story if ready stories exist
  2. Check epic completion status
    • Run retrospective workflow to check if epic is complete
    • Epic retrospective will verify all stories are done
```