# 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 If {{run_until_complete}} == true, run non-interactively: do not pause between steps unless a HALT condition is reached or explicit user approval is required for unapproved dependencies. 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) or a HALT condition is triggered. 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 Query sprint-status for ready stories: action: get_next_story filter_status: ready-for-dev 📋 No ready-for-dev stories found in sprint-status.yaml **Options:** 1. Run `story-ready` to mark drafted stories as ready 2. Run `create-story` if no stories are drafted yet 3. Check sprint-status.yaml to see current story states HALT Use {{result_story_key}} to find story file in {{story_dir}} Read COMPLETE story file from discovered path Store {{result_story_key}} for later status updates Parse sections: Story, Acceptance Criteria, Tasks/Subtasks, Dev Notes, Dev Agent Record, File List, Change Log, Status 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 action: get_story_status story_key: {{result_story_key}} action: update_story_status story_key: {{result_story_key}} new_status: in-progress validate: true 🚀 Starting work on story {{result_story_key}} Status updated: {{result_old_status}} → {{result_new_status}} ⏯️ Resuming work on story {{result_story_key}} Story is already marked 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, following architecture patterns and coding standards in this repo 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 or a HALT condition triggers Do NOT propose to pause for review, standups, 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 applicable Include end-to-end tests for critical user flows if applicable Cover edge cases and error handling scenarios noted in the plan 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 STOP and fix before continuing 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) Append a brief entry to Change Log describing the change 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: Ready for Review action: update_story_status story_key: {{result_story_key}} new_status: review validate: true ⚠️ Story file updated, but sprint-status update failed: {{result_error}} Story is marked Ready for Review in file, but sprint-status.yaml may be out of sync. 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 that the story is Ready for Review **✅ Story Implementation Complete, {user_name}!** **Story Details:** - Story ID: {{current_story_id}} - Story Key: {{result_story_key}} - Title: {{current_story_title}} - File: {{story_path}} - Status: {{result_new_status}} (was {{result_old_status}}) **Next Steps:** 1. Review the implemented story and test the changes 2. Verify all acceptance criteria are met 3. Run `review-story` workflow for senior developer review 4. When review passes, run `story-done` to mark complete ```