Skip to content

Commit efbe839

Browse files
Brian MadisonBrian Madison
authored andcommitted
installer cleanup
1 parent 3f9ad48 commit efbe839

21 files changed

+259
-327
lines changed

src/bmm/module-help.csv

Lines changed: 32 additions & 32 deletions
Large diffs are not rendered by default.

src/core/module-help.csv

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
module,phase,name,code,sequence,workflow-file,command,required,agent,options,description,output-location,outputs
2-
core,,Advanced Elicitation,AE,10,_bmad/core/workflows/advanced-elicitation/workflow.xml,bmad:advanced-elicitation,false,,,"Apply elicitation methods iteratively to enhance content being generated, presenting options and allowing reshuffle or full method listing for comprehensive content improvement",,
3-
core,,Brainstorming,BS,20,_bmad/core/workflows/brainstorming/workflow.md,bmad:brainstorming,false,analyst,,Facilitate interactive brainstorming sessions using diverse creative techniques and ideation methods,{output_folder}/brainstorming/brainstorming-session-{{date}}.md,,
4-
core,,Party Mode,PM,30,_bmad/core/workflows/party-mode/workflow.md,bmad:party-mode,false,party-mode facilitator,,Orchestrates group discussions between all installed BMAD agents enabling natural multi-agent conversations,,
5-
core,,bmad-help,BH,40,_bmad/core/tasks/bmad-help.md,bmad:help,false,system,,Get unstuck by showing what workflow steps come next or answering questions about what to do in the BMad Method,,
6-
core,,Index Docs,ID,50,_bmad/core/tasks/index-docs.xml,bmad:index-docs,false,llm,,Generates or updates an index.md of all documents in the specified directory,,
7-
core,,Execute Workflow,WF,60,_bmad/core/tasks/workflow.xml,bmad:workflow,false,llm,,Execute given workflow by loading its configuration following instructions and producing output,,
8-
core,,Shard Document,SD,70,_bmad/core/tasks/shard-doc.xml,bmad:shard-doc,false,llm,,Splits large markdown documents into smaller organized files based on level 2 sections,,
9-
core,,Editorial Review - Prose,EP,80,_bmad/core/tasks/editorial-review-prose.xml,bmad:editorial-review-prose,false,llm,reader_type,Clinical copy-editor that reviews text for communication issues,,"three-column markdown table with suggested fixes",
10-
core,,Editorial Review - Structure,ES,90,_bmad/core/tasks/editorial-review-structure.xml,bmad:editorial-review-structure,false,llm,,Structural editor that proposes cuts reorganization and simplification while preserving comprehension,,
11-
core,,Adversarial Review (General),AR,100,_bmad/core/tasks/review-adversarial-general.xml,bmad:review-adversarial-general,false,llm,,Cynically review content and produce findings,,
2+
core,,Advanced Elicitation,AE,10,_bmad/core/workflows/advanced-elicitation/workflow.xml,bmad_advanced-elicitation,false,,,"Apply elicitation methods iteratively to enhance content being generated, presenting options and allowing reshuffle or full method listing for comprehensive content improvement",,
3+
core,,Brainstorming,BS,20,_bmad/core/workflows/brainstorming/workflow.md,bmad_brainstorming,false,analyst,,Facilitate interactive brainstorming sessions using diverse creative techniques and ideation methods,{output_folder}/brainstorming/brainstorming-session-{{date}}.md,,
4+
core,,Party Mode,PM,30,_bmad/core/workflows/party-mode/workflow.md,bmad_party-mode,false,party-mode facilitator,,Orchestrates group discussions between all installed BMAD agents enabling natural multi-agent conversations,,
5+
core,,bmad-help,BH,40,_bmad/core/tasks/bmad-help.md,bmad_help,false,system,,Get unstuck by showing what workflow steps come next or answering questions about what to do in the BMad Method,,
6+
core,,Index Docs,ID,50,_bmad/core/tasks/index-docs.xml,bmad_index-docs,false,llm,,Generates or updates an index.md of all documents in the specified directory,,
7+
core,,Execute Workflow,WF,60,_bmad/core/tasks/workflow.xml,bmad_workflow,false,llm,,Execute given workflow by loading its configuration following instructions and producing output,,
8+
core,,Shard Document,SD,70,_bmad/core/tasks/shard-doc.xml,bmad_shard-doc,false,llm,,Splits large markdown documents into smaller organized files based on level 2 sections,,
9+
core,,Editorial Review - Prose,EP,80,_bmad/core/tasks/editorial-review-prose.xml,bmad_editorial-review-prose,false,llm,reader_type,Clinical copy-editor that reviews text for communication issues,,"three-column markdown table with suggested fixes",
10+
core,,Editorial Review - Structure,ES,90,_bmad/core/tasks/editorial-review-structure.xml,bmad_editorial-review-structure,false,llm,,Structural editor that proposes cuts reorganization and simplification while preserving comprehension,,
11+
core,,Adversarial Review (General),AR,100,_bmad/core/tasks/review-adversarial-general.xml,bmad_review-adversarial-general,false,llm,,Cynically review content and produce findings,,

