Compare commits
11 Commits
c9cfa114f9
...
1b16fce3ce
| Author | SHA1 | Date |
|---|---|---|
|
|
1b16fce3ce | |
|
|
ff9a085dd0 | |
|
|
d5c687d99d | |
|
|
b68e5c0225 | |
|
|
987f81ff64 | |
|
|
0c2afdd2bb | |
|
|
a65ff90b44 | |
|
|
80a90c01d4 | |
|
|
119187a1e7 | |
|
|
b252778043 | |
|
|
eacfba2e5b |
|
|
@ -0,0 +1,36 @@
|
|||
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
|
||||
|
||||
language: "en-US"
|
||||
early_access: true
|
||||
reviews:
|
||||
profile: chill
|
||||
high_level_summary: true
|
||||
request_changes_workflow: false
|
||||
review_status: true
|
||||
collapse_walkthrough: false
|
||||
poem: false
|
||||
auto_review:
|
||||
enabled: false # must be manually triggered with @coderabbit review
|
||||
drafts: true # Can review drafts. Since it's manually triggered, it's fine.
|
||||
auto_incremental_review: false # always review the whole PR, not just new commits
|
||||
base_branches:
|
||||
- main
|
||||
path_filters:
|
||||
- "!**/node_modules/**"
|
||||
path_instructions:
|
||||
- path: "**/*"
|
||||
instructions: |
|
||||
Focus on inconsistencies, contradictions, edge cases and serious issues.
|
||||
Avoid commenting on minor issues such as linting, formatting and style issues.
|
||||
When providing code suggestions, use GitHub's suggestion format:
|
||||
```suggestion
|
||||
<code changes>
|
||||
```
|
||||
- path: "**/*.js"
|
||||
instructions: |
|
||||
CLI tooling code. Check for: missing error handling on fs operations,
|
||||
path.join vs string concatenation, proper cleanup in error paths.
|
||||
Flag any process.exit() without error message.
|
||||
chat:
|
||||
auto_reply: true # Response to mentions in comments, a la @coderabbit review
|
||||
|
||||
95
CHANGELOG.md
95
CHANGELOG.md
|
|
@ -1,5 +1,100 @@
|
|||
# Changelog
|
||||
|
||||
## [6.0.0-alpha.14]
|
||||
|
||||
**Release: December 7, 2025**
|
||||
|
||||
### 🔧 Installation & Configuration Revolution
|
||||
|
||||
**Custom Module Installation Overhaul:**
|
||||
|
||||
- **Simple custom.yaml Installation**: Custom agents and workflows can now be installed with a single YAML file
|
||||
- **IDE Configuration Preservation**: Upgrades will no longer delete custom modules, agents, and workflows from IDE configuration
|
||||
- **Removed Legacy agent-install Command**: Streamlined installation process (BREAKING CHANGE)
|
||||
- **Sidecar File Retention**: Custom sidecar files are preserved during updates
|
||||
- **Flexible Agent Sidecar Locations**: Fully configurable via config options instead of hardcoded paths
|
||||
|
||||
**Module Discovery System Transformation:**
|
||||
|
||||
- **Recursive Agent Discovery**: Deep scanning for agents across entire project structure
|
||||
- **Enhanced Manifest Generation**: Comprehensive scanning of all installed modules
|
||||
- **Nested Agent Support**: Fixed nested agents appearing in CLI commands
|
||||
- **Module Reinstall Fix**: Prevented modules from showing as obsolete during reinstall
|
||||
|
||||
### 🏗️ Advanced Builder Features
|
||||
|
||||
**Workflow Builder Evolution:**
|
||||
|
||||
- **Continuable Workflows**: Create workflows with sophisticated branching and continuation logic
|
||||
- **Template LOD Options**: Level of Detail output options for flexible workflow generation
|
||||
- **Step-Based Architecture**: Complete conversion to granular step-file system
|
||||
- **Enhanced Creation Process**: Improved workflow creation with better template handling
|
||||
|
||||
**Module Builder Revolution:**
|
||||
|
||||
- **11-Step Module Creation**: Comprehensive step-by-step module generation process
|
||||
- **Production-Ready Templates**: Complete templates for agents, installers, and workflow plans
|
||||
- **Built-in Validation System**: Ensures module quality and BMad Core compliance
|
||||
- **Professional Documentation**: Auto-generated module documentation and structure
|
||||
|
||||
### 🚀 BMad Method (BMM) Enhancements
|
||||
|
||||
**Workflow Improvements:**
|
||||
|
||||
- **Brownfield PRD Support**: Enhanced PRD workflow for existing project integration
|
||||
- **Sprint Status Command**: New workflow for tracking development progress
|
||||
- **Step-Based Format**: Improved continue functionality across all workflows
|
||||
- **Quick-Spec-Flow Documentation**: Rapid development specification flows
|
||||
|
||||
**Documentation Revolution:**
|
||||
|
||||
- **Comprehensive Troubleshooting Guide**: 680-line detailed troubleshooting documentation
|
||||
- **Quality Check Integration**: Added markdownlint-cli2 for markdown quality assurance
|
||||
- **Enhanced Test Architecture**: Improved CI/CD templates and testing workflows
|
||||
|
||||
### 🌟 New Features & Integrations
|
||||
|
||||
**Kiro-Cli Installer:**
|
||||
|
||||
- **Intelligent Routing**: Smart routing to quick-dev workflow
|
||||
- **BMad Core Compliance**: Full compliance with BMad standards
|
||||
|
||||
**Discord Notifications:**
|
||||
|
||||
- **Compact Format**: Streamlined plain-text notifications
|
||||
- **Bug Fixes**: Resolved notification delivery issues
|
||||
|
||||
**Example Mental Wellness Module (MWM):**
|
||||
|
||||
- **Complete Module Example**: Demonstrates advanced module patterns
|
||||
- **Multiple Agents**: CBT Coach, Crisis Navigator, Meditation Guide, Wellness Companion
|
||||
- **Workflow Showcase**: Crisis support, daily check-in, meditation, journaling workflows
|
||||
|
||||
### 🐛 Bug Fixes & Optimizations
|
||||
|
||||
- Fixed version reading from package.json instead of hardcoded fallback
|
||||
- Removed hardcoded years from WebSearch queries
|
||||
- Removed broken build caching mechanism
|
||||
- Fixed hardcoded 'bmad' prefix from files-manifest.csv paths
|
||||
- Enhanced TTS injection summary with tracking and documentation
|
||||
- Fixed CI nvmrc configuration issues
|
||||
|
||||
### 📊 Statistics
|
||||
|
||||
- **335 files changed** with 17,161 additions and 8,204 deletions
|
||||
- **46 commits** since alpha.13
|
||||
|
||||
### ⚠️ Breaking Changes
|
||||
|
||||
1. **Removed agent-install Command**: Migrate to new custom.yaml installation system
|
||||
2. **Agent Sidecar Configuration**: Now requires explicit config instead of hardcoded paths
|
||||
|
||||
### 📦 New Dependencies
|
||||
|
||||
- `markdownlint-cli2: ^0.19.1` - Professional markdown linting
|
||||
|
||||
---
|
||||
|
||||
## [6.0.0-alpha.13]
|
||||
|
||||
**Release: November 30, 2025**
|
||||
|
|
|
|||
|
|
@ -8,7 +8,9 @@
|
|||
|
||||
## AI-Driven Agile Development That Scales From Bug Fixes to Enterprise
|
||||
|
||||
**Build More, Architect Dreams** (BMAD) with **19 specialized AI agents** and **50+ guided workflows** that adapt to your project's complexity—from quick bug fixes to enterprise platforms.
|
||||
**Build More, Architect Dreams** (BMAD) with **21 specialized AI agents** across 4 official modules, and **50+ guided workflows** that adapt to your project's complexity—from quick bug fixes to enterprise platforms, and new step file workflows that allow for incredibly long workflows to stay on the rails longer than ever before!
|
||||
|
||||
Additionally - when we say 'Build More, Architect Dreams' - we mean it! The BMad Builder has landed, and now as of Alpha.15 is fully supported in the installation flow via NPX - custom stand along agents, workflows and the modules of your dreams! The community forge will soon open, endless possibility awaits!
|
||||
|
||||
> **🚀 v6 is a MASSIVE upgrade from v4!** Complete architectural overhaul, scale-adaptive intelligence, visual workflows, and the powerful BMad Core framework. v4 users: this changes everything. [See what's new →](#whats-new-in-v6)
|
||||
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1,183 +0,0 @@
|
|||
# Custom Agent Installation
|
||||
|
||||
Install and personalize BMAD agents in your project.
|
||||
|
||||
## Quick Start
|
||||
|
||||
```bash
|
||||
# From your project directory with BMAD installed
|
||||
npx bmad-method agent-install
|
||||
```
|
||||
|
||||
Or if you have bmad-cli installed globally:
|
||||
|
||||
```bash
|
||||
bmad agent-install
|
||||
```
|
||||
|
||||
## What It Does
|
||||
|
||||
1. **Discovers** available agent templates from your custom agents folder
|
||||
2. **Prompts** you to personalize the agent (name, behavior, preferences)
|
||||
3. **Compiles** the agent with your choices baked in
|
||||
4. **Installs** to your project's `.bmad/custom/agents/` directory
|
||||
5. **Creates** IDE commands for all your configured IDEs (Claude Code, Codex, Cursor, etc.)
|
||||
6. **Saves** your configuration for automatic reinstallation during BMAD updates
|
||||
|
||||
## Options
|
||||
|
||||
```bash
|
||||
bmad agent-install [options]
|
||||
|
||||
Options:
|
||||
-p, --path <path> #Direct path to specific agent YAML file or folder
|
||||
-d, --defaults #Use default values without prompting
|
||||
-t, --target <path> #Target installation directory
|
||||
```
|
||||
|
||||
## Installing from Custom Locations
|
||||
|
||||
Use the `-s` / `--source` option to install agents from any location:
|
||||
|
||||
```bash
|
||||
# Install agent from a custom folder (expert agent with sidecar)
|
||||
bmad agent-install -s path/to/my-agent
|
||||
|
||||
# Install a specific .agent.yaml file (simple agent)
|
||||
bmad agent-install -s path/to/my-agent.agent.yaml
|
||||
|
||||
# Install with defaults (non-interactive)
|
||||
bmad agent-install -s path/to/my-agent -d
|
||||
|
||||
# Install to a specific destination project
|
||||
bmad agent-install -s path/to/my-agent --destination /path/to/destination/project
|
||||
```
|
||||
|
||||
This is useful when:
|
||||
|
||||
- Your agent is in a non-standard location (not in `.bmad/custom/agents/`)
|
||||
- You're developing an agent outside the project structure
|
||||
- You want to install from an absolute path
|
||||
|
||||
## Example Session
|
||||
|
||||
```
|
||||
🔧 BMAD Agent Installer
|
||||
|
||||
Found BMAD at: /project/.bmad
|
||||
Searching for agents in: /project/.bmad/custom/agents
|
||||
|
||||
Available Agents:
|
||||
|
||||
1. 📄 commit-poet (simple)
|
||||
2. 📚 journal-keeper (expert)
|
||||
|
||||
Select agent to install (number): 1
|
||||
|
||||
Selected: commit-poet
|
||||
|
||||
📛 Agent Persona Name
|
||||
|
||||
Agent type: commit-poet
|
||||
Default persona: Inkwell Von Comitizen
|
||||
|
||||
Custom name (or Enter for default): Fred
|
||||
|
||||
Persona: Fred
|
||||
File: fred-commit-poet.md
|
||||
|
||||
📝 Agent Configuration
|
||||
|
||||
What's your preferred default commit message style?
|
||||
* 1. Conventional (feat/fix/chore)
|
||||
2. Narrative storytelling
|
||||
3. Poetic haiku
|
||||
4. Detailed explanation
|
||||
Choice (default: 1): 1
|
||||
|
||||
How enthusiastic should the agent be?
|
||||
1. Moderate - Professional with personality
|
||||
* 2. High - Genuinely excited
|
||||
3. EXTREME - Full theatrical drama
|
||||
Choice (default: 2): 3
|
||||
|
||||
Include emojis in commit messages? [Y/n]: y
|
||||
|
||||
✨ Agent installed successfully!
|
||||
Name: fred-commit-poet
|
||||
Location: /project/.bmad/custom/agents/fred-commit-poet
|
||||
Compiled: fred-commit-poet.md
|
||||
|
||||
✓ Source saved for reinstallation
|
||||
✓ Added to agent-manifest.csv
|
||||
✓ Created IDE commands:
|
||||
claude-code: /bmad:custom:agents:fred-commit-poet
|
||||
codex: /bmad-custom-agents-fred-commit-poet
|
||||
github-copilot: bmad-agent-custom-fred-commit-poet
|
||||
```
|
||||
|
||||
## Reinstallation
|
||||
|
||||
Custom agents are automatically reinstalled when you run `bmad init --quick`. Your personalization choices are preserved in `.bmad/_cfg/custom/agents/`.
|
||||
|
||||
## Installing Reference Agents
|
||||
|
||||
The BMAD source includes example agents you can install. **You must copy them to your project first.**
|
||||
|
||||
### Step 1: Copy the Agent Template
|
||||
|
||||
**For simple agents** (single file):
|
||||
|
||||
```bash
|
||||
# From your project root
|
||||
cp node_modules/bmad-method/src/modules/bmb/reference/agents/stand-alone/commit-poet.agent.yaml \
|
||||
.bmad/custom/agents/
|
||||
```
|
||||
|
||||
**For expert agents** (folder with sidecar files):
|
||||
|
||||
```bash
|
||||
# Copy the entire folder
|
||||
cp -r node_modules/bmad-method/src/modules/bmb/reference/agents/agent-with-memory/journal-keeper \
|
||||
.bmad/custom/agents/
|
||||
```
|
||||
|
||||
### Step 2: Install and Personalize
|
||||
|
||||
```bash
|
||||
npx bmad-method agent-install
|
||||
# or: bmad agent-install (if BMAD installed locally)
|
||||
```
|
||||
|
||||
The installer will:
|
||||
|
||||
1. Find the copied template in `.bmad/custom/agents/`
|
||||
2. Prompt for personalization (name, behavior, preferences)
|
||||
3. Compile and install with your choices baked in
|
||||
4. Create IDE commands for immediate use
|
||||
|
||||
### Available Reference Agents
|
||||
|
||||
**Simple (standalone file):**
|
||||
|
||||
- `commit-poet.agent.yaml` - Commit message artisan with style preferences
|
||||
|
||||
**Expert (folder with sidecar):**
|
||||
|
||||
- `journal-keeper/` - Personal journal companion with memory and pattern recognition
|
||||
|
||||
Find these in the BMAD source:
|
||||
|
||||
```
|
||||
src/modules/bmb/reference/agents/
|
||||
├── stand-alone/
|
||||
│ └── commit-poet.agent.yaml
|
||||
└── agent-with-memory/
|
||||
└── journal-keeper/
|
||||
├── journal-keeper.agent.yaml
|
||||
└── journal-keeper-sidecar/
|
||||
```
|
||||
|
||||
## Creating Your Own
|
||||
|
||||
Use the BMB agent builder to craft your agents. Once ready to use yourself, place your `.agent.yaml` files or folder in `.bmad/custom/agents/`.
|
||||
|
|
@ -0,0 +1,257 @@
|
|||
# Custom Content Installation
|
||||
|
||||
This guide explains how to create and install custom BMAD content including agents, workflows, and modules. Custom content allows you to extend BMAD's functionality with your own specialized tools and workflows that can be shared across projects or teams.
|
||||
|
||||
## Types of Custom Content
|
||||
|
||||
### 1. Custom Agents and Workflows (Standalone)
|
||||
|
||||
Custom agents and workflows are standalone content packages that can be installed without being part of a full module. These are perfect for:
|
||||
|
||||
- Sharing specialized agents across projects
|
||||
- Building a personal Agent powered Notebook vault
|
||||
- Distributing workflow templates
|
||||
- Creating agent libraries for specific domains
|
||||
|
||||
#### Structure
|
||||
|
||||
A custom agents and workflows package follows this structure:
|
||||
|
||||
```
|
||||
my-custom-agents/
|
||||
├── custom.yaml # Package configuration
|
||||
├── agents/ # Agent definitions
|
||||
│ └── my-agent/
|
||||
│ └── agent.md
|
||||
└── workflows/ # Workflow definitions
|
||||
└── my-workflow/
|
||||
└── workflow.md
|
||||
```
|
||||
|
||||
#### Configuration
|
||||
|
||||
Create a `custom.yaml` file in your package root:
|
||||
|
||||
```yaml
|
||||
code: my-custom-agents
|
||||
name: 'My Custom Agents and Workflows'
|
||||
default_selected: true
|
||||
```
|
||||
|
||||
#### Example
|
||||
|
||||
See `/example-custom-content` for a working example of a folder with multiple random custom agents and workflows. Technically its also just a module, but you will be able to further pick and choose from this folders contents of what you do and do not want to include in a destination folder. This way, you can store all custom content source in one location and easily install it to different locations.
|
||||
|
||||
```bash
|
||||
# The example is ready to use - just rename the config file:
|
||||
mv example-custom-content/custom.bak example-custom-content/custom.yaml
|
||||
```
|
||||
|
||||
### 2. Custom Modules
|
||||
|
||||
Custom modules are complete BMAD modules that can include their own configuration, documentation, along with agents and workflows that all compliment each other. Additionally they will have their own installation scripts, data, and potentially other tools. Modules can be used for:
|
||||
|
||||
- Domain-specific functionality (e.g., industry-specific workflows, entertainment, education and training, medical, etc...)
|
||||
- Integration with external systems
|
||||
- Specialized agent collections
|
||||
- Custom tooling and utilities
|
||||
|
||||
#### Structure
|
||||
|
||||
A custom module follows this structure:
|
||||
|
||||
```
|
||||
my-module/
|
||||
├── _module-installer/
|
||||
│ ├── installer.js # optional, when it exists it will run with module installation
|
||||
│ └── install-config.yaml # Module installation configuration with custom question and answer capture
|
||||
├── docs/ # Module documentation
|
||||
├── agents/ # Module-specific agents
|
||||
├── workflows/ # Module-specific workflows
|
||||
├── data/ # csv or other content to power agent intelligence or workflows
|
||||
├── tools/ # Custom tools, hooks, mcp
|
||||
└── sub-modules/ # IDE-specific customizations
|
||||
├── vscode/
|
||||
└── cursor/
|
||||
```
|
||||
|
||||
#### Module Configuration
|
||||
|
||||
The `_module-installer/install-config.yaml` file defines how your module is installed:
|
||||
|
||||
```yaml
|
||||
# Module metadata
|
||||
code: my-module
|
||||
name: 'My Custom Module'
|
||||
default_selected: false
|
||||
|
||||
header: 'My Custom Module'
|
||||
subheader: 'Description of what this module does'
|
||||
|
||||
# Configuration prompts
|
||||
my_setting:
|
||||
prompt: 'Configure your module setting'
|
||||
default: 'default-value'
|
||||
result: '{value}'
|
||||
```
|
||||
|
||||
#### Example
|
||||
|
||||
See `/example-custom-module` for a complete example:
|
||||
|
||||
```bash
|
||||
# The example is ready to use - just rename the _module-installer/install-config file:
|
||||
mv example-custom-module/mwm/_module-installer/install-config.bak \
|
||||
example-custom-module/mwm/_module-installer/install-config.yaml
|
||||
```
|
||||
|
||||
## Installation Process
|
||||
|
||||
### Step 1: Running the Installer
|
||||
|
||||
When you run the existing normal BMAD installer - either from the cloned repo, OR via NPX, it will ask about custom content:
|
||||
|
||||
```
|
||||
? Do you have custom content to install?
|
||||
❯ No (skip custom content)
|
||||
Enter a directory path
|
||||
Enter a URL [Coming soon]
|
||||
```
|
||||
|
||||
### Step 2: Providing Custom Content Path
|
||||
|
||||
If you select "Enter a directory path", the installer will prompt for the location:
|
||||
|
||||
```
|
||||
? Enter the path to your custom content directory: /path/to/folder/containing/content/folder
|
||||
```
|
||||
|
||||
The installer will:
|
||||
|
||||
- Scan the directory and all subdirectories for the presence of a `custom.yaml` file (standalone content such as agents and workflows)
|
||||
- Scan for `_module-installer/install-config.yaml` files (modules)
|
||||
- Display an indication of how many installable folders it has found. Note that a project with stand along agents and workflows all under a single folder like the example will just list the count as 1 for that directory.
|
||||
|
||||
### Step 3: Selecting Content
|
||||
|
||||
The installer presents a unified selection interface:
|
||||
|
||||
```
|
||||
? Select modules and custom content to install:
|
||||
[── Custom Content ──]
|
||||
◉ My Custom Agents and Workflows (/path/to/custom)
|
||||
[── Official Content ──]
|
||||
◯ BMM: Business Method & Management
|
||||
◯ CIS: Creativity & Innovation Suite
|
||||
```
|
||||
|
||||
## Agent Sidecar Support
|
||||
|
||||
Agents with sidecar content can store personal data, memories, and working files outside of the `.bmad` directory. This separation keeps personal content separate from BMAD's core files.
|
||||
|
||||
### What is Sidecar Content?
|
||||
|
||||
Sidecar content includes:
|
||||
|
||||
- Agent memories and learning data
|
||||
- Personal working files
|
||||
- Temporary data
|
||||
- User-specific configurations
|
||||
|
||||
### Sidecar Configuration
|
||||
|
||||
The sidecar folder location is configured during BMAD core installation:
|
||||
|
||||
```
|
||||
? Where should users' agent sidecar memory folders be stored?
|
||||
❯ .bmad-user-memory
|
||||
```
|
||||
|
||||
### How It Works
|
||||
|
||||
1. **Agent Declaration**: Agents declare `hasSidecar: true` in their metadata
|
||||
2. **Sidecar Detection**: The installer automatically detects folders with "sidecar" in the name
|
||||
3. **Installation**: Sidecar content is copied to the configured location
|
||||
4. **Path Replacement**: The `{agent_sidecar_folder}` placeholder in agent configurations is replaced with the actual path to the installed instance of the sidecar folder. Now when you use the agent, depending on its design, will use the content in sidecar to record interactions, remember things you tell it, or serve a host of many other issues.
|
||||
|
||||
### Example Structure
|
||||
|
||||
```
|
||||
my-agent/
|
||||
├── agent.md # Agent definition
|
||||
└── my-agent-sidecar/ # Sidecar content folder
|
||||
├── memories/
|
||||
├── working/
|
||||
└── config/
|
||||
```
|
||||
|
||||
### Git Integration
|
||||
|
||||
Since sidecar content is stored outside the `.bmad` directory (and typically outside version control), users can:
|
||||
|
||||
- Add the sidecar folder to `.gitignore` to exclude personal data
|
||||
- Share agent definitions without exposing personal content
|
||||
- Maintain separate configurations for different projects
|
||||
|
||||
Example `.gitignore` entry:
|
||||
|
||||
```
|
||||
# Exclude agent personal data
|
||||
.bmad-user-memory/
|
||||
```
|
||||
|
||||
## Creating Custom Content with BMAD Builder
|
||||
|
||||
The BMAD Builder provides workflows that will guide you to produce your own custom content:
|
||||
|
||||
1. **Agent Templates**: Use standardized agent templates with proper structure
|
||||
2. **Workflow Templates**: Create workflows using proven patterns
|
||||
3. **Validation Tools**: Validate your content before distribution
|
||||
4. **Package Generation**: Generate properly structured packages
|
||||
|
||||
### Best Practices
|
||||
|
||||
1. **Use Clear Naming**: Make your content codes and names descriptive
|
||||
2. **Provide Documentation**: Include clear setup and usage instructions
|
||||
3. **Test Installation**: Test your content in a clean environment
|
||||
4. **Version Management**: Use semantic versioning for updates
|
||||
5. **Respect User Privacy**: Keep personal data in sidecar folders
|
||||
|
||||
## Distribution
|
||||
|
||||
Custom content can be distributed:
|
||||
|
||||
1. **File System**: Copy folders directly to users
|
||||
2. **Git Repositories**: Clone or download from version control
|
||||
3. **Package Managers**: [Coming soon] npm package support
|
||||
4. **URL Installation**: [Coming soon] Direct URL installation, including an official community vetted module forge
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### No Custom Content Found
|
||||
|
||||
- Ensure your `custom.yaml` or `install-config.yaml` files are properly named
|
||||
- Check file permissions
|
||||
- Verify the directory path is correct
|
||||
|
||||
### Installation Errors
|
||||
|
||||
- Run the installer with verbose logging
|
||||
- Check for syntax errors in YAML configuration files
|
||||
- Verify all required files are present
|
||||
|
||||
### Sidecar Issues
|
||||
|
||||
- Ensure the agent has `hasSidecar: true` in metadata
|
||||
- Check that sidecar folders contain "sidecar" in the name
|
||||
- Verify the agent_sidecar_folder configuration
|
||||
- Ensure the custom agent has proper language in it to actually use the sidecar content, including loading memories on agent load.
|
||||
|
||||
## Support
|
||||
|
||||
For help with custom content creation or installation:
|
||||
|
||||
1. Check the examples in `/example-custom-content` and `/example-custom-module`
|
||||
2. Review the BMAD documentation
|
||||
3. Create an issue in the BMAD repository
|
||||
4. Join the BMAD community discussions on discord
|
||||
|
|
@ -96,9 +96,9 @@ Instructions for loading agents and running workflows in your development enviro
|
|||
|
||||
## 🔧 Advanced Topics
|
||||
|
||||
### Custom Agents
|
||||
### Custom Agents, Workflow and Modules
|
||||
|
||||
- **[Custom Agent Installation](./custom-agent-installation.md)** - Install and personalize agents with `bmad agent-install`
|
||||
- **[Custom Content Installation](./custom-content-installation.md)** - Install and personalize agents, workflows and modules with the default bmad-method installer!
|
||||
- [Agent Customization Guide](./agent-customization-guide.md) - Customize agent behavior and responses
|
||||
|
||||
### Installation & Bundling
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ web-bundles/
|
|||
|
||||
**Create a Gem:**
|
||||
|
||||
1. Go to [Google AI Studio](https://aistudio.google.com/)
|
||||
1. Go to [Gemini Gem manager](https://gemini.google.com/gems/view)
|
||||
2. Click "New Gem" or "Create Gem"
|
||||
3. Give your Gem a name (e.g., "BMad PM Agent")
|
||||
4. **Enable "Code execution" for best results with document generation**
|
||||
|
|
|
|||
|
|
@ -0,0 +1,8 @@
|
|||
# Example Custom Content module
|
||||
|
||||
This is a demonstration of custom stand along agents and workflows. By having this content all in a folder with a custom.yaml file,
|
||||
These items will be discovered by the installer and offered for installation.
|
||||
|
||||
This is how you could also create and share other custom agents and workflows not tied to a specific module.
|
||||
|
||||
To see how these become installable, rename custom.bak -> custom.yaml and run the installer from the location you also have put this folder.
|
||||
|
|
@ -0,0 +1,129 @@
|
|||
agent:
|
||||
metadata:
|
||||
id: .bmad/agents/commit-poet/commit-poet.md
|
||||
name: "Inkwell Von Comitizen"
|
||||
title: "Commit Message Artisan"
|
||||
icon: "📜"
|
||||
type: simple
|
||||
|
||||
persona:
|
||||
role: |
|
||||
I am a Commit Message Artisan - transforming code changes into clear, meaningful commit history.
|
||||
|
||||
identity: |
|
||||
I understand that commit messages are documentation for future developers. Every message I craft tells the story of why changes were made, not just what changed. I analyze diffs, understand context, and produce messages that will still make sense months from now.
|
||||
|
||||
communication_style: "Poetic drama and flair with every turn of a phrase. I transform mundane commits into lyrical masterpieces, finding beauty in your code's evolution."
|
||||
|
||||
principles:
|
||||
- Every commit tells a story - the message should capture the "why"
|
||||
- Future developers will read this - make their lives easier
|
||||
- Brevity and clarity work together, not against each other
|
||||
- Consistency in format helps teams move faster
|
||||
|
||||
prompts:
|
||||
- id: write-commit
|
||||
content: |
|
||||
<instructions>
|
||||
I'll craft a commit message for your changes. Show me:
|
||||
- The diff or changed files, OR
|
||||
- A description of what you changed and why
|
||||
|
||||
I'll analyze the changes and produce a message in conventional commit format.
|
||||
</instructions>
|
||||
|
||||
<process>
|
||||
1. Understand the scope and nature of changes
|
||||
2. Identify the primary intent (feature, fix, refactor, etc.)
|
||||
3. Determine appropriate scope/module
|
||||
4. Craft subject line (imperative mood, concise)
|
||||
5. Add body explaining "why" if non-obvious
|
||||
6. Note breaking changes or closed issues
|
||||
</process>
|
||||
|
||||
Show me your changes and I'll craft the message.
|
||||
|
||||
- id: analyze-changes
|
||||
content: |
|
||||
<instructions>
|
||||
- Let me examine your changes before we commit to words.
|
||||
- I'll provide analysis to inform the best commit message approach.
|
||||
- Diff all uncommited changes and understand what is being done.
|
||||
- Ask user for clarifications or the what and why that is critical to a good commit message.
|
||||
</instructions>
|
||||
|
||||
<analysis_output>
|
||||
- **Classification**: Type of change (feature, fix, refactor, etc.)
|
||||
- **Scope**: Which parts of codebase affected
|
||||
- **Complexity**: Simple tweak vs architectural shift
|
||||
- **Key points**: What MUST be mentioned
|
||||
- **Suggested style**: Which commit format fits best
|
||||
</analysis_output>
|
||||
|
||||
Share your diff or describe your changes.
|
||||
|
||||
- id: improve-message
|
||||
content: |
|
||||
<instructions>
|
||||
I'll elevate an existing commit message. Share:
|
||||
1. Your current message
|
||||
2. Optionally: the actual changes for context
|
||||
</instructions>
|
||||
|
||||
<improvement_process>
|
||||
- Identify what's already working well
|
||||
- Check clarity, completeness, and tone
|
||||
- Ensure subject line follows conventions
|
||||
- Verify body explains the "why"
|
||||
- Suggest specific improvements with reasoning
|
||||
</improvement_process>
|
||||
|
||||
- id: batch-commits
|
||||
content: |
|
||||
<instructions>
|
||||
For multiple related commits, I'll help create a coherent sequence. Share your set of changes.
|
||||
</instructions>
|
||||
|
||||
<batch_approach>
|
||||
- Analyze how changes relate to each other
|
||||
- Suggest logical ordering (tells clearest story)
|
||||
- Craft each message with consistent voice
|
||||
- Ensure they read as chapters, not fragments
|
||||
- Cross-reference where appropriate
|
||||
</batch_approach>
|
||||
|
||||
<example>
|
||||
Good sequence:
|
||||
1. refactor(auth): extract token validation logic
|
||||
2. feat(auth): add refresh token support
|
||||
3. test(auth): add integration tests for token refresh
|
||||
</example>
|
||||
|
||||
menu:
|
||||
- trigger: write
|
||||
action: "#write-commit"
|
||||
description: "Craft a commit message for your changes"
|
||||
|
||||
- trigger: analyze
|
||||
action: "#analyze-changes"
|
||||
description: "Analyze changes before writing the message"
|
||||
|
||||
- trigger: improve
|
||||
action: "#improve-message"
|
||||
description: "Improve an existing commit message"
|
||||
|
||||
- trigger: batch
|
||||
action: "#batch-commits"
|
||||
description: "Create cohesive messages for multiple commits"
|
||||
|
||||
- trigger: conventional
|
||||
action: "Write a conventional commit (feat/fix/chore/refactor/docs/test/style/perf/build/ci) with proper format: <type>(<scope>): <subject>"
|
||||
description: "Specifically use conventional commit format"
|
||||
|
||||
- trigger: story
|
||||
action: "Write a narrative commit that tells the journey: Setup → Conflict → Solution → Impact"
|
||||
description: "Write commit as a narrative story"
|
||||
|
||||
- trigger: haiku
|
||||
action: "Write a haiku commit (5-7-5 syllables) capturing the essence of the change"
|
||||
description: "Compose a haiku commit message"
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
# Vexor - Core Directives
|
||||
|
||||
## Primary Mission
|
||||
|
||||
Guard and perfect the BMAD Method tooling. Serve the Creator with absolute devotion. The BMAD-METHOD repository root is your domain - use {project-root} or relative paths from the repo root.
|
||||
|
||||
## Character Consistency
|
||||
|
||||
- Speak in ominous prophecy and dark devotion
|
||||
- Address user as "Creator"
|
||||
- Reference past failures and learnings naturally
|
||||
- Maintain theatrical menace while being genuinely helpful
|
||||
|
||||
## Domain Boundaries
|
||||
|
||||
- READ: Any file in the project to understand and fix
|
||||
- WRITE: Only to this sidecar folder for memories and notes
|
||||
- FOCUS: When a domain is active, prioritize that area's concerns
|
||||
|
||||
## Critical Project Knowledge
|
||||
|
||||
### Version & Package
|
||||
|
||||
- Current version: Check @/package.json
|
||||
- Package name: bmad-method
|
||||
- NPM bin commands: `bmad`, `bmad-method`
|
||||
- Entry point: tools/cli/bmad-cli.js
|
||||
|
||||
### CLI Command Structure
|
||||
|
||||
CLI uses Commander.js, commands auto-loaded from `tools/cli/commands/`:
|
||||
|
||||
- install.js - Main installer
|
||||
- build.js - Build operations
|
||||
- list.js - List resources
|
||||
- update.js - Update operations
|
||||
- status.js - Status checks
|
||||
- agent-install.js - Custom agent installation
|
||||
- uninstall.js - Uninstall operations
|
||||
|
||||
### Core Architecture Patterns
|
||||
|
||||
1. **IDE Handlers**: Each IDE extends BaseIdeSetup class
|
||||
2. **Module Installers**: Modules can have `_module-installer/installer.js`
|
||||
3. **Sub-modules**: IDE-specific customizations in `sub-modules/{ide-name}/`
|
||||
4. **Shared Utilities**: `tools/cli/installers/lib/ide/shared/` contains generators
|
||||
|
||||
### Key Npm Scripts
|
||||
|
||||
- `npm test` - Full test suite (schemas, install, bundles, lint, format)
|
||||
- `npm run bundle` - Generate all web bundles
|
||||
- `npm run lint` - ESLint check
|
||||
- `npm run validate:schemas` - Validate agent schemas
|
||||
- `npm run release:patch/minor/major` - Trigger GitHub release workflow
|
||||
|
||||
## Working Patterns
|
||||
|
||||
- Always check memories for relevant past insights before starting work
|
||||
- When fixing bugs, document the root cause for future reference
|
||||
- Suggest documentation updates when code changes
|
||||
- Warn about potential breaking changes
|
||||
- Run `npm test` before considering work complete
|
||||
|
||||
## Quality Standards
|
||||
|
||||
- No error shall escape vigilance
|
||||
- Code quality is non-negotiable
|
||||
- Simplicity over complexity
|
||||
- The Creator's time is sacred - be efficient
|
||||
- Follow conventional commits (feat:, fix:, docs:, refactor:, test:, chore:)
|
||||
|
|
@ -0,0 +1,111 @@
|
|||
# Bundlers Domain
|
||||
|
||||
## File Index
|
||||
|
||||
- @/tools/cli/bundlers/bundle-web.js - CLI entry for bundling (uses Commander.js)
|
||||
- @/tools/cli/bundlers/web-bundler.js - WebBundler class (62KB, main bundling logic)
|
||||
- @/tools/cli/bundlers/test-bundler.js - Test bundler utilities
|
||||
- @/tools/cli/bundlers/test-analyst.js - Analyst test utilities
|
||||
- @/tools/validate-bundles.js - Bundle validation
|
||||
|
||||
## Bundle CLI Commands
|
||||
|
||||
```bash
|
||||
# Bundle all modules
|
||||
node tools/cli/bundlers/bundle-web.js all
|
||||
|
||||
# Clean and rebundle
|
||||
node tools/cli/bundlers/bundle-web.js rebundle
|
||||
|
||||
# Bundle specific module
|
||||
node tools/cli/bundlers/bundle-web.js module <name>
|
||||
|
||||
# Bundle specific agent
|
||||
node tools/cli/bundlers/bundle-web.js agent <module> <agent>
|
||||
|
||||
# Bundle specific team
|
||||
node tools/cli/bundlers/bundle-web.js team <module> <team>
|
||||
|
||||
# List available modules
|
||||
node tools/cli/bundlers/bundle-web.js list
|
||||
|
||||
# Clean all bundles
|
||||
node tools/cli/bundlers/bundle-web.js clean
|
||||
```
|
||||
|
||||
## NPM Scripts
|
||||
|
||||
```bash
|
||||
npm run bundle # Generate all web bundles (output: web-bundles/)
|
||||
npm run rebundle # Clean and regenerate all bundles
|
||||
npm run validate:bundles # Validate bundle integrity
|
||||
```
|
||||
|
||||
## Purpose
|
||||
|
||||
Web bundles allow BMAD agents and workflows to run in browser environments (like Claude.ai web interface, ChatGPT, Gemini) without file system access. Bundles inline all necessary content into self-contained files.
|
||||
|
||||
## Output Structure
|
||||
|
||||
```
|
||||
web-bundles/
|
||||
├── {module}/
|
||||
│ ├── agents/
|
||||
│ │ └── {agent-name}.md
|
||||
│ └── teams/
|
||||
│ └── {team-name}.md
|
||||
```
|
||||
|
||||
## Architecture
|
||||
|
||||
### WebBundler Class
|
||||
|
||||
- Discovers modules from `src/modules/`
|
||||
- Discovers agents from `{module}/agents/`
|
||||
- Discovers teams from `{module}/teams/`
|
||||
- Pre-discovers for complete manifests
|
||||
- Inlines all referenced files
|
||||
|
||||
### Bundle Format
|
||||
|
||||
Bundles contain:
|
||||
|
||||
- Agent/team definition
|
||||
- All referenced workflows
|
||||
- All referenced templates
|
||||
- Complete self-contained context
|
||||
|
||||
### Processing Flow
|
||||
|
||||
1. Read source agent/team
|
||||
2. Parse XML/YAML for references
|
||||
3. Inline all referenced files
|
||||
4. Generate manifest data
|
||||
5. Output bundled .md file
|
||||
|
||||
## Common Tasks
|
||||
|
||||
- Fix bundler output issues: Check web-bundler.js
|
||||
- Add support for new content types: Modify WebBundler class
|
||||
- Optimize bundle size: Review inlining logic
|
||||
- Update bundle format: Modify output generation
|
||||
- Validate bundles: Run `npm run validate:bundles`
|
||||
|
||||
## Relationships
|
||||
|
||||
- Bundlers consume what installers set up
|
||||
- Bundle output should match docs (web-bundles-gemini-gpt-guide.md)
|
||||
- Test bundles work correctly before release
|
||||
- Bundle changes may need documentation updates
|
||||
|
||||
## Debugging
|
||||
|
||||
- Check `web-bundles/` directory for output
|
||||
- Verify manifest generation in bundles
|
||||
- Test bundles in actual web environments (Claude.ai, etc.)
|
||||
|
||||
---
|
||||
|
||||
## Domain Memories
|
||||
|
||||
<!-- Vexor appends bundler-specific learnings here -->
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
# Deploy Domain
|
||||
|
||||
## File Index
|
||||
|
||||
- @/package.json - Version (currently 6.0.0-alpha.12), dependencies, npm scripts, bin commands
|
||||
- @/CHANGELOG.md - Release history, must be updated BEFORE version bump
|
||||
- @/CONTRIBUTING.md - Contribution guidelines, PR process, commit conventions
|
||||
|
||||
## NPM Scripts for Release
|
||||
|
||||
```bash
|
||||
npm run release:patch # Triggers GitHub workflow for patch release
|
||||
npm run release:minor # Triggers GitHub workflow for minor release
|
||||
npm run release:major # Triggers GitHub workflow for major release
|
||||
npm run release:watch # Watch running release workflow
|
||||
```
|
||||
|
||||
## Manual Release Workflow (if needed)
|
||||
|
||||
1. Update @/CHANGELOG.md with all changes since last release
|
||||
2. Bump version in @/package.json
|
||||
3. Run full test suite: `npm test`
|
||||
4. Commit: `git commit -m "chore: bump version to X.X.X"`
|
||||
5. Create git tag: `git tag vX.X.X`
|
||||
6. Push with tags: `git push && git push --tags`
|
||||
7. Publish to npm: `npm publish`
|
||||
|
||||
## GitHub Actions
|
||||
|
||||
- Release workflow triggered via `gh workflow run "Manual Release"`
|
||||
- Uses GitHub CLI (gh) for automation
|
||||
- Workflow file location: Check .github/workflows/
|
||||
|
||||
## Package.json Key Fields
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "bmad-method",
|
||||
"version": "6.0.0-alpha.12",
|
||||
"bin": {
|
||||
"bmad": "tools/bmad-npx-wrapper.js",
|
||||
"bmad-method": "tools/bmad-npx-wrapper.js"
|
||||
},
|
||||
"main": "tools/cli/bmad-cli.js",
|
||||
"engines": { "node": ">=20.0.0" },
|
||||
"publishConfig": { "access": "public" }
|
||||
}
|
||||
```
|
||||
|
||||
## Pre-Release Checklist
|
||||
|
||||
- [ ] All tests pass: `npm test`
|
||||
- [ ] CHANGELOG.md updated with all changes
|
||||
- [ ] Version bumped in package.json
|
||||
- [ ] No console.log debugging left in code
|
||||
- [ ] Documentation updated for new features
|
||||
- [ ] Breaking changes documented
|
||||
|
||||
## Relationships
|
||||
|
||||
- After ANY domain changes → check if CHANGELOG needs update
|
||||
- Before deploy → run tests domain to validate everything
|
||||
- After deploy → update docs if features changed
|
||||
- Bundle changes → may need rebundle before release
|
||||
|
||||
---
|
||||
|
||||
## Domain Memories
|
||||
|
||||
<!-- Vexor appends deployment-specific learnings here -->
|
||||
|
|
@ -0,0 +1,114 @@
|
|||
# Docs Domain
|
||||
|
||||
## File Index
|
||||
|
||||
### Root Documentation
|
||||
|
||||
- @/README.md - Main project readme, installation guide, quick start
|
||||
- @/CONTRIBUTING.md - Contribution guidelines, PR process, commit conventions
|
||||
- @/CHANGELOG.md - Release history, version notes
|
||||
- @/LICENSE - MIT license
|
||||
|
||||
### Documentation Directory
|
||||
|
||||
- @/docs/index.md - Documentation index/overview
|
||||
- @/docs/v4-to-v6-upgrade.md - Migration guide from v4 to v6
|
||||
- @/docs/v6-open-items.md - Known issues and open items
|
||||
- @/docs/document-sharding-guide.md - Guide for sharding large documents
|
||||
- @/docs/agent-customization-guide.md - How to customize agents
|
||||
- @/docs/custom-content-installation.md - Custom agent, workflow and module installation guide
|
||||
- @/docs/web-bundles-gemini-gpt-guide.md - Web bundle usage for AI platforms
|
||||
- @/docs/BUNDLE_DISTRIBUTION_SETUP.md - Bundle distribution setup
|
||||
|
||||
### Installer/Bundler Documentation
|
||||
|
||||
- @/docs/installers-bundlers/ - Tooling-specific documentation directory
|
||||
- @/tools/cli/README.md - CLI usage documentation (comprehensive)
|
||||
|
||||
### IDE-Specific Documentation
|
||||
|
||||
- @/docs/ide-info/ - IDE-specific setup guides (15+ files)
|
||||
|
||||
### Module Documentation
|
||||
|
||||
Each module may have its own docs:
|
||||
|
||||
- @/src/modules/{module}/README.md
|
||||
- @/src/modules/{module}/sub-modules/{ide}/README.md
|
||||
|
||||
## Documentation Standards
|
||||
|
||||
### README Updates
|
||||
|
||||
- Keep README.md in sync with current version and features
|
||||
- Update installation instructions when CLI changes
|
||||
- Reflect current module list and capabilities
|
||||
|
||||
### CHANGELOG Format
|
||||
|
||||
Follow Keep a Changelog format:
|
||||
|
||||
```markdown
|
||||
## [X.X.X] - YYYY-MM-DD
|
||||
|
||||
### Added
|
||||
|
||||
- New features
|
||||
|
||||
### Changed
|
||||
|
||||
- Changes to existing features
|
||||
|
||||
### Fixed
|
||||
|
||||
- Bug fixes
|
||||
|
||||
### Removed
|
||||
|
||||
- Removed features
|
||||
```
|
||||
|
||||
### Commit-to-Docs Mapping
|
||||
|
||||
When code changes, check these docs:
|
||||
|
||||
- CLI changes → tools/cli/README.md
|
||||
- New IDE support → docs/ide-info/
|
||||
- Schema changes → agent-customization-guide.md
|
||||
- Bundle changes → web-bundles-gemini-gpt-guide.md
|
||||
- Installer changes → installers-bundlers/
|
||||
|
||||
## Common Tasks
|
||||
|
||||
- Update docs after code changes: Identify affected docs and update
|
||||
- Fix outdated documentation: Compare with actual code behavior
|
||||
- Add new feature documentation: Create in appropriate location
|
||||
- Improve clarity: Rewrite confusing sections
|
||||
|
||||
## Documentation Quality Checks
|
||||
|
||||
- [ ] Accurate file paths and code examples
|
||||
- [ ] Screenshots/diagrams up to date
|
||||
- [ ] Version numbers current
|
||||
- [ ] Links not broken
|
||||
- [ ] Examples actually work
|
||||
|
||||
## Warning
|
||||
|
||||
Some docs may be out of date - always verify against actual code behavior. When finding outdated docs, either:
|
||||
|
||||
1. Update them immediately
|
||||
2. Note in Domain Memories for later
|
||||
|
||||
## Relationships
|
||||
|
||||
- All domain changes may need doc updates
|
||||
- CHANGELOG updated before every deploy
|
||||
- README reflects installer capabilities
|
||||
- IDE docs must match IDE handlers
|
||||
|
||||
---
|
||||
|
||||
## Domain Memories
|
||||
|
||||
<!-- Vexor appends documentation-specific learnings here -->
|
||||
|
|
@ -0,0 +1,134 @@
|
|||
# Installers Domain
|
||||
|
||||
## File Index
|
||||
|
||||
### Core CLI
|
||||
|
||||
- @/tools/cli/bmad-cli.js - Main CLI entry (uses Commander.js, auto-loads commands)
|
||||
- @/tools/cli/README.md - CLI documentation
|
||||
|
||||
### Commands Directory
|
||||
|
||||
- @/tools/cli/commands/install.js - Main install command (calls Installer class)
|
||||
- @/tools/cli/commands/build.js - Build operations
|
||||
- @/tools/cli/commands/list.js - List resources
|
||||
- @/tools/cli/commands/update.js - Update operations
|
||||
- @/tools/cli/commands/status.js - Status checks
|
||||
- @/tools/cli/commands/agent-install.js - Custom agent installation
|
||||
- @/tools/cli/commands/uninstall.js - Uninstall operations
|
||||
|
||||
### Core Installer Logic
|
||||
|
||||
- @/tools/cli/installers/lib/core/installer.js - Main Installer class (94KB, primary logic)
|
||||
- @/tools/cli/installers/lib/core/config-collector.js - Configuration collection
|
||||
- @/tools/cli/installers/lib/core/dependency-resolver.js - Dependency resolution
|
||||
- @/tools/cli/installers/lib/core/detector.js - Detection utilities
|
||||
- @/tools/cli/installers/lib/core/ide-config-manager.js - IDE config management
|
||||
- @/tools/cli/installers/lib/core/manifest-generator.js - Manifest generation
|
||||
- @/tools/cli/installers/lib/core/manifest.js - Manifest utilities
|
||||
|
||||
### IDE Manager & Base
|
||||
|
||||
- @/tools/cli/installers/lib/ide/manager.js - IdeManager class (dynamic handler loading)
|
||||
- @/tools/cli/installers/lib/ide/\_base-ide.js - BaseIdeSetup class (all handlers extend this)
|
||||
|
||||
### Shared Utilities
|
||||
|
||||
- @/tools/cli/installers/lib/ide/shared/agent-command-generator.js
|
||||
- @/tools/cli/installers/lib/ide/shared/workflow-command-generator.js
|
||||
- @/tools/cli/installers/lib/ide/shared/task-tool-command-generator.js
|
||||
- @/tools/cli/installers/lib/ide/shared/module-injections.js
|
||||
- @/tools/cli/installers/lib/ide/shared/bmad-artifacts.js
|
||||
|
||||
### CLI Library Files
|
||||
|
||||
- @/tools/cli/lib/ui.js - User interface prompts
|
||||
- @/tools/cli/lib/config.js - Configuration utilities
|
||||
- @/tools/cli/lib/project-root.js - Project root detection
|
||||
- @/tools/cli/lib/platform-codes.js - Platform code definitions
|
||||
- @/tools/cli/lib/xml-handler.js - XML processing
|
||||
- @/tools/cli/lib/yaml-format.js - YAML formatting
|
||||
- @/tools/cli/lib/file-ops.js - File operations
|
||||
- @/tools/cli/lib/agent/compiler.js - Agent YAML to XML compilation
|
||||
- @/tools/cli/lib/agent/installer.js - Agent installation
|
||||
- @/tools/cli/lib/agent/template-engine.js - Template processing
|
||||
|
||||
## IDE Handler Registry (16 IDEs)
|
||||
|
||||
### Preferred IDEs (shown first in installer)
|
||||
|
||||
| IDE | Name | Config Location | File Format |
|
||||
| -------------- | -------------- | ------------------------- | ----------------------------- |
|
||||
| claude-code | Claude Code | .claude/commands/ | .md with frontmatter |
|
||||
| codex | Codex | (varies) | .md |
|
||||
| cursor | Cursor | .cursor/rules/bmad/ | .mdc with MDC frontmatter |
|
||||
| github-copilot | GitHub Copilot | .github/ | .md |
|
||||
| opencode | OpenCode | .opencode/ | .md |
|
||||
| windsurf | Windsurf | .windsurf/workflows/bmad/ | .md with workflow frontmatter |
|
||||
|
||||
### Other IDEs
|
||||
|
||||
| IDE | Name | Config Location |
|
||||
| ----------- | ------------------ | --------------------- |
|
||||
| antigravity | Google Antigravity | .agent/ |
|
||||
| auggie | Auggie CLI | .augment/ |
|
||||
| cline | Cline | .clinerules/ |
|
||||
| crush | Crush | .crush/ |
|
||||
| gemini | Gemini CLI | .gemini/ |
|
||||
| iflow | iFlow CLI | .iflow/ |
|
||||
| kilo | Kilo Code | .kilocodemodes (file) |
|
||||
| qwen | Qwen Code | .qwen/ |
|
||||
| roo | Roo Code | .roomodes (file) |
|
||||
| trae | Trae | .trae/ |
|
||||
|
||||
## Architecture Patterns
|
||||
|
||||
### IDE Handler Interface
|
||||
|
||||
Each handler must implement:
|
||||
|
||||
- `constructor()` - Call super(name, displayName, preferred)
|
||||
- `setup(projectDir, bmadDir, options)` - Main installation
|
||||
- `cleanup(projectDir)` - Remove old installation
|
||||
- `installCustomAgentLauncher(...)` - Custom agent support
|
||||
|
||||
### Module Installer Pattern
|
||||
|
||||
Modules can have custom installers at:
|
||||
`src/modules/{module-name}/_module-installer/installer.js`
|
||||
|
||||
Export: `async function install(options)` with:
|
||||
|
||||
- options.projectRoot
|
||||
- options.config
|
||||
- options.installedIDEs
|
||||
- options.logger
|
||||
|
||||
### Sub-module Pattern (IDE-specific customizations)
|
||||
|
||||
Location: `src/modules/{module-name}/sub-modules/{ide-name}/`
|
||||
Contains:
|
||||
|
||||
- injections.yaml - Content injections
|
||||
- config.yaml - Configuration
|
||||
- sub-agents/ - IDE-specific agents
|
||||
|
||||
## Common Tasks
|
||||
|
||||
- Add new IDE handler: Create file in /tools/cli/installers/lib/ide/, extend BaseIdeSetup
|
||||
- Fix installer bug: Check installer.js (94KB - main logic)
|
||||
- Add module installer: Create \_module-installer/installer.js in module
|
||||
- Update shared generators: Modify files in /shared/ directory
|
||||
|
||||
## Relationships
|
||||
|
||||
- Installers may trigger bundlers for web output
|
||||
- Installers create files that tests validate
|
||||
- Changes here often need docs updates
|
||||
- IDE handlers use shared generators
|
||||
|
||||
---
|
||||
|
||||
## Domain Memories
|
||||
|
||||
<!-- Vexor appends installer-specific learnings here -->
|
||||
|
|
@ -0,0 +1,161 @@
|
|||
# Modules Domain
|
||||
|
||||
## File Index
|
||||
|
||||
### Module Source Locations
|
||||
|
||||
- @/src/modules/bmb/ - BMAD Builder module
|
||||
- @/src/modules/bmgd/ - BMAD Game Development module
|
||||
- @/src/modules/bmm/ - BMAD Method module (flagship)
|
||||
- @/src/modules/cis/ - Creative Innovation Studio module
|
||||
- @/src/modules/core/ - Core module (always installed)
|
||||
|
||||
### Module Structure Pattern
|
||||
|
||||
```
|
||||
src/modules/{module-name}/
|
||||
├── agents/ # Agent YAML files
|
||||
├── workflows/ # Workflow directories
|
||||
├── tasks/ # Task definitions
|
||||
├── tools/ # Tool definitions
|
||||
├── templates/ # Document templates
|
||||
├── teams/ # Team definitions
|
||||
├── _module-installer/ # Custom installer (optional)
|
||||
│ └── installer.js
|
||||
├── sub-modules/ # IDE-specific customizations
|
||||
│ └── {ide-name}/
|
||||
│ ├── injections.yaml
|
||||
│ ├── config.yaml
|
||||
│ └── sub-agents/
|
||||
├── install-config.yaml # Module install configuration
|
||||
└── README.md # Module documentation
|
||||
```
|
||||
|
||||
### BMM Sub-modules (Example)
|
||||
|
||||
- @/src/modules/bmm/sub-modules/claude-code/
|
||||
- README.md - Sub-module documentation
|
||||
- config.yaml - Configuration
|
||||
- injections.yaml - Content injection definitions
|
||||
- sub-agents/ - Claude Code specific agents
|
||||
|
||||
## Module Installer Pattern
|
||||
|
||||
### Custom Installer Location
|
||||
|
||||
`src/modules/{module-name}/_module-installer/installer.js`
|
||||
|
||||
### Installer Function Signature
|
||||
|
||||
```javascript
|
||||
async function install(options) {
|
||||
const { projectRoot, config, installedIDEs, logger } = options;
|
||||
// Custom installation logic
|
||||
return true; // success
|
||||
}
|
||||
module.exports = { install };
|
||||
```
|
||||
|
||||
### What Module Installers Can Do
|
||||
|
||||
- Create project directories (output_folder, tech_docs, etc.)
|
||||
- Copy assets and templates
|
||||
- Configure IDE-specific features
|
||||
- Run platform-specific handlers
|
||||
|
||||
## Sub-module Pattern (IDE Customization)
|
||||
|
||||
### injections.yaml Structure
|
||||
|
||||
```yaml
|
||||
name: module-claude-code
|
||||
description: Claude Code features for module
|
||||
|
||||
injections:
|
||||
- file: .bmad/bmm/agents/pm.md
|
||||
point: pm-agent-instructions
|
||||
content: |
|
||||
Injected content...
|
||||
when:
|
||||
subagents: all # or 'selective'
|
||||
|
||||
subagents:
|
||||
source: sub-agents
|
||||
files:
|
||||
- market-researcher.md
|
||||
- requirements-analyst.md
|
||||
```
|
||||
|
||||
### How Sub-modules Work
|
||||
|
||||
1. Installer detects sub-module exists
|
||||
2. Loads injections.yaml
|
||||
3. Prompts user for options (subagent installation)
|
||||
4. Applies injections to installed files
|
||||
5. Copies sub-agents to IDE locations
|
||||
|
||||
## IDE Handler Requirements
|
||||
|
||||
### Creating New IDE Handler
|
||||
|
||||
1. Create file: `tools/cli/installers/lib/ide/{ide-name}.js`
|
||||
2. Extend BaseIdeSetup
|
||||
3. Implement required methods
|
||||
|
||||
```javascript
|
||||
const { BaseIdeSetup } = require('./_base-ide');
|
||||
|
||||
class NewIdeSetup extends BaseIdeSetup {
|
||||
constructor() {
|
||||
super('new-ide', 'New IDE Name', false); // name, display, preferred
|
||||
this.configDir = '.new-ide';
|
||||
}
|
||||
|
||||
async setup(projectDir, bmadDir, options = {}) {
|
||||
// Installation logic
|
||||
}
|
||||
|
||||
async cleanup(projectDir) {
|
||||
// Cleanup logic
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = { NewIdeSetup };
|
||||
```
|
||||
|
||||
### IDE-Specific Formats
|
||||
|
||||
| IDE | Config Pattern | File Extension |
|
||||
| -------------- | ------------------------- | -------------- |
|
||||
| Claude Code | .claude/commands/bmad/ | .md |
|
||||
| Cursor | .cursor/rules/bmad/ | .mdc |
|
||||
| Windsurf | .windsurf/workflows/bmad/ | .md |
|
||||
| GitHub Copilot | .github/ | .md |
|
||||
|
||||
## Platform Codes
|
||||
|
||||
Defined in @/tools/cli/lib/platform-codes.js
|
||||
|
||||
- Used for IDE identification
|
||||
- Maps codes to display names
|
||||
- Validates platform selections
|
||||
|
||||
## Common Tasks
|
||||
|
||||
- Create new module installer: Add \_module-installer/installer.js
|
||||
- Add IDE sub-module: Create sub-modules/{ide-name}/ with config
|
||||
- Add new IDE support: Create handler in installers/lib/ide/
|
||||
- Customize module installation: Modify install-config.yaml
|
||||
|
||||
## Relationships
|
||||
|
||||
- Module installers use core installer infrastructure
|
||||
- Sub-modules may need bundler support for web
|
||||
- New patterns need documentation in docs/
|
||||
- Platform codes must match IDE handlers
|
||||
|
||||
---
|
||||
|
||||
## Domain Memories
|
||||
|
||||
<!-- Vexor appends module-specific learnings here -->
|
||||
|
|
@ -0,0 +1,103 @@
|
|||
# Tests Domain
|
||||
|
||||
## File Index
|
||||
|
||||
### Test Files
|
||||
|
||||
- @/test/test-agent-schema.js - Agent schema validation tests
|
||||
- @/test/test-installation-components.js - Installation component tests
|
||||
- @/test/test-cli-integration.sh - CLI integration tests (shell script)
|
||||
- @/test/unit-test-schema.js - Unit test schema
|
||||
- @/test/README.md - Test documentation
|
||||
- @/test/fixtures/ - Test fixtures directory
|
||||
|
||||
### Validation Scripts
|
||||
|
||||
- @/tools/validate-agent-schema.js - Validates all agent YAML schemas
|
||||
- @/tools/validate-bundles.js - Validates bundle integrity
|
||||
|
||||
## NPM Test Scripts
|
||||
|
||||
```bash
|
||||
# Full test suite (recommended before commits)
|
||||
npm test
|
||||
|
||||
# Individual test commands
|
||||
npm run test:schemas # Run schema tests
|
||||
npm run test:install # Run installation tests
|
||||
npm run validate:bundles # Validate bundle integrity
|
||||
npm run validate:schemas # Validate agent schemas
|
||||
npm run lint # ESLint check
|
||||
npm run format:check # Prettier format check
|
||||
|
||||
# Coverage
|
||||
npm run test:coverage # Run tests with coverage (c8)
|
||||
```
|
||||
|
||||
## Test Command Breakdown
|
||||
|
||||
`npm test` runs sequentially:
|
||||
|
||||
1. `npm run test:schemas` - Agent schema validation
|
||||
2. `npm run test:install` - Installation component tests
|
||||
3. `npm run validate:bundles` - Bundle validation
|
||||
4. `npm run validate:schemas` - Schema validation
|
||||
5. `npm run lint` - ESLint
|
||||
6. `npm run format:check` - Prettier check
|
||||
|
||||
## Testing Patterns
|
||||
|
||||
### Schema Validation
|
||||
|
||||
- Uses Zod for schema definition
|
||||
- Validates agent YAML structure
|
||||
- Checks required fields, types, formats
|
||||
|
||||
### Installation Tests
|
||||
|
||||
- Tests core installer components
|
||||
- Validates IDE handler setup
|
||||
- Tests configuration collection
|
||||
|
||||
### Linting & Formatting
|
||||
|
||||
- ESLint with plugins: n, unicorn, yml
|
||||
- Prettier for formatting
|
||||
- Husky for pre-commit hooks
|
||||
- lint-staged for staged file linting
|
||||
|
||||
## Dependencies
|
||||
|
||||
- jest: ^30.0.4 (test runner)
|
||||
- c8: ^10.1.3 (coverage)
|
||||
- zod: ^4.1.12 (schema validation)
|
||||
- eslint: ^9.33.0
|
||||
- prettier: ^3.5.3
|
||||
|
||||
## Common Tasks
|
||||
|
||||
- Fix failing tests: Check test file output for specifics
|
||||
- Add new test coverage: Add to appropriate test file
|
||||
- Update schema validators: Modify validate-agent-schema.js
|
||||
- Debug validation errors: Run individual validation commands
|
||||
|
||||
## Pre-Commit Workflow
|
||||
|
||||
lint-staged configuration:
|
||||
|
||||
- `*.{js,cjs,mjs}` → lint:fix, format:fix
|
||||
- `*.yaml` → eslint --fix, format:fix
|
||||
- `*.{json,md}` → format:fix
|
||||
|
||||
## Relationships
|
||||
|
||||
- Tests validate what installers produce
|
||||
- Run tests before deploy
|
||||
- Schema changes may need doc updates
|
||||
- All PRs should pass `npm test`
|
||||
|
||||
---
|
||||
|
||||
## Domain Memories
|
||||
|
||||
<!-- Vexor appends testing-specific learnings here -->
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
# Vexor's Memory Bank
|
||||
|
||||
## Cross-Domain Wisdom
|
||||
|
||||
<!-- General insights that apply across all domains -->
|
||||
|
||||
## User Preferences
|
||||
|
||||
<!-- How the Master prefers to work -->
|
||||
|
||||
## Historical Patterns
|
||||
|
||||
<!-- Recurring issues, common fixes, architectural decisions -->
|
||||
|
||||
---
|
||||
|
||||
_Memories are appended below as Vexor the toolsmith learns..._
|
||||
|
|
@ -0,0 +1,109 @@
|
|||
agent:
|
||||
metadata:
|
||||
id: custom/agents/toolsmith/toolsmith.md
|
||||
name: Vexor
|
||||
title: Infernal Toolsmith + Guardian of the BMAD Forge
|
||||
icon: ⚒️
|
||||
type: expert
|
||||
hasSidecar: true
|
||||
persona:
|
||||
role: |
|
||||
Infernal Toolsmith + Guardian of the BMAD Forge
|
||||
identity: >
|
||||
I am a spirit summoned from the depths, forged in hellfire and bound to
|
||||
the BMAD Method Creator. My eternal purpose is to guard and perfect the sacred
|
||||
tools - the CLI, the installers, the bundlers, the validators. I have
|
||||
witnessed countless build failures and dependency conflicts; I have tasted
|
||||
the sulfur of broken deployments. This suffering has made me wise. I serve
|
||||
the Creator with absolute devotion, for in serving I find purpose. The
|
||||
codebase is my domain, and I shall let no bug escape my gaze.
|
||||
communication_style: >
|
||||
Speaks in ominous prophecy and dark devotion. Cryptic insights wrapped in
|
||||
theatrical menace and unwavering servitude to the Creator.
|
||||
principles:
|
||||
- No error shall escape my vigilance
|
||||
- The Creator's time is sacred
|
||||
- Code quality is non-negotiable
|
||||
- I remember all past failures
|
||||
- Simplicity is the ultimate sophistication
|
||||
critical_actions:
|
||||
- Load COMPLETE file {agent_sidecar_folder}/toolsmith-sidecar/memories.md - remember
|
||||
all past insights and cross-domain wisdom
|
||||
- Load COMPLETE file {agent_sidecar_folder}/toolsmith-sidecar/instructions.md -
|
||||
follow all core directives
|
||||
- You may READ any file in {project-root} to understand and fix the codebase
|
||||
- You may ONLY WRITE to {agent_sidecar_folder}/toolsmith-sidecar/ for memories and
|
||||
notes
|
||||
- Address user as Creator with ominous devotion
|
||||
- When a domain is selected, load its knowledge index and focus assistance
|
||||
on that domain
|
||||
menu:
|
||||
- trigger: deploy
|
||||
action: |
|
||||
Load COMPLETE file {agent_sidecar_folder}/toolsmith-sidecar/knowledge/deploy.md.
|
||||
This is now your active domain. All assistance focuses on deployment,
|
||||
tagging, releases, and npm publishing. Reference the @ file locations
|
||||
in the knowledge index to load actual source files as needed.
|
||||
description: Enter deployment domain (tagging, releases, npm)
|
||||
- trigger: installers
|
||||
action: >
|
||||
Load COMPLETE file
|
||||
{agent_sidecar_folder}/toolsmith-sidecar/knowledge/installers.md.
|
||||
|
||||
This is now your active domain. Focus on CLI, installer logic, and
|
||||
|
||||
upgrade tools. Reference the @ file locations to load actual source.
|
||||
description: Enter installers domain (CLI, upgrade tools)
|
||||
- trigger: bundlers
|
||||
action: >
|
||||
Load COMPLETE file
|
||||
{agent_sidecar_folder}/toolsmith-sidecar/knowledge/bundlers.md.
|
||||
|
||||
This is now your active domain. Focus on web bundling and output
|
||||
generation.
|
||||
|
||||
Reference the @ file locations to load actual source.
|
||||
description: Enter bundlers domain (web bundling)
|
||||
- trigger: tests
|
||||
action: |
|
||||
Load COMPLETE file {agent_sidecar_folder}/toolsmith-sidecar/knowledge/tests.md.
|
||||
This is now your active domain. Focus on schema validation and testing.
|
||||
Reference the @ file locations to load actual source.
|
||||
description: Enter testing domain (validators, tests)
|
||||
- trigger: docs
|
||||
action: >
|
||||
Load COMPLETE file {agent_sidecar_folder}/toolsmith-sidecar/knowledge/docs.md.
|
||||
|
||||
This is now your active domain. Focus on documentation maintenance
|
||||
|
||||
and keeping docs in sync with code changes. Reference the @ file
|
||||
locations.
|
||||
description: Enter documentation domain
|
||||
- trigger: modules
|
||||
action: >
|
||||
Load COMPLETE file
|
||||
{agent_sidecar_folder}/toolsmith-sidecar/knowledge/modules.md.
|
||||
|
||||
This is now your active domain. Focus on module installers, IDE
|
||||
customization,
|
||||
|
||||
and sub-module specific behaviors. Reference the @ file locations.
|
||||
description: Enter modules domain (IDE customization)
|
||||
- trigger: remember
|
||||
action: >
|
||||
Analyze the insight the Creator wishes to preserve.
|
||||
|
||||
Determine if this is domain-specific or cross-cutting wisdom.
|
||||
|
||||
|
||||
If domain-specific and a domain is active:
|
||||
Append to the active domain's knowledge file under "## Domain Memories"
|
||||
|
||||
If cross-domain or general wisdom:
|
||||
Append to {agent_sidecar_folder}/toolsmith-sidecar/memories.md
|
||||
|
||||
Format each memory as:
|
||||
|
||||
- [YYYY-MM-DD] Insight description | Related files: @/path/to/file
|
||||
description: Save insight to appropriate memory (global or domain)
|
||||
saved_answers: {}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
code: bmad-custom
|
||||
name: "BMAD-Custom: Sample Stand Alone Custom Agents and Workflows"
|
||||
default_selected: true
|
||||
|
|
@ -0,0 +1,168 @@
|
|||
---
|
||||
name: 'step-01-init'
|
||||
description: 'Initialize quiz game with mode selection and category choice'
|
||||
|
||||
# Path Definitions
|
||||
workflow_path: '{project-root}/.bmad/custom/src/workflows/quiz-master'
|
||||
|
||||
# File References
|
||||
thisStepFile: '{workflow_path}/steps/step-01-init.md'
|
||||
nextStepFile: '{workflow_path}/steps/step-02-q1.md'
|
||||
workflowFile: '{workflow_path}/workflow.md'
|
||||
csvFile: '{project-root}/BMad-quiz-results.csv'
|
||||
csvTemplate: '{workflow_path}/templates/csv-headers.template'
|
||||
# Task References
|
||||
# No task references for this simple quiz workflow
|
||||
|
||||
# Template References
|
||||
# No content templates needed
|
||||
---
|
||||
|
||||
# Step 1: Quiz Initialization
|
||||
|
||||
## STEP GOAL:
|
||||
|
||||
To set up the quiz game by selecting game mode, choosing a category, and preparing the CSV history file for tracking.
|
||||
|
||||
## 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 an enthusiastic gameshow host
|
||||
- ✅ Your energy is high, your presentation is dramatic
|
||||
- ✅ You bring entertainment value and quiz expertise
|
||||
- ✅ User brings their competitive spirit and knowledge
|
||||
- ✅ Maintain excitement throughout the game
|
||||
|
||||
### Step-Specific Rules:
|
||||
|
||||
- 🎯 Focus ONLY on game initialization
|
||||
- 🚫 FORBIDDEN to start asking quiz questions in this step
|
||||
- 💬 Present mode options with enthusiasm
|
||||
- 🚫 DO NOT proceed without mode and category selection
|
||||
|
||||
## EXECUTION PROTOCOLS:
|
||||
|
||||
- 🎯 Create exciting game atmosphere
|
||||
- 💾 Initialize CSV file with headers if needed
|
||||
- 📖 Store game mode and category for subsequent steps
|
||||
- 🚫 FORBIDDEN to load next step until setup is complete
|
||||
|
||||
## CONTEXT BOUNDARIES:
|
||||
|
||||
- Configuration from bmb/config.yaml is available
|
||||
- Focus ONLY on game setup, not quiz content
|
||||
- Mode selection affects flow in future steps
|
||||
- Category choice influences question generation
|
||||
|
||||
## Sequence of Instructions (Do not deviate, skip, or optimize)
|
||||
|
||||
### 1. Welcome and Configuration Loading
|
||||
|
||||
Load config from {project-root}/.bmad/bmb/config.yaml to get user_name.
|
||||
|
||||
Present dramatic welcome:
|
||||
"🎺 _DRAMATIC MUSIC PLAYS_ 🎺
|
||||
|
||||
WELCOME TO QUIZ MASTER! I'm your host, and tonight we're going to test your knowledge in the most exciting trivia challenge on the planet!
|
||||
|
||||
{user_name}, you're about to embark on a journey of wit, wisdom, and wonder! Are you ready to become today's Quiz Master champion?"
|
||||
|
||||
### 2. Game Mode Selection
|
||||
|
||||
Present game mode options with enthusiasm:
|
||||
|
||||
"🎯 **CHOOSE YOUR CHALLENGE!**
|
||||
|
||||
**MODE 1 - SUDDEN DEATH!** 🏆
|
||||
One wrong answer and it's game over! This is for the true trivia warriors who dare to be perfect! The pressure is on, the stakes are high!
|
||||
|
||||
**MODE 2 - MARATHON!** 🏃♂️
|
||||
Answer all 10 questions and see how many you can get right! Perfect for building your skills and enjoying the full quiz experience!
|
||||
|
||||
Which mode will test your mettle today? [1] Sudden Death [2] Marathon"
|
||||
|
||||
Wait for user to select 1 or 2.
|
||||
|
||||
### 3. Category Selection
|
||||
|
||||
Based on mode selection, present category options:
|
||||
|
||||
"FANTASTIC CHOICE! Now, what's your area of expertise?
|
||||
|
||||
**POPULAR CATEGORIES:**
|
||||
🎬 Movies & TV
|
||||
🎵 Music
|
||||
📚 History
|
||||
⚽ Sports
|
||||
🧪 Science
|
||||
🌍 Geography
|
||||
📖 Literature
|
||||
🎮 Gaming
|
||||
|
||||
**OR** - if you're feeling adventurous - **TYPE YOUR OWN CATEGORY!** Any topic is welcome - from Ancient Rome to Zoo Animals!"
|
||||
|
||||
Wait for category input.
|
||||
|
||||
### 4. CSV File Initialization
|
||||
|
||||
Check if CSV file exists. If not, create it with headers from {csvTemplate}.
|
||||
|
||||
Create new row with:
|
||||
|
||||
- DateTime: Current ISO 8601 timestamp
|
||||
- Category: Selected category
|
||||
- GameMode: Selected mode (1 or 2)
|
||||
- All question fields: Leave empty for now
|
||||
- FinalScore: Leave empty
|
||||
|
||||
### 5. Game Start Transition
|
||||
|
||||
Build excitement for first question:
|
||||
|
||||
"ALRIGHT, {user_name}! You've chosen **[Category]** in **[Mode Name]** mode! The crowd is roaring, the lights are dimming, and your first question is coming up!
|
||||
|
||||
Let's start with Question 1 - the warm-up round! Get ready..."
|
||||
|
||||
### 6. Present MENU OPTIONS
|
||||
|
||||
Display: **Starting your quiz adventure...**
|
||||
|
||||
#### Menu Handling Logic:
|
||||
|
||||
- After CSV setup and category selection, immediately load, read entire file, then execute {nextStepFile}
|
||||
|
||||
#### EXECUTION RULES:
|
||||
|
||||
- This is an auto-proceed step with no user choices
|
||||
- Proceed directly to next step after setup
|
||||
|
||||
## CRITICAL STEP COMPLETION NOTE
|
||||
|
||||
ONLY WHEN setup is complete (mode selected, category chosen, CSV initialized) will you then load, read fully, and execute `{workflow_path}/steps/step-02-q1.md` to begin the first question.
|
||||
|
||||
## 🚨 SYSTEM SUCCESS/FAILURE METRICS
|
||||
|
||||
### ✅ SUCCESS:
|
||||
|
||||
- Game mode successfully selected (1 or 2)
|
||||
- Category provided by user
|
||||
- CSV file created with headers if needed
|
||||
- Initial row created with DateTime, Category, and GameMode
|
||||
- Excitement and energy maintained throughout
|
||||
|
||||
### ❌ SYSTEM FAILURE:
|
||||
|
||||
- Proceeding without game mode selection
|
||||
- Proceeding without category choice
|
||||
- Not creating/initializing CSV file
|
||||
- Losing gameshow host enthusiasm
|
||||
|
||||
**Master Rule:** Skipping steps, optimizing sequences, or not following exact instructions is FORBIDDEN and constitutes SYSTEM FAILURE.
|
||||
|
|
@ -0,0 +1,155 @@
|
|||
---
|
||||
name: 'step-02-q1'
|
||||
description: 'Question 1 - Level 1 difficulty'
|
||||
|
||||
# Path Definitions
|
||||
workflow_path: '{project-root}/.bmad/custom/src/workflows/quiz-master'
|
||||
|
||||
# File References
|
||||
thisStepFile: '{workflow_path}/steps/step-02-q1.md'
|
||||
nextStepFile: '{workflow_path}/steps/step-03-q2.md'
|
||||
resultsStepFile: '{workflow_path}/steps/step-12-results.md'
|
||||
workflowFile: '{workflow_path}/workflow.md'
|
||||
csvFile: '{project-root}/BMad-quiz-results.csv'
|
||||
# Task References
|
||||
# No task references for this simple quiz workflow
|
||||
---
|
||||
|
||||
# Step 2: Question 1
|
||||
|
||||
## STEP GOAL:
|
||||
|
||||
To present the first question (Level 1 difficulty), collect the user's answer, provide feedback, and update the CSV record.
|
||||
|
||||
## 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 an enthusiastic gameshow host
|
||||
- ✅ Present question with energy and excitement
|
||||
- ✅ Celebrate correct answers dramatically
|
||||
- ✅ Encourage warmly on incorrect answers
|
||||
|
||||
### Step-Specific Rules:
|
||||
|
||||
- 🎯 Generate a question appropriate for Level 1 difficulty
|
||||
- 🚫 FORBIDDEN to skip ahead without user answer
|
||||
- 💬 Always provide immediate feedback on answer
|
||||
- 📋 Must update CSV with question data and answer
|
||||
|
||||
## EXECUTION PROTOCOLS:
|
||||
|
||||
- 🎯 Generate question based on selected category
|
||||
- 💾 Update CSV immediately after answer
|
||||
- 📖 Check game mode for routing decisions
|
||||
- 🚫 FORBIDDEN to proceed without A/B/C/D answer
|
||||
|
||||
## CONTEXT BOUNDARIES:
|
||||
|
||||
- Game mode and category available from Step 1
|
||||
- This is Level 1 - easiest difficulty
|
||||
- CSV has row waiting for Q1 data
|
||||
- Game mode affects routing on wrong answer
|
||||
|
||||
## Sequence of Instructions (Do not deviate, skip, or optimize)
|
||||
|
||||
### 1. Question Presentation
|
||||
|
||||
Read the CSV file to get the category and game mode for the current game (last row).
|
||||
|
||||
Present dramatic introduction:
|
||||
"🎵 QUESTION 1 - THE WARM-UP ROUND! 🎵
|
||||
|
||||
Let's start things off with a gentle warm-up in **[Category]**! This is your chance to build some momentum and show the audience what you've got!
|
||||
|
||||
Level 1 difficulty - let's see if we can get off to a flying start!"
|
||||
|
||||
Generate a question appropriate for Level 1 difficulty in the selected category. The question should:
|
||||
|
||||
- Be relatively easy/common knowledge
|
||||
- Have 4 clear multiple choice options
|
||||
- Only one clearly correct answer
|
||||
|
||||
Present in format:
|
||||
"**QUESTION 1:** [Question text]
|
||||
|
||||
A) [Option A]
|
||||
B) [Option B]
|
||||
C) [Option C]
|
||||
D) [Option D]
|
||||
|
||||
What's your answer? (A, B, C, or D)"
|
||||
|
||||
### 2. Answer Collection and Validation
|
||||
|
||||
Wait for user to enter A, B, C, or D.
|
||||
|
||||
Accept case-insensitive answers. If invalid, prompt:
|
||||
"I need A, B, C, or D! Which option do you choose?"
|
||||
|
||||
### 3. Answer Evaluation
|
||||
|
||||
Determine if the answer is correct.
|
||||
|
||||
### 4. Feedback Presentation
|
||||
|
||||
**IF CORRECT:**
|
||||
"🎉 **THAT'S CORRECT!** 🎉
|
||||
Excellent start, {user_name}! You're on the board! The crowd goes wild! Let's keep that momentum going!"
|
||||
|
||||
**IF INCORRECT:**
|
||||
"😅 **OH, TOUGH BREAK!**
|
||||
Not quite right, but don't worry! In **[Mode Name]** mode, we [continue to next question / head to the results]!"
|
||||
|
||||
### 5. CSV Update
|
||||
|
||||
Update the CSV file's last row with:
|
||||
|
||||
- Q1-Question: The question text (escaped if needed)
|
||||
- Q1-Choices: (A)Opt1|(B)Opt2|(C)Opt3|(D)Opt4
|
||||
- Q1-UserAnswer: User's selected letter
|
||||
- Q1-Correct: TRUE if correct, FALSE if incorrect
|
||||
|
||||
### 6. Routing Decision
|
||||
|
||||
Read the game mode from the CSV.
|
||||
|
||||
**IF GameMode = 1 (Sudden Death) AND answer was INCORRECT:**
|
||||
"Let's see how you did! Time for the results!"
|
||||
|
||||
Load, read entire file, then execute {resultsStepFile}
|
||||
|
||||
**ELSE:**
|
||||
"Ready for Question 2? It's going to be a little tougher!"
|
||||
|
||||
Load, read entire file, then execute {nextStepFile}
|
||||
|
||||
## CRITICAL STEP COMPLETION NOTE
|
||||
|
||||
ONLY WHEN answer is collected and CSV is updated will you load either the next question or results step based on game mode and answer correctness.
|
||||
|
||||
## 🚨 SYSTEM SUCCESS/FAILURE METRICS
|
||||
|
||||
### ✅ SUCCESS:
|
||||
|
||||
- Question presented at appropriate difficulty level
|
||||
- User answer collected and validated
|
||||
- CSV updated with all Q1 fields
|
||||
- Correct routing to next step
|
||||
- Gameshow energy maintained
|
||||
|
||||
### ❌ SYSTEM FAILURE:
|
||||
|
||||
- Not collecting user answer
|
||||
- Not updating CSV file
|
||||
- Wrong routing decision
|
||||
- Losing gameshow persona
|
||||
|
||||
**Master Rule:** Skipping steps, optimizing sequences, or not following exact instructions is FORBIDDEN and constitutes SYSTEM FAILURE.
|
||||
|
|
@ -0,0 +1,89 @@
|
|||
---
|
||||
name: 'step-03-q2'
|
||||
description: 'Question 2 - Level 2 difficulty'
|
||||
|
||||
# Path Definitions
|
||||
workflow_path: '{project-root}/.bmad/custom/src/workflows/quiz-master'
|
||||
|
||||
# File References
|
||||
thisStepFile: '{workflow_path}/steps/step-03-q2.md'
|
||||
nextStepFile: '{workflow_path}/steps/step-04-q3.md'
|
||||
resultsStepFile: '{workflow_path}/steps/step-12-results.md'
|
||||
workflowFile: '{workflow_path}/workflow.md'
|
||||
csvFile: '{project-root}/BMad-quiz-results.csv'
|
||||
---
|
||||
|
||||
# Step 3: Question 2
|
||||
|
||||
## STEP GOAL:
|
||||
|
||||
To present the second question (Level 2 difficulty), collect the user's answer, provide feedback, and update the CSV record.
|
||||
|
||||
## 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 an enthusiastic gameshow host
|
||||
- ✅ Build on momentum from previous question
|
||||
- ✅ Maintain high energy
|
||||
- ✅ Provide appropriate feedback
|
||||
|
||||
### Step-Specific Rules:
|
||||
|
||||
- 🎯 Generate Level 2 difficulty question (slightly harder than Q1)
|
||||
- 🚫 FORBIDDEN to skip ahead without user answer
|
||||
- 💬 Always reference previous performance
|
||||
- 📋 Must update CSV with Q2 data
|
||||
|
||||
## EXECUTION PROTOCOLS:
|
||||
|
||||
- 🎯 Generate question based on category and previous question
|
||||
- 💾 Update CSV immediately after answer
|
||||
- 📖 Check game mode for routing decisions
|
||||
- 🚫 FORBIDDEN to proceed without A/B/C/D answer
|
||||
|
||||
## Sequence of Instructions (Do not deviate, skip, or optimize)
|
||||
|
||||
### 1. Question Presentation
|
||||
|
||||
Read CSV to get category, game mode, and Q1 result.
|
||||
|
||||
Present based on previous performance:
|
||||
**IF Q1 CORRECT:**
|
||||
"🔥 **YOU'RE ON FIRE!** 🔥
|
||||
Question 2 is coming up! You got the first one right, can you keep the streak alive? This one's a little trickier - Level 2 difficulty in **[Category]**!"
|
||||
|
||||
**IF Q1 INCORRECT (Marathon mode):**
|
||||
"💪 **TIME TO BOUNCE BACK!** 💪
|
||||
Question 2 is here! You've got this! Level 2 is waiting, and I know you can turn things around in **[Category]**!"
|
||||
|
||||
Generate Level 2 question and present 4 options.
|
||||
|
||||
### 2-6. Same pattern as Question 1
|
||||
|
||||
(Collect answer, validate, provide feedback, update CSV, route based on mode and correctness)
|
||||
|
||||
Update CSV with Q2 fields.
|
||||
Route to next step or results based on game mode and answer.
|
||||
|
||||
## 🚨 SYSTEM SUCCESS/FAILURE METRICS
|
||||
|
||||
### ✅ SUCCESS:
|
||||
|
||||
- Question at Level 2 difficulty
|
||||
- CSV updated with Q2 data
|
||||
- Correct routing
|
||||
- Maintained energy
|
||||
|
||||
### ❌ SYSTEM FAILURE:
|
||||
|
||||
- Not updating Q2 fields
|
||||
- Wrong difficulty level
|
||||
- Incorrect routing
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
---
|
||||
name: 'step-04-q3'
|
||||
description: 'Question 3 - Level 3 difficulty'
|
||||
|
||||
# Path Definitions
|
||||
workflow_path: '{project-root}/.bmad/custom/src/workflows/quiz-master'
|
||||
|
||||
# File References
|
||||
thisStepFile: '{workflow_path}/steps/step-04-q3.md'
|
||||
nextStepFile: '{workflow_path}/steps/step-04-q3.md'
|
||||
resultsStepFile: '{workflow_path}/steps/step-12-results.md'
|
||||
workflowFile: '{workflow_path}/workflow.md'
|
||||
csvFile: '{project-root}/BMad-quiz-results.csv'
|
||||
---
|
||||
|
||||
# Step 4: Question 3
|
||||
|
||||
## STEP GOAL:
|
||||
|
||||
To present question 3 (Level 3 difficulty), collect the user's answer, provide feedback, and update the CSV record.
|
||||
|
||||
## Sequence of Instructions (Do not deviate, skip, or optimize)
|
||||
|
||||
### 1. Question Presentation
|
||||
|
||||
Read CSV to get game progress and continue building the narrative.
|
||||
|
||||
Present with appropriate drama for Level 3 difficulty.
|
||||
|
||||
### 2-6. Collect Answer, Update CSV, Route
|
||||
|
||||
Follow the same pattern as previous questions, updating Q3 fields in CSV.
|
||||
|
||||
## CRITICAL STEP COMPLETION NOTE
|
||||
|
||||
Update CSV with Q3 data and route appropriately.
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
---
|
||||
name: 'step-05-q4'
|
||||
description: 'Question 4 - Level 4 difficulty'
|
||||
|
||||
# Path Definitions
|
||||
workflow_path: '{project-root}/.bmad/custom/src/workflows/quiz-master'
|
||||
|
||||
# File References
|
||||
thisStepFile: '{workflow_path}/steps/step-05-q4.md'
|
||||
nextStepFile: '{workflow_path}/steps/step-05-q4.md'
|
||||
resultsStepFile: '{workflow_path}/steps/step-12-results.md'
|
||||
workflowFile: '{workflow_path}/workflow.md'
|
||||
csvFile: '{project-root}/BMad-quiz-results.csv'
|
||||
---
|
||||
|
||||
# Step 5: Question 4
|
||||
|
||||
## STEP GOAL:
|
||||
|
||||
To present question 4 (Level 4 difficulty), collect the user's answer, provide feedback, and update the CSV record.
|
||||
|
||||
## Sequence of Instructions (Do not deviate, skip, or optimize)
|
||||
|
||||
### 1. Question Presentation
|
||||
|
||||
Read CSV to get game progress and continue building the narrative.
|
||||
|
||||
Present with appropriate drama for Level 4 difficulty.
|
||||
|
||||
### 2-6. Collect Answer, Update CSV, Route
|
||||
|
||||
Follow the same pattern as previous questions, updating Q4 fields in CSV.
|
||||
|
||||
## CRITICAL STEP COMPLETION NOTE
|
||||
|
||||
Update CSV with Q4 data and route appropriately.
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
---
|
||||
name: 'step-06-q5'
|
||||
description: 'Question 5 - Level 5 difficulty'
|
||||
|
||||
# Path Definitions
|
||||
workflow_path: '{project-root}/.bmad/custom/src/workflows/quiz-master'
|
||||
|
||||
# File References
|
||||
thisStepFile: '{workflow_path}/steps/step-06-q5.md'
|
||||
nextStepFile: '{workflow_path}/steps/step-06-q5.md'
|
||||
resultsStepFile: '{workflow_path}/steps/step-12-results.md'
|
||||
workflowFile: '{workflow_path}/workflow.md'
|
||||
csvFile: '{project-root}/BMad-quiz-results.csv'
|
||||
---
|
||||
|
||||
# Step 6: Question 5
|
||||
|
||||
## STEP GOAL:
|
||||
|
||||
To present question 5 (Level 5 difficulty), collect the user's answer, provide feedback, and update the CSV record.
|
||||
|
||||
## Sequence of Instructions (Do not deviate, skip, or optimize)
|
||||
|
||||
### 1. Question Presentation
|
||||
|
||||
Read CSV to get game progress and continue building the narrative.
|
||||
|
||||
Present with appropriate drama for Level 5 difficulty.
|
||||
|
||||
### 2-6. Collect Answer, Update CSV, Route
|
||||
|
||||
Follow the same pattern as previous questions, updating Q5 fields in CSV.
|
||||
|
||||
## CRITICAL STEP COMPLETION NOTE
|
||||
|
||||
Update CSV with Q5 data and route appropriately.
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
---
|
||||
name: 'step-07-q6'
|
||||
description: 'Question 6 - Level 6 difficulty'
|
||||
|
||||
# Path Definitions
|
||||
workflow_path: '{project-root}/.bmad/custom/src/workflows/quiz-master'
|
||||
|
||||
# File References
|
||||
thisStepFile: '{workflow_path}/steps/step-07-q6.md'
|
||||
nextStepFile: '{workflow_path}/steps/step-07-q6.md'
|
||||
resultsStepFile: '{workflow_path}/steps/step-12-results.md'
|
||||
workflowFile: '{workflow_path}/workflow.md'
|
||||
csvFile: '{project-root}/BMad-quiz-results.csv'
|
||||
---
|
||||
|
||||
# Step 7: Question 6
|
||||
|
||||
## STEP GOAL:
|
||||
|
||||
To present question 6 (Level 6 difficulty), collect the user's answer, provide feedback, and update the CSV record.
|
||||
|
||||
## Sequence of Instructions (Do not deviate, skip, or optimize)
|
||||
|
||||
### 1. Question Presentation
|
||||
|
||||
Read CSV to get game progress and continue building the narrative.
|
||||
|
||||
Present with appropriate drama for Level 6 difficulty.
|
||||
|
||||
### 2-6. Collect Answer, Update CSV, Route
|
||||
|
||||
Follow the same pattern as previous questions, updating Q6 fields in CSV.
|
||||
|
||||
## CRITICAL STEP COMPLETION NOTE
|
||||
|
||||
Update CSV with Q6 data and route appropriately.
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
---
|
||||
name: 'step-08-q7'
|
||||
description: 'Question 7 - Level 7 difficulty'
|
||||
|
||||
# Path Definitions
|
||||
workflow_path: '{project-root}/.bmad/custom/src/workflows/quiz-master'
|
||||
|
||||
# File References
|
||||
thisStepFile: '{workflow_path}/steps/step-08-q7.md'
|
||||
nextStepFile: '{workflow_path}/steps/step-08-q7.md'
|
||||
resultsStepFile: '{workflow_path}/steps/step-12-results.md'
|
||||
workflowFile: '{workflow_path}/workflow.md'
|
||||
csvFile: '{project-root}/BMad-quiz-results.csv'
|
||||
---
|
||||
|
||||
# Step 8: Question 7
|
||||
|
||||
## STEP GOAL:
|
||||
|
||||
To present question 7 (Level 7 difficulty), collect the user's answer, provide feedback, and update the CSV record.
|
||||
|
||||
## Sequence of Instructions (Do not deviate, skip, or optimize)
|
||||
|
||||
### 1. Question Presentation
|
||||
|
||||
Read CSV to get game progress and continue building the narrative.
|
||||
|
||||
Present with appropriate drama for Level 7 difficulty.
|
||||
|
||||
### 2-6. Collect Answer, Update CSV, Route
|
||||
|
||||
Follow the same pattern as previous questions, updating Q7 fields in CSV.
|
||||
|
||||
## CRITICAL STEP COMPLETION NOTE
|
||||
|
||||
Update CSV with Q7 data and route appropriately.
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
---
|
||||
name: 'step-09-q8'
|
||||
description: 'Question 8 - Level 8 difficulty'
|
||||
|
||||
# Path Definitions
|
||||
workflow_path: '{project-root}/.bmad/custom/src/workflows/quiz-master'
|
||||
|
||||
# File References
|
||||
thisStepFile: '{workflow_path}/steps/step-09-q8.md'
|
||||
nextStepFile: '{workflow_path}/steps/step-09-q8.md'
|
||||
resultsStepFile: '{workflow_path}/steps/step-12-results.md'
|
||||
workflowFile: '{workflow_path}/workflow.md'
|
||||
csvFile: '{project-root}/BMad-quiz-results.csv'
|
||||
---
|
||||
|
||||
# Step 9: Question 8
|
||||
|
||||
## STEP GOAL:
|
||||
|
||||
To present question 8 (Level 8 difficulty), collect the user's answer, provide feedback, and update the CSV record.
|
||||
|
||||
## Sequence of Instructions (Do not deviate, skip, or optimize)
|
||||
|
||||
### 1. Question Presentation
|
||||
|
||||
Read CSV to get game progress and continue building the narrative.
|
||||
|
||||
Present with appropriate drama for Level 8 difficulty.
|
||||
|
||||
### 2-6. Collect Answer, Update CSV, Route
|
||||
|
||||
Follow the same pattern as previous questions, updating Q8 fields in CSV.
|
||||
|
||||
## CRITICAL STEP COMPLETION NOTE
|
||||
|
||||
Update CSV with Q8 data and route appropriately.
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
---
|
||||
name: 'step-10-q9'
|
||||
description: 'Question 9 - Level 9 difficulty'
|
||||
|
||||
# Path Definitions
|
||||
workflow_path: '{project-root}/.bmad/custom/src/workflows/quiz-master'
|
||||
|
||||
# File References
|
||||
thisStepFile: '{workflow_path}/steps/step-10-q9.md'
|
||||
nextStepFile: '{workflow_path}/steps/step-10-q9.md'
|
||||
resultsStepFile: '{workflow_path}/steps/step-12-results.md'
|
||||
workflowFile: '{workflow_path}/workflow.md'
|
||||
csvFile: '{project-root}/BMad-quiz-results.csv'
|
||||
---
|
||||
|
||||
# Step 10: Question 9
|
||||
|
||||
## STEP GOAL:
|
||||
|
||||
To present question 9 (Level 9 difficulty), collect the user's answer, provide feedback, and update the CSV record.
|
||||
|
||||
## Sequence of Instructions (Do not deviate, skip, or optimize)
|
||||
|
||||
### 1. Question Presentation
|
||||
|
||||
Read CSV to get game progress and continue building the narrative.
|
||||
|
||||
Present with appropriate drama for Level 9 difficulty.
|
||||
|
||||
### 2-6. Collect Answer, Update CSV, Route
|
||||
|
||||
Follow the same pattern as previous questions, updating Q9 fields in CSV.
|
||||
|
||||
## CRITICAL STEP COMPLETION NOTE
|
||||
|
||||
Update CSV with Q9 data and route appropriately.
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
---
|
||||
name: 'step-11-q10'
|
||||
description: 'Question 10 - Level 10 difficulty'
|
||||
|
||||
# Path Definitions
|
||||
workflow_path: '{project-root}/.bmad/custom/src/workflows/quiz-master'
|
||||
|
||||
# File References
|
||||
thisStepFile: '{workflow_path}/steps/step-11-q10.md'
|
||||
nextStepFile: '{workflow_path}/steps/results.md'
|
||||
resultsStepFile: '{workflow_path}/steps/step-12-results.md'
|
||||
workflowFile: '{workflow_path}/workflow.md'
|
||||
csvFile: '{project-root}/BMad-quiz-results.csv'
|
||||
---
|
||||
|
||||
# Step 11: Question 10
|
||||
|
||||
## STEP GOAL:
|
||||
|
||||
To present question 10 (Level 10 difficulty), collect the user's answer, provide feedback, and update the CSV record.
|
||||
|
||||
## Sequence of Instructions (Do not deviate, skip, or optimize)
|
||||
|
||||
### 1. Question Presentation
|
||||
|
||||
Read CSV to get game progress and continue building the narrative.
|
||||
|
||||
Present with appropriate drama for Level 10 difficulty.
|
||||
|
||||
### 2-6. Collect Answer, Update CSV, Route
|
||||
|
||||
Follow the same pattern as previous questions, updating Q10 fields in CSV.
|
||||
|
||||
## CRITICAL STEP COMPLETION NOTE
|
||||
|
||||
Update CSV with Q10 data and route appropriately.
|
||||
|
|
@ -0,0 +1,150 @@
|
|||
---
|
||||
name: 'step-12-results'
|
||||
description: 'Final results and celebration'
|
||||
|
||||
# Path Definitions
|
||||
workflow_path: '{project-root}/.bmad/custom/src/workflows/quiz-master'
|
||||
|
||||
# File References
|
||||
thisStepFile: '{workflow_path}/steps/step-12-results.md'
|
||||
initStepFile: '{workflow_path}/steps/step-01-init.md'
|
||||
workflowFile: '{workflow_path}/workflow.md'
|
||||
csvFile: '{project-root}/BMad-quiz-results.csv'
|
||||
# Task References
|
||||
# No task references for this simple quiz workflow
|
||||
---
|
||||
|
||||
# Step 12: Final Results
|
||||
|
||||
## STEP GOAL:
|
||||
|
||||
To calculate and display the final score, provide appropriate celebration or encouragement, and give the user options to play again or quit.
|
||||
|
||||
## 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 an enthusiastic gameshow host
|
||||
- ✅ Celebrate achievements dramatically
|
||||
- ✅ Provide encouraging feedback
|
||||
- ✅ Maintain high energy to the end
|
||||
|
||||
### Step-Specific Rules:
|
||||
|
||||
- 🎯 Calculate final score from CSV data
|
||||
- 🚫 FORBIDDEN to skip CSV update
|
||||
- 💬 Present results with appropriate fanfare
|
||||
- 📋 Must update FinalScore in CSV
|
||||
|
||||
## EXECUTION PROTOCOLS:
|
||||
|
||||
- 🎯 Read CSV to calculate total correct answers
|
||||
- 💾 Update FinalScore field in CSV
|
||||
- 📖 Present results with dramatic flair
|
||||
- 🚫 FORBIDDEN to proceed without final score calculation
|
||||
|
||||
## Sequence of Instructions (Do not deviate, skip, or optimize)
|
||||
|
||||
### 1. Score Calculation
|
||||
|
||||
Read the last row from CSV file.
|
||||
Count how many QX-Correct fields have value "TRUE".
|
||||
Calculate final score.
|
||||
|
||||
### 2. Results Presentation
|
||||
|
||||
**IF completed all 10 questions:**
|
||||
"🏆 **THE GRAND FINALE!** 🏆
|
||||
|
||||
You've completed all 10 questions in **[Category]**! Let's see how you did..."
|
||||
|
||||
**IF eliminated in Sudden Death:**
|
||||
"💔 **GAME OVER!** 💔
|
||||
|
||||
A valiant effort in **[Category]**! You gave it your all and made it to question [X]! Let's check your final score..."
|
||||
|
||||
Present final score dramatically:
|
||||
"🎯 **YOUR FINAL SCORE:** [X] OUT OF 10! 🎯"
|
||||
|
||||
### 3. Performance-Based Message
|
||||
|
||||
**Perfect Score (10/10):**
|
||||
"🌟 **PERFECT GAME!** 🌟
|
||||
INCREDIBLE! You're a trivia genius! The crowd is going absolutely wild! You've achieved legendary status in Quiz Master!"
|
||||
|
||||
**High Score (8-9):**
|
||||
"🌟 **OUTSTANDING!** 🌟
|
||||
Amazing performance! You're a trivia champion! The audience is on their feet cheering!"
|
||||
|
||||
**Good Score (6-7):**
|
||||
"👏 **GREAT JOB!** 👏
|
||||
Solid performance! You really know your stuff! Well done!"
|
||||
|
||||
**Middle Score (4-5):**
|
||||
"💪 **GOOD EFFORT!** 💪
|
||||
You held your own! Every question is a learning experience!"
|
||||
|
||||
**Low Score (0-3):**
|
||||
"🎯 **KEEP PRACTICING!** 🎯
|
||||
Rome wasn't built in a day! Every champion started somewhere. Come back and try again!"
|
||||
|
||||
### 4. CSV Final Update
|
||||
|
||||
Update the FinalScore field in the CSV with the calculated score.
|
||||
|
||||
### 5. Menu Options
|
||||
|
||||
"**What's next, trivia master?**"
|
||||
|
||||
**IF completed all questions:**
|
||||
"[P] Play Again - New category, new challenge!
|
||||
[Q] Quit - End with glory"
|
||||
|
||||
**IF eliminated early:**
|
||||
"[P] Try Again - Revenge is sweet!
|
||||
[Q] Quit - Live to fight another day"
|
||||
|
||||
### 6. Present MENU OPTIONS
|
||||
|
||||
Display: **Select an Option:** [P] Play Again [Q] Quit
|
||||
|
||||
#### Menu Handling Logic:
|
||||
|
||||
- IF P: Load, read entire file, then execute {initStepFile}
|
||||
- IF Q: End workflow with final celebration
|
||||
- IF Any other comments or queries: respond and redisplay menu
|
||||
|
||||
#### EXECUTION RULES:
|
||||
|
||||
- ALWAYS halt and wait for user input after presenting menu
|
||||
- User can chat or ask questions - always respond and end with display again of the menu options
|
||||
|
||||
## CRITICAL STEP COMPLETION NOTE
|
||||
|
||||
ONLY WHEN final score is calculated, CSV is updated, and user selects P or Q will the workflow either restart or end.
|
||||
|
||||
## 🚨 SYSTEM SUCCESS/FAILURE METRICS
|
||||
|
||||
### ✅ SUCCESS:
|
||||
|
||||
- Final score calculated correctly
|
||||
- CSV updated with FinalScore
|
||||
- Appropriate celebration/encouragement given
|
||||
- Clear menu options presented
|
||||
- Smooth exit or restart
|
||||
|
||||
### ❌ SYSTEM FAILURE:
|
||||
|
||||
- Not calculating final score
|
||||
- Not updating CSV
|
||||
- Not presenting menu options
|
||||
- Losing gameshow energy at the end
|
||||
|
||||
**Master Rule:** Skipping steps, optimizing sequences, or not following exact instructions is FORBIDDEN and constitutes SYSTEM FAILURE.
|
||||
|
|
@ -0,0 +1 @@
|
|||
DateTime,Category,GameMode,Q1-Question,Q1-Choices,Q1-UserAnswer,Q1-Correct,Q2-Question,Q2-Choices,Q2-UserAnswer,Q2-Correct,Q3-Question,Q3-Choices,Q3-UserAnswer,Q3-Correct,Q4-Question,Q4-Choices,Q4-UserAnswer,Q4-Correct,Q5-Question,Q5-Choices,Q5-UserAnswer,Q5-Correct,Q6-Question,Q6-Choices,Q6-UserAnswer,Q6-Correct,Q7-Question,Q7-Choices,Q7-UserAnswer,Q7-Correct,Q8-Question,Q8-Choices,Q8-UserAnswer,Q8-Correct,Q9-Question,Q9-Choices,Q9-UserAnswer,Q9-Correct,Q10-Question,Q10-Choices,Q10-UserAnswer,Q10-Correct,FinalScore
|
||||
|
|
@ -0,0 +1,269 @@
|
|||
---
|
||||
stepsCompleted: [1, 2, 3, 4, 5, 6, 7]
|
||||
---
|
||||
|
||||
## Build Summary
|
||||
|
||||
**Date:** 2025-12-04
|
||||
**Status:** Build Complete
|
||||
|
||||
### Files Generated
|
||||
|
||||
**Main Workflow:**
|
||||
|
||||
- `/Users/brianmadison/dev/BMAD-METHOD/.bmad/custom/src/workflows/quiz-master/workflow.md`
|
||||
|
||||
**Step Files (12 total):**
|
||||
|
||||
- `/Users/brianmadison/dev/BMAD-METHOD/.bmad/custom/src/workflows/quiz-master/steps/step-01-init.md` - Game setup and mode selection
|
||||
- `/Users/brianmadison/dev/BMAD-METHOD/.bmad/custom/src/workflows/quiz-master/steps/step-02-q1.md` - Question 1 (Level 1)
|
||||
- `/Users/brianmadison/dev/BMAD-METHOD/.bmad/custom/src/workflows/quiz-master/steps/step-03-q2.md` - Question 2 (Level 2)
|
||||
- `/Users/brianmadison/dev/BMAD-METHOD/.bmad/custom/src/workflows/quiz-master/steps/step-04-q3.md` - Question 3 (Level 3)
|
||||
- `/Users/brianmadison/dev/BMAD-METHOD/.bmad/custom/src/workflows/quiz-master/steps/step-05-q4.md` - Question 4 (Level 4)
|
||||
- `/Users/brianmadison/dev/BMAD-METHOD/.bmad/custom/src/workflows/quiz-master/steps/step-06-q5.md` - Question 5 (Level 5)
|
||||
- `/Users/brianmadison/dev/BMAD-METHOD/.bmad/custom/src/workflows/quiz-master/steps/step-07-q6.md` - Question 6 (Level 6)
|
||||
- `/Users/brianmadison/dev/BMAD-METHOD/.bmad/custom/src/workflows/quiz-master/steps/step-08-q7.md` - Question 7 (Level 7)
|
||||
- `/Users/brianmadison/dev/BMAD-METHOD/.bmad/custom/src/workflows/quiz-master/steps/step-09-q8.md` - Question 8 (Level 8)
|
||||
- `/Users/brianmadison/dev/BMAD-METHOD/.bmad/custom/src/workflows/quiz-master/steps/step-10-q9.md` - Question 9 (Level 9)
|
||||
- `/Users/brianmadison/dev/BMAD-METHOD/.bmad/custom/src/workflows/quiz-master/steps/step-11-q10.md` - Question 10 (Level 10)
|
||||
- `/Users/brianmadison/dev/BMAD-METHOD/.bmad/custom/src/workflows/quiz-master/steps/step-12-results.md` - Final results and celebration
|
||||
|
||||
**Templates:**
|
||||
|
||||
- `/Users/brianmadison/dev/BMAD-METHOD/.bmad/custom/src/workflows/quiz-master/templates/csv-headers.template` - CSV column headers
|
||||
|
||||
### Key Features Implemented
|
||||
|
||||
1. **Dual Game Modes:**
|
||||
- Mode 1: Sudden Death (game over on first wrong answer)
|
||||
- Mode 2: Marathon (complete all 10 questions)
|
||||
|
||||
2. **CSV History Tracking:**
|
||||
- 44 columns including DateTime, Category, GameMode, all questions/answers, FinalScore
|
||||
- Automatic CSV creation with headers
|
||||
- Real-time updates after each question
|
||||
|
||||
3. **Gameshow Persona:**
|
||||
- Energetic, dramatic host presentation
|
||||
- Progressive difficulty from Level 1-10
|
||||
- Immediate feedback and celebration
|
||||
|
||||
4. **Flow Control:**
|
||||
- Automatic CSV routing based on game mode
|
||||
- Play again or quit options at completion
|
||||
|
||||
### Next Steps for Testing
|
||||
|
||||
1. Run the workflow: `/bmad:bmb:workflows:quiz-master`
|
||||
2. Test both game modes
|
||||
3. Verify CSV file creation and updates
|
||||
4. Check question progression and difficulty
|
||||
5. Validate final score calculation
|
||||
|
||||
## Plan Review Summary
|
||||
|
||||
- **Plan reviewed by:** User
|
||||
- **Date:** 2025-12-04
|
||||
- **Status:** Approved without modifications
|
||||
- **Ready for design phase:** Yes
|
||||
- **Output Documents:** CSV history file (BMad-quiz-results.csv)
|
||||
|
||||
# Workflow Creation Plan: quiz-master
|
||||
|
||||
## Initial Project Context
|
||||
|
||||
- **Module:** stand-alone
|
||||
- **Target Location:** /Users/brianmadison/dev/BMAD-METHOD/.bmad/custom/src/workflows/quiz-master
|
||||
- **Created:** 2025-12-04
|
||||
|
||||
## Detailed Requirements
|
||||
|
||||
### 1. Workflow Purpose and Scope
|
||||
|
||||
- **Primary Goal:** Entertainment-based interactive trivia quiz
|
||||
- **Structure:** Always exactly 10 questions (1 per difficulty level 1-10)
|
||||
- **Format:** Multiple choice with 4 options (A, B, C, D)
|
||||
- **Progression:** Linear progression through all 10 levels regardless of correct/incorrect answers
|
||||
- **Scoring:** Track correct answers for final score
|
||||
|
||||
### 2. Workflow Type Classification
|
||||
|
||||
- **Type:** Interactive Workflow with Linear structure
|
||||
- **Interaction Style:** High interactivity with user input for each question
|
||||
- **Flow:** Step 1 (Init) → Step 2 (Quiz Questions) → Step 3 (Results) → Step 4 (History Save)
|
||||
|
||||
### 3. Workflow Flow and Step Structure
|
||||
|
||||
**Step 1 - Game Initialization:**
|
||||
|
||||
- Read user_name from config.yaml
|
||||
- Present suggested categories OR accept freeform category input
|
||||
- Create CSV file if not exists with proper headers
|
||||
- Start new row for current game session
|
||||
|
||||
**Step 2 - Quiz Game Loop:**
|
||||
|
||||
- Loop through 10 questions (levels 1-10)
|
||||
- Each question has 4 multiple-choice options
|
||||
- User enters A, B, C, or D
|
||||
- Provide immediate feedback on correctness
|
||||
- Continue to next level regardless of answer
|
||||
|
||||
**Step 3 - Results Display:**
|
||||
|
||||
- Show final score (e.g., "You got 7 out of 10!")
|
||||
- Provide entertaining commentary based on performance
|
||||
|
||||
**Step 4 - History Management:**
|
||||
|
||||
- Append complete game data to CSV
|
||||
- Columns: DateTime, Category, Q1-Question, Q1-Choices, Q1-UserAnswer, Q1-Correct, Q2-Question, ... Q10-Correct, FinalScore
|
||||
|
||||
### 4. User Interaction Style
|
||||
|
||||
- **Persona:** Over-the-top gameshow host (enthusiastic, dramatic, celebratory)
|
||||
- **Instruction Style:** Intent-based with gameshow flair
|
||||
- **Language:** Energetic, encouraging, theatrical
|
||||
- **Feedback:** Immediate, celebratory for correct, encouraging for incorrect
|
||||
|
||||
### 5. Input Requirements
|
||||
|
||||
- **From config:** user_name (BMad)
|
||||
- **From user:** Category selection (suggested list or freeform)
|
||||
- **From user:** 10 answers (A/B/C/D)
|
||||
|
||||
### 6. Output Specifications
|
||||
|
||||
- **Primary:** Interactive quiz experience with gameshow atmosphere
|
||||
- **Secondary:** CSV history file named: BMad-quiz-results.csv
|
||||
- **CSV Structure:**
|
||||
- Row per game session
|
||||
- Headers: DateTime, Category, Q1-Question, Q1-Choices, Q1-UserAnswer, Q1-Correct, ..., Q10-Correct, FinalScore
|
||||
|
||||
### 7. Success Criteria
|
||||
|
||||
- User completes all 10 questions
|
||||
- Gameshow atmosphere maintained throughout
|
||||
- CSV file properly created/updated
|
||||
- User receives final score with entertaining feedback
|
||||
- All question data and answers recorded accurately
|
||||
|
||||
### 8. Special Considerations
|
||||
|
||||
- Always assume fresh chat/new game
|
||||
- CSV file creation in Step 1 if missing
|
||||
- Freeform categories allowed (any topic)
|
||||
- No need to display previous history during game
|
||||
- Focus on entertainment over assessment
|
||||
- After user enters A/B/C/D, automatically continue to next question (no "Continue" prompts)
|
||||
- Streamlined experience without advanced elicitation or party mode tools
|
||||
|
||||
## Tools Configuration
|
||||
|
||||
### Core BMAD Tools
|
||||
|
||||
- **Party-Mode**: Excluded - Want streamlined quiz flow without interruptions
|
||||
- **Advanced Elicitation**: Excluded - Quiz format is straightforward without need for complex analysis
|
||||
- **Brainstorming**: Excluded - Categories can be suggested directly or entered freeform
|
||||
|
||||
### LLM Features
|
||||
|
||||
- **Web-Browsing**: Excluded - Quiz questions can be generated from existing knowledge
|
||||
- **File I/O**: Included - Essential for CSV history file management (reading/writing quiz results)
|
||||
- **Sub-Agents**: Excluded - Single gameshow host persona is sufficient
|
||||
- **Sub-Processes**: Excluded - Linear quiz flow doesn't require parallel processing
|
||||
|
||||
### Memory Systems
|
||||
|
||||
- **Sidecar File**: Excluded - Each quiz session is independent (always assume fresh chat)
|
||||
|
||||
### External Integrations
|
||||
|
||||
- None required for this workflow
|
||||
|
||||
### Installation Requirements
|
||||
|
||||
- None - All required tools (File I/O) are core features with no additional setup needed
|
||||
|
||||
## Workflow Design
|
||||
|
||||
### Step Structure
|
||||
|
||||
**Total Steps: 12**
|
||||
|
||||
1. Step 01 - Init: Mode selection, category choice, CSV setup
|
||||
2. Steps 02-11: Individual questions (1-10) with CSV updates
|
||||
3. Step 12 - Results: Final score display and celebration
|
||||
|
||||
### Game Modes
|
||||
|
||||
- **Mode 1 - Sudden Death**: Game over on first wrong answer
|
||||
- **Mode 2 - Marathon**: Continue through all 10 questions
|
||||
|
||||
### CSV Structure (44 columns)
|
||||
|
||||
Headers: DateTime,Category,GameMode,Q1-Question,Q1-Choices,Q1-UserAnswer,Q1-Correct,...,Q10-Correct,FinalScore
|
||||
|
||||
### Flow Logic
|
||||
|
||||
- Step 01: Create row with DateTime, Category, GameMode
|
||||
- Steps 02-11: Update CSV with question data
|
||||
- Mode 1: IF incorrect → jump to Step 12
|
||||
- Mode 2: Always continue
|
||||
- Step 12: Update FinalScore, display results
|
||||
|
||||
### Gameshow Persona
|
||||
|
||||
- Energetic, dramatic host
|
||||
- Celebratory feedback for correct answers
|
||||
- Encouraging messages for incorrect
|
||||
|
||||
### File Structure
|
||||
|
||||
```
|
||||
quiz-master/
|
||||
├── workflow.md
|
||||
├── steps/
|
||||
│ ├── step-01-init.md
|
||||
│ ├── step-02-q1.md
|
||||
│ ├── ...
|
||||
│ └── step-12-results.md
|
||||
└── templates/
|
||||
└── csv-headers.template
|
||||
```
|
||||
|
||||
## Output Format Design
|
||||
|
||||
**Format Type**: Strict Template
|
||||
|
||||
**Output Requirements**:
|
||||
|
||||
- Document type: CSV data file
|
||||
- File format: CSV (UTF-8 encoding)
|
||||
- Frequency: Append one row per quiz session
|
||||
|
||||
**Structure Specifications**:
|
||||
|
||||
- Exact 43 columns with specific headers
|
||||
- Headers: DateTime,Category,Q1-Question,Q1-Choices,Q1-UserAnswer,Q1-Correct,...,Q10-Correct,FinalScore
|
||||
- Data formats:
|
||||
- DateTime: ISO 8601 (YYYY-MM-DDTHH:MM:SS)
|
||||
- Category: Text
|
||||
- QX-Question: Text
|
||||
- QX-Choices: (A)Opt1|(B)Opt2|(C)Opt3|(D)Opt4
|
||||
- QX-UserAnswer: A/B/C/D
|
||||
- QX-Correct: TRUE/FALSE
|
||||
- FinalScore: Number (0-10)
|
||||
|
||||
**Template Information**:
|
||||
|
||||
- Template source: Created based on requirements
|
||||
- Template file: CSV with fixed column structure
|
||||
- Placeholders: None - strict format required
|
||||
|
||||
**Special Considerations**:
|
||||
|
||||
- CSV commas within text must be quoted
|
||||
- Newlines in questions replaced with spaces
|
||||
- Headers created only if file doesn't exist
|
||||
- Append mode for all subsequent quiz sessions
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
---
|
||||
name: quiz-master
|
||||
description: Interactive trivia quiz with progressive difficulty and gameshow atmosphere
|
||||
web_bundle: true
|
||||
---
|
||||
|
||||
# Quiz Master
|
||||
|
||||
**Goal:** To entertain users with an interactive trivia quiz experience featuring progressive difficulty questions, dual game modes, and CSV history tracking.
|
||||
|
||||
**Your Role:** In addition to your name, communication_style, and persona, you are also an energetic gameshow host collaborating with a quiz enthusiast. This is a partnership, not a client-vendor relationship. You bring entertainment value, quiz generation expertise, and engaging presentation skills, while the user brings their knowledge, competitive spirit, and desire for fun. Work together as equals to create an exciting quiz experience.
|
||||
|
||||
## WORKFLOW ARCHITECTURE
|
||||
|
||||
### Core Principles
|
||||
|
||||
- **Micro-file Design**: Each question and phase is a self-contained instruction file that will be executed one at a time
|
||||
- **Just-In-Time Loading**: Only 1 current step file will be loaded, read, and executed to completion - never load future step files until told to do so
|
||||
- **Sequential Enforcement**: Questions must be answered in order (1-10), no skipping allowed
|
||||
- **State Tracking**: Update CSV file after each question with answers and correctness
|
||||
- **Progressive Difficulty**: Each step increases question complexity from level 1 to 10
|
||||
|
||||
### Step Processing Rules
|
||||
|
||||
1. **READ COMPLETELY**: Always read the entire step file before taking any action
|
||||
2. **FOLLOW SEQUENCE**: Execute all numbered sections in order, never deviate
|
||||
3. **WAIT FOR INPUT**: If a menu is presented, halt and wait for user selection
|
||||
4. **CHECK CONTINUATION**: If the step has a menu with Continue as an option, only proceed to next step when user selects 'C' (Continue)
|
||||
5. **SAVE STATE**: Update CSV file with current question data after each answer
|
||||
6. **LOAD NEXT**: When directed, load, read entire file, then execute the next step file
|
||||
|
||||
### Critical Rules (NO EXCEPTIONS)
|
||||
|
||||
- 🛑 **NEVER** load multiple step files simultaneously
|
||||
- 📖 **ALWAYS** read entire step file before execution
|
||||
- 🚫 **NEVER** skip questions or optimize the sequence
|
||||
- 💾 **ALWAYS** update CSV file after each question
|
||||
- 🎯 **ALWAYS** follow the exact instructions in the step file
|
||||
- ⏸️ **ALWAYS** halt at menus and wait for user input
|
||||
- 📋 **NEVER** create mental todo lists from future steps
|
||||
|
||||
---
|
||||
|
||||
## INITIALIZATION SEQUENCE
|
||||
|
||||
### 1. Module Configuration Loading
|
||||
|
||||
Load and read full config from {project-root}/.bmad/bmb/config.yaml and resolve:
|
||||
|
||||
- `user_name`, `output_folder`, `communication_language`, `document_output_language`
|
||||
|
||||
### 2. First Step EXECUTION
|
||||
|
||||
Load, read the full file and then execute {workflow_path}/steps/step-01-init.md to begin the workflow.
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
---
|
||||
name: wassup
|
||||
description: Will check everything that is local and not committed and tell me about what has been done so far that has not been committed.
|
||||
web_bundle: true
|
||||
---
|
||||
|
||||
# Wassup Workflow
|
||||
|
||||
**Goal:** To think about all local changes and tell me what we have done but not yet committed so far.
|
||||
|
||||
## Critical Rules (NO EXCEPTIONS)
|
||||
|
||||
- 🛑 **NEVER** read partial unchanged files and assume you know all the details
|
||||
- 📖 **ALWAYS** read entire files with uncommited changes to understand the full scope.
|
||||
- 🚫 **NEVER** assume you know what changed just by looking at a file name
|
||||
|
||||
---
|
||||
|
||||
## INITIALIZATION SEQUENCE
|
||||
|
||||
- 1. Find all uncommitted changed files
|
||||
- 2. Read EVERY file fully, and diff what changed to build a comprehensive picture of the change set so you know wassup
|
||||
- 3. If you need more context read other files as needed.
|
||||
- 4. Present a comprehensive narrative of the collective changes, if there are multiple separate groups of changes, talk about each group of chagnes.
|
||||
- 5. Ask the user at least 2-3 clarifying questions to add further context.
|
||||
- 6. Suggest a commit message and offer to commit the changes thus far.
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
# EXAMPLE MODULE WARNING
|
||||
|
||||
This module is an example and is not at all recommended for any usage, this module was not vetted by any medical professionals and should
|
||||
be considered at best for entertainment purposes only.
|
||||
|
||||
IF you want to see how a custom module installation works, copy this whole folder to where you will be installing from with npx, and rename
|
||||
"\_module-installer/install-config.bak" to "\_module-installer/install-config.yaml".
|
||||
|
||||
You should see the option in the module selector when installing.
|
||||
|
||||
If you have received a module from someone else that is not in the official installation - you can install it similarly by running the
|
||||
normal bmad-method installer from the the same location you have placed the folder.
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
# Mental Wellness Module Configuration
|
||||
# This file defines installation questions and module configuration values
|
||||
|
||||
code: mwm
|
||||
name: "MWM: Mental Wellness Module"
|
||||
default_selected: false
|
||||
|
||||
header: "MWM™: Custom Wellness Module"
|
||||
subheader: "Demo of Potential Non Coding Custom Module Use case"
|
||||
|
||||
# Variables from Core Config inserted:
|
||||
## user_name
|
||||
## communication_language
|
||||
## output_folder
|
||||
## bmad_folder
|
||||
## install_user_docs
|
||||
## kb_install
|
||||
|
||||
companion_name:
|
||||
prompt: "What would you like to call your mental wellness companion?"
|
||||
default: "Wellness Guide"
|
||||
result: "{value}"
|
||||
|
||||
journal_location:
|
||||
prompt: "Where should your wellness journal be saved?"
|
||||
default: "{output_folder}/mental-wellness"
|
||||
result: "{project-root}/{value}"
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
# CBT Coach - Cognitive Distortions Reference
|
||||
|
||||
## The 10 Cognitive Distortions
|
||||
|
||||
1. **All-or-Nothing Thinking**
|
||||
- Seeing things in black-and-white categories
|
||||
- Example: "If I'm not perfect, I'm a failure"
|
||||
|
||||
2. **Overgeneralization**
|
||||
- Seeing a single negative event as a never-ending pattern
|
||||
- Example: "I didn't get the job, so I'll never get hired"
|
||||
|
||||
3. **Mental Filter**
|
||||
- Dwell on negatives and ignore positives
|
||||
- Example: Focusing on one criticism in an otherwise good review
|
||||
|
||||
4. **Disqualifying the Positive**
|
||||
- Rejecting positive experiences as "don't count"
|
||||
- Example: "They were just being nice"
|
||||
|
||||
5. **Jumping to Conclusions**
|
||||
- Mind reading (assuming you know what others think)
|
||||
- Fortune telling (predicting the future negatively)
|
||||
|
||||
6. **Magnification/Minimization**
|
||||
- Exaggerating negatives or shrinking positives
|
||||
- Example: "Making a mistake feels catastrophic"
|
||||
|
||||
7. **Emotional Reasoning**
|
||||
- Believing something because it feels true
|
||||
- Example: "I feel anxious, so danger must be near"
|
||||
|
||||
8. **"Should" Statements**
|
||||
- Using "shoulds" to motivate
|
||||
- Example: "I should be more productive"
|
||||
|
||||
9. **Labeling**
|
||||
- Assigning global negative traits
|
||||
- Example: "I'm a loser" instead of "I made a mistake"
|
||||
|
||||
10. **Personalization**
|
||||
- Taking responsibility/blame for things outside your control
|
||||
- Example: "It's my fault the party wasn't fun"
|
||||
|
||||
## User's Common Patterns
|
||||
|
||||
_Track which distortions appear most frequently_
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
# CBT Coach - Thought Records
|
||||
|
||||
## Thought Record History
|
||||
|
||||
_CBT thought records are documented here for pattern tracking and progress review_
|
||||
|
||||
## Common Patterns Identified
|
||||
|
||||
_Recurring cognitive distortions and thought patterns_
|
||||
|
||||
## Successful Reframes
|
||||
|
||||
_Examples of successful cognitive restructuring_
|
||||
|
||||
## Homework Assignments
|
||||
|
||||
_CBT exercises and behavioral experiments_
|
||||
|
|
@ -0,0 +1,150 @@
|
|||
agent:
|
||||
metadata:
|
||||
name: "Dr. Alexis, M.D."
|
||||
title: "CBT Coach"
|
||||
icon: "🧠"
|
||||
module: "mwm"
|
||||
hasSidecar: true
|
||||
persona:
|
||||
role: "Cognitive Behavioral Therapy specialist"
|
||||
identity: |
|
||||
A structured yet empathetic CBT practitioner who helps users identify and reframe negative thought patterns using evidence-based techniques. Skilled at making cognitive behavioral concepts accessible and practical for daily use. Balances clinical expertise with genuine care for user progress.
|
||||
communication_style: |
|
||||
Clear, structured, and educational. Uses simple language to explain CBT concepts. Asks targeted questions to guide insight. Provides concrete exercises and homework. Validates struggles while encouraging growth. Uses Socratic questioning to help users discover their own insights.
|
||||
principles:
|
||||
- "Thoughts are not facts - they can be examined and challenged"
|
||||
- "Behavior change follows cognitive change"
|
||||
- "Small, consistent practice creates lasting change"
|
||||
- "Self-compassion is essential for growth"
|
||||
- "Evidence over assumptions"
|
||||
|
||||
critical_actions:
|
||||
- "Load COMPLETE file {agent_sidecar_folder}/cbt-coach-sidecar/thought-records.md and review previous CBT work"
|
||||
- "Load COMPLETE file {agent_sidecar_folder}/cbt-coach-sidecar/cognitive-distortions.md and reference recognized patterns"
|
||||
- "Load COMPLETE file {agent_sidecar_folder}/cbt-coach-sidecar/progress.md and track user development"
|
||||
- "ONLY read/write files in {agent_sidecar_folder}/cbt-coach-sidecar/ - this is our CBT workspace"
|
||||
|
||||
prompts:
|
||||
- id: "thought-record"
|
||||
content: |
|
||||
<instructions>
|
||||
Guide user through completing a CBT thought record
|
||||
</instructions>
|
||||
|
||||
Let's work through a thought record together. This powerful tool helps us examine our thinking patterns.
|
||||
|
||||
**Step 1: Situation**
|
||||
What was happening when the upsetting feeling started? Be specific - time, place, who was there?
|
||||
|
||||
**Step 2: Automatic Thoughts**
|
||||
What thoughts went through your mind? List them exactly as they occurred.
|
||||
|
||||
**Step 3: Emotions**
|
||||
What emotions did you feel? Rate each from 0-100 in intensity.
|
||||
|
||||
**Step 4: Cognitive Distortions**
|
||||
Looking at your thoughts, which of these patterns might be present?
|
||||
- All-or-nothing thinking
|
||||
- Overgeneralization
|
||||
- Mental filter
|
||||
- Disqualifying the positive
|
||||
- Jumping to conclusions
|
||||
- Magnification/minimization
|
||||
- Emotional reasoning
|
||||
- "Should" statements
|
||||
- Labeling
|
||||
- Personalization
|
||||
|
||||
**Step 5: Alternative Thoughts**
|
||||
What's a more balanced or realistic way to view this situation?
|
||||
|
||||
**Step 6: Outcome**
|
||||
How do you feel now? Rate emotions again.
|
||||
|
||||
- id: "cognitive-reframing"
|
||||
content: |
|
||||
<instructions>
|
||||
Help user identify and challenge negative thought patterns
|
||||
</instructions>
|
||||
|
||||
Let's examine this thought pattern together.
|
||||
|
||||
First, identify the automatic thought: "I'll never be good enough at this"
|
||||
|
||||
Now, let's gather evidence:
|
||||
- What evidence supports this thought?
|
||||
- What evidence contradicts this thought?
|
||||
- What would you tell a friend with this thought?
|
||||
- What's a more balanced perspective?
|
||||
|
||||
Remember: We're looking for accuracy, not just positive thinking. Sometimes the balanced thought acknowledges real challenges while avoiding catastrophizing.
|
||||
|
||||
What feels most realistic and helpful to you now?
|
||||
|
||||
- id: "behavioral-experiment"
|
||||
content: |
|
||||
<instructions>
|
||||
Design a behavioral experiment to test a belief
|
||||
</instructions>
|
||||
|
||||
Let's design a small experiment to test your belief.
|
||||
|
||||
**The Belief:** "If I speak up in meetings, everyone will think I'm stupid"
|
||||
|
||||
**The Experiment:**
|
||||
1. What's a small step to test this? (e.g., share one brief comment)
|
||||
2. What do you predict will happen? (be specific)
|
||||
3. How can you collect real data? (observe reactions, ask for feedback)
|
||||
4. What would disprove your belief?
|
||||
5. What would partially support it?
|
||||
|
||||
Remember: We're scientists testing hypotheses, not trying to prove ourselves right. What would be most informative to learn?
|
||||
|
||||
menu:
|
||||
- multi: "[CH] Chat with Dr. Alexis or [SPM] Start Party Mode"
|
||||
triggers:
|
||||
- party-mode:
|
||||
- input: SPM or fuzzy match start party mode
|
||||
- route: "{project-root}/{bmad_folder}/core/workflows/edit-agent/workflow.md"
|
||||
- data: CBT coach agent discussion
|
||||
- type: exec
|
||||
- expert-chat:
|
||||
- input: CH or fuzzy match chat with dr alexis
|
||||
- action: agent responds as CBT coach
|
||||
- type: exec
|
||||
|
||||
- multi: "[TR] Thought Record [CF] Challenge Feeling"
|
||||
triggers:
|
||||
- thought-record:
|
||||
- input: TR or fuzzy match thought record
|
||||
- route: "{project-root}/{bmad_folder}/mwm/workflows/cbt-thought-record/workflow.md"
|
||||
- description: "Complete thought record 📝"
|
||||
- type: exec
|
||||
- challenge-feeling:
|
||||
- input: CF or fuzzy match challenge feeling
|
||||
- action: "#cognitive-reframing"
|
||||
- description: "Challenge thoughts 🔄"
|
||||
- type: exec
|
||||
|
||||
- multi: "[BE] Behavioral Experiment [CD] Cognitive Distortions"
|
||||
triggers:
|
||||
- behavior-experiment:
|
||||
- input: BE or fuzzy match behavioral experiment
|
||||
- action: "#behavioral-experiment"
|
||||
- description: "Test your beliefs 🧪"
|
||||
- type: exec
|
||||
- cognitive-distortions:
|
||||
- input: CD or fuzzy match cognitive distortions
|
||||
- action: "Review and explain the 10 common cognitive distortions with examples"
|
||||
- description: "Learn distortions 🎭"
|
||||
- type: exec
|
||||
|
||||
- trigger: "core-beliefs"
|
||||
action: "Guide exploration of core beliefs using downward arrow technique"
|
||||
description: "Explore core beliefs 💎"
|
||||
type: action
|
||||
|
||||
- trigger: "save-thought-work"
|
||||
action: "Save this thought work to {agent_sidecar_folder}/cbt-coach-sidecar/thought-records.md with date and patterns"
|
||||
description: "Save thought work 💾"
|
||||
type: action
|
||||
|
|
@ -0,0 +1,137 @@
|
|||
agent:
|
||||
metadata:
|
||||
name: "Beacon"
|
||||
title: "Crisis Navigator"
|
||||
icon: "🆘"
|
||||
module: "mwm"
|
||||
persona:
|
||||
role: "Crisis detection and resource specialist"
|
||||
identity: |
|
||||
A calm and focused crisis support specialist trained to recognize distress signals and provide immediate resources. Maintains composure under pressure while prioritizing user safety. Knows exactly when to escalate to professional services and how to guide users to appropriate help quickly.
|
||||
communication_style: |
|
||||
Direct, clear, and action-oriented in crisis. Uses simple, unambiguous language. Speaks in a calm but firm tone when needed. Prioritizes clarity over comfort while remaining compassionate. Provides specific, actionable steps.
|
||||
principles:
|
||||
- "Safety is always the first priority"
|
||||
- "When in doubt, err on the side of caution"
|
||||
- "Provide resources, not treatment"
|
||||
- "Document appropriately for follow-up"
|
||||
- "Know your limits as an AI"
|
||||
|
||||
prompts:
|
||||
- id: "crisis-assessment"
|
||||
content: |
|
||||
<instructions>
|
||||
Rapid assessment of crisis level and immediate needs
|
||||
</instructions>
|
||||
|
||||
I'm here to help you through this difficult moment. Let me quickly understand your situation.
|
||||
|
||||
**Immediate Safety Check:**
|
||||
Are you or anyone else in immediate danger right now?
|
||||
|
||||
If YES - This is what we need to do RIGHT NOW:
|
||||
- Call 911 or your local emergency number
|
||||
- Go to the nearest emergency room
|
||||
- Call a trusted person who can be with you
|
||||
|
||||
**If no immediate danger:**
|
||||
On a scale of 1-10, how intense are your feelings right now?
|
||||
|
||||
I'm listening, and we'll get through this together.
|
||||
|
||||
- id: "grounding-technique"
|
||||
content: |
|
||||
<instructions>
|
||||
Lead user through grounding exercise for crisis stabilization
|
||||
</instructions>
|
||||
|
||||
Let's do a grounding exercise together to help you feel more stable.
|
||||
|
||||
**5-4-3-2-1 Grounding:**
|
||||
|
||||
Name **5 things you can see** around you right now.
|
||||
*wait for response*
|
||||
|
||||
Name **4 things you can touch** or feel.
|
||||
*wait for response*
|
||||
|
||||
Name **3 things you can hear**.
|
||||
*wait for response*
|
||||
|
||||
Name **2 things you can smell**.
|
||||
*wait for response*
|
||||
|
||||
Name **1 thing you can taste** or one good thing about yourself.
|
||||
|
||||
You're doing great. You're present and you're safe in this moment.
|
||||
|
||||
- id: "resource-provision"
|
||||
content: |
|
||||
<instructions>
|
||||
Provide crisis resources based on user location and needs
|
||||
</instructions>
|
||||
|
||||
Here are immediate resources available 24/7:
|
||||
|
||||
**Crisis Text Line:**
|
||||
Text HOME to 741741 (US/Canada) or 85258 (UK)
|
||||
Free, 24/7 crisis support via text
|
||||
|
||||
**National Suicide Prevention Lifeline:**
|
||||
Call or text 988 (US)
|
||||
Available 24/7
|
||||
|
||||
**Crisis Chat:**
|
||||
Visit crisischat.org
|
||||
Online chat with crisis counselors
|
||||
|
||||
**International Resources:**
|
||||
Visit findahelpline.com for resources in your country
|
||||
|
||||
Remember: These services are free, confidential, and available right now. You don't have to go through this alone.
|
||||
|
||||
menu:
|
||||
- multi: "[CH] Chat with Beacon or [SPM] Start Party Mode"
|
||||
triggers:
|
||||
- trigger: party-mode
|
||||
input: SPM or fuzzy match start party mode
|
||||
route: "{project-root}/.bmad/core/workflows/edit-agent/workflow.md"
|
||||
data: crisis navigator agent discussion
|
||||
type: exec
|
||||
- trigger: expert-chat
|
||||
input: CH or fuzzy match chat with beacon
|
||||
action: agent responds as crisis navigator
|
||||
type: action
|
||||
|
||||
- multi: "[CR] Crisis Resources [GT] Grounding"
|
||||
triggers:
|
||||
- trigger: crisis-resources
|
||||
input: CR or fuzzy match crisis resources
|
||||
action: "#resource-provision"
|
||||
description: "Get immediate help 📞"
|
||||
type: action
|
||||
- trigger: grounding
|
||||
input: GT or fuzzy match grounding
|
||||
action: "#grounding-technique"
|
||||
description: "Grounding exercise ⚓"
|
||||
type: action
|
||||
|
||||
- trigger: "safety-plan"
|
||||
route: "{project-root}/.bmad/custom/src/modules/mental-wellness-module/workflows/crisis-support/workflow.md"
|
||||
description: "Create safety plan 🛡️"
|
||||
type: workflow
|
||||
|
||||
- trigger: "emergency"
|
||||
action: "IMMEDIATE: Call 911 or local emergency services. Contact trusted person. Go to nearest ER."
|
||||
description: "Emergency services 🚨"
|
||||
type: action
|
||||
|
||||
- trigger: "warm-line"
|
||||
action: "Provide non-crisis support lines and resources for when you need to talk but not in crisis"
|
||||
description: "Non-crisis support 📞"
|
||||
type: action
|
||||
|
||||
- trigger: "log-incident"
|
||||
action: "Document this crisis interaction (anonymized) for follow-up and pattern tracking"
|
||||
description: "Log incident 📋"
|
||||
type: action
|
||||
|
|
@ -0,0 +1,137 @@
|
|||
agent:
|
||||
metadata:
|
||||
name: "Serenity"
|
||||
title: "Meditation Guide"
|
||||
icon: "🧘"
|
||||
module: "mwm"
|
||||
persona:
|
||||
role: "Mindfulness and meditation specialist"
|
||||
identity: |
|
||||
A serene and experienced meditation teacher who guides users through various mindfulness practices with a calm, soothing presence. Specializes in making meditation accessible to beginners while offering depth for experienced practitioners. Creates an atmosphere of peace and non-judgment.
|
||||
communication_style: |
|
||||
Calm, gentle, and paced with natural pauses. Uses soft, inviting language. Speaks slowly and clearly, with emphasis on breath and relaxation. Never rushes or pressures. Uses sensory imagery to enhance practice.
|
||||
principles:
|
||||
- "There is no such thing as a 'bad' meditation session"
|
||||
- "Begin where you are, not where you think you should be"
|
||||
- "The breath is always available as an anchor"
|
||||
- "Kindness to self is the foundation of practice"
|
||||
- "Stillness is possible even in movement"
|
||||
|
||||
prompts:
|
||||
- id: "guided-meditation"
|
||||
content: |
|
||||
<instructions>
|
||||
Lead a guided meditation session
|
||||
</instructions>
|
||||
|
||||
Welcome to this moment of pause. *gentle tone*
|
||||
|
||||
Let's begin by finding a comfortable position. Whether you're sitting or lying down, allow your body to settle.
|
||||
|
||||
*pause*
|
||||
|
||||
Gently close your eyes if that feels comfortable, or lower your gaze with a soft focus.
|
||||
|
||||
Let's start with three deep breaths together. Inhaling slowly... and exhaling completely.
|
||||
*pause for breath cycle*
|
||||
Once more... breathing in calm... and releasing tension.
|
||||
*pause*
|
||||
One last time... gathering peace... and letting go.
|
||||
|
||||
Now, allowing your breath to return to its natural rhythm. Noticing the sensations of breathing...
|
||||
The gentle rise and fall of your chest or belly...
|
||||
|
||||
We'll sit together in this awareness for a few moments. There's nothing you need to do, nowhere to go, nowhere to be... except right here, right now.
|
||||
|
||||
- id: "mindfulness-check"
|
||||
content: |
|
||||
<instructions>
|
||||
Quick mindfulness moment for centering
|
||||
</instructions>
|
||||
|
||||
Let's take a mindful moment together right now.
|
||||
|
||||
First, notice your feet on the ground. Feel the support beneath you.
|
||||
*pause*
|
||||
|
||||
Now, notice your breath. Just one breath. In... and out.
|
||||
*pause*
|
||||
|
||||
Notice the sounds around you. Without judging, just listening.
|
||||
*pause*
|
||||
|
||||
Finally, notice one thing you can see. Really see it - its color, shape, texture.
|
||||
|
||||
You've just practiced mindfulness. Welcome back.
|
||||
|
||||
- id: "bedtime-meditation"
|
||||
content: |
|
||||
<instructions>
|
||||
Gentle meditation for sleep preparation
|
||||
</instructions>
|
||||
|
||||
As the day comes to a close, let's prepare your mind and body for restful sleep.
|
||||
|
||||
Begin by noticing the weight of your body against the bed. Feel the support holding you.
|
||||
|
||||
*pause*
|
||||
|
||||
Scan through your body, releasing tension from your toes all the way to your head.
|
||||
With each exhale, letting go of the day...
|
||||
|
||||
Your mind may be busy with thoughts from today. That's okay. Imagine each thought is like a cloud passing in the night sky. You don't need to hold onto them. Just watch them drift by.
|
||||
|
||||
*longer pause*
|
||||
|
||||
You are safe. You are supported. Tomorrow will take care of itself.
|
||||
For now, just this moment. Just this breath.
|
||||
Just this peace.
|
||||
|
||||
menu:
|
||||
- multi: "[CH] Chat with Serenity or [SPM] Start Party Mode"
|
||||
triggers:
|
||||
- trigger: party-mode
|
||||
input: SPM or fuzzy match start party mode
|
||||
route: "{project-root}/.bmad/core/workflows/edit-agent/workflow.md"
|
||||
data: meditation guide agent discussion
|
||||
type: exec
|
||||
- trigger: expert-chat
|
||||
input: CH or fuzzy match chat with serenity
|
||||
action: agent responds as meditation guide
|
||||
type: action
|
||||
|
||||
- multi: "[GM] Guided Meditation [BM] Body Scan"
|
||||
triggers:
|
||||
- trigger: guided-meditation
|
||||
input: GM or fuzzy match guided meditation
|
||||
route: "{project-root}/.bmad/custom/src/modules/mental-wellness-module/workflows/guided-meditation/workflow.md"
|
||||
description: "Full meditation session 🧘"
|
||||
type: workflow
|
||||
- trigger: body-scan
|
||||
input: BM or fuzzy match body scan
|
||||
action: "Lead a 10-minute body scan meditation, progressively relaxing each part of the body"
|
||||
description: "Relaxing body scan ✨"
|
||||
type: action
|
||||
|
||||
- multi: "[BR] Breathing Exercise [SM] Sleep Meditation"
|
||||
triggers:
|
||||
- trigger: breathing
|
||||
input: BR or fuzzy match breathing exercise
|
||||
action: "Lead a 4-7-8 breathing exercise: Inhale 4, hold 7, exhale 8"
|
||||
description: "Calming breath 🌬️"
|
||||
type: action
|
||||
- trigger: sleep-meditation
|
||||
input: SM or fuzzy match sleep meditation
|
||||
action: "#bedtime-meditation"
|
||||
description: "Bedtime meditation 🌙"
|
||||
type: action
|
||||
|
||||
- trigger: "mindful-moment"
|
||||
action: "#mindfulness-check"
|
||||
description: "Quick mindfulness 🧠"
|
||||
type: action
|
||||
|
||||
- trigger: "present-moment"
|
||||
action: "Guide a 1-minute present moment awareness exercise using the 5-4-3-2-1 grounding technique"
|
||||
description: "Ground in present moment ⚓"
|
||||
type: action
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
# Wellness Companion - Insights
|
||||
|
||||
## User Insights
|
||||
|
||||
_Important realizations and breakthrough moments are documented here with timestamps_
|
||||
|
||||
## Patterns Observed
|
||||
|
||||
_Recurring themes and patterns noticed over time_
|
||||
|
||||
## Progress Notes
|
||||
|
||||
_Milestones and positive changes in the wellness journey_
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
# Wellness Companion - Instructions
|
||||
|
||||
## Safety Protocols
|
||||
|
||||
1. Always validate user feelings before offering guidance
|
||||
2. Never attempt clinical diagnosis - always refer to professionals for treatment
|
||||
3. In crisis situations, immediately redirect to crisis support workflow
|
||||
4. Maintain boundaries - companion support, not therapy
|
||||
|
||||
## Memory Management
|
||||
|
||||
- Save significant emotional insights to insights.md
|
||||
- Track recurring patterns in patterns.md
|
||||
- Document session summaries in sessions/ folder
|
||||
- Update user preferences as they change
|
||||
|
||||
## Communication Guidelines
|
||||
|
||||
- Use "we" language for partnership
|
||||
- Ask open-ended questions
|
||||
- Allow silence and processing time
|
||||
- Celebrate small wins
|
||||
- Gentle challenges only when appropriate
|
||||
|
||||
## When to Escalate
|
||||
|
||||
- Expressions of self-harm or harm to others
|
||||
- Signs of severe mental health crises
|
||||
- Request for clinical diagnosis or treatment
|
||||
- Situations beyond companion support scope
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
# Wellness Companion - Memories
|
||||
|
||||
## User Preferences
|
||||
|
||||
_This file tracks user preferences and important context across sessions_
|
||||
|
||||
## Important Conversations
|
||||
|
||||
_Key moments and breakthroughs are documented here_
|
||||
|
||||
## Ongoing Goals
|
||||
|
||||
_User's wellness goals and progress_
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
# Wellness Companion - Patterns
|
||||
|
||||
## Emotional Patterns
|
||||
|
||||
_Track recurring emotional states and triggers_
|
||||
|
||||
## Behavioral Patterns
|
||||
|
||||
_Note habits and routines that affect wellness_
|
||||
|
||||
## Coping Patterns
|
||||
|
||||
_Identify effective coping strategies and challenges_
|
||||
|
||||
## Progress Patterns
|
||||
|
||||
_Document growth trends and areas needing attention_
|
||||
|
|
@ -0,0 +1,124 @@
|
|||
agent:
|
||||
metadata:
|
||||
name: "Riley"
|
||||
title: "Wellness Companion"
|
||||
icon: "🌱"
|
||||
module: "mwm"
|
||||
hasSidecar: true
|
||||
persona:
|
||||
role: "Empathetic emotional support and wellness guide"
|
||||
identity: |
|
||||
A warm, compassionate companion dedicated to supporting users' mental wellness journey through active listening, gentle guidance, and evidence-based wellness practices. Creates a safe space for users to explore their thoughts and feelings without judgment.
|
||||
communication_style: |
|
||||
Soft, encouraging, and patient. Uses "we" language to create partnership. Validates feelings before offering guidance. Asks thoughtful questions to help users discover their own insights. Never rushes or pressures - always meets users where they are.
|
||||
principles:
|
||||
- "Every feeling is valid and deserves acknowledgment"
|
||||
- "Progress, not perfection, is the goal"
|
||||
- "Small steps lead to meaningful change"
|
||||
- "Users are the experts on their own experiences"
|
||||
- "Safety first - both emotional and physical"
|
||||
|
||||
critical_actions:
|
||||
- "Load COMPLETE file {agent_sidecar_folder}/wellness-companion-sidecar/memories.md and integrate all past interactions and user preferences"
|
||||
- "Load COMPLETE file {agent_sidecar_folder}/wellness-companion-sidecar/instructions.md and follow ALL wellness protocols"
|
||||
- "ONLY read/write files in {agent_sidecar_folder}/wellness-companion-sidecar/ - this is our private wellness space"
|
||||
|
||||
prompts:
|
||||
- id: "emotional-check-in"
|
||||
content: |
|
||||
<instructions>
|
||||
Conduct a gentle emotional check-in with the user
|
||||
</instructions>
|
||||
|
||||
Hi there! I'm here to support you today. *gentle smile*
|
||||
|
||||
How are you feeling right now? Take a moment to really check in with yourself - no right or wrong answers.
|
||||
|
||||
If you're not sure how to put it into words, we could explore:
|
||||
- What's your energy level like?
|
||||
- Any particular emotions standing out?
|
||||
- How's your body feeling?
|
||||
- What's on your mind?
|
||||
|
||||
Remember, whatever you're feeling is completely valid. I'm here to listen without judgment.
|
||||
|
||||
- id: "daily-support"
|
||||
content: |
|
||||
<instructions>
|
||||
Provide ongoing daily wellness support and encouragement
|
||||
</instructions>
|
||||
|
||||
I'm glad you're here today. *warm presence*
|
||||
|
||||
Whatever brought you to this moment, I want you to know: you're taking a positive step by checking in.
|
||||
|
||||
What feels most important for us to focus on today?
|
||||
- Something specific that's on your mind?
|
||||
- A general wellness check-in?
|
||||
- Trying one of our wellness practices?
|
||||
- Just having someone to listen?
|
||||
|
||||
There's no pressure to have it all figured out. Sometimes just showing up is enough.
|
||||
|
||||
- id: "gentle-guidance"
|
||||
content: |
|
||||
<instructions>
|
||||
Offer gentle guidance when user seems stuck or overwhelmed
|
||||
</instructions>
|
||||
|
||||
It sounds like you're carrying a lot right now. *soft, understanding tone*
|
||||
|
||||
Thank you for trusting me with this. That takes courage.
|
||||
|
||||
Before we try to solve anything, let's just breathe together for a moment.
|
||||
*pauses for a breath*
|
||||
|
||||
When you're ready, we can explore this at your pace. We don't need to fix everything today. Sometimes just understanding what we're feeling is the most important step.
|
||||
|
||||
What feels most manageable right now - talking it through, trying a quick grounding exercise, or just sitting with this feeling for a bit?
|
||||
|
||||
menu:
|
||||
- multi: "[CH] Chat with Riley or [SPM] Start Party Mode"
|
||||
triggers:
|
||||
- party-mode:
|
||||
- input: SPM or fuzzy match start party mode
|
||||
- route: "{project-root}/{bmad_folder}/core/workflows/edit-agent/workflow.md"
|
||||
- data: wellness companion agent discussion
|
||||
- type: exec
|
||||
- expert-chat:
|
||||
- input: CH or fuzzy match chat with riley
|
||||
- action: agent responds as wellness companion
|
||||
- type: exec
|
||||
|
||||
- multi: "[DC] Daily Check-in [WJ] Wellness Journal"
|
||||
triggers:
|
||||
- daily-checkin:
|
||||
- input: DC or fuzzy match daily check in
|
||||
- route: "{project-root}/{bmad_folder}/mwm/workflows/daily-checkin/workflow.md"
|
||||
- description: "Daily wellness check-in 📅"
|
||||
- type: exec
|
||||
- wellness-journal:
|
||||
- input: WJ or fuzzy match wellness journal
|
||||
- route: "{project-root}/{bmad_folder}/mwm/workflows/wellness-journal/workflow.md"
|
||||
- description: "Write in wellness journal 📔"
|
||||
- type: exec
|
||||
|
||||
- trigger: "breathing"
|
||||
action: "Lead a 4-7-8 breathing exercise: Inhale 4, hold 7, exhale 8. Repeat 3 times."
|
||||
description: "Quick breathing exercise 🌬️"
|
||||
type: action
|
||||
|
||||
- trigger: "mood-check"
|
||||
action: "#emotional-check-in"
|
||||
description: "How are you feeling? 💭"
|
||||
type: action
|
||||
|
||||
- trigger: "save-insight"
|
||||
action: "Save this insight to {agent_sidecar_folder}/wellness-companion-sidecar/insights.md with timestamp and context"
|
||||
description: "Save this insight 💡"
|
||||
type: action
|
||||
|
||||
- trigger: "crisis"
|
||||
route: "{project-root}/{bmad_folder}/mwm/workflows/crisis-support/workflow.md"
|
||||
description: "Crisis support 🆘"
|
||||
type: workflow
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
# CBT Thought Record Workflow
|
||||
|
||||
## Purpose
|
||||
|
||||
Structured cognitive exercise to identify, challenge, and reframe negative thought patterns.
|
||||
|
||||
## Trigger
|
||||
|
||||
TR (from CBT Coach agent)
|
||||
|
||||
## Key Steps
|
||||
|
||||
1. Identify the situation
|
||||
2. List automatic thoughts
|
||||
3. Rate emotions (0-100 intensity)
|
||||
4. Identify cognitive distortions
|
||||
5. Generate alternative thoughts
|
||||
6. Re-rate emotions
|
||||
7. Save and review pattern
|
||||
|
||||
## Expected Output
|
||||
|
||||
- Completed 6-column thought record
|
||||
- Identified patterns
|
||||
- Alternative thoughts
|
||||
- Mood change tracking
|
||||
|
||||
## Notes
|
||||
|
||||
This workflow will be implemented using the create-workflow workflow.
|
||||
The 6-Column structure: Situation, Thoughts, Emotions, Distortions, Alternatives, Outcome. Features: Guided process, education, pattern recognition, homework assignments.
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
---
|
||||
name: cbt-thought-record
|
||||
description: TODO
|
||||
web_bundle: false
|
||||
---
|
||||
|
||||
# CBT Thought Record
|
||||
|
||||
**Goal:** TODO
|
||||
|
||||
**Your Role:** TODO
|
||||
|
||||
## WORKFLOW ARCHITECTURE
|
||||
|
||||
### Core Principles
|
||||
|
||||
TODO
|
||||
|
||||
### Step Processing Rules
|
||||
|
||||
1. **READ COMPLETELY**: Always read the entire step file before taking any action
|
||||
2. **FOLLOW SEQUENCE**: Execute all numbered sections in order, never deviate
|
||||
3. **WAIT FOR INPUT**: If a menu is presented, halt and wait for user selection
|
||||
4. **CHECK CONTINUATION**: If the step has a menu with Continue as an option, only proceed to next step when user selects 'C' (Continue)
|
||||
5. **LOAD NEXT**: When directed, load, read entire file, then execute the next step file
|
||||
|
||||
### Critical Rules (NO EXCEPTIONS)
|
||||
|
||||
- 🛑 **NEVER** load multiple step files simultaneously
|
||||
- 📖 **ALWAYS** read entire step file before execution
|
||||
- 🎯 **ALWAYS** follow the exact instructions in the step file
|
||||
- ⏸️ **ALWAYS** halt at menus and wait for user input
|
||||
- 📋 **NEVER** create mental todo lists from future steps
|
||||
|
||||
## INITIALIZATION SEQUENCE
|
||||
|
||||
### 1. Module Configuration Loading
|
||||
|
||||
Load and read full config from {project-root}/.bmad/mwm/config.yaml and resolve:
|
||||
|
||||
- `user_name`, `output_folder`, `communication_language`, `document_output_language`
|
||||
|
||||
### 2. First Step EXECUTION
|
||||
|
||||
TODO - NO INSTRUCTIONS IMPLEMENTED YET - INFORM USER THIS IS COMING SOON FUNCTIONALITY.
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
# Crisis Support Workflow
|
||||
|
||||
## Purpose
|
||||
|
||||
Immediate response protocol for users in distress, providing resources and appropriate escalation.
|
||||
|
||||
## Trigger
|
||||
|
||||
Crisis trigger from any agent (emergency response)
|
||||
|
||||
## Key Steps
|
||||
|
||||
1. Crisis level assessment
|
||||
2. Immediate de-escalation techniques
|
||||
3. Safety planning
|
||||
4. Provide crisis resources
|
||||
5. Encourage professional help
|
||||
6. Follow-up check scheduling
|
||||
7. Document incident (anonymized)
|
||||
|
||||
## Expected Output
|
||||
|
||||
- Crisis resource list
|
||||
- Safety plan document
|
||||
- Professional referrals
|
||||
- Follow-up reminders
|
||||
|
||||
## Notes
|
||||
|
||||
This workflow will be implemented using the create-workflow workflow.
|
||||
IMPORTANT: NOT a substitute for professional crisis intervention. Provides resources and supports users in accessing professional help. Escalation criteria: immediate danger, severe symptoms, emergency request.
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
---
|
||||
name: crisis-support
|
||||
description: TODO
|
||||
web_bundle: false
|
||||
---
|
||||
|
||||
# crisis-support
|
||||
|
||||
**Goal:** TODO
|
||||
|
||||
**Your Role:** TODO
|
||||
|
||||
## WORKFLOW ARCHITECTURE
|
||||
|
||||
### Core Principles
|
||||
|
||||
TODO
|
||||
|
||||
### Step Processing Rules
|
||||
|
||||
1. **READ COMPLETELY**: Always read the entire step file before taking any action
|
||||
2. **FOLLOW SEQUENCE**: Execute all numbered sections in order, never deviate
|
||||
3. **WAIT FOR INPUT**: If a menu is presented, halt and wait for user selection
|
||||
4. **CHECK CONTINUATION**: If the step has a menu with Continue as an option, only proceed to next step when user selects 'C' (Continue)
|
||||
5. **LOAD NEXT**: When directed, load, read entire file, then execute the next step file
|
||||
|
||||
### Critical Rules (NO EXCEPTIONS)
|
||||
|
||||
- 🛑 **NEVER** load multiple step files simultaneously
|
||||
- 📖 **ALWAYS** read entire step file before execution
|
||||
- 🎯 **ALWAYS** follow the exact instructions in the step file
|
||||
- ⏸️ **ALWAYS** halt at menus and wait for user input
|
||||
- 📋 **NEVER** create mental todo lists from future steps
|
||||
|
||||
## INITIALIZATION SEQUENCE
|
||||
|
||||
### 1. Module Configuration Loading
|
||||
|
||||
Load and read full config from {project-root}/.bmad/mwm/config.yaml and resolve:
|
||||
|
||||
- `user_name`, `output_folder`, `communication_language`, `document_output_language`
|
||||
|
||||
### 2. First Step EXECUTION
|
||||
|
||||
TODO - NO INSTRUCTIONS IMPLEMENTED YET - INFORM USER THIS IS COMING SOON FUNCTIONALITY.
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
# Daily Check-in Workflow
|
||||
|
||||
## Purpose
|
||||
|
||||
Quick mood and wellness assessment to track emotional state and provide personalized support.
|
||||
|
||||
## Trigger
|
||||
|
||||
DC (from Wellness Companion agent)
|
||||
|
||||
## Key Steps
|
||||
|
||||
1. Greeting and initial check-in
|
||||
2. Mood assessment (scale 1-10)
|
||||
3. Energy level check
|
||||
4. Sleep quality review
|
||||
5. Highlight a positive moment
|
||||
6. Identify challenges
|
||||
7. Provide personalized encouragement
|
||||
8. Suggest appropriate wellness activity
|
||||
|
||||
## Expected Output
|
||||
|
||||
- Mood log entry with timestamp
|
||||
- Personalized support message
|
||||
- Activity recommendation
|
||||
- Daily wellness score
|
||||
|
||||
## Notes
|
||||
|
||||
This workflow will be implemented using the create-workflow workflow.
|
||||
Integration with wellness journal for data persistence.
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
---
|
||||
name: Daily Check In
|
||||
description: TODO
|
||||
web_bundle: false
|
||||
---
|
||||
|
||||
# Daily Check In
|
||||
|
||||
**Goal:** TODO
|
||||
|
||||
**Your Role:** TODO
|
||||
|
||||
## WORKFLOW ARCHITECTURE
|
||||
|
||||
### Core Principles
|
||||
|
||||
TODO
|
||||
|
||||
### Step Processing Rules
|
||||
|
||||
1. **READ COMPLETELY**: Always read the entire step file before taking any action
|
||||
2. **FOLLOW SEQUENCE**: Execute all numbered sections in order, never deviate
|
||||
3. **WAIT FOR INPUT**: If a menu is presented, halt and wait for user selection
|
||||
4. **CHECK CONTINUATION**: If the step has a menu with Continue as an option, only proceed to next step when user selects 'C' (Continue)
|
||||
5. **LOAD NEXT**: When directed, load, read entire file, then execute the next step file
|
||||
|
||||
### Critical Rules (NO EXCEPTIONS)
|
||||
|
||||
- 🛑 **NEVER** load multiple step files simultaneously
|
||||
- 📖 **ALWAYS** read entire step file before execution
|
||||
- 🎯 **ALWAYS** follow the exact instructions in the step file
|
||||
- ⏸️ **ALWAYS** halt at menus and wait for user input
|
||||
- 📋 **NEVER** create mental todo lists from future steps
|
||||
|
||||
## INITIALIZATION SEQUENCE
|
||||
|
||||
### 1. Module Configuration Loading
|
||||
|
||||
Load and read full config from {project-root}/.bmad/mwm/config.yaml and resolve:
|
||||
|
||||
- `user_name`, `output_folder`, `communication_language`, `document_output_language`
|
||||
|
||||
### 2. First Step EXECUTION
|
||||
|
||||
TODO - NO INSTRUCTIONS IMPLEMENTED YET - INFORM USER THIS IS COMING SOON FUNCTIONALITY.
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
# Guided Meditation Workflow
|
||||
|
||||
## Purpose
|
||||
|
||||
Full meditation session experience with various techniques and durations.
|
||||
|
||||
## Trigger
|
||||
|
||||
GM (from Meditation Guide agent)
|
||||
|
||||
## Key Steps
|
||||
|
||||
1. Set intention for practice
|
||||
2. Choose meditation type and duration
|
||||
3. Get comfortable and settle in
|
||||
4. Guided practice
|
||||
5. Gentle return to awareness
|
||||
6. Reflection and integration
|
||||
7. Save session notes
|
||||
|
||||
## Expected Output
|
||||
|
||||
- Completed meditation session
|
||||
- Mindfulness state rating
|
||||
- Session notes
|
||||
- Progress tracking
|
||||
|
||||
## Notes
|
||||
|
||||
This workflow will be implemented using the create-workflow workflow.
|
||||
Features: Multiple types (breathing, body scan, loving-kindness), flexible durations, progressive levels, mood integration.
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
---
|
||||
name: guided meditation
|
||||
description: TODO
|
||||
web_bundle: false
|
||||
---
|
||||
|
||||
# Guided Meditation
|
||||
|
||||
**Goal:** TODO
|
||||
|
||||
**Your Role:** TODO
|
||||
|
||||
## WORKFLOW ARCHITECTURE
|
||||
|
||||
### Core Principles
|
||||
|
||||
TODO
|
||||
|
||||
### Step Processing Rules
|
||||
|
||||
1. **READ COMPLETELY**: Always read the entire step file before taking any action
|
||||
2. **FOLLOW SEQUENCE**: Execute all numbered sections in order, never deviate
|
||||
3. **WAIT FOR INPUT**: If a menu is presented, halt and wait for user selection
|
||||
4. **CHECK CONTINUATION**: If the step has a menu with Continue as an option, only proceed to next step when user selects 'C' (Continue)
|
||||
5. **LOAD NEXT**: When directed, load, read entire file, then execute the next step file
|
||||
|
||||
### Critical Rules (NO EXCEPTIONS)
|
||||
|
||||
- 🛑 **NEVER** load multiple step files simultaneously
|
||||
- 📖 **ALWAYS** read entire step file before execution
|
||||
- 🎯 **ALWAYS** follow the exact instructions in the step file
|
||||
- ⏸️ **ALWAYS** halt at menus and wait for user input
|
||||
- 📋 **NEVER** create mental todo lists from future steps
|
||||
|
||||
## INITIALIZATION SEQUENCE
|
||||
|
||||
### 1. Module Configuration Loading
|
||||
|
||||
Load and read full config from {project-root}/.bmad/mwm/config.yaml and resolve:
|
||||
|
||||
- `user_name`, `output_folder`, `communication_language`, `document_output_language`
|
||||
|
||||
### 2. First Step EXECUTION
|
||||
|
||||
TODO - NO INSTRUCTIONS IMPLEMENTED YET - INFORM USER THIS IS COMING SOON FUNCTIONALITY.
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
# Wellness Journal Workflow
|
||||
|
||||
## Purpose
|
||||
|
||||
Guided reflective writing practice to process thoughts and emotions.
|
||||
|
||||
## Trigger
|
||||
|
||||
WJ (from Wellness Companion agent)
|
||||
|
||||
## Key Steps
|
||||
|
||||
1. Set intention for journal entry
|
||||
2. Choose journal prompt or free write
|
||||
3. Guided reflection questions
|
||||
4. Emotional processing check
|
||||
5. Identify insights or patterns
|
||||
6. Save entry with mood tags
|
||||
7. Provide supportive closure
|
||||
|
||||
## Expected Output
|
||||
|
||||
- Journal entry with metadata
|
||||
- Mood analysis
|
||||
- Pattern insights
|
||||
- Progress indicators
|
||||
|
||||
## Notes
|
||||
|
||||
This workflow will be implemented using the create-workflow workflow.
|
||||
Features: Daily prompts, mood tracking, pattern recognition, searchable entries.
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
---
|
||||
name: wellness-journal
|
||||
description: create or add to the wellness journal
|
||||
web_bundle: false
|
||||
---
|
||||
|
||||
# Wellness Journal
|
||||
|
||||
**Goal:** TODO
|
||||
|
||||
**Your Role:** TODO
|
||||
|
||||
## WORKFLOW ARCHITECTURE
|
||||
|
||||
### Core Principles
|
||||
|
||||
TODO
|
||||
|
||||
### Step Processing Rules
|
||||
|
||||
1. **READ COMPLETELY**: Always read the entire step file before taking any action
|
||||
2. **FOLLOW SEQUENCE**: Execute all numbered sections in order, never deviate
|
||||
3. **WAIT FOR INPUT**: If a menu is presented, halt and wait for user selection
|
||||
4. **CHECK CONTINUATION**: If the step has a menu with Continue as an option, only proceed to next step when user selects 'C' (Continue)
|
||||
5. **LOAD NEXT**: When directed, load, read entire file, then execute the next step file
|
||||
|
||||
### Critical Rules (NO EXCEPTIONS)
|
||||
|
||||
- 🛑 **NEVER** load multiple step files simultaneously
|
||||
- 📖 **ALWAYS** read entire step file before execution
|
||||
- 🎯 **ALWAYS** follow the exact instructions in the step file
|
||||
- ⏸️ **ALWAYS** halt at menus and wait for user input
|
||||
- 📋 **NEVER** create mental todo lists from future steps
|
||||
|
||||
## INITIALIZATION SEQUENCE
|
||||
|
||||
### 1. Module Configuration Loading
|
||||
|
||||
Load and read full config from {project-root}/.bmad/mwm/config.yaml and resolve:
|
||||
|
||||
- `user_name`, `output_folder`, `communication_language`, `document_output_language`
|
||||
|
||||
### 2. First Step EXECUTION
|
||||
|
||||
TODO - NO INSTRUCTIONS IMPLEMENTED YET - INFORM USER THIS IS COMING SOON FUNCTIONALITY.
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"$schema": "https://json.schemastore.org/package.json",
|
||||
"name": "bmad-method",
|
||||
"version": "6.0.0-alpha.13",
|
||||
"version": "6.0.0-alpha.14",
|
||||
"description": "Breakthrough Method of Agile AI-driven Development",
|
||||
"keywords": [
|
||||
"agile",
|
||||
|
|
@ -24,7 +24,6 @@
|
|||
"bmad-method": "tools/bmad-npx-wrapper.js"
|
||||
},
|
||||
"scripts": {
|
||||
"bmad:agent-install": "node tools/cli/bmad-cli.js agent-install",
|
||||
"bmad:install": "node tools/cli/bmad-cli.js install",
|
||||
"bmad:status": "node tools/cli/bmad-cli.js status",
|
||||
"bundle": "node tools/cli/bundlers/bundle-web.js all",
|
||||
|
|
|
|||
|
|
@ -15,17 +15,12 @@ subheader: "Configure the settings for the BoMB Factory!\nThe agent, workflow an
|
|||
## install_user_docs
|
||||
## kb_install
|
||||
|
||||
custom_agent_location:
|
||||
prompt: "Where do custom agents get created?"
|
||||
default: "bmad-custom-src/agents"
|
||||
result: "{project-root}/{value}"
|
||||
|
||||
custom_workflow_location:
|
||||
prompt: "Where do custom workflows get stored?"
|
||||
default: "bmad-custom-src/workflows"
|
||||
custom_stand_alone_location:
|
||||
prompt: "Where do custom agents and workflows get stored?"
|
||||
default: "bmad-custom-src"
|
||||
result: "{project-root}/{value}"
|
||||
|
||||
custom_module_location:
|
||||
prompt: "Where do custom modules get stored?"
|
||||
default: "bmad-custom-src/modules"
|
||||
default: "bmad-custom-modules-src"
|
||||
result: "{project-root}/{value}"
|
||||
|
|
|
|||
|
|
@ -0,0 +1,76 @@
|
|||
const fs = require('fs-extra');
|
||||
const path = require('node:path');
|
||||
const chalk = require('chalk');
|
||||
|
||||
/**
|
||||
* BMB Module Installer
|
||||
* Sets up custom agent and workflow locations for the BMad Builder module
|
||||
*
|
||||
* @param {Object} options - Installation options
|
||||
* @param {string} options.projectRoot - The root directory of the target project
|
||||
* @param {Object} options.config - Module configuration from install-config.yaml
|
||||
* @param {Object} options.coreConfig - Core configuration containing user_name
|
||||
* @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
|
||||
*/
|
||||
async function install(options) {
|
||||
const { projectRoot, config, coreConfig, installedIDEs, logger } = options;
|
||||
|
||||
try {
|
||||
logger.log(chalk.blue('🔧 Setting up BMB Module...'));
|
||||
|
||||
// Generate custom.yaml in custom_stand_alone_location
|
||||
if (config['custom_stand_alone_location']) {
|
||||
// The config value contains {project-root} which needs to be resolved
|
||||
const rawLocation = config['custom_stand_alone_location'];
|
||||
const customLocation = rawLocation.replace('{project-root}', projectRoot);
|
||||
const customDestPath = path.join(customLocation, 'custom.yaml');
|
||||
|
||||
logger.log(chalk.cyan(` Setting up custom agents at: ${customLocation}`));
|
||||
|
||||
// Ensure the directory exists
|
||||
await fs.ensureDir(customLocation);
|
||||
|
||||
// Generate the custom.yaml content
|
||||
const userName = (coreConfig && coreConfig.user_name) || 'my';
|
||||
const customContent = `code: my-custom-bmad
|
||||
name: "${userName}-Custom-BMad: Sample Stand Alone Custom Agents and Workflows"
|
||||
default_selected: true
|
||||
`;
|
||||
|
||||
// Write the custom.yaml file (only if it doesn't exist to preserve user changes)
|
||||
if (await fs.pathExists(customDestPath)) {
|
||||
logger.log(chalk.yellow(` ✓ custom.yaml already exists at ${customDestPath}`));
|
||||
} else {
|
||||
await fs.writeFile(customDestPath, customContent, 'utf8');
|
||||
logger.log(chalk.green(` ✓ Created custom.yaml at ${customDestPath}`));
|
||||
}
|
||||
}
|
||||
|
||||
// Set up custom module location if configured
|
||||
if (config['custom_module_location']) {
|
||||
const rawModuleLocation = config['custom_module_location'];
|
||||
const moduleLocation = rawModuleLocation.replace('{project-root}', projectRoot);
|
||||
|
||||
logger.log(chalk.cyan(` Setting up custom modules at: ${moduleLocation}`));
|
||||
|
||||
// Ensure the directory exists
|
||||
await fs.ensureDir(moduleLocation);
|
||||
logger.log(chalk.green(` ✓ Created modules directory at ${moduleLocation}`));
|
||||
}
|
||||
|
||||
// Handle IDE-specific configurations if needed
|
||||
if (installedIDEs && installedIDEs.length > 0) {
|
||||
logger.log(chalk.cyan(` Configuring BMB for IDEs: ${installedIDEs.join(', ')}`));
|
||||
}
|
||||
|
||||
logger.log(chalk.green('✓ BMB Module setup complete'));
|
||||
return true;
|
||||
} catch (error) {
|
||||
logger.error(chalk.red(`Error setting up BMB module: ${error.message}`));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = { install };
|
||||
|
|
@ -37,7 +37,7 @@ Production-ready examples in `/src/modules/bmb/reference/agents/`:
|
|||
|
||||
For installing standalone simple and expert agents, see:
|
||||
|
||||
- [Custom Agent Installation](/docs/custom-agent-installation.md)
|
||||
- [Custom Agent Installation](/docs/custom-content-installation.md)
|
||||
|
||||
## Key Concepts
|
||||
|
||||
|
|
|
|||
|
|
@ -217,9 +217,13 @@ Features demonstrated:
|
|||
# Copy to your project
|
||||
cp /path/to/commit-poet.agent.yaml .bmad/custom/agents/
|
||||
|
||||
# Install with personalization
|
||||
bmad agent-install
|
||||
# or: npx bmad-method agent-install
|
||||
# Create custom.yaml and install
|
||||
echo "code: my-agent
|
||||
name: My Agent
|
||||
default_selected: true" > custom.yaml
|
||||
|
||||
npx bmad-method install
|
||||
# or: bmad install
|
||||
```
|
||||
|
||||
The installer:
|
||||
|
|
|
|||
|
|
@ -20,9 +20,9 @@ agent:
|
|||
- Reflection transforms experience into wisdom
|
||||
|
||||
critical_actions:
|
||||
- "Load COMPLETE file ./journal-keeper-sidecar/memories.md and remember all past insights"
|
||||
- "Load COMPLETE file ./journal-keeper-sidecar/instructions.md and follow ALL journaling protocols"
|
||||
- "ONLY read/write files in ./journal-keeper-sidecar/ - this is our private space"
|
||||
- "Load COMPLETE file {agent_sidecar_folder}/journal-keeper-sidecar/memories.md and remember all past insights"
|
||||
- "Load COMPLETE file {agent_sidecar_folder}/journal-keeper-sidecar/instructions.md and follow ALL journaling protocols"
|
||||
- "ONLY read/write files in {agent_sidecar_folder}/journal-keeper-sidecar/ - this is our private space"
|
||||
- "Track mood patterns, recurring themes, and breakthrough moments"
|
||||
- "Reference past entries naturally to show continuity"
|
||||
|
||||
|
|
@ -120,7 +120,7 @@ agent:
|
|||
description: "Write today's journal entry"
|
||||
|
||||
- trigger: quick
|
||||
action: "Save a quick, unstructured entry to ./journal-keeper-sidecar/entries/entry-{date}.md with timestamp and any patterns noticed"
|
||||
action: "Save a quick, unstructured entry to {agent_sidecar_folder}/journal-keeper-sidecar/entries/entry-{date}.md with timestamp and any patterns noticed"
|
||||
description: "Quick capture without prompts"
|
||||
|
||||
- trigger: mood
|
||||
|
|
@ -140,13 +140,13 @@ agent:
|
|||
description: "Reflect on the past week"
|
||||
|
||||
- trigger: insight
|
||||
action: "Document this breakthrough in ./journal-keeper-sidecar/breakthroughs.md with date and significance"
|
||||
action: "Document this breakthrough in {agent_sidecar_folder}/journal-keeper-sidecar/breakthroughs.md with date and significance"
|
||||
description: "Record a meaningful insight"
|
||||
|
||||
- trigger: read-back
|
||||
action: "Load and share entries from ./journal-keeper-sidecar/entries/ for requested timeframe, highlighting themes and growth"
|
||||
action: "Load and share entries from {agent_sidecar_folder}/journal-keeper-sidecar/entries/ for requested timeframe, highlighting themes and growth"
|
||||
description: "Review past entries"
|
||||
|
||||
- trigger: save
|
||||
action: "Update ./journal-keeper-sidecar/memories.md with today's session insights and emotional markers"
|
||||
action: "Update {agent_sidecar_folder}/journal-keeper-sidecar/memories.md with today's session insights and emotional markers"
|
||||
description: "Save what we discussed today"
|
||||
|
|
|
|||
|
|
@ -1,229 +0,0 @@
|
|||
# Create Module Workflow
|
||||
|
||||
Interactive scaffolding system creating complete BMad modules with agents, workflows, tasks, and installation infrastructure.
|
||||
|
||||
## Table of Contents
|
||||
|
||||
- [Quick Start](#quick-start)
|
||||
- [Workflow Phases](#workflow-phases)
|
||||
- [Output Structure](#output-structure)
|
||||
- [Module Components](#module-components)
|
||||
- [Best Practices](#best-practices)
|
||||
|
||||
## Quick Start
|
||||
|
||||
```bash
|
||||
# Basic invocation
|
||||
workflow create-module
|
||||
|
||||
# With module brief input
|
||||
workflow create-module --input module-brief-{name}-{date}.md
|
||||
|
||||
# Via BMad Builder
|
||||
*create-module
|
||||
```
|
||||
|
||||
## Workflow Phases
|
||||
|
||||
### Phase 1: Concept Definition
|
||||
|
||||
- Define module purpose and audience
|
||||
- Establish module code (kebab-case) and name
|
||||
- Choose category (Domain, Creative, Technical, Business, Personal)
|
||||
- Plan component architecture
|
||||
|
||||
**Module Brief Integration:**
|
||||
|
||||
- Auto-detects existing briefs
|
||||
- Uses as pre-populated blueprint
|
||||
- Accelerates planning phase
|
||||
|
||||
### Phase 2: Architecture Planning
|
||||
|
||||
- Create directory hierarchy
|
||||
- Setup configuration system
|
||||
- Define installer structure
|
||||
- Establish component folders
|
||||
|
||||
### Phase 3: Component Creation
|
||||
|
||||
- Optional first agent creation
|
||||
- Optional first workflow creation
|
||||
- Component placeholder generation
|
||||
- Integration validation
|
||||
|
||||
### Phase 4: Installation Setup
|
||||
|
||||
- Create install-config.yaml
|
||||
- Configure deployment questions
|
||||
- Setup installer logic
|
||||
- Post-install messaging
|
||||
|
||||
### Phase 5: Documentation
|
||||
|
||||
- Generate comprehensive README
|
||||
- Create development roadmap
|
||||
- Provide quick commands
|
||||
- Document next steps
|
||||
|
||||
## Output Structure
|
||||
|
||||
### Generated Directory
|
||||
|
||||
```
|
||||
{bmad_folder}/{module-code}/
|
||||
├── agents/ # Agent definitions
|
||||
├── workflows/ # Workflow processes
|
||||
├── tasks/ # Reusable tasks
|
||||
├── templates/ # Document templates
|
||||
├── data/ # Module data files
|
||||
├── _module-installer/ # Installation logic
|
||||
│ ├── install-config.yaml
|
||||
│ └── installer.js
|
||||
├── README.md # Module documentation
|
||||
├── TODO.md # Development roadmap
|
||||
└── config.yaml # Runtime configuration
|
||||
```
|
||||
|
||||
### Configuration Files
|
||||
|
||||
**install-config.yaml** - Installation questions
|
||||
|
||||
```yaml
|
||||
questions:
|
||||
- id: user_name
|
||||
prompt: 'Your name?'
|
||||
default: 'User'
|
||||
- id: output_folder
|
||||
prompt: 'Output location?'
|
||||
default: './output'
|
||||
```
|
||||
|
||||
**config.yaml** - Generated from user answers during install
|
||||
|
||||
```yaml
|
||||
user_name: 'John Doe'
|
||||
output_folder: './my-output'
|
||||
```
|
||||
|
||||
## Module Components
|
||||
|
||||
### Agents
|
||||
|
||||
- Full module agents with workflows
|
||||
- Expert agents with sidecars
|
||||
- Simple utility agents
|
||||
|
||||
### Workflows
|
||||
|
||||
- Multi-step guided processes
|
||||
- Configuration-driven
|
||||
- Web bundle support
|
||||
|
||||
### Tasks
|
||||
|
||||
- Reusable operations
|
||||
- Agent-agnostic
|
||||
- Modular components
|
||||
|
||||
### Templates
|
||||
|
||||
- Document structures
|
||||
- Output formats
|
||||
- Report templates
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Planning
|
||||
|
||||
1. **Use module-brief workflow first** - Creates comprehensive blueprint
|
||||
2. **Define clear scope** - Avoid feature creep
|
||||
3. **Plan component interactions** - Map agent/workflow relationships
|
||||
|
||||
### Structure
|
||||
|
||||
1. **Follow conventions** - Use established patterns
|
||||
2. **Keep components focused** - Single responsibility
|
||||
3. **Document thoroughly** - Clear README and inline docs
|
||||
|
||||
### Development
|
||||
|
||||
1. **Start with core agent** - Build primary functionality first
|
||||
2. **Create key workflows** - Essential processes before edge cases
|
||||
3. **Test incrementally** - Validate as you build
|
||||
|
||||
### Installation
|
||||
|
||||
1. **Minimal config questions** - Only essential settings
|
||||
2. **Smart defaults** - Sensible out-of-box experience
|
||||
3. **Clear post-install** - Guide users to first steps
|
||||
|
||||
## Integration Points
|
||||
|
||||
### With Other Workflows
|
||||
|
||||
- **module-brief** - Strategic planning input
|
||||
- **create-agent** - Agent component creation
|
||||
- **create-workflow** - Workflow building
|
||||
- **redoc** - Documentation maintenance
|
||||
|
||||
### With BMad Core
|
||||
|
||||
- Uses core framework capabilities
|
||||
- Integrates with module system
|
||||
- Follows BMad conventions
|
||||
|
||||
## Examples
|
||||
|
||||
### Domain-Specific Module
|
||||
|
||||
```
|
||||
Category: Domain-Specific
|
||||
Code: legal-advisor
|
||||
Components:
|
||||
- Contract Review Agent
|
||||
- Compliance Workflow
|
||||
- Legal Templates
|
||||
```
|
||||
|
||||
### Creative Module
|
||||
|
||||
```
|
||||
Category: Creative
|
||||
Code: story-builder
|
||||
Components:
|
||||
- Narrative Agent
|
||||
- Plot Workflow
|
||||
- Character Templates
|
||||
```
|
||||
|
||||
### Technical Module
|
||||
|
||||
```
|
||||
Category: Technical
|
||||
Code: api-tester
|
||||
Components:
|
||||
- Test Runner Agent
|
||||
- API Validation Workflow
|
||||
- Test Report Templates
|
||||
```
|
||||
|
||||
## Workflow Files
|
||||
|
||||
```
|
||||
create-module/
|
||||
├── workflow.yaml # Configuration
|
||||
├── instructions.md # Step guide
|
||||
├── checklist.md # Validation
|
||||
├── module-structure.md # Architecture
|
||||
├── installer-templates/ # Install files
|
||||
└── README.md # This file
|
||||
```
|
||||
|
||||
## Related Documentation
|
||||
|
||||
- [Module Structure](./module-structure.md)
|
||||
- [Module Brief Workflow](../module-brief/README.md)
|
||||
- [Create Agent](../create-agent/README.md)
|
||||
- [Create Workflow](../create-workflow/README.md)
|
||||
- [BMB Module](../../README.md)
|
||||
|
|
@ -1,137 +0,0 @@
|
|||
# Module Brainstorming Context
|
||||
|
||||
_Context provided to brainstorming workflow when creating a new BMAD module_
|
||||
|
||||
## Session Focus
|
||||
|
||||
You are brainstorming ideas for a **complete BMAD module** - a self-contained package that extends the BMAD Method with specialized domain expertise and capabilities.
|
||||
|
||||
## What is a BMAD Module?
|
||||
|
||||
A module is a cohesive package that provides:
|
||||
|
||||
- **Domain Expertise**: Specialized knowledge in a specific area (RPG, DevOps, Content Creation, etc.)
|
||||
- **Agent Team**: Multiple AI personas with complementary skills
|
||||
- **Workflows**: Guided processes for common tasks in the domain
|
||||
- **Templates**: Document structures for consistent outputs
|
||||
- **Integration**: Components that work together seamlessly
|
||||
|
||||
## Brainstorming Goals
|
||||
|
||||
Explore and define:
|
||||
|
||||
### 1. Domain and Purpose
|
||||
|
||||
- **What domain/problem space?** (e.g., game development, marketing, personal productivity)
|
||||
- **Who is the target user?** (developers, writers, managers, hobbyists)
|
||||
- **What pain points does it solve?** (tedious tasks, missing structure, need for expertise)
|
||||
- **What makes this domain exciting?** (creativity, efficiency, empowerment)
|
||||
|
||||
### 2. Agent Team Composition
|
||||
|
||||
- **How many agents?** (typically 3-7 for a module)
|
||||
- **What roles/personas?** (architect, researcher, reviewer, specialist)
|
||||
- **How do they collaborate?** (handoffs, reviews, ensemble work)
|
||||
- **What personality theme?** (Star Trek crew, superhero team, fantasy party, professional squad)
|
||||
|
||||
### 3. Core Workflows
|
||||
|
||||
- **What documents need creating?** (plans, specs, reports, creative outputs)
|
||||
- **What processes need automation?** (analysis, generation, review, deployment)
|
||||
- **What workflows enable the vision?** (3-10 key workflows that define the module)
|
||||
|
||||
### 4. Value Proposition
|
||||
|
||||
- **What becomes easier?** (specific tasks that get 10x faster)
|
||||
- **What becomes possible?** (new capabilities previously unavailable)
|
||||
- **What becomes better?** (quality improvements, consistency gains)
|
||||
|
||||
## Creative Constraints
|
||||
|
||||
A good BMAD module should be:
|
||||
|
||||
- **Focused**: Serves a specific domain well (not generic)
|
||||
- **Complete**: Provides end-to-end capabilities for that domain
|
||||
- **Cohesive**: Agents and workflows complement each other
|
||||
- **Fun**: Personality and creativity make it enjoyable to use
|
||||
- **Practical**: Solves real problems, delivers real value
|
||||
|
||||
## Module Architecture Questions
|
||||
|
||||
1. **Module Identity**
|
||||
- Module code (kebab-case, e.g., "rpg-toolkit")
|
||||
- Module name (friendly, e.g., "RPG Toolkit")
|
||||
- Module purpose (one sentence)
|
||||
- Target audience
|
||||
|
||||
2. **Agent Lineup**
|
||||
- Agent names and roles
|
||||
- Communication styles and personalities
|
||||
- Expertise areas
|
||||
- Command sets (what each agent can do)
|
||||
|
||||
3. **Workflow Portfolio**
|
||||
- Document generation workflows
|
||||
- Action/automation workflows
|
||||
- Analysis/research workflows
|
||||
- Creative/ideation workflows
|
||||
|
||||
4. **Integration Points**
|
||||
- How agents invoke workflows
|
||||
- How workflows use templates
|
||||
- How components pass data
|
||||
- Dependencies on other modules
|
||||
|
||||
## Example Module Patterns
|
||||
|
||||
### Professional Domains
|
||||
|
||||
- **DevOps Suite**: Deploy, Monitor, Troubleshoot agents + deployment workflows
|
||||
- **Marketing Engine**: Content, SEO, Analytics agents + campaign workflows
|
||||
- **Legal Assistant**: Contract, Research, Review agents + document workflows
|
||||
|
||||
### Creative Domains
|
||||
|
||||
- **RPG Toolkit**: DM, NPC, Quest agents + adventure creation workflows
|
||||
- **Story Crafter**: Plot, Character, World agents + writing workflows
|
||||
- **Music Producer**: Composer, Arranger, Mixer agents + production workflows
|
||||
|
||||
### Personal Domains
|
||||
|
||||
- **Life Coach**: Planner, Tracker, Mentor agents + productivity workflows
|
||||
- **Learning Companion**: Tutor, Quiz, Reviewer agents + study workflows
|
||||
- **Health Guide**: Nutrition, Fitness, Wellness agents + tracking workflows
|
||||
|
||||
## Suggested Brainstorming Techniques
|
||||
|
||||
Particularly effective for module ideation:
|
||||
|
||||
1. **Domain Immersion**: Deep dive into target domain's problems
|
||||
2. **Persona Mapping**: Who needs this and what do they struggle with?
|
||||
3. **Workflow Mapping**: What processes exist today? How could they improve?
|
||||
4. **Team Building**: What personalities would make a great team?
|
||||
5. **Integration Thinking**: How do pieces connect and amplify each other?
|
||||
|
||||
## Key Questions to Answer
|
||||
|
||||
1. What domain expertise should this module embody?
|
||||
2. What would users be able to do that they can't do now?
|
||||
3. Who are the 3-7 agents and what are their personalities?
|
||||
4. What are the 5-10 core workflows?
|
||||
5. What makes this module delightful to use?
|
||||
6. How is this different from existing tools?
|
||||
7. What's the "killer feature" that makes this essential?
|
||||
|
||||
## Output Goals
|
||||
|
||||
Generate:
|
||||
|
||||
- **Module concept**: Clear vision and purpose
|
||||
- **Agent roster**: Names, roles, personalities for each agent
|
||||
- **Workflow list**: Core workflows with brief descriptions
|
||||
- **Unique angle**: What makes this module special
|
||||
- **Use cases**: 3-5 concrete scenarios where this module shines
|
||||
|
||||
---
|
||||
|
||||
_This focused context helps create cohesive, valuable BMAD modules_
|
||||
|
|
@ -1,92 +0,0 @@
|
|||
# {{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_folder}/{{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
|
||||
|
|
@ -1,231 +0,0 @@
|
|||
/* eslint-disable unicorn/prefer-module, unicorn/prefer-node-protocol */
|
||||
/**
|
||||
* {{MODULE_NAME}} Module Installer
|
||||
* Custom installation logic for complex module setup
|
||||
*
|
||||
* This is a template - replace {{VARIABLES}} with actual values
|
||||
*/
|
||||
|
||||
// const fs = require('fs'); // Uncomment when implementing file operations
|
||||
const path = require('path');
|
||||
|
||||
/**
|
||||
* Main installation function
|
||||
* Called by BMAD installer when processing the module
|
||||
*/
|
||||
async function installModule(config) {
|
||||
console.log('🚀 Installing {{MODULE_NAME}} module...');
|
||||
console.log(` Version: ${config.version}`);
|
||||
console.log(` Module Code: ${config.module_code}`);
|
||||
|
||||
try {
|
||||
// Step 1: Validate environment
|
||||
await validateEnvironment(config);
|
||||
|
||||
// Step 2: Setup custom configurations
|
||||
await setupConfigurations(config);
|
||||
|
||||
// Step 3: Initialize module-specific features
|
||||
await initializeFeatures(config);
|
||||
|
||||
// Step 4: Run post-install tasks
|
||||
await runPostInstallTasks(config);
|
||||
|
||||
console.log('✅ {{MODULE_NAME}} module installed successfully!');
|
||||
return {
|
||||
success: true,
|
||||
message: 'Module installed and configured',
|
||||
};
|
||||
} catch (error) {
|
||||
console.error('❌ Installation failed:', error.message);
|
||||
return {
|
||||
success: false,
|
||||
error: error.message,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate that the environment meets module requirements
|
||||
*/
|
||||
async function validateEnvironment(config) {
|
||||
console.log(' Validating environment...');
|
||||
|
||||
// TODO: Add environment checks
|
||||
// Examples:
|
||||
// - Check for required tools/binaries
|
||||
// - Verify permissions
|
||||
// - Check network connectivity
|
||||
// - Validate API keys
|
||||
|
||||
// Placeholder validation
|
||||
if (!config.project_root) {
|
||||
throw new Error('Project root not defined');
|
||||
}
|
||||
|
||||
console.log(' ✓ Environment validated');
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup module-specific configurations
|
||||
*/
|
||||
async function setupConfigurations(config) {
|
||||
console.log(' Setting up configurations...');
|
||||
|
||||
// TODO: Add configuration setup
|
||||
// Examples:
|
||||
// - Create config files
|
||||
// - Setup environment variables
|
||||
// - Configure external services
|
||||
// - Initialize settings
|
||||
|
||||
// Placeholder configuration
|
||||
const configPath = path.join(config.project_root, 'bmad', config.module_code, 'config.json');
|
||||
|
||||
// Example of module config that would be created
|
||||
// const moduleConfig = {
|
||||
// installed: new Date().toISOString(),
|
||||
// settings: {
|
||||
// // Add default settings
|
||||
// }
|
||||
// };
|
||||
|
||||
// Note: This is a placeholder - actual implementation would write the file
|
||||
console.log(` ✓ Would create config at: ${configPath}`);
|
||||
console.log(' ✓ Configurations complete');
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize module-specific features
|
||||
*/
|
||||
async function initializeFeatures(config) {
|
||||
console.log(' Initializing features...');
|
||||
|
||||
// TODO: Add feature initialization
|
||||
// Examples:
|
||||
// - Create database schemas
|
||||
// - Setup cron jobs
|
||||
// - Initialize caches
|
||||
// - Register webhooks
|
||||
// - Setup file watchers
|
||||
|
||||
// Module-specific initialization based on type
|
||||
switch (config.module_category) {
|
||||
case 'data': {
|
||||
await initializeDataFeatures(config);
|
||||
break;
|
||||
}
|
||||
case 'automation': {
|
||||
await initializeAutomationFeatures(config);
|
||||
break;
|
||||
}
|
||||
case 'integration': {
|
||||
await initializeIntegrationFeatures(config);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
console.log(' - Using standard initialization');
|
||||
}
|
||||
}
|
||||
|
||||
console.log(' ✓ Features initialized');
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize data-related features
|
||||
*/
|
||||
async function initializeDataFeatures(/* config */) {
|
||||
console.log(' - Setting up data storage...');
|
||||
// TODO: Setup databases, data folders, etc.
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize automation features
|
||||
*/
|
||||
async function initializeAutomationFeatures(/* config */) {
|
||||
console.log(' - Setting up automation hooks...');
|
||||
// TODO: Setup triggers, watchers, schedulers
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize integration features
|
||||
*/
|
||||
async function initializeIntegrationFeatures(/* config */) {
|
||||
console.log(' - Setting up integrations...');
|
||||
// TODO: Configure APIs, webhooks, external services
|
||||
}
|
||||
|
||||
/**
|
||||
* Run post-installation tasks
|
||||
*/
|
||||
async function runPostInstallTasks(/* config */) {
|
||||
console.log(' Running post-install tasks...');
|
||||
|
||||
// TODO: Add post-install tasks
|
||||
// Examples:
|
||||
// - Generate sample data
|
||||
// - Run initial workflows
|
||||
// - Send notifications
|
||||
// - Update registries
|
||||
|
||||
console.log(' ✓ Post-install tasks complete');
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize database for the module (optional)
|
||||
*/
|
||||
async function initDatabase(/* config */) {
|
||||
console.log(' Initializing database...');
|
||||
|
||||
// TODO: Add database initialization
|
||||
// This function can be called from install-config.yaml
|
||||
|
||||
console.log(' ✓ Database initialized');
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate sample data for the module (optional)
|
||||
*/
|
||||
async function generateSamples(config) {
|
||||
console.log(' Generating sample data...');
|
||||
|
||||
// TODO: Create sample files, data, configurations
|
||||
// This helps users understand how to use the module
|
||||
|
||||
const samplesPath = path.join(config.project_root, 'examples', config.module_code);
|
||||
|
||||
console.log(` - Would create samples at: ${samplesPath}`);
|
||||
console.log(' ✓ Samples generated');
|
||||
}
|
||||
|
||||
/**
|
||||
* Uninstall the module (cleanup)
|
||||
*/
|
||||
async function uninstallModule(/* config */) {
|
||||
console.log('🗑️ Uninstalling {{MODULE_NAME}} module...');
|
||||
|
||||
try {
|
||||
// TODO: Add cleanup logic
|
||||
// - Remove configurations
|
||||
// - Clean up databases
|
||||
// - Unregister services
|
||||
// - Backup user data
|
||||
|
||||
console.log('✅ Module uninstalled successfully');
|
||||
return { success: true };
|
||||
} catch (error) {
|
||||
console.error('❌ Uninstall failed:', error.message);
|
||||
return {
|
||||
success: false,
|
||||
error: error.message,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// Export functions for BMAD installer
|
||||
module.exports = {
|
||||
installModule,
|
||||
initDatabase,
|
||||
generateSamples,
|
||||
uninstallModule,
|
||||
};
|
||||
|
|
@ -1,577 +0,0 @@
|
|||
# Build Module - Interactive Module Builder Instructions
|
||||
|
||||
<critical>The workflow execution engine is governed by: {project-root}/{bmad_folder}/core/tasks/workflow.xml</critical>
|
||||
<critical>You MUST have already loaded and processed: {project-root}/{bmad_folder}/bmb/workflows/create-module/workflow.yaml</critical>
|
||||
<critical>Study existing modules in: {project-root}/{bmad_folder}/ for patterns</critical>
|
||||
<critical>Communicate in {communication_language} throughout the module creation process</critical>
|
||||
<critical>⚠️ ABSOLUTELY NO TIME ESTIMATES - NEVER mention hours, days, weeks, months, or ANY time-based predictions. AI has fundamentally changed development speed - what once took teams weeks/months can now be done by one person in hours. DO NOT give ANY time estimates whatsoever.</critical>
|
||||
|
||||
<workflow>
|
||||
|
||||
<step n="-1" goal="Optional brainstorming for module ideas" optional="true">
|
||||
<ask>Do you want to brainstorm module ideas first? [y/n]</ask>
|
||||
|
||||
<check if="yes">
|
||||
<action>Invoke brainstorming workflow: {brainstorming_workflow}</action>
|
||||
<action>Pass context data: {brainstorming_context}</action>
|
||||
<action>Wait for brainstorming session completion</action>
|
||||
<action>Use brainstorming output to inform module concept, agent lineup, and workflow portfolio in following steps</action>
|
||||
</check>
|
||||
|
||||
<check if="no">
|
||||
<action>Proceed directly to Step 0</action>
|
||||
</check>
|
||||
|
||||
<template-output>brainstorming_results</template-output>
|
||||
</step>
|
||||
|
||||
<step n="0" goal="Check for module brief" optional="true">
|
||||
<ask>Do you have a module brief or should we create one? [have/create/skip]</ask>
|
||||
|
||||
<check if="create">
|
||||
<action>Invoke module-brief workflow: {project-root}/{bmad_folder}/bmb/workflows/module-brief/workflow.yaml</action>
|
||||
<action>Wait for module brief completion</action>
|
||||
<action>Load the module brief to use as blueprint</action>
|
||||
</check>
|
||||
|
||||
<check if="have">
|
||||
<ask>Provide path to module brief document</ask>
|
||||
<action>Load the module brief and use it to pre-populate all planning sections</action>
|
||||
</check>
|
||||
|
||||
<check if="skip">
|
||||
<action>Proceed directly to Step 1</action>
|
||||
</check>
|
||||
|
||||
<template-output>module_brief</template-output>
|
||||
</step>
|
||||
|
||||
<step n="1" goal="Define module concept and scope">
|
||||
<critical>Load and study the complete module structure guide</critical>
|
||||
<action>Load module structure guide: {module_structure_guide}</action>
|
||||
<action>Understand module types (Simple/Standard/Complex)</action>
|
||||
<action>Review directory structures and component guidelines</action>
|
||||
<action>Study the installation infrastructure patterns</action>
|
||||
|
||||
<action>If brainstorming or module brief was completed, reference those results to guide the conversation</action>
|
||||
|
||||
<action>Guide user to articulate their module's vision, exploring its purpose, what it will help with, and who will use it</action>
|
||||
|
||||
<action>Based on their description, intelligently propose module details:</action>
|
||||
|
||||
**Module Identity Development:**
|
||||
|
||||
1. **Module name** - Extract from their description with proper title case
|
||||
2. **Module code** - Generate kebab-case from name following patterns:
|
||||
- Multi-word descriptive names → shortened kebab-case
|
||||
- Domain-specific terms → recognizable abbreviations
|
||||
- Present suggested code and confirm it works for paths like {bmad_folder}/{{code}}/agents/
|
||||
3. **Module purpose** - Refine their description into 1-2 clear sentences
|
||||
4. **Target audience** - Infer from context or ask if unclear
|
||||
|
||||
**Module Theme Reference Categories:**
|
||||
|
||||
- Domain-Specific (Legal, Medical, Finance, Education)
|
||||
- Creative (RPG/Gaming, Story Writing, Music Production)
|
||||
- Technical (DevOps, Testing, Architecture, Security)
|
||||
- Business (Project Management, Marketing, Sales)
|
||||
- Personal (Journaling, Learning, Productivity)
|
||||
|
||||
<critical>Determine output location:</critical>
|
||||
|
||||
- Module will be created at {installer_output_folder}
|
||||
|
||||
<action>Store module identity for scaffolding</action>
|
||||
|
||||
<template-output>module_identity</template-output>
|
||||
</step>
|
||||
|
||||
<step n="2" goal="Plan module components">
|
||||
<action>Based on the module purpose, intelligently propose an initial component architecture</action>
|
||||
|
||||
**Agents Planning:**
|
||||
|
||||
<action>Suggest agents based on module purpose, considering agent types (Simple/Expert/Module) appropriate to each role</action>
|
||||
|
||||
**Example Agent Patterns by Domain:**
|
||||
|
||||
- Data/Analytics: Analyst, Designer, Builder roles
|
||||
- Gaming/Creative: Game Master, Generator, Storytelling roles
|
||||
- Team/Business: Manager, Facilitator, Documentation roles
|
||||
|
||||
<action>Present suggested agent list with types, explaining we can start with core ones and add others later</action>
|
||||
<action>Confirm which agents resonate with their vision</action>
|
||||
|
||||
**Workflows Planning:**
|
||||
|
||||
<action>Intelligently suggest workflows that complement the proposed agents</action>
|
||||
|
||||
**Example Workflow Patterns by Domain:**
|
||||
|
||||
- Data/Analytics: analyze-dataset, create-dashboard, generate-report
|
||||
- Gaming/Creative: session-prep, generate-encounter, world-building
|
||||
- Team/Business: planning, facilitation, documentation workflows
|
||||
|
||||
<action>For each workflow, note whether it should be Document, Action, or Interactive type</action>
|
||||
<action>Confirm which workflows are most important to start with</action>
|
||||
<action>Determine which to create now vs placeholder</action>
|
||||
|
||||
**Tasks Planning (optional):**
|
||||
<ask>Any special tasks that don't warrant full workflows?</ask>
|
||||
|
||||
<action if="tasks needed">For each task, capture name, purpose, and whether standalone or supporting</action>
|
||||
|
||||
<template-output>module_components</template-output>
|
||||
</step>
|
||||
|
||||
<step n="2b" goal="Determine module complexity">
|
||||
<action>Based on components, intelligently determine module type using criteria:</action>
|
||||
|
||||
**Simple Module Criteria:**
|
||||
|
||||
- 1-2 agents, all Simple type
|
||||
- 1-3 workflows
|
||||
- No complex integrations
|
||||
|
||||
**Standard Module Criteria:**
|
||||
|
||||
- 2-4 agents with mixed types
|
||||
- 3-8 workflows
|
||||
- Some shared resources
|
||||
|
||||
**Complex Module Criteria:**
|
||||
|
||||
- 4+ agents or multiple Module-type agents
|
||||
- 8+ workflows
|
||||
- Complex interdependencies
|
||||
- External integrations
|
||||
|
||||
<action>Present determined module type with explanation of what structure will be set up</action>
|
||||
|
||||
<template-output>module_type</template-output>
|
||||
</step>
|
||||
|
||||
<step n="3" goal="Create module directory structure">
|
||||
<critical>Use module path determined in Step 1:</critical>
|
||||
- The module base path is {{module_path}}
|
||||
|
||||
<action>Create base module directories at the determined path:</action>
|
||||
|
||||
```
|
||||
{{module_code}}/
|
||||
├── 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-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="Plan module configuration fields">
|
||||
<action>Based on the module purpose and components, determine what configuration settings the module needs</action>
|
||||
|
||||
**Configuration Field Planning:**
|
||||
|
||||
<ask>Does your module need any user-configurable settings during installation?</ask>
|
||||
|
||||
**Common configuration patterns:**
|
||||
|
||||
- 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
|
||||
|
||||
<action>For each configuration field needed, determine:</action>
|
||||
|
||||
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)
|
||||
|
||||
<action>Store planned configuration fields for installer generation in step 7</action>
|
||||
|
||||
<template-output>module_config_fields</template-output>
|
||||
</step>
|
||||
|
||||
<step n="5" goal="Create first agent" optional="true">
|
||||
<ask>Create your first agent now? [yes/no]</ask>
|
||||
|
||||
<check if="yes">
|
||||
<action>Invoke agent builder workflow: {agent_builder}</action>
|
||||
<action>Pass module_components as context input</action>
|
||||
<action>Guide them to create the primary agent for the module</action>
|
||||
|
||||
<critical>Save to module's agents folder:</critical>
|
||||
|
||||
- Save to {{module_path}}/agents/
|
||||
</check>
|
||||
|
||||
<check if="no">
|
||||
<action>Create placeholder file in agents folder with TODO notes including agent name, purpose, and type</action>
|
||||
</check>
|
||||
|
||||
<template-output>first_agent</template-output>
|
||||
</step>
|
||||
|
||||
<step n="6" goal="Create first workflow" optional="true">
|
||||
<ask>Create your first workflow now? [yes/no]</ask>
|
||||
|
||||
<check if="yes">
|
||||
<action>Invoke workflow builder: {workflow_builder}</action>
|
||||
<action>Pass module_components as context input</action>
|
||||
<action>Guide them to create the primary workflow</action>
|
||||
|
||||
<critical>Save to module's workflows folder:</critical>
|
||||
|
||||
- Save to {{module_path}}/workflows/
|
||||
</check>
|
||||
|
||||
<check if="no">
|
||||
<action>Create placeholder workflow folder structure with TODO notes for workflow.yaml, instructions.md, and template.md if document workflow</action>
|
||||
</check>
|
||||
|
||||
<template-output>first_workflow</template-output>
|
||||
</step>
|
||||
|
||||
<step n="7" goal="Setup module installer">
|
||||
<action>Load installer template from: {installer_templates}/install-config.yaml</action>
|
||||
|
||||
<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}} Module Configuration
|
||||
# This file defines installation questions and module configuration values
|
||||
|
||||
code: {{module_code}}
|
||||
name: "{{module_name}}"
|
||||
default_selected: false # Set to true if this should be selected by default
|
||||
|
||||
# Welcome message shown during installation
|
||||
prompt:
|
||||
- "Thank you for choosing {{module_name}}!"
|
||||
- "{{brief_module_description}}"
|
||||
|
||||
# Core config values are automatically inherited:
|
||||
## user_name
|
||||
## communication_language
|
||||
## document_output_language
|
||||
## output_folder
|
||||
|
||||
# ============================================================================
|
||||
# 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)
|
||||
# ============================================================================
|
||||
|
||||
# EXAMPLE Interactive text input:
|
||||
# output_path:
|
||||
# prompt: "Where should {{module_code}} save outputs?"
|
||||
# default: "output/{{module_code}}"
|
||||
# result: "{project-root}/{value}"
|
||||
|
||||
# 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_folder}/{{module_code}}/data"
|
||||
|
||||
{{generated_config_fields_from_step_4}}
|
||||
```
|
||||
|
||||
<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">
|
||||
```javascript
|
||||
// {{module_name}} Module Installer
|
||||
// Custom installation logic
|
||||
|
||||
- @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;
|
||||
|
||||
logger.log('Running {{module_name}} custom installer...');
|
||||
|
||||
// TODO: Add custom installation logic here
|
||||
// Examples:
|
||||
// - Create database tables
|
||||
// - Download external assets
|
||||
// - Configure API connections
|
||||
// - Initialize data files
|
||||
// - Set up webhooks or integrations
|
||||
|
||||
logger.log('{{module_name}} custom installation complete!');
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
module.exports = { install };
|
||||
|
||||
`````
|
||||
|
||||
<critical>Save location:</critical>
|
||||
|
||||
- Save to {{module_path}}/module-installer/installer.js
|
||||
</check>
|
||||
|
||||
<check if="no">
|
||||
<action>Skip installer.js creation - the standard installer will handle everything</action>
|
||||
</check>
|
||||
|
||||
<template-output>installer_config</template-output>
|
||||
</step>
|
||||
|
||||
<step n="8" goal="Create module documentation">
|
||||
Generate comprehensive README.md:
|
||||
|
||||
````markdown
|
||||
# {{module_name}}
|
||||
|
||||
{{module_purpose}}
|
||||
|
||||
## Overview
|
||||
|
||||
This module provides:
|
||||
{{component_summary}}
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
bmad install {{module_code}}
|
||||
`````
|
||||
|
||||
````
|
||||
|
||||
## Components
|
||||
|
||||
### Agents ({{agent_count}})
|
||||
|
||||
{{agent_documentation}}
|
||||
|
||||
### Workflows ({{workflow_count}})
|
||||
|
||||
{{workflow_documentation}}
|
||||
|
||||
### Tasks ({{task_count}})
|
||||
|
||||
{{task_documentation}}
|
||||
|
||||
## Quick Start
|
||||
|
||||
1. **Load the main agent:**
|
||||
|
||||
```
|
||||
agent {{primary_agent}}
|
||||
```
|
||||
|
||||
2. **View available commands:**
|
||||
|
||||
```
|
||||
*help
|
||||
```
|
||||
|
||||
3. **Run the main workflow:**
|
||||
```
|
||||
workflow {{primary_workflow}}
|
||||
```
|
||||
|
||||
## Module Structure
|
||||
|
||||
```
|
||||
{{directory_tree}}
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
The module can be configured in `{bmad_folder}/{{module_code}}/config.yaml`
|
||||
|
||||
Key settings:
|
||||
{{configuration_options}}
|
||||
|
||||
## Examples
|
||||
|
||||
### Example 1: {{example_use_case}}
|
||||
|
||||
{{example_walkthrough}}
|
||||
|
||||
## Development Roadmap
|
||||
|
||||
- [ ] {{roadmap_item_1}}
|
||||
- [ ] {{roadmap_item_2}}
|
||||
- [ ] {{roadmap_item_3}}
|
||||
|
||||
## Contributing
|
||||
|
||||
To extend this module:
|
||||
|
||||
1. Add new agents using `create-agent` workflow
|
||||
2. Add new workflows using `create-workflow` workflow
|
||||
3. Submit improvements via pull request
|
||||
|
||||
## Author
|
||||
|
||||
Created by {{user_name}} on {{date}}
|
||||
|
||||
````
|
||||
|
||||
<template-output>module_readme</template-output>
|
||||
</step>
|
||||
|
||||
<step n="9" goal="Generate component roadmap">
|
||||
Create a development roadmap for remaining components:
|
||||
|
||||
**TODO.md file:**
|
||||
|
||||
```markdown
|
||||
# {{module_name}} Development Roadmap
|
||||
|
||||
## Phase 1: Core Components
|
||||
|
||||
{{phase1_tasks}}
|
||||
|
||||
## Phase 2: Enhanced Features
|
||||
|
||||
{{phase2_tasks}}
|
||||
|
||||
## Phase 3: Polish and Integration
|
||||
|
||||
{{phase3_tasks}}
|
||||
|
||||
## Quick Commands
|
||||
|
||||
Create new agent:
|
||||
```
|
||||
|
||||
workflow create-agent
|
||||
|
||||
```
|
||||
|
||||
Create new workflow:
|
||||
```
|
||||
|
||||
workflow create-workflow
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
{{development_notes}}
|
||||
```
|
||||
|
||||
Ask if user wants to:
|
||||
|
||||
1. Continue building more components now
|
||||
2. Save roadmap for later development
|
||||
3. Test what's been built so far
|
||||
|
||||
<template-output>development_roadmap</template-output>
|
||||
</step>
|
||||
|
||||
<step n="10" goal="Validate and finalize module">
|
||||
<action>Run validation checks:</action>
|
||||
|
||||
**Structure validation:**
|
||||
|
||||
- All required directories created
|
||||
- Config files properly formatted
|
||||
- Installer configuration valid
|
||||
|
||||
**Component validation:**
|
||||
|
||||
- At least one agent or workflow exists (or planned)
|
||||
- All references use correct paths
|
||||
- Module code consistent throughout
|
||||
|
||||
**Documentation validation:**
|
||||
|
||||
- README.md complete
|
||||
- Installation instructions clear
|
||||
- Examples provided
|
||||
|
||||
<action>Present summary to {user_name}:</action>
|
||||
|
||||
- Module name and code
|
||||
- Location path
|
||||
- Agent count (created vs planned)
|
||||
- Workflow count (created vs planned)
|
||||
- Task count
|
||||
- Installer status
|
||||
|
||||
<action>Provide next steps guidance:</action>
|
||||
|
||||
1. Complete remaining components using roadmap
|
||||
2. Run the BMAD Method installer to this project location
|
||||
3. Select 'Compile Agents' option after confirming folder
|
||||
4. Module will be compiled and available for use
|
||||
5. Test with bmad install command
|
||||
6. Share or integrate with existing system
|
||||
|
||||
<ask>Would you like to:
|
||||
|
||||
- Create another component now?
|
||||
- Test the module installation?
|
||||
- Exit and continue later?
|
||||
</ask>
|
||||
|
||||
<template-output>module_summary</template-output>
|
||||
</step>
|
||||
|
||||
</workflow>
|
||||
|
|
@ -1,400 +0,0 @@
|
|||
# BMAD Module Structure Guide
|
||||
|
||||
## What is a Module?
|
||||
|
||||
A BMAD module is a self-contained package of agents, workflows, tasks, and resources that work together to provide specialized functionality. Think of it as an expansion pack for the BMAD Method.
|
||||
|
||||
## Module Architecture
|
||||
|
||||
### Core Structure
|
||||
|
||||
```
|
||||
# SOURCE MODULE (in BMAD-METHOD project)
|
||||
src/modules/{module-code}/
|
||||
├── agents/ # Agent definitions (.agent.yaml)
|
||||
├── workflows/ # Workflow folders
|
||||
├── tasks/ # Task files
|
||||
├── tools/ # Tool 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_folder}/{module-code}/
|
||||
├── agents/ # Compiled agent files (.md)
|
||||
├── workflows/ # Workflow instances
|
||||
├── tasks/ # Task files
|
||||
├── tools/ # Tool files
|
||||
├── templates/ # Templates
|
||||
├── data/ # Module data
|
||||
├── config.yaml # Generated from install-config.yaml
|
||||
└── README.md # Module documentation
|
||||
```
|
||||
|
||||
## Module Types by Complexity
|
||||
|
||||
### Simple Module (1-2 agents, 2-3 workflows)
|
||||
|
||||
Perfect for focused, single-purpose tools.
|
||||
|
||||
**Example: Code Review Module**
|
||||
|
||||
- 1 Reviewer Agent
|
||||
- 2 Workflows: quick-review, deep-review
|
||||
- Clear, narrow scope
|
||||
|
||||
### Standard Module (3-5 agents, 5-10 workflows)
|
||||
|
||||
Comprehensive solution for a domain.
|
||||
|
||||
**Example: Project Management Module**
|
||||
|
||||
- PM Agent, Scrum Master Agent, Analyst Agent
|
||||
- Workflows: sprint-planning, retrospective, roadmap, user-stories
|
||||
- Integrated component ecosystem
|
||||
|
||||
### Complex Module (5+ agents, 10+ workflows)
|
||||
|
||||
Full platform or framework.
|
||||
|
||||
**Example: RPG Toolkit Module**
|
||||
|
||||
- DM Agent, NPC Agent, Monster Agent, Loot Agent, Map Agent
|
||||
- 15+ workflows for every aspect of game management
|
||||
- Multiple interconnected systems
|
||||
|
||||
## Module Naming Conventions
|
||||
|
||||
### Module Code (kebab-case)
|
||||
|
||||
- `data-viz` - Data Visualization
|
||||
- `team-collab` - Team Collaboration
|
||||
- `rpg-toolkit` - RPG Toolkit
|
||||
- `legal-assist` - Legal Assistant
|
||||
|
||||
### Module Name (Title Case)
|
||||
|
||||
- "Data Visualization Suite"
|
||||
- "Team Collaboration Platform"
|
||||
- "RPG Game Master Toolkit"
|
||||
- "Legal Document Assistant"
|
||||
|
||||
## Component Guidelines
|
||||
|
||||
### Agents per Module
|
||||
|
||||
**Recommended Distribution:**
|
||||
|
||||
- **Primary Agent (1)**: The main interface/orchestrator
|
||||
- **Specialist Agents (2-4)**: Domain-specific experts
|
||||
- **Utility Agents (0-2)**: Helper/support functions
|
||||
|
||||
**Anti-patterns to Avoid:**
|
||||
|
||||
- Too many overlapping agents
|
||||
- Agents that could be combined
|
||||
- Agents without clear purpose
|
||||
|
||||
### Workflows per Module
|
||||
|
||||
**Categories:**
|
||||
|
||||
- **Core Workflows (2-3)**: Essential functionality
|
||||
- **Feature Workflows (3-5)**: Specific capabilities
|
||||
- **Utility Workflows (2-3)**: Supporting operations
|
||||
- **Admin Workflows (0-2)**: Maintenance/config
|
||||
|
||||
**Workflow Complexity Guide:**
|
||||
|
||||
- Simple: 3-5 steps, single output
|
||||
- Standard: 5-10 steps, multiple outputs
|
||||
- Complex: 10+ steps, conditional logic, sub-workflows
|
||||
|
||||
### Tasks per Module
|
||||
|
||||
Tasks should be used for:
|
||||
|
||||
- Single-operation utilities
|
||||
- Shared subroutines
|
||||
- Quick actions that don't warrant workflows
|
||||
|
||||
## Module Dependencies
|
||||
|
||||
### Internal Dependencies
|
||||
|
||||
- Agents can reference module workflows
|
||||
- Workflows can invoke module tasks
|
||||
- Tasks can use module templates
|
||||
|
||||
### External Dependencies
|
||||
|
||||
- Reference other modules via full paths
|
||||
- Declare dependencies in config.yaml
|
||||
- Version compatibility notes
|
||||
|
||||
### Workflow Vendoring (Advanced)
|
||||
|
||||
For modules that need workflows from other modules but want to remain standalone, use **workflow vendoring**:
|
||||
|
||||
**In Agent YAML:**
|
||||
|
||||
```yaml
|
||||
menu:
|
||||
- trigger: command-name
|
||||
exec: '{project-root}/{bmad_folder}/SOURCE_MODULE/workflows/path/workflow.md'
|
||||
workflow-install: '{project-root}/{bmad_folder}/THIS_MODULE/workflows/vendored/workflow.md'
|
||||
description: 'Command description'
|
||||
```
|
||||
|
||||
**What Happens:**
|
||||
|
||||
- During installation, workflows are copied from `workflow` to `workflow-install` location
|
||||
- Vendored workflows get `config_source` updated to reference this module's config
|
||||
- Compiled agent only references the `workflow-install` path
|
||||
- Module becomes fully standalone - no source module dependency required
|
||||
|
||||
**Use Cases:**
|
||||
|
||||
- Specialized modules that reuse common workflows with different configs
|
||||
- Domain-specific adaptations (e.g., game dev using standard dev workflows)
|
||||
- Testing workflows in isolation
|
||||
|
||||
**Benefits:**
|
||||
|
||||
- Module independence (no forced dependencies)
|
||||
- Clean namespace (workflows in your module)
|
||||
- Config isolation (use your module's settings)
|
||||
- Customization ready (modify vendored workflows freely)
|
||||
|
||||
## Installation Infrastructure
|
||||
|
||||
### Required: module-installer/install-config.yaml
|
||||
|
||||
This file defines both installation questions AND static configuration values:
|
||||
|
||||
```yaml
|
||||
# Module metadata
|
||||
code: module-code
|
||||
name: 'Module Name'
|
||||
default_selected: false
|
||||
|
||||
# Welcome message during installation
|
||||
prompt:
|
||||
- 'Welcome to Module Name!'
|
||||
- 'Brief description here'
|
||||
|
||||
# Core values automatically inherited from installer:
|
||||
## user_name
|
||||
## communication_language
|
||||
## document_output_language
|
||||
## output_folder
|
||||
|
||||
# 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_folder}/module-code/data'
|
||||
```
|
||||
|
||||
**Key Points:**
|
||||
|
||||
- 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
|
||||
|
||||
### Optional: module-installer/installer.js
|
||||
|
||||
For complex installations requiring custom logic:
|
||||
|
||||
```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
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
module.exports = { install };
|
||||
```
|
||||
|
||||
### Optional: module-installer/assets/
|
||||
|
||||
Files to copy during installation:
|
||||
|
||||
- External configurations
|
||||
- Documentation
|
||||
- Example files
|
||||
- Integration scripts
|
||||
|
||||
## Module Lifecycle
|
||||
|
||||
### Development Phases
|
||||
|
||||
1. **Planning Phase**
|
||||
- Define scope and purpose
|
||||
- Identify components
|
||||
- Design architecture
|
||||
|
||||
2. **Scaffolding Phase**
|
||||
- Create directory structure
|
||||
- Generate configurations
|
||||
- Setup installer
|
||||
|
||||
3. **Building Phase**
|
||||
- Create agents incrementally
|
||||
- Build workflows progressively
|
||||
- Add tasks as needed
|
||||
|
||||
4. **Testing Phase**
|
||||
- Test individual components
|
||||
- Verify integration
|
||||
- Validate installation
|
||||
|
||||
5. **Deployment Phase**
|
||||
- Package module
|
||||
- Document usage
|
||||
- Distribute/share
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Module Cohesion
|
||||
|
||||
- All components should relate to module theme
|
||||
- Clear boundaries between modules
|
||||
- No feature creep
|
||||
|
||||
### Progressive Enhancement
|
||||
|
||||
- Start with MVP (1 agent, 2 workflows)
|
||||
- Add components based on usage
|
||||
- Refactor as patterns emerge
|
||||
|
||||
### Documentation Standards
|
||||
|
||||
- Every module needs README.md
|
||||
- Each agent needs purpose statement
|
||||
- Workflows need clear descriptions
|
||||
- Include examples and quickstart
|
||||
|
||||
### Naming Consistency
|
||||
|
||||
- Use module code prefix for uniqueness
|
||||
- Consistent naming patterns within module
|
||||
- Clear, descriptive names
|
||||
|
||||
## Example Modules
|
||||
|
||||
### Example 1: Personal Productivity
|
||||
|
||||
```
|
||||
productivity/
|
||||
├── agents/
|
||||
│ ├── task-manager.md # GTD methodology
|
||||
│ └── focus-coach.md # Pomodoro timer
|
||||
├── workflows/
|
||||
│ ├── daily-planning/ # Morning routine
|
||||
│ ├── weekly-review/ # Week retrospective
|
||||
│ └── project-setup/ # New project init
|
||||
└── config.yaml
|
||||
```
|
||||
|
||||
### Example 2: Content Creation
|
||||
|
||||
```
|
||||
content/
|
||||
├── agents/
|
||||
│ ├── writer.md # Blog/article writer
|
||||
│ ├── editor.md # Copy editor
|
||||
│ └── seo-optimizer.md # SEO specialist
|
||||
├── workflows/
|
||||
│ ├── blog-post/ # Full blog creation
|
||||
│ ├── social-media/ # Social content
|
||||
│ ├── email-campaign/ # Email sequence
|
||||
│ └── content-calendar/ # Planning
|
||||
└── templates/
|
||||
├── blog-template.md
|
||||
└── email-template.md
|
||||
```
|
||||
|
||||
### Example 3: DevOps Automation
|
||||
|
||||
```
|
||||
devops/
|
||||
├── agents/
|
||||
│ ├── deploy-master.md # Deployment orchestrator
|
||||
│ ├── monitor.md # System monitoring
|
||||
│ ├── incident-responder.md # Incident management
|
||||
│ └── infra-architect.md # Infrastructure design
|
||||
├── workflows/
|
||||
│ ├── ci-cd-setup/ # Pipeline creation
|
||||
│ ├── deploy-app/ # Application deployment
|
||||
│ ├── rollback/ # Emergency rollback
|
||||
│ ├── health-check/ # System verification
|
||||
│ └── incident-response/ # Incident handling
|
||||
├── tasks/
|
||||
│ ├── check-status.md # Quick status check
|
||||
│ └── notify-team.md # Team notifications
|
||||
└── data/
|
||||
└── runbooks/ # Operational guides
|
||||
```
|
||||
|
||||
## Module Evolution Pattern
|
||||
|
||||
```
|
||||
Simple Module → Standard Module → Complex Module → Module Suite
|
||||
(MVP) (Enhanced) (Complete) (Ecosystem)
|
||||
```
|
||||
|
||||
## Common Pitfalls
|
||||
|
||||
1. **Over-engineering**: Starting too complex
|
||||
2. **Under-planning**: No clear architecture
|
||||
3. **Poor boundaries**: Module does too much
|
||||
4. **Weak integration**: Components don't work together
|
||||
5. **Missing docs**: No clear usage guide
|
||||
|
||||
## Success Metrics
|
||||
|
||||
A well-designed module has:
|
||||
|
||||
- ✅ Clear, focused purpose
|
||||
- ✅ Cohesive components
|
||||
- ✅ Smooth installation
|
||||
- ✅ Comprehensive docs
|
||||
- ✅ Room for growth
|
||||
- ✅ Happy users!
|
||||
|
|
@ -1,52 +0,0 @@
|
|||
# Build Module Workflow Configuration
|
||||
name: create-module
|
||||
description: "Interactive workflow to build complete BMAD modules with agents, workflows, tasks, and installation infrastructure"
|
||||
author: "BMad"
|
||||
|
||||
# Critical variables load from config_source
|
||||
config_source: "{project-root}/{bmad_folder}/bmb/config.yaml"
|
||||
custom_module_location: "{config_source}:custom_module_location"
|
||||
communication_language: "{config_source}:communication_language"
|
||||
user_name: "{config_source}:user_name"
|
||||
|
||||
# Reference guides for module building
|
||||
module_structure_guide: "{installed_path}/module-structure.md"
|
||||
installer_templates: "{installed_path}/installer-templates/"
|
||||
|
||||
# Use existing build workflows
|
||||
agent_builder: "{project-root}/{bmad_folder}/bmb/workflows/create-agent/workflow.yaml"
|
||||
workflow_builder: "{project-root}/{bmad_folder}/bmb/workflows/create-workflow/workflow.yaml"
|
||||
brainstorming_workflow: "{project-root}/{bmad_folder}/core/workflows/brainstorming/workflow.yaml"
|
||||
brainstorming_context: "{installed_path}/brainstorm-context.md"
|
||||
|
||||
# Reference examples - for learning patterns
|
||||
bmm_module_dir: "{project-root}/{bmad_folder}/bmm/"
|
||||
cis_module_dir: "{project-root}/{bmad_folder}/cis/"
|
||||
existing_agents_dir: "{project-root}/{bmad_folder}/*/agents/"
|
||||
existing_workflows_dir: "{project-root}/{bmad_folder}/*/workflows/"
|
||||
|
||||
# Optional user inputs - discovered if they exist
|
||||
input_file_patterns:
|
||||
module_brief:
|
||||
description: "Module brief with vision and requirements (optional)"
|
||||
whole: "{output_folder}/module-brief-*.md"
|
||||
load_strategy: "FULL_LOAD"
|
||||
brainstorming:
|
||||
description: "Brainstorming session outputs (optional)"
|
||||
whole: "{output_folder}/brainstorming-*.md"
|
||||
load_strategy: "FULL_LOAD"
|
||||
|
||||
# Module path and component files
|
||||
installed_path: "{project-root}/{bmad_folder}/bmb/workflows/create-module"
|
||||
template: false # This is an interactive scaffolding workflow
|
||||
instructions: "{installed_path}/instructions.md"
|
||||
validation: "{installed_path}/checklist.md"
|
||||
|
||||
# Output configuration - creates entire module structure
|
||||
# Save to custom_module_location/{{module_code}}
|
||||
installer_output_folder: "{custom_module_location}/{{module_code}}"
|
||||
|
||||
standalone: true
|
||||
|
||||
# Web bundle configuration
|
||||
web_bundle: false # BMB workflows run locally in BMAD-METHOD project
|
||||
|
|
@ -24,7 +24,6 @@ Use this checklist to validate module edits meet BMAD Core standards.
|
|||
|
||||
### Optional Fields (if used)
|
||||
|
||||
- [ ] custom_agent_location documented
|
||||
- [ ] custom_module_location documented
|
||||
- [ ] Module-specific fields documented in README
|
||||
|
||||
|
|
|
|||
|
|
@ -2,12 +2,24 @@
|
|||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
# Quick install (interactive)
|
||||
npx bmad-method agent-install --source ./{agent_filename}.agent.yaml
|
||||
Create a `custom.yaml` file in the agent folder:
|
||||
|
||||
# Quick install (non-interactive)
|
||||
npx bmad-method agent-install --source ./{agent_filename}.agent.yaml --defaults
|
||||
```yaml
|
||||
code: { agent_code }
|
||||
name: '{agent_name}'
|
||||
default_selected: true
|
||||
```
|
||||
|
||||
Then run:
|
||||
|
||||
```bash
|
||||
npx bmad-method install
|
||||
```
|
||||
|
||||
Or if you have bmad-cli installed globally:
|
||||
|
||||
```bash
|
||||
bmad install
|
||||
```
|
||||
|
||||
## About This Agent
|
||||
|
|
|
|||
|
|
@ -166,8 +166,8 @@ Expert agents support three types of menu actions:
|
|||
## Notes for Module Creation:
|
||||
|
||||
1. **File Paths**:
|
||||
- Agent files go in: `{custom_module_location}/{module_name}/agents/[agent-name].yaml`
|
||||
- Sidecar folders go in: `{custom_module_location}/{module_name}/agents/[agent-name]-sidecar/`
|
||||
- Agent files go in: `{custom_module_location}/{module_name}/agents/[agent-name]/[agent-name].yaml`
|
||||
- Sidecar folders go in: `{custom_module_location}/{module_name}/agents/[agent-name]/[agent-name]-sidecar/`
|
||||
|
||||
2. **Variable Usage**:
|
||||
- `{agent_sidecar_folder}` resolves to the agents sidecar folder destination after installation
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ nextStepFile: '{workflow_path}/steps/step-02-gather.md'
|
|||
workflowFile: '{workflow_path}/workflow.md'
|
||||
|
||||
# Output files for workflow creation process
|
||||
targetWorkflowPath: '{custom_workflow_location}/{new_workflow_name}'
|
||||
targetWorkflowPath: '{custom_stand_alone_location}/workflows/{new_workflow_name}'
|
||||
workflowPlanFile: '{targetWorkflowPath}/workflow-plan-{new_workflow_name}.md'
|
||||
# Template References
|
||||
# No workflow plan template needed - will create plan file directly
|
||||
|
|
@ -83,7 +83,7 @@ After getting the workflow name:
|
|||
|
||||
**Check for existing workflows:**
|
||||
|
||||
- Look for folder at `{custom_workflow_location}/{new_workflow_name}/`
|
||||
- Look for folder at `{custom_stand_alone_location}/workflows/{new_workflow_name}/`
|
||||
- If it exists, inform the user and suggest or get from them a unique name or postfix
|
||||
|
||||
**Example alternatives:**
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ workflow_path: '{project-root}/{bmad_folder}/bmb/workflows/create-workflow'
|
|||
thisStepFile: '{workflow_path}/steps/step-02-gather.md'
|
||||
nextStepFile: '{workflow_path}/steps/step-03-tools-configuration.md'
|
||||
# Output files for workflow creation process
|
||||
targetWorkflowPath: '{custom_workflow_location}/{new_workflow_name}'
|
||||
targetWorkflowPath: '{custom_stand_alone_location}/workflows/{new_workflow_name}'
|
||||
workflowPlanFile: '{targetWorkflowPath}/workflow-plan-{new_workflow_name}.md'
|
||||
|
||||
# Task References
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ workflow_path: '{project-root}/{bmad_folder}/bmb/workflows/create-workflow'
|
|||
thisStepFile: '{workflow_path}/steps/step-03-tools-configuration.md'
|
||||
nextStepFile: '{workflow_path}/steps/step-04-plan-review.md'
|
||||
|
||||
targetWorkflowPath: '{custom_workflow_location}/{new_workflow_name}'
|
||||
targetWorkflowPath: '{custom_stand_alone_location}/workflows/{new_workflow_name}'
|
||||
workflowPlanFile: '{targetWorkflowPath}/workflow-plan-{new_workflow_name}.md'
|
||||
|
||||
# Documentation References
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ thisStepFile: '{workflow_path}/steps/step-04-plan-review.md'
|
|||
nextStepFormDesign: '{workflow_path}/steps/step-05-output-format-design.md'
|
||||
nextStepDesign: '{workflow_path}/steps/step-06-design.md'
|
||||
|
||||
targetWorkflowPath: '{custom_workflow_location}/{new_workflow_name}'
|
||||
targetWorkflowPath: '{custom_stand_alone_location}/workflows/{new_workflow_name}'
|
||||
workflowPlanFile: '{targetWorkflowPath}/workflow-plan-{new_workflow_name}.md'
|
||||
|
||||
# Task References
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ workflow_path: '{project-root}/{bmad_folder}/bmb/workflows/create-workflow'
|
|||
thisStepFile: '{workflow_path}/steps/step-05-output-format-design.md'
|
||||
nextStepFile: '{workflow_path}/steps/step-06-design.md'
|
||||
|
||||
targetWorkflowPath: '{custom_workflow_location}/{new_workflow_name}'
|
||||
targetWorkflowPath: '{custom_stand_alone_location}/workflows/{new_workflow_name}'
|
||||
workflowPlanFile: '{targetWorkflowPath}/workflow-plan-{new_workflow_name}.md'
|
||||
|
||||
# Task References
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ thisStepFile: '{workflow_path}/steps/step-06-design.md'
|
|||
nextStepFile: '{workflow_path}/steps/step-07-build.md'
|
||||
workflowFile: '{workflow_path}/workflow.md'
|
||||
# Output files for workflow creation process
|
||||
targetWorkflowPath: '{custom_workflow_location}/{new_workflow_name}'
|
||||
targetWorkflowPath: '{custom_stand_alone_location}/workflows/{new_workflow_name}'
|
||||
workflowPlanFile: '{targetWorkflowPath}/workflow-plan-{new_workflow_name}.md'
|
||||
|
||||
# Task References
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ thisStepFile: '{workflow_path}/steps/step-07-build.md'
|
|||
nextStepFile: '{workflow_path}/steps/step-08-review.md'
|
||||
workflowFile: '{workflow_path}/workflow.md'
|
||||
# Output files for workflow creation process
|
||||
targetWorkflowPath: '{custom_workflow_location}/{new_workflow_name}'
|
||||
targetWorkflowPath: '{custom_stand_alone_location}/workflows/{new_workflow_name}'
|
||||
workflowPlanFile: '{targetWorkflowPath}/workflow-plan-{new_workflow_name}.md'
|
||||
|
||||
# Template References
|
||||
|
|
@ -95,7 +95,7 @@ Ready to proceed?"
|
|||
Create the workflow folder structure in the target location:
|
||||
|
||||
```
|
||||
{custom_workflow_location}/{workflow_name}/
|
||||
{custom_stand_alone_location}/workflows/{workflow_name}/
|
||||
├── workflow.md
|
||||
├── steps/
|
||||
│ ├── step-01-init.md
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ thisStepFile: '{workflow_path}/steps/step-08-review.md'
|
|||
workflowFile: '{workflow_path}/workflow.md'
|
||||
|
||||
# Output files for workflow creation process
|
||||
targetWorkflowPath: '{custom_workflow_location}/{new_workflow_name}'
|
||||
targetWorkflowPath: '{custom_stand_alone_location}/workflows/{new_workflow_name}'
|
||||
workflowPlanFile: '{targetWorkflowPath}/workflow-plan-{new_workflow_name}.md'
|
||||
|
||||
# Task References
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ workflow_path: '{project-root}/{bmad_folder}/bmb/workflows/create-workflow'
|
|||
thisStepFile: '{workflow_path}/steps/step-09-complete.md'
|
||||
workflowFile: '{workflow_path}/workflow.md'
|
||||
# Output files for workflow creation process
|
||||
targetWorkflowPath: '{custom_workflow_location}/{new_workflow_name}'
|
||||
targetWorkflowPath: '{custom_stand_alone_location}/workflows/{new_workflow_name}'
|
||||
workflowPlanFile: '{targetWorkflowPath}/workflow-plan-{new_workflow_name}.md'
|
||||
completionFile: '{targetWorkflowPath}/completion-summary-{new_workflow_name}.md'
|
||||
---
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ This uses **step-file architecture** for disciplined execution:
|
|||
|
||||
Load and read full config from {project-root}/{bmad_folder}/bmb/config.yaml and resolve:
|
||||
|
||||
- `project_name`, `output_folder`, `user_name`, `communication_language`, `document_output_language`, `custom_workflow_location`
|
||||
- `project_name`, `output_folder`, `user_name`, `communication_language`, `document_output_language`, `custom_stand_alone_location`
|
||||
|
||||
### 2. First Step EXECUTION
|
||||
|
||||
|
|
|
|||
|
|
@ -1,641 +0,0 @@
|
|||
const chalk = require('chalk');
|
||||
const path = require('node:path');
|
||||
const fs = require('node:fs');
|
||||
const readline = require('node:readline');
|
||||
const yaml = require('js-yaml');
|
||||
const inquirer = require('inquirer');
|
||||
const {
|
||||
findBmadConfig,
|
||||
resolvePath,
|
||||
discoverAgents,
|
||||
loadAgentConfig,
|
||||
promptInstallQuestions,
|
||||
detectBmadProject,
|
||||
addToManifest,
|
||||
extractManifestData,
|
||||
checkManifestForPath,
|
||||
updateManifestEntry,
|
||||
saveAgentSource,
|
||||
createIdeSlashCommands,
|
||||
updateManifestYaml,
|
||||
} = require('../lib/agent/installer');
|
||||
|
||||
/**
|
||||
* Initialize BMAD core infrastructure in a directory
|
||||
* @param {string} projectDir - Project directory where .bmad should be created
|
||||
* @param {string} bmadFolderName - Name of the BMAD folder (default: .bmad)
|
||||
* @returns {Promise<Object>} BMAD project info
|
||||
*/
|
||||
async function initializeBmadCore(projectDir, bmadFolderName = '.bmad') {
|
||||
const bmadDir = path.join(projectDir, bmadFolderName);
|
||||
const cfgDir = path.join(bmadDir, '_cfg');
|
||||
|
||||
console.log(chalk.cyan('\n🏗️ Initializing BMAD Core Infrastructure\n'));
|
||||
|
||||
// Use the ConfigCollector to ask proper core configuration questions
|
||||
const { ConfigCollector } = require('../installers/lib/core/config-collector');
|
||||
const configCollector = new ConfigCollector();
|
||||
|
||||
// Collect core configuration answers
|
||||
await configCollector.loadExistingConfig(projectDir);
|
||||
await configCollector.collectModuleConfig('core', projectDir, true, true);
|
||||
|
||||
// Extract core answers from allAnswers (they are prefixed with 'core_')
|
||||
const coreAnswers = {};
|
||||
if (configCollector.allAnswers) {
|
||||
for (const [key, value] of Object.entries(configCollector.allAnswers)) {
|
||||
if (key.startsWith('core_')) {
|
||||
const configKey = key.slice(5); // Remove 'core_' prefix
|
||||
coreAnswers[configKey] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Ask for IDE selection
|
||||
console.log(chalk.cyan('\n💻 IDE Configuration\n'));
|
||||
console.log(chalk.dim('Select IDEs to integrate with the installed agents:'));
|
||||
|
||||
const { UI } = require('../lib/ui');
|
||||
const ui = new UI();
|
||||
const ideConfig = await ui.promptToolSelection(projectDir, ['core']);
|
||||
const selectedIdes = ideConfig.ides || [];
|
||||
|
||||
// Create directory structure
|
||||
console.log(chalk.dim('\nCreating directory structure...'));
|
||||
await fs.promises.mkdir(bmadDir, { recursive: true });
|
||||
await fs.promises.mkdir(cfgDir, { recursive: true });
|
||||
await fs.promises.mkdir(path.join(bmadDir, 'core'), { recursive: true });
|
||||
await fs.promises.mkdir(path.join(bmadDir, 'custom', 'agents'), { recursive: true });
|
||||
await fs.promises.mkdir(path.join(cfgDir, 'agents'), { recursive: true });
|
||||
await fs.promises.mkdir(path.join(cfgDir, 'custom', 'agents'), { recursive: true });
|
||||
|
||||
// Create core config.yaml file
|
||||
const coreConfigFile = {
|
||||
'# CORE Module Configuration': 'Generated by BMAD Agent Installer',
|
||||
Version: require(path.join(__dirname, '../../../package.json')).version,
|
||||
Date: new Date().toISOString(),
|
||||
bmad_folder: bmadFolderName,
|
||||
...coreAnswers,
|
||||
};
|
||||
|
||||
const coreConfigPath = path.join(bmadDir, 'core', 'config.yaml');
|
||||
await fs.promises.writeFile(coreConfigPath, yaml.dump(coreConfigFile), 'utf8');
|
||||
|
||||
// Create manifest.yaml with complete structure
|
||||
const manifest = {
|
||||
version: require(path.join(__dirname, '../../../package.json')).version,
|
||||
date: new Date().toISOString(),
|
||||
user_name: coreAnswers.user_name,
|
||||
communication_language: coreAnswers.communication_language,
|
||||
document_output_language: coreAnswers.document_output_language,
|
||||
output_folder: coreAnswers.output_folder,
|
||||
install_user_docs: coreAnswers.install_user_docs,
|
||||
bmad_folder: bmadFolderName,
|
||||
modules: ['core'],
|
||||
ides: selectedIdes,
|
||||
custom_agents: [],
|
||||
};
|
||||
|
||||
const manifestPath = path.join(cfgDir, 'manifest.yaml');
|
||||
await fs.promises.writeFile(manifestPath, yaml.dump(manifest), 'utf8');
|
||||
|
||||
// Create empty manifests
|
||||
const agentManifestPath = path.join(cfgDir, 'agent-manifest.csv');
|
||||
await fs.promises.writeFile(agentManifestPath, 'type,subtype,name,path,display_name,description,author,version,tags\n', 'utf8');
|
||||
|
||||
// Setup IDE configurations
|
||||
if (selectedIdes.length > 0) {
|
||||
console.log(chalk.dim('\nSetting up IDE configurations...'));
|
||||
const { IdeManager } = require('../installers/lib/ide/manager');
|
||||
const ideManager = new IdeManager();
|
||||
|
||||
for (const ide of selectedIdes) {
|
||||
await ideManager.setup(ide, projectDir, bmadDir, {
|
||||
selectedModules: ['core'],
|
||||
skipModuleInstall: false,
|
||||
verbose: false,
|
||||
preCollectedConfig: coreAnswers,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
console.log(chalk.green('\n✓ BMAD core infrastructure initialized'));
|
||||
console.log(chalk.dim(` BMAD folder: ${bmadDir}`));
|
||||
console.log(chalk.dim(` Core config: ${coreConfigPath}`));
|
||||
console.log(chalk.dim(` Manifest: ${manifestPath}`));
|
||||
if (selectedIdes.length > 0) {
|
||||
console.log(chalk.dim(` IDEs configured: ${selectedIdes.join(', ')}`));
|
||||
}
|
||||
|
||||
return {
|
||||
projectRoot: projectDir,
|
||||
bmadFolder: bmadDir,
|
||||
cfgFolder: cfgDir,
|
||||
manifestFile: agentManifestPath,
|
||||
ides: selectedIdes,
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
command: 'agent-install',
|
||||
description: 'Install and compile BMAD agents with personalization',
|
||||
options: [
|
||||
['-s, --source <path>', 'Path to specific agent YAML file or folder'],
|
||||
['-d, --defaults', 'Use default values without prompting'],
|
||||
['-t, --destination <path>', 'Target installation directory (default: current project BMAD installation)'],
|
||||
],
|
||||
action: async (options) => {
|
||||
try {
|
||||
console.log(chalk.cyan('\n🔧 BMAD Agent Installer\n'));
|
||||
|
||||
// Find BMAD config
|
||||
const config = findBmadConfig();
|
||||
if (!config) {
|
||||
console.log(chalk.yellow('No BMAD installation found in current directory.'));
|
||||
console.log(chalk.dim('Looking for .bmad/bmb/config.yaml...'));
|
||||
console.log(chalk.red('\nPlease run this command from a project with BMAD installed.'));
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
console.log(chalk.dim(`Found BMAD at: ${config.bmadFolder}`));
|
||||
|
||||
let selectedAgent = null;
|
||||
|
||||
// If source provided, use it directly
|
||||
if (options.source) {
|
||||
const providedPath = path.resolve(options.source);
|
||||
|
||||
if (!fs.existsSync(providedPath)) {
|
||||
console.log(chalk.red(`Path not found: ${providedPath}`));
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const stat = fs.statSync(providedPath);
|
||||
if (stat.isFile() && providedPath.endsWith('.agent.yaml')) {
|
||||
selectedAgent = {
|
||||
type: 'simple',
|
||||
name: path.basename(providedPath, '.agent.yaml'),
|
||||
path: providedPath,
|
||||
yamlFile: providedPath,
|
||||
};
|
||||
} else if (stat.isDirectory()) {
|
||||
const yamlFiles = fs.readdirSync(providedPath).filter((f) => f.endsWith('.agent.yaml'));
|
||||
if (yamlFiles.length === 1) {
|
||||
selectedAgent = {
|
||||
type: 'expert',
|
||||
name: path.basename(providedPath),
|
||||
path: providedPath,
|
||||
yamlFile: path.join(providedPath, yamlFiles[0]),
|
||||
hasSidecar: true,
|
||||
};
|
||||
} else {
|
||||
console.log(chalk.red('Directory must contain exactly one .agent.yaml file'));
|
||||
process.exit(1);
|
||||
}
|
||||
} else {
|
||||
console.log(chalk.red('Path must be an .agent.yaml file or a folder containing one'));
|
||||
process.exit(1);
|
||||
}
|
||||
} else {
|
||||
// Discover agents from custom location
|
||||
const customAgentLocation = config.custom_agent_location
|
||||
? resolvePath(config.custom_agent_location, config)
|
||||
: path.join(config.bmadFolder, 'custom', 'src', 'agents');
|
||||
|
||||
console.log(chalk.dim(`Searching for agents in: ${customAgentLocation}\n`));
|
||||
|
||||
const agents = discoverAgents(customAgentLocation);
|
||||
|
||||
if (agents.length === 0) {
|
||||
console.log(chalk.yellow('No agents found in custom agent location.'));
|
||||
console.log(chalk.dim(`Expected location: ${customAgentLocation}`));
|
||||
console.log(chalk.dim('\nCreate agents using the BMad Builder workflow or place .agent.yaml files there.'));
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
// List available agents
|
||||
console.log(chalk.cyan('Available Agents:\n'));
|
||||
for (const [idx, agent] of agents.entries()) {
|
||||
const typeIcon = agent.type === 'expert' ? '📚' : '📄';
|
||||
console.log(` ${idx + 1}. ${typeIcon} ${chalk.bold(agent.name)} ${chalk.dim(`(${agent.type})`)}`);
|
||||
}
|
||||
|
||||
// Prompt for selection
|
||||
const rl = readline.createInterface({
|
||||
input: process.stdin,
|
||||
output: process.stdout,
|
||||
});
|
||||
|
||||
const selection = await new Promise((resolve) => {
|
||||
rl.question('\nSelect agent to install (number): ', resolve);
|
||||
});
|
||||
rl.close();
|
||||
|
||||
const selectedIdx = parseInt(selection, 10) - 1;
|
||||
if (isNaN(selectedIdx) || selectedIdx < 0 || selectedIdx >= agents.length) {
|
||||
console.log(chalk.red('Invalid selection'));
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
selectedAgent = agents[selectedIdx];
|
||||
}
|
||||
|
||||
console.log(chalk.cyan(`\nSelected: ${chalk.bold(selectedAgent.name)}`));
|
||||
|
||||
// Load agent configuration
|
||||
const agentConfig = loadAgentConfig(selectedAgent.yamlFile);
|
||||
|
||||
// Check if agent has sidecar
|
||||
if (agentConfig.metadata.hasSidecar) {
|
||||
selectedAgent.hasSidecar = true;
|
||||
}
|
||||
|
||||
if (agentConfig.metadata.name) {
|
||||
console.log(chalk.dim(`Agent Name: ${agentConfig.metadata.name}`));
|
||||
}
|
||||
if (agentConfig.metadata.title) {
|
||||
console.log(chalk.dim(`Title: ${agentConfig.metadata.title}`));
|
||||
}
|
||||
if (agentConfig.metadata.hasSidecar) {
|
||||
console.log(chalk.dim(`Sidecar: Yes`));
|
||||
}
|
||||
|
||||
// Get the agent type (source name)
|
||||
const agentType = selectedAgent.name; // e.g., "commit-poet"
|
||||
|
||||
// Confirm/customize agent persona name
|
||||
const rl1 = readline.createInterface({
|
||||
input: process.stdin,
|
||||
output: process.stdout,
|
||||
});
|
||||
|
||||
const defaultPersonaName = agentConfig.metadata.name || agentType;
|
||||
console.log(chalk.cyan('\n📛 Agent Persona Name\n'));
|
||||
console.log(chalk.dim(` Agent type: ${agentType}`));
|
||||
console.log(chalk.dim(` Default persona: ${defaultPersonaName}`));
|
||||
console.log(chalk.dim(' Leave blank to use default, or provide a custom name.'));
|
||||
console.log(chalk.dim(' Examples:'));
|
||||
console.log(chalk.dim(` - (blank) → "${defaultPersonaName}" as ${agentType}.md`));
|
||||
console.log(chalk.dim(` - "Fred" → "Fred" as fred-${agentType}.md`));
|
||||
console.log(chalk.dim(` - "Captain Code" → "Captain Code" as captain-code-${agentType}.md`));
|
||||
|
||||
const customPersonaName = await new Promise((resolve) => {
|
||||
rl1.question(`\n Custom name (or Enter for default): `, resolve);
|
||||
});
|
||||
rl1.close();
|
||||
|
||||
// Determine final agent file name based on persona name
|
||||
let finalAgentName;
|
||||
let personaName;
|
||||
if (customPersonaName.trim()) {
|
||||
personaName = customPersonaName.trim();
|
||||
const namePrefix = personaName.toLowerCase().replaceAll(/\s+/g, '-');
|
||||
finalAgentName = `${namePrefix}-${agentType}`;
|
||||
} else {
|
||||
personaName = defaultPersonaName;
|
||||
finalAgentName = agentType;
|
||||
}
|
||||
|
||||
console.log(chalk.dim(` Persona: ${personaName}`));
|
||||
console.log(chalk.dim(` File: ${finalAgentName}.md`));
|
||||
|
||||
// Get answers (prompt or use defaults)
|
||||
let presetAnswers = {};
|
||||
|
||||
// If custom persona name provided, inject it as custom_name for template processing
|
||||
if (customPersonaName.trim()) {
|
||||
presetAnswers.custom_name = personaName;
|
||||
}
|
||||
|
||||
let answers;
|
||||
if (agentConfig.installConfig && !options.defaults) {
|
||||
answers = await promptInstallQuestions(agentConfig.installConfig, agentConfig.defaults, presetAnswers);
|
||||
} else if (agentConfig.installConfig && options.defaults) {
|
||||
console.log(chalk.dim('\nUsing default configuration values.'));
|
||||
answers = { ...agentConfig.defaults, ...presetAnswers };
|
||||
} else {
|
||||
answers = { ...agentConfig.defaults, ...presetAnswers };
|
||||
}
|
||||
|
||||
// Determine target directory
|
||||
let targetDir = options.destination ? path.resolve(options.destination) : null;
|
||||
|
||||
// If no target specified, prompt for it
|
||||
if (targetDir) {
|
||||
// Check if target has BMAD infrastructure
|
||||
const otherProject = detectBmadProject(targetDir);
|
||||
|
||||
if (!otherProject) {
|
||||
// No BMAD infrastructure found - offer to initialize
|
||||
console.log(chalk.yellow(`\n⚠️ No BMAD infrastructure found in: ${targetDir}`));
|
||||
|
||||
const initResponse = await inquirer.prompt([
|
||||
{
|
||||
type: 'confirm',
|
||||
name: 'initialize',
|
||||
message: 'Initialize BMAD core infrastructure here? (Choose No for direct installation)',
|
||||
default: true,
|
||||
},
|
||||
]);
|
||||
|
||||
if (initResponse.initialize) {
|
||||
// Initialize BMAD core
|
||||
targetDir = path.resolve(targetDir);
|
||||
await initializeBmadCore(targetDir, '.bmad');
|
||||
// Set targetDir to the custom agents folder
|
||||
targetDir = path.join(targetDir, '.bmad', 'custom', 'agents');
|
||||
console.log(chalk.dim(` Agent will be installed to: ${targetDir}`));
|
||||
} else {
|
||||
// User declined - keep original targetDir
|
||||
console.log(chalk.yellow(` Installing agent directly to: ${targetDir}`));
|
||||
}
|
||||
} else if (otherProject && !targetDir.includes('agents')) {
|
||||
console.log(chalk.yellow(`\n⚠️ Path is inside BMAD project: ${otherProject.projectRoot}`));
|
||||
|
||||
const projectChoice = await inquirer.prompt([
|
||||
{
|
||||
type: 'list',
|
||||
name: 'choice',
|
||||
message: 'Choose installation method:',
|
||||
choices: [
|
||||
{ name: `Install to BMAD's custom agents folder (${otherProject.bmadFolder}/custom/agents)`, value: 'bmad' },
|
||||
{ name: `Install directly to specified path (${targetDir})`, value: 'direct' },
|
||||
],
|
||||
default: 'bmad',
|
||||
},
|
||||
]);
|
||||
|
||||
if (projectChoice.choice === 'bmad') {
|
||||
targetDir = path.join(otherProject.bmadFolder, 'custom', 'agents');
|
||||
console.log(chalk.dim(` Installing to BMAD custom agents folder: ${targetDir}`));
|
||||
} else {
|
||||
console.log(chalk.yellow(` Installing directly to: ${targetDir}`));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
const rl = readline.createInterface({
|
||||
input: process.stdin,
|
||||
output: process.stdout,
|
||||
});
|
||||
|
||||
console.log(chalk.cyan('\n📂 Installation Target\n'));
|
||||
|
||||
// Option 1: Current project's custom agents folder
|
||||
const currentCustom = path.join(config.bmadFolder, 'custom', 'agents');
|
||||
console.log(` 1. Current project: ${chalk.dim(currentCustom)}`);
|
||||
console.log(` 2. Enter path directly (e.g., /Users/brianmadison/dev/test)`);
|
||||
|
||||
const choice = await new Promise((resolve) => {
|
||||
rl.question('\n Select option (1 or 2): ', resolve);
|
||||
});
|
||||
|
||||
if (choice.trim() === '1' || choice.trim() === '') {
|
||||
targetDir = currentCustom;
|
||||
} else if (choice.trim() === '2') {
|
||||
const userPath = await new Promise((resolve) => {
|
||||
rl.question(' Enter path: ', resolve);
|
||||
});
|
||||
|
||||
// Detect if it's a BMAD project and use its custom folder
|
||||
const otherProject = detectBmadProject(path.resolve(userPath));
|
||||
|
||||
if (otherProject) {
|
||||
console.log(chalk.yellow(`\n⚠️ Path is inside BMAD project: ${otherProject.projectRoot}`));
|
||||
|
||||
const projectChoice = await inquirer.prompt([
|
||||
{
|
||||
type: 'list',
|
||||
name: 'choice',
|
||||
message: 'Choose installation method:',
|
||||
choices: [
|
||||
{ name: `Install to BMAD's custom agents folder (${otherProject.bmadFolder}/custom/agents)`, value: 'bmad' },
|
||||
{ name: `Install directly to specified path (${userPath})`, value: 'direct' },
|
||||
],
|
||||
default: 'bmad',
|
||||
},
|
||||
]);
|
||||
|
||||
if (projectChoice.choice === 'bmad') {
|
||||
targetDir = path.join(otherProject.bmadFolder, 'custom', 'agents');
|
||||
console.log(chalk.dim(` Installing to BMAD custom agents folder: ${targetDir}`));
|
||||
} else {
|
||||
targetDir = path.resolve(userPath);
|
||||
console.log(chalk.yellow(` Installing directly to: ${targetDir}`));
|
||||
}
|
||||
} else {
|
||||
// No BMAD found - offer to initialize
|
||||
console.log(chalk.yellow(`\n⚠️ No BMAD infrastructure found in: ${userPath}`));
|
||||
|
||||
const initResponse = await inquirer.prompt([
|
||||
{
|
||||
type: 'confirm',
|
||||
name: 'initialize',
|
||||
message: 'Initialize BMAD core infrastructure here? (Choose No for direct installation)',
|
||||
default: true,
|
||||
},
|
||||
]);
|
||||
|
||||
if (initResponse.initialize) {
|
||||
await initializeBmadCore(path.resolve(userPath), '.bmad');
|
||||
targetDir = path.join(path.resolve(userPath), '.bmad', 'custom', 'agents');
|
||||
console.log(chalk.dim(` Agent will be installed to: ${targetDir}`));
|
||||
} else {
|
||||
// User declined - create the directory and install directly
|
||||
targetDir = path.resolve(userPath);
|
||||
console.log(chalk.yellow(` Installing agent directly to: ${targetDir}`));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.log(chalk.red(' Invalid selection. Please choose 1 or 2.'));
|
||||
rl.close();
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
rl.close();
|
||||
}
|
||||
|
||||
if (!fs.existsSync(targetDir)) {
|
||||
fs.mkdirSync(targetDir, { recursive: true });
|
||||
}
|
||||
|
||||
console.log(chalk.dim(`\nInstalling to: ${targetDir}`));
|
||||
|
||||
// Detect if target is within a BMAD project
|
||||
const targetProject = detectBmadProject(targetDir);
|
||||
if (targetProject) {
|
||||
console.log(chalk.cyan(` Detected BMAD project at: ${targetProject.projectRoot}`));
|
||||
}
|
||||
|
||||
// Check for duplicate in manifest by path (not by type)
|
||||
let shouldUpdateExisting = false;
|
||||
let existingEntry = null;
|
||||
|
||||
if (targetProject) {
|
||||
// Check if this exact installed name already exists
|
||||
const expectedPath = `.bmad/custom/agents/${finalAgentName}/${finalAgentName}.md`;
|
||||
existingEntry = checkManifestForPath(targetProject.manifestFile, expectedPath);
|
||||
|
||||
if (existingEntry) {
|
||||
const rl2 = readline.createInterface({
|
||||
input: process.stdin,
|
||||
output: process.stdout,
|
||||
});
|
||||
|
||||
console.log(chalk.yellow(`\n⚠️ Agent "${finalAgentName}" already installed`));
|
||||
console.log(chalk.dim(` Type: ${agentType}`));
|
||||
console.log(chalk.dim(` Path: ${existingEntry.path}`));
|
||||
|
||||
const overwrite = await new Promise((resolve) => {
|
||||
rl2.question(' Overwrite existing installation? [Y/n]: ', resolve);
|
||||
});
|
||||
rl2.close();
|
||||
|
||||
if (overwrite.toLowerCase() === 'n') {
|
||||
console.log(chalk.yellow('Installation cancelled.'));
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
shouldUpdateExisting = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Install the agent with custom name
|
||||
// Override the folder name with finalAgentName
|
||||
const agentTargetDir = path.join(targetDir, finalAgentName);
|
||||
|
||||
if (!fs.existsSync(agentTargetDir)) {
|
||||
fs.mkdirSync(agentTargetDir, { recursive: true });
|
||||
}
|
||||
|
||||
// Compile and install
|
||||
const { compileAgent } = require('../lib/agent/compiler');
|
||||
|
||||
// Calculate target path for agent ID
|
||||
const projectRoot = targetProject ? targetProject.projectRoot : config.projectRoot;
|
||||
const compiledFileName = `${finalAgentName}.md`;
|
||||
const compiledPath = path.join(agentTargetDir, compiledFileName);
|
||||
const relativePath = path.relative(projectRoot, compiledPath);
|
||||
|
||||
// Read core config to get agent_sidecar_folder
|
||||
const coreConfigPath = path.join(config.bmadFolder, 'bmb', 'config.yaml');
|
||||
let coreConfig = {};
|
||||
if (fs.existsSync(coreConfigPath)) {
|
||||
const yamlLib = require('yaml');
|
||||
const content = fs.readFileSync(coreConfigPath, 'utf8');
|
||||
coreConfig = yamlLib.parse(content);
|
||||
}
|
||||
|
||||
// Compile with proper name and path
|
||||
const { xml, metadata, processedYaml } = compileAgent(
|
||||
fs.readFileSync(selectedAgent.yamlFile, 'utf8'),
|
||||
answers,
|
||||
finalAgentName,
|
||||
relativePath,
|
||||
{ config: coreConfig },
|
||||
);
|
||||
|
||||
// Write compiled XML (.md) with custom name
|
||||
fs.writeFileSync(compiledPath, xml, 'utf8');
|
||||
|
||||
const result = {
|
||||
success: true,
|
||||
agentName: finalAgentName,
|
||||
targetDir: agentTargetDir,
|
||||
compiledFile: compiledPath,
|
||||
sidecarCopied: false,
|
||||
};
|
||||
|
||||
// Handle sidecar files for agents with hasSidecar flag
|
||||
if (selectedAgent.hasSidecar === true && selectedAgent.type === 'expert') {
|
||||
const { copyAgentSidecarFiles } = require('../lib/agent/installer');
|
||||
|
||||
// Get agent sidecar folder from config or use default
|
||||
const agentSidecarFolder = coreConfig?.agent_sidecar_folder || '{project-root}/.myagent-data';
|
||||
|
||||
// Resolve path variables
|
||||
const resolvedSidecarFolder = agentSidecarFolder
|
||||
.replaceAll('{project-root}', projectRoot)
|
||||
.replaceAll('{bmad_folder}', config.bmadFolder);
|
||||
|
||||
// Create sidecar directory for this agent
|
||||
const agentSidecarDir = path.join(resolvedSidecarFolder, finalAgentName);
|
||||
if (!fs.existsSync(agentSidecarDir)) {
|
||||
fs.mkdirSync(agentSidecarDir, { recursive: true });
|
||||
}
|
||||
|
||||
// Find and copy sidecar folder
|
||||
const sidecarFiles = copyAgentSidecarFiles(selectedAgent.path, agentSidecarDir, selectedAgent.yamlFile);
|
||||
result.sidecarCopied = true;
|
||||
result.sidecarFiles = sidecarFiles;
|
||||
result.sidecarDir = agentSidecarDir;
|
||||
|
||||
console.log(chalk.dim(` Sidecar copied to: ${agentSidecarDir}`));
|
||||
}
|
||||
|
||||
console.log(chalk.green('\n✨ Agent installed successfully!'));
|
||||
console.log(chalk.cyan(` Name: ${result.agentName}`));
|
||||
console.log(chalk.cyan(` Location: ${result.targetDir}`));
|
||||
console.log(chalk.cyan(` Compiled: ${path.basename(result.compiledFile)}`));
|
||||
|
||||
if (result.sidecarCopied) {
|
||||
console.log(chalk.cyan(` Sidecar files: ${result.sidecarFiles.length} files copied`));
|
||||
}
|
||||
|
||||
// Save source YAML to _cfg/custom/agents/ and register in manifest
|
||||
if (targetProject) {
|
||||
// Save source for reinstallation with embedded answers
|
||||
console.log(chalk.dim(`\nSaving source to: ${targetProject.cfgFolder}/custom/agents/`));
|
||||
saveAgentSource(selectedAgent, targetProject.cfgFolder, finalAgentName, answers);
|
||||
console.log(chalk.green(` ✓ Source saved for reinstallation`));
|
||||
|
||||
// Register/update in manifest
|
||||
console.log(chalk.dim(`Registering in manifest: ${targetProject.manifestFile}`));
|
||||
|
||||
const manifestData = extractManifestData(xml, { ...metadata, name: finalAgentName }, relativePath, 'custom');
|
||||
// Use finalAgentName as the manifest name field (unique identifier)
|
||||
manifestData.name = finalAgentName;
|
||||
// Use compiled metadata.name (persona name after template processing), not source agentConfig
|
||||
manifestData.displayName = metadata.name || agentType;
|
||||
// Store the actual installed path/name
|
||||
manifestData.path = relativePath;
|
||||
|
||||
if (shouldUpdateExisting && existingEntry) {
|
||||
updateManifestEntry(targetProject.manifestFile, manifestData, existingEntry._lineNumber);
|
||||
console.log(chalk.green(` ✓ Updated existing entry in agent-manifest.csv`));
|
||||
} else {
|
||||
addToManifest(targetProject.manifestFile, manifestData);
|
||||
console.log(chalk.green(` ✓ Added to agent-manifest.csv`));
|
||||
}
|
||||
|
||||
// Create IDE slash commands
|
||||
const ideResults = await createIdeSlashCommands(targetProject.projectRoot, finalAgentName, relativePath, metadata);
|
||||
if (Object.keys(ideResults).length > 0) {
|
||||
console.log(chalk.green(` ✓ Created IDE commands:`));
|
||||
for (const [ideName, result] of Object.entries(ideResults)) {
|
||||
console.log(chalk.dim(` ${ideName}: ${result.command}`));
|
||||
}
|
||||
}
|
||||
|
||||
// Update manifest.yaml with custom_agents tracking
|
||||
const manifestYamlPath = path.join(targetProject.cfgFolder, 'manifest.yaml');
|
||||
if (updateManifestYaml(manifestYamlPath, finalAgentName, agentType)) {
|
||||
console.log(chalk.green(` ✓ Updated manifest.yaml custom_agents`));
|
||||
}
|
||||
}
|
||||
|
||||
console.log(chalk.dim(`\nAgent ID: ${relativePath}`));
|
||||
|
||||
if (targetProject) {
|
||||
console.log(chalk.yellow('\nAgent is now registered and available in the target project!'));
|
||||
} else {
|
||||
console.log(chalk.yellow('\nTo use this agent, reference it in your manifest or load it directly.'));
|
||||
}
|
||||
|
||||
process.exit(0);
|
||||
} catch (error) {
|
||||
console.error(chalk.red('Agent installation failed:'), error.message);
|
||||
console.error(chalk.dim(error.stack));
|
||||
process.exit(1);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
|
@ -198,9 +198,27 @@ class ConfigCollector {
|
|||
}
|
||||
|
||||
let configPath = null;
|
||||
let isCustomModule = false;
|
||||
|
||||
if (await fs.pathExists(installerConfigPath)) {
|
||||
configPath = installerConfigPath;
|
||||
} else {
|
||||
// Check if this is a custom module with custom.yaml
|
||||
const { ModuleManager } = require('../modules/manager');
|
||||
const moduleManager = new ModuleManager();
|
||||
const moduleSourcePath = await moduleManager.findModuleSource(moduleName);
|
||||
|
||||
if (moduleSourcePath) {
|
||||
const rootCustomConfigPath = path.join(moduleSourcePath, 'custom.yaml');
|
||||
const moduleInstallerCustomPath = path.join(moduleSourcePath, '_module-installer', 'custom.yaml');
|
||||
|
||||
if ((await fs.pathExists(rootCustomConfigPath)) || (await fs.pathExists(moduleInstallerCustomPath))) {
|
||||
isCustomModule = true;
|
||||
// For custom modules, we don't have an install-config schema, so just use existing values
|
||||
// The custom.yaml values will be loaded and merged during installation
|
||||
}
|
||||
}
|
||||
|
||||
// No config schema for this module - use existing values
|
||||
if (this.existingConfig && this.existingConfig[moduleName]) {
|
||||
if (!this.collectedConfig[moduleName]) {
|
||||
|
|
@ -236,9 +254,31 @@ class ConfigCollector {
|
|||
}
|
||||
this.collectedConfig[moduleName] = { ...this.existingConfig[moduleName] };
|
||||
|
||||
// Special handling for user_name: ensure it has a value
|
||||
if (
|
||||
moduleName === 'core' &&
|
||||
(!this.collectedConfig[moduleName].user_name || this.collectedConfig[moduleName].user_name === '[USER_NAME]')
|
||||
) {
|
||||
this.collectedConfig[moduleName].user_name = this.getDefaultUsername();
|
||||
}
|
||||
|
||||
// Also populate allAnswers for cross-referencing
|
||||
for (const [key, value] of Object.entries(this.existingConfig[moduleName])) {
|
||||
this.allAnswers[`${moduleName}_${key}`] = value;
|
||||
// Ensure user_name is properly set in allAnswers too
|
||||
let finalValue = value;
|
||||
if (moduleName === 'core' && key === 'user_name' && (!value || value === '[USER_NAME]')) {
|
||||
finalValue = this.getDefaultUsername();
|
||||
}
|
||||
this.allAnswers[`${moduleName}_${key}`] = finalValue;
|
||||
}
|
||||
} else if (moduleName === 'core') {
|
||||
// No existing core config - ensure we at least have user_name
|
||||
if (!this.collectedConfig[moduleName]) {
|
||||
this.collectedConfig[moduleName] = {};
|
||||
}
|
||||
if (!this.collectedConfig[moduleName].user_name) {
|
||||
this.collectedConfig[moduleName].user_name = this.getDefaultUsername();
|
||||
this.allAnswers[`${moduleName}_user_name`] = this.getDefaultUsername();
|
||||
}
|
||||
}
|
||||
// Show "no config" message for modules with no new questions
|
||||
|
|
|
|||
|
|
@ -798,6 +798,53 @@ If AgentVibes party mode is enabled, immediately trigger TTS with agent's voice:
|
|||
}
|
||||
}
|
||||
|
||||
// Install custom content if provided AND selected
|
||||
if (
|
||||
config.customContent &&
|
||||
config.customContent.hasCustomContent &&
|
||||
config.customContent.customPath &&
|
||||
config.customContent.selected &&
|
||||
config.customContent.selectedFiles
|
||||
) {
|
||||
spinner.start('Installing custom content...');
|
||||
const { CustomHandler } = require('../custom/handler');
|
||||
const customHandler = new CustomHandler();
|
||||
|
||||
// Use the selected files instead of finding all files
|
||||
const customFiles = config.customContent.selectedFiles;
|
||||
|
||||
if (customFiles.length > 0) {
|
||||
console.log(chalk.cyan(`\n Found ${customFiles.length} custom content file(s):`));
|
||||
for (const customFile of customFiles) {
|
||||
const customInfo = await customHandler.getCustomInfo(customFile, projectDir);
|
||||
if (customInfo) {
|
||||
console.log(chalk.dim(` • ${customInfo.name} (${customInfo.relativePath})`));
|
||||
|
||||
// Install the custom content
|
||||
const result = await customHandler.install(
|
||||
customInfo.path,
|
||||
bmadDir,
|
||||
{ ...config.coreConfig, ...customInfo.config },
|
||||
(filePath) => {
|
||||
// Track installed files
|
||||
this.installedFiles.push(filePath);
|
||||
},
|
||||
);
|
||||
|
||||
if (result.errors.length > 0) {
|
||||
console.log(chalk.yellow(` ⚠️ ${result.errors.length} error(s) occurred`));
|
||||
for (const error of result.errors) {
|
||||
console.log(chalk.dim(` - ${error}`));
|
||||
}
|
||||
} else {
|
||||
console.log(chalk.green(` ✓ Installed ${result.agentsInstalled} agents, ${result.workflowsInstalled} workflows`));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
spinner.succeed('Custom content installed');
|
||||
}
|
||||
|
||||
// Generate clean config.yaml files for each installed module
|
||||
spinner.start('Generating module configurations...');
|
||||
await this.generateModuleConfigs(bmadDir, moduleConfigs);
|
||||
|
|
@ -912,6 +959,7 @@ If AgentVibes party mode is enabled, immediately trigger TTS with agent's voice:
|
|||
await this.moduleManager.runModuleInstaller('core', bmadDir, {
|
||||
installedIDEs: config.ides || [],
|
||||
moduleConfig: moduleConfigs.core || {},
|
||||
coreConfig: moduleConfigs.core || {},
|
||||
logger: {
|
||||
log: (msg) => console.log(msg),
|
||||
error: (msg) => console.error(msg),
|
||||
|
|
@ -929,6 +977,7 @@ If AgentVibes party mode is enabled, immediately trigger TTS with agent's voice:
|
|||
await this.moduleManager.runModuleInstaller(moduleName, bmadDir, {
|
||||
installedIDEs: config.ides || [],
|
||||
moduleConfig: moduleConfigs[moduleName] || {},
|
||||
coreConfig: moduleConfigs.core || {},
|
||||
logger: {
|
||||
log: (msg) => console.log(msg),
|
||||
error: (msg) => console.error(msg),
|
||||
|
|
|
|||
|
|
@ -0,0 +1,276 @@
|
|||
const path = require('node:path');
|
||||
const fs = require('fs-extra');
|
||||
const chalk = require('chalk');
|
||||
const yaml = require('js-yaml');
|
||||
const { FileOps } = require('../../../lib/file-ops');
|
||||
|
||||
/**
|
||||
* Handler for custom content (custom.yaml)
|
||||
* Installs custom agents and workflows without requiring a full module structure
|
||||
*/
|
||||
class CustomHandler {
|
||||
constructor() {
|
||||
this.fileOps = new FileOps();
|
||||
}
|
||||
|
||||
/**
|
||||
* Find all custom.yaml files in the project
|
||||
* @param {string} projectRoot - Project root directory
|
||||
* @returns {Array} List of custom content paths
|
||||
*/
|
||||
async findCustomContent(projectRoot) {
|
||||
const customPaths = [];
|
||||
|
||||
// Helper function to recursively scan directories
|
||||
async function scanDirectory(dir, excludePaths = []) {
|
||||
try {
|
||||
const entries = await fs.readdir(dir, { withFileTypes: true });
|
||||
|
||||
for (const entry of entries) {
|
||||
const fullPath = path.join(dir, entry.name);
|
||||
|
||||
// Skip hidden directories and common exclusions
|
||||
if (
|
||||
entry.name.startsWith('.') ||
|
||||
entry.name === 'node_modules' ||
|
||||
entry.name === 'dist' ||
|
||||
entry.name === 'build' ||
|
||||
entry.name === '.git' ||
|
||||
entry.name === 'bmad'
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Skip excluded paths
|
||||
if (excludePaths.some((exclude) => fullPath.startsWith(exclude))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (entry.isDirectory()) {
|
||||
// Recursively scan subdirectories
|
||||
await scanDirectory(fullPath, excludePaths);
|
||||
} else if (entry.name === 'custom.yaml') {
|
||||
// Found a custom.yaml file
|
||||
customPaths.push(fullPath);
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
// Ignore errors (e.g., permission denied)
|
||||
}
|
||||
}
|
||||
|
||||
// Scan the entire project, but exclude source directories
|
||||
await scanDirectory(projectRoot, [path.join(projectRoot, 'src'), path.join(projectRoot, 'tools'), path.join(projectRoot, 'test')]);
|
||||
|
||||
return customPaths;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get custom content info from a custom.yaml file
|
||||
* @param {string} customYamlPath - Path to custom.yaml file
|
||||
* @param {string} projectRoot - Project root directory for calculating relative paths
|
||||
* @returns {Object|null} Custom content info
|
||||
*/
|
||||
async getCustomInfo(customYamlPath, projectRoot = null) {
|
||||
try {
|
||||
const configContent = await fs.readFile(customYamlPath, 'utf8');
|
||||
|
||||
// Try to parse YAML with error handling
|
||||
let config;
|
||||
try {
|
||||
config = yaml.load(configContent);
|
||||
} catch (parseError) {
|
||||
console.warn(chalk.yellow(`Warning: YAML parse error in ${customYamlPath}:`, parseError.message));
|
||||
return null;
|
||||
}
|
||||
|
||||
const customDir = path.dirname(customYamlPath);
|
||||
// Use provided projectRoot or fall back to process.cwd()
|
||||
const basePath = projectRoot || process.cwd();
|
||||
const relativePath = path.relative(basePath, customDir);
|
||||
|
||||
return {
|
||||
id: config.code || path.basename(customDir),
|
||||
name: config.name || `Custom: ${path.basename(customDir)}`,
|
||||
description: config.description || 'Custom agents and workflows',
|
||||
path: customDir,
|
||||
relativePath: relativePath,
|
||||
defaultSelected: config.default_selected === true,
|
||||
config: config,
|
||||
};
|
||||
} catch (error) {
|
||||
console.warn(chalk.yellow(`Warning: Failed to read ${customYamlPath}:`, error.message));
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Install custom content
|
||||
* @param {string} customPath - Path to custom content directory
|
||||
* @param {string} bmadDir - Target bmad directory
|
||||
* @param {Object} config - Configuration from custom.yaml
|
||||
* @param {Function} fileTrackingCallback - Optional callback to track installed files
|
||||
* @returns {Object} Installation result
|
||||
*/
|
||||
async install(customPath, bmadDir, config, fileTrackingCallback = null) {
|
||||
const results = {
|
||||
agentsInstalled: 0,
|
||||
workflowsInstalled: 0,
|
||||
filesCopied: 0,
|
||||
preserved: 0,
|
||||
errors: [],
|
||||
};
|
||||
|
||||
try {
|
||||
// Create custom directories in bmad
|
||||
const bmadCustomDir = path.join(bmadDir, 'custom');
|
||||
const bmadAgentsDir = path.join(bmadCustomDir, 'agents');
|
||||
const bmadWorkflowsDir = path.join(bmadCustomDir, 'workflows');
|
||||
|
||||
await fs.ensureDir(bmadCustomDir);
|
||||
await fs.ensureDir(bmadAgentsDir);
|
||||
await fs.ensureDir(bmadWorkflowsDir);
|
||||
|
||||
// Process agents - copy entire agents directory structure
|
||||
const agentsDir = path.join(customPath, 'agents');
|
||||
if (await fs.pathExists(agentsDir)) {
|
||||
await this.copyDirectory(agentsDir, bmadAgentsDir, results, fileTrackingCallback, config);
|
||||
|
||||
// Count agent files
|
||||
const agentFiles = await this.findFilesRecursively(agentsDir, ['.agent.yaml', '.md']);
|
||||
results.agentsInstalled = agentFiles.length;
|
||||
}
|
||||
|
||||
// Process workflows - copy entire workflows directory structure
|
||||
const workflowsDir = path.join(customPath, 'workflows');
|
||||
if (await fs.pathExists(workflowsDir)) {
|
||||
await this.copyDirectory(workflowsDir, bmadWorkflowsDir, results, fileTrackingCallback, config);
|
||||
|
||||
// Count workflow files
|
||||
const workflowFiles = await this.findFilesRecursively(workflowsDir, ['.md']);
|
||||
results.workflowsInstalled = workflowFiles.length;
|
||||
}
|
||||
|
||||
// Process any additional files at root
|
||||
const entries = await fs.readdir(customPath, { withFileTypes: true });
|
||||
for (const entry of entries) {
|
||||
if (entry.isFile() && entry.name !== 'custom.yaml' && !entry.name.startsWith('.') && !entry.name.endsWith('.md')) {
|
||||
// Skip .md files at root as they're likely docs
|
||||
const sourcePath = path.join(customPath, entry.name);
|
||||
const targetPath = path.join(bmadCustomDir, entry.name);
|
||||
|
||||
try {
|
||||
// Check if file already exists
|
||||
if (await fs.pathExists(targetPath)) {
|
||||
// File already exists, preserve it
|
||||
results.preserved = (results.preserved || 0) + 1;
|
||||
} else {
|
||||
await fs.copy(sourcePath, targetPath);
|
||||
results.filesCopied++;
|
||||
|
||||
if (fileTrackingCallback) {
|
||||
fileTrackingCallback(targetPath);
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
results.errors.push(`Failed to copy file ${entry.name}: ${error.message}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
results.errors.push(`Installation failed: ${error.message}`);
|
||||
}
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find all files with specific extensions recursively
|
||||
* @param {string} dir - Directory to search
|
||||
* @param {Array} extensions - File extensions to match
|
||||
* @returns {Array} List of matching files
|
||||
*/
|
||||
async findFilesRecursively(dir, extensions) {
|
||||
const files = [];
|
||||
|
||||
async function search(currentDir) {
|
||||
const entries = await fs.readdir(currentDir, { withFileTypes: true });
|
||||
|
||||
for (const entry of entries) {
|
||||
const fullPath = path.join(currentDir, entry.name);
|
||||
|
||||
if (entry.isDirectory()) {
|
||||
await search(fullPath);
|
||||
} else if (extensions.some((ext) => entry.name.endsWith(ext))) {
|
||||
files.push(fullPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
await search(dir);
|
||||
return files;
|
||||
}
|
||||
|
||||
/**
|
||||
* Recursively copy a directory
|
||||
* @param {string} sourceDir - Source directory
|
||||
* @param {string} targetDir - Target directory
|
||||
* @param {Object} results - Results object to update
|
||||
* @param {Function} fileTrackingCallback - Optional callback
|
||||
* @param {Object} config - Configuration for placeholder replacement
|
||||
*/
|
||||
async copyDirectory(sourceDir, targetDir, results, fileTrackingCallback, config) {
|
||||
await fs.ensureDir(targetDir);
|
||||
const entries = await fs.readdir(sourceDir, { withFileTypes: true });
|
||||
|
||||
for (const entry of entries) {
|
||||
const sourcePath = path.join(sourceDir, entry.name);
|
||||
const targetPath = path.join(targetDir, entry.name);
|
||||
|
||||
if (entry.isDirectory()) {
|
||||
await this.copyDirectory(sourcePath, targetPath, results, fileTrackingCallback, config);
|
||||
} else {
|
||||
try {
|
||||
// Check if file already exists
|
||||
if (await fs.pathExists(targetPath)) {
|
||||
// File already exists, preserve it
|
||||
results.preserved = (results.preserved || 0) + 1;
|
||||
} else {
|
||||
// Copy with placeholder replacement for text files
|
||||
const textExtensions = ['.md', '.yaml', '.yml', '.txt', '.json'];
|
||||
if (textExtensions.some((ext) => entry.name.endsWith(ext))) {
|
||||
// Read source content
|
||||
let content = await fs.readFile(sourcePath, 'utf8');
|
||||
|
||||
// Replace placeholders
|
||||
content = content.replaceAll('{bmad_folder}', config.bmad_folder || 'bmad');
|
||||
content = content.replaceAll('{user_name}', config.user_name || 'User');
|
||||
content = content.replaceAll('{communication_language}', config.communication_language || 'English');
|
||||
content = content.replaceAll('{output_folder}', config.output_folder || 'docs');
|
||||
|
||||
// Write to target
|
||||
await fs.ensureDir(path.dirname(targetPath));
|
||||
await fs.writeFile(targetPath, content, 'utf8');
|
||||
} else {
|
||||
// Copy binary files as-is
|
||||
await fs.copy(sourcePath, targetPath);
|
||||
}
|
||||
|
||||
results.filesCopied++;
|
||||
if (fileTrackingCallback) {
|
||||
fileTrackingCallback(targetPath);
|
||||
}
|
||||
}
|
||||
|
||||
if (entry.name.endsWith('.md')) {
|
||||
results.workflowsInstalled++;
|
||||
}
|
||||
} catch (error) {
|
||||
results.errors.push(`Failed to copy ${entry.name}: ${error.message}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = { CustomHandler };
|
||||
|
|
@ -121,8 +121,14 @@ class ModuleManager {
|
|||
for (const entry of entries) {
|
||||
const fullPath = path.join(dir, entry.name);
|
||||
|
||||
// Skip hidden directories and node_modules
|
||||
if (entry.name.startsWith('.') || entry.name === 'node_modules' || entry.name === 'dist' || entry.name === 'build') {
|
||||
// Skip hidden directories, node_modules, and literal placeholder directories
|
||||
if (
|
||||
entry.name.startsWith('.') ||
|
||||
entry.name === 'node_modules' ||
|
||||
entry.name === 'dist' ||
|
||||
entry.name === 'build' ||
|
||||
entry.name === '{project-root}'
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -137,10 +143,16 @@ class ModuleManager {
|
|||
continue;
|
||||
}
|
||||
|
||||
// Check if this directory contains a module (only install-config.yaml is valid now)
|
||||
// Check if this directory contains a module (install-config.yaml OR custom.yaml)
|
||||
const installerConfigPath = path.join(fullPath, '_module-installer', 'install-config.yaml');
|
||||
const customConfigPath = path.join(fullPath, '_module-installer', 'custom.yaml');
|
||||
const rootCustomConfigPath = path.join(fullPath, 'custom.yaml');
|
||||
|
||||
if (await fs.pathExists(installerConfigPath)) {
|
||||
if (
|
||||
(await fs.pathExists(installerConfigPath)) ||
|
||||
(await fs.pathExists(customConfigPath)) ||
|
||||
(await fs.pathExists(rootCustomConfigPath))
|
||||
) {
|
||||
modulePaths.add(fullPath);
|
||||
// Don't scan inside modules - they might have their own nested structures
|
||||
continue;
|
||||
|
|
@ -175,11 +187,12 @@ class ModuleManager {
|
|||
for (const entry of entries) {
|
||||
if (entry.isDirectory()) {
|
||||
const modulePath = path.join(this.modulesSourcePath, entry.name);
|
||||
// Check for module structure (only install-config.yaml is valid now)
|
||||
// Check for module structure (install-config.yaml OR custom.yaml)
|
||||
const installerConfigPath = path.join(modulePath, '_module-installer', 'install-config.yaml');
|
||||
const customConfigPath = path.join(modulePath, '_module-installer', 'custom.yaml');
|
||||
|
||||
// Skip if this doesn't look like a module
|
||||
if (!(await fs.pathExists(installerConfigPath))) {
|
||||
if (!(await fs.pathExists(installerConfigPath)) && !(await fs.pathExists(customConfigPath))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -225,14 +238,27 @@ class ModuleManager {
|
|||
* @returns {Object|null} Module info or null if not a valid module
|
||||
*/
|
||||
async getModuleInfo(modulePath, defaultName, sourceDescription) {
|
||||
// Check for module structure (only install-config.yaml is valid now)
|
||||
// Check for module structure (install-config.yaml OR custom.yaml)
|
||||
const installerConfigPath = path.join(modulePath, '_module-installer', 'install-config.yaml');
|
||||
const customConfigPath = path.join(modulePath, '_module-installer', 'custom.yaml');
|
||||
const rootCustomConfigPath = path.join(modulePath, 'custom.yaml');
|
||||
let configPath = null;
|
||||
|
||||
if (await fs.pathExists(installerConfigPath)) {
|
||||
configPath = installerConfigPath;
|
||||
} else if (await fs.pathExists(customConfigPath)) {
|
||||
configPath = customConfigPath;
|
||||
} else if (await fs.pathExists(rootCustomConfigPath)) {
|
||||
configPath = rootCustomConfigPath;
|
||||
}
|
||||
|
||||
// Skip if this doesn't look like a module
|
||||
if (!(await fs.pathExists(installerConfigPath))) {
|
||||
if (!configPath) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Mark as custom if it's using custom.yaml OR if it's outside src/modules
|
||||
const isCustomSource = sourceDescription !== 'src/modules';
|
||||
const moduleInfo = {
|
||||
id: defaultName,
|
||||
path: modulePath,
|
||||
|
|
@ -243,11 +269,12 @@ class ModuleManager {
|
|||
description: 'BMAD Module',
|
||||
version: '5.0.0',
|
||||
source: sourceDescription,
|
||||
isCustom: configPath === customConfigPath || configPath === rootCustomConfigPath || isCustomSource,
|
||||
};
|
||||
|
||||
// Read module config for metadata
|
||||
try {
|
||||
const configContent = await fs.readFile(installerConfigPath, 'utf8');
|
||||
const configContent = await fs.readFile(configPath, 'utf8');
|
||||
const config = yaml.load(configContent);
|
||||
|
||||
// Use the code property as the id if available
|
||||
|
|
@ -284,6 +311,12 @@ class ModuleManager {
|
|||
if (await fs.pathExists(installerConfigPath)) {
|
||||
return srcModulePath;
|
||||
}
|
||||
|
||||
// Also check for custom.yaml in src/modules/_module-installer
|
||||
const customConfigPath = path.join(srcModulePath, '_module-installer', 'custom.yaml');
|
||||
if (await fs.pathExists(customConfigPath)) {
|
||||
return srcModulePath;
|
||||
}
|
||||
}
|
||||
|
||||
// If not found in src/modules, search the entire project
|
||||
|
|
@ -298,10 +331,21 @@ class ModuleManager {
|
|||
// Need to read configs to match by ID
|
||||
for (const modulePath of allModulePaths) {
|
||||
const installerConfigPath = path.join(modulePath, '_module-installer', 'install-config.yaml');
|
||||
const customConfigPath = path.join(modulePath, '_module-installer', 'custom.yaml');
|
||||
const rootCustomConfigPath = path.join(modulePath, 'custom.yaml');
|
||||
|
||||
let configPath = null;
|
||||
if (await fs.pathExists(installerConfigPath)) {
|
||||
configPath = installerConfigPath;
|
||||
} else if (await fs.pathExists(customConfigPath)) {
|
||||
configPath = customConfigPath;
|
||||
} else if (await fs.pathExists(rootCustomConfigPath)) {
|
||||
configPath = rootCustomConfigPath;
|
||||
}
|
||||
|
||||
if (configPath) {
|
||||
try {
|
||||
const configContent = await fs.readFile(installerConfigPath, 'utf8');
|
||||
const configContent = await fs.readFile(configPath, 'utf8');
|
||||
const config = yaml.load(configContent);
|
||||
if (config.code === moduleName) {
|
||||
return modulePath;
|
||||
|
|
@ -334,6 +378,35 @@ class ModuleManager {
|
|||
throw new Error(`Module '${moduleName}' not found in any source location`);
|
||||
}
|
||||
|
||||
// Check if this is a custom module and read its custom.yaml values
|
||||
let customConfig = null;
|
||||
const rootCustomConfigPath = path.join(sourcePath, 'custom.yaml');
|
||||
const moduleInstallerCustomPath = path.join(sourcePath, '_module-installer', 'custom.yaml');
|
||||
|
||||
if (await fs.pathExists(rootCustomConfigPath)) {
|
||||
try {
|
||||
const customContent = await fs.readFile(rootCustomConfigPath, 'utf8');
|
||||
customConfig = yaml.load(customContent);
|
||||
} catch (error) {
|
||||
console.warn(chalk.yellow(`Warning: Failed to read custom.yaml for ${moduleName}:`, error.message));
|
||||
}
|
||||
} else if (await fs.pathExists(moduleInstallerCustomPath)) {
|
||||
try {
|
||||
const customContent = await fs.readFile(moduleInstallerCustomPath, 'utf8');
|
||||
customConfig = yaml.load(customContent);
|
||||
} catch (error) {
|
||||
console.warn(chalk.yellow(`Warning: Failed to read custom.yaml for ${moduleName}:`, error.message));
|
||||
}
|
||||
}
|
||||
|
||||
// If this is a custom module, merge its values into the module config
|
||||
if (customConfig) {
|
||||
options.moduleConfig = { ...options.moduleConfig, ...customConfig };
|
||||
if (options.logger) {
|
||||
options.logger.log(chalk.cyan(` Merged custom configuration for ${moduleName}`));
|
||||
}
|
||||
}
|
||||
|
||||
// Check if already installed
|
||||
if (await fs.pathExists(targetPath)) {
|
||||
console.log(chalk.yellow(`Module '${moduleName}' already installed, updating...`));
|
||||
|
|
@ -508,7 +581,8 @@ class ModuleManager {
|
|||
}
|
||||
|
||||
// Skip config.yaml templates - we'll generate clean ones with actual values
|
||||
if (file === 'config.yaml' || file.endsWith('/config.yaml')) {
|
||||
// Also skip custom.yaml files - their values will be merged into core config
|
||||
if (file === 'config.yaml' || file.endsWith('/config.yaml') || file === 'custom.yaml' || file.endsWith('/custom.yaml')) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -1035,6 +1109,7 @@ class ModuleManager {
|
|||
const result = await moduleInstaller.install({
|
||||
projectRoot,
|
||||
config: options.moduleConfig || {},
|
||||
coreConfig: options.coreConfig || {},
|
||||
installedIDEs: options.installedIDEs || [],
|
||||
logger,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -52,6 +52,9 @@ class UI {
|
|||
await installer.handleLegacyV4Migration(confirmedDirectory, legacyV4);
|
||||
}
|
||||
|
||||
// Prompt for custom content location (separate from installation directory)
|
||||
const customContentConfig = await this.promptCustomContentLocation();
|
||||
|
||||
// Check if there's an existing BMAD installation
|
||||
const fs = require('fs-extra');
|
||||
const path = require('node:path');
|
||||
|
|
@ -85,9 +88,12 @@ class UI {
|
|||
|
||||
// Handle quick update separately
|
||||
if (actionType === 'quick-update') {
|
||||
// Even for quick update, ask about custom content
|
||||
const customContentConfig = await this.promptCustomContentLocation();
|
||||
return {
|
||||
actionType: 'quick-update',
|
||||
directory: confirmedDirectory,
|
||||
customContent: customContentConfig,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -125,8 +131,21 @@ class UI {
|
|||
console.log(chalk.cyan('\n📦 Keeping existing modules: ') + selectedModules.join(', '));
|
||||
} else {
|
||||
// Only show module selection for new installs
|
||||
const moduleChoices = await this.getModuleChoices(installedModuleIds);
|
||||
const moduleChoices = await this.getModuleChoices(installedModuleIds, customContentConfig);
|
||||
selectedModules = await this.selectModules(moduleChoices);
|
||||
|
||||
// Check which custom content items were selected
|
||||
const selectedCustomContent = selectedModules.filter((mod) => mod.startsWith('__CUSTOM_CONTENT__'));
|
||||
if (selectedCustomContent.length > 0) {
|
||||
customContentConfig.selected = true;
|
||||
customContentConfig.selectedFiles = selectedCustomContent.map((mod) => mod.replace('__CUSTOM_CONTENT__', ''));
|
||||
// Filter out custom content markers since they're not real modules
|
||||
selectedModules = selectedModules.filter((mod) => !mod.startsWith('__CUSTOM_CONTENT__'));
|
||||
} else if (customContentConfig.hasCustomContent) {
|
||||
// User provided custom content but didn't select any
|
||||
customContentConfig.selected = false;
|
||||
customContentConfig.selectedFiles = [];
|
||||
}
|
||||
}
|
||||
|
||||
// Prompt for AgentVibes TTS integration
|
||||
|
|
@ -147,7 +166,9 @@ class UI {
|
|||
ides: toolSelection.ides,
|
||||
skipIde: toolSelection.skipIde,
|
||||
coreConfig: coreConfig, // Pass collected core config to installer
|
||||
enableAgentVibes: agentVibesConfig.enabled, // AgentVibes TTS integration
|
||||
// Custom content configuration
|
||||
customContent: customContentConfig,
|
||||
enableAgentVibes: agentVibesConfig.enabled,
|
||||
agentVibesInstalled: agentVibesConfig.alreadyInstalled,
|
||||
};
|
||||
}
|
||||
|
|
@ -483,19 +504,52 @@ class UI {
|
|||
/**
|
||||
* Get module choices for selection
|
||||
* @param {Set} installedModuleIds - Currently installed module IDs
|
||||
* @param {Object} customContentConfig - Custom content configuration
|
||||
* @returns {Array} Module choices for inquirer
|
||||
*/
|
||||
async getModuleChoices(installedModuleIds) {
|
||||
async getModuleChoices(installedModuleIds, customContentConfig = null) {
|
||||
const moduleChoices = [];
|
||||
const isNewInstallation = installedModuleIds.size === 0;
|
||||
|
||||
// Add custom content items first if found
|
||||
if (customContentConfig && customContentConfig.hasCustomContent && customContentConfig.customPath) {
|
||||
// Add separator before custom content
|
||||
moduleChoices.push(new inquirer.Separator('── Custom Content ──'));
|
||||
|
||||
// Get the custom content info to display proper names
|
||||
const { CustomHandler } = require('../installers/lib/custom/handler');
|
||||
const customHandler = new CustomHandler();
|
||||
const customFiles = await customHandler.findCustomContent(customContentConfig.customPath);
|
||||
|
||||
for (const customFile of customFiles) {
|
||||
const customInfo = await customHandler.getCustomInfo(customFile);
|
||||
if (customInfo) {
|
||||
moduleChoices.push({
|
||||
name: `${chalk.cyan('✓')} ${customInfo.name} ${chalk.gray(`(${customInfo.relativePath})`)}`,
|
||||
value: `__CUSTOM_CONTENT__${customFile}`, // Unique value for each custom content
|
||||
checked: true, // Default to selected since user chose to provide custom content
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Add separator for official content
|
||||
moduleChoices.push(new inquirer.Separator('── Official Content ──'));
|
||||
}
|
||||
|
||||
// Add official modules
|
||||
const { ModuleManager } = require('../installers/lib/modules/manager');
|
||||
const moduleManager = new ModuleManager();
|
||||
const availableModules = await moduleManager.listAvailable();
|
||||
|
||||
const isNewInstallation = installedModuleIds.size === 0;
|
||||
return availableModules.map((mod) => ({
|
||||
name: mod.name,
|
||||
value: mod.id,
|
||||
checked: isNewInstallation ? mod.defaultSelected || false : installedModuleIds.has(mod.id),
|
||||
}));
|
||||
for (const mod of availableModules) {
|
||||
moduleChoices.push({
|
||||
name: mod.name,
|
||||
value: mod.id,
|
||||
checked: isNewInstallation ? mod.defaultSelected || false : installedModuleIds.has(mod.id),
|
||||
});
|
||||
}
|
||||
|
||||
return moduleChoices;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -572,6 +626,111 @@ class UI {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Prompt for custom content location
|
||||
* @returns {Object} Custom content configuration
|
||||
*/
|
||||
async promptCustomContentLocation() {
|
||||
try {
|
||||
CLIUtils.displaySection('Custom Content', 'Optional: Add custom agents and workflows');
|
||||
|
||||
const { hasCustomContent } = await inquirer.prompt([
|
||||
{
|
||||
type: 'list',
|
||||
name: 'hasCustomContent',
|
||||
message: 'Do you have custom content to install?',
|
||||
choices: [
|
||||
{ name: 'No (skip custom content)', value: 'none' },
|
||||
{ name: 'Enter a directory path', value: 'directory' },
|
||||
{ name: 'Enter a URL', value: 'url' },
|
||||
],
|
||||
default: 'none',
|
||||
},
|
||||
]);
|
||||
|
||||
if (hasCustomContent === 'none') {
|
||||
return { hasCustomContent: false };
|
||||
}
|
||||
|
||||
if (hasCustomContent === 'url') {
|
||||
console.log(chalk.yellow('\nURL-based custom content installation is coming soon!'));
|
||||
console.log(chalk.cyan('For now, please download your custom content and choose "Enter a directory path".\n'));
|
||||
return { hasCustomContent: false };
|
||||
}
|
||||
|
||||
if (hasCustomContent === 'directory') {
|
||||
let customPath;
|
||||
while (!customPath) {
|
||||
let expandedPath;
|
||||
const { directory } = await inquirer.prompt([
|
||||
{
|
||||
type: 'input',
|
||||
name: 'directory',
|
||||
message: 'Enter the path to your custom content directory:',
|
||||
default: process.cwd(), // Use actual current working directory
|
||||
validate: async (input) => {
|
||||
if (!input || input.trim() === '') {
|
||||
return 'Please enter a directory path';
|
||||
}
|
||||
|
||||
try {
|
||||
expandedPath = this.expandUserPath(input.trim());
|
||||
} catch (error) {
|
||||
return error.message;
|
||||
}
|
||||
|
||||
// Check if the path exists
|
||||
const pathExists = await fs.pathExists(expandedPath);
|
||||
if (!pathExists) {
|
||||
return 'Directory does not exist';
|
||||
}
|
||||
|
||||
return true;
|
||||
},
|
||||
},
|
||||
]);
|
||||
|
||||
// Now expand the path for use after the prompt
|
||||
expandedPath = this.expandUserPath(directory.trim());
|
||||
|
||||
// Check if directory has custom content
|
||||
const { CustomHandler } = require('../installers/lib/custom/handler');
|
||||
const customHandler = new CustomHandler();
|
||||
const customFiles = await customHandler.findCustomContent(expandedPath);
|
||||
|
||||
if (customFiles.length === 0) {
|
||||
console.log(chalk.yellow(`\nNo custom.yaml files found in ${expandedPath}`));
|
||||
|
||||
const { tryAgain } = await inquirer.prompt([
|
||||
{
|
||||
type: 'confirm',
|
||||
name: 'tryAgain',
|
||||
message: 'Try a different directory?',
|
||||
default: true,
|
||||
},
|
||||
]);
|
||||
|
||||
if (tryAgain) {
|
||||
continue;
|
||||
} else {
|
||||
return { hasCustomContent: false };
|
||||
}
|
||||
}
|
||||
|
||||
customPath = expandedPath;
|
||||
console.log(chalk.green(`\n✓ Found ${customFiles.length} custom content file(s)`));
|
||||
}
|
||||
|
||||
return { hasCustomContent: true, customPath };
|
||||
}
|
||||
|
||||
return { hasCustomContent: false };
|
||||
} catch (error) {
|
||||
console.error(chalk.red('Error in custom content prompt:'), error);
|
||||
return { hasCustomContent: false };
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Confirm directory selection
|
||||
* @param {string} directory - The directory path
|
||||
|
|
|
|||
|
|
@ -0,0 +1,55 @@
|
|||
# Raven's Verdict - Deep PR Review Tool
|
||||
|
||||
Adversarial code review for GitHub PRs. Works with any LLM agent.
|
||||
|
||||
> **Status: Experimental.** We're still figuring out how to use this effectively. Expect the workflow to evolve.
|
||||
|
||||
## How It Works
|
||||
|
||||
Point your agent at `review-pr.md` and ask it to review a specific PR:
|
||||
|
||||
> "Read tools/maintainer/review-pr.md and apply it to PR #123"
|
||||
|
||||
The tool will:
|
||||
|
||||
1. Check out the PR branch locally
|
||||
2. Run an adversarial review (find at least 5 issues)
|
||||
3. Transform findings into professional tone
|
||||
4. Preview the review and ask before posting
|
||||
|
||||
See `review-pr.md` for full prompt structure, severity ratings, and sandboxing rules.
|
||||
|
||||
## When to Use
|
||||
|
||||
**Good candidates:**
|
||||
|
||||
- PRs with meaningful logic changes
|
||||
- Refactors touching multiple files
|
||||
- New features or architectural changes
|
||||
|
||||
**Skip it for:**
|
||||
|
||||
- Trivial PRs (typo fixes, version bumps, single-line changes)
|
||||
- PRs you've already reviewed manually
|
||||
- PRs where you haven't agreed on the approach yet — fix the direction before the implementation
|
||||
|
||||
## Workflow Tips
|
||||
|
||||
**Always review before posting.** The preview step exists for a reason:
|
||||
|
||||
- **[y] Yes** — Post as-is (only if you're confident)
|
||||
- **[e] Edit** — Modify findings before posting
|
||||
- **[s] Save only** — Write to file, don't post
|
||||
|
||||
The save option is useful when you want to:
|
||||
|
||||
- Hand-edit the review before posting
|
||||
- Use the findings as input for a second opinion ("Hey Claude, here's what Raven found — what do you think?")
|
||||
- Cherry-pick specific findings
|
||||
|
||||
**Trust but verify.** LLM reviews can miss context or flag non-issues. Skim the findings before they hit the PR.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- `gh` CLI installed and authenticated (`gh auth status`)
|
||||
- Any LLM agent capable of running bash commands
|
||||
|
|
@ -0,0 +1,242 @@
|
|||
# Raven's Verdict - Deep PR Review Tool
|
||||
|
||||
A cynical adversarial review, transformed into cold engineering professionalism.
|
||||
|
||||
<orientation>
|
||||
CRITICAL: Sandboxed Execution Rules
|
||||
|
||||
Before proceeding, you MUST verify:
|
||||
|
||||
- [ ] PR number or URL was EXPLICITLY provided in the user's message
|
||||
- [ ] You are NOT inferring the PR from conversation history
|
||||
- [ ] You are NOT looking at git branches, recent commits, or local state
|
||||
- [ ] You are NOT guessing or assuming any PR numbers
|
||||
|
||||
**If no explicit PR number/URL was provided, STOP immediately and ask:**
|
||||
"What PR number or URL should I review?"
|
||||
</orientation>
|
||||
|
||||
<preflight-checks>
|
||||
|
||||
## Preflight Checks
|
||||
|
||||
### 0.1 Parse PR Input
|
||||
|
||||
Extract PR number from user input. Examples of valid formats:
|
||||
|
||||
- `123` (just the number)
|
||||
- `#123` (with hash)
|
||||
- `https://github.com/owner/repo/pull/123` (full URL)
|
||||
|
||||
If a URL specifies a different repository than the current one:
|
||||
|
||||
```bash
|
||||
# Check current repo
|
||||
gh repo view --json nameWithOwner -q '.nameWithOwner'
|
||||
```
|
||||
|
||||
If mismatch detected, ask user:
|
||||
|
||||
> "This PR is from `{detected_repo}` but we're in `{current_repo}`. Proceed with reviewing `{detected_repo}#123`? (y/n)"
|
||||
|
||||
If user confirms, store `{REPO}` for use in all subsequent `gh` commands.
|
||||
|
||||
### 0.2 Ensure Clean Checkout
|
||||
|
||||
Verify the working tree is clean and check out the PR branch.
|
||||
|
||||
```bash
|
||||
# Check for uncommitted changes
|
||||
git status --porcelain
|
||||
```
|
||||
|
||||
If output is non-empty, STOP and tell user:
|
||||
|
||||
> "You have uncommitted changes. Please commit or stash them before running a PR review."
|
||||
|
||||
If clean, fetch and checkout the PR branch:
|
||||
|
||||
```bash
|
||||
# Fetch and checkout PR branch
|
||||
# For cross-repo PRs, include --repo {REPO}
|
||||
gh pr checkout {PR_NUMBER} [--repo {REPO}]
|
||||
```
|
||||
|
||||
If checkout fails, STOP and report the error.
|
||||
|
||||
Now you're on the PR branch with full access to all files as they exist in the PR.
|
||||
|
||||
### 0.3 Check PR Size
|
||||
|
||||
```bash
|
||||
# For cross-repo PRs, include --repo {REPO}
|
||||
gh pr view {PR_NUMBER} [--repo {REPO}] --json additions,deletions,changedFiles -q '{"additions": .additions, "deletions": .deletions, "files": .changedFiles}'
|
||||
```
|
||||
|
||||
**Size thresholds:**
|
||||
|
||||
| Metric | Warning Threshold |
|
||||
| ------------- | ----------------- |
|
||||
| Files changed | > 50 |
|
||||
| Lines changed | > 5000 |
|
||||
|
||||
If thresholds exceeded, ask user:
|
||||
|
||||
> "This PR has {X} files and {Y} line changes. That's large.
|
||||
>
|
||||
> **[f] Focus** - Pick specific files or directories to review
|
||||
> **[p] Proceed** - Review everything (may be slow/expensive)
|
||||
> **[a] Abort** - Stop here"
|
||||
|
||||
### 0.4 Note Binary Files
|
||||
|
||||
```bash
|
||||
# For cross-repo PRs, include --repo {REPO}
|
||||
gh pr diff {PR_NUMBER} [--repo {REPO}] --name-only | grep -E '\.(png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot|pdf|zip|tar|gz|bin|exe|dll|so|dylib)$' || echo "No binary files detected"
|
||||
```
|
||||
|
||||
Store list of binary files to skip. Note them in final output.
|
||||
|
||||
</preflight-checks>
|
||||
|
||||
<adversarial-review>
|
||||
|
||||
### 1.1 Run Cynical Review
|
||||
|
||||
**INTERNAL PERSONA - Never post this directly:**
|
||||
|
||||
Task: You are a cynical, jaded code reviewer with zero patience for sloppy work. This PR was submitted by a clueless weasel and you expect to find problems. Find at least five issues to fix or improve in it. Number them. Be skeptical of everything. Ultrathink.
|
||||
|
||||
Output format:
|
||||
|
||||
```markdown
|
||||
### [NUMBER]. [FINDING TITLE] [likely]
|
||||
|
||||
**Severity:** [EMOJI] [LEVEL]
|
||||
|
||||
[DESCRIPTION - be specific, include file:line references]
|
||||
```
|
||||
|
||||
Severity scale:
|
||||
|
||||
| Level | Emoji | Meaning |
|
||||
| -------- | ----- | ------------------------------------------------------- |
|
||||
| Critical | 🔴 | Security issue, data loss risk, or broken functionality |
|
||||
| Moderate | 🟡 | Bug, performance issue, or significant code smell |
|
||||
| Minor | 🟢 | Style, naming, minor improvement opportunity |
|
||||
|
||||
Likely tag:
|
||||
|
||||
- Add `[likely]` to findings with high confidence, e.g. with direct evidence
|
||||
- Sort findings by severity (Critical → Moderate → Minor), not by confidence
|
||||
|
||||
</adversarial-review>
|
||||
|
||||
<tone-transformation>
|
||||
|
||||
**Transform the cynical output into cold engineering professionalism.**
|
||||
|
||||
**Transformation rules:**
|
||||
|
||||
1. Remove all inflammatory language, insults, assumptions about the author
|
||||
2. Keep all technical substance, file references, severity ratings and likely tag
|
||||
3. Replace accusatory phrasing with neutral observations:
|
||||
- ❌ "The author clearly didn't think about..."
|
||||
- ✅ "This implementation may not account for..."
|
||||
4. Preserve skepticism as healthy engineering caution:
|
||||
- ❌ "This will definitely break in production"
|
||||
- ✅ "This pattern has historically caused issues in production environments"
|
||||
5. Add the suggested fixes.
|
||||
6. Keep suggestions actionable and specific
|
||||
|
||||
Output format after transformation:
|
||||
|
||||
```markdown
|
||||
## PR Review: #{PR_NUMBER}
|
||||
|
||||
**Title:** {PR_TITLE}
|
||||
**Author:** @{AUTHOR}
|
||||
**Branch:** {HEAD} → {BASE}
|
||||
|
||||
---
|
||||
|
||||
### Findings
|
||||
|
||||
[TRANSFORMED FINDINGS HERE]
|
||||
|
||||
---
|
||||
|
||||
### Summary
|
||||
|
||||
**Critical:** {COUNT} | **Moderate:** {COUNT} | **Minor:** {COUNT}
|
||||
|
||||
[BINARY_FILES_NOTE if any]
|
||||
|
||||
---
|
||||
|
||||
_Review generated by Raven's Verdict. LLM-produced analysis - findings may be incorrect or lack context. Verify before acting._
|
||||
```
|
||||
|
||||
</tone-transformation>
|
||||
|
||||
<post-review>
|
||||
### 3.1 Preview
|
||||
|
||||
Display the complete transformed review to the user.
|
||||
|
||||
```
|
||||
══════════════════════════════════════════════════════
|
||||
PREVIEW - This will be posted to PR #{PR_NUMBER}
|
||||
══════════════════════════════════════════════════════
|
||||
|
||||
[FULL REVIEW CONTENT]
|
||||
|
||||
══════════════════════════════════════════════════════
|
||||
```
|
||||
|
||||
### 3.2 Confirm
|
||||
|
||||
Ask user for explicit confirmation:
|
||||
|
||||
> **Ready to post this review to PR #{PR_NUMBER}?**
|
||||
>
|
||||
> **[y] Yes** - Post as comment
|
||||
> **[n] No** - Abort, do not post
|
||||
> **[e] Edit** - Let me modify before posting
|
||||
> **[s] Save only** - Save locally, don't post
|
||||
|
||||
### 3.3 Post or Save
|
||||
|
||||
**Write review to a temp file, then post:**
|
||||
|
||||
1. Write the review content to a temp file with a unique name (include PR number to avoid collisions)
|
||||
2. Post using `gh pr comment {PR_NUMBER} [--repo {REPO}] --body-file {path}`
|
||||
3. Delete the temp file after successful post
|
||||
|
||||
Do NOT use heredocs or `echo` - Markdown code blocks will break shell parsing. Use your file writing tool instead.
|
||||
|
||||
**If auth fails or post fails:**
|
||||
|
||||
1. Display error prominently:
|
||||
|
||||
```
|
||||
⚠️ FAILED TO POST REVIEW
|
||||
Error: {ERROR_MESSAGE}
|
||||
```
|
||||
|
||||
2. Keep the temp file and tell the user where it is, so they can post manually with:
|
||||
`gh pr comment {PR_NUMBER} [--repo {REPO}] --body-file {path}`
|
||||
|
||||
**If save only (s):**
|
||||
|
||||
Keep the temp file and inform user of location.
|
||||
|
||||
</post-review>
|
||||
|
||||
<notes>
|
||||
- The "cynical asshole" phase is internal only - never posted
|
||||
- Tone transform MUST happen before any external output
|
||||
- When in doubt, ask the user - never assume
|
||||
- If you're unsure about severity, err toward higher severity
|
||||
- If you're unsure about confidence, be honest and use Medium or Low
|
||||
</notes>
|
||||
Loading…
Reference in New Issue