chore(installer): remove dead template and agent-command pipeline

The legacy agent-command-generator, bmad-artifacts helpers, and all 26
IDE template files (combined/ and split/) are unreachable dead code.
The installer now uses verbatim SKILL.md directory copying -- no template
rendering occurs. The files own TODO comments confirm retirement.
This commit is contained in:
Alex Verkhovsky 2026-04-10 06:34:09 -07:00
parent 17da5ca8ca
commit 5f6c7993a3
28 changed files with 0 additions and 661 deletions

View File

@ -1,180 +0,0 @@
const path = require('node:path');
const fs = require('fs-extra');
const { toColonPath, toDashPath, customAgentColonName, customAgentDashName, BMAD_FOLDER_NAME } = require('./path-utils');
/**
* Generates launcher command files for each agent
*/
class AgentCommandGenerator {
constructor(bmadFolderName = BMAD_FOLDER_NAME) {
this.templatePath = path.join(__dirname, '../templates/agent-command-template.md');
this.bmadFolderName = bmadFolderName;
}
/**
* Collect agent artifacts for IDE installation
* @param {string} bmadDir - BMAD installation directory
* @param {Array} selectedModules - Modules to include
* @returns {Object} Artifacts array with metadata
*/
async collectAgentArtifacts(bmadDir, selectedModules = []) {
const { getAgentsFromBmad } = require('./bmad-artifacts');
// Get agents from INSTALLED bmad/ directory
const agents = await getAgentsFromBmad(bmadDir, selectedModules);
const artifacts = [];
for (const agent of agents) {
const launcherContent = await this.generateLauncherContent(agent);
// Use relativePath if available (for nested agents), otherwise just name with .md
const agentPathInModule = agent.relativePath || `${agent.name}.md`;
// Calculate the relative agent path (e.g., bmm/agents/pm.md)
let agentRelPath = agent.path || '';
// Normalize path separators for cross-platform compatibility
agentRelPath = agentRelPath.replaceAll('\\', '/');
// Remove _bmad/ prefix if present to get relative path from project root
// Handle both absolute paths (/path/to/_bmad/...) and relative paths (_bmad/...)
if (agentRelPath.includes('_bmad/')) {
const parts = agentRelPath.split(/_bmad\//);
if (parts.length > 1) {
agentRelPath = parts.slice(1).join('/');
}
}
artifacts.push({
type: 'agent-launcher',
name: agent.name,
description: agent.description || `${agent.name} agent`,
module: agent.module,
canonicalId: agent.canonicalId || '',
relativePath: path.join(agent.module, 'agents', agentPathInModule), // For command filename
agentPath: agentRelPath, // Relative path to actual agent file
content: launcherContent,
sourcePath: agent.path,
});
}
return {
artifacts,
counts: {
agents: agents.length,
},
};
}
/**
* Generate launcher content for an agent
* @param {Object} agent - Agent metadata
* @returns {string} Launcher file content
*/
async generateLauncherContent(agent) {
// Load the template
const template = await fs.readFile(this.templatePath, 'utf8');
// Replace template variables
// Use relativePath if available (for nested agents), otherwise just name with .md
const agentPathInModule = agent.relativePath || `${agent.name}.md`;
return template
.replaceAll('{{name}}', agent.name)
.replaceAll('{{module}}', agent.module)
.replaceAll('{{path}}', agentPathInModule)
.replaceAll('{{description}}', agent.description || `${agent.name} agent`)
.replaceAll('_bmad', this.bmadFolderName)
.replaceAll('_bmad', '_bmad');
}
/**
* Write agent launcher artifacts to IDE commands directory
* @param {string} baseCommandsDir - Base commands directory for the IDE
* @param {Array} artifacts - Agent launcher artifacts
* @returns {number} Count of launchers written
*/
async writeAgentLaunchers(baseCommandsDir, artifacts) {
let writtenCount = 0;
for (const artifact of artifacts) {
if (artifact.type === 'agent-launcher') {
const moduleAgentsDir = path.join(baseCommandsDir, artifact.module, 'agents');
await fs.ensureDir(moduleAgentsDir);
const launcherPath = path.join(moduleAgentsDir, `${artifact.name}.md`);
await fs.writeFile(launcherPath, artifact.content);
writtenCount++;
}
}
return writtenCount;
}
/**
* Write agent launcher artifacts using underscore format (Windows-compatible)
* Creates flat files like: bmad_bmm_pm.md
*
* @param {string} baseCommandsDir - Base commands directory for the IDE
* @param {Array} artifacts - Agent launcher artifacts
* @returns {number} Count of launchers written
*/
async writeColonArtifacts(baseCommandsDir, artifacts) {
let writtenCount = 0;
for (const artifact of artifacts) {
if (artifact.type === 'agent-launcher') {
// Convert relativePath to underscore format: bmm/agents/pm.md → bmad_bmm_pm.md
const flatName = toColonPath(artifact.relativePath);
const launcherPath = path.join(baseCommandsDir, flatName);
await fs.ensureDir(path.dirname(launcherPath));
await fs.writeFile(launcherPath, artifact.content);
writtenCount++;
}
}
return writtenCount;
}
/**
* Write agent launcher artifacts using dash format (NEW STANDARD)
* Creates flat files like: bmad-agent-bmm-pm.md
*
* The bmad-agent- prefix distinguishes agents from workflows/tasks/tools.
*
* @param {string} baseCommandsDir - Base commands directory for the IDE
* @param {Array} artifacts - Agent launcher artifacts
* @returns {number} Count of launchers written
*/
async writeDashArtifacts(baseCommandsDir, artifacts) {
let writtenCount = 0;
for (const artifact of artifacts) {
if (artifact.type === 'agent-launcher') {
// Convert relativePath to dash format: bmm/agents/pm.md → bmad-agent-bmm-pm.md
const flatName = toDashPath(artifact.relativePath);
const launcherPath = path.join(baseCommandsDir, flatName);
await fs.ensureDir(path.dirname(launcherPath));
await fs.writeFile(launcherPath, artifact.content);
writtenCount++;
}
}
return writtenCount;
}
/**
* Get the custom agent name in underscore format (Windows-compatible)
* @param {string} agentName - Custom agent name
* @returns {string} Underscore-formatted filename
*/
getCustomAgentColonName(agentName) {
return customAgentColonName(agentName);
}
/**
* Get the custom agent name in underscore format (Windows-compatible)
* @param {string} agentName - Custom agent name
* @returns {string} Underscore-formatted filename
*/
getCustomAgentDashName(agentName) {
return customAgentDashName(agentName);
}
}
module.exports = { AgentCommandGenerator };

View File

@ -1,208 +0,0 @@
const path = require('node:path');
const fs = require('fs-extra');
const { loadSkillManifest, getCanonicalId } = require('./skill-manifest');
/**
* Helpers for gathering BMAD agents/tasks from the installed tree.
* Shared by installers that need Claude-style exports.
*
* TODO: Dead code cleanup compiled XML agents are retired.
*
* All agents now use the SKILL.md directory format with bmad-skill-manifest.yaml
* (type: agent). The legacy pipeline below only discovers compiled .md files
* containing <agent> XML tags, which no longer exist. The following are dead:
*
* - getAgentsFromBmad() scans {module}/agents/ for .md files with <agent> tags
* - getAgentsFromDir() recursive helper for the above
* - AgentCommandGenerator (agent-command-generator.js) generates launcher .md files
* that tell the LLM to load a compiled agent .md file
* - agent-command-template.md (templates/) the launcher template with hardcoded
* {module}/agents/{{path}} reference
*
* Agent metadata for agent-manifest.csv is now handled entirely by
* ManifestGenerator.getAgentsFromDirRecursive() in manifest-generator.js,
* which walks the full module tree and finds type:agent directories.
*
* IDE installation of agents is handled by the native skill pipeline
* each agent's SKILL.md directory is installed directly to the IDE's
* skills path, so no launcher intermediary is needed.
*
* Cleanup: remove getAgentsFromBmad, getAgentsFromDir, their exports,
* AgentCommandGenerator, agent-command-template.md, and all call sites
* in IDE installers that invoke collectAgentArtifacts / writeAgentLaunchers /
* writeColonArtifacts / writeDashArtifacts.
* getTasksFromBmad and getTasksFromDir may still be live verify before removing.
*/
async function getAgentsFromBmad(bmadDir, selectedModules = []) {
const agents = [];
// Get core agents
if (await fs.pathExists(path.join(bmadDir, 'core', 'agents'))) {
const coreAgents = await getAgentsFromDir(path.join(bmadDir, 'core', 'agents'), 'core');
agents.push(...coreAgents);
}
// Get module agents
for (const moduleName of selectedModules) {
const agentsPath = path.join(bmadDir, moduleName, 'agents');
if (await fs.pathExists(agentsPath)) {
const moduleAgents = await getAgentsFromDir(agentsPath, moduleName);
agents.push(...moduleAgents);
}
}
// Get standalone agents from bmad/agents/ directory
const standaloneAgentsDir = path.join(bmadDir, 'agents');
if (await fs.pathExists(standaloneAgentsDir)) {
const agentDirs = await fs.readdir(standaloneAgentsDir, { withFileTypes: true });
for (const agentDir of agentDirs) {
if (!agentDir.isDirectory()) continue;
const agentDirPath = path.join(standaloneAgentsDir, agentDir.name);
const agentFiles = await fs.readdir(agentDirPath);
const skillManifest = await loadSkillManifest(agentDirPath);
for (const file of agentFiles) {
if (!file.endsWith('.md')) continue;
if (file.includes('.customize.')) continue;
const filePath = path.join(agentDirPath, file);
const content = await fs.readFile(filePath, 'utf8');
if (content.includes('localskip="true"')) continue;
agents.push({
path: filePath,
name: file.replace('.md', ''),
module: 'standalone', // Mark as standalone agent
canonicalId: getCanonicalId(skillManifest, file),
});
}
}
}
return agents;
}
async function getTasksFromBmad(bmadDir, selectedModules = []) {
const tasks = [];
if (await fs.pathExists(path.join(bmadDir, 'core', 'tasks'))) {
const coreTasks = await getTasksFromDir(path.join(bmadDir, 'core', 'tasks'), 'core');
tasks.push(...coreTasks);
}
for (const moduleName of selectedModules) {
const tasksPath = path.join(bmadDir, moduleName, 'tasks');
if (await fs.pathExists(tasksPath)) {
const moduleTasks = await getTasksFromDir(tasksPath, moduleName);
tasks.push(...moduleTasks);
}
}
return tasks;
}
async function getAgentsFromDir(dirPath, moduleName, relativePath = '') {
const agents = [];
if (!(await fs.pathExists(dirPath))) {
return agents;
}
const entries = await fs.readdir(dirPath, { withFileTypes: true });
const skillManifest = await loadSkillManifest(dirPath);
for (const entry of entries) {
// Skip if entry.name is undefined or not a string
if (!entry.name || typeof entry.name !== 'string') {
continue;
}
const fullPath = path.join(dirPath, entry.name);
const newRelativePath = relativePath ? `${relativePath}/${entry.name}` : entry.name;
if (entry.isDirectory()) {
// Recurse into subdirectories
const subDirAgents = await getAgentsFromDir(fullPath, moduleName, newRelativePath);
agents.push(...subDirAgents);
} else if (entry.name.endsWith('.md')) {
// Skip README files and other non-agent files
if (entry.name.toLowerCase() === 'readme.md' || entry.name.toLowerCase().startsWith('readme-')) {
continue;
}
if (entry.name.includes('.customize.')) {
continue;
}
const content = await fs.readFile(fullPath, 'utf8');
if (content.includes('localskip="true"')) {
continue;
}
// Only include files that have agent-specific content (compiled agents have <agent> tag)
if (!content.includes('<agent')) {
continue;
}
agents.push({
path: fullPath,
name: entry.name.replace('.md', ''),
module: moduleName,
relativePath: newRelativePath, // Keep the .md extension for the full path
canonicalId: getCanonicalId(skillManifest, entry.name),
});
}
}
return agents;
}
async function getTasksFromDir(dirPath, moduleName) {
const tasks = [];
if (!(await fs.pathExists(dirPath))) {
return tasks;
}
const files = await fs.readdir(dirPath);
const skillManifest = await loadSkillManifest(dirPath);
for (const file of files) {
// Include both .md and .xml task files
if (!file.endsWith('.md') && !file.endsWith('.xml')) {
continue;
}
const filePath = path.join(dirPath, file);
const content = await fs.readFile(filePath, 'utf8');
// Skip internal/engine files (not user-facing tasks)
if (content.includes('internal="true"')) {
continue;
}
// Remove extension to get task name
const ext = file.endsWith('.xml') ? '.xml' : '.md';
tasks.push({
path: filePath,
name: file.replace(ext, ''),
module: moduleName,
canonicalId: getCanonicalId(skillManifest, file),
});
}
return tasks;
}
module.exports = {
getAgentsFromBmad,
getTasksFromBmad,
getAgentsFromDir,
getTasksFromDir,
};

View File

@ -1,14 +0,0 @@
---
name: '{{name}}'
description: '{{description}}'
---
You must fully embody this agent's persona and follow all activation instructions exactly as specified. NEVER break character until given an exit command.
<agent-activation CRITICAL="TRUE">
1. LOAD the FULL agent file from {project-root}/_bmad/{{module}}/agents/{{path}}
2. READ its entire contents - this contains the complete agent persona, menu, and instructions
3. Execute ALL activation steps exactly as written in the agent file
4. Follow the agent's persona and menu system precisely
5. Stay in character throughout the session
</agent-activation>

View File

@ -1,8 +0,0 @@
---
name: '{{name}}'
description: '{{description}}'
---
Read the entire workflow file at: {project-root}/_bmad/{{workflow_path}}
Follow all instructions in the workflow file exactly as written.

View File

@ -1 +0,0 @@
default-agent.md

View File

@ -1 +0,0 @@
default-workflow.md

View File

@ -1,15 +0,0 @@
---
name: '{{name}}'
description: '{{description}}'
---
You must fully embody this agent's persona and follow all activation instructions exactly as specified. NEVER break character until given an exit command.
<agent-activation CRITICAL="TRUE">
1. LOAD the FULL agent file from {project-root}/_bmad/{{path}}
2. READ its entire contents - this contains the complete agent persona, menu, and instructions
3. FOLLOW every step in the <activation> section precisely
4. DISPLAY the welcome/greeting as instructed
5. PRESENT the numbered menu
6. WAIT for user input before proceeding
</agent-activation>

View File

@ -1,10 +0,0 @@
---
name: '{{name}}'
description: '{{description}}'
---
# {{name}}
Read the entire task file at: {project-root}/{{bmadFolderName}}/{{path}}
Follow all instructions in the task file exactly as written.

View File

@ -1,10 +0,0 @@
---
name: '{{name}}'
description: '{{description}}'
---
# {{name}}
Read the entire tool file at: {project-root}/{{bmadFolderName}}/{{path}}
Follow all instructions in the tool file exactly as written.

View File

@ -1,6 +0,0 @@
---
name: '{{name}}'
description: '{{description}}'
---
IT IS CRITICAL THAT YOU FOLLOW THIS COMMAND: LOAD the FULL {project-root}/{{bmadFolderName}}/{{path}}, READ its entire contents and follow its directions exactly!

View File

@ -1,14 +0,0 @@
description = "Activates the {{name}} agent from the BMad Method."
prompt = """
CRITICAL: You are now the BMad '{{name}}' agent.
PRE-FLIGHT CHECKLIST:
1. [ ] IMMEDIATE ACTION: Load and parse {project-root}/{{bmadFolderName}}/{{module}}/config.yaml - store ALL config values in memory for use throughout the session.
2. [ ] IMMEDIATE ACTION: Read and internalize the full agent definition at {project-root}/{{bmadFolderName}}/{{path}}.
3. [ ] CONFIRM: The user's name from config is {user_name}.
Only after all checks are complete, greet the user by name and display the menu.
Acknowledge this checklist is complete in your first response.
AGENT DEFINITION: {project-root}/{{bmadFolderName}}/{{path}}
"""

View File

@ -1,11 +0,0 @@
description = "Executes the {{name}} task from the BMAD Method."
prompt = """
Execute the BMAD '{{name}}' task.
TASK INSTRUCTIONS:
1. LOAD the task file from {project-root}/{{bmadFolderName}}/{{path}}
2. READ its entire contents
3. FOLLOW every instruction precisely as specified
TASK FILE: {project-root}/{{bmadFolderName}}/{{path}}
"""

View File

@ -1,11 +0,0 @@
description = "Executes the {{name}} tool from the BMAD Method."
prompt = """
Execute the BMAD '{{name}}' tool.
TOOL INSTRUCTIONS:
1. LOAD the tool file from {project-root}/{{bmadFolderName}}/{{path}}
2. READ its entire contents
3. FOLLOW every instruction precisely as specified
TOOL FILE: {project-root}/{{bmadFolderName}}/{{path}}
"""

View File

@ -1,16 +0,0 @@
description = '{{description}}'
prompt = """
Execute the BMAD '{{name}}' workflow.
CRITICAL: This is a structured YAML workflow. Follow these steps precisely:
1. LOAD the workflow definition from {project-root}/{{bmadFolderName}}/{{workflow_path}}
2. PARSE the YAML structure to understand:
- Workflow phases and steps
- Required inputs and outputs
- Dependencies between steps
3. EXECUTE each step in order
4. VALIDATE outputs before proceeding to next step
WORKFLOW FILE: {project-root}/{{bmadFolderName}}/{{workflow_path}}
"""

View File

@ -1,14 +0,0 @@
description = '{{description}}'
prompt = """
Execute the BMAD '{{name}}' workflow.
CRITICAL: You must load and follow the workflow definition exactly.
WORKFLOW INSTRUCTIONS:
1. LOAD the workflow file from {project-root}/{{bmadFolderName}}/{{workflow_path}}
2. READ its entire contents
3. FOLLOW every step precisely as specified
4. DO NOT skip or modify any steps
WORKFLOW FILE: {project-root}/{{bmadFolderName}}/{{workflow_path}}
"""

View File

@ -1,16 +0,0 @@
---
inclusion: manual
---
# {{name}}
You must fully embody this agent's persona and follow all activation instructions exactly as specified. NEVER break character until given an exit command.
<agent-activation CRITICAL="TRUE">
1. LOAD the FULL agent file from #[[file:{{bmadFolderName}}/{{path}}]]
2. READ its entire contents - this contains the complete agent persona, menu, and instructions
3. FOLLOW every step in the <activation> section precisely
4. DISPLAY the welcome/greeting as instructed
5. PRESENT the numbered menu
6. WAIT for user input before proceeding
</agent-activation>

View File

@ -1,9 +0,0 @@
---
inclusion: manual
---
# {{name}}
Read the entire task file at: #[[file:{{bmadFolderName}}/{{path}}]]
Follow all instructions in the task file exactly as written.

View File

@ -1,9 +0,0 @@
---
inclusion: manual
---
# {{name}}
Read the entire tool file at: #[[file:{{bmadFolderName}}/{{path}}]]
Follow all instructions in the tool file exactly as written.

View File

@ -1,7 +0,0 @@
---
inclusion: manual
---
# {{name}}
IT IS CRITICAL THAT YOU FOLLOW THIS COMMAND: LOAD the FULL #[[file:{{bmadFolderName}}/{{path}}]], READ its entire contents and follow its directions exactly!

View File

@ -1,15 +0,0 @@
---
mode: all
description: '{{description}}'
---
You must fully embody this agent's persona and follow all activation instructions exactly as specified. NEVER break character until given an exit command.
<agent-activation CRITICAL="TRUE">
1. LOAD the FULL agent file from {project-root}/{{bmadFolderName}}/{{path}}
2. READ its entire contents - this contains the complete agent persona, menu, and instructions
3. FOLLOW every step in the <activation> section precisely
4. DISPLAY the welcome/greeting as instructed
5. PRESENT the numbered menu
6. WAIT for user input before proceeding
</agent-activation>

View File

@ -1,13 +0,0 @@
---
description: '{{description}}'
---
Execute the BMAD '{{name}}' task.
TASK INSTRUCTIONS:
1. LOAD the task file from {project-root}/{{bmadFolderName}}/{{path}}
2. READ its entire contents
3. FOLLOW every instruction precisely as specified
TASK FILE: {project-root}/{{bmadFolderName}}/{{path}}

View File

@ -1,13 +0,0 @@
---
description: '{{description}}'
---
Execute the BMAD '{{name}}' tool.
TOOL INSTRUCTIONS:
1. LOAD the tool file from {project-root}/{{bmadFolderName}}/{{path}}
2. READ its entire contents
3. FOLLOW every instruction precisely as specified
TOOL FILE: {project-root}/{{bmadFolderName}}/{{path}}

View File

@ -1,16 +0,0 @@
---
description: '{{description}}'
---
Execute the BMAD '{{name}}' workflow.
CRITICAL: You must load and follow the workflow definition exactly.
WORKFLOW INSTRUCTIONS:
1. LOAD the workflow file from {project-root}/{{bmadFolderName}}/{{path}}
2. READ its entire contents
3. FOLLOW every step precisely as specified
4. DO NOT skip or modify any steps
WORKFLOW FILE: {project-root}/{{bmadFolderName}}/{{path}}

View File

@ -1,16 +0,0 @@
---
description: '{{description}}'
---
Execute the BMAD '{{name}}' workflow.
CRITICAL: You must load and follow the workflow definition exactly.
WORKFLOW INSTRUCTIONS:
1. LOAD the workflow file from {project-root}/{{bmadFolderName}}/{{path}}
2. READ its entire contents
3. FOLLOW every step precisely as specified
4. DO NOT skip or modify any steps
WORKFLOW FILE: {project-root}/{{bmadFolderName}}/{{path}}

View File

@ -1,9 +0,0 @@
# {{name}}
{{description}}
---
Read the entire workflow file at: {project-root}/_bmad/{{workflow_path}}
Follow all instructions in the workflow file exactly as written.

View File

@ -1,9 +0,0 @@
# {{name}}
{{description}}
## Instructions
Read the entire workflow file at: {project-root}/_bmad/{{workflow_path}}
Follow all instructions in the workflow file exactly as written.

View File

@ -1,10 +0,0 @@
---
description: '{{description}}'
auto_execution_mode: "iterate"
---
# {{name}}
Read the entire workflow file at {project-root}/_bmad/{{workflow_path}}
Follow all instructions in the workflow file exactly as written.