bmad-method 1.1.0 → 4.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/.bmad-core/agents/analyst.md +14 -20
  2. package/.bmad-core/agents/architect.md +15 -20
  3. package/.bmad-core/agents/bmad-master.md +18 -26
  4. package/.bmad-core/agents/bmad-orchestrator.md +16 -28
  5. package/.bmad-core/agents/dev.md +5 -4
  6. package/.bmad-core/agents/pm.md +11 -16
  7. package/.bmad-core/agents/sm.md +20 -25
  8. package/.bmad-core/bmad-core-config.yml +60 -0
  9. package/.bmad-core/data/bmad-kb.md +12 -1
  10. package/.bmad-core/tasks/doc-migration-task.md +91 -146
  11. package/.bmad-core/tasks/document-project.md +389 -0
  12. package/.bmad-core/tasks/generate-ai-frontend-prompt.md +41 -48
  13. package/.bmad-core/tasks/index-docs.md +4 -1
  14. package/.bmad-core/templates/architecture-tmpl.md +15 -12
  15. package/.bmad-core/templates/fullstack-architecture-tmpl.md +85 -103
  16. package/.bmad-core/templates/prd-tmpl.md +1 -1
  17. package/.bmad-core/templates/simple-project-prd-tmpl.md +461 -0
  18. package/.bmad-core/templates/story-tmpl.md +2 -2
  19. package/.bmad-core/utils/workflow-management.md +14 -15
  20. package/.bmad-core/web-bundles/agents/analyst.txt +26 -21
  21. package/.bmad-core/web-bundles/agents/architect.txt +605 -233
  22. package/.bmad-core/web-bundles/agents/bmad-master.txt +457 -1039
  23. package/.bmad-core/web-bundles/agents/bmad-orchestrator.txt +36 -903
  24. package/.bmad-core/web-bundles/agents/dev.txt +5 -4
  25. package/.bmad-core/web-bundles/agents/pm.txt +476 -17
  26. package/.bmad-core/web-bundles/agents/po.txt +2 -2
  27. package/.bmad-core/web-bundles/agents/sm.txt +22 -27
  28. package/.bmad-core/web-bundles/agents/ux-expert.txt +41 -48
  29. package/.bmad-core/web-bundles/teams/team-all.txt +4394 -4447
  30. package/.bmad-core/web-bundles/teams/team-fullstack.txt +2760 -2809
  31. package/.bmad-core/web-bundles/teams/team-no-ui.txt +2718 -2760
  32. package/.bmad-core/workflows/greenfield-fullstack.yml +3 -3
  33. package/.claude/commands/analyst.md +14 -20
  34. package/.claude/commands/architect.md +15 -20
  35. package/.claude/commands/bmad-master.md +18 -26
  36. package/.claude/commands/bmad-orchestrator.md +16 -28
  37. package/.claude/commands/dev.md +5 -4
  38. package/.claude/commands/pm.md +11 -16
  39. package/.claude/commands/sm.md +20 -25
  40. package/.cursor/rules/analyst.mdc +13 -19
  41. package/.cursor/rules/architect.mdc +14 -19
  42. package/.cursor/rules/bmad-master.mdc +18 -26
  43. package/.cursor/rules/bmad-orchestrator.mdc +15 -27
  44. package/.cursor/rules/dev.mdc +5 -4
  45. package/.cursor/rules/pm.mdc +11 -16
  46. package/.cursor/rules/sm.mdc +19 -24
  47. package/.releaserc.json +2 -1
  48. package/.vscode/settings.json +4 -0
  49. package/.windsurf/rules/analyst.md +13 -19
  50. package/.windsurf/rules/architect.md +14 -19
  51. package/.windsurf/rules/bmad-master.md +18 -26
  52. package/.windsurf/rules/bmad-orchestrator.md +15 -27
  53. package/.windsurf/rules/dev.md +5 -4
  54. package/.windsurf/rules/pm.md +11 -16
  55. package/.windsurf/rules/sm.md +19 -24
  56. package/CHANGELOG.md +120 -2
  57. package/CONTRIBUTING.md +2 -0
  58. package/README.md +21 -3
  59. package/{.bmad-core → creator-tools}/tasks/create-agent.md +10 -12
  60. package/{.bmad-core/tasks/create-expansion-pack.md → creator-tools/tasks/generate-expansion-pack.md} +8 -6
  61. package/docs/bmad-workflow-guide.md +161 -0
  62. package/docs/claude-code-guide.md +119 -0
  63. package/docs/core-architecture.md +213 -0
  64. package/docs/cursor-guide.md +127 -0
  65. package/docs/how-to-contribute-with-pull-requests.md +141 -0
  66. package/docs/roo-code-guide.md +140 -0
  67. package/docs/user-guide.md +1044 -0
  68. package/docs/windsurf-guide.md +127 -0
  69. package/expansion-packs/README.md +1 -111
  70. package/expansion-packs/infrastructure-devops/agents/infra-devops-platform.md +1 -1
  71. package/expansion-packs/infrastructure-devops/tasks/create-doc.md +74 -0
  72. package/package.json +19 -13
  73. package/tools/builders/web-builder.js +16 -15
  74. package/tools/installer/bin/bmad.js +50 -29
  75. package/tools/installer/lib/file-manager.js +20 -3
  76. package/tools/installer/lib/ide-setup.js +11 -1
  77. package/tools/installer/lib/installer.js +149 -29
  78. package/tools/installer/package-lock.json +537 -335
  79. package/tools/installer/package.json +7 -7
  80. package/tools/lib/dependency-resolver.js +1 -1
  81. package/tools/semantic-release-sync-installer.js +31 -0
  82. package/tools/sync-installer-version.js +34 -0
  83. package/tools/upgraders/v3-to-v4-upgrader.js +18 -13
  84. package/tools/version-bump.js +33 -26
  85. package/tools/yaml-format.js +54 -25
  86. package/.bmad-core/schemas/agent-team-schema.yml +0 -153
  87. package/.bmad-core/tasks/create-team.md +0 -229
