From 79f2af34d5f72e92d43fdcfe35c69c15bba131eb Mon Sep 17 00:00:00 2001 From: mrsaifullah52 Date: Thu, 9 Oct 2025 16:04:13 +0500 Subject: [PATCH] feat: add Kiro IDE support - Added Kiro IDE to the list of supported IDEs in the installer. - Implemented the `setupKiro` function to create the necessary files and directories for Kiro IDE integration in `ide-setup.js`. - Updated `bmad.js` to include `kiro` in the interactive installer and command-line options. - Added `kiro` configuration to `install.config.yaml. --- tools/installer/bin/bmad.js | 3 +- tools/installer/config/install.config.yaml | 10 +++++++ tools/installer/lib/ide-setup.js | 33 ++++++++++++++++++++++ 3 files changed, 45 insertions(+), 1 deletion(-) diff --git a/tools/installer/bin/bmad.js b/tools/installer/bin/bmad.js index d016b268..7fed8090 100755 --- a/tools/installer/bin/bmad.js +++ b/tools/installer/bin/bmad.js @@ -49,7 +49,7 @@ program .option('-d, --directory ', 'Installation directory') .option( '-i, --ide ', - 'Configure for specific IDE(s) - can specify multiple (cursor, claude-code, windsurf, trae, roo, kilo, cline, gemini, qwen-code, github-copilot, codex, codex-web, auggie-cli, iflow-cli, opencode, other)', + 'Configure for specific IDE(s) - can specify multiple (cursor, claude-code, windsurf, trae, roo, kilo, kiro, cline, gemini, qwen-code, github-copilot, codex, codex-web, auggie-cli, iflow-cli, opencode, other)', ) .option( '-e, --expansion-packs ', @@ -402,6 +402,7 @@ async function promptInstallation() { { name: 'Trae', value: 'trae' }, // { name: 'Trae', value: 'trae'} { name: 'Roo Code', value: 'roo' }, { name: 'Kilo Code', value: 'kilo' }, + { name: 'Kiro IDE', value: 'kiro' }, { name: 'Cline', value: 'cline' }, { name: 'Gemini CLI', value: 'gemini' }, { name: 'Qwen Code', value: 'qwen-code' }, diff --git a/tools/installer/config/install.config.yaml b/tools/installer/config/install.config.yaml index 3aa7464c..94403b39 100644 --- a/tools/installer/config/install.config.yaml +++ b/tools/installer/config/install.config.yaml @@ -9,6 +9,16 @@ installation-options: description: Select and install a single agent with its dependencies action: copy-agent ide-configurations: + kiro: + name: Kiro IDE + rule-dir: .kiro/steering/ + format: multi-file + command-suffix: .md + instructions: | + # To use BMad agents in Kiro IDE: + # 1. The installer creates agent files in `.kiro/steering/`. + # 2. The steering file `bmad.md` is always included. + # 3. Type *agent-name (e.g., "*agent-dev", "*agent-pm") to activate the agent. cursor: name: Cursor rule-dir: .cursor/rules/bmad/ diff --git a/tools/installer/lib/ide-setup.js b/tools/installer/lib/ide-setup.js index a3882333..2e92b854 100644 --- a/tools/installer/lib/ide-setup.js +++ b/tools/installer/lib/ide-setup.js @@ -69,6 +69,9 @@ class IdeSetup extends BaseIdeSetup { case 'cline': { return this.setupCline(installDir, selectedAgent); } + case 'kiro': { + return this.setupKiro(installDir, selectedAgent); + } case 'kilo': { return this.setupKilocode(installDir, selectedAgent); } @@ -1391,6 +1394,36 @@ class IdeSetup extends BaseIdeSetup { } } + async setupKiro(installDir, selectedAgent) { + const kiroSteeringDir = path.join(installDir, '.kiro', 'steering'); + await fileManager.ensureDirectory(kiroSteeringDir); + + // Get all agent IDs + const agents = selectedAgent ? [selectedAgent] : await this.getAllAgentIds(installDir); + const agentLinks = []; + + for (const agentId of agents) { + // Find the agent file + const agentPath = await this.findAgentPath(agentId, installDir); + if (agentPath) { + const agentContent = await fileManager.readFile(agentPath); + const mdPath = path.join(kiroSteeringDir, `${agentId}.md`); + await fileManager.writeFile(mdPath, agentContent); + agentLinks.push(`- [*agent-${agentId}](./${agentId}.md)`); + console.log(chalk.green(`✓ Created steering file: ${agentId}.md`)); + } + } + + // Create bmad-method.md and readme.md with inclusion header and agent links + const inclusionHeader = '---\ninclusion: always\n---\n'; + const intro = + "i'll open the next file that is under the .kiro/steering/ dir based on the user's input file name\n"; + const content = `${inclusionHeader}\n${intro}\n${agentLinks.join('\n')}\n`; + await fileManager.writeFile(path.join(kiroSteeringDir, 'bmad.md'), content); + console.log(chalk.green('✓ Created bmad.md for Kiro steering.')); + return true; + } + async findAgentPath(agentId, installDir) { // Try to find the agent file in various locations const possiblePaths = [