fix: remove empty tasks directories from Claude Code installer
Previously, the installer created empty tasks/ directories under
.claude/commands/bmad/{module}/ and attempted to copy task files.
Since getTasksFromDir() filters for .md files only and all actual
tasks are .xml files, these directories remained empty.
Tasks are utility files referenced by agents via exec attributes
(e.g., exec="{project-root}/bmad/core/tasks/workflow.xml") and
should remain in the bmad/ directory - they are not slash commands.
Changes:
- Removed tasks directory creation in module setup
- Removed tasks copying logic (15 lines)
- Removed taskCount from console output
- Removed tasks property from return value
- Removed unused getTasksFromBmad and getTasksFromDir imports
- Updated comment to clarify agents-only installation
Verified: No tasks/ directories created in .claude/commands/bmad/
while task files remain accessible in bmad/core/tasks/
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -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
|
||||
@@ -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/
|
||||
@@ -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) {
|
||||
@@ -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`));
|
||||
}
|
||||
@@ -170,7 +152,6 @@ class ClaudeCodeSetup extends BaseIdeSetup {
|
||||
return {
|
||||
success: true,
|
||||
agents: agentCount,
|
||||
tasks: taskCount,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user