( _projectPath: string, scope: InstallScope, platformIds: string[], )
| 45 | const LINGMA_STAGE_AGENT = 'claude-code'; |
| 46 | |
| 47 | function buildSuperpowersInstallCommand( |
| 48 | _projectPath: string, |
| 49 | scope: InstallScope, |
| 50 | platformIds: string[], |
| 51 | ): { command: string; args: string[] } { |
| 52 | const unknownIds = platformIds.filter((id) => !VALID_PLATFORM_IDS.has(id)); |
| 53 | if (unknownIds.length > 0) { |
| 54 | throw new Error(`Unknown platform IDs: ${unknownIds.join(', ')}`); |
| 55 | } |
| 56 | |
| 57 | const agentNames = [ |
| 58 | ...new Set( |
| 59 | platformIds.map((id) => SKILLS_AGENT_MAP[id]).filter((name): name is string => Boolean(name)), |
| 60 | ), |
| 61 | ]; |
| 62 | |
| 63 | if (agentNames.length === 0) { |
| 64 | throw new Error(`No skills CLI agent names resolved for platforms: ${platformIds.join(', ')}`); |
| 65 | } |
| 66 | |
| 67 | const args = ['skills', 'add', 'obra/superpowers', '-y']; |
| 68 | if (scope === 'global') { |
| 69 | args.push('-g'); |
| 70 | } |
| 71 | for (const name of agentNames) { |
| 72 | args.push('--agent', name); |
| 73 | } |
| 74 | return { command: getNpxExecutable(), args }; |
| 75 | } |
| 76 | |
| 77 | function buildLingmaSuperpowersStageCommand(): { command: string; args: string[] } { |
| 78 | return { |
no test coverage detected