skill-land 1.7.0 → 1.7.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 +239 -141
- package/package.json +4 -5
- package/skill-land.mjs +88 -10
package/README.md
CHANGED
|
@@ -1,48 +1,64 @@
|
|
|
1
|
-
|
|
1
|
+
<h1 align="center">skill-land</h1>
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
<p align="center">
|
|
4
|
+
<img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License"/>
|
|
5
|
+
<a href="https://github.com/Magithar/skill-land/releases"><img src="https://img.shields.io/github/v/release/Magithar/skill-land?label=release" alt="Release"/></a>
|
|
6
|
+
<a href="https://www.npmjs.com/package/skill-land"><img src="https://img.shields.io/npm/v/skill-land" alt="npm version"/></a>
|
|
7
|
+
<a href="https://www.npmjs.com/package/skill-land"><img src="https://img.shields.io/npm/dt/skill-land" alt="npm downloads"/></a>
|
|
8
|
+
<a href="https://github.com/Magithar/skill-land/actions/workflows/check.yml"><img src="https://github.com/Magithar/skill-land/actions/workflows/check.yml/badge.svg" alt="CI"/></a>
|
|
9
|
+
</p>
|
|
5
10
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
11
|
+
<p align="center">
|
|
12
|
+
Installs an agent skill to the directory the agent <b>actually reads</b>, then reads every file back and exits non-zero if it didn't land. Built because <code>npx skills add -g</code> reports success while writing somewhere 13 agents never look. It also audits skills you already have, whatever installed them, and can ask a fresh agent session whether it really sees the skill.<br/><br/>
|
|
13
|
+
Works with <a href="#supported-agents">Claude Code</a>, <a href="#supported-agents">OpenAI Codex</a>, <a href="#antigravity">Antigravity</a>, <a href="#supported-agents">Gemini CLI</a>, <a href="#supported-agents">Cursor</a>, <a href="#supported-agents">GitHub Copilot</a> and <a href="#supported-agents">more</a>.
|
|
14
|
+
</p>
|
|
10
15
|
|
|
11
|
-
|
|
16
|
+
---
|
|
12
17
|
|
|
13
|
-
|
|
18
|
+
<p align="center">
|
|
19
|
+
<a href="#install">Install</a> • <a href="#usage">Usage</a> • <a href="#why-this-exists">Why</a> • <a href="#what-verified-means">Verified</a> • <a href="#auditing-a-whole-directory">Auditing</a> • <a href="#does-the-agent-actually-load-it---discover">Discover</a> • <a href="#security-scan">Security Scan</a> • <a href="#antigravity">Antigravity</a> • <a href="#skill-discovery">Skill Discovery</a> • <a href="#what-skill-land-is-not">Is Not</a> • <a href="#project-structure">Project Structure</a> • <a href="#releasing">Releasing</a> • <a href="#related">Related</a>
|
|
20
|
+
</p>
|
|
14
21
|
|
|
15
|
-
|
|
16
|
-
for 13 agents, including Codex, Antigravity, Cursor, GitHub Copilot, Gemini CLI and
|
|
17
|
-
opencode. Reproduced against `skills@1.5.22` (latest) on 2026-08-08:
|
|
22
|
+
---
|
|
18
23
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
0
|
|
27
|
-
$ ls ~/.codex/skills/
|
|
28
|
-
# empty. Codex never sees it.
|
|
24
|
+
## Install
|
|
25
|
+
|
|
26
|
+
No install step. Run it with `npx`:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npx skill-land Magithar/SKILLmama --for codex,antigravity # install, then verify
|
|
30
|
+
npx skill-land Magithar/SKILLmama --for codex --verify # audit an existing install
|
|
29
31
|
```
|
|
30
32
|
|
|
31
|
-
The
|
|
32
|
-
|
|
33
|
-
`.agents/skills` as "universal", and `getAgentBaseDir()` then routes it to the
|
|
34
|
-
canonical store, discarding `globalSkillsDir`:
|
|
33
|
+
The examples throughout use [SKILLmama](https://github.com/Magithar/SKILLmama), a capability
|
|
34
|
+
discovery skill by the same author. Any GitHub repo, local folder or `SKILL.md` works as a source.
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
Or install it globally:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
npm install -g skill-land
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
Node 18 or later. No dependencies.
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
### Supported agents
|
|
45
|
+
|
|
46
|
+
| Agent | `--for` | Upstream `skills add -g` |
|
|
47
|
+
|-------|---------|--------------------------|
|
|
48
|
+
| Claude Code | `claude-code` | works |
|
|
49
|
+
| OpenAI Codex | `codex` | writes to the wrong directory |
|
|
50
|
+
| Antigravity | `antigravity` | writes to the wrong directory ([details](#antigravity)) |
|
|
51
|
+
| Antigravity CLI | `antigravity-cli` | writes to the wrong directory |
|
|
52
|
+
| Gemini CLI | `gemini-cli` | writes to the wrong directory |
|
|
53
|
+
| Cursor | `cursor` | writes to the wrong directory |
|
|
54
|
+
| GitHub Copilot | `github-copilot` | writes to the wrong directory |
|
|
55
|
+
| opencode | `opencode` | writes to the wrong directory |
|
|
56
|
+
| Firebender | `firebender` | writes to the wrong directory |
|
|
57
|
+
| Amp | `amp` | writes to the wrong directory |
|
|
58
|
+
|
|
59
|
+
`skill-land --list` prints every agent with the directories it writes to.
|
|
60
|
+
|
|
61
|
+
---
|
|
46
62
|
|
|
47
63
|
## Usage
|
|
48
64
|
|
|
@@ -77,41 +93,43 @@ skill-land Magithar/SKILLmama --for codex --verify
|
|
|
77
93
|
skill-land ~/.agents/skills --for antigravity --verify --all
|
|
78
94
|
```
|
|
79
95
|
|
|
80
|
-
|
|
96
|
+
---
|
|
81
97
|
|
|
82
|
-
|
|
83
|
-
[`selectSkill()`](skill-land.mjs) refuses to guess when a source holds several,
|
|
84
|
-
and `--all` is you saying you meant all of them.
|
|
98
|
+
## Why this exists
|
|
85
99
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
the ecosystem reads an install back:
|
|
100
|
+
`npx skills add -a <agent> -g` reports success while writing to the wrong directory
|
|
101
|
+
for 13 agents, including Codex, Antigravity, Cursor, GitHub Copilot, Gemini CLI and
|
|
102
|
+
opencode. Reproduced against `skills@1.5.22` (latest) on 2026-08-08:
|
|
90
103
|
|
|
91
104
|
```
|
|
92
|
-
$
|
|
105
|
+
$ npx skills add Magithar/SKILLmama -a codex -g -y
|
|
106
|
+
copy → Codex
|
|
107
|
+
✓ SKILLmama (copied)
|
|
108
|
+
→ ~/.agents/skills/skillmama
|
|
109
|
+
Done!
|
|
110
|
+
$ echo $?
|
|
111
|
+
0
|
|
112
|
+
$ ls ~/.codex/skills/
|
|
113
|
+
# empty. Codex never sees it.
|
|
114
|
+
```
|
|
93
115
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
116
|
+
The correct path is in the CLI's own registry and never read. `isUniversalAgent()`
|
|
117
|
+
(`dist/cli.mjs:1678`) classifies any agent whose *project* directory is
|
|
118
|
+
`.agents/skills` as "universal", and `getAgentBaseDir()` then routes it to the
|
|
119
|
+
canonical store, discarding `globalSkillsDir`:
|
|
120
|
+
|
|
121
|
+
```js
|
|
122
|
+
function isUniversalAgent(type) {
|
|
123
|
+
return agents[type].skillsDir === ".agents/skills";
|
|
124
|
+
}
|
|
102
125
|
```
|
|
103
126
|
|
|
104
|
-
|
|
105
|
-
10401 bytes and they are not the same file. A copy that drifted after install
|
|
106
|
-
looks identical to `ls`.
|
|
127
|
+
Every failure of this kind exits 0. Nothing in the ecosystem checks the install took.
|
|
107
128
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
you have to re-run to act on is not a summary.
|
|
129
|
+
A second, separate bug: `-a claude-code,antigravity` is rejected as "Invalid agents"
|
|
130
|
+
while both names appear in the valid list it prints.
|
|
111
131
|
|
|
112
|
-
|
|
113
|
-
exits non-zero and lists what it skipped. All-or-nothing across a directory would
|
|
114
|
-
let one flagged skill block every clean one.
|
|
132
|
+
---
|
|
115
133
|
|
|
116
134
|
## What "verified" means
|
|
117
135
|
|
|
@@ -149,31 +167,6 @@ This is a warning and does not change the exit code, because an installed direct
|
|
|
149
167
|
files a person or the agent added, and nothing here can tell those from stale ones. `skill-land`
|
|
150
168
|
never deletes them. It is skipped for a raw `.md` source, which only knows about `SKILL.md`.
|
|
151
169
|
|
|
152
|
-
### Does the agent actually load it? `--discover`
|
|
153
|
-
|
|
154
|
-
Everything above proves the bytes are on disk. It does not prove the agent loads them: it may
|
|
155
|
-
need a restart, reject the frontmatter, or read the directory only in some workspaces.
|
|
156
|
-
`--discover` starts a fresh non-interactive session from a neutral directory and checks that the
|
|
157
|
-
skill name appears in what the agent says it can see.
|
|
158
|
-
|
|
159
|
-
```bash
|
|
160
|
-
skill-land Magithar/SKILLmama --for codex,antigravity --discover
|
|
161
|
-
```
|
|
162
|
-
|
|
163
|
-
| Agent | Listing used | Kind |
|
|
164
|
-
|---|---|---|
|
|
165
|
-
| Antigravity | `agy -p /skills` | a real skill list |
|
|
166
|
-
| Gemini CLI | `gemini skills list` | a real skill list, with enabled/disabled state |
|
|
167
|
-
| Codex | `codex exec "list your skills"` | asks the model |
|
|
168
|
-
| Claude Code | `claude -p "list your skills"` | asks the model |
|
|
169
|
-
|
|
170
|
-
Each was tested by planting a uniquely named canary skill and confirming it appeared, then with real skills from git. A skill that is listed but switched off (Gemini CLI prints `[Disabled]`) fails: on disk and listed is not the same as loaded. Every other
|
|
171
|
-
agent reports `NOT CHECKED`, never a pass: an unknown is not a success. A missing binary or a
|
|
172
|
-
timeout is also `NOT CHECKED`; only a completed listing that lacks the skill fails the run.
|
|
173
|
-
|
|
174
|
-
The Codex and Claude Code listings go through the model, so they cost an API call and a `FAIL`
|
|
175
|
-
is a lead to investigate, not proof. It is opt-in for that reason, and skipped with `--project`.
|
|
176
|
-
|
|
177
170
|
### What it cannot tell you
|
|
178
171
|
|
|
179
172
|
Verification assumes the installer **copied**. Some installers **rewrite** on install — the
|
|
@@ -190,65 +183,74 @@ never looked at. There is no uninstall command, so delete the old directory by h
|
|
|
190
183
|
Tested against: truncated file, wrong skill in the right place, missing file,
|
|
191
184
|
unwritable destination, and a real `npx skills add` install (correctly reported FAIL).
|
|
192
185
|
|
|
193
|
-
|
|
186
|
+
---
|
|
194
187
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
188
|
+
## Auditing a whole directory
|
|
189
|
+
|
|
190
|
+
`--all` takes every skill in the source instead of one. It is never the default:
|
|
191
|
+
[`selectSkill()`](skill-land.mjs) refuses to guess when a source holds several,
|
|
192
|
+
and `--all` is you saying you meant all of them.
|
|
193
|
+
|
|
194
|
+
The use it was built for is `--verify --all` — checking whether the skills you
|
|
195
|
+
already installed are where the agent actually reads, whatever put them there.
|
|
196
|
+
That question is unanswerable today even if your setup works, because nothing in
|
|
197
|
+
the ecosystem reads an install back:
|
|
198
198
|
|
|
199
199
|
```
|
|
200
|
-
~/.
|
|
201
|
-
|
|
202
|
-
|
|
200
|
+
$ skill-land ~/.agents/skills --for antigravity --verify --all
|
|
201
|
+
|
|
202
|
+
source /Users/you/.agents/skills
|
|
203
|
+
skills 1 found
|
|
204
|
+
impeccable FAIL 0/3
|
|
205
|
+
x ~/.gemini/config/skills/impeccable/SKILL.md
|
|
206
|
+
file exists: ~/.gemini/config/skills/impeccable/SKILL.md
|
|
207
|
+
x ~/.gemini/skills/impeccable/SKILL.md
|
|
208
|
+
content matches source: 10401 bytes sha abd76e36cf1d vs 10401 bytes sha a1ea82ce80f4
|
|
209
|
+
1 skill, 3 failed
|
|
203
210
|
```
|
|
204
211
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
reads the same list is **unverified**.
|
|
212
|
+
That middle line is why the check compares hashes and not sizes: both files are
|
|
213
|
+
10401 bytes and they are not the same file. A copy that drifted after install
|
|
214
|
+
looks identical to `ls`.
|
|
209
215
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
skills resolve to `skills/<name>/` under a *customization root*. Both roots we write
|
|
214
|
-
to are named in the shipped strings and config:
|
|
216
|
+
One line per skill, because a report nobody reads verifies nothing; `--verbose`
|
|
217
|
+
restores the full per-target output. Failing paths are always named — a summary
|
|
218
|
+
you have to re-run to act on is not a summary.
|
|
215
219
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
220
|
+
With `--strict`, a flagged skill is skipped and the rest still install; the run
|
|
221
|
+
exits non-zero and lists what it skipped. All-or-nothing across a directory would
|
|
222
|
+
let one flagged skill block every clean one.
|
|
219
223
|
|
|
220
|
-
|
|
221
|
-
Antigravity created that directory itself. That reasoning was wrong: `app.asar` defines
|
|
222
|
-
`~/.gemini/antigravity` as `IDE_OLD_DATA_DIR`, the **legacy IDE data directory** being
|
|
223
|
-
migrated to `~/.gemini/antigravity-ide`. It was never a skills root. No longer written.
|
|
224
|
+
---
|
|
224
225
|
|
|
225
|
-
|
|
226
|
+
## Does the agent actually load it? `--discover`
|
|
226
227
|
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
a neutral
|
|
228
|
+
Everything above proves the bytes are on disk. It does not prove the agent loads them: it may
|
|
229
|
+
need a restart, reject the frontmatter, or read the directory only in some workspaces.
|
|
230
|
+
`--discover` starts a fresh non-interactive session from a neutral directory and checks that the
|
|
231
|
+
skill name appears in what the agent says it can see.
|
|
230
232
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
| `~/.gemini/skills` | **yes** |
|
|
235
|
-
| `~/.gemini/antigravity-cli/skills` | **yes** |
|
|
236
|
-
| `~/.agents/skills` | no |
|
|
237
|
-
| `~/.gemini/antigravity/skills` | no |
|
|
233
|
+
```bash
|
|
234
|
+
skill-land Magithar/SKILLmama --for codex,antigravity --discover
|
|
235
|
+
```
|
|
238
236
|
|
|
239
|
-
|
|
240
|
-
|
|
237
|
+
| Agent | Listing used | Kind |
|
|
238
|
+
|---|---|---|
|
|
239
|
+
| Antigravity | `agy -p /skills` | a real skill list |
|
|
240
|
+
| Gemini CLI | `gemini skills list` | a real skill list, with enabled/disabled state |
|
|
241
|
+
| Codex | `codex exec "list your skills"` | asks the model |
|
|
242
|
+
| Claude Code | `claude -p "list your skills"` | asks the model |
|
|
241
243
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
is
|
|
244
|
+
Each was tested by planting a uniquely named canary skill and confirming it appeared, then with
|
|
245
|
+
real skills from git. A skill that is listed but switched off (Gemini CLI prints `[Disabled]`)
|
|
246
|
+
fails: on disk and listed is not the same as loaded. Every other agent reports `NOT CHECKED`,
|
|
247
|
+
never a pass: an unknown is not a success. A missing binary or a timeout is also `NOT CHECKED`;
|
|
248
|
+
only a completed listing that lacks the skill fails the run.
|
|
246
249
|
|
|
247
|
-
|
|
248
|
-
a
|
|
249
|
-
`.antigravity/skills` and `.agy/skills` are not read at all.
|
|
250
|
+
The Codex and Claude Code listings go through the model, so they cost an API call and a `FAIL`
|
|
251
|
+
is a lead to investigate, not proof. It is opt-in for that reason, and skipped with `--project`.
|
|
250
252
|
|
|
251
|
-
|
|
253
|
+
---
|
|
252
254
|
|
|
253
255
|
## Security scan
|
|
254
256
|
|
|
@@ -340,6 +342,70 @@ security SAFE SAFE, LOW, score 7, 2 issue(s)
|
|
|
340
342
|
credentials, which would silently degrade this gate to a no-op for anyone without an API key. A
|
|
341
343
|
check that did not run must never read as a check that passed.
|
|
342
344
|
|
|
345
|
+
---
|
|
346
|
+
|
|
347
|
+
## Antigravity
|
|
348
|
+
|
|
349
|
+
Antigravity loads skills at startup, so an install cannot be confirmed live. The
|
|
350
|
+
`agy` search path was stated by an Antigravity maintainer on 2026-09-05 in
|
|
351
|
+
[antigravity-cli#103](https://github.com/google-antigravity/antigravity-cli/issues/103#issuecomment-5547952239):
|
|
352
|
+
|
|
353
|
+
```
|
|
354
|
+
~/.gemini/config/skills primary; independently confirmed by live testing
|
|
355
|
+
~/.gemini/skills fallback
|
|
356
|
+
~/.gemini/antigravity-cli/skills fallback
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
`--for antigravity` writes to all three and says so. The `language_server` binary
|
|
360
|
+
contains `skillsPaths` and `skills_paths`, so this is a configurable list rather than a
|
|
361
|
+
single directory, and the maintainer statement covers the CLI — whether the IDE surface
|
|
362
|
+
reads the same list is **unverified**.
|
|
363
|
+
|
|
364
|
+
Checked against the shipped binaries (Antigravity 2026-07-30 build, inspected
|
|
365
|
+
2026-09-05). `language_server` contains **no** `.gemini/*/skills` literal at all:
|
|
366
|
+
`skills_paths` is a repeated protobuf field, so the client passes the list in, and
|
|
367
|
+
skills resolve to `skills/<name>/` under a *customization root*. Both roots we write
|
|
368
|
+
to are named in the shipped strings and config:
|
|
369
|
+
|
|
370
|
+
- `~/.gemini/config/` holds `config.json` and `skills/` — the global root
|
|
371
|
+
- `~/.gemini/antigravity-cli/` — "The CLI is configured via
|
|
372
|
+
`~/.gemini/antigravity-cli/settings.json`" (`language_server`)
|
|
373
|
+
|
|
374
|
+
1.1.0 and earlier also wrote `~/.gemini/antigravity/skills`, on the reasoning that
|
|
375
|
+
Antigravity created that directory itself. That reasoning was wrong: `app.asar` defines
|
|
376
|
+
`~/.gemini/antigravity` as `IDE_OLD_DATA_DIR`, the **legacy IDE data directory** being
|
|
377
|
+
migrated to `~/.gemini/antigravity-ide`. It was never a skills root. No longer written.
|
|
378
|
+
|
|
379
|
+
### Live verification
|
|
380
|
+
|
|
381
|
+
Confirmed against **`agy` 1.1.27 on 2026-09-05**, not inferred. A uniquely-named
|
|
382
|
+
canary skill was planted in each candidate directory and `agy -p "/skills"` run from
|
|
383
|
+
a neutral workspace:
|
|
384
|
+
|
|
385
|
+
| directory | listed? |
|
|
386
|
+
|---|---|
|
|
387
|
+
| `~/.gemini/config/skills` | **yes** |
|
|
388
|
+
| `~/.gemini/skills` | **yes** |
|
|
389
|
+
| `~/.gemini/antigravity-cli/skills` | **yes** |
|
|
390
|
+
| `~/.agents/skills` | no |
|
|
391
|
+
| `~/.gemini/antigravity/skills` | no |
|
|
392
|
+
|
|
393
|
+
All three directories `skill-land` writes to are read. The two it does not write to
|
|
394
|
+
are not.
|
|
395
|
+
|
|
396
|
+
`~/.agents/skills` appears **only** when its parent is the active workspace
|
|
397
|
+
(`agy --add-dir $HOME`) — that is project-local behaviour, not a global search path,
|
|
398
|
+
which is exactly what [#103](https://github.com/google-antigravity/antigravity-cli/issues/103)
|
|
399
|
+
is asking to change. Confirmed still open at 1.1.27.
|
|
400
|
+
|
|
401
|
+
Two side findings: project-local `.agents/skills` is read only when the directory is
|
|
402
|
+
a **registered workspace** — being the current directory was not enough — and
|
|
403
|
+
`.antigravity/skills` and `.agy/skills` are not read at all.
|
|
404
|
+
|
|
405
|
+
Restart Antigravity fully after installing.
|
|
406
|
+
|
|
407
|
+
---
|
|
408
|
+
|
|
343
409
|
## Skill discovery
|
|
344
410
|
|
|
345
411
|
Walks up to 10 levels, skipping only `.git`, `node_modules`, `.venv` and
|
|
@@ -358,32 +424,64 @@ $ skill-land product-on-purpose/pm-skills --for codex
|
|
|
358
424
|
...
|
|
359
425
|
```
|
|
360
426
|
|
|
427
|
+
---
|
|
428
|
+
|
|
429
|
+
## What skill-land Is Not
|
|
430
|
+
|
|
431
|
+
- Not a registry or a package manager
|
|
432
|
+
- Not a publisher
|
|
433
|
+
- Not a content transformer: no per-platform rewrites
|
|
434
|
+
|
|
435
|
+
skill-land **installs and verifies**. One `SKILL.md` works across all of these agents; the failure
|
|
436
|
+
mode here is a wrong-path bug, not a content-format problem.
|
|
437
|
+
|
|
438
|
+
---
|
|
439
|
+
|
|
440
|
+
## Project Structure
|
|
441
|
+
|
|
442
|
+
```
|
|
443
|
+
skill-land.mjs the CLI: resolve, scan, copy, read back, discover
|
|
444
|
+
agents.json every agent's skill directories; broken: true marks upstream misroutes
|
|
445
|
+
test.mjs test suite (node test.mjs)
|
|
446
|
+
CHANGELOG.md release notes, one section per version
|
|
447
|
+
.github/workflows/
|
|
448
|
+
check.yml runs the tests on every push and pull request
|
|
449
|
+
publish.yml publishes to npm on a v* tag
|
|
450
|
+
```
|
|
451
|
+
|
|
452
|
+
### Adding an agent
|
|
453
|
+
|
|
454
|
+
Edit `agents.json`. `broken: true` marks agents where the upstream CLI misroutes a
|
|
455
|
+
global install, which is what drives the warning note.
|
|
456
|
+
|
|
457
|
+
---
|
|
458
|
+
|
|
361
459
|
## Releasing
|
|
362
460
|
|
|
363
461
|
Published from CI by [trusted publishing](https://docs.npmjs.com/trusted-publishers), so there is
|
|
364
462
|
no `NPM_TOKEN` in this repo and the npm account keeps 2FA on write actions. npm mints a
|
|
365
|
-
short-lived token from the GitHub identity of `.github/workflows/publish
|
|
463
|
+
short-lived token from the GitHub identity of `.github/workflows/publish.yml`.
|
|
366
464
|
|
|
367
465
|
```bash
|
|
368
|
-
# bump version in package.json, commit, then:
|
|
369
|
-
git tag
|
|
370
|
-
git push origin
|
|
466
|
+
# bump version in package.json, add a CHANGELOG section, commit, then:
|
|
467
|
+
git tag v1.8.0
|
|
468
|
+
git push origin v1.8.0
|
|
371
469
|
```
|
|
372
470
|
|
|
373
471
|
CI runs the tests, refuses to publish a version that already exists, checks the tag matches
|
|
374
|
-
`package.json`,
|
|
375
|
-
independently.
|
|
472
|
+
`package.json`, publishes, and creates the GitHub release from that version's CHANGELOG section.
|
|
376
473
|
|
|
377
|
-
|
|
474
|
+
Releases up to 1.7.0 were made from [Magithar/skills](https://github.com/Magithar/skills), where
|
|
475
|
+
skill-land used to live under `tools/skill-land/`.
|
|
378
476
|
|
|
379
|
-
|
|
380
|
-
global install, which is what drives the warning note.
|
|
477
|
+
---
|
|
381
478
|
|
|
382
|
-
##
|
|
479
|
+
## Related
|
|
383
480
|
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
481
|
+
- [SKILLmama](https://github.com/Magithar/SKILLmama), capability discovery engine: finds and ranks
|
|
482
|
+
the libraries, SDKs and tools for your stack. The skill used in the examples above.
|
|
483
|
+
- [Magithar/skills](https://github.com/Magithar/skills), agent skills installable as a Claude Code
|
|
484
|
+
plugin, including `dep-egress` and `evidence-loop`.
|
|
387
485
|
|
|
388
486
|
---
|
|
389
487
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "skill-land",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.1",
|
|
4
4
|
"description": "Install an agent skill to the directory the agent actually reads, then verify it landed. Exits non-zero if it didn't.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agent-skills",
|
|
@@ -12,14 +12,13 @@
|
|
|
12
12
|
"install",
|
|
13
13
|
"verify"
|
|
14
14
|
],
|
|
15
|
-
"homepage": "https://github.com/Magithar/
|
|
15
|
+
"homepage": "https://github.com/Magithar/skill-land#readme",
|
|
16
16
|
"bugs": {
|
|
17
|
-
"url": "https://github.com/Magithar/
|
|
17
|
+
"url": "https://github.com/Magithar/skill-land/issues"
|
|
18
18
|
},
|
|
19
19
|
"repository": {
|
|
20
20
|
"type": "git",
|
|
21
|
-
"url": "git+https://github.com/Magithar/
|
|
22
|
-
"directory": "tools/skill-land"
|
|
21
|
+
"url": "git+https://github.com/Magithar/skill-land.git"
|
|
23
22
|
},
|
|
24
23
|
"author": "Magithar",
|
|
25
24
|
"license": "MIT",
|
package/skill-land.mjs
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
import { execFileSync } from "child_process";
|
|
13
13
|
import { createHash } from "crypto";
|
|
14
14
|
import {
|
|
15
|
-
|
|
15
|
+
copyFileSync, existsSync, mkdirSync, mkdtempSync, readdirSync,
|
|
16
16
|
readFileSync, realpathSync, rmSync, statSync, writeFileSync,
|
|
17
17
|
} from "fs";
|
|
18
18
|
import { homedir, tmpdir } from "os";
|
|
@@ -180,17 +180,36 @@ function collectSkillFiles(skillDir, skillFile) {
|
|
|
180
180
|
(a === skillFile ? -1 : b === skillFile ? 1 : 0) || a.localeCompare(b));
|
|
181
181
|
}
|
|
182
182
|
|
|
183
|
+
// CRLF is normalised first: a SKILL.md saved on Windows otherwise has no
|
|
184
|
+
// frontmatter at all, and its skill was installed under a placeholder name.
|
|
185
|
+
// YAML quotes are stripped, so `name: "foo"` is foo, not "foo" (-foo- on disk).
|
|
183
186
|
function parseFrontmatter(text) {
|
|
184
|
-
const m = text.match(/^---\n([\s\S]*?)\n
|
|
187
|
+
const m = text.replace(/\r\n/g, "\n").match(/^---\n([\s\S]*?)\n---(\n|$)/);
|
|
185
188
|
if (!m) return {};
|
|
186
189
|
const fm = {};
|
|
187
190
|
for (const line of m[1].split("\n")) {
|
|
188
191
|
const i = line.indexOf(":");
|
|
189
|
-
if (i > 0) fm[line.slice(0, i).trim()] = line.slice(i + 1).trim();
|
|
192
|
+
if (i > 0) fm[line.slice(0, i).trim()] = line.slice(i + 1).trim().replace(/^(["'])(.*)\1$/, "$2");
|
|
190
193
|
}
|
|
191
194
|
return fm;
|
|
192
195
|
}
|
|
193
196
|
|
|
197
|
+
// The directory name a skill installs under. Without a frontmatter name this
|
|
198
|
+
// used to be the literal "skill" for every one, so --all wrote several skills
|
|
199
|
+
// into one directory, each over the last, and reported all of them OK. Fall
|
|
200
|
+
// back to the folder the skill lives in, which is what it is called on disk.
|
|
201
|
+
function skillNameOf(skillPath, root) {
|
|
202
|
+
const fm = parseFrontmatter(readFileSync(skillPath, "utf-8"));
|
|
203
|
+
const dir = dirname(skillPath);
|
|
204
|
+
// At the source root the folder is a temp clone; use what the source is called.
|
|
205
|
+
const folder = dir !== root ? basename(dir)
|
|
206
|
+
: src.kind === "repo" ? src.label.split("/")[1]
|
|
207
|
+
: src.kind === "dir" ? basename(src.dir) : "";
|
|
208
|
+
const name = (fm.name || folder || "skill").toLowerCase()
|
|
209
|
+
.replace(/[^a-z0-9._-]+/g, "-").replace(/^[-.]+|-+$/g, "");
|
|
210
|
+
return name || "skill";
|
|
211
|
+
}
|
|
212
|
+
|
|
194
213
|
// ---------------------------------------------------------------- security
|
|
195
214
|
|
|
196
215
|
// A skill is instructions an agent executes with full permissions, so the one
|
|
@@ -325,7 +344,10 @@ function verify(target, expected) {
|
|
|
325
344
|
// it read 25266 for a 25546-byte file and would pass two different files
|
|
326
345
|
// that happened to share a character count.
|
|
327
346
|
const raw = readFileSync(target);
|
|
328
|
-
|
|
347
|
+
// Empty only fails when the source was not empty. A skill may ship an empty
|
|
348
|
+
// file on purpose (scripts/__init__.py in anthropics/skills), and calling
|
|
349
|
+
// that a failed install blocked every skill that has one.
|
|
350
|
+
ok("non-empty", raw.length > 0 || expected.bytes === 0, `${raw.length} bytes`);
|
|
329
351
|
const gotHash = sha256(raw);
|
|
330
352
|
ok("content matches source", gotHash === expected.hash,
|
|
331
353
|
`${raw.length} bytes sha ${gotHash.slice(0, 12)} vs ${expected.bytes} bytes sha ${expected.hash.slice(0, 12)}`);
|
|
@@ -373,14 +395,41 @@ function runSkill(skillPath, root, quiet) {
|
|
|
373
395
|
let skillSkipped = false;
|
|
374
396
|
const body = readFileSync(skillPath, "utf-8");
|
|
375
397
|
const fm = parseFrontmatter(body);
|
|
376
|
-
const skillName = (
|
|
398
|
+
const skillName = skillNameOf(skillPath, root);
|
|
377
399
|
const rawBody = readFileSync(skillPath);
|
|
378
400
|
|
|
379
401
|
// The skill is the directory SKILL.md sits in. `name` is set only on SKILL.md
|
|
380
402
|
// so the frontmatter check does not run against scripts and reference docs.
|
|
381
403
|
const skillDir = dirname(skillPath);
|
|
382
404
|
const skillFile = basename(skillPath);
|
|
383
|
-
const
|
|
405
|
+
const allRels = collectSkillFiles(skillDir, skillFile);
|
|
406
|
+
|
|
407
|
+
// Symlinks are copied as their contents (see copyFileSync below), so a link must
|
|
408
|
+
// resolve inside the source. Copying the link itself left it pointing into the
|
|
409
|
+
// temp clone, deleted on exit, after it had already read back as verified. And
|
|
410
|
+
// a link out of the source, say to ~/.ssh/id_rsa, would place that file where
|
|
411
|
+
// an agent auto-loads it, whether copied as a link or as bytes. Refuse that
|
|
412
|
+
// for cloned repos, which are untrusted. A local path is the user's own disk,
|
|
413
|
+
// and links out of it are normal (the skills CLI installs by symlink), so
|
|
414
|
+
// there a link only has to reach a real file.
|
|
415
|
+
const rootReal = realpathSync(root);
|
|
416
|
+
const confine = src.kind === "repo";
|
|
417
|
+
const badLinks = allRels.filter((rel) => {
|
|
418
|
+
try {
|
|
419
|
+
const real = realpathSync(join(skillDir, rel));
|
|
420
|
+
const inside = real === rootReal || real.startsWith(rootReal + "/");
|
|
421
|
+
return (confine && !inside) || !statSync(real).isFile();
|
|
422
|
+
} catch { return true; } // dangling
|
|
423
|
+
});
|
|
424
|
+
if (badLinks.length) {
|
|
425
|
+
const shown = badLinks.slice(0, 5).join(", ") + (badLinks.length > 5 ? ` +${badLinks.length - 5} more` : "");
|
|
426
|
+
const why = confine ? "points outside the repo, at a directory, or nowhere" : "points at a directory or nowhere";
|
|
427
|
+
if (quiet) console.log(` ${skillName.slice(0, 28).padEnd(30)}${red("FAIL")} symlink ${why}: ${shown}`);
|
|
428
|
+
else console.error(`\n error ${skillName}: symlink ${why}\n ${shown}\n Nothing was written for this skill.\n`);
|
|
429
|
+
return { name: skillName, fmName: fm.name, failed: 1, skipped: false, leftovers: 0 };
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
const files = allRels.map((rel) => {
|
|
384
433
|
const raw = readFileSync(join(skillDir, rel));
|
|
385
434
|
return { rel, bytes: raw.length, hash: sha256(raw),
|
|
386
435
|
name: rel === skillFile ? fm.name : undefined };
|
|
@@ -407,7 +456,7 @@ function runSkill(skillPath, root, quiet) {
|
|
|
407
456
|
};
|
|
408
457
|
|
|
409
458
|
if (quiet) {
|
|
410
|
-
process.stdout.write(` ${(fm.name ||
|
|
459
|
+
process.stdout.write(` ${(fm.name || skillName).slice(0, 28).padEnd(30)}`);
|
|
411
460
|
} else {
|
|
412
461
|
console.log(`\n source ${tilde(src.label)}`);
|
|
413
462
|
console.log(` skill ${fm.name || "(no frontmatter name)"} [${files.length} file${files.length === 1 ? "" : "s"}, ${fmtBytes(totalBytes)}, SKILL.md sha ${files[0].hash.slice(0,12)}]`);
|
|
@@ -474,7 +523,9 @@ function runSkill(skillPath, root, quiet) {
|
|
|
474
523
|
if (!verifyOnly) {
|
|
475
524
|
try {
|
|
476
525
|
mkdirSync(dirname(target), { recursive: true });
|
|
477
|
-
|
|
526
|
+
// copyFileSync follows links: install the bytes, never a link back into the
|
|
527
|
+
// source. Links were checked above to stay inside it.
|
|
528
|
+
copyFileSync(join(skillDir, f.rel), target);
|
|
478
529
|
} catch (e) {
|
|
479
530
|
writeErr = `${e.code || "error"}: ${e.message.split("\n")[0]}`;
|
|
480
531
|
}
|
|
@@ -714,6 +765,15 @@ if (argv.includes("--list")) {
|
|
|
714
765
|
process.exit(0);
|
|
715
766
|
}
|
|
716
767
|
|
|
768
|
+
// An unknown flag is an error, not ignored. `--verfy` meant "check, write
|
|
769
|
+
// nothing" and ran a full install; `--dryrun` would have written too.
|
|
770
|
+
const BOOL_FLAGS = new Set(["--project", "--dry-run", "--verify", "--discover",
|
|
771
|
+
"--skip-security", "--strict", "--all", "--verbose"]);
|
|
772
|
+
for (const a of argv) {
|
|
773
|
+
if (a.startsWith("-") && !BOOL_FLAGS.has(a) && a !== "--for" && a !== "--skill")
|
|
774
|
+
die(`unknown option "${a}"\n see skill-land --help`);
|
|
775
|
+
}
|
|
776
|
+
|
|
717
777
|
const flag = (n) => argv.includes(n);
|
|
718
778
|
const values = (n) => argv.reduce((acc, a, i) =>
|
|
719
779
|
a === n && argv[i + 1] ? acc.concat(argv[i + 1].split(",")) : acc, []);
|
|
@@ -754,6 +814,20 @@ try {
|
|
|
754
814
|
|
|
755
815
|
// With --all the per-skill detail becomes a wall nobody reads, and an unread
|
|
756
816
|
// report verifies nothing. Collapse to one line each unless asked otherwise.
|
|
817
|
+
// Two skills that install under one directory name would overwrite each other
|
|
818
|
+
// and both read back as verified (each check runs right after its own write).
|
|
819
|
+
// Refuse before writing anything.
|
|
820
|
+
const byName = new Map();
|
|
821
|
+
for (const p of skillPaths) {
|
|
822
|
+
const n = skillNameOf(p, root);
|
|
823
|
+
byName.set(n, [...(byName.get(n) || []), p]);
|
|
824
|
+
}
|
|
825
|
+
const clashes = [...byName].filter(([, ps]) => ps.length > 1);
|
|
826
|
+
if (clashes.length)
|
|
827
|
+
die(`${clashes.length} install name(s) shared by more than one skill; they would overwrite each other:\n` +
|
|
828
|
+
clashes.map(([n, ps]) => ` ${n} ${ps.map((p) => p.replace(root, ".")).join(", ")}`).join("\n") +
|
|
829
|
+
`\n Give each a distinct frontmatter name, or install them one by one with --skill.`);
|
|
830
|
+
|
|
757
831
|
const quiet = allSkills && !verbose;
|
|
758
832
|
if (quiet) console.log(`\n source ${src.label}\n skills ${skillPaths.length} found`);
|
|
759
833
|
|
|
@@ -793,8 +867,12 @@ if (leftovers) {
|
|
|
793
867
|
console.log(` The agent can still read them. Nothing was removed; review and delete by hand.\n`);
|
|
794
868
|
}
|
|
795
869
|
|
|
796
|
-
|
|
797
|
-
|
|
870
|
+
// A skill --strict refused was not installed, so the run did not do what was
|
|
871
|
+
// asked. It used to print "verified" and exit 0, which a CI gate reads as pass.
|
|
872
|
+
if (failed || skipped.length) {
|
|
873
|
+
if (failed) console.error(` ${red(`✗ ${failed} install(s) failed verification`)}`);
|
|
874
|
+
if (skipped.length) console.error(` ${red(`✗ ${skipped.length} skill(s) not installed: refused by --strict`)} ${skipped.join(", ")}`);
|
|
875
|
+
console.error("");
|
|
798
876
|
process.exit(1);
|
|
799
877
|
}
|
|
800
878
|
// Close on the outcome in plain words: what is ready, and for which agent.
|