remove hardcoded .bmad folders from demo content

This commit is contained in:
Brian Madison
2025-12-07 21:41:37 -06:00
parent a638f062b9
commit 86f2786dde
23 changed files with 33 additions and 302 deletions

View File

@@ -130,7 +130,7 @@ class Installer {
*/
async copyFileWithPlaceholderReplacement(sourcePath, targetPath, bmadFolderName) {
// List of text file extensions that should have placeholder replacement
const textExtensions = ['.md', '.yaml', '.yml', '.txt', '.json', '.js', '.ts', '.html', '.css', '.sh', '.bat', '.csv'];
const textExtensions = ['.md', '.yaml', '.yml', '.txt', '.json', '.js', '.ts', '.html', '.css', '.sh', '.bat', '.csv', '.xml'];
const ext = path.extname(sourcePath).toLowerCase();
// Check if this is a text file that might contain placeholders
@@ -1864,6 +1864,9 @@ If AgentVibes party mode is enabled, immediately trigger TTS with agent's voice:
// DO NOT replace {project-root} - LLMs understand this placeholder at runtime
// const processedContent = xmlContent.replaceAll('{project-root}', projectDir);
// Replace {bmad_folder} with actual folder name
xmlContent = xmlContent.replaceAll('{bmad_folder}', this.bmadFolderName || 'bmad');
// Replace {agent_sidecar_folder} if configured
const coreConfig = this.configCollector.collectedConfig.core || {};
if (coreConfig.agent_sidecar_folder && xmlContent.includes('{agent_sidecar_folder}')) {

View File

@@ -445,17 +445,9 @@ function compileAgent(yamlContent, answers = {}, agentName = '', targetPath = ''
// Parse YAML
const agentYaml = yaml.parse(yamlContent);
// Inject custom agent name into metadata.name if provided
// This is the user's chosen persona name (e.g., "Fred" instead of "Inkwell Von Comitizen")
if (agentName && agentYaml.agent && agentYaml.agent.metadata) {
// Convert kebab-case to title case for the name field
// e.g., "fred-commit-poet" → "Fred Commit Poet"
const titleCaseName = agentName
.split('-')
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
.join(' ');
agentYaml.agent.metadata.name = titleCaseName;
}
// Note: agentName parameter is for UI display only, not for modifying the YAML
// The persona name (metadata.name) should always come from the YAML file
// We should NEVER modify metadata.name as it's part of the agent's identity
// Extract install_config
const installConfig = extractInstallConfig(agentYaml);

View File

@@ -242,7 +242,8 @@ function installAgent(agentInfo, answers, targetPath, options = {}) {
const { xml, metadata, processedYaml } = compileAgent(fs.readFileSync(agentInfo.yamlFile, 'utf8'), answers);
// Determine target agent folder name
const agentFolderName = metadata.name ? metadata.name.toLowerCase().replaceAll(/\s+/g, '-') : agentInfo.name;
// Use the folder name from agentInfo, NOT the persona name from metadata
const agentFolderName = agentInfo.name;
const agentTargetDir = path.join(targetPath, agentFolderName);