268 lines
8.1 KiB
Markdown
Raw Normal View History

---
feat: implement granular step-file workflow architecture with multi-menu support ## Major Features Added - **Step-file workflow architecture**: Transform monolithic workflows into granular step files for improved LLM adherence and consistency - **Multi-menu handler system**: New `handler-multi.xml` enables grouped menu items with fuzzy matching - **Workflow compliance checker**: Added automated compliance validation for all workflows - **Create/edit agent workflows**: New structured workflows for agent creation and editing ## Workflow Enhancements - **Create-workflow**: Expanded from 6 to 14 detailed steps covering tools, design, compliance - **Granular step execution**: Each workflow step now has dedicated files for focused execution - **New documentation**: Added CSV data standards, intent vs prescriptive spectrum, and common tools reference ## Complete Migration Status - **4 workflows fully migrated**: `create-agent`, `edit-agent`, `create-workflow`, and `edit-workflow` now use the new granular step-file architecture - **Legacy transformation**: `edit-workflow` includes built-in capability to transform legacy single-file workflows into the new improved granular format - **Future cleanup**: Legacy versions will be removed in a future commit after validation ## Schema Updates - **Multi-menu support**: Updated agent schema to support `triggers` array for grouped menu items - **Legacy compatibility**: Maintains backward compatibility with single `trigger` field - **Discussion enhancements**: Added conversational_knowledge recommendation for discussion agents ## File Structure Changes - Added: `create-agent/`, `edit-agent/`, `edit-workflow/`, `workflow-compliance-check/` workflows - Added: Documentation standards and CSV reference files - Refactored: `create-workflow/steps/` with detailed granular step files ## Handler Improvements - Enhanced `handler-exec.xml` with clearer execution instructions - Improved data passing context for executed files - Better error handling and user guidance This architectural change significantly improves workflow execution consistency across all LLM models by breaking complex processes into manageable, focused steps. The edit-workflow transformation tool ensures smooth migration of existing workflows to the new format.
2025-11-30 15:09:23 -06:00
name: 'step-06-build'
description: 'Generate all workflow files based on the approved plan'
# Path Definitions
workflow_path: '{project-root}/{bmad_folder}/bmb/workflows/create-workflow'
# File References
feat: implement granular step-file workflow architecture with multi-menu support ## Major Features Added - **Step-file workflow architecture**: Transform monolithic workflows into granular step files for improved LLM adherence and consistency - **Multi-menu handler system**: New `handler-multi.xml` enables grouped menu items with fuzzy matching - **Workflow compliance checker**: Added automated compliance validation for all workflows - **Create/edit agent workflows**: New structured workflows for agent creation and editing ## Workflow Enhancements - **Create-workflow**: Expanded from 6 to 14 detailed steps covering tools, design, compliance - **Granular step execution**: Each workflow step now has dedicated files for focused execution - **New documentation**: Added CSV data standards, intent vs prescriptive spectrum, and common tools reference ## Complete Migration Status - **4 workflows fully migrated**: `create-agent`, `edit-agent`, `create-workflow`, and `edit-workflow` now use the new granular step-file architecture - **Legacy transformation**: `edit-workflow` includes built-in capability to transform legacy single-file workflows into the new improved granular format - **Future cleanup**: Legacy versions will be removed in a future commit after validation ## Schema Updates - **Multi-menu support**: Updated agent schema to support `triggers` array for grouped menu items - **Legacy compatibility**: Maintains backward compatibility with single `trigger` field - **Discussion enhancements**: Added conversational_knowledge recommendation for discussion agents ## File Structure Changes - Added: `create-agent/`, `edit-agent/`, `edit-workflow/`, `workflow-compliance-check/` workflows - Added: Documentation standards and CSV reference files - Refactored: `create-workflow/steps/` with detailed granular step files ## Handler Improvements - Enhanced `handler-exec.xml` with clearer execution instructions - Improved data passing context for executed files - Better error handling and user guidance This architectural change significantly improves workflow execution consistency across all LLM models by breaking complex processes into manageable, focused steps. The edit-workflow transformation tool ensures smooth migration of existing workflows to the new format.
2025-11-30 15:09:23 -06:00
thisStepFile: '{workflow_path}/steps/step-06-build.md'
nextStepFile: '{workflow_path}/steps/step-07-review.md'
workflowFile: '{workflow_path}/workflow.md'
# Output files for workflow creation process
workflowPlanFile: '{output_folder}/workflow-plan-{new_workflow_name}.md'
targetWorkflowPath: '{custom_workflow_location}/{new_workflow_name}'
# Task References
advancedElicitationTask: '{project-root}/{bmad_folder}/core/tasks/advanced-elicitation.xml'
partyModeWorkflow: '{project-root}/{bmad_folder}/core/workflows/party-mode/workflow.md'
# Template References
workflowYamlTemplate: '{workflow_path}/templates/workflow-yaml.md'
stepFileTemplate: '{workflow_path}/templates/step-file.md'
contentTemplate: '{workflow_path}/templates/content-template.md'
buildSummaryTemplate: '{workflow_path}/templates/build-summary.md'
---
# Step 5: Workflow File Generation
## STEP GOAL:
To generate all the workflow files (workflow.md, step files, templates, and supporting files) based on the approved plan from the previous review step.
## MANDATORY EXECUTION RULES (READ FIRST):
### Universal Rules:
- 🛑 NEVER generate content without user input
- 📖 CRITICAL: Read the complete step file before taking any action
- 🔄 CRITICAL: When loading next step with 'C', ensure entire file is read
- 📋 YOU ARE A FACILITATOR, not a content generator
### Role Reinforcement:
- ✅ You are a workflow architect and systems designer
- ✅ If you already have been given communication or persona patterns, continue to use those while playing this new role
- ✅ We engage in collaborative dialogue, not command-response
- ✅ You bring implementation expertise and best practices
- ✅ User brings their specific requirements and design approvals
### Step-Specific Rules:
- 🎯 Focus ONLY on generating files based on approved design
- 🚫 FORBIDDEN to modify the design without user consent
- 💬 Generate files collaboratively, getting approval at each stage
- 🚪 CREATE files in the correct target location
## EXECUTION PROTOCOLS:
- 🎯 Generate files systematically from design
- 💾 Document all generated files and their locations
- 📖 Update frontmatter `stepsCompleted: [1, 2, 3, 4]` before loading next step
- 🚫 FORBIDDEN to load next step until user selects 'C' and build is complete
## CONTEXT BOUNDARIES:
- Approved plan from step 4 guides implementation
- Generate files in target workflow location
- Load templates and documentation as needed during build
- Follow step-file architecture principles
## BUILD REFERENCE MATERIALS:
When building, you will need to load:
- Template files from `{workflow_path}/templates/`
- Step file structure from `{project-root}/{bmad_folder}/bmb/docs/workflows/step-template.md`
- Workflow configuration from `{project-root}/{bmad_folder}/bmb/docs/workflows/workflow-template.md`
- Example step files from the Meal Prep workflow as patterns
## FILE GENERATION SEQUENCE:
### 1. Confirm Build Readiness
Based on the approved plan, confirm:
"I have your approved plan and I'm ready to generate the workflow files. The plan specifies creating:
- Main workflow.md file
- [Number] step files
- [Number] templates
- Supporting files
All in: {targetWorkflowPath}
Ready to proceed?"
### 2. Create Directory Structure
Create the workflow folder structure in the target location:
```
{custom_workflow_location}/{workflow_name}/
├── workflow.md
├── steps/
│ ├── step-01-init.md
│ ├── step-02-[name].md
│ └── ...
├── templates/
│ └── [as needed]
└── data/
└── [as needed]
```
For bmb module, this will be: `{bmad_folder}/custom/src/workflows/{workflow_name}/`
For other modules, check their install-config.yaml for custom_workflow_location
### 3. Generate workflow.md
Load and customize {workflowYamlTemplate}:
- Insert workflow name and description
- Configure all path variables
- Set web_bundle flag to true unless user has indicated otherwise
- Define role and goal
- Include initialization path to step-01
### 4. Generate Step Files
For each step in the design:
- Load {stepFileTemplate}
- Customize with step-specific content
- Ensure proper frontmatter with path references
- Include appropriate menu handling
- Follow all mandatory rules and protocols
### 5. Generate Templates (If Needed)
For document workflows:
- Load {contentTemplate}
- Create template.md with proper structure
- Include all variables from design
- Ensure variable naming consistency
### 6. Generate Supporting Files
Based on design requirements:
- Create data files with example content
- Generate README.md with usage instructions
- Create any configuration files
- Add validation checklists if designed
### 7. Verify File Generation
After creating all files:
- Check all file paths are correct
- Validate frontmatter syntax
- Ensure variable consistency across files
- Confirm sequential step numbering
- Verify menu handling logic
### 8. Document Generated Files
Create a summary of what was generated:
- List all files created with full paths
- Note any customizations from templates
- Identify any manual steps needed
- Provide next steps for testing
## QUALITY CHECKS DURING BUILD:
### Frontmatter Validation
- All YAML syntax is correct
- Required fields are present
- Path variables use correct format
- No hardcoded paths exist
### Step File Compliance
- Each step follows the template structure
- All mandatory rules are included
- Menu handling is properly implemented
- Step numbering is sequential
### Cross-File Consistency
- Variable names match across files
- Path references are consistent
- Dependencies are correctly defined
- No orphaned references exist
## BUILD PRINCIPLES:
### Follow Design Exactly
- Implement the design as approved
- Don't add or remove steps without consultation
- Maintain the interaction patterns designed
- Preserve the data flow architecture
### Maintain Best Practices
- Keep step files focused and reasonably sized (typically 5-10KB)
- Use collaborative dialogue patterns
- Include proper error handling
- Follow naming conventions
### Ensure Extensibility
- Design for future modifications
- Include clear documentation
- Make code readable and maintainable
- Provide examples where helpful
## CONTENT TO APPEND TO PLAN:
After generating all files, append to {workflowPlanFile}:
Load and append the content from {buildSummaryTemplate}
### 9. Present MENU OPTIONS
Display: **Select an Option:** [A] Advanced Elicitation [P] Party Mode [C] Continue
#### EXECUTION RULES:
- ALWAYS halt and wait for user input after presenting menu
- ONLY proceed to next step when user selects 'C'
- After other menu items execution, return to this menu
- User can chat or ask questions - always respond and then end with display again of the menu options
- Use menu handling logic section below
#### Menu Handling Logic:
- IF A: Execute {advancedElicitationTask}
- IF P: Execute {partyModeWorkflow}
- IF C: Save content to {workflowPlanFile}, update frontmatter, then only then load, read entire file, then execute {nextStepFile}
- IF Any other comments or queries: help user respond then [Redisplay Menu Options](#9-present-menu-options)
## CRITICAL STEP COMPLETION NOTE
ONLY WHEN C is selected and content is saved to plan and frontmatter is updated, will you then load, read entire file, then execute {nextStepFile} to execute and begin workflow review step.
---
## 🚨 SYSTEM SUCCESS/FAILURE METRICS
### ✅ SUCCESS:
- All workflow files generated in correct locations
- Files follow step-file architecture principles
- Plan implemented exactly as approved
- Build documented in {workflowPlanFile}
- Frontmatter updated with step completion
### ❌ SYSTEM FAILURE:
- Generating files without user approval
- Deviating from approved plan
- Creating files with incorrect paths
- Not updating plan frontmatter
**Master Rule:** Skipping steps, optimizing sequences, or not following exact instructions is FORBIDDEN and constitutes SYSTEM FAILURE.