@dealdeploy/skl 1.1.0 → 1.1.1

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/index.ts +14 -36
  2. package/package.json +1 -1
package/index.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env bun
2
2
 
3
3
  import { createCliRenderer } from "@opentui/core";
4
- import { existsSync, rmSync, cpSync, mkdirSync, readdirSync } from "fs";
4
+ import { existsSync, rmSync, mkdirSync, readdirSync, statSync } from "fs";
5
5
  import { join } from "path";
6
6
  import { homedir } from "os";
7
- import { getCatalogSkills, removeFromLock, catalogDir, buildAddArgs, parseSkillsListOutput } from "./lib.ts";
7
+ import { getCatalogSkills, removeFromLock, catalogDir, buildAddArgs } from "./lib.ts";
8
8
  import { createTui, type ColId } from "./tui.ts";
9
9
 
10
10
  // @ts-ignore - bun supports JSON imports
@@ -44,47 +44,25 @@ if (arg === "update") {
44
44
 
45
45
  try {
46
46
 
47
- // ── Migration: ~/dotfiles/skills → ~/.skl/catalog ───────────────────
48
- const OLD_LIBRARY = join(homedir(), "dotfiles/skills");
49
47
  const CATALOG = catalogDir();
50
-
51
- if (!existsSync(CATALOG) && existsSync(OLD_LIBRARY)) {
52
- console.log("Migrating skills from ~/dotfiles/skills to ~/.skl/catalog...");
53
- mkdirSync(CATALOG, { recursive: true });
54
- for (const name of readdirSync(OLD_LIBRARY)) {
55
- const src = join(OLD_LIBRARY, name);
56
- const dest = join(CATALOG, name);
57
- try {
58
- cpSync(src, dest, { recursive: true });
59
- console.log(` ${name}`);
60
- } catch {}
61
- }
62
- console.log("Done. You can remove ~/dotfiles/skills when ready.\n");
63
- }
64
-
65
48
  mkdirSync(CATALOG, { recursive: true });
66
49
 
67
- // ── Load installed state from skills CLI ─────────────────────────────
50
+ // ── Read installed skills directly from filesystem ──────────────────
68
51
 
69
- async function listInstalled(global: boolean): Promise<Set<string>> {
70
- const args = ["npx", "-y", "skills", "list", "--json"];
71
- if (global) args.push("-g");
52
+ function readInstalledSkills(dir: string): Set<string> {
72
53
  try {
73
- const proc = Bun.spawn(args, { stdout: "pipe", stderr: "pipe" });
74
- const out = await new Response(proc.stdout).text();
75
- const code = await proc.exited;
76
- if (code !== 0) return new Set();
77
- return new Set(parseSkillsListOutput(out.trim()));
78
- } catch {}
79
- return new Set();
54
+ return new Set(
55
+ readdirSync(dir).filter((name) => {
56
+ try { return statSync(join(dir, name)).isDirectory(); } catch { return false; }
57
+ })
58
+ );
59
+ } catch {
60
+ return new Set();
61
+ }
80
62
  }
81
63
 
82
- process.stdout.write("Loading installed skills...");
83
- const [globalInstalled, localInstalled] = await Promise.all([
84
- listInstalled(true),
85
- listInstalled(false),
86
- ]);
87
- console.log(" done");
64
+ const globalInstalled = readInstalledSkills(join(homedir(), ".claude/skills"));
65
+ const localInstalled = readInstalledSkills(join(process.cwd(), ".claude/skills"));
88
66
 
89
67
  // ── Create TUI ──────────────────────────────────────────────────────
90
68
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dealdeploy/skl",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "TUI skill manager for Claude Code agents",
5
5
  "module": "index.ts",
6
6
  "bin": {