Edit Workflow - Workflow Editor 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/edit-workflow/workflow.yaml Study the workflow creation guide thoroughly at: {workflow_creation_guide}

What is the path to the workflow you want to edit? (provide path to workflow.yaml or workflow folder)

Load the workflow.yaml file from the provided path Identify the workflow type (document, action, interactive, autonomous, meta) List all associated files (template.md, instructions.md, checklist.md, data files) Load any existing instructions.md and template.md files if present

Display a summary:

Load the complete workflow creation guide from: {workflow_creation_guide} Check the workflow against the guide’s best practices:

Analyze for:

Create a list of identified issues or improvement opportunities Prioritize issues by importance (critical, important, nice-to-have)

Present the editing menu to the user:

What aspect would you like to edit?

  1. Fix critical issues - Address missing headers, broken references
  2. Update workflow.yaml - Modify configuration, paths, metadata
  3. Refine instructions - Improve steps, add detail, fix flow
  4. Update template - Fix variables, improve structure (if applicable)
  5. Enhance validation - Make checklist more specific and measurable
  6. Add new features - Add steps, optional sections, or capabilities
  7. Configure web bundle - Add/update web bundle for deployment
  8. Optimize for clarity - Improve descriptions, add examples
  9. Full review and update - Comprehensive improvements across all files

Select an option (1-9) or describe a custom edit:

Based on the selected edit type, load appropriate reference materials:

If editing instructions or adding features: Review the “Writing Instructions” section of the creation guide Load example workflows from {project-root}/bmad/bmm/workflows/ for patterns

If editing templates: Review the “Templates and Variables” section of the creation guide Ensure variable naming conventions are followed

If editing validation: Review the “Validation” section and measurable criteria examples

If configuring web bundle: Review the “Web Bundles” section of the creation guide Scan all workflow files for referenced resources Create inventory of all files that must be included

If fixing critical issues: Load the workflow execution engine documentation Verify all required elements are present

Based on the selected focus area:

If configuring web bundle (option 7): Check if web_bundle section exists in workflow.yaml

If creating new web bundle:

  1. Extract workflow metadata (name, description, author)
  2. Convert all file paths to bmad/-relative format
  3. Remove any {config_source} references
  4. Scan instructions.md for all file references:
  5. Scan template.md for any includes
  6. Create complete web_bundle_files array
  7. Generate web_bundle section

If updating existing web bundle:

  1. Verify all paths are bmad/-relative
  2. Check for missing files in web_bundle_files
  3. Remove any config dependencies
  4. Update file list with newly referenced files

Show the current content that will be edited Explain the proposed changes and why they improve the workflow Generate the updated content following all conventions from the guide

Review the proposed changes. Options:

If user selects ‘a’: Apply the changes to the file Log the change for the summary

If user selects ‘e’: What modifications would you like to make? Regenerate with modifications

If user selects ’d': Proceed to validation

Run a comprehensive validation check:

Validation checks:

Web bundle validation (if applicable):

If any validation fails: Issues found. Would you like to fix them? (y/n) If yes: Return to editing

Create a summary of all changes made:

Workflow Edit Summary

Workflow: {{workflow_name}} Date: {{date}} Editor: {{user_name}}

Changes Made:

List each file that was modified with a brief description of changes

Improvements:

Summarize how the workflow is now better aligned with best practices

Files Modified:

List all modified files with their paths

Next Steps:

Suggest any additional improvements or testing that could be done

Would you like to:

If save summary: Write the summary to the change log file

If test workflow: <invoke-workflow>{{workflow_name}}</invoke-workflow>