superclaude-kiro 1.0.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 (44) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +190 -0
  3. package/bin/superclaude-kiro.js +38 -0
  4. package/dist/agents/sc-analyze.json +18 -0
  5. package/dist/agents/sc-implement.json +18 -0
  6. package/dist/agents/sc-pm.json +18 -0
  7. package/dist/agents/superclaude.json +18 -0
  8. package/dist/mcp/mcp-servers.json +44 -0
  9. package/dist/steering/superclaude/sc-agent.md +80 -0
  10. package/dist/steering/superclaude/sc-analyze.md +89 -0
  11. package/dist/steering/superclaude/sc-brainstorm.md +100 -0
  12. package/dist/steering/superclaude/sc-build.md +94 -0
  13. package/dist/steering/superclaude/sc-business-panel.md +90 -0
  14. package/dist/steering/superclaude/sc-cleanup.md +93 -0
  15. package/dist/steering/superclaude/sc-design.md +88 -0
  16. package/dist/steering/superclaude/sc-document.md +88 -0
  17. package/dist/steering/superclaude/sc-estimate.md +86 -0
  18. package/dist/steering/superclaude/sc-explain.md +92 -0
  19. package/dist/steering/superclaude/sc-git.md +80 -0
  20. package/dist/steering/superclaude/sc-help.md +148 -0
  21. package/dist/steering/superclaude/sc-implement.md +97 -0
  22. package/dist/steering/superclaude/sc-improve.md +93 -0
  23. package/dist/steering/superclaude/sc-index-repo.md +169 -0
  24. package/dist/steering/superclaude/sc-index.md +86 -0
  25. package/dist/steering/superclaude/sc-load.md +93 -0
  26. package/dist/steering/superclaude/sc-pm.md +592 -0
  27. package/dist/steering/superclaude/sc-recommend.md +1008 -0
  28. package/dist/steering/superclaude/sc-reflect.md +87 -0
  29. package/dist/steering/superclaude/sc-research.md +103 -0
  30. package/dist/steering/superclaude/sc-save.md +93 -0
  31. package/dist/steering/superclaude/sc-sc.md +134 -0
  32. package/dist/steering/superclaude/sc-select-tool.md +86 -0
  33. package/dist/steering/superclaude/sc-spawn.md +85 -0
  34. package/dist/steering/superclaude/sc-spec-panel.md +428 -0
  35. package/dist/steering/superclaude/sc-task.md +89 -0
  36. package/dist/steering/superclaude/sc-test.md +93 -0
  37. package/dist/steering/superclaude/sc-troubleshoot.md +88 -0
  38. package/dist/steering/superclaude/sc-workflow.md +97 -0
  39. package/package.json +52 -0
  40. package/src/cli.js +23 -0
  41. package/src/converter.js +63 -0
  42. package/src/installer.js +319 -0
  43. package/src/utils.js +105 -0
  44. package/templates/cli-settings.json +7 -0
