joyskills-cli 0.2.8 → 0.2.10

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": "joyskills-cli",
3
- "version": "0.2.8",
3
+ "version": "0.2.10",
4
4
  "description": "Team-level skill governance compatible with open skill / Claude Skills",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -206,29 +206,26 @@ async function tryInstallFromRegistryDir(skillName, registryDirPath, targetDir,
206
206
  return false;
207
207
  }
208
208
  } else {
209
- // No registry.yaml: scan skill directories directly
210
- const skillPath = path.join(registryDirPath, skillName);
211
- if (fs.existsSync(path.join(skillPath, 'SKILL.md'))) {
212
- const targetPath = path.join(targetDir, skillName);
213
- copyRecursive(skillPath, targetPath);
214
-
215
- const content = fs.readFileSync(path.join(skillPath, 'SKILL.md'), 'utf-8');
216
- const versionMatch = content.match(/version:\s*(.+)/);
217
- const version = versionMatch?.[1]?.trim() || '1.0.0';
209
+ // No registry.yaml: scan skill directories recursively
210
+ const skills = await findSkills(registryDirPath);
211
+ const skill = skills.find(s => s.name === skillName);
212
+
213
+ if (!skill) return false;
214
+
215
+ const targetPath = path.join(targetDir, skillName);
216
+ copyRecursive(skill.path, targetPath);
218
217
 
219
- const lockfileManager = new LockfileManager(projectRoot);
220
- await lockfileManager.load();
221
- lockfileManager.updateSkill(skillName, {
222
- version,
223
- source: sourceLabel,
224
- installedAt: new Date().toISOString()
225
- });
226
- await lockfileManager.save();
218
+ const lockfileManager = new LockfileManager(projectRoot);
219
+ await lockfileManager.load();
220
+ lockfileManager.updateSkill(skillName, {
221
+ version: skill.version || '1.0.0',
222
+ source: sourceLabel,
223
+ installedAt: new Date().toISOString()
224
+ });
225
+ await lockfileManager.save();
227
226
 
228
- console.log(chalk.green(`✅ Installed ${skillName} v${version} from ${sourceLabel}`));
229
- return true;
230
- }
231
- return false;
227
+ console.log(chalk.green(`✅ Installed ${skillName} v${skill.version || '1.0.0'} from ${sourceLabel}`));
228
+ return true;
232
229
  }
233
230
  }
234
231
 
@@ -380,6 +377,14 @@ async function installFromGitUrl(gitUrl, targetDir, options) {
380
377
  console.log(chalk.green(' ✓ Repository cloned'));
381
378
  } else {
382
379
  console.log(chalk.gray(' Using cached repository'));
380
+ // Try to update cache
381
+ try {
382
+ const git = simpleGit(cachePath);
383
+ await git.pull('origin', 'main', ['--depth', '1']);
384
+ console.log(chalk.gray(' ✓ Cache updated'));
385
+ } catch (e) {
386
+ // Ignore update errors, use cached version
387
+ }
383
388
  }
384
389
 
385
390
  const skills = await findSkills(cachePath);
@@ -442,6 +447,14 @@ async function installFromGitHub(owner, repo, skillPath, targetDir, options) {
442
447
  console.log(chalk.green(' ✓ Repository cloned'));
443
448
  } else {
444
449
  console.log(chalk.gray(' Using cached repository'));
450
+ // Try to update cache
451
+ try {
452
+ const git = simpleGit(cachePath);
453
+ await git.pull('origin', 'main', ['--depth', '1']);
454
+ console.log(chalk.gray(' ✓ Cache updated'));
455
+ } catch (e) {
456
+ // Ignore update errors, use cached version
457
+ }
445
458
  }
446
459
 
447
460
  // Find skills in the repo
@@ -23,7 +23,8 @@ export function removeCommand(program) {
23
23
  program
24
24
  .command('remove <skill>')
25
25
  .description('Remove a skill')
26
- .action(async (skillName) => {
26
+ .option('-y, --yes', 'Skip confirmation prompt')
27
+ .action(async (skillName, options) => {
27
28
  const projectRoot = process.cwd();
28
29
  const lockfileManager = new LockfileManager(projectRoot);
29
30
 
@@ -269,9 +269,12 @@ async function upgradeFromGitHub(skill, skillsDir) {
269
269
  const git = simpleGit(cachePath);
270
270
  await git.pull();
271
271
 
272
- // Find skill in cache
273
- const skillSourcePath = path.join(cachePath, skill.name);
274
- if (!fs.existsSync(skillSourcePath)) {
272
+ // Find skill in cache (support nested directories)
273
+ const { findSkills } = await import('../commands/install.js');
274
+ const skills = await findSkills(cachePath);
275
+ const skillInfo = skills.find(s => s.name === skill.name);
276
+
277
+ if (!skillInfo) {
275
278
  throw new Error(`Skill not found in repository: ${skill.name}`);
276
279
  }
277
280
 
@@ -282,7 +285,7 @@ async function upgradeFromGitHub(skill, skillsDir) {
282
285
  }
283
286
 
284
287
  // Copy new version
285
- copyRecursive(skillSourcePath, targetPath);
288
+ copyRecursive(skillInfo.path, targetPath);
286
289
  }
287
290
 
288
291
  async function upgradeFromRegistry(skill, skillsDir) {