diff --git a/README.md b/README.md index 28d8d8ab..57d8ec88 100644 --- a/README.md +++ b/README.md @@ -156,7 +156,7 @@ The BMad Method works with any IDE, but has built-in integration for: - `gemini-cli` - Gemini with @agent commands - `windsurf` - Windsurf with manual rule @agent commands - `roo` - Roo Code with custom modes (see `.roomodes`) -- `windsurf` - Windsurf with @agent commands +- `vs-code-copilot` - VS Code with GitHub Copilot agent mode integration ## Available Agents @@ -290,6 +290,7 @@ See the **[Core Architecture](docs/core-architecture.md)** for the complete sour - 🦘 [Roo Code Guide](docs/agentic-tools/roo-code-guide.md) - Setup and usage for Roo Code - šŸ”§ [Cline Guide](docs/agentic-tools/cline-guide.md) - Setup and usage for Cline (VS Code) - ✨ [Gemini CLI Guide](docs/agentic-tools/gemini-cli-guide.md) - Setup and usage for Gemini CLI +- šŸ’» [VS Code Copilot Guide](docs/agentic-tools/vs-code-copilot-guide.md) - Setup and usage for VS Code with GitHub Copilot ## 🌟 Beyond Software Development - Expansion Packs diff --git a/bmad-core/data/bmad-kb.md b/bmad-core/data/bmad-kb.md index 8961d5e0..cfb923dc 100644 --- a/bmad-core/data/bmad-kb.md +++ b/bmad-core/data/bmad-kb.md @@ -78,7 +78,7 @@ BMAD transforms you into a "Vibe CEO" - directing a team of specialized AI agent 5. Type `/help` to see available commands #### Option 2: IDE Integration -**Best for**: Cursor, Claude Code, Windsurf, Cline, Roo Code users +**Best for**: Cursor, Claude Code, Windsurf, Cline, Roo Code, VS Code Copilot users ```bash # Interactive installation (recommended) @@ -93,6 +93,7 @@ npx bmad-method install - **Windsurf**: Built-in AI capabilities - **Cline**: VS Code extension with AI features - **Roo Code**: Web-based IDE with agent support + - **VS Code Copilot**: AI-powered coding assistant **Note for VS Code Users**: BMAD-METHOD assumes when you mention "VS Code" that you're using it with an AI-powered extension like GitHub Copilot, Cline, or Roo. Standard VS Code without AI capabilities cannot run BMAD agents. The installer includes built-in support for Cline and Roo. @@ -278,6 +279,7 @@ You are the "Vibe CEO" - thinking like a CEO with unlimited resources and a sing - **Cursor**: `@agent-name` (e.g., `@bmad-master`) - **Windsurf**: `@agent-name` (e.g., `@bmad-master`) - **Roo Code**: Select mode from mode selector (e.g., `bmad-bmad-master`) +- **VS Code Copilot**: Open the Chat view (`⌃⌘I` on Mac, `Ctrl+Alt+I` on Windows/Linux) and select **Agent** from the chat mode selector. **Chat Management Guidelines**: - **Claude Code, Cursor, Windsurf**: Start new chats when switching agents diff --git a/dist/agents/analyst.txt b/dist/agents/analyst.txt index e0edc913..5dc5e450 100644 --- a/dist/agents/analyst.txt +++ b/dist/agents/analyst.txt @@ -2010,7 +2010,7 @@ BMAD transforms you into a "Vibe CEO" - directing a team of specialized AI agent 5. Type `/help` to see available commands #### Option 2: IDE Integration -**Best for**: Cursor, Claude Code, Windsurf, Cline, Roo Code users +**Best for**: Cursor, Claude Code, Windsurf, Cline, Roo Code, VS Code Copilot users ```bash # Interactive installation (recommended) diff --git a/dist/agents/bmad-master.txt b/dist/agents/bmad-master.txt index 69ed59ab..2b20d34f 100644 --- a/dist/agents/bmad-master.txt +++ b/dist/agents/bmad-master.txt @@ -8396,7 +8396,7 @@ BMAD transforms you into a "Vibe CEO" - directing a team of specialized AI agent 5. Type `/help` to see available commands #### Option 2: IDE Integration -**Best for**: Cursor, Claude Code, Windsurf, Cline, Roo Code users +**Best for**: Cursor, Claude Code, Windsurf, Cline, Roo Code, VS Code Copilot users ```bash # Interactive installation (recommended) diff --git a/dist/agents/bmad-orchestrator.txt b/dist/agents/bmad-orchestrator.txt index f9f8ef0d..f082280e 100644 --- a/dist/agents/bmad-orchestrator.txt +++ b/dist/agents/bmad-orchestrator.txt @@ -486,7 +486,7 @@ BMAD transforms you into a "Vibe CEO" - directing a team of specialized AI agent 5. Type `/help` to see available commands #### Option 2: IDE Integration -**Best for**: Cursor, Claude Code, Windsurf, Cline, Roo Code users +**Best for**: Cursor, Claude Code, Windsurf, Cline, Roo Code, VS Code Copilot users ```bash # Interactive installation (recommended) diff --git a/dist/teams/team-all.txt b/dist/teams/team-all.txt index 0f53033f..1372ce88 100644 --- a/dist/teams/team-all.txt +++ b/dist/teams/team-all.txt @@ -978,7 +978,7 @@ BMAD transforms you into a "Vibe CEO" - directing a team of specialized AI agent 5. Type `/help` to see available commands #### Option 2: IDE Integration -**Best for**: Cursor, Claude Code, Windsurf, Cline, Roo Code users +**Best for**: Cursor, Claude Code, Windsurf, Cline, Roo Code, VS Code Copilot users ```bash # Interactive installation (recommended) diff --git a/dist/teams/team-fullstack.txt b/dist/teams/team-fullstack.txt index b2d19ddc..5933d66c 100644 --- a/dist/teams/team-fullstack.txt +++ b/dist/teams/team-fullstack.txt @@ -822,7 +822,7 @@ BMAD transforms you into a "Vibe CEO" - directing a team of specialized AI agent 5. Type `/help` to see available commands #### Option 2: IDE Integration -**Best for**: Cursor, Claude Code, Windsurf, Cline, Roo Code users +**Best for**: Cursor, Claude Code, Windsurf, Cline, Roo Code, VS Code Copilot users ```bash # Interactive installation (recommended) diff --git a/dist/teams/team-ide-minimal.txt b/dist/teams/team-ide-minimal.txt index 8be39fef..f2b8b7da 100644 --- a/dist/teams/team-ide-minimal.txt +++ b/dist/teams/team-ide-minimal.txt @@ -722,7 +722,7 @@ BMAD transforms you into a "Vibe CEO" - directing a team of specialized AI agent 5. Type `/help` to see available commands #### Option 2: IDE Integration -**Best for**: Cursor, Claude Code, Windsurf, Cline, Roo Code users +**Best for**: Cursor, Claude Code, Windsurf, Cline, Roo Code, VS Code Copilot users ```bash # Interactive installation (recommended) diff --git a/dist/teams/team-no-ui.txt b/dist/teams/team-no-ui.txt index c2dc8ee0..5e967188 100644 --- a/dist/teams/team-no-ui.txt +++ b/dist/teams/team-no-ui.txt @@ -754,7 +754,7 @@ BMAD transforms you into a "Vibe CEO" - directing a team of specialized AI agent 5. Type `/help` to see available commands #### Option 2: IDE Integration -**Best for**: Cursor, Claude Code, Windsurf, Cline, Roo Code users +**Best for**: Cursor, Claude Code, Windsurf, Cline, Roo Code, VS Code Copilot users ```bash # Interactive installation (recommended) diff --git a/docs/bmad-workflow-guide.md b/docs/bmad-workflow-guide.md index 388209e6..b84f6b16 100644 --- a/docs/bmad-workflow-guide.md +++ b/docs/bmad-workflow-guide.md @@ -22,7 +22,7 @@ The BMAD Method follows a structured approach to AI-assisted software developmen ``` - Choose "Complete installation" - - Select your IDE (Cursor, Claude Code, Windsurf, or Roo Code) + - Select your IDE (Cursor, Claude Code, Windsurf, Roo Code, or VS Code Copilot) 2. **Verify installation**: - `.bmad-core/` folder created with all agents @@ -113,6 +113,7 @@ Follow the SM → Dev cycle for systematic story development: - **Cursor**: `@agent-name` (e.g., `@bmad-master`) - **Windsurf**: `@agent-name` (e.g., `@bmad-master`) - **Roo Code**: Select mode from mode selector (e.g., `bmad-bmad-master`) +- **VS Code Copilot**: Open the Chat view (`⌃⌘I` on Mac, `Ctrl+Alt+I` on Windows/Linux) and select **Agent** from the chat mode selector. ### Chat Management: diff --git a/docs/core-architecture.md b/docs/core-architecture.md index 8fc25406..33a901d2 100644 --- a/docs/core-architecture.md +++ b/docs/core-architecture.md @@ -292,7 +292,8 @@ bmad-method/ │ │ ā”œā”€ā”€ cline-guide.md │ │ ā”œā”€ā”€ gemini-cli-guide.md │ │ ā”œā”€ā”€ roo-code-guide.md -│ │ └── windsurf-guide.md +│ │ ā”œā”€ā”€ windsurf-guide.md +│ │ └── vs-code-copilot-guide.md │ ā”œā”€ā”€ bmad-workflow-guide.md # Universal workflow guide │ ā”œā”€ā”€ core-architecture.md # This document │ ā”œā”€ā”€ expansion-packs.md # Expansion pack guide diff --git a/tools/installer/bin/bmad.js b/tools/installer/bin/bmad.js index 0e4793d5..7c050e71 100755 --- a/tools/installer/bin/bmad.js +++ b/tools/installer/bin/bmad.js @@ -50,7 +50,7 @@ program .option('-f, --full', 'Install complete BMAD Method') .option('-x, --expansion-only', 'Install only expansion packs (no bmad-core)') .option('-d, --directory ', 'Installation directory') - .option('-i, --ide ', 'Configure for specific IDE(s) - can specify multiple (cursor, claude-code, windsurf, roo, cline, gemini, other)') + .option('-i, --ide ', 'Configure for specific IDE(s) - can specify multiple (cursor, claude-code, windsurf, roo, cline, gemini, vs-code-copilot, other)') .option('-e, --expansion-packs ', 'Install specific expansion packs (can specify multiple)') .action(async (options) => { try { @@ -236,7 +236,8 @@ async function promptInstallation() { { name: 'Windsurf', value: 'windsurf' }, { name: 'Roo Code', value: 'roo' }, { name: 'Cline', value: 'cline' }, - { name: 'Gemini CLI', value: 'gemini' } + { name: 'Gemini CLI', value: 'gemini' }, + { name: 'VS Code Copilot', value: 'vs-code-copilot' } ] } ]); diff --git a/tools/installer/config/install.config.yml b/tools/installer/config/install.config.yml index 81f3ccdb..0bc27ebf 100644 --- a/tools/installer/config/install.config.yml +++ b/tools/installer/config/install.config.yml @@ -67,3 +67,16 @@ ide-configurations: # 2. It also configures .gemini/settings.json to load all agent files. # 3. Simply mention the agent in your prompt (e.g., "As @dev, ..."). # 4. The Gemini CLI will automatically have the context for that agent. + vs-code-copilot: + name: VS Code Copilot + rule-dir: .github/chatmodes/ + format: multi-file + command-suffix: .md + instructions: | + # To use BMAD agents with VS Code Copilot: + # 1. The installer creates a .github/chatmodes/ directory in your project + # 2. Open the Chat view (`⌃⌘I` on Mac, `Ctrl+Alt+I` on Windows/Linux) and select **Agent** from the chat mode selector. + # 3. The agent will adopt that persona for the conversation + # 4. Requires VS Code 1.99+ with `chat.agent.enabled: true` in settings + # 5. Agent files are stored in .github/chatmodes/ + # 6. Use `/help` to see available commands and agents \ No newline at end of file diff --git a/tools/installer/lib/ide-setup.js b/tools/installer/lib/ide-setup.js index aea2b891..01c3f886 100644 --- a/tools/installer/lib/ide-setup.js +++ b/tools/installer/lib/ide-setup.js @@ -6,12 +6,16 @@ const configLoader = require("./config-loader"); // Dynamic import for ES module let chalk; +let inquirer; // Initialize ES modules async function initializeModules() { if (!chalk) { chalk = (await import("chalk")).default; } + if (!inquirer) { + inquirer = (await import("inquirer")).default; + } } class IdeSetup { @@ -36,7 +40,7 @@ class IdeSetup { } } - async setup(ide, installDir, selectedAgent = null) { + async setup(ide, installDir, selectedAgent = null, spinner = null) { await initializeModules(); const ideConfig = await configLoader.getIdeConfiguration(ide); @@ -58,6 +62,8 @@ class IdeSetup { return this.setupCline(installDir, selectedAgent); case "gemini": return this.setupGeminiCli(installDir, selectedAgent); + case "vs-code-copilot": + return this.setupVsCodeCopilot(installDir, selectedAgent, spinner); default: console.log(chalk.yellow(`\nIDE ${ide} not yet supported`)); return false; @@ -507,6 +513,213 @@ class IdeSetup { return true; } + + async setupVsCodeCopilot(installDir, selectedAgent, spinner = null) { + await initializeModules(); + + // Configure VS Code workspace settings first to avoid UI conflicts with loading spinners + await this.configureVsCodeSettings(installDir, spinner); + + const chatmodesDir = path.join(installDir, ".github", "chatmodes"); + const agents = selectedAgent ? [selectedAgent] : await this.getAllAgentIds(installDir); + + await fileManager.ensureDirectory(chatmodesDir); + + for (const agentId of agents) { + // Find the agent file + const agentPath = await this.findAgentPath(agentId, installDir); + const chatmodePath = path.join(chatmodesDir, `${agentId}.chatmode.md`); + + if (agentPath) { + // Create chat mode file with agent content + const agentContent = await fileManager.readFile(agentPath); + const agentTitle = await this.getAgentTitle(agentId, installDir); + + // Extract whenToUse for the description + const yamlMatch = agentContent.match(/```ya?ml\n([\s\S]*?)```/); + let description = `Activates the ${agentTitle} agent persona.`; + if (yamlMatch) { + const whenToUseMatch = yamlMatch[1].match(/whenToUse:\s*"(.*?)"/); + if (whenToUseMatch && whenToUseMatch[1]) { + description = whenToUseMatch[1]; + } + } + + let chatmodeContent = `--- +description: "${description.replace(/"/g, '\\"')}" +tools: ['changes', 'codebase', 'fetch', 'findTestFiles', 'githubRepo', 'problems', 'usages'] +--- + +`; + chatmodeContent += agentContent; + + await fileManager.writeFile(chatmodePath, chatmodeContent); + console.log(chalk.green(`āœ“ Created chat mode: ${agentId}.chatmode.md`)); + } + } + + console.log(chalk.green(`\nāœ“ VS Code Copilot setup complete!`)); + console.log(chalk.dim(`You can now find the BMAD agents in the Chat view's mode selector.`)); + + return true; + } + + async configureVsCodeSettings(installDir, spinner) { + await initializeModules(); // Ensure inquirer is loaded + const vscodeDir = path.join(installDir, ".vscode"); + const settingsPath = path.join(vscodeDir, "settings.json"); + + await fileManager.ensureDirectory(vscodeDir); + + // Read existing settings if they exist + let existingSettings = {}; + if (await fileManager.pathExists(settingsPath)) { + try { + const existingContent = await fileManager.readFile(settingsPath); + existingSettings = JSON.parse(existingContent); + console.log(chalk.yellow("Found existing .vscode/settings.json. Merging BMAD settings...")); + } catch (error) { + console.warn(chalk.yellow("Could not parse existing settings.json. Creating new one.")); + existingSettings = {}; + } + } + + // Clear any previous output and add spacing to avoid conflicts with loaders + console.log('\n'.repeat(2)); + console.log(chalk.blue("šŸ”§ VS Code Copilot Agent Settings Configuration")); + console.log(chalk.dim("BMAD works best with specific VS Code settings for optimal agent experience.")); + console.log(''); // Add extra spacing + + const { configChoice } = await inquirer.prompt([ + { + type: 'list', + name: 'configChoice', + message: 'How would you like to configure VS Code Copilot settings?', + choices: [ + { + name: 'Use recommended defaults (fastest setup)', + value: 'defaults' + }, + { + name: 'Configure each setting manually (customize to your preferences)', + value: 'manual' + }, + { + name: 'Skip settings configuration (I\'ll configure manually later)\n', + value: 'skip' + } + ], + default: 'defaults' + } + ]); + + let bmadSettings = {}; + + if (configChoice === 'skip') { + console.log(chalk.yellow("āš ļø Skipping VS Code settings configuration.")); + console.log(chalk.dim("You can manually configure these settings in .vscode/settings.json:")); + console.log(chalk.dim(" • chat.agent.enabled: true")); + console.log(chalk.dim(" • chat.agent.maxRequests: 15")); + console.log(chalk.dim(" • github.copilot.chat.agent.runTasks: true")); + console.log(chalk.dim(" • chat.mcp.discovery.enabled: true")); + console.log(chalk.dim(" • github.copilot.chat.agent.autoFix: true")); + console.log(chalk.dim(" • chat.tools.autoApprove: false")); + return true; + } + + if (configChoice === 'defaults') { + // Use recommended defaults + bmadSettings = { + "chat.agent.enabled": true, + "chat.agent.maxRequests": 15, + "github.copilot.chat.agent.runTasks": true, + "chat.mcp.discovery.enabled": true, + "github.copilot.chat.agent.autoFix": true, + "chat.tools.autoApprove": false + }; + console.log(chalk.green("āœ“ Using recommended BMAD defaults for VS Code Copilot settings")); + } else { + // Manual configuration + console.log(chalk.blue("\nšŸ“‹ Let's configure each setting for your preferences:")); + + // Pause spinner during manual configuration prompts + let spinnerWasActive = false; + if (spinner && spinner.isSpinning) { + spinner.stop(); + spinnerWasActive = true; + } + + const manualSettings = await inquirer.prompt([ + { + type: 'input', + name: 'maxRequests', + message: 'Maximum requests per agent session (recommended: 15)?', + default: '15', + validate: (input) => { + const num = parseInt(input); + if (isNaN(num) || num < 1 || num > 50) { + return 'Please enter a number between 1 and 50'; + } + return true; + } + }, + { + type: 'confirm', + name: 'runTasks', + message: 'Allow agents to run workspace tasks (package.json scripts, etc.)?', + default: true + }, + { + type: 'confirm', + name: 'mcpDiscovery', + message: 'Enable MCP (Model Context Protocol) server discovery?', + default: true + }, + { + type: 'confirm', + name: 'autoFix', + message: 'Enable automatic error detection and fixing in generated code?', + default: true + }, + { + type: 'confirm', + name: 'autoApprove', + message: 'Auto-approve ALL tools without confirmation? (āš ļø EXPERIMENTAL - less secure)', + default: false + } + ]); + + // Restart spinner if it was active before prompts + if (spinner && spinnerWasActive) { + spinner.start(); + } + + bmadSettings = { + "chat.agent.enabled": true, // Always enabled - required for BMAD agents + "chat.agent.maxRequests": parseInt(manualSettings.maxRequests), + "github.copilot.chat.agent.runTasks": manualSettings.runTasks, + "chat.mcp.discovery.enabled": manualSettings.mcpDiscovery, + "github.copilot.chat.agent.autoFix": manualSettings.autoFix, + "chat.tools.autoApprove": manualSettings.autoApprove + }; + + console.log(chalk.green("āœ“ Custom settings configured")); + } + + // Merge settings (existing settings take precedence to avoid overriding user preferences) + const mergedSettings = { ...bmadSettings, ...existingSettings }; + + // Write the updated settings + await fileManager.writeFile(settingsPath, JSON.stringify(mergedSettings, null, 2)); + + console.log(chalk.green("āœ“ VS Code workspace settings configured successfully")); + console.log(chalk.dim(" Settings written to .vscode/settings.json:")); + Object.entries(bmadSettings).forEach(([key, value]) => { + console.log(chalk.dim(` • ${key}: ${value}`)); + }); + console.log(chalk.dim("")); + console.log(chalk.dim("You can modify these settings anytime in .vscode/settings.json")); + } } module.exports = new IdeSetup(); diff --git a/tools/installer/lib/installer.js b/tools/installer/lib/installer.js index 47c71fba..a60a3c1f 100644 --- a/tools/installer/lib/installer.js +++ b/tools/installer/lib/installer.js @@ -372,7 +372,7 @@ class Installer { if (ides.length > 0) { for (const ide of ides) { spinner.text = `Setting up ${ide} integration...`; - await ideSetup.setup(ide, installDir, config.agent); + await ideSetup.setup(ide, installDir, config.agent, spinner); } }