@lythos/skill-deck 0.9.29 → 0.9.31

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/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
  This package exposes a **CLI**. Invoke via:
10
10
 
11
11
  ```bash
12
- bunx @lythos/skill-deck@0.9.29 <command> [options]
12
+ bunx @lythos/skill-deck@0.9.31 <command> [options]
13
13
  ```
14
14
 
15
15
  No installation required. `bunx` auto-downloads the package.
@@ -55,14 +55,14 @@ prompt = "Search for latest info, then generate professional document with diagr
55
55
 
56
56
  | Situation | Command |
57
57
  |-----------|---------|
58
- | Sync working set with `skill-deck.toml` | `bunx @lythos/skill-deck@0.9.29 link` |
59
- | Validate `skill-deck.toml` before committing | `bunx @lythos/skill-deck@0.9.29 validate` |
60
- | Download a skill to cold pool and add to deck | `bunx @lythos/skill-deck@0.9.29 add owner/repo` |
61
- | Pull latest versions of declared skills | `bunx @lythos/skill-deck@0.9.29 refresh` |
62
- | Refresh a single skill by alias | `bunx @lythos/skill-deck@0.9.29 refresh tdd` |
63
- | Remove a skill from deck and working set | `bunx @lythos/skill-deck@0.9.29 remove tdd` |
64
- | GC unreferenced repos from cold pool | `bunx @lythos/skill-deck@0.9.29 prune` |
65
- | Use a custom deck file or working dir | `bunx @lythos/skill-deck@0.9.29 link --deck ./my-deck.toml --workdir /path/to/project` |
58
+ | Sync working set with `skill-deck.toml` | `bunx @lythos/skill-deck@0.9.31 link` |
59
+ | Validate `skill-deck.toml` before committing | `bunx @lythos/skill-deck@0.9.31 validate` |
60
+ | Download a skill to cold pool and add to deck | `bunx @lythos/skill-deck@0.9.31 add owner/repo` |
61
+ | Pull latest versions of declared skills | `bunx @lythos/skill-deck@0.9.31 refresh` |
62
+ | Refresh a single skill by alias | `bunx @lythos/skill-deck@0.9.31 refresh tdd` |
63
+ | Remove a skill from deck and working set | `bunx @lythos/skill-deck@0.9.31 remove tdd` |
64
+ | GC unreferenced repos from cold pool | `bunx @lythos/skill-deck@0.9.31 prune` |
65
+ | Use a custom deck file or working dir | `bunx @lythos/skill-deck@0.9.31 link --deck ./my-deck.toml --workdir /path/to/project` |
66
66
 
67
67
  ### Commands
68
68
 
@@ -119,7 +119,7 @@ path = "github.com/lythos-labs/lythoskill/skills/lythoskill-deck"
119
119
  EOF
120
120
 
121
121
  # 2. Link — creates symlinks in .claude/skills/
