cskit-cli 1.0.5 → 1.0.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cskit-cli",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "Content Suite Kit CLI - Download and manage CSK skills from private repository",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -124,42 +124,25 @@ async function setupPythonEnv(projectDir, spinner) {
124
124
  }
125
125
 
126
126
  /**
127
- * Setup CSK in Claude Code directories
127
+ * Remap source paths to .claude/ destinations
128
+ * Downloads directly to Claude Code directories
128
129
  */
129
- async function setupCommands(projectDir, spinner) {
130
- spinner.start('Setting up CSK for Claude Code...');
131
-
132
- try {
133
- const claudeDir = path.join(projectDir, '.claude');
134
- ensureDir(claudeDir);
135
-
136
- // Map: source → destination
137
- const mappings = [
138
- { src: 'src/commands', dest: '.claude/commands' },
139
- { src: 'core', dest: '.claude/skills/csk/core' },
140
- { src: 'domains', dest: '.claude/skills/csk/domains' },
141
- { src: 'industries', dest: '.claude/skills/csk/industries' },
142
- { src: 'lib', dest: '.claude/skills/csk/lib' }
143
- ];
144
-
145
- let copied = 0;
146
- for (const { src, dest } of mappings) {
147
- const srcPath = path.join(projectDir, src);
148
- const destPath = path.join(projectDir, dest);
149
-
150
- if (fs.existsSync(srcPath)) {
151
- ensureDir(destPath);
152
- copyDirRecursive(srcPath, destPath);
153
- copied++;
154
- }
130
+ function remapPath(filePath) {
131
+ const mappings = [
132
+ { from: 'src/commands/', to: '.claude/commands/' },
133
+ { from: 'core/', to: '.claude/skills/csk/core/' },
134
+ { from: 'domains/', to: '.claude/skills/csk/domains/' },
135
+ { from: 'industries/', to: '.claude/skills/csk/industries/' }
136
+ ];
137
+
138
+ for (const { from, to } of mappings) {
139
+ if (filePath.startsWith(from)) {
140
+ return filePath.replace(from, to);
155
141
  }
156
-
157
- spinner.succeed(`CSK installed to .claude/ (${copied} modules)`);
158
- return { success: true };
159
- } catch (error) {
160
- spinner.warn(`CSK setup failed: ${error.message}`);
161
- return { success: false, error: error.message };
162
142
  }
143
+
144
+ // Keep other files as-is (lib/, cli/, config/, etc.)
145
+ return filePath;
163
146
  }
164
147
 
165
148
  /**
@@ -277,8 +260,8 @@ async function initCommand(options) {
277
260
 
278
261
  for (let i = 0; i < files.length; i++) {
279
262
  const file = files[i];
280
- const targetPath = path.join(projectDir, file.path);
281
- const relativePath = file.path;
263
+ const relativePath = remapPath(file.path);
264
+ const targetPath = path.join(projectDir, relativePath);
282
265
 
283
266
  // Update progress bar
284
267
  process.stdout.write(`\r ${progressBar(i + 1, files.length)} ${chalk.dim(`(${i + 1}/${files.length})`)}`);
@@ -339,8 +322,8 @@ async function initCommand(options) {
339
322
  console.log('');
340
323
  const pythonResult = await setupPythonEnv(projectDir, spinner);
341
324
 
342
- // Copy commands to .claude/commands/
343
- await setupCommands(projectDir, spinner);
325
+ // CSK files already downloaded to .claude/ (no copy needed)
326
+ spinner.succeed('CSK installed to .claude/');
344
327
 
345
328
  // Success message
346
329
  const ver = selectedVersion.replace(/^v/, '');