@@ -0,0 +1,127 @@
1
+ # BMAD Method Guide for Windsurf
2
+
3
+ This guide walks you through the complete BMAD workflow using Windsurf as your AI-powered IDE.
4
+
5
+ ## Step 1: Install BMAD in Your Project
6
+
7
+ 1. Navigate to your project directory
8
+ 2. Run the BMAD installer:
9
+ ```bash
10
+ npx bmad-method install
11
+ ```
12
+ 3. When prompted:
13
+ - **Installation Type**: Choose "Complete installation (recommended)"
14
+ - **IDE**: Select "Windsurf"
15
+
16
+ This creates a `.bmad-core` folder with all agents and a `.windsurf/rules` folder with agent rules.
17
+
18
+ ## Step 2: Set Up Team Fullstack in Gemini
19
+
20
+ For ideation and planning, use Google's Gemini with the team-fullstack configuration:
21
+
22
+ 1. Open [Google AI Studio (Gemini)](https://aistudio.google.com/)
23
+ 2. Create a new chat
24
+ 3. Copy the contents of `/Users/brianmadison/dev/BMAD-METHOD/.bmad-core/web-bundles/teams/team-fullstack.txt`
25
+ 4. Paste this content into Gemini to set up the team
26
+
27
+ ### Gemini Planning Phase
28
+
29
+ In Gemini, ask the BMAD team to help you:
30
+
31
+ - **Ideate** your project concept
32
+ - **Brainstorm** features and requirements
33
+ - **Create a PRD** (Product Requirements Document)
34
+ - **Design the architecture**
35
+
36
+ Ask questions like:
37
+
38
+ - "Help me brainstorm a [type of application] that does [core functionality]"
39
+ - "Create a comprehensive PRD for this concept"
40
+ - "Design the technical architecture for this system"
41
+
42
+ Copy the PRD and architecture documents that Gemini creates into your project's `docs/` folder:
43
+
44
+ - `docs/prd.md`
45
+ - `docs/architecture.md`
46
+
47
+ ## Step 3: Back to Windsurf - Document Sharding
48
+
49
+ Once you have your PRD and architecture documents in the `docs/` folder:
50
+
51
+ 1. **Start a new chat in Windsurf**
52
+ 2. **Load the bmad-master agent**: Type `@bmad-master`
53
+ 3. **Shard the PRD**: Type `*shard-doc docs/prd.md prd`
54
+ 4. **Shard the architecture**: Type `*shard-doc docs/architecture.md architecture`
55
+
56
+ This creates organized folders:
57
+
58
+ - `docs/prd/` - Contains broken down PRD sections
59
+ - `docs/architecture/` - Contains broken down architecture sections
60
+
61
+ ## Step 4: Story Development Cycle
62
+
63
+ Now begin the iterative development cycle:
64
+
65
+ ### Create Stories (Scrum Master)
66
+
67
+ 1. **Start a new chat**
68
+ 2. **Load SM agent**: Type `@sm`
69
+ 3. **Create story**: Type `*create` (this runs the create-next-story task)
70
+ 4. **Review the generated story**
71
+ 5. **If approved**: Set story status to "Approved" in the story file
72
+
73
+ ### Implement Stories (Developer)
74
+
75
+ 1. **Start a new chat**
76
+ 2. **Load Dev agent**: Type `@dev`
77
+ 3. **The agent will ask which story to implement**
78
+ 4. **Follow the development tasks** the agent provides
79
+ 5. **When story is complete**: Mark status as "Done"
80
+
81
+ ### Repeat the Cycle
82
+
83
+ 1. **Start a new chat with SM agent** (`@sm`)
84
+ 2. **Create next story**: Type `*create`
85
+ 3. **Review and approve**
86
+ 4. **Start new chat with Dev agent** (`@dev`)
87
+ 5. **Implement the story**
88
+ 6. **Repeat until project complete**
89
+
90
+ ## Available Agent Rules in Windsurf
91
+
92
+ All BMAD agents are available as Windsurf rules (use `@` prefix):
93
+
94
+ - `@bmad-master` - Universal task executor
95
+ - `@sm` - Scrum Master for story creation
96
+ - `@dev` - Full-stack developer for implementation
97
+ - `@architect` - Solution architect for design
98
+ - `@pm` - Product manager for planning
99
+ - `@analyst` - Business analyst for requirements
100
+ - `@qa` - QA specialist for testing
101
+ - `@po` - Product owner for prioritization
102
+ - `@ux-expert` - UX specialist for design
103
+
104
+ ## Windsurf-Specific Features
105
+
106
+ - **Agent rules are stored in**: `.windsurf/rules/` as `.md` files
107
+ - **Rule activation**: Rules activate when you mention `@agent-name` in chat
108
+ - **Collaborative workflow**: Windsurf's collaborative features work well with BMAD's agent-switching pattern
109
+ - **Context awareness**: Agents have access to your project context
110
+
111
+ ## Key Workflow Principles
112
+
113
+ 1. **Always start new chats** when switching agents to avoid context confusion
114
+ 2. **Use Gemini for initial planning** and ideation with the team-fullstack bundle
115
+ 3. **Use bmad-master for document management** (sharding, templates, etc.)
116
+ 4. **Follow the SM → Dev cycle** for consistent story development
117
+ 5. **Review and approve stories** before implementation begins
118
+
119
+ ## Tips for Success
120
+
121
+ - **Keep chats focused**: Each chat should have one agent and one primary task
122
+ - **Use \*help command**: Every agent supports `*help` to see available commands
123
+ - **Review generated content**: Always review and approve stories before marking them ready
124
+ - **Maintain status updates**: Keep story statuses current (Draft → Approved → InProgress → Done)
125
+ - **Leverage Windsurf's collaboration**: Use the collaborative features for team reviews
126
+
127
+ This workflow ensures systematic, AI-assisted development following agile principles with clear handoffs between planning, story creation, and implementation phases.
@@ -1,113 +1,3 @@
1
1
  # BMAD Method Expansion Packs
2
2
 
3
- ## Overview
4
-
5
- Expansion packs extend BMAD Method with specialized capabilities for specific use cases. They allow teams to add functionality without cluttering the core workflow.
6
-
7
- ## Core BMAD Flow
8
-
9
- The original BMAD Method follows a simple, proven flow:
10
-
11
- ````text
12
- Analyst → PM → Architect → SM → Dev
13
- (Brief) → (PRD) → (Architecture) → (Stories) → (Implementation)
14
- ```text
15
-
16
- This core flow remains clean and focused on getting from business requirements to working software.
17
-
18
- ## Why Expansion Packs?
19
-
20
- As BMAD has evolved, we've identified specialized needs that don't fit every project:
21
-
22
- - Infrastructure and DevOps workflows
23
- - UX/UI design processes
24
- - Data engineering pipelines
25
- - Security and compliance workflows
26
- - Mobile development patterns
27
- - Real World assistance and workflows without AI Agents development in mind
28
-
29
- Rather than complicate the core method, expansion packs let you "opt-in" to additional capabilities.
30
-
31
- ## Available Expansion Packs
32
-
33
- ### 1. Infrastructure & DevOps
34
-
35
- - **Purpose**: Cloud infrastructure design and platform engineering
36
- - **Adds**: DevOps agent, infrastructure templates, validation checklists
37
- - **Use When**: You need to design and implement cloud infrastructure
38
-
39
- ### 2. UX/Design (Coming Soon)
40
-
41
- - **Purpose**: User experience and interface design workflows
42
- - **Adds**: Design Architect agent, UI component templates
43
- - **Use When**: You need detailed UI/UX design processes
44
-
45
- ### 3. Data Engineering (Planned)
46
-
47
- - **Purpose**: Data pipeline and analytics infrastructure
48
- - **Adds**: Data Engineer agent, ETL templates, data architecture patterns
49
- - **Use When**: You're building data-intensive applications
50
-
51
- ## Structure of an Expansion Pack
52
-
53
- Each expansion pack contains:
54
-
55
- ```text
56
- expansion-pack-name/
57
- ├── README.md # Overview and usage instructions
58
- ├── manifest.yml # Installation configuration
59
- ├── agents/ # Agent configurations (.yml)
60
- ├── personas/ # Persona definitions (.md)
61
- ├── ide-agents/ # IDE-specific agents (.ide.md)
62
- ├── templates/ # Document templates (.md)
63
- ├── tasks/ # Specialized tasks (.md)
64
- └── checklists/ # Validation checklists (.md)
65
- ````
66
-
67
- ## Installing an Expansion Pack
68
-
69
- ### Method 1: NPM Script
70
-
71
- ````bash
72
- npm run install:expansion <pack-name>
73
- ```text
74
-
75
- ### Method 2: Direct Script
76
-
77
- ```bash
78
- node tools/install-expansion-pack.js <pack-name>
79
- ````
80
-
81
- ### Method 3: Manual
82
-
83
- 1. Copy files according to manifest.yml
84
- 2. Update team configurations as needed
85
- 3. Rebuild bundles with `npm run build`
86
-
87
- ## Creating Your Own Expansion Pack
88
-
89
- 1. Create a new folder under `expansion-packs/`
90
- 2. Add your specialized agents, templates, and tasks
91
- 3. Create a manifest.yml defining installation mappings
92
- 4. Write a README explaining purpose and usage
93
- 5. Test installation process
94
-
95
- ## Best Practices
96
-
97
- 1. **Keep Core Simple**: Don't add to core what could be an expansion
98
- 2. **Clear Purpose**: Each pack should solve a specific need
99
- 3. **Self-Contained**: Packs should work independently when possible
100
- 4. **Document Well**: Clear README and usage examples
101
- 5. **Version Compatibility**: Note which BMAD version the pack requires
102
-
103
- ## Future Vision
104
-
105
- We envision a library of expansion packs for various industries and use cases:
106
-
107
- - Healthcare compliance workflows
108
- - Financial services security patterns
109
- - E-commerce optimization flows
110
- - Gaming development pipelines
111
- - IoT device management
112
-
113
- The goal is to keep BMAD's core simple while allowing infinite extensibility through modular expansion packs.
3
+ Expansion packs extend BMAD-METHOD beyond traditional software development, providing specialized agent teams, templates, and workflows for specific domains and industries. Each pack is a self-contained ecosystem designed to bring the power of AI-assisted workflows to any field. Coming soon.
@@ -2,7 +2,7 @@
2
2
 
3
3
  CRITICAL: Read the full YML, start activation to alter your state of being, follow startup section instructions, stay in this being until told to exit this mode:
4
4
 
5
- ```yml
5
+ ```yaml
6
6
  activation-instructions:
7
7
  - Follow all instructions in this file -> this defines you, your persona and more importantly what you can do. STAY IN CHARACTER!
8
8
  - Only read the files/tasks listed here when user selects them for execution to minimize context usage
@@ -0,0 +1,74 @@
1
+ # Create Document from Template Task
2
+
3
+ ## Purpose
4
+
5
+ - Generate documents from any specified template following embedded instructions from the perspective of the selected agent persona
6
+
7
+ ## Instructions
8
+
9
+ ### 1. Identify Template and Context
10
+
11
+ - Determine which template to use (user-provided or list available for selection to user)
12
+
13
+ - Agent-specific templates are listed in the agent's dependencies under `templates`. For each template listed, consider it a document the agent can create. So if an agent has:
14
+
15
+ @{example}
16
+ dependencies:
17
+ templates: - prd-tmpl - architecture-tmpl
18
+ @{/example}
19
+
20
+ You would offer to create "PRD" and "Architecture" documents when the user asks what you can help with.
21
+
22
+ - Gather all relevant inputs, or ask for them, or else rely on user providing necessary details to complete the document
23
+ - Understand the document purpose and target audience
24
+
25
+ ### 2. Determine Interaction Mode
26
+
27
+ Confirm with the user their preferred interaction style:
28
+
29
+ - **Incremental:** Work through chunks of the document.
30
+ - **YOLO Mode:** Draft complete document making reasonable assumptions in one shot. (Can be entered also after starting incremental by just typing /yolo)
31
+
32
+ ### 3. Execute Template
33
+
34
+ - Load specified template from `templates#*` or the /templates directory
35
+ - Follow ALL embedded LLM instructions within the template
36
+ - Process template markup according to `utils#template-format` conventions
37
+
38
+ ### 4. Template Processing Rules
39
+
40
+ #### CRITICAL: Never display template markup, LLM instructions, or examples to users
41
+
42
+ - Replace all {{placeholders}} with actual content
43
+ - Execute all [[LLM: instructions]] internally
44
+ - Process `<<REPEAT>>` sections as needed
45
+ - Evaluate ^^CONDITION^^ blocks and include only if applicable
46
+ - Use @{examples} for guidance but never output them
47
+
48
+ ### 5. Content Generation
49
+
50
+ - **Incremental Mode**: Present each major section for review before proceeding
51
+ - **YOLO Mode**: Generate all sections, then review complete document with user
52
+ - Apply any elicitation protocols specified in template
53
+ - Incorporate user feedback and iterate as needed
54
+
55
+ ### 6. Validation
56
+
57
+ If template specifies a checklist:
58
+
59
+ - Run the appropriate checklist against completed document
60
+ - Document completion status for each item
61
+ - Address any deficiencies found
62
+ - Present validation summary to user
63
+
64
+ ### 7. Final Presentation
65
+
66
+ - Present clean, formatted content only
67
+ - Ensure all sections are complete
68
+ - DO NOT truncate or summarize content
69
+ - Begin directly with document content (no preamble)
70
+ - Include any handoff prompts specified in template
71
+
72
+ ## Important Notes
73
+
74
+ - Template markup is for AI processing only - never expose to users
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "bmad-method",
3
- "version": "1.1.0",
3
+ "version": "4.4.0",
4
4
  "description": "Breakthrough Method of Agile AI-driven Development",
5
5
  "main": "tools/cli.js",
6
6
  "bin": {
7
- "bmad": "./tools/bmad-npx-wrapper.js",
8
- "bmad-method": "./tools/bmad-npx-wrapper.js"
7
+ "bmad": "tools/bmad-npx-wrapper.js",
8
+ "bmad-method": "tools/bmad-npx-wrapper.js"
9
9
  },
10
10
  "scripts": {
11
11
  "build": "node tools/cli.js build",
@@ -23,14 +23,14 @@
23
23
  "prepare": "husky"
24
24
  },
25
25
  "dependencies": {
26
- "@kayvan/markdown-tree-parser": "^1.4.2",
27
- "chalk": "^4.1.2",
28
- "commander": "^9.4.1",
29
- "fs-extra": "^11.1.0",
30
- "glob": "^8.0.3",
31
- "inquirer": "^8.2.5",
26
+ "@kayvan/markdown-tree-parser": "^1.5.0",
27
+ "chalk": "^5.4.1",
28
+ "commander": "^14.0.0",
29
+ "fs-extra": "^11.3.0",
30
+ "glob": "^11.0.3",
31
+ "inquirer": "^12.6.3",
32
32
  "js-yaml": "^4.1.0",
33
- "ora": "^5.4.1"
33
+ "ora": "^8.2.0"
34
34
  },
35
35
  "keywords": [
36
36
  "agile",
@@ -45,7 +45,7 @@
45
45
  "license": "MIT",
46
46
  "repository": {
47
47
  "type": "git",
48
- "url": "https://github.com/bmadcode/BMAD-METHOD.git"
48
+ "url": "git+https://github.com/bmadcode/BMAD-METHOD.git"
49
49
  },
50
50
  "engines": {
51
51
  "node": ">=14.0.0"
@@ -60,14 +60,20 @@
60
60
  "yaml-lint": "^1.7.0"
61
61
  },
62
62
  "lint-staged": {
63
- "*.{yml,yaml}": [
63
+ "**/*.{yml,yaml}": [
64
64
  "node tools/yaml-format.js"
65
65
  ],
66
- "*.md": [
66
+ "**/*.md": [
67
67
  "node tools/yaml-format.js"
68
68
  ],
69
69
  ".roomodes": [
70
70
  "node tools/yaml-format.js"
71
+ ],
72
+ ".bmad-core/**/*.yml": [
73
+ "node tools/yaml-format.js"
74
+ ],
75
+ ".github/**/*.yml": [
76
+ "node tools/yaml-format.js"
71
77
  ]
72
78
  }
73
79
  }
@@ -1,5 +1,5 @@
1
- const fs = require('fs').promises;
2
- const path = require('path');
1
+ const fs = require('node:fs').promises;
2
+ const path = require('node:path');
3
3
  const DependencyResolver = require('../lib/dependency-resolver');
4
4
 
5
5
  class WebBuilder {
@@ -19,6 +19,7 @@ class WebBuilder {
19
19
  await fs.rm(dir, { recursive: true, force: true });
20
20
  console.log(`Cleaned: ${path.relative(this.rootDir, dir)}`);
21
21
  } catch (error) {
22
+ console.debug(`Failed to clean directory ${dir}:`, error.message);
22
23
  // Directory might not exist, that's fine
23
24
  }
24
25
  }
@@ -26,11 +27,11 @@ class WebBuilder {
26
27
 
27
28
  async buildAgents() {
28
29
  const agents = await this.resolver.listAgents();
29
-
30
+
30
31
  for (const agentId of agents) {
31
32
  console.log(` Building agent: ${agentId}`);
32
33
  const bundle = await this.buildAgentBundle(agentId);
33
-
34
+
34
35
  // Write to all output directories
35
36
  for (const outputDir of this.outputDirs) {
36
37
  const outputPath = path.join(outputDir, 'agents');
@@ -45,11 +46,11 @@ class WebBuilder {
45
46
 
46
47
  async buildTeams() {
47
48
  const teams = await this.resolver.listTeams();
48
-
49
+
49
50
  for (const teamId of teams) {
50
51
  console.log(` Building team: ${teamId}`);
51
52
  const bundle = await this.buildTeamBundle(teamId);
52
-
53
+
53
54
  // Write to all output directories
54
55
  for (const outputDir of this.outputDirs) {
55
56
  const outputPath = path.join(outputDir, 'teams');
@@ -65,39 +66,39 @@ class WebBuilder {
65
66
  async buildAgentBundle(agentId) {
66
67
  const dependencies = await this.resolver.resolveAgentDependencies(agentId);
67
68
  const template = await fs.readFile(this.templatePath, 'utf8');
68
-
69
+
69
70
  const sections = [template];
70
-
71
+
71
72
  // Add agent configuration
72
73
  sections.push(this.formatSection(dependencies.agent.path, dependencies.agent.content));
73
-
74
+
74
75
  // Add all dependencies
75
76
  for (const resource of dependencies.resources) {
76
77
  sections.push(this.formatSection(resource.path, resource.content));
77
78
  }
78
-
79
+
79
80
  return sections.join('\n');
80
81
  }
81
82
 
82
83
  async buildTeamBundle(teamId) {
83
84
  const dependencies = await this.resolver.resolveTeamDependencies(teamId);
84
85
  const template = await fs.readFile(this.templatePath, 'utf8');
85
-
86
+
86
87
  const sections = [template];
87
-
88
+
88
89
  // Add team configuration
89
90
  sections.push(this.formatSection(dependencies.team.path, dependencies.team.content));
90
-
91
+
91
92
  // Add all agents
92
93
  for (const agent of dependencies.agents) {
93
94
  sections.push(this.formatSection(agent.path, agent.content));
94
95
  }
95
-
96
+
96
97
  // Add all deduplicated resources
97
98
  for (const resource of dependencies.resources) {
98
99
  sections.push(this.formatSection(resource.path, resource.content));
99
100
  }
100
-
101
+
101
102
  return sections.join('\n');
102
103
  }
103
104
 
@@ -1,24 +1,34 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  const { program } = require('commander');
4
- const inquirer = require('inquirer');
5
- const chalk = require('chalk');
6
- const path = require('path');
4
+
5
+ // Dynamic imports for ES modules
6
+ let chalk, inquirer;
7
+
8
+ // Initialize ES modules
9
+ async function initializeModules() {
10
+ if (!chalk) {
11
+ chalk = (await import('chalk')).default;
12
+ inquirer = (await import('inquirer')).default;
13
+ }
14
+ }
7
15
 
8
16
  // Handle both execution contexts (from root via npx or from installer directory)
9
- let version, installer;
17
+ let version;
18
+ let installer;
10
19
  try {
11
20
  // Try installer context first (when run from tools/installer/)
12
21
  version = require('../package.json').version;
13
22
  installer = require('../lib/installer');
14
23
  } catch (e) {
15
24
  // Fall back to root context (when run via npx from GitHub)
25
+ console.log(`Installer context not found (${e.message}), trying root context...`);
16
26
  try {
17
27
  version = require('../../../package.json').version;
18
28
  installer = require('../../../tools/installer/lib/installer');
19
29
  } catch (e2) {
20
- console.error(chalk.red('Error: Could not load required modules. Please ensure you are running from the correct directory.'));
21
- console.error(chalk.yellow('Debug info:'), {
30
+ console.error('Error: Could not load required modules. Please ensure you are running from the correct directory.');
31
+ console.error('Debug info:', {
22
32
  __dirname,
23
33
  cwd: process.cwd(),
24
34
  error: e2.message
@@ -36,25 +46,27 @@ program
36
46
  .description('Install BMAD Method agents and tools')
37
47
  .option('-f, --full', 'Install complete .bmad-core folder')
38
48
  .option('-a, --agent <agent>', 'Install specific agent with dependencies')
39
- .option('-d, --directory <path>', 'Installation directory (default: ./bmad-core)')
40
- .option('-i, --ide <ide>', 'Configure for specific IDE (cursor, claude-code, windsurf, roo)')
49
+ .option('-d, --directory <path>', 'Installation directory (default: .bmad-core)')
50
+ .option('-i, --ide <ide...>', 'Configure for specific IDE(s) - can specify multiple (cursor, claude-code, windsurf, roo)')
41
51
  .action(async (options) => {
42
52
  try {
53
+ await initializeModules();
43
54
  if (!options.full && !options.agent) {
44
55
  // Interactive mode
45
- const answers = await promptInstallation(options);
56
+ const answers = await promptInstallation();
46
57
  await installer.install(answers);
47
58
  } else {
48
59
  // Direct mode
49
60
  const config = {
50
61
  installType: options.full ? 'full' : 'single-agent',
51
62
  agent: options.agent,
52
- directory: options.directory || './.bmad-core',
53
- ide: options.ide
63
+ directory: options.directory || '.bmad-core',
64
+ ides: options.ide || []
54
65
  };
55
66
  await installer.install(config);
56
67
  }
57
68
  } catch (error) {
69
+ if (!chalk) await initializeModules();
58
70
  console.error(chalk.red('Installation failed:'), error.message);
59
71
  process.exit(1);
60
72
  }
@@ -65,10 +77,11 @@ program
65
77
  .description('Update existing BMAD installation')
66
78
  .option('--force', 'Force update, overwriting modified files')
67
79
  .option('--dry-run', 'Show what would be updated without making changes')
68
- .action(async (options) => {
80
+ .action(async () => {
69
81
  try {
70
- await installer.update(options);
82
+ await installer.update();
71
83
  } catch (error) {
84
+ if (!chalk) await initializeModules();
72
85
  console.error(chalk.red('Update failed:'), error.message);
73
86
  process.exit(1);
74
87
  }
@@ -81,6 +94,7 @@ program
81
94
  try {
82
95
  await installer.listAgents();
83
96
  } catch (error) {
97
+ if (!chalk) await initializeModules();
84
98
  console.error(chalk.red('Error:'), error.message);
85
99
  process.exit(1);
86
100
  }
@@ -93,27 +107,29 @@ program
93
107
  try {
94
108
  await installer.showStatus();
95
109
  } catch (error) {
110
+ if (!chalk) await initializeModules();
96
111
  console.error(chalk.red('Error:'), error.message);
97
112
  process.exit(1);
98
113
  }
99
114
  });
100
115
 
101
- async function promptInstallation(options) {
116
+ async function promptInstallation() {
117
+ await initializeModules();
102
118
  console.log(chalk.bold.blue(`\nWelcome to BMAD Method Installer v${version}\n`));
103
-
119
+
104
120
  const answers = {};
105
-
121
+
106
122
  // Ask for installation directory
107
123
  const { directory } = await inquirer.prompt([
108
124
  {
109
125
  type: 'input',
110
126
  name: 'directory',
111
127
  message: 'Where would you like to install BMAD?',
112
- default: './.bmad-core'
128
+ default: '.bmad-core'
113
129
  }
114
130
  ]);
115
131
  answers.directory = directory;
116
-
132
+
117
133
  // Ask for installation type
118
134
  const { installType } = await inquirer.prompt([
119
135
  {
@@ -133,7 +149,7 @@ async function promptInstallation(options) {
133
149
  }
134
150
  ]);
135
151
  answers.installType = installType;
136
-
152
+
137
153
  // If single agent, ask which one
138
154
  if (installType === 'single-agent') {
139
155
  const agents = await installer.getAvailableAgents();
@@ -150,24 +166,29 @@ async function promptInstallation(options) {
150
166
  ]);
151
167
  answers.agent = agent;
152
168
  }
153
-
169
+
154
170
  // Ask for IDE configuration
155
- const { ide } = await inquirer.prompt([
171
+ const { ides } = await inquirer.prompt([
156
172
  {
157
- type: 'list',
158
- name: 'ide',
159
- message: 'Which IDE are you using?',
173
+ type: 'checkbox',
174
+ name: 'ides',
175
+ message: 'Which IDE(s) are you using? (Select all that apply)',
160
176
  choices: [
161
177
  { name: 'Cursor', value: 'cursor' },
162
178
  { name: 'Claude Code', value: 'claude-code' },
163
179
  { name: 'Windsurf', value: 'windsurf' },
164
- { name: 'Roo Code', value: 'roo' },
165
- { name: 'Other/Manual setup', value: null }
166
- ]
180
+ { name: 'Roo Code', value: 'roo' }
181
+ ],
182
+ validate: (answer) => {
183
+ if (answer.length < 1) {
184
+ return 'You must choose at least one IDE, or press Ctrl+C to skip IDE setup.';
185
+ }
186
+ return true;
187
+ }
167
188
  }
168
189
  ]);
169
- answers.ide = ide;
170
-
190
+ answers.ides = ides;
191
+
171
192
  return answers;
172
193
  }
173
194