Convert Legacy - v4 to v5 Conversion Instructions

The workflow execution engine is governed by: {project_root}/bmad/core/tasks/workflow.xml You MUST have already loaded and processed: {project_root}/bmad/bmb/workflows/convert-legacy/workflow.yaml

Ask user for the path to the v4 item to convert (agent, workflow, or module) Load the complete file/folder structure Detect item type based on structure and content patterns: - Agent: Contains agent or prompt XML tags, single file - Workflow: Contains workflow YAML or instruction patterns, usually folder - Module: Contains multiple agents/workflows in organized structure - Task: Contains task XML tags Confirm detected type or allow user to correct: “Detected as [type]. Is this correct? (y/n)”

Parse the v4 structure and extract key components:

For v4 Agents (YAML-based in markdown):

For v4 Templates (YAML-based document generators):

For v4 Tasks (Markdown with execution instructions):

For Modules:

Create a conversion map of what needs to be transformed Map v4 patterns to v5 equivalents:

Which module should this belong to? (eg. bmm, bmb, cis, bmm-legacy, or custom) If custom module: Enter custom module code (kebab-case): Determine installation path based on type and module IMPORTANT: All paths must use final BMAD installation locations, not src paths! Show user the target location: {project-root}/bmad/{{target_module}}/{{item_type}}/{{item_name}} Note: Files will be created in bmad/ but all internal paths will reference {project-root}/bmad/ locations Proceed with this location? (y/n)

Based on item type and complexity, choose approach:

If agent conversion: If simple agent (basic persona + commands): Use direct conversion to v5 agent YAML format Direct Agent Conversion If complex agent with embedded workflows: Plan to invoke create-agent workflow Workflow-Assisted Agent Creation

If template or task conversion to workflow: Analyze the v4 item to determine workflow type:

Based on analysis, this appears to be a {{detected_workflow_type}} workflow. Confirm or correct:

  1. Document workflow (generates documents with template)
  2. Action workflow (performs actions, no template)
  3. Interactive workflow (guided session)
  4. Meta-workflow (coordinates other workflows) Select 1-4:

If template conversion: Template-to-Workflow Conversion If task conversion: Task-to-Workflow Conversion

If full module conversion: Plan to invoke create-module workflow Module Creation

Transform v4 YAML agent to v5 YAML format:

  1. Convert agent metadata structure:

  2. Transform persona structure:

  3. Convert commands to menu:

  4. Add v5-specific sections (in YAML):

  5. Handle dependencies and paths:

Generate the converted v5 agent YAML file (.agent.yaml) Example path conversions:

Extract key information from v4 agent: - Name and purpose - Commands and functionality - Persona traits - Any special behaviors

<invoke-workflow> workflow: {project-root}/bmad/bmb/workflows/create-agent/workflow.yaml inputs: - agent_name: {{extracted_name}} - agent_purpose: {{extracted_purpose}} - commands: {{extracted_commands}} - persona: {{extracted_persona}} </invoke-workflow>

Continue to Validation

Convert v4 Template (YAML) to v5 Workflow:

  1. Extract template metadata:

  2. Convert template sections to instructions.md:

  3. Extract template structure to template.md:

  4. Handle v4 create-doc.md task integration:

<invoke-workflow> workflow: {project-root}/bmad/bmb/workflows/create-workflow/workflow.yaml inputs: - workflow_name: {{template_name}} - workflow_type: document - template_structure: {{extracted_template}} - instructions: {{converted_sections}} </invoke-workflow>

Continue to Validation

Analyze module structure and components Create module blueprint with all components

<invoke-workflow> workflow: {project-root}/bmad/bmb/workflows/create-module/workflow.yaml inputs: - module_name: {{module_name}} - components: {{component_list}} </invoke-workflow>

Continue to Validation

Convert v4 Task (Markdown) to v5 Workflow:

  1. Analyze task purpose and output:

  2. Extract task components:

  3. Based on confirmed workflow type: If Document workflow:

    If Action workflow:

  4. Handle special v4 patterns:

<invoke-workflow> workflow: {project-root}/bmad/bmb/workflows/create-workflow/workflow.yaml inputs: - workflow_name: {{task_name}} - workflow_type: {{confirmed_workflow_type}} - instructions: {{extracted_task_logic}} - template: {{generated_template_if_document}} </invoke-workflow>

Continue to Validation

Run validation checks on converted item:

For Agents:

For Workflows:

For Modules:

Show validation results to user Any issues to fix before finalizing? (y/n) If yes: Address specific issues Re-validate

Generate conversion report showing: - Original v4 location - New v5 location - Items converted - Any manual adjustments needed - Warnings or notes

Save report to: {output_folder}/conversion-report-{{date}}.md

Archive original v4 files? (y/n) If yes: Move v4 files to: {project-root}/archive/v4-legacy/{{date}}/

Show user the final converted items and their locations Provide any post-conversion instructions or recommendations

Would you like to convert another legacy item? (y/n) If yes: Start new conversion