workflow builder has template LOD output options

This commit is contained in:
Brian Madison
2025-12-02 22:36:44 -06:00
parent 1e6fc4ba14
commit 0b3964902a
21 changed files with 565 additions and 27 deletions

View File

@@ -141,6 +141,11 @@ class Installer {
content = content.replaceAll('{bmad_folder}', bmadFolderName);
}
// Replace escape sequence {*bmad_folder*} with literal {bmad_folder}
if (content.includes('{*bmad_folder*}')) {
content = content.replaceAll('{*bmad_folder*}', '{bmad_folder}');
}
// Process AgentVibes injection points
content = this.processTTSInjectionPoints(content);

View File

@@ -536,6 +536,11 @@ class BaseIdeSetup {
if (typeof content === 'string' && content.includes('{bmad_folder}')) {
content = content.replaceAll('{bmad_folder}', this.bmadFolderName);
}
// Replace escape sequence {*bmad_folder*} with literal {bmad_folder}
if (typeof content === 'string' && content.includes('{*bmad_folder*}')) {
content = content.replaceAll('{*bmad_folder*}', '{bmad_folder}');
}
await this.ensureDir(path.dirname(filePath));
await fs.writeFile(filePath, content, 'utf8');
}
@@ -563,6 +568,11 @@ class BaseIdeSetup {
content = content.replaceAll('{bmad_folder}', this.bmadFolderName);
}
// Replace escape sequence {*bmad_folder*} with literal {bmad_folder}
if (content.includes('{*bmad_folder*}')) {
content = content.replaceAll('{*bmad_folder*}', '{bmad_folder}');
}
// Write to dest with replaced content
await fs.writeFile(dest, content, 'utf8');
} catch {

View File

@@ -149,6 +149,7 @@ ${contentWithoutFrontmatter}
// Note: {user_name} and other {config_values} are left as-is for runtime substitution by Gemini
const tomlContent = template
.replaceAll('{{title}}', title)
.replaceAll('{{*bmad_folder*}}', '{bmad_folder}')
.replaceAll('{{bmad_folder}}', this.bmadFolderName)
.replaceAll('{{module}}', agent.module)
.replaceAll('{{name}}', agent.name);
@@ -170,6 +171,7 @@ ${contentWithoutFrontmatter}
// Replace template variables
const tomlContent = template
.replaceAll('{{taskName}}', taskName)
.replaceAll('{{*bmad_folder*}}', '{bmad_folder}')
.replaceAll('{{bmad_folder}}', this.bmadFolderName)
.replaceAll('{{module}}', task.module)
.replaceAll('{{filename}}', task.filename);

View File

@@ -60,7 +60,8 @@ class AgentCommandGenerator {
.replaceAll('{{name}}', agent.name)
.replaceAll('{{module}}', agent.module)
.replaceAll('{{description}}', agent.description || `${agent.name} agent`)
.replaceAll('{bmad_folder}', this.bmadFolderName);
.replaceAll('{bmad_folder}', this.bmadFolderName)
.replaceAll('{*bmad_folder*}', '{bmad_folder}');
}
/**

View File

@@ -127,6 +127,7 @@ class WorkflowCommandGenerator {
.replaceAll('{{description}}', workflow.description)
.replaceAll('{{workflow_path}}', workflowPath)
.replaceAll('{bmad_folder}', this.bmadFolderName)
.replaceAll('{*bmad_folder*}', '{bmad_folder}')
.replaceAll('{{interactive}}', workflow.interactive)
.replaceAll('{{author}}', workflow.author || 'BMAD');
}

View File

@@ -53,6 +53,11 @@ class ModuleManager {
// Read the file content
let content = await fs.readFile(sourcePath, 'utf8');
// Replace escape sequence {*bmad_folder*} with literal {bmad_folder}
if (content.includes('{*bmad_folder*}')) {
content = content.replaceAll('{*bmad_folder*}', '{bmad_folder}');
}
// Replace {bmad_folder} placeholder with actual folder name
if (content.includes('{bmad_folder}')) {
content = content.replaceAll('{bmad_folder}', this.bmadFolderName);
@@ -396,8 +401,9 @@ class ModuleManager {
// Read the source YAML file
let yamlContent = await fs.readFile(sourceFile, 'utf8');
// IMPORTANT: Replace {bmad_folder} BEFORE parsing YAML
// IMPORTANT: Replace escape sequence and placeholder BEFORE parsing YAML
// Otherwise parsing will fail on the placeholder
yamlContent = yamlContent.replaceAll('{*bmad_folder*}', '{bmad_folder}');
yamlContent = yamlContent.replaceAll('{bmad_folder}', this.bmadFolderName);
try {