@@ -0,0 +1,88 @@
1
+ ---
2
+ inclusion: manual
3
+ ---
4
+
5
+ # SuperClaude: troubleshoot
6
+
7
+ > Converted from Claude Code SuperClaude framework
8
+ > Original: ~/.claude/commands/sc/troubleshoot.md
9
+
10
+ # /sc:troubleshoot - Issue Diagnosis and Resolution
11
+
12
+ ## Triggers
13
+ - Code defects and runtime error investigation requests
14
+ - Build failure analysis and resolution needs
15
+ - Performance issue diagnosis and optimization requirements
16
+ - Deployment problem analysis and system behavior debugging
17
+
18
+ ## Usage
19
+ ```
20
+ /sc:troubleshoot [issue] [--type bug|build|performance|deployment] [--trace] [--fix]
21
+ ```
22
+
23
+ ## Behavioral Flow
24
+ 1. **Analyze**: Examine issue description and gather relevant system state information
25
+ 2. **Investigate**: Identify potential root causes through systematic pattern analysis
26
+ 3. **Debug**: Execute structured debugging procedures including log and state examination
27
+ 4. **Propose**: Validate solution approaches with impact assessment and risk evaluation
28
+ 5. **Resolve**: Apply appropriate fixes and verify resolution effectiveness
29
+
30
+ Key behaviors:
31
+ - Systematic root cause analysis with hypothesis testing and evidence collection
32
+ - Multi-domain troubleshooting (code, build, performance, deployment)
33
+ - Structured debugging methodologies with comprehensive problem analysis
34
+ - Safe fix application with verification and documentation
35
+
36
+ ## Tool Coordination
37
+ - **Read**: Log analysis and system state examination
38
+ - **Bash**: Diagnostic command execution and system investigation
39
+ - **Grep**: Error pattern detection and log analysis
40
+ - **Write**: Diagnostic reports and resolution documentation
41
+
42
+ ## Key Patterns
43
+ - **Bug Investigation**: Error analysis → stack trace examination → code inspection → fix validation
44
+ - **Build Troubleshooting**: Build log analysis → dependency checking → configuration validation
45
+ - **Performance Diagnosis**: Metrics analysis → bottleneck identification → optimization recommendations
46
+ - **Deployment Issues**: Environment analysis → configuration verification → service validation
47
+
48
+ ## Examples
49
+
50
+ ### Code Bug Investigation
51
+ ```
52
+ /sc:troubleshoot "Null pointer exception in user service" --type bug --trace
53
+ # Systematic analysis of error context and stack traces
54
+ # Identifies root cause and provides targeted fix recommendations
55
+ ```
56
+
57
+ ### Build Failure Analysis
58
+ ```
59
+ /sc:troubleshoot "TypeScript compilation errors" --type build --fix
60
+ # Analyzes build logs and TypeScript configuration
61
+ # Automatically applies safe fixes for common compilation issues
62
+ ```
63
+
64
+ ### Performance Issue Diagnosis
65
+ ```
66
+ /sc:troubleshoot "API response times degraded" --type performance
67
+ # Performance metrics analysis and bottleneck identification
68
+ # Provides optimization recommendations and monitoring guidance
69
+ ```
70
+
71
+ ### Deployment Problem Resolution
72
+ ```
73
+ /sc:troubleshoot "Service not starting in production" --type deployment --trace
74
+ # Environment and configuration analysis
75
+ # Systematic verification of deployment requirements and dependencies
76
+ ```
77
+
78
+ ## Boundaries
79
+
80
+ **Will:**
81
+ - Execute systematic issue diagnosis using structured debugging methodologies
82
+ - Provide validated solution approaches with comprehensive problem analysis
83
+ - Apply safe fixes with verification and detailed resolution documentation
84
+
85
+ **Will Not:**
86
+ - Apply risky fixes without proper analysis and user confirmation
87
+ - Modify production systems without explicit permission and safety validation
88
+ - Make architectural changes without understanding full system impact
@@ -0,0 +1,97 @@
1
+ ---
2
+ inclusion: manual
3
+ ---
4
+
5
+ # SuperClaude: workflow
6
+
7
+ > Converted from Claude Code SuperClaude framework
8
+ > Original: ~/.claude/commands/sc/workflow.md
9
+
10
+ # /sc:workflow - Implementation Workflow Generator
11
+
12
+ ## Triggers
13
+ - PRD and feature specification analysis for implementation planning
14
+ - Structured workflow generation for development projects
15
+ - Multi-persona coordination for complex implementation strategies
16
+ - Cross-session workflow management and dependency mapping
17
+
18
+ ## Usage
19
+ ```
20
+ /sc:workflow [prd-file|feature-description] [--strategy systematic|agile|enterprise] [--depth shallow|normal|deep] [--parallel]
21
+ ```
22
+
23
+ ## Behavioral Flow
24
+ 1. **Analyze**: Parse PRD and feature specifications to understand implementation requirements
25
+ 2. **Plan**: Generate comprehensive workflow structure with dependency mapping and task orchestration
26
+ 3. **Coordinate**: Activate multiple personas for domain expertise and implementation strategy
27
+ 4. **Execute**: Create structured step-by-step workflows with automated task coordination
28
+ 5. **Validate**: Apply quality gates and ensure workflow completeness across domains
29
+
30
+ Key behaviors:
31
+ - Multi-persona orchestration across architecture, frontend, backend, security, and devops domains
32
+ - Advanced MCP coordination with intelligent routing for specialized workflow analysis
33
+ - Systematic execution with progressive workflow enhancement and parallel processing
34
+ - Cross-session workflow management with comprehensive dependency tracking
35
+
36
+ ## MCP Integration
37
+ - **Sequential MCP**: Complex multi-step workflow analysis and systematic implementation planning
38
+ - **Context7 MCP**: Framework-specific workflow patterns and implementation best practices
39
+ - **Magic MCP**: UI/UX workflow generation and design system integration strategies
40
+ - **Playwright MCP**: Testing workflow integration and quality assurance automation
41
+ - **Morphllm MCP**: Large-scale workflow transformation and pattern-based optimization
42
+ - **Serena MCP**: Cross-session workflow persistence, memory management, and project context
43
+
44
+ ## Tool Coordination
45
+ - **Read/Write/Edit**: PRD analysis and workflow documentation generation
46
+ - **TodoWrite**: Progress tracking for complex multi-phase workflow execution
47
+ - **Task**: Advanced delegation for parallel workflow generation and multi-agent coordination
48
+ - **WebSearch**: Technology research, framework validation, and implementation strategy analysis
49
+ - **sequentialthinking**: Structured reasoning for complex workflow dependency analysis
50
+
51
+ ## Key Patterns
52
+ - **PRD Analysis**: Document parsing → requirement extraction → implementation strategy development
53
+ - **Workflow Generation**: Task decomposition → dependency mapping → structured implementation planning
54
+ - **Multi-Domain Coordination**: Cross-functional expertise → comprehensive implementation strategies
55
+ - **Quality Integration**: Workflow validation → testing strategies → deployment planning
56
+
57
+ ## Examples
58
+
59
+ ### Systematic PRD Workflow
60
+ ```
61
+ /sc:workflow Claudedocs/PRD/feature-spec.md --strategy systematic --depth deep
62
+ # Comprehensive PRD analysis with systematic workflow generation
63
+ # Multi-persona coordination for complete implementation strategy
64
+ ```
65
+
66
+ ### Agile Feature Workflow
67
+ ```
68
+ /sc:workflow "user authentication system" --strategy agile --parallel
69
+ # Agile workflow generation with parallel task coordination
70
+ # Context7 and Magic MCP for framework and UI workflow patterns
71
+ ```
72
+
73
+ ### Enterprise Implementation Planning
74
+ ```
75
+ /sc:workflow enterprise-prd.md --strategy enterprise --validate
76
+ # Enterprise-scale workflow with comprehensive validation
77
+ # Security, devops, and architect personas for compliance and scalability
78
+ ```
79
+
80
+ ### Cross-Session Workflow Management
81
+ ```
82
+ /sc:workflow project-brief.md --depth normal
83
+ # Serena MCP manages cross-session workflow context and persistence
84
+ # Progressive workflow enhancement with memory-driven insights
85
+ ```
86
+
87
+ ## Boundaries
88
+
89
+ **Will:**
90
+ - Generate comprehensive implementation workflows from PRD and feature specifications
91
+ - Coordinate multiple personas and MCP servers for complete implementation strategies
92
+ - Provide cross-session workflow management and progressive enhancement capabilities
93
+
94
+ **Will Not:**
95
+ - Execute actual implementation tasks beyond workflow planning and strategy
96
+ - Override established development processes without proper analysis and validation
97
+ - Generate workflows without comprehensive requirement analysis and dependency mapping
package/package.json ADDED
@@ -0,0 +1,52 @@
1
+ {
2
+ "name": "superclaude-kiro",
3
+ "version": "1.0.0",
4
+ "description": "SuperClaude Framework for Kiro CLI - Easy installation for teams",
5
+ "type": "module",
6
+ "bin": {
7
+ "superclaude-kiro": "./bin/superclaude-kiro.js"
8
+ },
9
+ "main": "src/cli.js",
10
+ "scripts": {
11
+ "build": "node scripts/build.js",
12
+ "sync:claude": "node scripts/sync-from-claude.js",
13
+ "sync:github": "node scripts/sync-from-github.js",
14
+ "prepublishOnly": "npm run build"
15
+ },
16
+ "keywords": [
17
+ "superclaude",
18
+ "kiro",
19
+ "claude",
20
+ "ai",
21
+ "cli",
22
+ "development",
23
+ "productivity"
24
+ ],
25
+ "author": "Richardmbs12 <richardmbs3@gmail.com>",
26
+ "license": "MIT",
27
+ "repository": {
28
+ "type": "git",
29
+ "url": "https://github.com/The-SBG-A-Team/super-claude-for-kiro.git"
30
+ },
31
+ "homepage": "https://github.com/The-SBG-A-Team/super-claude-for-kiro#readme",
32
+ "bugs": {
33
+ "url": "https://github.com/The-SBG-A-Team/super-claude-for-kiro/issues"
34
+ },
35
+ "engines": {
36
+ "node": ">=18.0.0"
37
+ },
38
+ "dependencies": {
39
+ "commander": "^12.1.0",
40
+ "chalk": "^5.3.0",
41
+ "fs-extra": "^11.2.0",
42
+ "ora": "^8.1.0"
43
+ },
44
+ "files": [
45
+ "bin/",
46
+ "src/",
47
+ "dist/",
48
+ "templates/",
49
+ "README.md",
50
+ "LICENSE"
51
+ ]
52
+ }
package/src/cli.js ADDED
@@ -0,0 +1,23 @@
1
+ import { installSuperClaude, updateSuperClaude, uninstallSuperClaude, getStatus } from './installer.js';
2
+
3
+ export async function install(options) {
4
+ await installSuperClaude({
5
+ force: options.force || false,
6
+ mcp: options.mcp !== false,
7
+ default: options.default !== false
8
+ });
9
+ }
10
+
11
+ export async function update(options) {
12
+ await updateSuperClaude();
13
+ }
14
+
15
+ export async function uninstall(options) {
16
+ await uninstallSuperClaude({
17
+ skipConfirm: options.yes || false
18
+ });
19
+ }
20
+
21
+ export async function status(options) {
22
+ await getStatus();
23
+ }
@@ -0,0 +1,63 @@
1
+ import fs from 'fs-extra';
2
+ import path from 'path';
3
+
4
+ /**
5
+ * Convert a Claude Code command file to Kiro steering file format
6
+ * @param {string} src - Source file path
7
+ * @param {string} dst - Destination file path
8
+ */
9
+ export async function convertCommand(src, dst) {
10
+ const content = await fs.readFile(src, 'utf-8');
11
+ const filename = path.basename(src, '.md');
12
+
13
+ const kiroContent = `---
14
+ inclusion: manual
15
+ ---
16
+
17
+ # SuperClaude: ${filename}
18
+
19
+ > Converted from Claude Code SuperClaude framework
20
+ > Original: ~/.claude/commands/sc/${path.basename(src)}
21
+
22
+ ${stripFrontmatter(content)}`;
23
+
24
+ await fs.writeFile(dst, kiroContent);
25
+ }
26
+
27
+ /**
28
+ * Strip YAML frontmatter from markdown content
29
+ * @param {string} content - Markdown content with potential frontmatter
30
+ * @returns {string} Content without frontmatter
31
+ */
32
+ export function stripFrontmatter(content) {
33
+ // Match YAML frontmatter at the start of the file
34
+ const match = content.match(/^---\r?\n[\s\S]*?\r?\n---\r?\n([\s\S]*)$/);
35
+ return match ? match[1].trim() : content.trim();
36
+ }
37
+
38
+ /**
39
+ * Parse YAML frontmatter from markdown content
40
+ * @param {string} content - Markdown content with frontmatter
41
+ * @returns {Object} Parsed frontmatter object
42
+ */
43
+ export function parseFrontmatter(content) {
44
+ const match = content.match(/^---\r?\n([\s\S]*?)\r?\n---/);
45
+ if (!match) return {};
46
+
47
+ const yaml = match[1];
48
+ const result = {};
49
+
50
+ // Simple YAML parsing for key: value pairs
51
+ const lines = yaml.split('\n');
52
+ for (const line of lines) {
53
+ const colonIndex = line.indexOf(':');
54
+ if (colonIndex > 0) {
55
+ const key = line.slice(0, colonIndex).trim();
56
+ const value = line.slice(colonIndex + 1).trim();
57
+ // Remove quotes if present
58
+ result[key] = value.replace(/^["']|["']$/g, '');
59
+ }
60
+ }
61
+
62
+ return result;
63
+ }
@@ -0,0 +1,319 @@
1
+ import fs from 'fs-extra';
2
+ import path from 'path';
3
+ import os from 'os';
4
+ import chalk from 'chalk';
5
+ import ora from 'ora';
6
+ import { fileURLToPath } from 'url';
7
+ import { createRequire } from 'module';
8
+
9
+ const __filename = fileURLToPath(import.meta.url);
10
+ const __dirname = path.dirname(__filename);
11
+
12
+ const require = createRequire(import.meta.url);
13
+
14
+ const KIRO_DIR = path.join(os.homedir(), '.kiro');
15
+ const DIST_DIR = path.join(__dirname, '..', 'dist');
16
+
17
+ export async function installSuperClaude(options = {}) {
18
+ const spinner = ora('Installing SuperClaude for Kiro...').start();
19
+
20
+ try {
21
+ // 1. Verify Kiro CLI directory exists
22
+ if (!await fs.pathExists(KIRO_DIR)) {
23
+ spinner.fail(chalk.red('Kiro CLI not found.'));
24
+ console.log(chalk.yellow('\nPlease install Kiro CLI first:'));
25
+ console.log(chalk.cyan(' npm install -g @anthropic-ai/kiro-cli'));
26
+ console.log(chalk.yellow(' or visit: https://kiro.dev/docs/cli/'));
27
+ process.exit(1);
28
+ }
29
+
30
+ // 2. Check for existing installation
31
+ const steeringDir = path.join(KIRO_DIR, 'steering', 'superclaude');
32
+ if (await fs.pathExists(steeringDir) && !options.force) {
33
+ spinner.fail(chalk.red('SuperClaude already installed.'));
34
+ console.log(chalk.yellow('\nTo overwrite, run:'));
35
+ console.log(chalk.cyan(' npx superclaude-kiro install --force'));
36
+ process.exit(1);
37
+ }
38
+
39
+ // 3. Verify dist directory exists
40
+ if (!await fs.pathExists(DIST_DIR)) {
41
+ spinner.fail(chalk.red('Distribution files not found.'));
42
+ console.log(chalk.yellow('\nPackage may be corrupted. Try reinstalling:'));
43
+ console.log(chalk.cyan(' npm cache clean --force'));
44
+ console.log(chalk.cyan(' npx superclaude-kiro@latest install'));
45
+ process.exit(1);
46
+ }
47
+
48
+ // 4. Create directories
49
+ spinner.text = 'Creating directories...';
50
+ await fs.ensureDir(path.join(KIRO_DIR, 'steering', 'superclaude'));
51
+ await fs.ensureDir(path.join(KIRO_DIR, 'agents'));
52
+ await fs.ensureDir(path.join(KIRO_DIR, 'settings'));
53
+ await fs.ensureDir(path.join(KIRO_DIR, 'docs'));
54
+
55
+ // 5. Copy steering files
56
+ spinner.text = 'Installing steering files...';
57
+ const steeringSrc = path.join(DIST_DIR, 'steering', 'superclaude');
58
+ if (await fs.pathExists(steeringSrc)) {
59
+ await fs.copy(steeringSrc, path.join(KIRO_DIR, 'steering', 'superclaude'));
60
+ }
61
+
62
+ // 6. Copy agents
63
+ spinner.text = 'Installing agents...';
64
+ const agentsSrc = path.join(DIST_DIR, 'agents');
65
+ if (await fs.pathExists(agentsSrc)) {
66
+ const agents = await fs.readdir(agentsSrc);
67
+ for (const agent of agents) {
68
+ if (agent.endsWith('.json')) {
69
+ await fs.copy(
70
+ path.join(agentsSrc, agent),
71
+ path.join(KIRO_DIR, 'agents', agent)
72
+ );
73
+ }
74
+ }
75
+ }
76
+
77
+ // 7. Configure MCP servers (optional)
78
+ if (options.mcp !== false) {
79
+ spinner.text = 'Configuring MCP servers...';
80
+ await configureMcpServers();
81
+ }
82
+
83
+ // 8. Set default agent (optional)
84
+ if (options.default !== false) {
85
+ spinner.text = 'Setting default agent...';
86
+ await setDefaultAgent();
87
+ }
88
+
89
+ // 9. Create version file
90
+ spinner.text = 'Finalizing installation...';
91
+ const pkg = require('../package.json');
92
+ await fs.writeJson(
93
+ path.join(KIRO_DIR, 'docs', 'superclaude-version.json'),
94
+ {
95
+ version: pkg.version,
96
+ installedAt: new Date().toISOString(),
97
+ source: 'npm:superclaude-kiro'
98
+ },
99
+ { spaces: 2 }
100
+ );
101
+
102
+ // Count installed files
103
+ const steeringFiles = await countFiles(path.join(KIRO_DIR, 'steering', 'superclaude'), '.md');
104
+ const agentFiles = await countFiles(path.join(KIRO_DIR, 'agents'), '.json', 'sc-');
105
+
106
+ spinner.succeed(chalk.green('SuperClaude installed successfully!'));
107
+
108
+ console.log('');
109
+ console.log(chalk.gray(' Installed:'));
110
+ console.log(chalk.gray(` - ${steeringFiles} steering files`));
111
+ console.log(chalk.gray(` - ${agentFiles + 1} agents`));
112
+ console.log('');
113
+ console.log(chalk.cyan('Quick Start:'));
114
+ console.log(' 1. Run: ' + chalk.yellow('kiro-cli chat'));
115
+ console.log(' 2. Try: ' + chalk.yellow('#sc-help'));
116
+ console.log('');
117
+
118
+ } catch (error) {
119
+ spinner.fail(chalk.red('Installation failed: ' + error.message));
120
+ process.exit(1);
121
+ }
122
+ }
123
+
124
+ export async function updateSuperClaude() {
125
+ const spinner = ora('Checking for updates...').start();
126
+
127
+ try {
128
+ // Check if installed
129
+ const versionFile = path.join(KIRO_DIR, 'docs', 'superclaude-version.json');
130
+ if (!await fs.pathExists(versionFile)) {
131
+ spinner.fail(chalk.red('SuperClaude is not installed.'));
132
+ console.log(chalk.yellow('\nTo install, run:'));
133
+ console.log(chalk.cyan(' npx superclaude-kiro install'));
134
+ process.exit(1);
135
+ }
136
+
137
+ spinner.text = 'Updating SuperClaude...';
138
+
139
+ // Perform fresh install with force
140
+ await installSuperClaude({ force: true, mcp: true, default: true });
141
+
142
+ } catch (error) {
143
+ spinner.fail(chalk.red('Update failed: ' + error.message));
144
+ process.exit(1);
145
+ }
146
+ }
147
+
148
+ export async function uninstallSuperClaude(options = {}) {
149
+ const spinner = ora('Uninstalling SuperClaude...').start();
150
+
151
+ try {
152
+ // Check if installed
153
+ const steeringDir = path.join(KIRO_DIR, 'steering', 'superclaude');
154
+ if (!await fs.pathExists(steeringDir)) {
155
+ spinner.fail(chalk.red('SuperClaude is not installed.'));
156
+ process.exit(1);
157
+ }
158
+
159
+ // Remove steering files
160
+ spinner.text = 'Removing steering files...';
161
+ await fs.remove(steeringDir);
162
+
163
+ // Remove agents
164
+ spinner.text = 'Removing agents...';
165
+ const agents = ['superclaude.json', 'sc-pm.json', 'sc-implement.json', 'sc-analyze.json'];
166
+ for (const agent of agents) {
167
+ const agentPath = path.join(KIRO_DIR, 'agents', agent);
168
+ if (await fs.pathExists(agentPath)) {
169
+ await fs.remove(agentPath);
170
+ }
171
+ }
172
+
173
+ // Remove version file
174
+ spinner.text = 'Cleaning up...';
175
+ await fs.remove(path.join(KIRO_DIR, 'docs', 'superclaude-version.json'));
176
+
177
+ // Reset default agent if it was superclaude
178
+ const cliSettingsPath = path.join(KIRO_DIR, 'settings', 'cli.json');
179
+ if (await fs.pathExists(cliSettingsPath)) {
180
+ const settings = await fs.readJson(cliSettingsPath);
181
+ if (settings['chat.defaultAgent'] === 'superclaude') {
182
+ delete settings['chat.defaultAgent'];
183
+ await fs.writeJson(cliSettingsPath, settings, { spaces: 2 });
184
+ }
185
+ }
186
+
187
+ spinner.succeed(chalk.green('SuperClaude uninstalled successfully!'));
188
+ console.log('');
189
+ console.log(chalk.gray(' Note: MCP server configurations were preserved.'));
190
+ console.log('');
191
+
192
+ } catch (error) {
193
+ spinner.fail(chalk.red('Uninstall failed: ' + error.message));
194
+ process.exit(1);
195
+ }
196
+ }
197
+
198
+ export async function getStatus() {
199
+ console.log('');
200
+ console.log(chalk.bold(' SuperClaude for Kiro'));
201
+ console.log(chalk.gray(' ' + '─'.repeat(30)));
202
+
203
+ // Check Kiro CLI
204
+ if (!await fs.pathExists(KIRO_DIR)) {
205
+ console.log(chalk.red(' Status: Not installed (Kiro CLI missing)'));
206
+ console.log('');
207
+ return;
208
+ }
209
+
210
+ // Check installation
211
+ const versionFile = path.join(KIRO_DIR, 'docs', 'superclaude-version.json');
212
+ const steeringDir = path.join(KIRO_DIR, 'steering', 'superclaude');
213
+
214
+ if (!await fs.pathExists(versionFile) || !await fs.pathExists(steeringDir)) {
215
+ console.log(chalk.yellow(' Status: Not installed'));
216
+ console.log('');
217
+ console.log(chalk.gray(' To install:'));
218
+ console.log(chalk.cyan(' npx superclaude-kiro install'));
219
+ console.log('');
220
+ return;
221
+ }
222
+
223
+ // Read version info
224
+ const versionInfo = await fs.readJson(versionFile);
225
+ const installedDate = new Date(versionInfo.installedAt).toLocaleDateString();
226
+
227
+ console.log(chalk.green(' Status: Installed'));
228
+ console.log(chalk.white(` Version: ${versionInfo.version}`));
229
+ console.log(chalk.gray(` Installed: ${installedDate}`));
230
+ console.log('');
231
+
232
+ // Count components
233
+ const steeringFiles = await countFiles(steeringDir, '.md');
234
+ const agentFiles = await countFiles(path.join(KIRO_DIR, 'agents'), '.json', 'sc-');
235
+
236
+ console.log(chalk.gray(' Components:'));
237
+ console.log(chalk.green(` ✔ Steering files (${steeringFiles})`));
238
+ console.log(chalk.green(` ✔ Agents (${agentFiles + 1})`));
239
+
240
+ // Check MCP
241
+ const mcpPath = path.join(KIRO_DIR, 'settings', 'mcp.json');
242
+ if (await fs.pathExists(mcpPath)) {
243
+ const mcpConfig = await fs.readJson(mcpPath);
244
+ const mcpCount = Object.keys(mcpConfig.mcpServers || {}).length;
245
+ console.log(chalk.green(` ✔ MCP servers (${mcpCount})`));
246
+ } else {
247
+ console.log(chalk.yellow(' ○ MCP servers (not configured)'));
248
+ }
249
+
250
+ // Check default agent
251
+ const cliSettingsPath = path.join(KIRO_DIR, 'settings', 'cli.json');
252
+ if (await fs.pathExists(cliSettingsPath)) {
253
+ const settings = await fs.readJson(cliSettingsPath);
254
+ if (settings['chat.defaultAgent'] === 'superclaude') {
255
+ console.log(chalk.green(' ✔ Default agent: superclaude'));
256
+ } else {
257
+ console.log(chalk.yellow(` ○ Default agent: ${settings['chat.defaultAgent'] || 'none'}`));
258
+ }
259
+ }
260
+
261
+ console.log('');
262
+ }
263
+
264
+ // Helper functions
265
+
266
+ async function configureMcpServers() {
267
+ const mcpPath = path.join(KIRO_DIR, 'settings', 'mcp.json');
268
+ const templatePath = path.join(DIST_DIR, 'mcp', 'mcp-servers.json');
269
+
270
+ let existingConfig = { mcpServers: {} };
271
+ if (await fs.pathExists(mcpPath)) {
272
+ existingConfig = await fs.readJson(mcpPath);
273
+ }
274
+
275
+ let newServers = { mcpServers: {} };
276
+ if (await fs.pathExists(templatePath)) {
277
+ newServers = await fs.readJson(templatePath);
278
+ }
279
+
280
+ // Merge MCP servers (existing takes precedence to preserve user customizations)
281
+ const mergedConfig = {
282
+ mcpServers: {
283
+ ...newServers.mcpServers,
284
+ ...existingConfig.mcpServers
285
+ }
286
+ };
287
+
288
+ await fs.ensureDir(path.join(KIRO_DIR, 'settings'));
289
+ await fs.writeJson(mcpPath, mergedConfig, { spaces: 2 });
290
+ }
291
+
292
+ async function setDefaultAgent() {
293
+ const cliSettingsPath = path.join(KIRO_DIR, 'settings', 'cli.json');
294
+
295
+ let settings = {};
296
+ if (await fs.pathExists(cliSettingsPath)) {
297
+ settings = await fs.readJson(cliSettingsPath);
298
+ }
299
+
300
+ settings['chat.defaultAgent'] = 'superclaude';
301
+ settings['chat.model'] = settings['chat.model'] || 'claude-sonnet-4.5';
302
+ settings['chat.enableThinking'] = settings['chat.enableThinking'] !== false;
303
+ settings['chat.enableTodoList'] = settings['chat.enableTodoList'] !== false;
304
+ settings['chat.enableDelegate'] = settings['chat.enableDelegate'] !== false;
305
+
306
+ await fs.ensureDir(path.join(KIRO_DIR, 'settings'));
307
+ await fs.writeJson(cliSettingsPath, settings, { spaces: 2 });
308
+ }
309
+
310
+ async function countFiles(dir, extension, prefix = '') {
311
+ if (!await fs.pathExists(dir)) return 0;
312
+
313
+ const files = await fs.readdir(dir);
314
+ return files.filter(f => {
315
+ const matchesExt = f.endsWith(extension);
316
+ const matchesPrefix = prefix ? f.startsWith(prefix) : true;
317
+ return matchesExt && matchesPrefix;
318
+ }).length;
319
+ }