122
- bunx @lythos/skill-deck@0.9.29 link
122
+ bunx @lythos/skill-deck@0.9.31 link
123
123
  ```
124
124
 
125
125
  ### Key Concepts
@@ -148,7 +148,7 @@ Different agents look for skills in different directories. `skill-deck.toml` con
148
148
 
149
149
  | Symptom | Cause | Fix |
150
150
  |---------|-------|-----|
151
- | `❌ Skill not found: <name>` | Skill declared in deck but not in cold pool | `bunx @lythos/skill-deck@0.9.29 add github.com/owner/repo/skill` or clone manually into cold pool |
151
+ | `❌ Skill not found: <name>` | Skill declared in deck but not in cold pool | `bunx @lythos/skill-deck@0.9.31 add github.com/owner/repo/skill` or clone manually into cold pool |
152
152
  | `link` skips entries with warnings | Real files/directories exist in working set (not symlinks) | Delete the real directories in `working_set` and re-run `link`. Never create directories manually there |
153
153
  | `refresh` reports "Not a git repository" | Skill was copied (not cloned) into cold pool | Re-clone with `git clone` or use `deck add` which clones by default |
154
154
  | `deck update` prints deprecation warning | `update` was renamed to `refresh` in v0.8+ | Use `deck refresh` instead |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lythos/skill-deck",
3
- "version": "0.9.29",
3
+ "version": "0.9.31",
4
4
  "description": "Declarative skill deck governance — cold pool, working set, deny-by-default",
5
5
  "keywords": [
6
6
  "ai-agent",
package/src/add.ts CHANGED
@@ -270,7 +270,7 @@ export async function addSkill(
270
270
 
271
271
  console.log('🔗 Running deck link...')
272
272
  const { linkDeck } = await import('./link.js')
273
- linkDeck(deckPath, workdir, { mode: options.mode })
273
+ await linkDeck(deckPath, workdir, { mode: options.mode })
274
274
 
275
275
  // ── Metadata recording (content-level only; deck refs reconciled by link) ─
276
276
 
package/src/cli.ts CHANGED
@@ -64,7 +64,7 @@ switch (command) {
64
64
  console.log(formatHelp(HELP_CONFIG))
65
65
  process.exit(0)
66
66
  case 'link':
67
- linkDeck(deckPath, workdir, { noBackup, mode })
67
+ await linkDeck(deckPath, workdir, { noBackup, mode })
68
68
  break
69
69
  case 'add': {
70
70
  const locator = args[1]
package/src/link.ts CHANGED
@@ -125,12 +125,37 @@ const BACKUP_SIZE_THRESHOLD = 100 * 1024 * 1024; // 100MB
125
125
 
126
126
  // ── 主流程 ──────────────────────────────────────────────────
127
127
 
128
- export function linkDeck(cliDeckPath?: string, cliWorkdir?: string, opts?: { noBackup?: boolean; mode?: 'symlink' | 'snapshot' }): void {
128
+ export async function linkDeck(cliDeckPath?: string, cliWorkdir?: string, opts?: { noBackup?: boolean; mode?: 'symlink' | 'snapshot' }): Promise<void> {
129
129
  const MODE = opts?.mode ?? 'symlink'
130
130
  const cliDeck = cliDeckPath || process.argv.find((_, i, a) => a[i - 1] === "--deck");
131
- const DECK_PATH = cliDeck
132
- ? resolve(cliDeck)
133
- : findDeckToml(process.cwd()) || resolve("skill-deck.toml");
131
+
132
+ // If --deck is a URL, fetch it first (discovered via quick-agent.sh dogfooding)
133
+ let DECK_PATH: string
134
+ if (cliDeck && (cliDeck.startsWith('http://') || cliDeck.startsWith('https://'))) {
135
+ let url = cliDeck
136
+ if (url.includes('github.com/') && url.includes('/blob/')) {
137
+ url = url.replace('github.com/', 'raw.githubusercontent.com/').replace('/blob/', '/')
138
+ }
139
+ const dest = resolve(process.cwd(), 'skill-deck.toml')
140
+ console.log(`📥 Fetching deck: ${url}`)
141
+ try {
142
+ const res = await fetch(url, { signal: AbortSignal.timeout(30_000) })
143
+ if (!res.ok) {
144
+ console.error(`❌ Failed to fetch deck (HTTP ${res.status}): ${url}`)
145
+ process.exit(1)
146
+ }
147
+ writeFileSync(dest, await res.text())
148
+ console.log(` → saved to ${dest}`)
149
+ DECK_PATH = dest
150
+ } catch (e: any) {
151
+ console.error(`❌ Failed to fetch deck: ${e.message || e}`)
152
+ process.exit(1)
153
+ }
154
+ } else {
155
+ DECK_PATH = cliDeck
156
+ ? resolve(cliDeck)
157
+ : findDeckToml(process.cwd()) || resolve("skill-deck.toml");
158
+ }
134
159
 
135
160
  if (!existsSync(DECK_PATH)) {
136
161
  console.error(`❌ skill-deck.toml not found in ${process.cwd()}`);
package/src/refresh.ts CHANGED
@@ -63,10 +63,10 @@ export function refreshDeck(cliDeckPath?: string, cliWorkdir?: string, target?:
63
63
  const results = executeRefreshPlan(plan, {
64
64
  gitPull,
65
65
  log: console.log,
66
- linkDeck: () => {
66
+ linkDeck: async () => {
67
67
  console.log(`\n💡 Run 'bunx @lythos/skill-deck link' to sync refreshed skills to working set.`)
68
68
  console.log('🔗 Running deck link...')
69
- linkDeck(cliDeckPath, cliWorkdir)
69
+ await linkDeck(cliDeckPath, cliWorkdir)
70
70
  },
71
71
  })
72
72