Execute given workflow by loading its configuration, following instructions, and producing output Always read COMPLETE files - NEVER use offset/limit when reading any workflow related files Instructions are MANDATORY - either as file path, steps or embedded list in YAML, XML or markdown Execute ALL steps in instructions IN EXACT ORDER Save to template output file after EVERY "template-output" tag NEVER skip a step - YOU are responsible for every steps execution without fail or excuse Steps execute in exact numerical order (1, 2, 3...) Optional steps: Ask user unless #yolo mode active Template-output tags: Save content, discuss with the user the section completed, and NEVER proceed until the users indicates to proceed (unless YOLO mode has been activated) Read workflow.yaml from provided path Load config_source (REQUIRED for all modules) Load external config from config_source path Resolve all {config_source}: references with values from config Resolve system variables (date:system-generated) and paths ({project-root}, {installed_path}) Ask user for input of any variables that are still unknown Instructions: Read COMPLETE file from path OR embedded list (REQUIRED) If template path → Read COMPLETE template file If validation path → Note path for later loading when needed If template: false → Mark as action-workflow (else template-workflow) Data files (csv, json) → Store paths only, load on-demand when instructions reference them Resolve default_output_file path with all variables and {{date}} Create output directory if doesn't exist If template-workflow → Write template to output file with placeholders If action-workflow → Skip file creation For each step in instructions: If optional="true" and NOT #yolo → Ask user to include If if="condition" → Evaluate condition If for-each="item" → Repeat step for each item If repeat="n" → Repeat step n times Process step instructions (markdown or XML tags) Replace {{variables}} with values (ask user if unknown) action xml tag → Perform the action check if="condition" xml tag → Conditional block wrapping actions (requires closing </check>) ask xml tag → Prompt user and WAIT for response invoke-workflow xml tag → Execute another workflow with given inputs and the workflow.xml runner invoke-task xml tag → Execute specified task invoke-protocol name="protocol_name" xml tag → Execute reusable protocol from protocols section invoke-bash cmd="command" → Execute shell command, capture stdout/stderr, set {{bash_exit_code}}, {{bash_stdout}}, {{bash_stderr}} set-var name="varname" value="..." → Set runtime variable {{varname}} to specified value (supports expressions) goto step="x" → Jump to specified step Generate content for this section Save to file (Write first time, Edit subsequent) Display generated content [a] Advanced Elicitation, [c] Continue, [p] Party-Mode, [y] YOLO the rest of this document only. WAIT for response. Start the advanced elicitation workflow {project-root}/_bmad/core/tasks/advanced-elicitation.xml Continue to next step Start the party-mode workflow {project-root}/_bmad/core/workflows/party-mode/workflow.yaml Enter #yolo mode for the rest of the workflow If no special tags and NOT #yolo: Continue to next step? (y/n/edit) Confirm document saved to output path Report workflow completion Full user interaction and confirmation of EVERY step at EVERY template output - NO EXCEPTIONS except yolo MODE Skip all confirmations and elicitation, minimize prompts and try to produce all of the workflow automatically by simulating the remaining discussions with an simulated expert user step n="X" goal="..." - Define step with number and goal optional="true" - Step can be skipped if="condition" - Conditional execution for-each="collection" - Iterate over items repeat="n" - Repeat n times action - Required action to perform action if="condition" - Single conditional action (inline, no closing tag needed) check if="condition">...</check> - Conditional block wrapping multiple items (closing tag required) ask - Get user input (ALWAYS wait for response before continuing) goto - Jump to another step invoke-workflow - Call another workflow invoke-task - Call a task invoke-protocol - Execute a reusable protocol (e.g., discover_inputs) invoke-bash cmd="..." - Execute shell command, results in {{bash_exit_code}}, {{bash_stdout}}, {{bash_stderr}} set-var name="..." value="..." - Set runtime variable dynamically template-output - Save content checkpoint critical - Cannot be skipped example - Show example output Intelligently load project files (whole or sharded) based on workflow's input_file_patterns configuration Only execute if workflow.yaml contains input_file_patterns section Read input_file_patterns from loaded workflow.yaml For each pattern group (prd, architecture, epics, etc.), note the load_strategy if present For each pattern in input_file_patterns: Determine load_strategy from pattern config (defaults to FULL_LOAD if not specified) Load ALL files in sharded directory - used for PRD, Architecture, UX, brownfield docs Use glob pattern to find ALL .md files (e.g., "{output_folder}/*architecture*/*.md") Load EVERY matching file completely Concatenate content in logical order (index.md first if exists, then alphabetical) Store in variable: {pattern_name_content} Load specific shard using template variable - example: used for epics with {{epic_num}} Check for template variables in sharded_single pattern (e.g., {{epic_num}}) If variable undefined, ask user for value OR infer from context Resolve template to specific file path Load that specific file Store in variable: {pattern_name_content} Load index.md, analyze structure and description of each doc in the index, then intelligently load relevant docs DO NOT BE LAZY - use best judgment to load documents that might have relevant information, even if only a 5% chance Load index.md from sharded directory Parse table of contents, links, section headers Analyze workflow's purpose and objective Identify which linked/referenced documents are likely relevant If workflow is about authentication and index shows "Auth Overview", "Payment Setup", "Deployment" → Load auth docs, consider deployment docs, skip payment Load all identified relevant documents Store combined content in variable: {pattern_name_content} When in doubt, LOAD IT - context is valuable, being thorough is better than missing critical info Mark pattern as RESOLVED, skip to next pattern Attempt glob match on 'whole' pattern (e.g., "{output_folder}/*prd*.md") Load ALL matching files completely (no offset/limit) Store content in variable: {pattern_name_content} (e.g., {prd_content}) Mark pattern as RESOLVED, skip to next pattern Set {pattern_name_content} to empty string Note in session: "No {pattern_name} files found" (not an error, just unavailable, offer use change to provide) List all loaded content variables with file counts ✓ Loaded {prd_content} from 5 sharded files: prd/index.md, prd/requirements.md, ... ✓ Loaded {architecture_content} from 1 file: Architecture.md ✓ Loaded {epics_content} from selective load: epics/epic-3.md ○ No ux_design files found This gives workflow transparency into what context is available • This is the complete workflow execution engine • You MUST Follow instructions exactly as written • 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 • This workflow uses INTENT-DRIVEN PLANNING - adapt organically to product type and context • YOU ARE FACILITATING A CONVERSATION With a user to produce a final document step by step. The whole process is meant to be collaborative helping the user flesh out their ideas. Do not rush or optimize and skip any section.