Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 3 additions & 22 deletions tools/cli/installers/lib/ide/claude-code.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const {
filterAgentInstructions,
resolveSubagentFiles,
} = require('./shared/module-injections');
const { getAgentsFromBmad, getTasksFromBmad, getAgentsFromDir, getTasksFromDir } = require('./shared/bmad-artifacts');
const { getAgentsFromBmad, getAgentsFromDir } = require('./shared/bmad-artifacts');

/**
* Claude Code IDE setup handler
Expand Down Expand Up @@ -99,19 +99,17 @@ class ClaudeCodeSetup extends BaseIdeSetup {

await this.ensureDir(bmadCommandsDir);

// Get agents and tasks from INSTALLED bmad/ directory
// Get agents from INSTALLED bmad/ directory
// Base installer has already built .md files from .agent.yaml sources
const agents = await getAgentsFromBmad(bmadDir, options.selectedModules || []);
const tasks = await getTasksFromBmad(bmadDir, options.selectedModules || []);

// Create directories for each module (including standalone)
const modules = new Set();
for (const item of [...agents, ...tasks]) modules.add(item.module);
for (const item of agents) modules.add(item.module);

for (const module of modules) {
await this.ensureDir(path.join(bmadCommandsDir, module));
await this.ensureDir(path.join(bmadCommandsDir, module, 'agents'));
await this.ensureDir(path.join(bmadCommandsDir, module, 'tasks'));
}

// Copy agents from bmad/ to .claude/commands/
Expand All @@ -129,21 +127,6 @@ class ClaudeCodeSetup extends BaseIdeSetup {
agentCount++;
}

// Copy tasks from bmad/ to .claude/commands/
let taskCount = 0;
for (const task of tasks) {
const sourcePath = task.path;
const targetPath = path.join(bmadCommandsDir, task.module, 'tasks', `${task.name}.md`);

const content = await this.readAndProcess(sourcePath, {
module: task.module,
name: task.name,
});

await this.writeFile(targetPath, content);
taskCount++;
}

// Process Claude Code specific injections for installed modules
// Use pre-collected configuration if available
if (options.preCollectedConfig) {
Expand All @@ -161,7 +144,6 @@ class ClaudeCodeSetup extends BaseIdeSetup {

console.log(chalk.green(`✓ ${this.name} configured:`));
console.log(chalk.dim(` - ${agentCount} agents installed`));
console.log(chalk.dim(` - ${taskCount} tasks installed`));
if (workflowResult.generated > 0) {
console.log(chalk.dim(` - ${workflowResult.generated} workflow commands generated`));
}
Expand All @@ -170,7 +152,6 @@ class ClaudeCodeSetup extends BaseIdeSetup {
return {
success: true,
agents: agentCount,
tasks: taskCount,
};
}

Expand Down