installer updates, bmd module added and moved out of src, created a plan for module installation tool for custom modules, minor flow improvements

This commit is contained in:
Brian Madison
2025-10-19 11:59:27 -05:00
parent eb9a214115
commit 0a048f2ccc
69 changed files with 5244 additions and 617 deletions

View File

@@ -6,7 +6,7 @@ const chalk = require('chalk');
*
* @param {Object} options - Installation options
* @param {string} options.projectRoot - The root directory of the target project
* @param {Object} options.config - Module configuration from install-menu-config.yaml
* @param {Object} options.config - Module configuration from install-config.yaml
* @param {Array<string>} options.installedIDEs - Array of IDE codes that were installed
* @param {Object} options.logger - Logger instance for output
* @returns {Promise<boolean>} - Success status

View File

@@ -79,7 +79,7 @@ create-module/
**Module Configuration**
- Generates main config.yaml with module metadata
- Defines configuration questions in install-config.yaml (config.yaml generated during installation)
- Configures component counts and references
- Sets up output and data folder specifications
@@ -101,7 +101,7 @@ create-module/
**Installer Infrastructure**
- Creates install-module-config.yaml for deployment
- Creates install-config.yaml with configuration questions for deployment
- Sets up optional installer.js for complex installation logic
- Configures post-install messaging and instructions
@@ -125,7 +125,9 @@ create-module/
### Generated Files
- **Module Directory**: Complete module structure at `{project-root}/bmad/{module_code}/`
- **Configuration Files**: config.yaml, install-module-config.yaml
- **Configuration Files**:
- Source: install-config.yaml (configuration questions)
- Target: config.yaml (generated from user answers during installation)
- **Documentation**: README.md, TODO.md development roadmap
- **Component Placeholders**: Structured folders for agents, workflows, and tasks
@@ -184,7 +186,7 @@ The workflow creates a complete module ready for development:
**Issue**: Installation configuration invalid
- **Solution**: Review install-module-config.yaml syntax and paths
- **Solution**: Review install-config.yaml syntax and paths
- **Check**: Ensure all referenced paths use {project-root} variables correctly
## Customization

View File

@@ -26,16 +26,15 @@
- [ ] `/tasks` directory exists (if tasks planned)
- [ ] `/templates` directory exists (if templates used)
- [ ] `/data` directory exists (if data files needed)
- [ ] `config.yaml` present in module root
- [ ] `/_module-installer/install-config.yaml` present (defines configuration questions)
- [ ] `README.md` present with documentation
### Runtime Directories (bmad/{module-code}/)
### Installed Module Structure (generated in target after installation)
- [ ] `/_module-installer` directory created
- [ ] `/agents` directory for compiled agents
- [ ] `/workflows` directory for workflow instances
- [ ] `/data` directory for user data
- [ ] `/agents` directory for overrides
- [ ] `/workflows` directory for instances
- [ ] Runtime `config.yaml` present
- [ ] `config.yaml` generated from install-config.yaml during installation
## Component Planning
@@ -63,22 +62,22 @@
## Configuration Files
### Module config.yaml
### Installation Configuration (install-config.yaml)
- [ ] All required fields present (name, code, version, author)
- [ ] Component lists accurate (agents, workflows, tasks)
- [ ] Paths use proper variables ({project-root}, etc.)
- [ ] Output folders configured
- [ ] Custom settings documented
- [ ] `install-config.yaml` exists in `_module-installer`
- [ ] Module metadata present (code, name, version)
- [ ] Configuration questions defined for user input
- [ ] Default values provided for all questions
- [ ] Prompt text is clear and helpful
- [ ] Result templates use proper variable substitution
- [ ] Paths use proper variables ({project-root}, {value}, etc.)
### Install Configuration
### Generated Config (config.yaml in target)
- [ ] `install-module-config.yaml` exists in `_module-installer`
- [ ] Installation steps defined
- [ ] Directory creation steps present
- [ ] File copy operations specified
- [ ] Module registration included
- [ ] Post-install message defined
- [ ] Generated during installation from install-config.yaml
- [ ] Contains all user-provided configuration values
- [ ] Module metadata included
- [ ] No config.yaml should exist in source module
## Installation Infrastructure

View File

