mirror of
https://github.com/bmadcode/BMAD-METHOD.git
synced 2025-12-29 16:14:59 +00:00
claude and a few other ide tools installation fix to not add a readme file slash comand regression, and cleanup bmad folders in tools on install
This commit is contained in:
@@ -83,6 +83,9 @@ class AuggieSetup extends BaseIdeSetup {
|
||||
return { success: false, reason: 'no-locations' };
|
||||
}
|
||||
|
||||
// Clean up old BMAD installation first
|
||||
await this.cleanup(projectDir);
|
||||
|
||||
// Get agents, tasks, tools, and workflows (standalone only)
|
||||
const agents = await this.getAgents(bmadDir);
|
||||
const tasks = await this.getTasks(bmadDir, true);
|
||||
@@ -305,31 +308,17 @@ BMAD ${workflow.module.toUpperCase()} module
|
||||
async cleanup(projectDir) {
|
||||
const fs = require('fs-extra');
|
||||
|
||||
// Check common locations
|
||||
// Check common locations - bmad folder structure
|
||||
const locations = [path.join(os.homedir(), '.augment', 'commands'), path.join(projectDir, '.augment', 'commands')];
|
||||
|
||||
for (const location of locations) {
|
||||
const agentsDir = path.join(location, 'agents');
|
||||
const tasksDir = path.join(location, 'tasks');
|
||||
const toolsDir = path.join(location, 'tools');
|
||||
const workflowsDir = path.join(location, 'workflows');
|
||||
const bmadDir = path.join(location, 'bmad');
|
||||
|
||||
const dirs = [agentsDir, tasksDir, toolsDir, workflowsDir];
|
||||
|
||||
for (const dir of dirs) {
|
||||
if (await fs.pathExists(dir)) {
|
||||
// Remove only BMAD files (those with module prefix)
|
||||
const files = await fs.readdir(dir);
|
||||
for (const file of files) {
|
||||
if (file.includes('-') && file.endsWith('.md')) {
|
||||
await fs.remove(path.join(dir, file));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (await fs.pathExists(bmadDir)) {
|
||||
await fs.remove(bmadDir);
|
||||
console.log(chalk.dim(` Removed old BMAD commands from ${location}`));
|
||||
}
|
||||
}
|
||||
|
||||
console.log(chalk.dim('Cleaned up Auggie CLI configurations'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -81,6 +81,20 @@ class ClaudeCodeSetup extends BaseIdeSetup {
|
||||
return config;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cleanup old BMAD installation before reinstalling
|
||||
* @param {string} projectDir - Project directory
|
||||
*/
|
||||
async cleanup(projectDir) {
|
||||
const fs = require('fs-extra');
|
||||
const bmadCommandsDir = path.join(projectDir, this.configDir, this.commandsDir, 'bmad');
|
||||
|
||||
if (await fs.pathExists(bmadCommandsDir)) {
|
||||
await fs.remove(bmadCommandsDir);
|
||||
console.log(chalk.dim(` Removed old BMAD commands from ${this.name}`));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup Claude Code IDE configuration
|
||||
* @param {string} projectDir - Project directory
|
||||
@@ -93,6 +107,9 @@ class ClaudeCodeSetup extends BaseIdeSetup {
|
||||
|
||||
console.log(chalk.cyan(`Setting up ${this.name}...`));
|
||||
|
||||
// Clean up old BMAD installation first
|
||||
await this.cleanup(projectDir);
|
||||
|
||||
// Create .claude/commands directory structure
|
||||
const claudeDir = path.join(projectDir, this.configDir);
|
||||
const commandsDir = path.join(claudeDir, this.commandsDir);
|
||||
@@ -145,7 +162,20 @@ class ClaudeCodeSetup extends BaseIdeSetup {
|
||||
|
||||
// Generate workflow commands from manifest (if it exists)
|
||||
const workflowGen = new WorkflowCommandGenerator();
|
||||
const workflowResult = await workflowGen.generateWorkflowCommands(projectDir, bmadDir);
|
||||
const { artifacts: workflowArtifacts } = await workflowGen.collectWorkflowArtifacts(bmadDir);
|
||||
|
||||
// Write only workflow-command artifacts, skip workflow-launcher READMEs
|
||||
let workflowCommandCount = 0;
|
||||
for (const artifact of workflowArtifacts) {
|
||||
if (artifact.type === 'workflow-command') {
|
||||
const moduleWorkflowsDir = path.join(bmadCommandsDir, artifact.module, 'workflows');
|
||||
await this.ensureDir(moduleWorkflowsDir);
|
||||
const commandPath = path.join(moduleWorkflowsDir, path.basename(artifact.relativePath));
|
||||
await this.writeFile(commandPath, artifact.content);
|
||||
workflowCommandCount++;
|
||||
}
|
||||
// Skip workflow-launcher READMEs as they would be treated as slash commands
|
||||
}
|
||||
|
||||
// Generate task and tool commands from manifests (if they exist)
|
||||
const taskToolGen = new TaskToolCommandGenerator();
|
||||
@@ -153,8 +183,8 @@ class ClaudeCodeSetup extends BaseIdeSetup {
|
||||
|
||||
console.log(chalk.green(`✓ ${this.name} configured:`));
|
||||
console.log(chalk.dim(` - ${agentCount} agents installed`));
|
||||
if (workflowResult.generated > 0) {
|
||||
console.log(chalk.dim(` - ${workflowResult.generated} workflow commands generated`));
|
||||
if (workflowCommandCount > 0) {
|
||||
console.log(chalk.dim(` - ${workflowCommandCount} workflow commands generated`));
|
||||
}
|
||||
if (taskToolResult.generated > 0) {
|
||||
console.log(
|
||||
|
||||
@@ -12,6 +12,20 @@ class CursorSetup extends BaseIdeSetup {
|
||||
this.rulesDir = 'rules';
|
||||
}
|
||||
|
||||
/**
|
||||
* Cleanup old BMAD installation before reinstalling
|
||||
* @param {string} projectDir - Project directory
|
||||
*/
|
||||
async cleanup(projectDir) {
|
||||
const fs = require('fs-extra');
|
||||
const bmadRulesDir = path.join(projectDir, this.configDir, this.rulesDir, 'bmad');
|
||||
|
||||
if (await fs.pathExists(bmadRulesDir)) {
|
||||
await fs.remove(bmadRulesDir);
|
||||
console.log(chalk.dim(` Removed old BMAD rules from ${this.name}`));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup Cursor IDE configuration
|
||||
* @param {string} projectDir - Project directory
|
||||
@@ -21,6 +35,9 @@ class CursorSetup extends BaseIdeSetup {
|
||||
async setup(projectDir, bmadDir, options = {}) {
|
||||
console.log(chalk.cyan(`Setting up ${this.name}...`));
|
||||
|
||||
// Clean up old BMAD installation first
|
||||
await this.cleanup(projectDir);
|
||||
|
||||
// Create .cursor/rules directory structure
|
||||
const cursorDir = path.join(projectDir, this.configDir);
|
||||
const rulesDir = path.join(cursorDir, this.rulesDir);
|
||||
|
||||
Reference in New Issue
Block a user