skilllib 1.11.3 → 1.11.5
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 +23 -20
- package/dist/{chunk-3XDWEHI4.js → chunk-TE2EDZ7L.js} +1006 -373
- package/dist/index.js +8 -5
- package/dist/json.d.cts +20 -8
- package/dist/json.d.ts +20 -8
- package/dist/{tui-WSHQRBPF.js → tui-GFQUHPEC.js} +219 -136
- package/package.json +2 -2
- package/skills/skilllib/SKILL.md +9 -6
package/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
|
+
VALUE_FLAGS,
|
|
3
4
|
add,
|
|
4
5
|
agentSkill,
|
|
5
6
|
apply,
|
|
@@ -30,7 +31,7 @@ import {
|
|
|
30
31
|
unhide,
|
|
31
32
|
update,
|
|
32
33
|
usage
|
|
33
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-TE2EDZ7L.js";
|
|
34
35
|
|
|
35
36
|
// src/index.ts
|
|
36
37
|
import { readFileSync } from "fs";
|
|
@@ -97,7 +98,7 @@ var FLAGS_OF = {
|
|
|
97
98
|
status: ["days"],
|
|
98
99
|
add: ["force", "allow-tracked"],
|
|
99
100
|
remove: ["force"],
|
|
100
|
-
sync: ["all", "force"
|
|
101
|
+
sync: ["all", "force"],
|
|
101
102
|
update: ["all", "force", "allow-tracked"],
|
|
102
103
|
outdated: ["all"],
|
|
103
104
|
list: ["days"],
|
|
@@ -120,11 +121,12 @@ var FLAGS_OF = {
|
|
|
120
121
|
version: [],
|
|
121
122
|
help: []
|
|
122
123
|
};
|
|
124
|
+
var NO_ARGS = /* @__PURE__ */ new Set(["", "ui", "status", "outdated", "list", "projects", "link", "doctor", "usage", "version"]);
|
|
123
125
|
async function main() {
|
|
124
126
|
const argv = process.argv.slice(2);
|
|
125
127
|
setJsonMode(argv.includes("--json"));
|
|
126
128
|
let at = 0;
|
|
127
|
-
while (argv[at]?.startsWith("--") && !["--version", "--help"].includes(argv[at])) at +=
|
|
129
|
+
while (argv[at]?.startsWith("--") && !["--version", "--help"].includes(argv[at])) at += VALUE_FLAGS.includes(argv[at]) ? 2 : 1;
|
|
128
130
|
const command = argv[at];
|
|
129
131
|
const rest = [...argv.slice(0, at), ...argv.slice(at + 1)];
|
|
130
132
|
const args = parseArgs(rest);
|
|
@@ -132,13 +134,14 @@ async function main() {
|
|
|
132
134
|
const flagOf = (a) => a.slice(2).split("=")[0];
|
|
133
135
|
const wrong = takes ? rest.filter((a) => a.startsWith("--") && flagOf(a) !== "json" && !takes.includes(flagOf(a))) : [];
|
|
134
136
|
if (wrong.length) throw new Error(`skilllib${command ? ` ${command}` : ""} doesn't take ${wrong.join(", ")}`);
|
|
137
|
+
if (NO_ARGS.has(command ?? "") && args.positional.length) throw new Error(`skilllib${command ? ` ${command}` : ""} doesn't take ${args.positional.join(" ")}`);
|
|
135
138
|
if (!["--version", "-v", "version", "help", "--help", "-h"].includes(command ?? "")) refreshAgentSkill();
|
|
136
139
|
switch (command) {
|
|
137
140
|
case void 0:
|
|
138
|
-
return process.stdin.isTTY && process.stdout.isTTY ? (await import("./tui-
|
|
141
|
+
return process.stdin.isTTY && process.stdout.isTTY ? (await import("./tui-GFQUHPEC.js")).tui() : overview(args);
|
|
139
142
|
case "ui":
|
|
140
143
|
if (!process.stdin.isTTY || !process.stdout.isTTY) throw new Error("`skilllib ui` needs an interactive terminal. Agents and scripts: use `skilllib status --json`.");
|
|
141
|
-
return (await import("./tui-
|
|
144
|
+
return (await import("./tui-GFQUHPEC.js")).tui();
|
|
142
145
|
case "status":
|
|
143
146
|
return status(args);
|
|
144
147
|
case "add":
|
package/dist/json.d.cts
CHANGED
|
@@ -11,12 +11,17 @@ type AgentSkillState = "installed" | "outdated" | "missing";
|
|
|
11
11
|
*/
|
|
12
12
|
type GitState = "committed" | "changed" | "new" | "ignored";
|
|
13
13
|
|
|
14
|
-
type SkillState = "ok" | "update available" | "edited locally" | "edited locally, update available"
|
|
14
|
+
type SkillState = "ok" | "update available" | "edited locally" | "edited locally, update available"
|
|
15
|
+
/** The copy is another version from your library than the one skilllib.json pins (after a pull, say): sync installs the pinned one. */
|
|
16
|
+
| "out of sync" | "folder missing" | "not in library" | "untracked copy of library skill" | "untracked, differs from library" | "local only" | "repo skill" | "repo skill, in library" | "repo skill, differs from library" | "from npx skills";
|
|
15
17
|
type Change = {
|
|
16
18
|
name: string;
|
|
17
|
-
/**
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
/**
|
|
20
|
+
* reset: back to the version it had; its local edits were overwritten (and backed up, see `backedUp`).
|
|
21
|
+
* relinked: the copy was as pinned; only the links skilllib.json records were put back.
|
|
22
|
+
* unchanged: it was already as asked (same version, same links): nothing was written.
|
|
23
|
+
*/
|
|
24
|
+
action: "installed" | "updated" | "reset" | "relinked" | "unchanged" | "removed" | "skipped";
|
|
20
25
|
reason?: string;
|
|
21
26
|
from?: number;
|
|
22
27
|
to?: number;
|
|
@@ -24,6 +29,8 @@ type Change = {
|
|
|
24
29
|
blocked?: string[];
|
|
25
30
|
/** Harness folders git tracks, left without a link because git doesn't share the real copy (teammates would get a broken link). */
|
|
26
31
|
uncommitted?: string[];
|
|
32
|
+
/** What kept a link out (a file or another copy where it goes): an agent can't use the skill there. */
|
|
33
|
+
inTheWay?: string[];
|
|
27
34
|
/** Where overwritten local edits went (~/.skilllib/edit-backup/…); `skilllib restore` puts them back. */
|
|
28
35
|
backedUp?: string;
|
|
29
36
|
};
|
|
@@ -34,7 +41,7 @@ type Change = {
|
|
|
34
41
|
* - skills.sh: a symlink into ~/.agents/skills, installed by `npx skills`
|
|
35
42
|
* - claude.ai: synced from your claude.ai account
|
|
36
43
|
* - plugin: shipped inside an enabled Claude Code plugin
|
|
37
|
-
* - built-in: bundled with an agent (Cursor's ~/.cursor/skills-cursor, Grok's ~/.grok/bundled/skills)
|
|
44
|
+
* - built-in: bundled with an agent (Cursor's ~/.cursor/skills-cursor, Codex's ~/.codex/skills/.system, Grok's ~/.grok/bundled/skills)
|
|
38
45
|
* - system: a machine-wide folder an admin manages (/etc/codex/skills)
|
|
39
46
|
* - skilllib: skilllib's own skill, which `skilllib agent-skill install` puts in your global folders
|
|
40
47
|
*/
|
|
@@ -42,7 +49,7 @@ type SourceKind = "global" | "skills.sh" | "claude.ai" | "plugin" | "built-in" |
|
|
|
42
49
|
|
|
43
50
|
/**
|
|
44
51
|
* - library: added from your skills with skilllib (pinned in skilllib.json)
|
|
45
|
-
* - repo: the team's: committed to git (any skill folder), or in .agents/skills
|
|
52
|
+
* - repo: the team's: committed to git (any skill folder), or in .agents/skills or .grok/skills
|
|
46
53
|
* - local: only on this machine: not committed, not managed by skilllib
|
|
47
54
|
*/
|
|
48
55
|
type ProjectSource = "library" | "repo" | "local";
|
|
@@ -53,7 +60,7 @@ type StatusSkillGroup = {
|
|
|
53
60
|
/** Folder with the real copy, when it isn't .claude/skills. */
|
|
54
61
|
dir?: string;
|
|
55
62
|
version?: number;
|
|
56
|
-
/** Only when it isn't "ok". */
|
|
63
|
+
/** Only when it isn't the usual one: "ok", "local only", or a repo skill's. */
|
|
57
64
|
state?: SkillState;
|
|
58
65
|
/** Newer library version, when there is one. */
|
|
59
66
|
latest?: number;
|
|
@@ -171,7 +178,10 @@ type DoctorJson = {
|
|
|
171
178
|
detail: string;
|
|
172
179
|
/** A safe repair; `doctor --fix` runs it. */
|
|
173
180
|
fix?: string;
|
|
174
|
-
/**
|
|
181
|
+
/**
|
|
182
|
+
* Fixes that need a decision: `skilllib apply <id> <n>` runs the nth (from 1). An issue that spans repos can list
|
|
183
|
+
* other choices inside one (status there), and then apply takes only the label: `skilllib apply <id> "<label>"`.
|
|
184
|
+
*/
|
|
175
185
|
choices?: string[];
|
|
176
186
|
/** With --fix: what running `fix` did. */
|
|
177
187
|
fixed?: {
|
|
@@ -196,6 +206,8 @@ type GlobalMoveJson = {
|
|
|
196
206
|
/** Added to every repo and no longer global. When false, it still loads globally and `reason` says why. */
|
|
197
207
|
moved: boolean;
|
|
198
208
|
reason?: string;
|
|
209
|
+
/** Links in a repo's packages now pointing at nothing (the repo's own copy serves them): remove them. */
|
|
210
|
+
left?: string[];
|
|
199
211
|
projects: {
|
|
200
212
|
project: string;
|
|
201
213
|
path: string;
|
package/dist/json.d.ts
CHANGED
|
@@ -11,12 +11,17 @@ type AgentSkillState = "installed" | "outdated" | "missing";
|
|
|
11
11
|
*/
|
|
12
12
|
type GitState = "committed" | "changed" | "new" | "ignored";
|
|
13
13
|
|
|
14
|
-
type SkillState = "ok" | "update available" | "edited locally" | "edited locally, update available"
|
|
14
|
+
type SkillState = "ok" | "update available" | "edited locally" | "edited locally, update available"
|
|
15
|
+
/** The copy is another version from your library than the one skilllib.json pins (after a pull, say): sync installs the pinned one. */
|
|
16
|
+
| "out of sync" | "folder missing" | "not in library" | "untracked copy of library skill" | "untracked, differs from library" | "local only" | "repo skill" | "repo skill, in library" | "repo skill, differs from library" | "from npx skills";
|
|
15
17
|
type Change = {
|
|
16
18
|
name: string;
|
|
17
|
-
/**
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
/**
|
|
20
|
+
* reset: back to the version it had; its local edits were overwritten (and backed up, see `backedUp`).
|
|
21
|
+
* relinked: the copy was as pinned; only the links skilllib.json records were put back.
|
|
22
|
+
* unchanged: it was already as asked (same version, same links): nothing was written.
|
|
23
|
+
*/
|
|
24
|
+
action: "installed" | "updated" | "reset" | "relinked" | "unchanged" | "removed" | "skipped";
|
|
20
25
|
reason?: string;
|
|
21
26
|
from?: number;
|
|
22
27
|
to?: number;
|
|
@@ -24,6 +29,8 @@ type Change = {
|
|
|
24
29
|
blocked?: string[];
|
|
25
30
|
/** Harness folders git tracks, left without a link because git doesn't share the real copy (teammates would get a broken link). */
|
|
26
31
|
uncommitted?: string[];
|
|
32
|
+
/** What kept a link out (a file or another copy where it goes): an agent can't use the skill there. */
|
|
33
|
+
inTheWay?: string[];
|
|
27
34
|
/** Where overwritten local edits went (~/.skilllib/edit-backup/…); `skilllib restore` puts them back. */
|
|
28
35
|
backedUp?: string;
|
|
29
36
|
};
|
|
@@ -34,7 +41,7 @@ type Change = {
|
|
|
34
41
|
* - skills.sh: a symlink into ~/.agents/skills, installed by `npx skills`
|
|
35
42
|
* - claude.ai: synced from your claude.ai account
|
|
36
43
|
* - plugin: shipped inside an enabled Claude Code plugin
|
|
37
|
-
* - built-in: bundled with an agent (Cursor's ~/.cursor/skills-cursor, Grok's ~/.grok/bundled/skills)
|
|
44
|
+
* - built-in: bundled with an agent (Cursor's ~/.cursor/skills-cursor, Codex's ~/.codex/skills/.system, Grok's ~/.grok/bundled/skills)
|
|
38
45
|
* - system: a machine-wide folder an admin manages (/etc/codex/skills)
|
|
39
46
|
* - skilllib: skilllib's own skill, which `skilllib agent-skill install` puts in your global folders
|
|
40
47
|
*/
|
|
@@ -42,7 +49,7 @@ type SourceKind = "global" | "skills.sh" | "claude.ai" | "plugin" | "built-in" |
|
|
|
42
49
|
|
|
43
50
|
/**
|
|
44
51
|
* - library: added from your skills with skilllib (pinned in skilllib.json)
|
|
45
|
-
* - repo: the team's: committed to git (any skill folder), or in .agents/skills
|
|
52
|
+
* - repo: the team's: committed to git (any skill folder), or in .agents/skills or .grok/skills
|
|
46
53
|
* - local: only on this machine: not committed, not managed by skilllib
|
|
47
54
|
*/
|
|
48
55
|
type ProjectSource = "library" | "repo" | "local";
|
|
@@ -53,7 +60,7 @@ type StatusSkillGroup = {
|
|
|
53
60
|
/** Folder with the real copy, when it isn't .claude/skills. */
|
|
54
61
|
dir?: string;
|
|
55
62
|
version?: number;
|
|
56
|
-
/** Only when it isn't "ok". */
|
|
63
|
+
/** Only when it isn't the usual one: "ok", "local only", or a repo skill's. */
|
|
57
64
|
state?: SkillState;
|
|
58
65
|
/** Newer library version, when there is one. */
|
|
59
66
|
latest?: number;
|
|
@@ -171,7 +178,10 @@ type DoctorJson = {
|
|
|
171
178
|
detail: string;
|
|
172
179
|
/** A safe repair; `doctor --fix` runs it. */
|
|
173
180
|
fix?: string;
|
|
174
|
-
/**
|
|
181
|
+
/**
|
|
182
|
+
* Fixes that need a decision: `skilllib apply <id> <n>` runs the nth (from 1). An issue that spans repos can list
|
|
183
|
+
* other choices inside one (status there), and then apply takes only the label: `skilllib apply <id> "<label>"`.
|
|
184
|
+
*/
|
|
175
185
|
choices?: string[];
|
|
176
186
|
/** With --fix: what running `fix` did. */
|
|
177
187
|
fixed?: {
|
|
@@ -196,6 +206,8 @@ type GlobalMoveJson = {
|
|
|
196
206
|
/** Added to every repo and no longer global. When false, it still loads globally and `reason` says why. */
|
|
197
207
|
moved: boolean;
|
|
198
208
|
reason?: string;
|
|
209
|
+
/** Links in a repo's packages now pointing at nothing (the repo's own copy serves them): remove them. */
|
|
210
|
+
left?: string[];
|
|
199
211
|
projects: {
|
|
200
212
|
project: string;
|
|
201
213
|
path: string;
|