@@ -0,0 +1,92 @@
# {{MODULE_NAME}} Module Configuration
# This file defines installation questions and module configuration values
code: "{{MODULE_CODE}}"
name: "{{MODULE_NAME}}"
default_selected: "{{DEFAULT_SELECTED}}" # true if this should be selected by default
# Welcome message shown during installation
prompt:
- "{{WELCOME_MESSAGE_LINE_1}}"
- "{{WELCOME_MESSAGE_LINE_2}}"
# Core config values are automatically inherited:
## user_name
## communication_language
## document_output_language
## output_folder
# ============================================================================
# CONFIGURATION FIELDS
# ============================================================================
#
# Each field can be:
# 1. INTERACTIVE (has 'prompt' - asks user during installation)
# 2. STATIC (no 'prompt' - just uses 'result' value)
#
# Field structure:
# field_name:
# prompt: "Question to ask user" (optional - omit for static values)
# default: "default_value" (optional)
# result: "{value}" or "static-value"
# single-select: [...] (optional - for dropdown)
# multi-select: [...] (optional - for checkboxes)
#
# Special placeholders in result:
# {value} - replaced with user's answer
# {project-root} - replaced with project root path
# {directory_name} - replaced with project directory name
# {module_code} - replaced with this module's code
# ============================================================================
# EXAMPLE: Interactive text input
# example_project_name:
# prompt: "What is your project name?"
# default: "{directory_name}"
# result: "{value}"
# EXAMPLE: Interactive single-select dropdown
# example_skill_level:
# prompt: "What is your experience level?"
# default: "intermediate"
# result: "{value}"
# single-select:
# - value: "beginner"
# label: "Beginner - New to this domain"
# - value: "intermediate"
# label: "Intermediate - Familiar with basics"
# - value: "expert"
# label: "Expert - Deep knowledge"
# EXAMPLE: Interactive multi-select checkboxes
# example_features:
# prompt:
# - "Which features do you want to enable?"
# - "(Select all that apply)"
# result: "{value}"
# multi-select:
# - "Feature A"
# - "Feature B"
# - "Feature C"
# EXAMPLE: Interactive path input
# example_output_path:
# prompt: "Where should outputs be saved?"
# default: "output/{{MODULE_CODE}}"
# result: "{project-root}/{value}"
# EXAMPLE: Static value (no user prompt)
# example_static_setting:
# result: "hardcoded-value"
# EXAMPLE: Static path
# module_data_path:
# result: "{project-root}/bmad/{{MODULE_CODE}}/data"
# ============================================================================
# YOUR MODULE CONFIGURATION FIELDS
# ============================================================================
# Replace examples above with your module's actual configuration needs.
# Delete this comment block and the examples when implementing.
# ============================================================================
# TODO: INSERT {MODULE_CONFIG_FIELDS} HERE

View File

@@ -1,132 +0,0 @@
# {{MODULE_NAME}} Installation Configuration Template
# This file defines how the module gets installed into a BMAD system
module_name: "{{MODULE_NAME}}"
module_code: "{{MODULE_CODE}}"
author: "{{AUTHOR}}"
installation_date: "{{DATE}}"
bmad_version_required: "6.0.0"
# Module metadata
metadata:
description: "{{MODULE_DESCRIPTION}}"
category: "{{MODULE_CATEGORY}}"
tags: ["{{MODULE_TAGS}}"]
homepage: "{{MODULE_HOMEPAGE}}"
license: "{{MODULE_LICENSE}}"
# Pre-installation checks
pre_install_checks:
- name: "Check BMAD version"
type: "version_check"
minimum: "6.0.0"
- name: "Check dependencies"
type: "module_check"
required_modules: [] # List any required modules
- name: "Check disk space"
type: "disk_check"
required_mb: 50
# Installation steps
install_steps:
- name: "Create module directories"
action: "mkdir"
paths:
- "{project-root}/bmad/{{MODULE_CODE}}"
- "{project-root}/bmad/{{MODULE_CODE}}/data"
- "{project-root}/bmad/{{MODULE_CODE}}/agents"
- "{project-root}/bmad/{{MODULE_CODE}}/workflows"
- "{project-root}/bmad/{{MODULE_CODE}}/config"
- "{project-root}/bmad/{{MODULE_CODE}}/logs"
- name: "Copy module configuration"
action: "copy"
files:
- source: "config.yaml"
dest: "{project-root}/bmad/{{MODULE_CODE}}/config.yaml"
- name: "Copy default data files"
action: "copy"
optional: true
files:
- source: "data/*"
dest: "{project-root}/bmad/{{MODULE_CODE}}/data/"
- name: "Register module in manifest"
action: "register"
manifest_path: "{project-root}/bmad/_cfg/manifest.yaml"
entry:
module: "{{MODULE_CODE}}"
status: "active"
path: "{project-root}/bmad/{{MODULE_CODE}}"
- name: "Setup agent shortcuts"
action: "create_shortcuts"
agents: "{{AGENT_LIST}}"
- name: "Initialize module database"
action: "exec"
optional: true
script: "installer.js"
function: "initDatabase"
# External assets to install
external_assets:
- description: "Module documentation"
source: "assets/docs/*"
dest: "{project-root}/docs/{{MODULE_CODE}}/"
- description: "Example configurations"
source: "assets/examples/*"
dest: "{project-root}/examples/{{MODULE_CODE}}/"
optional: true
# Module configuration defaults
default_config:
output_folder: "{project-root}/output/{{MODULE_CODE}}"
data_folder: "{project-root}/bmad/{{MODULE_CODE}}/data"
log_level: "info"
auto_save: true
# {{CUSTOM_CONFIG}}
# Post-installation setup
post_install:
- name: "Run initial setup"
action: "workflow"
workflow: "{{MODULE_CODE}}-setup"
optional: true
- name: "Generate sample data"
action: "exec"
script: "installer.js"
function: "generateSamples"
optional: true
- name: "Verify installation"
action: "test"
test_command: "bmad test {{MODULE_CODE}}"
# Post-installation message
post_install_message: |
✅ {{MODULE_NAME}} has been installed successfully!
🚀 Quick Start:
1. Load the main agent: `agent {{PRIMARY_AGENT}}`
2. View available commands: `*help`
3. Run the main workflow: `workflow {{PRIMARY_WORKFLOW}}`
📚 Documentation: {project-root}/docs/{{MODULE_CODE}}/README.md
💡 Examples: {project-root}/examples/{{MODULE_CODE}}/
{{CUSTOM_MESSAGE}}
# Uninstall configuration
uninstall:
preserve_user_data: true
remove_paths:
- "{project-root}/bmad/{{MODULE_CODE}}"
- "{project-root}/docs/{{MODULE_CODE}}"
backup_before_remove: true
unregister_from_manifest: true

