diff --git a/.bmad-user-memory/cbt-coach/cognitive-distortions.md b/.bmad-user-memory/cbt-coach/cognitive-distortions.md deleted file mode 100644 index 58e567b0..00000000 --- a/.bmad-user-memory/cbt-coach/cognitive-distortions.md +++ /dev/null @@ -1,47 +0,0 @@ -# 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_ diff --git a/.bmad-user-memory/cbt-coach/thought-records.md b/.bmad-user-memory/cbt-coach/thought-records.md deleted file mode 100644 index 6fd54e63..00000000 --- a/.bmad-user-memory/cbt-coach/thought-records.md +++ /dev/null @@ -1,17 +0,0 @@ -# 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_ diff --git a/.bmad-user-memory/wellness-companion/insights.md b/.bmad-user-memory/wellness-companion/insights.md deleted file mode 100644 index 5ab17362..00000000 --- a/.bmad-user-memory/wellness-companion/insights.md +++ /dev/null @@ -1,13 +0,0 @@ -# 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_ diff --git a/.bmad-user-memory/wellness-companion/instructions.md b/.bmad-user-memory/wellness-companion/instructions.md deleted file mode 100644 index 9062ac30..00000000 --- a/.bmad-user-memory/wellness-companion/instructions.md +++ /dev/null @@ -1,30 +0,0 @@ -# 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 diff --git a/.bmad-user-memory/wellness-companion/memories.md b/.bmad-user-memory/wellness-companion/memories.md deleted file mode 100644 index 3b5330e3..00000000 --- a/.bmad-user-memory/wellness-companion/memories.md +++ /dev/null @@ -1,13 +0,0 @@ -# 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_ diff --git a/.bmad-user-memory/wellness-companion/patterns.md b/.bmad-user-memory/wellness-companion/patterns.md deleted file mode 100644 index 263aac53..00000000 --- a/.bmad-user-memory/wellness-companion/patterns.md +++ /dev/null @@ -1,17 +0,0 @@ -# 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_ diff --git a/docs/custom-content-installation.md b/docs/custom-content-installation.md index e56f0906..a19873ee 100644 --- a/docs/custom-content-installation.md +++ b/docs/custom-content-installation.md @@ -64,7 +64,7 @@ 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 +├── module.yaml # Module installation configuration with custom question and answer capture ├── docs/ # Module documentation ├── agents/ # Module-specific agents ├── workflows/ # Module-specific workflows @@ -77,7 +77,7 @@ my-module/ #### Module Configuration -The `_module-installer/install-config.yaml` file defines how your module is installed: +The `module.yaml` file defines how your module is installed: ```yaml # Module metadata @@ -99,12 +99,6 @@ my_setting: 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 @@ -129,7 +123,7 @@ If you select "Enter a directory path", the installer will prompt for the locati 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) +- Scan for `module.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 @@ -230,7 +224,7 @@ Custom content can be distributed: ### No Custom Content Found -- Ensure your `custom.yaml` or `install-config.yaml` files are properly named +- Ensure your `custom.yaml` or `module.yaml` files are properly named - Check file permissions - Verify the directory path is correct diff --git a/docs/installers-bundlers/installers-modules-platforms-reference.md b/docs/installers-bundlers/installers-modules-platforms-reference.md index 62f1a398..45108177 100644 --- a/docs/installers-bundlers/installers-modules-platforms-reference.md +++ b/docs/installers-bundlers/installers-modules-platforms-reference.md @@ -59,6 +59,7 @@ project-root/ ### Key Exclusions - `_module-installer/` directories are never copied to destination +- module.yaml - `localskip="true"` agents are filtered out - Source `config.yaml` templates are replaced with generated configs @@ -92,8 +93,8 @@ Creative Innovation Studio for design workflows ``` src/modules/{module}/ ├── _module-installer/ # Not copied to destination -│ ├── installer.js # Post-install logic -│ └── install-config.yaml +│ ├── installer.js # Post-install logic +├── module.yaml ├── agents/ ├── tasks/ ├── templates/ @@ -107,7 +108,7 @@ src/modules/{module}/ ### Collection Process -Modules define prompts in `install-config.yaml`: +Modules define prompts in `module.yaml`: ```yaml project_name: @@ -218,12 +219,12 @@ Platform-specific content without source modification: src/modules/mymod/ ├── _module-installer/ │ ├── installer.js - │ └── install-config.yaml + ├── module.yaml ├── agents/ └── tasks/ ``` -2. **Configuration** (`install-config.yaml`) +2. **Configuration** (`module.yaml`) ```yaml code: mymod diff --git a/example-custom-content/agents/toolsmith/toolsmith-sidecar/instructions.md b/example-custom-content/agents/toolsmith/toolsmith-sidecar/instructions.md index 5d702a57..3c0121f5 100644 --- a/example-custom-content/agents/toolsmith/toolsmith-sidecar/instructions.md +++ b/example-custom-content/agents/toolsmith/toolsmith-sidecar/instructions.md @@ -41,7 +41,7 @@ CLI uses Commander.js, commands auto-loaded from `tools/cli/commands/`: ### Core Architecture Patterns 1. **IDE Handlers**: Each IDE extends BaseIdeSetup class -2. **Module Installers**: Modules can have `_module-installer/installer.js` +2. **Module Installers**: Modules can have `module.yaml` and `_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 diff --git a/example-custom-content/agents/toolsmith/toolsmith-sidecar/knowledge/installers.md b/example-custom-content/agents/toolsmith/toolsmith-sidecar/knowledge/installers.md index d25d8e27..71498d59 100644 --- a/example-custom-content/agents/toolsmith/toolsmith-sidecar/knowledge/installers.md +++ b/example-custom-content/agents/toolsmith/toolsmith-sidecar/knowledge/installers.md @@ -117,7 +117,7 @@ Contains: - 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 +- Add module installer: Create \_module-installer/installer.js if custom installer logic needed - Update shared generators: Modify files in /shared/ directory ## Relationships diff --git a/example-custom-content/agents/toolsmith/toolsmith-sidecar/knowledge/modules.md b/example-custom-content/agents/toolsmith/toolsmith-sidecar/knowledge/modules.md index a2386254..496356f6 100644 --- a/example-custom-content/agents/toolsmith/toolsmith-sidecar/knowledge/modules.md +++ b/example-custom-content/agents/toolsmith/toolsmith-sidecar/knowledge/modules.md @@ -27,7 +27,7 @@ src/modules/{module-name}/ │ ├── injections.yaml │ ├── config.yaml │ └── sub-agents/ -├── install-config.yaml # Module install configuration +├── module.yaml # Module install configuration └── README.md # Module documentation ``` @@ -145,7 +145,7 @@ Defined in @/tools/cli/lib/platform-codes.js - 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 +- Customize module installation: Modify module.yaml ## Relationships diff --git a/example-custom-content/custom.yaml b/example-custom-content/module.yaml similarity index 89% rename from example-custom-content/custom.yaml rename to example-custom-content/module.yaml index 63263f29..85daca32 100644 --- a/example-custom-content/custom.yaml +++ b/example-custom-content/module.yaml @@ -1,3 +1,4 @@ code: bmad-custom name: "BMAD-Custom: Sample Stand Alone Custom Agents and Workflows" default_selected: true +type: custom diff --git a/example-custom-module/mwm/README.md b/example-custom-module/mwm/README.md index 09e8aba8..7ac6f328 100644 --- a/example-custom-module/mwm/README.md +++ b/example-custom-module/mwm/README.md @@ -3,9 +3,6 @@ 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 diff --git a/example-custom-module/mwm/_module-installer/install-config.yaml b/example-custom-module/mwm/module.yaml similarity index 98% rename from example-custom-module/mwm/_module-installer/install-config.yaml rename to example-custom-module/mwm/module.yaml index ccfe66c8..7f91165b 100644 --- a/example-custom-module/mwm/_module-installer/install-config.yaml +++ b/example-custom-module/mwm/module.yaml @@ -4,6 +4,7 @@ code: mwm name: "MWM: Mental Wellness Module" default_selected: false +type: module header: "MWM™: Custom Wellness Module" subheader: "Demo of Potential Non Coding Custom Module Use case" diff --git a/src/core/_module-installer/installer.js b/src/core/_module-installer/installer.js index 2fef9562..d77bc62f 100644 --- a/src/core/_module-installer/installer.js +++ b/src/core/_module-installer/installer.js @@ -6,7 +6,7 @@ const chalk = require('chalk'); * * @param {Object} options - Installation options * @param {string} options.projectRoot - The root directory of the target project - * @param {Object} options.config - Module configuration from install-config.yaml + * @param {Object} options.config - Module configuration from module.yaml * @param {Array} options.installedIDEs - Array of IDE codes that were installed * @param {Object} options.logger - Logger instance for output * @returns {Promise} - Success status diff --git a/src/core/_module-installer/install-config.yaml b/src/core/module.yaml similarity index 100% rename from src/core/_module-installer/install-config.yaml rename to src/core/module.yaml diff --git a/src/modules/bmb/_module-installer/installer.js b/src/modules/bmb/_module-installer/installer.js index a1897c89..9b201f57 100644 --- a/src/modules/bmb/_module-installer/installer.js +++ b/src/modules/bmb/_module-installer/installer.js @@ -8,7 +8,7 @@ const chalk = require('chalk'); * * @param {Object} options - Installation options * @param {string} options.projectRoot - The root directory of the target project - * @param {Object} options.config - Module configuration from install-config.yaml + * @param {Object} options.config - Module configuration from module.yaml * @param {Object} options.coreConfig - Core configuration containing user_name * @param {Array} options.installedIDEs - Array of IDE codes that were installed * @param {Object} options.logger - Logger instance for output diff --git a/src/modules/bmb/_module-installer/install-config.yaml b/src/modules/bmb/module.yaml similarity index 100% rename from src/modules/bmb/_module-installer/install-config.yaml rename to src/modules/bmb/module.yaml diff --git a/src/modules/bmb/workflows/create-module/steps/step-04-structure.md b/src/modules/bmb/workflows/create-module/steps/step-04-structure.md index 0e4cc7d8..ed12122d 100644 --- a/src/modules/bmb/workflows/create-module/steps/step-04-structure.md +++ b/src/modules/bmb/workflows/create-module/steps/step-04-structure.md @@ -113,10 +113,10 @@ For a [module type] module, we'll create this structure:" │ └── [template-files] ├── data/ # Module data files │ └── [data-files] +├── module.yaml # Required ├── _module-installer/ # Installation configuration -│ ├── install-config.yaml # Required -│ ├── installer.js # Optional -│ └── assets/ # Optional install assets +│ ├── installer.js # Optional +│ └── assets/ # Optional install assets └── README.md # Module documentation ``` diff --git a/src/modules/bmb/workflows/create-module/steps/step-05-config.md b/src/modules/bmb/workflows/create-module/steps/step-05-config.md index 6ee043e2..55da3c50 100644 --- a/src/modules/bmb/workflows/create-module/steps/step-05-config.md +++ b/src/modules/bmb/workflows/create-module/steps/step-05-config.md @@ -184,7 +184,7 @@ Update module-plan.md with configuration section: ### Result Configuration Structure -The install-config.yaml will generate: +The module.yaml will generate: - Module configuration at: {bmad_folder}/{module_code}/config.yaml - User settings stored as: [describe structure] ```` diff --git a/src/modules/bmb/workflows/create-module/steps/step-08-installer.md b/src/modules/bmb/workflows/create-module/steps/step-08-installer.md index 1f9bc369..4332ab68 100644 --- a/src/modules/bmb/workflows/create-module/steps/step-08-installer.md +++ b/src/modules/bmb/workflows/create-module/steps/step-08-installer.md @@ -37,7 +37,7 @@ partyModeWorkflow: '{project-root}/{bmad_folder}/core/workflows/party-mode/workf ## EXECUTION PROTOCOLS: - 🎯 Use configuration plan from step 5 -- 💾 Create install-config.yaml with all fields +- 💾 Create module.yaml with all fields - 📖 Add "step-08-installer" to stepsCompleted array` before loading next step - 🚫 FORBIDDEN to load next step until user selects 'C' @@ -50,7 +50,7 @@ partyModeWorkflow: '{project-root}/{bmad_folder}/core/workflows/party-mode/workf ## STEP GOAL: -To create the module installer configuration (install-config.yaml) that defines how users will install and configure the module. +To create the module installer configuration (module.yaml) that defines how users will install and configure the module. ## INSTALLER SETUP PROCESS: @@ -74,11 +74,11 @@ From step 5, we planned these configuration fields: Ensure \_module-installer directory exists Directory: {custom_module_location}/{module_name}/\_module-installer/ -### 3. Create install-config.yaml +### 3. Create module.yaml -"I'll create the install-config.yaml file based on your configuration plan. This is the core installer configuration file." +"I'll create the module.yaml file based on your configuration plan. This is the core installer configuration file." -Create file: {custom_module_location}/{module_name}/\_module-installer/install-config.yaml from template {installConfigTemplate} +Create file: {custom_module_location}/{module_name}/module.yaml from template {installConfigTemplate} ### 4. Handle Custom Installation Logic @@ -117,7 +117,7 @@ Update module-plan.md with installer section: ### Install Configuration -- File: \_module-installer/install-config.yaml +- File: module.yaml - Module code: {module_name} - Default selected: false - Configuration fields: [count] @@ -166,7 +166,7 @@ Display: **Select an Option:** [A] Advanced Elicitation [P] Party Mode [C] Conti ### ✅ SUCCESS: -- install-config.yaml created with all planned fields +- module.yaml created with all planned fields - YAML syntax valid - Custom installation logic prepared (if needed) - Installer follows BMAD standards @@ -174,7 +174,7 @@ Display: **Select an Option:** [A] Advanced Elicitation [P] Party Mode [C] Conti ### ❌ SYSTEM FAILURE: -- Not creating install-config.yaml +- Not creating module.yaml - Invalid YAML syntax - Missing required fields - Not using proper path templates diff --git a/src/modules/bmb/workflows/create-module/steps/step-09-documentation.md b/src/modules/bmb/workflows/create-module/steps/step-09-documentation.md index dd74db4b..8d98c239 100644 --- a/src/modules/bmb/workflows/create-module/steps/step-09-documentation.md +++ b/src/modules/bmb/workflows/create-module/steps/step-09-documentation.md @@ -133,7 +133,8 @@ bmad install {module_name} ├── tasks/ # Task files ├── templates/ # Shared templates ├── data/ # Module data -├── _module-installer/ # Installation config +├── _module-installer/ # Installation optional js file with custom install routine +├── module.yaml # yaml config and install questions └── README.md # This file ``` diff --git a/src/modules/bmb/workflows/create-module/steps/step-10-roadmap.md b/src/modules/bmb/workflows/create-module/steps/step-10-roadmap.md index 4168bc8c..39807a7d 100644 --- a/src/modules/bmb/workflows/create-module/steps/step-10-roadmap.md +++ b/src/modules/bmb/workflows/create-module/steps/step-10-roadmap.md @@ -207,9 +207,10 @@ workflow {workflow_name} ├── workflows/ # ✅ Structure created, plans written ├── tasks/ # ✅ Created ├── templates/ # ✅ Created -├── data/ # ✅ Created +├── data/ # ✅ Created ├── _module-installer/ # ✅ Configured -└── README.md # ✅ Complete +└── README.md # ✅ Complete +└── module.yaml # ✅ Complete ``` ## Completion Criteria diff --git a/src/modules/bmb/workflows/create-module/steps/step-11-validate.md b/src/modules/bmb/workflows/create-module/steps/step-11-validate.md index 1c186b7e..31182408 100644 --- a/src/modules/bmb/workflows/create-module/steps/step-11-validate.md +++ b/src/modules/bmb/workflows/create-module/steps/step-11-validate.md @@ -73,8 +73,8 @@ Expected Structure: ├── templates/ [✅/❌] ├── data/ [✅/❌] ├── _module-installer/ [✅/❌] -│ ├── install-config.yaml [✅/❌] -│ └── installer.js [✅/N/A] +│ └── installer.js [✅/N/A] +├── module.yaml [✅/❌] └── README.md [✅/❌] ``` @@ -87,7 +87,7 @@ Expected Structure: "**2. Configuration Files Check**" **Install Configuration:** -Validate install-config.yaml +Validate module.yaml - [ ] YAML syntax valid - [ ] Module code matches folder name diff --git a/src/modules/bmb/workflows/create-module/templates/installer.template.js b/src/modules/bmb/workflows/create-module/templates/installer.template.js index f9114425..428a57e4 100644 --- a/src/modules/bmb/workflows/create-module/templates/installer.template.js +++ b/src/modules/bmb/workflows/create-module/templates/installer.template.js @@ -6,7 +6,7 @@ /** * @param {Object} options - Installation options * @param {string} options.projectRoot - Project root directory - * @param {Object} options.config - Module configuration from install-config.yaml + * @param {Object} options.config - Module configuration from module.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 diff --git a/src/modules/bmb/workflows/create-module/templates/install-config.template.yaml b/src/modules/bmb/workflows/create-module/templates/module.template.yaml similarity index 100% rename from src/modules/bmb/workflows/create-module/templates/install-config.template.yaml rename to src/modules/bmb/workflows/create-module/templates/module.template.yaml diff --git a/src/modules/bmb/workflows/create-module/validation.md b/src/modules/bmb/workflows/create-module/validation.md index 001e28a2..3783b2aa 100644 --- a/src/modules/bmb/workflows/create-module/validation.md +++ b/src/modules/bmb/workflows/create-module/validation.md @@ -13,15 +13,15 @@ This document provides the validation criteria used in step-11-validate.md to en - [ ] data/ - Module data - [ ] \_module-installer/ - Installation config - [ ] README.md - Module documentation +- [ ] module.yaml - module config file -### Required Files in \_module-installer/ +### Optional File in \_module-installer/ -- [ ] install-config.yaml - Installation configuration - [ ] installer.js - Custom logic (if needed) ## Configuration Validation -### install-config.yaml +### module.yaml - [ ] Valid YAML syntax - [ ] Module code matches folder name diff --git a/src/modules/bmb/workflows/create-workflow/steps/step-01-init.md b/src/modules/bmb/workflows/create-workflow/steps/step-01-init.md index 901207f3..796d2eb6 100644 --- a/src/modules/bmb/workflows/create-workflow/steps/step-01-init.md +++ b/src/modules/bmb/workflows/create-workflow/steps/step-01-init.md @@ -98,7 +98,7 @@ After getting the workflow name: Based on the module selection, confirm the target location: - For bmb module: `{custom_workflow_location}` (defaults to `{bmad_folder}/custom/src/workflows`) -- For other modules: Check their install-config.yaml for custom workflow locations +- For other modules: Check their module.yaml for custom workflow locations - Confirm the exact folder path where the workflow will be created - Store the confirmed path as `{targetWorkflowPath}` diff --git a/src/modules/bmb/workflows/create-workflow/steps/step-07-build.md b/src/modules/bmb/workflows/create-workflow/steps/step-07-build.md index a62c8969..9a505b0d 100644 --- a/src/modules/bmb/workflows/create-workflow/steps/step-07-build.md +++ b/src/modules/bmb/workflows/create-workflow/steps/step-07-build.md @@ -109,7 +109,7 @@ Create the workflow folder structure in the target location: ``` For bmb module, this will be: `{bmad_folder}/custom/src/workflows/{workflow_name}/` -For other modules, check their install-config.yaml for custom_workflow_location +For other modules, check their module.yaml for custom_workflow_location ### 3. Generate workflow.md diff --git a/src/modules/bmgd/README.md b/src/modules/bmgd/README.md index 8116b54e..f007cf01 100644 --- a/src/modules/bmgd/README.md +++ b/src/modules/bmgd/README.md @@ -129,8 +129,9 @@ bmgd/ │ (Uses BMM workflows via cross-module references) ├── templates/ ├── data/ +├── module.yaml └── _module-installer/ - └── install-config.yaml + └── installer.js (optional) ``` ## Configuration diff --git a/src/modules/bmgd/_module-installer/install-config.yaml b/src/modules/bmgd/module.yaml similarity index 100% rename from src/modules/bmgd/_module-installer/install-config.yaml rename to src/modules/bmgd/module.yaml diff --git a/src/modules/bmm/_module-installer/installer.js b/src/modules/bmm/_module-installer/installer.js index 79b360a1..d5ddf930 100644 --- a/src/modules/bmm/_module-installer/installer.js +++ b/src/modules/bmm/_module-installer/installer.js @@ -9,7 +9,7 @@ const platformCodes = require(path.join(__dirname, '../../../../tools/cli/lib/pl * * @param {Object} options - Installation options * @param {string} options.projectRoot - The root directory of the target project - * @param {Object} options.config - Module configuration from install-config.yaml + * @param {Object} options.config - Module configuration from module.yaml * @param {Array} options.installedIDEs - Array of IDE codes that were installed * @param {Object} options.logger - Logger instance for output * @returns {Promise} - Success status diff --git a/src/modules/bmm/_module-installer/platform-specifics/claude-code.js b/src/modules/bmm/_module-installer/platform-specifics/claude-code.js index 8fee8579..ab96fad0 100644 --- a/src/modules/bmm/_module-installer/platform-specifics/claude-code.js +++ b/src/modules/bmm/_module-installer/platform-specifics/claude-code.js @@ -5,7 +5,7 @@ const chalk = require('chalk'); * * @param {Object} options - Installation options * @param {string} options.projectRoot - The root directory of the target project - * @param {Object} options.config - Module configuration from install-config.yaml + * @param {Object} options.config - Module configuration from module.yaml * @param {Object} options.logger - Logger instance for output * @param {Object} options.platformInfo - Platform metadata from global config * @returns {Promise} - Success status diff --git a/src/modules/bmm/_module-installer/platform-specifics/windsurf.js b/src/modules/bmm/_module-installer/platform-specifics/windsurf.js index 13c65d10..d1c6f012 100644 --- a/src/modules/bmm/_module-installer/platform-specifics/windsurf.js +++ b/src/modules/bmm/_module-installer/platform-specifics/windsurf.js @@ -5,7 +5,7 @@ const chalk = require('chalk'); * * @param {Object} options - Installation options * @param {string} options.projectRoot - The root directory of the target project - * @param {Object} options.config - Module configuration from install-config.yaml + * @param {Object} options.config - Module configuration from module.yaml * @param {Object} options.logger - Logger instance for output * @returns {Promise} - Success status */ diff --git a/src/modules/bmm/_module-installer/install-config.yaml b/src/modules/bmm/module.yaml similarity index 100% rename from src/modules/bmm/_module-installer/install-config.yaml rename to src/modules/bmm/module.yaml diff --git a/src/modules/cis/_module-installer/installer.js b/src/modules/cis/_module-installer/installer.js index 5178259f..dec5f372 100644 --- a/src/modules/cis/_module-installer/installer.js +++ b/src/modules/cis/_module-installer/installer.js @@ -8,7 +8,7 @@ const chalk = require('chalk'); * * @param {Object} options - Installation options * @param {string} options.projectRoot - The root directory of the target project - * @param {Object} options.config - Module configuration from install-config.yaml + * @param {Object} options.config - Module configuration from module.yaml * @param {Array} options.installedIDEs - Array of IDE codes that were installed * @param {Object} options.logger - Logger instance for output * @returns {Promise} - Success status diff --git a/src/modules/cis/_module-installer/install-config.yaml b/src/modules/cis/module.yaml similarity index 100% rename from src/modules/cis/_module-installer/install-config.yaml rename to src/modules/cis/module.yaml diff --git a/tools/cli/README.md b/tools/cli/README.md index c2dc6d1f..0c8bf4bd 100644 --- a/tools/cli/README.md +++ b/tools/cli/README.md @@ -98,7 +98,7 @@ The installer is a multi-stage system that handles agent compilation, IDE integr ``` 1. Collect User Input - Target directory, modules, IDEs - - Custom module configuration (via install-config.yaml) + - Custom module configuration (via module.yaml) 2. Pre-Installation - Validate target, check conflicts, backup existing installations @@ -183,12 +183,12 @@ The installer supports **15 IDE environments** through a base-derived architectu ### Custom Module Configuration -Modules define interactive configuration menus via `install-config.yaml` files in their `_module-installer/` directories. +Modules define interactive configuration menus via `module.yaml` files in their `_module-installer/` directories. **Config File Location**: -- Core: `src/core/_module-installer/install-config.yaml` -- Modules: `src/modules/{module}/_module-installer/install-config.yaml` +- Core: `src/core/module.yaml` +- Modules: `src/modules/{module}/module.yaml` **Configuration Types**: diff --git a/tools/cli/installers/lib/core/config-collector.js b/tools/cli/installers/lib/core/config-collector.js index 8335d8ee..743c1954 100644 --- a/tools/cli/installers/lib/core/config-collector.js +++ b/tools/cli/installers/lib/core/config-collector.js @@ -183,24 +183,28 @@ class ConfigCollector { // Load module's install config schema // First, try the standard src/modules location - let installerConfigPath = path.join(getModulePath(moduleName), '_module-installer', 'install-config.yaml'); + let installerConfigPath = path.join(getModulePath(moduleName), '_module-installer', 'module.yaml'); + let moduleConfigPath = path.join(getModulePath(moduleName), 'module.yaml'); // If not found in src/modules, we need to find it by searching the project - if (!(await fs.pathExists(installerConfigPath))) { + if (!(await fs.pathExists(installerConfigPath)) && !(await fs.pathExists(moduleConfigPath))) { // Use the module manager to find the module source const { ModuleManager } = require('../modules/manager'); const moduleManager = new ModuleManager(); const moduleSourcePath = await moduleManager.findModuleSource(moduleName); if (moduleSourcePath) { - installerConfigPath = path.join(moduleSourcePath, '_module-installer', 'install-config.yaml'); + installerConfigPath = path.join(moduleSourcePath, '_module-installer', 'module.yaml'); + moduleConfigPath = path.join(moduleSourcePath, 'module.yaml'); } } let configPath = null; let isCustomModule = false; - if (await fs.pathExists(installerConfigPath)) { + if (await fs.pathExists(moduleConfigPath)) { + configPath = moduleConfigPath; + } else if (await fs.pathExists(installerConfigPath)) { configPath = installerConfigPath; } else { // Check if this is a custom module with custom.yaml @@ -448,22 +452,26 @@ class ConfigCollector { } // Load module's config // First, try the standard src/modules location - let installerConfigPath = path.join(getModulePath(moduleName), '_module-installer', 'install-config.yaml'); + let installerConfigPath = path.join(getModulePath(moduleName), '_module-installer', 'module.yaml'); + let moduleConfigPath = path.join(getModulePath(moduleName), 'module.yaml'); // If not found in src/modules, we need to find it by searching the project - if (!(await fs.pathExists(installerConfigPath))) { + if (!(await fs.pathExists(installerConfigPath)) && !(await fs.pathExists(moduleConfigPath))) { // Use the module manager to find the module source const { ModuleManager } = require('../modules/manager'); const moduleManager = new ModuleManager(); const moduleSourcePath = await moduleManager.findModuleSource(moduleName); if (moduleSourcePath) { - installerConfigPath = path.join(moduleSourcePath, '_module-installer', 'install-config.yaml'); + installerConfigPath = path.join(moduleSourcePath, '_module-installer', 'module.yaml'); + moduleConfigPath = path.join(moduleSourcePath, 'module.yaml'); } } let configPath = null; - if (await fs.pathExists(installerConfigPath)) { + if (await fs.pathExists(moduleConfigPath)) { + configPath = moduleConfigPath; + } else if (await fs.pathExists(installerConfigPath)) { configPath = installerConfigPath; } else { // No config for this module diff --git a/tools/cli/installers/lib/core/installer.js b/tools/cli/installers/lib/core/installer.js index 9390042e..48110f34 100644 --- a/tools/cli/installers/lib/core/installer.js +++ b/tools/cli/installers/lib/core/installer.js @@ -753,10 +753,39 @@ If AgentVibes party mode is enabled, immediately trigger TTS with agent's voice: // Resolve dependencies for selected modules spinner.text = 'Resolving dependencies...'; const projectRoot = getProjectRoot(); - const modulesToInstall = config.installCore ? ['core', ...config.modules] : config.modules; + + // Add custom content modules to the modules list for installation + let allModules = [...(config.modules || [])]; + if (config.customContent && config.customContent.selected && config.customContent.selectedFiles) { + // Add custom modules to the installation list + for (const customFile of config.customContent.selectedFiles) { + const { CustomHandler } = require('../custom/handler'); + const customHandler = new CustomHandler(); + const customInfo = await customHandler.getCustomInfo(customFile, projectDir); + if (customInfo && customInfo.id) { + allModules.push(customInfo.id); + } + } + } + + const modulesToInstall = config.installCore ? ['core', ...allModules] : allModules; // For dependency resolution, we need to pass the project root - const resolution = await this.dependencyResolver.resolve(projectRoot, config.modules || [], { verbose: config.verbose }); + // Create a temporary module manager that knows about custom content locations + const tempModuleManager = new ModuleManager({ + scanProjectForModules: true, + }); + + // Make sure custom modules are discoverable + if (config.customContent && config.customContent.selected && config.customContent.selectedFiles) { + // The dependency resolver needs to know about these modules + // We'll handle custom modules separately in the installation loop + } + + const resolution = await this.dependencyResolver.resolve(projectRoot, allModules, { + verbose: config.verbose, + moduleManager: tempModuleManager, + }); if (config.verbose) { spinner.succeed('Dependencies resolved'); @@ -772,16 +801,90 @@ If AgentVibes party mode is enabled, immediately trigger TTS with agent's voice: } // Install modules with their dependencies - if (config.modules && config.modules.length > 0) { - for (const moduleName of config.modules) { + if (allModules && allModules.length > 0) { + const installedModuleNames = new Set(); + + for (const moduleName of allModules) { + // Skip if already installed + if (installedModuleNames.has(moduleName)) { + continue; + } + installedModuleNames.add(moduleName); + spinner.start(`Installing module: ${moduleName}...`); - await this.installModuleWithDependencies(moduleName, bmadDir, resolution.byModule[moduleName]); + + // Check if this is a custom module + let isCustomModule = false; + let customInfo = null; + if (config.customContent && config.customContent.selected && config.customContent.selectedFiles) { + const { CustomHandler } = require('../custom/handler'); + const customHandler = new CustomHandler(); + for (const customFile of config.customContent.selectedFiles) { + const info = await customHandler.getCustomInfo(customFile, projectDir); + if (info && info.id === moduleName) { + isCustomModule = true; + customInfo = info; + break; + } + } + } + + if (isCustomModule && customInfo) { + // Install custom module using CustomHandler but as a proper module + const { CustomHandler } = require('../custom/handler'); + const customHandler = new CustomHandler(); + + // Install to module directory instead of custom directory + const moduleTargetPath = path.join(bmadDir, moduleName); + await fs.ensureDir(moduleTargetPath); + + const result = await customHandler.install( + customInfo.path, + path.join(bmadDir, 'temp-custom'), + { ...config.coreConfig, ...customInfo.config, _bmadDir: bmadDir }, + (filePath) => { + // Track installed files with correct path + const relativePath = path.relative(path.join(bmadDir, 'temp-custom'), filePath); + const finalPath = path.join(moduleTargetPath, relativePath); + this.installedFiles.push(finalPath); + }, + ); + + // Move from temp-custom to actual module directory + const tempCustomPath = path.join(bmadDir, 'temp-custom'); + if (await fs.pathExists(tempCustomPath)) { + const customDir = path.join(tempCustomPath, 'custom'); + if (await fs.pathExists(customDir)) { + // Move contents to module directory + const items = await fs.readdir(customDir); + for (const item of items) { + const srcPath = path.join(customDir, item); + const destPath = path.join(moduleTargetPath, item); + + // If destination exists, remove it first (or we could merge) + if (await fs.pathExists(destPath)) { + await fs.remove(destPath); + } + + await fs.move(srcPath, destPath); + } + } + await fs.remove(tempCustomPath); + } + + // Create module config + await this.generateModuleConfigs(bmadDir, { [moduleName]: { ...config.coreConfig, ...customInfo.config } }); + } else { + // Regular module installation + await this.installModuleWithDependencies(moduleName, bmadDir, resolution.byModule[moduleName]); + } + spinner.succeed(`Module installed: ${moduleName}`); } // Install partial modules (only dependencies) for (const [module, files] of Object.entries(resolution.byModule)) { - if (!config.modules.includes(module) && module !== 'core') { + if (!allModules.includes(module) && module !== 'core') { const totalFiles = files.agents.length + files.tasks.length + @@ -799,6 +902,11 @@ If AgentVibes party mode is enabled, immediately trigger TTS with agent's voice: } // Install custom content if provided AND selected + // Process custom content that wasn't installed as modules + // This is now handled in the module installation loop above + // This section is kept for backward compatibility with any custom content + // that doesn't have a module structure + const remainingCustomContent = []; if ( config.customContent && config.customContent.hasCustomContent && @@ -806,12 +914,26 @@ If AgentVibes party mode is enabled, immediately trigger TTS with agent's voice: config.customContent.selected && config.customContent.selectedFiles ) { - spinner.start('Installing custom content...'); + // Filter out custom modules that were already installed + for (const customFile of config.customContent.selectedFiles) { + const { CustomHandler } = require('../custom/handler'); + const customHandler = new CustomHandler(); + const customInfo = await customHandler.getCustomInfo(customFile, projectDir); + + // Skip if this was installed as a module + if (!customInfo || !customInfo.id || !allModules.includes(customInfo.id)) { + remainingCustomContent.push(customFile); + } + } + } + + if (remainingCustomContent.length > 0) { + spinner.start('Installing remaining 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; + // Use the remaining files + const customFiles = remainingCustomContent; if (customFiles.length > 0) { console.log(chalk.cyan(`\n Found ${customFiles.length} custom content file(s):`)); @@ -867,10 +989,10 @@ If AgentVibes party mode is enabled, immediately trigger TTS with agent's voice: spinner.start('Generating workflow and agent manifests...'); const manifestGen = new ManifestGenerator(); - // Include preserved modules (from quick update) in the manifest - const allModulesToList = config._preserveModules ? [...(config.modules || []), ...config._preserveModules] : config.modules || []; + // Include preserved modules (from quick update) and custom modules in the manifest + const allModulesToList = config._preserveModules ? [...allModules, ...config._preserveModules] : allModules || []; - const manifestStats = await manifestGen.generateManifests(bmadDir, config.modules || [], this.installedFiles, { + const manifestStats = await manifestGen.generateManifests(bmadDir, allModulesToList, this.installedFiles, { ides: config.ides || [], preservedModules: config._preserveModules || [], // Scan these from installed bmad/ dir }); diff --git a/tools/cli/installers/lib/custom/handler.js b/tools/cli/installers/lib/custom/handler.js index dddec7e5..3f6f46d0 100644 --- a/tools/cli/installers/lib/custom/handler.js +++ b/tools/cli/installers/lib/custom/handler.js @@ -3,6 +3,7 @@ const fs = require('fs-extra'); const chalk = require('chalk'); const yaml = require('js-yaml'); const { FileOps } = require('../../../lib/file-ops'); +const { XmlHandler } = require('../../../lib/xml-handler'); /** * Handler for custom content (custom.yaml) @@ -11,6 +12,7 @@ const { FileOps } = require('../../../lib/file-ops'); class CustomHandler { constructor() { this.fileOps = new FileOps(); + this.xmlHandler = new XmlHandler(); } /** @@ -52,6 +54,12 @@ class CustomHandler { } else if (entry.name === 'custom.yaml') { // Found a custom.yaml file customPaths.push(fullPath); + } else if ( + entry.name === 'module.yaml' && // Check if this is a custom module (either in _module-installer or in root directory) + // Skip if it's in src/modules (those are standard modules) + !fullPath.includes(path.join('src', 'modules')) + ) { + customPaths.push(fullPath); } } } catch { @@ -66,40 +74,44 @@ class CustomHandler { } /** - * Get custom content info from a custom.yaml file - * @param {string} customYamlPath - Path to custom.yaml file + * Get custom content info from a custom.yaml or module.yaml file + * @param {string} configPath - Path to config file * @param {string} projectRoot - Project root directory for calculating relative paths * @returns {Object|null} Custom content info */ - async getCustomInfo(customYamlPath, projectRoot = null) { + async getCustomInfo(configPath, projectRoot = null) { try { - const configContent = await fs.readFile(customYamlPath, 'utf8'); + const configContent = await fs.readFile(configPath, '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)); + console.warn(chalk.yellow(`Warning: YAML parse error in ${configPath}:`, parseError.message)); return null; } - const customDir = path.dirname(customYamlPath); + // Check if this is an module.yaml (module) or custom.yaml (custom content) + const isInstallConfig = configPath.endsWith('module.yaml'); + const configDir = path.dirname(configPath); + // Use provided projectRoot or fall back to process.cwd() const basePath = projectRoot || process.cwd(); - const relativePath = path.relative(basePath, customDir); + const relativePath = path.relative(basePath, configDir); return { - id: config.code || path.basename(customDir), - name: config.name || `Custom: ${path.basename(customDir)}`, - description: config.description || 'Custom agents and workflows', - path: customDir, + id: config.code || 'unknown-code', + name: config.name, + description: config.description || '', + path: configDir, relativePath: relativePath, defaultSelected: config.default_selected === true, config: config, + isInstallConfig: isInstallConfig, // Track which type this is }; } catch (error) { - console.warn(chalk.yellow(`Warning: Failed to read ${customYamlPath}:`, error.message)); + console.warn(chalk.yellow(`Warning: Failed to read ${configPath}:`, error.message)); return null; } } @@ -131,10 +143,10 @@ class CustomHandler { await fs.ensureDir(bmadAgentsDir); await fs.ensureDir(bmadWorkflowsDir); - // Process agents - copy entire agents directory structure + // Process agents - compile and copy agents const agentsDir = path.join(customPath, 'agents'); if (await fs.pathExists(agentsDir)) { - await this.copyDirectory(agentsDir, bmadAgentsDir, results, fileTrackingCallback, config); + await this.compileAndCopyAgents(agentsDir, bmadAgentsDir, bmadDir, config, fileTrackingCallback, results); // Count agent files const agentFiles = await this.findFilesRecursively(agentsDir, ['.agent.yaml', '.md']); @@ -271,6 +283,114 @@ class CustomHandler { } } } + + /** + * Compile .agent.yaml files to .md format and handle sidecars + * @param {string} sourceAgentsPath - Source agents directory + * @param {string} targetAgentsPath - Target agents directory + * @param {string} bmadDir - BMAD installation directory + * @param {Object} config - Configuration for placeholder replacement + * @param {Function} fileTrackingCallback - Optional callback to track installed files + * @param {Object} results - Results object to update + */ + async compileAndCopyAgents(sourceAgentsPath, targetAgentsPath, bmadDir, config, fileTrackingCallback, results) { + // Get all .agent.yaml files recursively + const agentFiles = await this.findFilesRecursively(sourceAgentsPath, ['.agent.yaml']); + + for (const agentFile of agentFiles) { + const relativePath = path.relative(sourceAgentsPath, agentFile); + const targetDir = path.join(targetAgentsPath, path.dirname(relativePath)); + + await fs.ensureDir(targetDir); + + const agentName = path.basename(agentFile, '.agent.yaml'); + const targetMdPath = path.join(targetDir, `${agentName}.md`); + // Use the actual bmadDir if available (for when installing to temp dir) + const actualBmadDir = config._bmadDir || bmadDir; + const customizePath = path.join(actualBmadDir, '_cfg', 'agents', `custom-${agentName}.customize.yaml`); + + // Read and compile the YAML + try { + const yamlContent = await fs.readFile(agentFile, 'utf8'); + const { compileAgent } = require('../../../lib/agent/compiler'); + + // Create customize template if it doesn't exist + if (!(await fs.pathExists(customizePath))) { + const { getSourcePath } = require('../../../lib/project-root'); + const genericTemplatePath = getSourcePath('utility', 'templates', 'agent.customize.template.yaml'); + if (await fs.pathExists(genericTemplatePath)) { + // Copy with placeholder replacement + let templateContent = await fs.readFile(genericTemplatePath, 'utf8'); + templateContent = templateContent.replaceAll('{bmad_folder}', config.bmad_folder || 'bmad'); + await fs.writeFile(customizePath, templateContent, 'utf8'); + console.log(chalk.dim(` Created customize: custom-${agentName}.customize.yaml`)); + } + } + + // Compile the agent + const { xml } = compileAgent(yamlContent, {}, agentName, relativePath, { config }); + + // Replace placeholders in the compiled content + let processedXml = xml; + processedXml = processedXml.replaceAll('{bmad_folder}', config.bmad_folder || 'bmad'); + processedXml = processedXml.replaceAll('{user_name}', config.user_name || 'User'); + processedXml = processedXml.replaceAll('{communication_language}', config.communication_language || 'English'); + processedXml = processedXml.replaceAll('{output_folder}', config.output_folder || 'docs'); + + // Write the compiled MD file + await fs.writeFile(targetMdPath, processedXml, 'utf8'); + + // Check if agent has sidecar + let hasSidecar = false; + try { + const yamlLib = require('yaml'); + const agentYaml = yamlLib.parse(yamlContent); + hasSidecar = agentYaml?.agent?.metadata?.hasSidecar === true; + } catch { + // Continue without sidecar processing + } + + // Copy sidecar files if agent has hasSidecar flag + if (hasSidecar && config.agent_sidecar_folder) { + const { copyAgentSidecarFiles } = require('../../../lib/agent/installer'); + + // Resolve agent sidecar folder path + const projectDir = path.dirname(bmadDir); + const resolvedSidecarFolder = config.agent_sidecar_folder + .replaceAll('{project-root}', projectDir) + .replaceAll('{bmad_folder}', path.basename(bmadDir)); + + // Create sidecar directory for this agent + const agentSidecarDir = path.join(resolvedSidecarFolder, agentName); + await fs.ensureDir(agentSidecarDir); + + // Copy sidecar files + const sidecarResult = copyAgentSidecarFiles(path.dirname(agentFile), agentSidecarDir, agentFile); + + if (sidecarResult.copied.length > 0) { + console.log(chalk.dim(` Copied ${sidecarResult.copied.length} sidecar file(s) to: ${agentSidecarDir}`)); + } + if (sidecarResult.preserved.length > 0) { + console.log(chalk.dim(` Preserved ${sidecarResult.preserved.length} existing sidecar file(s)`)); + } + } + + // Track the file + if (fileTrackingCallback) { + fileTrackingCallback(targetMdPath); + } + + console.log( + chalk.dim( + ` Compiled agent: ${agentName} -> ${path.relative(targetAgentsPath, targetMdPath)}${hasSidecar ? ' (with sidecar)' : ''}`, + ), + ); + } catch (error) { + console.warn(chalk.yellow(` Failed to compile agent ${agentName}:`, error.message)); + results.errors.push(`Failed to compile agent ${agentName}: ${error.message}`); + } + } + } } module.exports = { CustomHandler }; diff --git a/tools/cli/installers/lib/modules/manager.js b/tools/cli/installers/lib/modules/manager.js index ec657359..9c89813a 100644 --- a/tools/cli/installers/lib/modules/manager.js +++ b/tools/cli/installers/lib/modules/manager.js @@ -107,7 +107,7 @@ class ModuleManager { } /** - * Find all modules in the project by searching for install-config.yaml files + * Find all modules in the project by searching for module.yaml files * @returns {Array} List of module paths */ async findModulesInProject() { @@ -144,12 +144,14 @@ class ModuleManager { continue; } - // Check if this directory contains a module (install-config.yaml OR custom.yaml) - const installerConfigPath = path.join(fullPath, '_module-installer', 'install-config.yaml'); + // Check if this directory contains a module (module.yaml OR custom.yaml) + const moduleConfigPath = path.join(fullPath, 'module.yaml'); + const installerConfigPath = path.join(fullPath, '_module-installer', 'module.yaml'); const customConfigPath = path.join(fullPath, '_module-installer', 'custom.yaml'); const rootCustomConfigPath = path.join(fullPath, 'custom.yaml'); if ( + (await fs.pathExists(moduleConfigPath)) || (await fs.pathExists(installerConfigPath)) || (await fs.pathExists(customConfigPath)) || (await fs.pathExists(rootCustomConfigPath)) @@ -189,12 +191,17 @@ class ModuleManager { for (const entry of entries) { if (entry.isDirectory()) { const modulePath = path.join(this.modulesSourcePath, entry.name); - // Check for module structure (install-config.yaml OR custom.yaml) - const installerConfigPath = path.join(modulePath, '_module-installer', 'install-config.yaml'); + // Check for module structure (module.yaml OR custom.yaml) + const moduleConfigPath = path.join(modulePath, 'module.yaml'); + const installerConfigPath = path.join(modulePath, '_module-installer', 'module.yaml'); const customConfigPath = path.join(modulePath, '_module-installer', 'custom.yaml'); // Skip if this doesn't look like a module - if (!(await fs.pathExists(installerConfigPath)) && !(await fs.pathExists(customConfigPath))) { + if ( + !(await fs.pathExists(moduleConfigPath)) && + !(await fs.pathExists(installerConfigPath)) && + !(await fs.pathExists(customConfigPath)) + ) { continue; } @@ -246,13 +253,16 @@ class ModuleManager { * @returns {Object|null} Module info or null if not a valid module */ async getModuleInfo(modulePath, defaultName, sourceDescription) { - // Check for module structure (install-config.yaml OR custom.yaml) - const installerConfigPath = path.join(modulePath, '_module-installer', 'install-config.yaml'); + // Check for module structure (module.yaml OR custom.yaml) + const moduleConfigPath = path.join(modulePath, 'module.yaml'); + const installerConfigPath = path.join(modulePath, '_module-installer', 'module.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)) { + if (await fs.pathExists(moduleConfigPath)) { + configPath = moduleConfigPath; + } else if (await fs.pathExists(installerConfigPath)) { configPath = installerConfigPath; } else if (await fs.pathExists(customConfigPath)) { configPath = customConfigPath; @@ -313,10 +323,11 @@ class ModuleManager { // First, check src/modules const srcModulePath = path.join(this.modulesSourcePath, moduleName); if (await fs.pathExists(srcModulePath)) { - // Check if this looks like a module (has install-config.yaml) - const installerConfigPath = path.join(srcModulePath, '_module-installer', 'install-config.yaml'); + // Check if this looks like a module (has module.yaml) + const moduleConfigPath = path.join(srcModulePath, 'module.yaml'); + const installerConfigPath = path.join(srcModulePath, '_module-installer', 'module.yaml'); - if (await fs.pathExists(installerConfigPath)) { + if ((await fs.pathExists(moduleConfigPath)) || (await fs.pathExists(installerConfigPath))) { return srcModulePath; } @@ -338,12 +349,15 @@ class ModuleManager { // Also check by module ID (not just folder name) // Need to read configs to match by ID for (const modulePath of allModulePaths) { - const installerConfigPath = path.join(modulePath, '_module-installer', 'install-config.yaml'); + const moduleConfigPath = path.join(modulePath, 'module.yaml'); + const installerConfigPath = path.join(modulePath, '_module-installer', 'module.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)) { + if (await fs.pathExists(moduleConfigPath)) { + configPath = moduleConfigPath; + } else if (await fs.pathExists(installerConfigPath)) { configPath = installerConfigPath; } else if (await fs.pathExists(customConfigPath)) { configPath = customConfigPath; @@ -584,7 +598,7 @@ class ModuleManager { } // Skip _module-installer directory - it's only needed at install time - if (file.startsWith('_module-installer/')) { + if (file.startsWith('_module-installer/') || file === 'module.yaml') { continue; } diff --git a/tools/cli/lib/cli-utils.js b/tools/cli/lib/cli-utils.js index 57489970..313d49a2 100644 --- a/tools/cli/lib/cli-utils.js +++ b/tools/cli/lib/cli-utils.js @@ -84,8 +84,8 @@ const CLIUtils = { /** * Display module configuration header * @param {string} moduleName - Module name (fallback if no custom header) - * @param {string} header - Custom header from install-config.yaml - * @param {string} subheader - Custom subheader from install-config.yaml + * @param {string} header - Custom header from module.yaml + * @param {string} subheader - Custom subheader from module.yaml */ displayModuleConfigHeader(moduleName, header = null, subheader = null) { // Simple blue banner with custom header/subheader if provided @@ -100,8 +100,8 @@ const CLIUtils = { /** * Display module with no custom configuration * @param {string} moduleName - Module name (fallback if no custom header) - * @param {string} header - Custom header from install-config.yaml - * @param {string} subheader - Custom subheader from install-config.yaml + * @param {string} header - Custom header from module.yaml + * @param {string} subheader - Custom subheader from module.yaml */ displayModuleNoConfig(moduleName, header = null, subheader = null) { // Show full banner with header/subheader, just like modules with config diff --git a/tools/cli/lib/ui.js b/tools/cli/lib/ui.js index 2ce6f437..2de47d59 100644 --- a/tools/cli/lib/ui.js +++ b/tools/cli/lib/ui.js @@ -142,8 +142,19 @@ class UI { 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__')); + // Convert custom content to module IDs for installation + const customContentModuleIds = []; + const { CustomHandler } = require('../installers/lib/custom/handler'); + const customHandler = new CustomHandler(); + for (const customFile of customContentConfig.selectedFiles) { + // Get the module info to extract the ID + const customInfo = await customHandler.getCustomInfo(customFile); + if (customInfo) { + customContentModuleIds.push(customInfo.id); + } + } + // Filter out custom content markers and add module IDs + selectedModules = [...selectedModules.filter((mod) => !mod.startsWith('__CUSTOM_CONTENT__')), ...customContentModuleIds]; } else if (customContentConfig.hasCustomContent) { // User provided custom content but didn't select any customContentConfig.selected = false; @@ -669,7 +680,7 @@ class UI { */ async promptCustomContentLocation() { try { - CLIUtils.displaySection('Custom Content', 'Optional: Add custom agents and workflows'); + CLIUtils.displaySection('Custom Content', 'Optional: Add custom agents, workflows, and modules'); const { hasCustomContent } = await inquirer.prompt([ { @@ -703,7 +714,7 @@ class UI { { type: 'input', name: 'directory', - message: 'Enter the path to your custom content directory:', + message: 'Enter directory to search for custom content (will scan subfolders):', default: process.cwd(), // Use actual current working directory validate: async (input) => { if (!input || input.trim() === '') { @@ -736,7 +747,7 @@ class UI { const customFiles = await customHandler.findCustomContent(expandedPath); if (customFiles.length === 0) { - console.log(chalk.yellow(`\nNo custom.yaml files found in ${expandedPath}`)); + console.log(chalk.yellow(`\nNo custom content found in ${expandedPath}`)); const { tryAgain } = await inquirer.prompt([ { @@ -755,7 +766,12 @@ class UI { } customPath = expandedPath; - console.log(chalk.green(`\n✓ Found ${customFiles.length} custom content file(s)`)); + console.log(chalk.green(`\n✓ Found ${customFiles.length} custom content item(s):`)); + for (const file of customFiles) { + const relativePath = path.relative(expandedPath, path.dirname(file)); + const folderName = path.dirname(file).split(path.sep).pop(); + console.log(chalk.dim(` • ${folderName} ${chalk.gray(`(${relativePath})`)}`)); + } } return { hasCustomContent: true, customPath };