tools/cli/installers/lib/ide/STANDARDIZATION_PLAN.md

Lines changed: 70 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
## Overview
44

5-
Standardize IDE installers to use **flat file naming** and centralize duplicated code in shared utilities.
5+
Standardize IDE installers to use **flat file naming** with **underscores** (Windows-compatible) and centralize duplicated code in shared utilities.
66

7-
**Key Rule: Only folder-based IDEs convert to colon format. IDEs already using dashes keep using dashes.**
7+
**Key Rule: All IDEs use underscore format for Windows compatibility (colons don't work on Windows).**
88

99
## Current State Analysis
1010

@@ -15,10 +15,10 @@ Standardize IDE installers to use **flat file naming** and centralize duplicated
1515
| **claude-code** | Hierarchical | `.claude/commands/bmad/{module}/agents/{name}.md` |
1616
| **cursor** | Hierarchical | `.cursor/commands/bmad/{module}/agents/{name}.md` |
1717
| **crush** | Hierarchical | `.crush/commands/bmad/{module}/agents/{name}.md` |
18-
| **antigravity** | Flattened (dashes) | `.agent/workflows/bmad-module-agents-name.md` |
19-
| **codex** | Flattened (dashes) | `~/.codex/prompts/bmad-module-agents-name.md` |
20-
| **cline** | Flattened (dashes) | `.clinerules/workflows/bmad-module-type-name.md` |
21-
| **roo** | Flattened (dashes) | `.roo/commands/bmad-{module}-agent-{name}.md` |
18+
| **antigravity** | Flattened (underscores) | `.agent/workflows/bmad_module_agents_name.md` |
19+
| **codex** | Flattened (underscores) | `~/.codex/prompts/bmad_module_agents_name.md` |
20+
| **cline** | Flattened (underscores) | `.clinerules/workflows/bmad_module_type_name.md` |
21+
| **roo** | Flattened (underscores) | `.roo/commands/bmad_module_agent_name.md` |
2222
| **auggie** | Hybrid | `.augment/commands/bmad/agents/{module}-{name}.md` |
2323
| **iflow** | Hybrid | `.iflow/commands/bmad/agents/{module}-{name}.md` |
2424
| **trae** | Different (rules) | `.trae/rules/bmad-agent-{module}-{name}.md` |
@@ -40,35 +40,24 @@ All currently create artifacts with **nested relative paths** like `{module}/age
4040

4141
## Target Standardization
4242

43-
### For Folder-Based IDEs (convert to colon format)
43+
### For All IDEs (underscore format - Windows-compatible)
4444

45-
**IDEs affected:** claude-code, cursor, crush
45+
**IDEs affected:** claude-code, cursor, crush, antigravity, codex, cline, roo
4646

4747
```
48-
Format: bmad:{module}:{type}:{name}.md
48+
Format: bmad_{module}_{type}_{name}.md
4949
5050
Examples:
51-
- Agent: bmad:bmm:agents:pm.md
52-
- Agent: bmad:core:agents:dev.md
53-
- Workflow: bmad:bmm:workflows:correct-course.md
54-
- Task: bmad:bmm:tasks:bmad-help.md
55-
- Tool: bmad:core:tools:code-review.md
56-
- Custom: bmad:custom:agents:fred-commit-poet.md
51+
- Agent: bmad_bmm_agents_pm.md
52+
- Agent: bmad_core_agents_dev.md
53+
- Workflow: bmad_bmm_workflows_correct-course.md
54+
- Task: bmad_bmm_tasks_bmad-help.md
55+
- Tool: bmad_core_tools_code-review.md
56+
- Custom: bmad_custom_agents_fred-commit-poet.md
5757
```
5858

59-
### For Already-Flat IDEs (keep using dashes)
60-
61-
**IDEs affected:** antigravity, codex, cline, roo
62-
63-
```
64-
Format: bmad-{module}-{type}-{name}.md
65-
66-
Examples:
67-
- Agent: bmad-bmm-agents-pm.md
68-
- Workflow: bmad-bmm-workflows-correct-course.md
69-
- Task: bmad-bmm-tasks-bmad-help.md
70-
- Custom: bmad-custom-agents-fred-commit-poet.md
71-
```
59+
**Note:** Type segments (agents, workflows, tasks, tools) are filtered out from names:
60+
- `bmm/agents/pm.md``bmad_bmm_pm.md` (not `bmad_bmm_agents_pm.md`)
7261

7362
### For Hybrid IDEs (keep as-is)
7463

@@ -88,57 +77,50 @@ These use `{module}-{name}.md` format within subdirectories - keep as-is.
8877

8978
```javascript
9079
/**
91-
* Convert hierarchical path to flat colon-separated name (for folder-based IDEs)
80+
* Convert hierarchical path to flat underscore-separated name (Windows-compatible)
9281
* @param {string} module - Module name (e.g., 'bmm', 'core')
93-
* @param {string} type - Artifact type ('agents', 'workflows', 'tasks', 'tools')
82+
* @param {string} type - Artifact type ('agents', 'workflows', 'tasks', 'tools') - filtered out
9483
* @param {string} name - Artifact name (e.g., 'pm', 'correct-course')
95-
* @returns {string} Flat filename like 'bmad:bmm:agents:pm.md'
96-
*/
97-
function toColonName(module, type, name) {
98-
return `bmad:${module}:${type}:${name}.md`;
99-
}
100-
101-
/**
102-
* Convert relative path to flat colon-separated name (for folder-based IDEs)
103-
* @param {string} relativePath - Path like 'bmm/agents/pm.md'
104-
* @returns {string} Flat filename like 'bmad:bmm:agents:pm.md'
84+
* @returns {string} Flat filename like 'bmad_bmm_pm.md'
10585
*/
106-
function toColonPath(relativePath) {
107-
const withoutExt = relativePath.replace('.md', '');
108-
const parts = withoutExt.split(/[\/\\]/);
109-
return `bmad:${parts.join(':')}.md`;
86+
function toUnderscoreName(module, type, name) {
87+
return `bmad_${module}_${name}.md`;
11088
}
11189

11290
/**
113-
* Convert hierarchical path to flat dash-separated name (for flat IDEs)
91+
* Convert relative path to flat underscore-separated name (Windows-compatible)
11492
* @param {string} relativePath - Path like 'bmm/agents/pm.md'
115-
* @returns {string} Flat filename like 'bmad-bmm-agents-pm.md'
93+
* @returns {string} Flat filename like 'bmad_bmm_pm.md'
11694
*/
117-
function toDashPath(relativePath) {
95+
function toUnderscorePath(relativePath) {
11896
const withoutExt = relativePath.replace('.md', '');
11997
const parts = withoutExt.split(/[\/\\]/);
120-
return `bmad-${parts.join('-')}.md`;
98+
// Filter out type segments (agents, workflows, tasks, tools)
99+
const filtered = parts.filter((p) => !TYPE_SEGMENTS.includes(p));
100+
return `bmad_${filtered.join('_')}.md`;
121101
}
122102

123103
/**
124-
* Create custom agent colon name
104+
* Create custom agent underscore name
125105
* @param {string} agentName - Custom agent name
126-
* @returns {string} Flat filename like 'bmad:custom:agents:fred-commit-poet.md'
106+
* @returns {string} Flat filename like 'bmad_custom_fred-commit-poet.md'
127107
*/
128-
function customAgentColonName(agentName) {
129-
return `bmad:custom:agents:${agentName}.md`;
108+
function customAgentUnderscoreName(agentName) {
109+
return `bmad_custom_${agentName}.md`;
130110
}
131111

132-
/**
133-
* Create custom agent dash name
134-
* @param {string} agentName - Custom agent name
135-
* @returns {string} Flat filename like 'bmad-custom-agents-fred-commit-poet.md'
136-
*/
137-
function customAgentDashName(agentName) {
138-
return `bmad-custom-agents-${agentName}.md`;
139-
}
112+
// Backward compatibility aliases
113+
const toColonName = toUnderscoreName;
114+
const toColonPath = toUnderscorePath;
115+
const toDashPath = toUnderscorePath;
116+
const customAgentColonName = customAgentUnderscoreName;
117+
const customAgentDashName = customAgentUnderscoreName;
140118

141119
module.exports = {
120+
toUnderscoreName,
121+
toUnderscorePath,
122+
customAgentUnderscoreName,
123+
// Backward compatibility
142124
toColonName,
143125
toColonPath,
144126
toDashPath,
@@ -157,34 +139,26 @@ module.exports = {
157139
**Changes:**
158140
1. Import path utilities
159141
2. Change `relativePath` to use flat format
160-
3. Add method `writeColonArtifacts()` for folder-based IDEs
161-
4. Add method `writeDashArtifacts()` for flat IDEs
142+
3. Add method `writeColonArtifacts()` for folder-based IDEs (uses underscore)
143+
4. Add method `writeDashArtifacts()` for flat IDEs (uses underscore)
162144

163-
### Phase 3: Update Folder-Based IDEs
145+
### Phase 3: Update All IDEs
164146

165147
**Files to modify:**
166148
- `claude-code.js`
167149
- `cursor.js`
168150
- `crush.js`
169-
170-
**Changes:**
171-
1. Import `toColonPath`, `customAgentColonName` from path-utils
172-
2. Change from hierarchical to flat colon naming
173-
3. Update cleanup to handle flat structure
174-
175-
### Phase 4: Update Flat IDEs
176-
177-
**Files to modify:**
178151
- `antigravity.js`
179152
- `codex.js`
180153
- `cline.js`
181154
- `roo.js`
182155

183156
**Changes:**
184-
1. Import `toDashPath`, `customAgentDashName` from path-utils
185-
2. Replace local `flattenFilename()` with shared `toDashPath()`
157+
1. Import utilities from path-utils
158+
2. Change from hierarchical to flat underscore naming
159+
3. Update cleanup to handle flat structure (`startsWith('bmad')`)
186160

187-
### Phase 5: Update Base Class
161+
### Phase 4: Update Base Class
188162

189163
**File:** `_base-ide.js`
190164

@@ -195,24 +169,23 @@ module.exports = {
195169
## Migration Checklist
196170

197171
### New Files
198-
- [ ] Create `shared/path-utils.js`
199-
200-
### Folder-Based IDEs (convert to colon format)
201-
- [ ] Update `shared/agent-command-generator.js` - add `writeColonArtifacts()`
202-
- [ ] Update `shared/task-tool-command-generator.js` - add `writeColonArtifacts()`
203-
- [ ] Update `shared/workflow-command-generator.js` - add `writeColonArtifacts()`
204-
- [ ] Update `claude-code.js` - convert to colon format
205-
- [ ] Update `cursor.js` - convert to colon format
206-
- [ ] Update `crush.js` - convert to colon format
207-
208-
### Flat IDEs (standardize dash format)
209-
- [ ] Update `shared/agent-command-generator.js` - add `writeDashArtifacts()`
210-
- [ ] Update `shared/task-tool-command-generator.js` - add `writeDashArtifacts()`
211-
- [ ] Update `shared/workflow-command-generator.js` - add `writeDashArtifacts()`
212-
- [ ] Update `antigravity.js` - use shared `toDashPath()`
213-
- [ ] Update `codex.js` - use shared `toDashPath()`
214-
- [ ] Update `cline.js` - use shared `toDashPath()`
215-
- [ ] Update `roo.js` - use shared `toDashPath()`
172+
- [x] Create `shared/path-utils.js`
173+
174+
### All IDEs (convert to underscore format)
175+
- [x] Update `shared/agent-command-generator.js` - update for underscore
176+
- [x] Update `shared/task-tool-command-generator.js` - update for underscore
177+
- [x] Update `shared/workflow-command-generator.js` - update for underscore
178+
- [x] Update `claude-code.js` - convert to underscore format
179+
- [x] Update `cursor.js` - convert to underscore format
180+
- [x] Update `crush.js` - convert to underscore format
181+
- [ ] Update `antigravity.js` - use underscore format
182+
- [ ] Update `codex.js` - use underscore format
183+
- [ ] Update `cline.js` - use underscore format
184+
- [ ] Update `roo.js` - use underscore format
185+
186+
### CSV Command Files
187+
- [x] Update `src/core/module-help.csv` - change colons to underscores
188+
- [x] Update `src/bmm/module-help.csv` - change colons to underscores
216189

217190
### Base Class
218191
- [ ] Update `_base-ide.js` - add deprecation notice
@@ -228,7 +201,8 @@ module.exports = {
228201

229202
## Notes
230203

231-
1. **Keep segments**: agents, workflows, tasks, tools all become part of the flat name
232-
2. **Colon vs Dash**: Colons for folder-based IDEs converting to flat, dashes for already-flat IDEs
204+
1. **Filter type segments**: agents, workflows, tasks, tools are filtered out from flat names
205+
2. **Underscore format**: Universal underscore format for Windows compatibility
233206
3. **Custom agents**: Follow the same pattern as regular agents
234-
4. **Backward compatibility**: Cleanup will remove old folder structure
207+
4. **Backward compatibility**: Old function names kept as aliases
208+
5. **Cleanup**: Will remove old `bmad:` format files on next install

tools/cli/installers/lib/ide/antigravity.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ class AntigravitySetup extends BaseIdeSetup {
127127
const { artifacts: agentArtifacts, counts: agentCounts } = await agentGen.collectAgentArtifacts(bmadDir, options.selectedModules || []);
128128

129129
// Write agent launcher files with FLATTENED naming using shared utility
130-
// Antigravity ignores directory structure, so we flatten to: bmad-module-name.md
131-
// This creates slash commands like /bmad-bmm-dev instead of /dev
130+
// Antigravity ignores directory structure, so we flatten to: bmad_module_name.md
131+
// This creates slash commands like /bmad_bmm_dev instead of /dev
132132
const agentCount = await agentGen.writeDashArtifacts(bmadWorkflowsDir, agentArtifacts);
133133

134134
// Process Antigravity specific injections for installed modules
@@ -167,7 +167,7 @@ class AntigravitySetup extends BaseIdeSetup {
167167
);
168168
}
169169
console.log(chalk.dim(` - Workflows directory: ${path.relative(projectDir, bmadWorkflowsDir)}`));
170-
console.log(chalk.yellow(`\n Note: Antigravity uses flattened slash commands (e.g., /bmad-module-agents-name)`));
170+
console.log(chalk.yellow(`\n Note: Antigravity uses flattened slash commands (e.g., /bmad_module_agents_name)`));
171171

172172
return {
173173
success: true,
@@ -455,7 +455,7 @@ usage: |
455455
456456
⚠️ **IMPORTANT**: Run @${agentPath} to load the complete agent before using this launcher!`;
457457

458-
// Use dash format: bmad-custom-agents-fred-commit-poet.md
458+
// Use underscore format: bmad_custom_fred-commit-poet.md
459459
const fileName = customAgentDashName(agentName);
460460
const launcherPath = path.join(bmadWorkflowsDir, fileName);
461461

tools/cli/installers/lib/ide/claude-code.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,12 @@ class ClaudeCodeSetup extends BaseIdeSetup {
9292
async cleanup(projectDir) {
9393
const commandsDir = path.join(projectDir, this.configDir, this.commandsDir);
9494

95-
// Remove any bmad:* files from the commands directory
95+
// Remove any bmad* files from the commands directory (cleans up old bmad: and bmad- formats)
9696
if (await fs.pathExists(commandsDir)) {
9797
const entries = await fs.readdir(commandsDir);
9898
let removedCount = 0;
9999
for (const entry of entries) {
100-
if (entry.startsWith('bmad:')) {
100+
if (entry.startsWith('bmad')) {
101101
await fs.remove(path.join(commandsDir, entry));
102102
removedCount++;
103103
}
@@ -151,16 +151,16 @@ class ClaudeCodeSetup extends BaseIdeSetup {
151151
const commandsDir = path.join(claudeDir, this.commandsDir);
152152
await this.ensureDir(commandsDir);
153153

154-
// Use colon format: files written directly to commands dir (no bmad subfolder)
155-
// Creates: .claude/commands/bmad:bmm:pm.md
154+
// Use underscore format: files written directly to commands dir (no bmad subfolder)
155+
// Creates: .claude/commands/bmad_bmm_pm.md
156156

157157
// Generate agent launchers using AgentCommandGenerator
158158
// This creates small launcher files that reference the actual agents in _bmad/
159159
const agentGen = new AgentCommandGenerator(this.bmadFolderName);
160160
const { artifacts: agentArtifacts, counts: agentCounts } = await agentGen.collectAgentArtifacts(bmadDir, options.selectedModules || []);
161161

162-
// Write agent launcher files using flat colon naming
163-
// Creates files like: bmad:bmm:pm.md
162+
// Write agent launcher files using flat underscore naming
163+
// Creates files like: bmad_bmm_pm.md
164164
const agentCount = await agentGen.writeColonArtifacts(commandsDir, agentArtifacts);
165165

166166
// Process Claude Code specific injections for installed modules
@@ -182,8 +182,8 @@ class ClaudeCodeSetup extends BaseIdeSetup {
182182
const workflowGen = new WorkflowCommandGenerator(this.bmadFolderName);
183183
const { artifacts: workflowArtifacts } = await workflowGen.collectWorkflowArtifacts(bmadDir);
184184

185-
// Write workflow-command artifacts using flat colon naming
186-
// Creates files like: bmad:bmm:correct-course.md
185+
// Write workflow-command artifacts using flat underscore naming
186+
// Creates files like: bmad_bmm_correct-course.md
187187
const workflowCommandCount = await workflowGen.writeColonArtifacts(commandsDir, workflowArtifacts);
188188

189189
// Generate task and tool commands from manifests (if they exist)
@@ -490,7 +490,7 @@ You must fully embody this agent's persona and follow all activation instruction
490490
</agent-activation>
491491
`;
492492

493-
// Use colon format: bmad:custom:agents:fred-commit-poet.md
493+
// Use underscore format: bmad_custom_fred-commit-poet.md
494494
// Written directly to commands dir (no bmad subfolder)
495495
const launcherName = customAgentColonName(agentName);
496496
const launcherPath = path.join(commandsDir, launcherName);

0 commit comments

Comments
 (0)