View File

@@ -178,7 +178,7 @@ async function initDatabase(/* config */) {
console.log(' Initializing database...');
// TODO: Add database initialization
// This function can be called from install-module-config.yaml
// This function can be called from install-config.yaml
console.log(' ✓ Database initialized');
}

View File

@@ -154,72 +154,68 @@
```
{{module_code}}/
├── agents/ # Agent definitions
├── workflows/ # Workflow folders
├── tasks/ # Task files (if any)
├── templates/ # Shared templates
├── data/ # Module data files
├── config.yaml # Module configuration
└── README.md # Module documentation
├── agents/ # Agent definitions
├── workflows/ # Workflow folders
├── tasks/ # Task files (if any)
├── templates/ # Shared templates
├── data/ # Module data files
├── _module-installer/ # Installation configuration
│ └── install-config.yaml # Configuration questions (config.yaml generated at install time)
└── README.md # Module documentation
```
<action>Create installer directory:</action>
**INSTALLED MODULE STRUCTURE** (generated in target project after installation):
```
{{module_code}}/
├── agents/ # Compiled agents
├── workflows/ # Workflow instances
├── config.yaml # Generated from install-config.yaml during installation
└── data/ # User data directory
```
**SOURCE MODULE** (\_module-installer is for installation only, not copied to target):
```
{{module_code}}/
├── _module-installer/
│ ├── install-module-config.yaml
│ ├── installer.js (optional)
│ └── assets/ # Files to copy during install
├── config.yaml # Runtime configuration
├── agents/ # Agent configs (optional)
├── workflows/ # Workflow instances
└── data/ # User data directory
│ ├── install-config.yaml # Configuration questions
│ ├── installer.js # Optional custom installation logic
│ └── assets/ # Files to copy during install
```
<template-output>directory_structure</template-output>
</step>
<step n="4" goal="Generate module configuration">
Create the main module config.yaml:
<step n="4" goal="Plan module configuration fields">
<action>Based on the module purpose and components, determine what configuration settings the module needs</action>
```yaml
# {{module_name}} Module Configuration
module_name: {{module_name}}
module_code: {{module_code}}
author: {{user_name}}
description: {{module_purpose}}
**Configuration Field Planning:**
# Module paths
module_root: "{project-root}/bmad/{{module_code}}"
installer_path: "{project-root}/bmad/{{module_code}}"
<ask>Does your module need any user-configurable settings during installation?</ask>
# Component counts
agents:
count: {{agent_count}}
list: {{agent_list}}
**Common configuration patterns:**
workflows:
count: {{workflow_count}}
list: {{workflow_list}}
- Output/data paths (where module saves files)
- Feature toggles (enable/disable functionality)
- Integration settings (API keys, external services)
- Behavior preferences (automation level, detail level)
- User skill level or experience settings
tasks:
count: {{task_count}}
list: {{task_list}}
<action>For each configuration field needed, determine:</action>
# Module-specific settings
{{custom_settings}}
1. Field name (snake_case)
2. Whether it's INTERACTIVE (asks user) or STATIC (hardcoded)
3. Prompt text (if interactive)
4. Default value
5. Type: text input, single-select, or multi-select
6. Result template (how the value gets stored)
# Output configuration
output_folder: "{project-root}/docs/{{module_code}}"
data_folder: "{{determined_module_path}}/data"
```
<action>Store planned configuration fields for installer generation in step 7</action>
<critical>Save location:</critical>
- Save to {{module_path}}/config.yaml
<template-output>module_config</template-output>
<template-output>module_config_fields</template-output>
</step>
<step n="5" goal="Create first agent" optional="true">
@@ -259,73 +255,120 @@ data_folder: "{{determined_module_path}}/data"
</step>
<step n="7" goal="Setup module installer">
<action>Load installer templates from: {installer_templates}</action>
<action>Load installer template from: {installer_templates}/install-config.yaml</action>
Create install-module-config.yaml:
<critical>IMPORTANT: Create install-config.yaml NOT install-config.yaml</critical>
<critical>This is the STANDARD format that BMAD installer uses</critical>
Create \_module-installer/install-config.yaml:
```yaml
# {{module_name}} Installation Configuration
module_name: { { module_name } }
module_code: { { module_code } }
installation_date: { { date } }
# {{module_name}} Module Configuration
# This file defines installation questions and module configuration values
# Installation steps
install_steps:
- name: 'Create directories'
action: 'mkdir'
paths:
- '{project-root}/bmad/{{module_code}}'
- '{project-root}/bmad/{{module_code}}/data'
- '{project-root}/bmad/{{module_code}}/agents'
code: {{module_code}}
name: "{{module_name}}"
default_selected: false # Set to true if this should be selected by default
- name: 'Copy configuration'
action: 'copy'
source: '{installer_path}/config.yaml'
dest: '{project-root}/bmad/{{module_code}}/config.yaml'
# Welcome message shown during installation
prompt:
- "Thank you for choosing {{module_name}}!"
- "{{brief_module_description}}"
- name: 'Register module'
action: 'register'
manifest: '{project-root}/bmad/_cfg/manifest.yaml'
# Core config values are automatically inherited:
## user_name
## communication_language
## document_output_language
## output_folder
# External assets (if any)
external_assets:
- description: '{{asset_description}}'
source: 'assets/{{filename}}'
dest: '{{destination_path}}'
# ============================================================================
# CONFIGURATION FIELDS (from step 4 planning)
# ============================================================================
# Each field can be:
# 1. INTERACTIVE (has 'prompt' - asks user during installation)
# 2. STATIC (no 'prompt' - just uses 'result' value)
# ============================================================================
# Post-install message
post_install_message: |
{{module_name}} has been installed successfully!
# EXAMPLE Interactive text input:
# output_path:
# prompt: "Where should {{module_code}} save outputs?"
# default: "output/{{module_code}}"
# result: "{project-root}/{value}"
To get started:
1. Load any {{module_code}} agent
2. Use *help to see available commands
3. Check README.md for full documentation
# EXAMPLE Interactive single-select:
# detail_level:
# prompt: "How detailed should outputs be?"
# default: "standard"
# result: "{value}"
# single-select:
# - value: "minimal"
# label: "Minimal - Brief summaries only"
# - value: "standard"
# label: "Standard - Balanced detail"
# - value: "detailed"
# label: "Detailed - Comprehensive information"
# EXAMPLE Static value:
# module_version:
# result: "1.0.0"
# EXAMPLE Static path:
# data_path:
# result: "{project-root}/bmad/{{module_code}}/data"
{{generated_config_fields_from_step_4}}
```
Create installer.js stub (optional):
<critical>Save location:</critical>
- Save to {{module_path}}/\_module-installer/install-config.yaml
<ask>Does your module need custom installation logic (database setup, API registration, etc.)?</ask>
<check>If yes, create installer.js:</check>
```javascript
// {{module_name}} Module Installer
// This is a placeholder for complex installation logic
// Custom installation logic
function installModule(config) {
console.log('Installing {{module_name}} module...');
/**
* Module installation hook
* Called after files are copied but before IDE configuration
*
* @param {Object} options - Installation options
* @param {string} options.projectRoot - Project root directory
* @param {Object} options.config - Module configuration from install-config.yaml
* @param {Array} options.installedIDEs - List of IDE codes being configured
* @param {Object} options.logger - Logger instance (log, warn, error methods)
* @returns {boolean} - true if successful, false to abort installation
*/
async function install(options) {
const { projectRoot, config, installedIDEs, logger } = options;
// TODO: Add any complex installation logic here
logger.log('Running {{module_name}} custom installer...');
// TODO: Add custom installation logic here
// Examples:
// - Database setup
// - API key configuration
// - External service registration
// - File system preparation
// - Create database tables
// - Download external assets
// - Configure API connections
// - Initialize data files
// - Set up webhooks or integrations
console.log('{{module_name}} module installed successfully!');
logger.log('{{module_name}} custom installation complete!');
return true;
}
module.exports = { installModule };
module.exports = { install };
```
<critical>Save location:</critical>
- Save to {{module_path}}/\_module-installer/installer.js
<check>If no:</check>
<action>Skip installer.js creation - the standard installer will handle everything</action>
<template-output>installer_config</template-output>
</step>

