diff --git a/tools/installer/lib/ide-setup.js b/tools/installer/lib/ide-setup.js index a3882333..8dc4af41 100644 --- a/tools/installer/lib/ide-setup.js +++ b/tools/installer/lib/ide-setup.js @@ -72,6 +72,9 @@ class IdeSetup extends BaseIdeSetup { case 'kilo': { return this.setupKilocode(installDir, selectedAgent); } + case 'kiro': { + return this.setupKiro(installDir, selectedAgent); + } case 'gemini': { return this.setupGeminiCli(installDir, selectedAgent); } @@ -1921,6 +1924,50 @@ class IdeSetup extends BaseIdeSetup { return true; } + async setupKiro(installDir, selectedAgent) { + const steeringDir = path.join(installDir, '.kiro', 'steering'); + const agents = selectedAgent ? [selectedAgent] : await this.getAllAgentIds(installDir); + + // Create steering directory + await fileManager.ensureDirectory(steeringDir); + + // Track created agents for bmad.md + const agentLinks = []; + + for (const agentId of agents) { + const agentPath = await this.findAgentPath(agentId, installDir); + if (!agentPath) { + console.log(chalk.red(`✗ Could not find agent file for ${agentId}`)); + continue; + } + + const agentContent = await fileManager.readFile(agentPath); + const steeringPath = path.join(steeringDir, `${agentId}.md`); + + // Write agent file to steering directory + await fileManager.writeFile(steeringPath, agentContent); + console.log(chalk.green(`✓ Added agent: ${agentId}`)); + + // Add to agent links for bmad.md + agentLinks.push(agentId); + } + + // Create bmad.md with inclusion header + const bmadMdPath = path.join(steeringDir, 'bmad.md'); + const header = '---\ninclusion: always\n---\n\n'; + const intro = '# BMad Steering Files\n\nOpen any of the following files to activate that agent:\n\n'; + + const agentRefs = agentLinks.map((id) => `- [${id}](./${id}.md)`).join('\n'); + + const bmadContent = header + intro + agentRefs; + await fileManager.writeFile(bmadMdPath, bmadContent); + console.log(chalk.green('✓ Created bmad.md steering file')); + console.log(chalk.green('✓ Kiro IDE setup complete!')); + console.log(chalk.dim('Steering files are ready in .kiro/steering/')); + + return true; + } + async setupCline(installDir, selectedAgent) { const clineRulesDir = path.join(installDir, '.clinerules'); const agents = selectedAgent ? [selectedAgent] : await this.getAllAgentIds(installDir);