@supercorks/skills-installer 1.9.0 → 1.10.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 (2) hide show
  1. package/bin/install.js +18 -10
  2. package/package.json +1 -1
package/bin/install.js CHANGED
@@ -50,6 +50,10 @@ function resolveInstallPath(path) {
50
50
  return resolve(process.cwd(), path);
51
51
  }
52
52
 
53
+ function isHomePath(path) {
54
+ return path === '~' || path.startsWith('~/');
55
+ }
56
+
53
57
  /**
54
58
  * Detect existing skill installations in common paths
55
59
  * @returns {Promise<Array<{path: string, skillCount: number, skills: string[]}>>}
@@ -235,6 +239,8 @@ async function runSkillsInstall() {
235
239
  async function runSkillsInstallForTarget(skills, existingInstalls, target) {
236
240
  const { path: installPath, isExisting } = target;
237
241
  const absoluteInstallPath = resolveInstallPath(installPath);
242
+ const gitDir = join(absoluteInstallPath, '.git');
243
+ const hasExistingRepo = existsSync(gitDir);
238
244
 
239
245
  // Get currently installed skills if managing existing installation
240
246
  let installedSkills = [];
@@ -243,17 +249,17 @@ async function runSkillsInstallForTarget(skills, existingInstalls, target) {
243
249
  installedSkills = existingInstall?.skills || [];
244
250
  } else {
245
251
  // Check if manually entered path has an existing installation
246
- const gitDir = join(absoluteInstallPath, '.git');
247
- if (existsSync(gitDir)) {
252
+ if (hasExistingRepo) {
248
253
  try {
249
254
  installedSkills = await listCheckedOutSkills(absoluteInstallPath);
250
255
  } catch {
251
- // If we can't read it, treat as fresh install
256
+ // If repo exists but sparse-checkout can't be read, still treat as manage mode.
257
+ // Prompt will default to selecting all skills.
252
258
  }
253
259
  }
254
260
  }
255
261
 
256
- const isManageMode = installedSkills.length > 0;
262
+ const isManageMode = isExisting || hasExistingRepo || installedSkills.length > 0;
257
263
 
258
264
  // Check for updates if in manage mode
259
265
  let skillsNeedingUpdate = new Set();
@@ -274,7 +280,7 @@ async function runSkillsInstallForTarget(skills, existingInstalls, target) {
274
280
  // Ask about .gitignore (only for fresh installs and if not already in .gitignore)
275
281
  let shouldGitignore = false;
276
282
  const gitignorePath = resolveInstallPath('.gitignore');
277
- if (!isManageMode && !isInGitignore(gitignorePath, installPath)) {
283
+ if (!isManageMode && !isHomePath(installPath) && !isInGitignore(gitignorePath, installPath)) {
278
284
  shouldGitignore = await promptGitignore(installPath);
279
285
  }
280
286
 
@@ -387,6 +393,8 @@ async function runSubagentsInstall() {
387
393
  async function runSubagentsInstallForTarget(subagents, existingInstalls, target) {
388
394
  const { path: installPath, isExisting } = target;
389
395
  const absoluteInstallPath = resolveInstallPath(installPath);
396
+ const gitDir = join(absoluteInstallPath, '.git');
397
+ const hasExistingRepo = existsSync(gitDir);
390
398
 
391
399
  // Get currently installed subagents if managing existing installation
392
400
  let installedAgents = [];
@@ -395,17 +403,17 @@ async function runSubagentsInstallForTarget(subagents, existingInstalls, target)
395
403
  installedAgents = existingInstall?.agents || [];
396
404
  } else {
397
405
  // Check if manually entered path has an existing installation
398
- const gitDir = join(absoluteInstallPath, '.git');
399
- if (existsSync(gitDir)) {
406
+ if (hasExistingRepo) {
400
407
  try {
401
408
  installedAgents = await listCheckedOutSubagents(absoluteInstallPath);
402
409
  } catch {
403
- // If we can't read it, treat as fresh install
410
+ // If repo exists but sparse-checkout can't be read, still treat as manage mode.
411
+ // Prompt will default to selecting all subagents.
404
412
  }
405
413
  }
406
414
  }
407
415
 
408
- const isManageMode = installedAgents.length > 0;
416
+ const isManageMode = isExisting || hasExistingRepo || installedAgents.length > 0;
409
417
 
410
418
  // Check for updates if in manage mode
411
419
  let subagentsNeedingUpdate = new Set();
@@ -426,7 +434,7 @@ async function runSubagentsInstallForTarget(subagents, existingInstalls, target)
426
434
  // Ask about .gitignore (only for fresh installs and if not already in .gitignore)
427
435
  let shouldGitignore = false;
428
436
  const gitignorePath = resolveInstallPath('.gitignore');
429
- if (!isManageMode && !isInGitignore(gitignorePath, installPath)) {
437
+ if (!isManageMode && !isHomePath(installPath) && !isInGitignore(gitignorePath, installPath)) {
430
438
  shouldGitignore = await promptGitignore(installPath);
431
439
  }
432
440
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supercorks/skills-installer",
3
- "version": "1.9.0",
3
+ "version": "1.10.0",
4
4
  "description": "Interactive CLI installer for AI agent skills and subagents",
5
5
  "type": "module",
6
6
  "bin": {