View File

@@ -9,25 +9,28 @@ A BMAD module is a self-contained package of agents, workflows, tasks, and resou
### Core Structure
```
project-root/
├── bmad/{module-code}/ # Source code
├── agents/ # Agent definitions
├── workflows/ # Workflow folders
├── tasks/ # Task files
├── templates/ # Shared templates
├── data/ # Static data
│ ├── config.yaml # Module config
── README.md # Documentation
└── bmad/{module-code}/ # Runtime instance
├── _module-installer/ # Installation files
│ ├── install-module-config.yaml
│ ├── installer.js # Optional
│ └── assets/ # Install assets
├── config.yaml # User config
├── agents/ # Agent overrides
├── workflows/ # Workflow instances
└── data/ # User data
# SOURCE MODULE (in BMAD-METHOD project)
src/modules/{module-code}/
├── agents/ # Agent definitions (.agent.yaml)
├── workflows/ # Workflow folders
├── tasks/ # Task files
├── templates/ # Shared templates
├── data/ # Static data
├── _module-installer/ # Installation configuration
── install-config.yaml # Installation questions & config
├── installer.js # Optional custom install logic
│ └── assets/ # Files to copy during install
└── README.md # Module documentation
# INSTALLED MODULE (in target project)
{project-root}/bmad/{module-code}/
├── agents/ # Compiled agent files (.md)
├── workflows/ # Workflow instances
├── tasks/ # Task files
├── templates/ # Templates
├── data/ # Module data
├── config.yaml # Generated from install-config.yaml
└── README.md # Module documentation
```
@@ -134,41 +137,93 @@ Tasks should be used for:
## Installation Infrastructure
### Required: install-module-config.yaml
### Required: \_module-installer/install-config.yaml
This file defines both installation questions AND static configuration values:
```yaml
module_name: 'Module Name'
module_code: 'module-code'
# Module metadata
code: module-code
name: 'Module Name'
default_selected: false
install_steps:
- name: 'Create directories'
action: 'mkdir'
paths: [...]
# Welcome message during installation
prompt:
- 'Welcome to Module Name!'
- 'Brief description here'
- name: 'Copy files'
action: 'copy'
mappings: [...]
# Core values automatically inherited from installer:
## user_name
## communication_language
## document_output_language
## output_folder
- name: 'Register module'
action: 'register'
# INTERACTIVE fields (ask user during install)
output_location:
prompt: 'Where should module outputs be saved?'
default: 'output/module-code'
result: '{project-root}/{value}'
feature_level:
prompt: 'Which feature set?'
default: 'standard'
result: '{value}'
single-select:
- value: 'basic'
label: 'Basic - Core features only'
- value: 'standard'
label: 'Standard - Recommended features'
- value: 'advanced'
label: 'Advanced - All features'
# STATIC fields (no prompt, just hardcoded values)
module_version:
result: '1.0.0'
data_path:
result: '{project-root}/bmad/module-code/data'
```
### Optional: installer.js
**Key Points:**
For complex installations requiring:
- File is named `install-config.yaml` (NOT install-config.yaml)
- Supports both interactive prompts and static values
- `result` field uses placeholders: `{value}`, `{project-root}`, `{directory_name}`
- Installer generates final `config.yaml` from this template
- Database setup
- API configuration
- System integration
- Permission management
### Optional: \_module-installer/installer.js
### Optional: External Assets
For complex installations requiring custom logic:
Files that get copied outside the module:
```javascript
/**
* @param {Object} options - Installation options
* @param {string} options.projectRoot - Target project directory
* @param {Object} options.config - Config from install-config.yaml
* @param {Array} options.installedIDEs - IDEs being configured
* @param {Object} options.logger - Logger (log, warn, error)
* @returns {boolean} - true if successful
*/
async function install(options) {
// Custom installation logic here
// - Database setup
// - API configuration
// - External downloads
// - Integration setup
- System configurations
- User templates
- Shared resources
return true;
}
module.exports = { install };
```
### Optional: \_module-installer/assets/
Files to copy during installation:
- External configurations
- Documentation
- Example files
- Integration scripts
## Module Lifecycle

