skilllib 1.11.2 → 1.11.4
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 +49 -40
- package/dist/{chunk-OFWHWIER.js → chunk-CS6T66EE.js} +1564 -677
- package/dist/index.js +45 -13
- package/dist/json.d.cts +20 -7
- package/dist/json.d.ts +20 -7
- package/dist/{tui-NGTOOVAQ.js → tui-BDLJOMSC.js} +469 -801
- package/package.json +2 -2
- package/skills/skilllib/SKILL.md +10 -7
package/dist/index.js
CHANGED
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
unhide,
|
|
31
31
|
update,
|
|
32
32
|
usage
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-CS6T66EE.js";
|
|
34
34
|
|
|
35
35
|
// src/index.ts
|
|
36
36
|
import { readFileSync } from "fs";
|
|
@@ -91,33 +91,69 @@ function packageVersion() {
|
|
|
91
91
|
return "unknown";
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
|
+
var FLAGS_OF = {
|
|
95
|
+
"": ["days"],
|
|
96
|
+
ui: [],
|
|
97
|
+
status: ["days"],
|
|
98
|
+
add: ["force", "allow-tracked"],
|
|
99
|
+
remove: ["force"],
|
|
100
|
+
sync: ["all", "force"],
|
|
101
|
+
update: ["all", "force", "allow-tracked"],
|
|
102
|
+
outdated: ["all"],
|
|
103
|
+
list: ["days"],
|
|
104
|
+
show: [],
|
|
105
|
+
import: ["force", "global"],
|
|
106
|
+
scan: [],
|
|
107
|
+
projects: [],
|
|
108
|
+
link: ["all", "allow-tracked"],
|
|
109
|
+
tidy: ["all", "global", "dry-run", "allow-git", "keep"],
|
|
110
|
+
harnesses: [],
|
|
111
|
+
folders: [],
|
|
112
|
+
unhide: [],
|
|
113
|
+
new: [],
|
|
114
|
+
global: ["allow-tracked", "to"],
|
|
115
|
+
restore: [],
|
|
116
|
+
doctor: ["fix", "days"],
|
|
117
|
+
apply: ["days"],
|
|
118
|
+
usage: ["days"],
|
|
119
|
+
"agent-skill": [],
|
|
120
|
+
version: [],
|
|
121
|
+
help: []
|
|
122
|
+
};
|
|
123
|
+
var NO_ARGS = /* @__PURE__ */ new Set(["", "ui", "status", "outdated", "list", "projects", "link", "doctor", "usage", "version"]);
|
|
94
124
|
async function main() {
|
|
95
|
-
const
|
|
96
|
-
setJsonMode(
|
|
125
|
+
const argv = process.argv.slice(2);
|
|
126
|
+
setJsonMode(argv.includes("--json"));
|
|
127
|
+
let at = 0;
|
|
128
|
+
while (argv[at]?.startsWith("--") && !["--version", "--help"].includes(argv[at])) at += ["--days", "--keep", "--to"].includes(argv[at]) ? 2 : 1;
|
|
129
|
+
const command = argv[at];
|
|
130
|
+
const rest = [...argv.slice(0, at), ...argv.slice(at + 1)];
|
|
97
131
|
const args = parseArgs(rest);
|
|
132
|
+
const takes = FLAGS_OF[command ?? ""];
|
|
133
|
+
const flagOf = (a) => a.slice(2).split("=")[0];
|
|
134
|
+
const wrong = takes ? rest.filter((a) => a.startsWith("--") && flagOf(a) !== "json" && !takes.includes(flagOf(a))) : [];
|
|
135
|
+
if (wrong.length) throw new Error(`skilllib${command ? ` ${command}` : ""} doesn't take ${wrong.join(", ")}`);
|
|
136
|
+
if (NO_ARGS.has(command ?? "") && args.positional.length) throw new Error(`skilllib${command ? ` ${command}` : ""} doesn't take ${args.positional.join(" ")}`);
|
|
98
137
|
if (!["--version", "-v", "version", "help", "--help", "-h"].includes(command ?? "")) refreshAgentSkill();
|
|
99
138
|
switch (command) {
|
|
100
139
|
case void 0:
|
|
101
|
-
return process.stdin.isTTY && process.stdout.isTTY ? (await import("./tui-
|
|
140
|
+
return process.stdin.isTTY && process.stdout.isTTY ? (await import("./tui-BDLJOMSC.js")).tui() : overview(args);
|
|
102
141
|
case "ui":
|
|
103
142
|
if (!process.stdin.isTTY || !process.stdout.isTTY) throw new Error("`skilllib ui` needs an interactive terminal. Agents and scripts: use `skilllib status --json`.");
|
|
104
|
-
return (await import("./tui-
|
|
143
|
+
return (await import("./tui-BDLJOMSC.js")).tui();
|
|
105
144
|
case "status":
|
|
106
145
|
return status(args);
|
|
107
146
|
case "add":
|
|
108
147
|
return add(args);
|
|
109
148
|
case "remove":
|
|
110
|
-
case "rm":
|
|
111
149
|
return remove(args);
|
|
112
150
|
case "sync":
|
|
113
151
|
return sync(args);
|
|
114
152
|
case "update":
|
|
115
|
-
case "upgrade":
|
|
116
153
|
return update(args);
|
|
117
154
|
case "outdated":
|
|
118
155
|
return outdated(args);
|
|
119
156
|
case "list":
|
|
120
|
-
case "ls":
|
|
121
157
|
return list(args);
|
|
122
158
|
case "show":
|
|
123
159
|
return show(args);
|
|
@@ -130,18 +166,14 @@ async function main() {
|
|
|
130
166
|
case "link":
|
|
131
167
|
return link(args);
|
|
132
168
|
case "tidy":
|
|
133
|
-
case "dedup":
|
|
134
169
|
return tidy(args);
|
|
135
170
|
case "harnesses":
|
|
136
|
-
case "agents":
|
|
137
171
|
return harnessesCommand(args);
|
|
138
172
|
case "folders":
|
|
139
|
-
case "roots":
|
|
140
173
|
return folders(args);
|
|
141
174
|
case "unhide":
|
|
142
175
|
return unhide(args);
|
|
143
176
|
case "new":
|
|
144
|
-
case "create":
|
|
145
177
|
return newSkill(args);
|
|
146
178
|
case "global":
|
|
147
179
|
return globalCommand(args);
|
|
@@ -158,7 +190,7 @@ async function main() {
|
|
|
158
190
|
case "--version":
|
|
159
191
|
case "-v":
|
|
160
192
|
case "version":
|
|
161
|
-
console.log(packageVersion());
|
|
193
|
+
console.log(isJsonMode() ? JSON.stringify(packageVersion()) : packageVersion());
|
|
162
194
|
return;
|
|
163
195
|
case "help":
|
|
164
196
|
case "--help":
|
package/dist/json.d.cts
CHANGED
|
@@ -11,11 +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
|
+
/**
|
|
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";
|
|
19
25
|
reason?: string;
|
|
20
26
|
from?: number;
|
|
21
27
|
to?: number;
|
|
@@ -23,6 +29,8 @@ type Change = {
|
|
|
23
29
|
blocked?: string[];
|
|
24
30
|
/** Harness folders git tracks, left without a link because git doesn't share the real copy (teammates would get a broken link). */
|
|
25
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[];
|
|
26
34
|
/** Where overwritten local edits went (~/.skilllib/edit-backup/…); `skilllib restore` puts them back. */
|
|
27
35
|
backedUp?: string;
|
|
28
36
|
};
|
|
@@ -33,7 +41,7 @@ type Change = {
|
|
|
33
41
|
* - skills.sh: a symlink into ~/.agents/skills, installed by `npx skills`
|
|
34
42
|
* - claude.ai: synced from your claude.ai account
|
|
35
43
|
* - plugin: shipped inside an enabled Claude Code plugin
|
|
36
|
-
* - 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)
|
|
37
45
|
* - system: a machine-wide folder an admin manages (/etc/codex/skills)
|
|
38
46
|
* - skilllib: skilllib's own skill, which `skilllib agent-skill install` puts in your global folders
|
|
39
47
|
*/
|
|
@@ -41,7 +49,7 @@ type SourceKind = "global" | "skills.sh" | "claude.ai" | "plugin" | "built-in" |
|
|
|
41
49
|
|
|
42
50
|
/**
|
|
43
51
|
* - library: added from your skills with skilllib (pinned in skilllib.json)
|
|
44
|
-
* - 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
|
|
45
53
|
* - local: only on this machine: not committed, not managed by skilllib
|
|
46
54
|
*/
|
|
47
55
|
type ProjectSource = "library" | "repo" | "local";
|
|
@@ -52,7 +60,7 @@ type StatusSkillGroup = {
|
|
|
52
60
|
/** Folder with the real copy, when it isn't .claude/skills. */
|
|
53
61
|
dir?: string;
|
|
54
62
|
version?: number;
|
|
55
|
-
/** Only when it isn't "ok". */
|
|
63
|
+
/** Only when it isn't the usual one: "ok", "local only", or a repo skill's. */
|
|
56
64
|
state?: SkillState;
|
|
57
65
|
/** Newer library version, when there is one. */
|
|
58
66
|
latest?: number;
|
|
@@ -170,7 +178,10 @@ type DoctorJson = {
|
|
|
170
178
|
detail: string;
|
|
171
179
|
/** A safe repair; `doctor --fix` runs it. */
|
|
172
180
|
fix?: string;
|
|
173
|
-
/**
|
|
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
|
+
*/
|
|
174
185
|
choices?: string[];
|
|
175
186
|
/** With --fix: what running `fix` did. */
|
|
176
187
|
fixed?: {
|
|
@@ -195,6 +206,8 @@ type GlobalMoveJson = {
|
|
|
195
206
|
/** Added to every repo and no longer global. When false, it still loads globally and `reason` says why. */
|
|
196
207
|
moved: boolean;
|
|
197
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[];
|
|
198
211
|
projects: {
|
|
199
212
|
project: string;
|
|
200
213
|
path: string;
|
package/dist/json.d.ts
CHANGED
|
@@ -11,11 +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
|
+
/**
|
|
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";
|
|
19
25
|
reason?: string;
|
|
20
26
|
from?: number;
|
|
21
27
|
to?: number;
|
|
@@ -23,6 +29,8 @@ type Change = {
|
|
|
23
29
|
blocked?: string[];
|
|
24
30
|
/** Harness folders git tracks, left without a link because git doesn't share the real copy (teammates would get a broken link). */
|
|
25
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[];
|
|
26
34
|
/** Where overwritten local edits went (~/.skilllib/edit-backup/…); `skilllib restore` puts them back. */
|
|
27
35
|
backedUp?: string;
|
|
28
36
|
};
|
|
@@ -33,7 +41,7 @@ type Change = {
|
|
|
33
41
|
* - skills.sh: a symlink into ~/.agents/skills, installed by `npx skills`
|
|
34
42
|
* - claude.ai: synced from your claude.ai account
|
|
35
43
|
* - plugin: shipped inside an enabled Claude Code plugin
|
|
36
|
-
* - 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)
|
|
37
45
|
* - system: a machine-wide folder an admin manages (/etc/codex/skills)
|
|
38
46
|
* - skilllib: skilllib's own skill, which `skilllib agent-skill install` puts in your global folders
|
|
39
47
|
*/
|
|
@@ -41,7 +49,7 @@ type SourceKind = "global" | "skills.sh" | "claude.ai" | "plugin" | "built-in" |
|
|
|
41
49
|
|
|
42
50
|
/**
|
|
43
51
|
* - library: added from your skills with skilllib (pinned in skilllib.json)
|
|
44
|
-
* - 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
|
|
45
53
|
* - local: only on this machine: not committed, not managed by skilllib
|
|
46
54
|
*/
|
|
47
55
|
type ProjectSource = "library" | "repo" | "local";
|
|
@@ -52,7 +60,7 @@ type StatusSkillGroup = {
|
|
|
52
60
|
/** Folder with the real copy, when it isn't .claude/skills. */
|
|
53
61
|
dir?: string;
|
|
54
62
|
version?: number;
|
|
55
|
-
/** Only when it isn't "ok". */
|
|
63
|
+
/** Only when it isn't the usual one: "ok", "local only", or a repo skill's. */
|
|
56
64
|
state?: SkillState;
|
|
57
65
|
/** Newer library version, when there is one. */
|
|
58
66
|
latest?: number;
|
|
@@ -170,7 +178,10 @@ type DoctorJson = {
|
|
|
170
178
|
detail: string;
|
|
171
179
|
/** A safe repair; `doctor --fix` runs it. */
|
|
172
180
|
fix?: string;
|
|
173
|
-
/**
|
|
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
|
+
*/
|
|
174
185
|
choices?: string[];
|
|
175
186
|
/** With --fix: what running `fix` did. */
|
|
176
187
|
fixed?: {
|
|
@@ -195,6 +206,8 @@ type GlobalMoveJson = {
|
|
|
195
206
|
/** Added to every repo and no longer global. When false, it still loads globally and `reason` says why. */
|
|
196
207
|
moved: boolean;
|
|
197
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[];
|
|
198
211
|
projects: {
|
|
199
212
|
project: string;
|
|
200
213
|
path: string;
|