diff --git a/src/core/module.yaml b/src/core/module.yaml new file mode 100644 index 00000000..b05b1992 --- /dev/null +++ b/src/core/module.yaml @@ -0,0 +1,25 @@ +code: core +name: "BMad™ Core Module" + +header: "BMad™ Core Configuration" +subheader: "Configure the core settings for your BMad™ installation.\nThese settings will be used across all modules and agents." + +user_name: + prompt: "What shall the agents call you (TIP: Use a team name if using with a group)?" + default: "BMad" + result: "{value}" + +communication_language: + prompt: "Preferred chat language/style? (English, Mandarin, English Pirate, etc...)" + default: "English" + result: "{value}" + +document_output_language: + prompt: "Preferred document output language?" + default: "English" + result: "{value}" + +output_folder: + prompt: "Where should default output files be saved unless specified in other modules?" + default: "_bmad-output" + result: "{project-root}/{value}" diff --git a/tools/cli/installers/lib/core/config-collector.js b/tools/cli/installers/lib/core/config-collector.js index ee486955..f8b2042a 100644 --- a/tools/cli/installers/lib/core/config-collector.js +++ b/tools/cli/installers/lib/core/config-collector.js @@ -696,10 +696,6 @@ class ConfigCollector { for (const mod of Object.keys(this.collectedConfig)) { if (mod !== '_meta' && this.collectedConfig[mod] && this.collectedConfig[mod][configKey]) { configValue = this.collectedConfig[mod][configKey]; - // Extract just the value part if it's a result template - if (typeof configValue === 'string' && configValue.includes('{project-root}/')) { - configValue = configValue.replace('{project-root}/', ''); - } break; } } @@ -813,10 +809,6 @@ class ConfigCollector { for (const mod of Object.keys(this.collectedConfig)) { if (mod !== '_meta' && this.collectedConfig[mod] && this.collectedConfig[mod][configKey]) { configValue = this.collectedConfig[mod][configKey]; - // Remove {project-root}/ prefix if present for cleaner display - if (typeof configValue === 'string' && configValue.includes('{project-root}/')) { - configValue = configValue.replace('{project-root}/', ''); - } break; } } diff --git a/tools/cli/installers/lib/core/installer.js b/tools/cli/installers/lib/core/installer.js index 2780679b..02ab01f7 100644 --- a/tools/cli/installers/lib/core/installer.js +++ b/tools/cli/installers/lib/core/installer.js @@ -505,6 +505,25 @@ class Installer { config._customFiles = customFiles; config._modifiedFiles = modifiedFiles; + // Preserve existing core configuration during updates + // Read the current core config.yaml to maintain user's settings + const coreConfigPath = path.join(bmadDir, 'core', 'config.yaml'); + if ((await fs.pathExists(coreConfigPath)) && (!config.coreConfig || Object.keys(config.coreConfig).length === 0)) { + try { + const yaml = require('yaml'); + const coreConfigContent = await fs.readFile(coreConfigPath, 'utf8'); + const existingCoreConfig = yaml.parse(coreConfigContent); + + // Store in config.coreConfig so it's preserved through the installation + config.coreConfig = existingCoreConfig; + + // Also store in configCollector for use during config collection + this.configCollector.collectedConfig.core = existingCoreConfig; + } catch (error) { + console.warn(chalk.yellow(`Warning: Could not read existing core config: ${error.message}`)); + } + } + // Also check cache directory for custom modules (like quick update does) const cacheDir = path.join(bmadDir, '_config', 'custom'); if (await fs.pathExists(cacheDir)) {