View File

@@ -43,6 +43,12 @@ dev_story_location:
prompt: "Where should development stories be stored?"
default: "docs/stories"
result: "{project-root}/{value}"
# TEA Agent Configuration
tea_use_mcp_enhancements:
prompt: "Enable Playwright MCP capabilities (healing, exploratory, verification)?"
default: true
result: "{value}"
# kb_location:
# prompt: "Where should bmad knowledge base articles be stored?"
# default: "~/bmad/bmm/kb.md"

View File

@@ -9,7 +9,7 @@ const platformCodes = require(path.join(__dirname, '../../../../tools/cli/lib/pl
*
* @param {Object} options - Installation options
* @param {string} options.projectRoot - The root directory of the target project
* @param {Object} options.config - Module configuration from install-menu-config.yaml
* @param {Object} options.config - Module configuration from install-config.yaml
* @param {Array<string>} options.installedIDEs - Array of IDE codes that were installed
* @param {Object} options.logger - Logger instance for output
* @returns {Promise<boolean>} - Success status

View File

@@ -5,7 +5,7 @@ const chalk = require('chalk');
*
* @param {Object} options - Installation options
* @param {string} options.projectRoot - The root directory of the target project
* @param {Object} options.config - Module configuration from install-menu-config.yaml
* @param {Object} options.config - Module configuration from install-config.yaml
* @param {Object} options.logger - Logger instance for output
* @param {Object} options.platformInfo - Platform metadata from global config
* @returns {Promise<boolean>} - Success status

View File

@@ -5,7 +5,7 @@ const chalk = require('chalk');
*
* @param {Object} options - Installation options
* @param {string} options.projectRoot - The root directory of the target project
* @param {Object} options.config - Module configuration from install-menu-config.yaml
* @param {Object} options.config - Module configuration from install-config.yaml
* @param {Object} options.logger - Logger instance for output
* @returns {Promise<boolean>} - Success status
*/

View File

@@ -1,7 +0,0 @@
# Powered by BMAD™ Core
name: bmm
short-title: BMad Method Module
author: Brian (BMad) Madison
# TEA Agent Configuration
tea_use_mcp_enhancements: true # Enable Playwright MCP capabilities (healing, exploratory, verification)

View File

@@ -1,283 +0,0 @@
# Story Approved Workflow Instructions (DEV Agent)
<critical>The workflow execution engine is governed by: {project_root}/bmad/core/tasks/workflow.xml</critical>
<critical>You MUST have already loaded and processed: {installed_path}/workflow.yaml</critical>
<critical>Communicate all responses in {communication_language}</critical>
<workflow>
<critical>This workflow is run by DEV agent AFTER user confirms a story is approved (Definition of Done is complete)</critical>
<critical>NO SEARCHING - DEV agent reads status file IN PROGRESS section to know which story was being worked on</critical>
<critical>Workflow: Update story file status, move story IN PROGRESS → DONE, move TODO → IN PROGRESS, move BACKLOG → TODO</critical>
<step n="1" goal="Read status file and identify the IN PROGRESS story">
<action>Read {output_folder}/bmm-workflow-status.md</action>
<action>Navigate to "### Implementation Progress (Phase 4 Only)" section</action>
<action>Find "#### IN PROGRESS (Approved for Development)" section</action>
<action>Extract current story information:</action>
- current_story_id: The story ID (e.g., "1.1", "auth-feature-1", "login-fix")
- current_story_title: The story title
- current_story_file: The exact story file path
- current_story_points: Story points (if tracked)
<action>Read the TODO section to know what's next:</action>
- todo_story_id: Next story to move to IN PROGRESS (if exists)
- todo_story_title: Next story title
- todo_story_file: Next story file path
<action>Read the BACKLOG section to know what comes after:</action>
- next_backlog_story_id: Story to move to TODO (if exists)
- next_backlog_story_title
- next_backlog_story_file
<critical>DO NOT SEARCH for stories - the status file tells you exactly which story is in each state</critical>
</step>
<step n="2" goal="Update the current story file status to Done">
<action>Read the story file: {story_dir}/{current_story_file}</action>
<action>Find the "Status:" line (usually at the top)</action>
<action>Update story file:</action>
- Change: `Status: Ready` or `Status: In Review`
- To: `Status: Done`
<action>Add completion notes if Dev Agent Record section exists:</action>
Find "## Dev Agent Record" section and add:
```
### Completion Notes
**Completed:** {{date}}
**Definition of Done:** All acceptance criteria met, code reviewed, tests passing, deployed
```
<action>Save the story file</action>
</step>
<step n="3" goal="Move story IN PROGRESS → DONE, advance the queue">
<action>Open {output_folder}/bmm-workflow-status.md</action>
<action>Update "#### DONE (Completed Stories)" section:</action>
Add the completed story to the table:
| Story ID | File | Completed Date | Points |
| -------------------- | ---------------------- | -------------- | ------------------------ |
| {{current_story_id}} | {{current_story_file}} | {{date}} | {{current_story_points}} |
... (existing done stories)
**Total completed:** {{done_count + 1}} stories
**Total points completed:** {{done_points + current_story_points}} points
<action>Update "#### IN PROGRESS (Approved for Development)" section:</action>
<check if="todo_story exists">
Move the TODO story to IN PROGRESS:
#### IN PROGRESS (Approved for Development)
- **Story ID:** {{todo_story_id}}
- **Story Title:** {{todo_story_title}}
- **Story File:** `{{todo_story_file}}`
- **Story Status:** Ready (OR Draft if not yet reviewed)
- **Context File:** `{{context_file_path}}` (if exists, otherwise note "Context not yet generated")
- **Action:** DEV should run `dev-story` workflow to implement this story
</check>
<check if="todo_story does NOT exist">
Mark IN PROGRESS as empty:
#### IN PROGRESS (Approved for Development)
(No story currently in progress - all stories complete!)
</check>
<action>Update "#### TODO (Needs Drafting)" section:</action>
<check if="next_backlog_story exists">
Move the first BACKLOG story to TODO:
#### TODO (Needs Drafting)
- **Story ID:** {{next_backlog_story_id}}
- **Story Title:** {{next_backlog_story_title}}
- **Story File:** `{{next_backlog_story_file}}`
- **Status:** Not created OR Draft (needs review)
- **Action:** SM should run `create-story` workflow to draft this story
</check>
<check if="next_backlog_story does NOT exist">
Mark TODO as empty:
#### TODO (Needs Drafting)
(No more stories to draft - all stories are drafted or complete)
</check>
<action>Update "#### BACKLOG (Not Yet Drafted)" section:</action>
Remove the first story from the BACKLOG table (the one we just moved to TODO).
If BACKLOG had 1 story and is now empty:
| Epic | Story | ID | Title | File |
| ----------------------------- | ----- | --- | ----- | ---- |
| (empty - all stories drafted) | | | | |
**Total in backlog:** 0 stories
<action>Update story counts in "#### Epic/Story Summary" section:</action>
- Increment done_count by 1
- Increment done_points by {{current_story_points}}
- Decrement backlog_count by 1 (if story was moved from BACKLOG → TODO)
- Update epic breakdown:
- Increment epic_done_stories for the current story's epic
<check if="all stories complete">
<action>Check "4-Implementation" checkbox in "### Phase Completion Status"</action>
<action>Set progress_percentage = 100%</action>
</check>
</step>
<step n="4" goal="Update Decision Log, Progress, and Next Action">
<action>Add to "## Decision Log" section:</action>
```
- **{{date}}**: Story {{current_story_id}} ({{current_story_title}}) approved and marked done by DEV agent. Moved from IN PROGRESS → DONE. {{#if todo_story}}Story {{todo_story_id}} moved from TODO → IN PROGRESS.{{/if}} {{#if next_backlog_story}}Story {{next_backlog_story_id}} moved from BACKLOG → TODO.{{/if}}
```
<template-output file="{{status_file_path}}">current_step</template-output>
<action>Set to: "story-approved (Story {{current_story_id}})"</action>
<template-output file="{{status_file_path}}">current_workflow</template-output>
<action>Set to: "story-approved (Story {{current_story_id}}) - Complete"</action>
<template-output file="{{status_file_path}}">progress_percentage</template-output>
<action>Calculate per-story weight: remaining_40_percent / total_stories / 5</action>
<action>Increment by: {{per_story_weight}} \* 1 (story-approved weight is ~1% per story)</action>
<check if="all stories complete">
<action>Set progress_percentage = 100%</action>
</check>
<action>Update "### Next Action Required" section:</action>
<check if="todo_story exists">
```
**What to do next:** {{#if todo_story_status == 'Draft'}}Review drafted story {{todo_story_id}}, then mark it ready{{else}}Implement story {{todo_story_id}}{{/if}}
**Command to run:** {{#if todo_story_status == 'Draft'}}Load SM agent and run 'story-ready' workflow{{else}}Run 'dev-story' workflow to implement{{/if}}
**Agent to load:** {{#if todo_story_status == 'Draft'}}bmad/bmm/agents/sm.md{{else}}bmad/bmm/agents/dev.md{{/if}}
```
</check>
<check if="todo_story does NOT exist AND backlog not empty">
```
**What to do next:** Draft the next story ({{next_backlog_story_id}})
**Command to run:** Load SM agent and run 'create-story' workflow
**Agent to load:** bmad/bmm/agents/sm.md
```
</check>
<check if="all stories complete">
```
**What to do next:** All stories complete! Run retrospective workflow or close project.
**Command to run:** Load PM agent and run 'retrospective' workflow
**Agent to load:** bmad/bmm/agents/pm.md
```
</check>
<action>Save bmm-workflow-status.md</action>
</step>
<step n="5" goal="Confirm completion to user">
<action>Display summary</action>
**Story Approved and Marked Done, {user_name}!**
✅ Story file updated: `{{current_story_file}}` → Status: Done
✅ Status file updated: Story moved IN PROGRESS → DONE
{{#if todo_story}}✅ Next story moved: TODO → IN PROGRESS ({{todo_story_id}}: {{todo_story_title}}){{/if}}
{{#if next_backlog_story}}✅ Next story moved: BACKLOG → TODO ({{next_backlog_story_id}}: {{next_backlog_story_title}}){{/if}}
**Completed Story:**
- **ID:** {{current_story_id}}
- **Title:** {{current_story_title}}
- **File:** `{{current_story_file}}`
- **Points:** {{current_story_points}}
- **Completed:** {{date}}
**Progress Summary:**
- **Stories Completed:** {{done_count}} / {{total_stories}}
- **Points Completed:** {{done_points}} / {{total_points}}
- **Progress:** {{progress_percentage}}%
{{#if all_stories_complete}}
**🎉 ALL STORIES COMPLETE!**
Congratulations! You have completed all stories for this project.
**Next Steps:**
1. Run `retrospective` workflow with PM agent to review the project
2. Close out the project
3. Celebrate! 🎊
{{/if}}
{{#if todo_story}}
**Next Story (IN PROGRESS):**
- **ID:** {{todo_story_id}}
- **Title:** {{todo_story_title}}
- **File:** `{{todo_story_file}}`
- **Status:** {{todo_story_status}}
**Next Steps:**
{{#if todo_story_status == 'Draft'}}
1. Review the drafted story {{todo_story_file}}
2. Load SM agent and run `story-ready` workflow to approve it
3. Then return to DEV agent to implement
{{else}}
1. Stay with DEV agent and run `dev-story` workflow
2. Implement story {{todo_story_id}}
{{/if}}
{{/if}}
{{#if backlog_not_empty AND todo_empty}}
**Next Story (TODO):**
- **ID:** {{next_backlog_story_id}}
- **Title:** {{next_backlog_story_title}}
**Next Steps:**
1. Load SM agent
2. Run `create-story` workflow to draft story {{next_backlog_story_id}}
{{/if}}
</step>
</workflow>
```

View File

@@ -46,7 +46,18 @@ phases:
- phase: 3
name: "Solutioning"
skip: true
required: true
workflows:
- id: "solution-architecture"
required: true
agent: "architect"
command: "solution-architecture"
output: "System-wide architecture document"
- id: "assess-project-ready"
required: true
agent: "sm"
command: "assess-project-ready"
note: "Validate architecture before implementation"
- phase: 4
name: "Implementation"

View File

@@ -8,7 +8,7 @@ const chalk = require('chalk');
*
* @param {Object} options - Installation options
* @param {string} options.projectRoot - The root directory of the target project
* @param {Object} options.config - Module configuration from install-menu-config.yaml
* @param {Object} options.config - Module configuration from install-config.yaml
* @param {Array<string>} options.installedIDEs - Array of IDE codes that were installed
* @param {Object} options.logger - Logger instance for output
* @returns {Promise<boolean>} - Success status