@skilldeck/cli 0.1.0 → 0.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.
- package/README.md +4 -2
- package/bin/skilldeck.mjs +30 -11
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -14,8 +14,9 @@ npx @skilldeck/cli add cartograph disciplines
|
|
|
14
14
|
## Commands
|
|
15
15
|
|
|
16
16
|
```bash
|
|
17
|
-
skilldeck add <pack...>
|
|
18
|
-
skilldeck
|
|
17
|
+
skilldeck add <pack...> # install whole packs ("all" for every pack)
|
|
18
|
+
skilldeck add disciplines/test-first # install a single skill
|
|
19
|
+
skilldeck remove <pack|pack/skill...> # uninstall exactly what was installed
|
|
19
20
|
skilldeck list # available packs and where they're installed
|
|
20
21
|
```
|
|
21
22
|
|
|
@@ -24,6 +25,7 @@ skilldeck list # available packs and where they're installed
|
|
|
24
25
|
| Flag | Meaning |
|
|
25
26
|
|---|---|
|
|
26
27
|
| `-a, --agent <name>` | `claude` (default), `codex`, `agents`, `all`, or a comma list |
|
|
28
|
+
| `-s, --skill <name>` | Only these skills from the named pack (repeat, or comma-separate) |
|
|
27
29
|
| `-p, --project` | Install into the current project (`./.claude/skills`, ...) instead of your home folder |
|
|
28
30
|
| `-f, --force` | Replace skill folders SkillDeck didn't install |
|
|
29
31
|
| `--dry-run` | Show what would happen without writing anything |
|
package/bin/skilldeck.mjs
CHANGED
|
@@ -10,8 +10,8 @@ const { version } = JSON.parse(fs.readFileSync(new URL('../package.json', import
|
|
|
10
10
|
const HELP = `${bold('skilldeck')} ${version}: skill packs for coding agents
|
|
11
11
|
|
|
12
12
|
Usage:
|
|
13
|
-
npx @skilldeck/cli add <pack...>
|
|
14
|
-
npx @skilldeck/cli remove <pack...>
|
|
13
|
+
npx @skilldeck/cli add <pack|pack/skill...> install packs or single skills
|
|
14
|
+
npx @skilldeck/cli remove <pack|pack/skill...> uninstall packs or single skills
|
|
15
15
|
npx @skilldeck/cli list available packs and where they're installed
|
|
16
16
|
|
|
17
17
|
Packs:
|
|
@@ -23,15 +23,29 @@ ${OPTIONS_HELP}
|
|
|
23
23
|
|
|
24
24
|
Examples:
|
|
25
25
|
npx @skilldeck/cli add cartograph disciplines
|
|
26
|
+
npx @skilldeck/cli add disciplines/test-first disciplines/verify-before-done
|
|
26
27
|
npx @skilldeck/cli add cartograph --agent all --project
|
|
27
28
|
npx @skilldeck/cli remove disciplines`
|
|
28
29
|
|
|
29
|
-
|
|
30
|
+
/**
|
|
31
|
+
* Accepts pack names and pack/skill pairs, e.g. `cartograph disciplines/test-first`.
|
|
32
|
+
* Returns [{ pack, skills }] where skills is undefined for a whole pack.
|
|
33
|
+
*/
|
|
34
|
+
function resolvePacks(names, skillFlag) {
|
|
30
35
|
if (names.length === 0) throw new Error('Name at least one pack, e.g. `skilldeck add cartograph`.')
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
36
|
+
const wanted = new Map()
|
|
37
|
+
for (const raw of names.includes('all') ? Object.keys(PACKS) : names) {
|
|
38
|
+
const [name, skill] = raw.split(/[/:]/)
|
|
39
|
+
if (!PACKS[name]) throw new Error(`Unknown pack: ${name}. Available: ${Object.keys(PACKS).join(', ')}`)
|
|
40
|
+
if (!skill) wanted.set(name, null)
|
|
41
|
+
else if (wanted.get(name) !== null) wanted.set(name, [...(wanted.get(name) ?? []), skill])
|
|
42
|
+
}
|
|
43
|
+
if (skillFlag) {
|
|
44
|
+
if (wanted.size !== 1) throw new Error('--skill works with exactly one pack. Use pack/skill to mix packs, e.g. disciplines/test-first.')
|
|
45
|
+
const [name] = wanted.keys()
|
|
46
|
+
wanted.set(name, [...(wanted.get(name) ?? []), ...skillFlag])
|
|
47
|
+
}
|
|
48
|
+
return [...wanted].map(([name, skills]) => ({ pack: PACKS[name], skills: skills ?? undefined }))
|
|
35
49
|
}
|
|
36
50
|
|
|
37
51
|
try {
|
|
@@ -42,11 +56,16 @@ try {
|
|
|
42
56
|
if (values.version) console.log(version)
|
|
43
57
|
else if (values.help || !cmd || cmd === 'help') console.log(HELP)
|
|
44
58
|
else if (cmd === 'add' || cmd === 'install' || cmd === 'i') {
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
59
|
+
const picks = resolvePacks(names, opts.skills)
|
|
60
|
+
let hooked = false
|
|
61
|
+
for (const { pack, skills } of picks) {
|
|
62
|
+
const r = install(pack, { ...opts, skills })
|
|
63
|
+
printInstall(pack, r)
|
|
64
|
+
hooked ||= r.some((x) => x.hook)
|
|
65
|
+
}
|
|
66
|
+
if (!opts.dryRun && hooked) console.log(dim('\nRestart your agent (or run /clear in Claude Code) to load session hooks.'))
|
|
48
67
|
} else if (cmd === 'remove' || cmd === 'uninstall' || cmd === 'rm') {
|
|
49
|
-
for (const
|
|
68
|
+
for (const { pack, skills } of resolvePacks(names, opts.skills)) printUninstall(pack.name, uninstall(pack.name, { ...opts, skills }))
|
|
50
69
|
} else if (cmd === 'list' || cmd === 'ls' || cmd === 'status') {
|
|
51
70
|
console.log(bold('Available'))
|
|
52
71
|
for (const p of Object.values(PACKS)) console.log(` ${p.name}@${p.version} ${dim(`${p.skills.length} skill${p.skills.length === 1 ? '' : 's'}${p.hook ? ' + hook' : ''}`)}`)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skilldeck/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Install SkillDeck skill packs (cartograph, disciplines) into Claude Code, Codex and other SKILL.md agents.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"LICENSE"
|
|
13
13
|
],
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@skilldeck/core": "^0.1.
|
|
15
|
+
"@skilldeck/core": "^0.1.1",
|
|
16
16
|
"@skilldeck/cartograph": "^0.1.0",
|
|
17
17
|
"@skilldeck/disciplines": "^0.1.0"
|
|
18
18
|
},
|