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.
- package/LICENSE +21 -0
- package/README.md +190 -0
- package/bin/superclaude-kiro.js +38 -0
- package/dist/agents/sc-analyze.json +18 -0
- package/dist/agents/sc-implement.json +18 -0
- package/dist/agents/sc-pm.json +18 -0
- package/dist/agents/superclaude.json +18 -0
- package/dist/mcp/mcp-servers.json +44 -0
- package/dist/steering/superclaude/sc-agent.md +80 -0
- package/dist/steering/superclaude/sc-analyze.md +89 -0
- package/dist/steering/superclaude/sc-brainstorm.md +100 -0
- package/dist/steering/superclaude/sc-build.md +94 -0
- package/dist/steering/superclaude/sc-business-panel.md +90 -0
- package/dist/steering/superclaude/sc-cleanup.md +93 -0
- package/dist/steering/superclaude/sc-design.md +88 -0
- package/dist/steering/superclaude/sc-document.md +88 -0
- package/dist/steering/superclaude/sc-estimate.md +86 -0
- package/dist/steering/superclaude/sc-explain.md +92 -0
- package/dist/steering/superclaude/sc-git.md +80 -0
- package/dist/steering/superclaude/sc-help.md +148 -0
- package/dist/steering/superclaude/sc-implement.md +97 -0
- package/dist/steering/superclaude/sc-improve.md +93 -0
- package/dist/steering/superclaude/sc-index-repo.md +169 -0
- package/dist/steering/superclaude/sc-index.md +86 -0
- package/dist/steering/superclaude/sc-load.md +93 -0
- package/dist/steering/superclaude/sc-pm.md +592 -0
- package/dist/steering/superclaude/sc-recommend.md +1008 -0
- package/dist/steering/superclaude/sc-reflect.md +87 -0
- package/dist/steering/superclaude/sc-research.md +103 -0
- package/dist/steering/superclaude/sc-save.md +93 -0
- package/dist/steering/superclaude/sc-sc.md +134 -0
- package/dist/steering/superclaude/sc-select-tool.md +86 -0
- package/dist/steering/superclaude/sc-spawn.md +85 -0
- package/dist/steering/superclaude/sc-spec-panel.md +428 -0
- package/dist/steering/superclaude/sc-task.md +89 -0
- package/dist/steering/superclaude/sc-test.md +93 -0
- package/dist/steering/superclaude/sc-troubleshoot.md +88 -0
- package/dist/steering/superclaude/sc-workflow.md +97 -0
- package/package.json +52 -0
- package/src/cli.js +23 -0
- package/src/converter.js +63 -0
- package/src/installer.js +319 -0
- package/src/utils.js +105 -0
- package/templates/cli-settings.json +7 -0
package/src/utils.js
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import fs from 'fs-extra';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import os from 'os';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Get the Kiro CLI directory path
|
|
7
|
+
* @returns {string} Path to ~/.kiro
|
|
8
|
+
*/
|
|
9
|
+
export function getKiroDir() {
|
|
10
|
+
return path.join(os.homedir(), '.kiro');
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Get the Claude Code directory path
|
|
15
|
+
* @returns {string} Path to ~/.claude
|
|
16
|
+
*/
|
|
17
|
+
export function getClaudeDir() {
|
|
18
|
+
return path.join(os.homedir(), '.claude');
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Check if Kiro CLI is installed
|
|
23
|
+
* @returns {Promise<boolean>}
|
|
24
|
+
*/
|
|
25
|
+
export async function isKiroInstalled() {
|
|
26
|
+
return await fs.pathExists(getKiroDir());
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Check if SuperClaude is installed in Kiro
|
|
31
|
+
* @returns {Promise<boolean>}
|
|
32
|
+
*/
|
|
33
|
+
export async function isSuperClaudeInstalled() {
|
|
34
|
+
const versionFile = path.join(getKiroDir(), 'docs', 'superclaude-version.json');
|
|
35
|
+
const steeringDir = path.join(getKiroDir(), 'steering', 'superclaude');
|
|
36
|
+
return await fs.pathExists(versionFile) && await fs.pathExists(steeringDir);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Get installed SuperClaude version
|
|
41
|
+
* @returns {Promise<string|null>} Version string or null if not installed
|
|
42
|
+
*/
|
|
43
|
+
export async function getInstalledVersion() {
|
|
44
|
+
const versionFile = path.join(getKiroDir(), 'docs', 'superclaude-version.json');
|
|
45
|
+
if (!await fs.pathExists(versionFile)) return null;
|
|
46
|
+
|
|
47
|
+
const info = await fs.readJson(versionFile);
|
|
48
|
+
return info.version;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Ensure a directory exists
|
|
53
|
+
* @param {string} dirPath - Directory path to ensure
|
|
54
|
+
*/
|
|
55
|
+
export async function ensureDir(dirPath) {
|
|
56
|
+
await fs.ensureDir(dirPath);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Copy files matching a pattern from source to destination
|
|
61
|
+
* @param {string} srcDir - Source directory
|
|
62
|
+
* @param {string} dstDir - Destination directory
|
|
63
|
+
* @param {string} extension - File extension to match (e.g., '.md')
|
|
64
|
+
* @returns {Promise<number>} Number of files copied
|
|
65
|
+
*/
|
|
66
|
+
export async function copyMatchingFiles(srcDir, dstDir, extension) {
|
|
67
|
+
if (!await fs.pathExists(srcDir)) return 0;
|
|
68
|
+
|
|
69
|
+
await fs.ensureDir(dstDir);
|
|
70
|
+
|
|
71
|
+
const files = await fs.readdir(srcDir);
|
|
72
|
+
let count = 0;
|
|
73
|
+
|
|
74
|
+
for (const file of files) {
|
|
75
|
+
if (file.endsWith(extension)) {
|
|
76
|
+
await fs.copy(
|
|
77
|
+
path.join(srcDir, file),
|
|
78
|
+
path.join(dstDir, file)
|
|
79
|
+
);
|
|
80
|
+
count++;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return count;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Deep merge two objects
|
|
89
|
+
* @param {Object} target - Target object
|
|
90
|
+
* @param {Object} source - Source object
|
|
91
|
+
* @returns {Object} Merged object
|
|
92
|
+
*/
|
|
93
|
+
export function deepMerge(target, source) {
|
|
94
|
+
const result = { ...target };
|
|
95
|
+
|
|
96
|
+
for (const key in source) {
|
|
97
|
+
if (source[key] && typeof source[key] === 'object' && !Array.isArray(source[key])) {
|
|
98
|
+
result[key] = deepMerge(result[key] || {}, source[key]);
|
|
99
|
+
} else {
|
|
100
|
+
result[key] = source[key];
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
return result;
|
|
105
|
+
}
|