# Develop Story - Workflow Instructions
```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}
Generate all documents in {document_output_language}
Only modify the story file in these areas: Tasks/Subtasks checkboxes, Dev Agent Record (Debug Log, Completion Notes), File List, Change Log, and Status
Execute ALL steps in exact order; do NOT skip steps
Absolutely DO NOT stop because of "milestones", "significant progress", or "session boundaries". Continue in a single execution until the story is COMPLETE (all ACs satisfied and all tasks/subtasks checked) UNLESS a HALT condition is triggered or the USER gives other instruction.
Do NOT schedule a "next session" or request review pauses unless a HALT condition applies. Only Step 6 decides completion.
User skill level ({user_skill_level}) affects conversation style ONLY, not code updates.
Use {{story_path}} directly
Read COMPLETE story file
Extract story_key from filename or metadata
task_check
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 to understand story order
Find the FIRST story (by 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 "ready-for-dev"
HALT
Store the found story_key (e.g., "1-2-user-authentication") for later status updates
Find matching story file in {{story_dir}} using story_key pattern: {{story_key}}.md
Read COMPLETE story file from discovered path
Parse sections: Story, Acceptance Criteria, Tasks/Subtasks, Dev Notes, Dev Agent Record, File List, Change Log, Status
Check if context file exists at: {{story_dir}}/{{story_key}}.context.xml
Read COMPLETE context file
Parse all sections: story details, artifacts (docs, code, dependencies), interfaces, constraints, tests
Use this context to inform implementation decisions and approaches
Identify first incomplete task (unchecked [ ]) in Tasks/Subtasks
Completion sequence
HALT: "Cannot develop story without access to story file"
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}}
Set review_continuation = false
Set {{pending_review_items}} = empty
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}}]
Update the story in the sprint status report to = "in-progress"
Review acceptance criteria and dev notes for the selected task
Plan implementation steps and edge cases; write down a brief plan in Dev Agent Record â Debug Log
Implement the task COMPLETELY including all subtasks, critically following best practices, coding patterns and coding standards in this repo you have learned about from the story and context file or your own critical agent instructions
Handle error conditions and edge cases appropriately
ASK user for approval before adding
HALT and request guidance
HALT: "Cannot proceed without necessary configuration files"
Do not stop after partial progress; continue iterating tasks until all ACs are satisfied and tested or a HALT condition triggers
Do NOT propose to pause for review, stand-ups, or validation until Step 6 gates are satisfied
Create unit tests for business logic and core functionality introduced/changed by the task
Add integration tests for component interactions where desired by test plan or story notes
Include end-to-end tests for critical user flows where desired by test plan or story notes
Cover edge cases and error handling scenarios noted in the test plan or story notes
Determine how to run tests for this repo (infer or use {{run_tests_command}} if provided)
Run all existing tests to ensure no regressions
Run the new tests to verify implementation correctness
Run linting and code quality checks if configured
Validate implementation meets ALL story acceptance criteria; if ACs include quantitative thresholds (e.g., test pass rate), ensure they are met before marking complete
STOP and fix before continuing, consider how current changes made broke regression
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
Completion
Verify ALL tasks and subtasks are marked [x] (re-scan the story document now)
Run the full regression suite (do not skip)
Confirm File List includes every changed file
Execute story definition-of-done checklist, if the story includes one
Update the story Status to: review
Load the FULL file: {{output_folder}}/sprint-status.yaml
Find development_status key matching {{story_key}}
Verify current status is "in-progress" (expected previous state)
Update development_status[{{story_key}}] = "review"
Save file, preserving ALL comments and structure including STATUS DEFINITIONS
Return to step 1 to complete remaining work (Do NOT finish with partial progress)
STOP and resolve before completing
Update it before completing
Optionally run the workflow validation task against the story using {project-root}/bmad/core/tasks/validate-workflow.xml
Prepare a concise summary in Dev Agent Record â Completion Notes
Communicate to {user_name} that story implementation is complete and ready for review
Summarize key accomplishments: story ID, story key, title, key changes made, tests added, files modified
Provide the story file path and current status (now "review", was "in-progress")
Based on {user_skill_level}, ask if user needs any explanations about:
- What was implemented and how it works
- Why certain technical decisions were made
- How to test or verify the changes
- Any patterns, libraries, or approaches used
- Anything else they'd like clarified
Provide clear, contextual explanations tailored to {user_skill_level}
Use examples and references to specific code when helpful
Once explanations are complete (or user indicates no questions), suggest logical next steps
Common next steps to suggest (but allow user flexibility):
- Review the implemented story yourself and test the changes
- Verify all acceptance criteria are met
- Ensure deployment readiness if applicable
- Run `code-review` workflow for peer review
- Check sprint-status.yaml to see project progress
Remain flexible - allow user to choose their own path or ask for other assistance
```