skilld 3.6.7 → 3.6.8

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
@@ -166,9 +166,14 @@ The script installs one native binary to `~/.skilld/bin`.
166
166
  It adds that directory to PATH: in your shell profile on macOS and Linux, in your user PATH on Windows.
167
167
  On macOS and Linux, set `SKILLD_NO_MODIFY_PATH=1` to leave your shell profile alone.
168
168
 
169
- The script install upgrades itself in the background after it verifies the signed release manifest.
169
+ skilld checks for CLI upgrades in the background once a day.
170
+ If a newer release is cached, the next terminal invocation offers to upgrade.
171
+ Choose `Upgrade now`, `Not now`, or `Don't remind me for this version`.
172
+ The script install verifies the signed release manifest before replacing the executable.
170
173
  Restart skilld to use the new version.
171
- An npm install prints the upgrade command instead.
174
+ Recognized global npm, pnpm, Yarn, and Bun installs run their package manager after you confirm.
175
+ Local and transient installs show upgrade guidance instead.
176
+ After an upgrade, run your command again.
172
177
  Set `SKILLD_NO_UPGRADE=1` to turn off upgrade checks.
173
178
  See [SECURITY.md](./SECURITY.md#how-the-cli-upgrades-itself) for each check.
174
179
 
@@ -351,6 +356,11 @@ skilld update --check --json
351
356
  skilld update <skill>
352
357
  skilld verify <skill>
353
358
 
359
+ # Sweep Skill files and review cleanup actions
360
+ skilld doctor
361
+ skilld doctor ./apps --json
362
+ skilld doctor --exclude '**/archive/**'
363
+
354
364
  # Remove a Skill
355
365
  skilld remove <skill>
356
366
  ```
@@ -359,6 +369,55 @@ Project installs update `.skills/skilld-lock.yaml` and the selected Agent target
359
369
  Use `--global` (or `-g`) for account-level Agent targets.
360
370
  Use `--mode copy` or `--mode symlink` to control target writes.
361
371
 
372
+ ### Review Skill files
373
+
374
+ `skilld doctor` scans your home directory and opens a terminal UI.
375
+ Pass roots to narrow the scan. Use `--json` or `--plain` for a read-only report.
376
+ The default scan skips links and ownership metadata outside your home directory.
377
+ Pass explicit roots when you need those locations.
378
+ Progress shows the current phase, directory counts, and elapsed time.
379
+ The scan includes hidden `.claude/skills` directories and lists `CLAUDE.md` and `.claude/commands` files separately.
380
+
381
+ Default exclude globs prune dependencies, builds, caches, plugin staging, sessions, backups, and fixtures before reading their children.
382
+ The scan skips general `~/.local` discovery, including worker homes and cached bundles.
383
+ Configured Agent Skill directories and the configured skilld store remain included within the requested scan roots.
384
+ Skill symlinks can still resolve into `~/.local`. Their neighboring directories are not scanned.
385
+ Configured roots still honor exclude globs. Use `--include-excluded` for a broad `.local` scan.
386
+ Git worktrees are skipped, including explicit roots and links into worktrees.
387
+ Main checkouts and submodules remain included.
388
+ Use `--include-excluded` or `--include-worktrees` when you need those files.
389
+ Repeat `--exclude GLOB` to add exclusions. Git internals remain excluded.
390
+ Source and plugin files retain their owners.
391
+
392
+ The first screen recommends reviewing skills.sh migration, unknown installs, ownership problems, and duplicate copies.
393
+ Open a recommendation with Enter, choose a project or folder, then choose a Skill. Escape goes back.
394
+ Managed installs, plugin Skills, and source directories have separate groups.
395
+ Press Tab to cycle through all paths, symlinks, and directories.
396
+ Details show symlink destinations and the paths of identical copies. Symlinks are not duplicate copies.
397
+ The Symlinks view includes Skills reached through linked parent folders and identifies the folder link.
398
+ Counts distinguish physical Skills from linked paths. One Skill can appear in both path views.
399
+ Filters only change the view. Cleanup reviews all targets for the selected install.
400
+ Choose a Skill, then press `m` to migrate or `d` to remove.
401
+ Review affected Agent targets before pressing Enter. Escape cancels.
402
+ Press `/` to filter by name, owner, or path. Left and right switch focus between the list and details.
403
+ Press `p` for scan problems, `n` for the full notice, or `?` for help.
404
+ After cleanup, quitting prints the completed action and backup path to your shell.
405
+ Migration keeps the scope and copy or link mode of each observed target.
406
+ It verifies source contents, preserves recorded branches, and requests approval for Skill behaviors.
407
+ When the recorded Git tree matches the installed files, migration can also replace them with the displayed source commit.
408
+ If provenance cannot establish the replacement, migration stops before changing files.
409
+
410
+ Removal backs up the selected targets and removes only their skills.sh lockfile entry.
411
+ Original targets, lock metadata, and `recovery.json` remain under `.skilld-doctor-backups` beside the skilld store.
412
+ Unknown Agent targets can also be removed after review.
413
+ Declared skilld installs, plugin files, and source directories require their existing owner's workflow.
414
+
415
+ `--check-sources` checks up to 20 source candidates through skilld.dev.
416
+ An exact directory match includes supporting files and executable modes.
417
+ A name match alone never establishes provenance.
418
+ The report retains scan problems. Exit code 1 means some files could not be checked.
419
+ Historical commit searches and project-to-global deduplication are outside this command's current actions.
420
+
362
421
  ### Read the registry
363
422
 
364
423
  These commands read skilld.dev and need no account:
@@ -465,6 +524,7 @@ The skilld-maintained Skills:
465
524
  - [`update-package-skill`](./skills/update-package-skill): update that Skill after a release, testing only what changed
466
525
  - [`generate-project-skill`](./skills/generate-project-skill): draft a Skill from a project you maintain
467
526
  - [`review-skill`](./skills/review-skill): review a Skill before you publish it
527
+ - [`skilld-tui-design`](./skills/skilld-tui-design): design and verify terminal output and interactive CLI flows
468
528
 
469
529
  When you run these Skills directly, you see every instruction and review every change.
470
530
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "skilld",
3
3
  "type": "module",
4
- "version": "3.6.7",
4
+ "version": "3.6.8",
5
5
  "description": "Search, run, install, and keep Agent Skills current. The open-source CLI behind skilld.dev.",
6
6
  "author": {
7
7
  "name": "Harlan Wilton",
@@ -39,20 +39,21 @@
39
39
  },
40
40
  "files": [
41
41
  "bin",
42
- "loader"
42
+ "loader",
43
+ "skills/skilld"
43
44
  ],
44
45
  "engines": {
45
46
  "node": ">=22.0.0"
46
47
  },
47
48
  "optionalDependencies": {
48
- "skilld-cli-darwin-arm64": "3.6.7",
49
- "skilld-cli-darwin-x64": "3.6.7",
50
- "skilld-cli-linux-arm64-gnu": "3.6.7",
51
- "skilld-cli-linux-arm64-musl": "3.6.7",
52
- "skilld-cli-linux-x64-gnu": "3.6.7",
53
- "skilld-cli-linux-x64-musl": "3.6.7",
54
- "skilld-cli-win32-arm64-msvc": "3.6.7",
55
- "skilld-cli-win32-x64-msvc": "3.6.7"
49
+ "skilld-cli-darwin-arm64": "3.6.8",
50
+ "skilld-cli-darwin-x64": "3.6.8",
51
+ "skilld-cli-linux-arm64-gnu": "3.6.8",
52
+ "skilld-cli-linux-arm64-musl": "3.6.8",
53
+ "skilld-cli-linux-x64-gnu": "3.6.8",
54
+ "skilld-cli-linux-x64-musl": "3.6.8",
55
+ "skilld-cli-win32-arm64-msvc": "3.6.8",
56
+ "skilld-cli-win32-x64-msvc": "3.6.8"
56
57
  },
57
58
  "devDependencies": {
58
59
  "@antfu/eslint-config": "^9.5.1",
@@ -0,0 +1,566 @@
1
+ ---
2
+ name: skilld
3
+ description: Operate skilld CLI for Skill discovery, use, installation, inspection, updates, authentication, configuration, restoration, and removal, including Repository, curator, and collection refs. Also read the skilld.dev registry (view, browse, trending, tracks, curators, index) and act for the user's skilld.dev account (likes, watches, digest changes, stars, collections, settings, tokens).
4
+ ---
5
+
6
+ # Use skilld CLI
7
+
8
+ Use skilld CLI to find, load, install, inspect, restore, update, verify, and remove Skills.
9
+
10
+ Run a Skill first. Install a Skill only when the user asks to keep it.
11
+ If the user asks to fork a Skill, copy its source before installing the local copy.
12
+
13
+ ## Use Agent output
14
+
15
+ Use `--json` with `search`, `run`, and `update --check`.
16
+ Use `--json` with `view` of a registry ref, and with every registry and account command below.
17
+ Their `data` is the skilld.dev answer. A command whose answer has no body returns `data: null`.
18
+ Use `--json` with `sync` and `sync --check` for declared Skills.
19
+ Use `doctor --json` for read-only Skill discovery and cleanup findings.
20
+ The remaining commands do not support JSON output.
21
+ Use `--plain` when another command needs stable text.
22
+
23
+ Check the exit code before reading stdout.
24
+ Read JSON success data only when `_tag` is `Success`.
25
+ Read JSON failures from stderr.
26
+ Report the error `code` and `message`.
27
+ A failed `skilld run` ends with a `Next step:` line. In JSON, read `error.nextStep`.
28
+ Follow that step. It says whether to retry, when, and what to tell the user.
29
+ Exit code `75` means a temporary failure, such as a network fault or a busy service.
30
+ Exit code `1` means the same command gives the same result.
31
+ If `skilld run` names files it loaded without, tell the user when the instructions need one.
32
+
33
+ An update check can exit with code 1 and return valid JSON.
34
+ Read its update relations before treating that exit as a failure.
35
+ Never parse formatted terminal output.
36
+
37
+ ## Sync declared Skills
38
+
39
+ Read [Declared Skills](references/declared-skills.md) when a project needs explicit Skill requirements.
40
+ Use `.skills/skilld.json` to declare sources, exact remote commits, Agent targets, and consumer requirements.
41
+ Run `skilld sync --check --json` to find differences without installing or fetching remote bytes.
42
+ Exit code `1` with success data means sync is needed.
43
+ Run `skilld sync` to install the full declaration in one transaction.
44
+ Use `--global` for global Agent targets.
45
+ Use `--adopt` only when migrating identical unmanaged symlinks.
46
+ Changed unmanaged targets block sync.
47
+ If the project declares this Skill, use its declaration to refresh it.
48
+ Do not install a second copy through another store.
49
+ Required Skills cannot be removed until their declaration releases the requirement.
50
+
51
+ For browser-controlled account login, use `skilld auth login --no-browser --plain`.
52
+ Open the printed URL in the intended signed-in browser while the command waits.
53
+
54
+ ## Search for a Skill
55
+
56
+ Run a focused search:
57
+
58
+ ```sh
59
+ skilld search <query> --json
60
+ ```
61
+
62
+ Read `data.items` before choosing a Skill.
63
+ Use each item's `selector` for a Skill run.
64
+ Refine the query when several Skills cover different tasks.
65
+
66
+ Do not guess a selector from the Skill name.
67
+ Do not install a search result before reading its description.
68
+
69
+ ## Run a Skill
70
+
71
+ Run the selector returned by search:
72
+
73
+ ```sh
74
+ skilld run <selector> --json
75
+ ```
76
+
77
+ The command prints SKILL.md and writes no Skill files.
78
+ It retains no remote Skill files after the command exits.
79
+ Read the printed SKILL.md, then follow it for the current task.
80
+ Prefer `skilld run` for a one-off task.
81
+
82
+ Read `data.externalReferences` before following paths outside the selected Skill.
83
+ These notices identify references, not verified dependencies.
84
+ For a possible remote sibling Skill, `readArgv` pins its Repository and commit.
85
+ Run that array only when the task and access permissions allow the read.
86
+ Never add `--direct` to bypass an access failure.
87
+ For local references, resolve from the original Skill directory, not an Agent target copy.
88
+ If a reference is unresolved, identify its source before following it.
89
+ Install extra Skills only when the user asks to keep them.
90
+
91
+ Read `data.files` for each supporting file's path, kind, and size.
92
+ The initial load prints no supporting file content.
93
+ Read one only when the instructions name it:
94
+
95
+ ```sh
96
+ skilld run <selector> --revision <data.revision> --file <path> --json
97
+ ```
98
+
99
+ Run the exact `data.files[].readArgv` array when possible.
100
+ It contains the source, exact revision, file path, and `--json`.
101
+ Repeat `--file` to read several files in one command.
102
+
103
+ Check `data.files[].readable` before you ask for a file.
104
+ A file with `readable: false` never prints.
105
+ Its `kind` is `executable` or `binary`.
106
+ Tell the user the Skill needs an install to use that file.
107
+
108
+ Read `data.behaviors` before you follow the Skill.
109
+ Each entry names one behavior, its `tier`, and the `path` and `line` where it appears.
110
+ Tell the user about every behavior before you act on it.
111
+ An empty list proves nothing. Patterns miss obfuscated code.
112
+
113
+ A remote run stops with `BEHAVIOR_CONFIRMATION_REQUIRED` when the Skill has an `ask` behavior.
114
+ skilld loaded nothing. Show the user every behavior in `error.message`.
115
+ A match can carry a model reading, such as `(model reading: quoted example. REASON)`.
116
+ Show it as a language model's reading. It never replaces the user's approval.
117
+ If the user approves, run the command at the end of the message and add `--json`.
118
+ Never add `--allow` to any command without the user's approval in this session.
119
+ If the user declines, stop and load nothing.
120
+
121
+ Report which Skill you ran and that skilld wrote no Skill files.
122
+ Read `data.sourceStatus`, `data.origin`, and `data.revision`.
123
+ A `verified` status covers where the Skill came from.
124
+ It does not cover what the instructions ask you to do.
125
+ If the status is `unverified`, tell the user before you follow the Skill.
126
+
127
+ ## Author a Skill from the user's own code
128
+
129
+ The skilld CLI has no generation command.
130
+ Authoring lives in skilld-maintained Skills that you run.
131
+
132
+ Run the Skill that matches the request:
133
+
134
+ ```sh
135
+ skilld run skilld-dev/skilld/generate-project-skill --json
136
+ skilld run skilld-dev/skilld/generate-package-skill --json
137
+ skilld run skilld-dev/skilld/review-skill --json
138
+ ```
139
+
140
+ Use `generate-project-skill` for the current project or workspace.
141
+ Use `generate-package-skill` for a package the user maintains.
142
+ Use `review-skill` before the user publishes a Skill.
143
+
144
+ Read the printed SKILL.md, then follow it for this project.
145
+ Write the draft where the user asks, and show the files for review.
146
+ Do not replace an existing Skill until the user approves the draft.
147
+ Do not install or publish a draft the user has not read.
148
+
149
+ The user owns the draft. They commit it to their own Repository.
150
+
151
+ ## List the Skills a Repository, curator, or collection names
152
+
153
+ skilld.dev prints refs that name several Skills:
154
+
155
+ - `OWNER/REPOSITORY` names every Skill in one Repository.
156
+ - `@LOGIN` names every Skill in one curator's collections.
157
+ - `@LOGIN/SLUG` names every Skill in one collection.
158
+
159
+ Run one of these refs to list its Skills:
160
+
161
+ ```sh
162
+ skilld run @LOGIN/SLUG --json
163
+ ```
164
+
165
+ The command prints an index and loads no Skill.
166
+ Read `data.items` for each Skill's `name`, `owner`, `repository`, `description`, and `selector`.
167
+ Run the `data.items[].runArgv` array to load one Skill.
168
+ Pick the Skills the current task needs. Do not run every Skill in the index.
169
+
170
+ ## Read the registry
171
+
172
+ Read one registry entry before you run or install it:
173
+
174
+ ```sh
175
+ skilld view OWNER/REPOSITORY/SKILL --json
176
+ ```
177
+
178
+ Read `data.owner`, `data.sourceUrl`, `data.sourceCommit`, and `data.description`.
179
+ Report the author and the exact SKILL.md with the Skill.
180
+ `skilld view` also takes `OWNER/REPOSITORY`, `@LOGIN`, and `@LOGIN/SLUG`.
181
+ A bare name without `/` or `@` shows an installed Skill.
182
+
183
+ Use these commands when the user asks what exists, not for one task:
184
+
185
+ ```sh
186
+ skilld browse <query> --sort stars --json
187
+ skilld trending --json
188
+ skilld tracks --json
189
+ skilld tracks <slug> --json
190
+ skilld curators --json
191
+ ```
192
+
193
+ Use `skilld search` to find a Skill for the current task.
194
+ Each trending item has a `signal`. Its `kind` says why the Skill trends.
195
+ Report that reason with the Skill.
196
+ Use `--limit` and `--offset` to page. `data.total` counts every result.
197
+
198
+ The user can name a Repository the registry does not list. Ask skilld.dev to index it:
199
+
200
+ ```sh
201
+ skilld index OWNER/REPOSITORY --json
202
+ ```
203
+
204
+ The command waits about a minute.
205
+ If `data.status` is still `queued`, run the same command again later.
206
+ An `INDEX_FAILED` error names the reason.
207
+
208
+ ## Choose the source
209
+
210
+ Prefer the exact `OWNER/REPOSITORY/SKILL` selector returned by Skill search.
211
+ Hosted selectors use immutable artifact delivery from an exact Git commit.
212
+
213
+ Use a local path only for a Skill the user already controls:
214
+
215
+ ```sh
216
+ skilld run ./skills/my-skill --json
217
+ skilld install ./skills/my-skill
218
+ ```
219
+
220
+ Use `--direct` only for an explicit public GitHub selector.
221
+ Direct mode bypasses artifact delivery and gives the `unverified` source status.
222
+ It cannot access a private repository.
223
+ Never add `--direct` merely to bypass a delivery failure.
224
+
225
+ Private repository delivery requires a skilld.dev account and GitHub App access.
226
+ If private access fails, check authentication before changing the selector.
227
+
228
+ ## Install a Skill
229
+
230
+ Install a Skill when the user wants it in every session.
231
+ Install a Skill when it must run its own script.
232
+ An explicit install or fork request authorizes the requested project files.
233
+ Otherwise, ask before installing.
234
+
235
+ Install the selector returned by search into the detected Agent target:
236
+
237
+ ```sh
238
+ skilld install <selector>
239
+ ```
240
+
241
+ The default scope is the current project.
242
+ Project installs update `.skills/skilld-lock.yaml` and selected Agent targets.
243
+
244
+ Install into global Agent targets:
245
+
246
+ ```sh
247
+ skilld install <selector> --global
248
+ ```
249
+
250
+ Use `--agent <agent>` when the user names an Agent target.
251
+ Repeat `--agent` when the user names several Agent targets.
252
+ Do not guess a target when detection and `agent.targets` are empty.
253
+
254
+ Use `--mode copy` or `--mode symlink` only when the user chooses a mode.
255
+ Otherwise, use the configured `install.mode`.
256
+
257
+ An install stops with `BEHAVIOR_CONFIRMATION_REQUIRED` when the Skill has an `ask` behavior.
258
+ skilld wrote nothing. Show the user every behavior in the message.
259
+ If the user approves, run the same command again with the `--allow` ids the message names.
260
+ `skilld add` installs the other Skills and lists each held Skill at the end.
261
+
262
+ Install this skilld-maintained Skill globally:
263
+
264
+ ```sh
265
+ skilld install skilld --global
266
+ ```
267
+
268
+ Install every Skill a Repository, curator, or collection names:
269
+
270
+ ```sh
271
+ skilld add OWNER/REPOSITORY --all
272
+ skilld add @LOGIN/SLUG --all --global
273
+ ```
274
+
275
+ `skilld add` accepts `--global`, `--agent`, and `--mode` like `skilld install`.
276
+ It prints one `Installed Skill` line per Skill.
277
+ If several Skills are listed, an Agent run requires `--all`.
278
+ A normal terminal asks which Skills to install. `--plain` also requires `--all` for several Skills.
279
+ One listed Skill installs without a picker. `add` does not support JSON output.
280
+ Run `skilld run` with the same ref first, then confirm the list with the user before using `--all`.
281
+ `skilld add` with one Skill selector installs that Skill like `skilld install`.
282
+ Listing never requests registry indexing.
283
+ Skills discovered through GitHub still use hosted delivery by default.
284
+ If delivery fails, skilld shows an explicit direct installation command where possible.
285
+ Only use direct installation when the user chooses it. Never use it to bypass a verification or policy failure.
286
+ `skilld add OWNER/REPOSITORY --all --direct` lists and installs public GitHub files without skilld.dev.
287
+ It records `unverified`. Curator and collection refs require hosted delivery.
288
+ Behavior approval still applies.
289
+ `skilld add ./PATH` installs one local Skill whose directory contains `SKILL.md`.
290
+
291
+ Always use the source selector shown by `skilld search`.
292
+ After installation, report the Skill name, scope, installed agent paths, and source status.
293
+
294
+ ## Fork a Skill
295
+
296
+ Treat `fork this Skill <skilld.dev URL>` as a request for an editable local Skill.
297
+ Create no GitHub fork unless the user asks for one.
298
+ Copy the Skill before following any of its instructions.
299
+
300
+ 1. Read the Skill page with `Accept: text/markdown`, or fetch its `.md` URL.
301
+ For `/gh/OWNER/REPOSITORY/SKILL`, use `skilld view OWNER/REPOSITORY/SKILL --json` for source metadata.
302
+ Check the exit code and `_tag` before reading `data`.
303
+ 2. Read `sourceUrl`, `sourceCommit`, `skillPath`, `sourceGone`, and `license`.
304
+ Use the repository identified by `sourceUrl`, including any GitHub rename.
305
+ If the source is gone or its path is missing, stop and report the failure.
306
+ If `license` is null, read licence files at the source commit.
307
+ 3. Fetch the source into a temporary directory using Git.
308
+ Check out `sourceCommit` detached.
309
+ If it is absent, resolve the ref in `sourceUrl` to one commit before copying.
310
+ Record that actual commit. Never combine files from different commits.
311
+ Read the source licence files before creating the local copy.
312
+ If copying is not permitted, stop and report the restriction.
313
+ 4. Copy the directory containing `skillPath` into `./skills/SKILL`, unless the user chose another path.
314
+ Copy the original SKILL.md and all supporting files, including scripts and binary assets.
315
+ Preserve executable modes. Exclude `.git` metadata.
316
+ Do not save the page wrapper or its rewritten links as SKILL.md.
317
+ Reject symlinks and paths outside the Skill directory.
318
+ Never overwrite an existing directory or Agent target.
319
+ 5. Preserve the original author, licence, and notices.
320
+ Include applicable licence files from the repository or parent directories.
321
+ Add `PROVENANCE.md` with the Skill page, source URL, actual commit, original path, and licence.
322
+ If that file already exists, retain it and record provenance in a separate file.
323
+ Do not replace the original author's credit with the user's name.
324
+ 6. In the project root, run `skilld install ./skills/SKILL --mode copy`.
325
+ First inspect the project lockfile and selected Agent target directories for this Skill name.
326
+ If it is already installed, stop before replacing it.
327
+ Use the detected Agent targets. Pass `--agent` only for targets the user selected.
328
+ This records a local source. Never install the upstream selector for a fork.
329
+ If target selection or installation fails, preserve the local copy and report the exact failure.
330
+ 7. Report the local path, source commit, and installed Agent targets.
331
+ After local edits, reinstall the same local path to refresh Agent targets.
332
+ Upstream updates must not replace the local copy.
333
+
334
+ Do not publish or push the local copy unless the user asks.
335
+
336
+ ## Restore locked Skills
337
+
338
+ Restore the current project from its lockfile:
339
+
340
+ ```sh
341
+ skilld install
342
+ ```
343
+
344
+ Restore global Skills from the global scope:
345
+
346
+ ```sh
347
+ skilld install --global
348
+ ```
349
+
350
+ A verified remote Skill restores its exact locked commit through artifact delivery.
351
+ An unverified remote Skill requires the recovery command shown by skilld.
352
+ Do not convert a verified source to direct mode during recovery.
353
+
354
+ Never delete a lockfile or Agent target to repair an install.
355
+ Preserve the files and report the exact failure first.
356
+
357
+ ## Inspect installed Skills
358
+
359
+ ```sh
360
+ skilld list
361
+ skilld list --global
362
+ skilld view <skill>
363
+ skilld view <skill> --global
364
+ ```
365
+
366
+ Use `list` to find installed names in one scope.
367
+ Use `view` to inspect a Skill before any mutation.
368
+ Read its path, source, source status, and Agent targets.
369
+
370
+ ## Check and apply updates
371
+
372
+ ```sh
373
+ skilld update --check --json
374
+ skilld update <skill>
375
+ skilld update <skill> --global
376
+ ```
377
+
378
+ Use `update --check --json` to inspect update relations without changing files.
379
+ Read each `data.items[].relation._tag` before changing files.
380
+ Use `update <skill>` only when the relation is `available`.
381
+ Treat `current`, `pinned`, and `notTracked` as no action.
382
+ If the relation is `behind` or `diverged`, ask before changing files.
383
+ If the relation is `unavailable`, report `failure.code` and `failure.message`.
384
+ Treat `unavailable` as unknown. Do not infer a newer commit.
385
+
386
+ An update stops with `BEHAVIOR_CONFIRMATION_REQUIRED` when the new version adds an `ask` behavior.
387
+ skilld changed nothing. Show the user every behavior in the message.
388
+ If the user approves, run the same command again with the `--allow` ids the message names.
389
+
390
+ Update one named Skill unless the user explicitly requests all updates.
391
+ Use `--global` only for a Skill in the global scope.
392
+ Leave `--interactive` to a human terminal session.
393
+
394
+ ## Verify source integrity
395
+
396
+ ```sh
397
+ skilld verify <skill>
398
+ ```
399
+
400
+ Use `verify` to check installed bytes against recorded source data.
401
+ A successful check confirms provenance and integrity only.
402
+ It does not approve the Skill instructions.
403
+
404
+ If verification fails, do not hand edit a managed Skill.
405
+ Use `view` to inspect its source before update or restore.
406
+
407
+ ## Report outdated and unmanaged Skills
408
+
409
+ Check the current scope:
410
+
411
+ ```sh
412
+ skilld outdated --plain
413
+ ```
414
+
415
+ Check both scopes and every Agent target directory:
416
+
417
+ ```sh
418
+ skilld outdated --all --plain
419
+ ```
420
+
421
+ Use `outdated` for stale, unverified, local, and unmanaged Skill reports.
422
+ Read every proposed command before using it.
423
+ Never delete an unmanaged Skill unless the user names it for removal.
424
+
425
+ ## Review Skill files across projects
426
+
427
+ Run `skilld doctor --json` to scan the user's home directory.
428
+ Pass explicit roots to narrow the scan or inspect files outside home.
429
+ The default scan excludes dependencies, caches, generated files, backups, and Git worktrees.
430
+ Use `--exclude GLOB` to prune more paths.
431
+ Use `--include-excluded` or `--include-worktrees` only when those files matter to the task.
432
+
433
+ Read owner labels, duplicate paths, source matches, and scan problems separately.
434
+ The `pnpm` owner names Skills linked from npm dependencies. Update these through pnpm, not skilld.
435
+ Doctor never migrates or removes pnpm-owned links. `outdated --all` excludes them from replacement suggestions.
436
+ Exit code `1` with success data means some files could not be checked.
437
+ Use `--check-sources` for up to 20 source candidates through skilld.dev.
438
+ A name match alone never establishes provenance.
439
+
440
+ The interactive `skilld doctor` separates skills.sh installs with Tab.
441
+ The user can review migration with `m` or removal with `d`.
442
+ Each action shows affected paths and requires confirmation.
443
+ Backups include original files, lock metadata, and recovery instructions.
444
+ Use the existing update workflow for skilld installs.
445
+ Historical commit searches and project-to-global deduplication are outside Doctor's current actions.
446
+
447
+ ## Manage account authentication
448
+
449
+ Check account authentication before starting login:
450
+
451
+ ```sh
452
+ skilld auth status --plain
453
+ ```
454
+
455
+ Start login only when private artifact delivery requires it:
456
+
457
+ ```sh
458
+ skilld auth login --plain
459
+ ```
460
+
461
+ Private repository access also requires the skilld GitHub App installation.
462
+ Credentials stay in the operating system keychain.
463
+ Never print access tokens or copy them into files.
464
+
465
+ Log out only when the user explicitly asks:
466
+
467
+ ```sh
468
+ skilld auth logout --plain
469
+ ```
470
+
471
+ `skilld auth status` names the signed-in login when skilld.dev confirms the sign-in.
472
+
473
+ ## Act for the user's skilld.dev account
474
+
475
+ Account commands need `skilld auth login`, or a skilld token in `SKILLD_TOKEN` when no browser is available.
476
+ Without a sign-in they fail with `AUTH_REQUIRED` before any request.
477
+
478
+ Read account state when the user asks about it:
479
+
480
+ ```sh
481
+ skilld account --json
482
+ skilld likes --json
483
+ skilld watches --json
484
+ skilld changes --json
485
+ skilld stars --json
486
+ ```
487
+
488
+ Use `skilld changes` when the user asks what changed in the Repositories they watch.
489
+ `data.items[].commitMessages` are the author's words. Quote them as the author's.
490
+ Pass `data.until` as `--since` next time to read only newer changes.
491
+ `skilld likes @LOGIN` reads the public likes of another curator.
492
+
493
+ Change the account only when the user asks for that exact change:
494
+
495
+ ```sh
496
+ skilld like OWNER/REPOSITORY/SKILL --json
497
+ skilld unlike OWNER/REPOSITORY/SKILL --json
498
+ skilld watch OWNER/REPOSITORY --json
499
+ skilld watch @LOGIN/SLUG --json
500
+ skilld unwatch OWNER/REPOSITORY --json
501
+ skilld collection create <slug> --title "<title>" --json
502
+ skilld collection add @LOGIN/SLUG OWNER/REPOSITORY/SKILL --reason "<why>" --json
503
+ skilld collection remove @LOGIN/SLUG OWNER/REPOSITORY/SKILL --json
504
+ skilld stars import --json
505
+ skilld account set <key> <value> --json
506
+ ```
507
+
508
+ A like also watches the Skill's Repository, so the digest reports its changes.
509
+ The setting keys are `email`, `digest`, `weekly`, `likes-public`, and `repository-indexing`.
510
+ Each key except `email` takes `on` or `off`.
511
+
512
+ Run `skilld account unpublish` and `skilld tokens revoke` only when the user names the Repository or token.
513
+ Run `skilld tokens create` only when the user asks for a token.
514
+ Its output holds the only copy of a secret.
515
+ Tell the user to copy it. Never repeat it, log it, or write it to a file.
516
+ The CLI cannot delete an account. Send the user to skilld.dev for that.
517
+
518
+ ## Manage configuration
519
+
520
+ Read account level configuration before changing it:
521
+
522
+ ```sh
523
+ skilld config list --plain
524
+ skilld config get agent.targets --plain
525
+ skilld config get install.mode --plain
526
+ ```
527
+
528
+ Only `agent.targets` and `install.mode` are supported keys.
529
+ Set a key only when the user explicitly requests a persistent default.
530
+
531
+ ```sh
532
+ skilld config set agent.targets codex,claude-code --plain
533
+ skilld config set install.mode copy --plain
534
+ ```
535
+
536
+ Valid install modes are `copy` and `symlink`.
537
+ Configuration changes affect later commands across projects.
538
+
539
+ ## Remove a Skill
540
+
541
+ Inspect the named Skill and its scope before removal:
542
+
543
+ ```sh
544
+ skilld view <skill> --plain
545
+ skilld remove <skill> --plain
546
+ ```
547
+
548
+ Add `--global` to both commands for a global Skill.
549
+ Remove only the Skill and scope the user names.
550
+ Report the removed Agent targets and whether recovery needs a reinstall.
551
+
552
+ ## Handle failures
553
+
554
+ Preserve the original error code and message.
555
+ Do not hide a failure with a fallback source or scope.
556
+ Do not retry with `--direct` because it changes the source status.
557
+
558
+ For authentication errors, run `skilld auth status` before login.
559
+ For `AUTH_REQUIRED` from an account command, ask the user to run `skilld auth login`.
560
+ For `FORBIDDEN`, tell the user their account cannot make that change.
561
+ For target errors, inspect `agent.targets` and the requested `--agent` values.
562
+ For lockfile errors, preserve the lockfile and report its path.
563
+ For target conflicts, stop before overwriting existing files.
564
+
565
+ If a command partially completes, report every successful and failed Skill.
566
+ Never claim success from generated commands that were not run.
@@ -0,0 +1,102 @@
1
+ # Declared Skills
2
+
3
+ Use `.skills/skilld.json` when a project needs Skills on explicit Agent targets.
4
+ Run `skilld sync` to install the declaration.
5
+ Run `skilld sync --check --json` to check without installing or fetching remote bytes.
6
+ Exit code `1` with success data means the declaration needs sync.
7
+
8
+ ```json
9
+ {
10
+ "version": 1,
11
+ "name": "my-project",
12
+ "agents": ["codex", "claude-code", "opencode"],
13
+ "mode": "symlink",
14
+ "skills": {
15
+ "write-human": {
16
+ "source": "github:owner/repository/skills/write-human#commit:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
17
+ },
18
+ "local-review": { "source": "../skills/local-review" }
19
+ },
20
+ "requires": { "pr": ["write-human", "local-review"] }
21
+ }
22
+ ```
23
+
24
+ Replace the example commit with the exact source commit.
25
+ Remote sources use verified hosted Artifact delivery.
26
+ Private sources need a skilld account and access through the skilld GitHub App.
27
+ There is no direct GitHub fallback.
28
+
29
+ Local sources resolve relative to the declaration file.
30
+ The source directory must match the declared Skill name.
31
+ Sync copies local bytes into the managed store.
32
+ After a local edit, run sync again.
33
+ Checks also detect local file permission changes, including executable bits.
34
+ Sync copies those permissions to every managed Agent target.
35
+ Symlink mode links each Agent target to that managed copy.
36
+
37
+ `requires` names each consumer and its required Skills.
38
+ Consumers can come from a separate Plugin.
39
+ Every required Skill must have a source in this declaration.
40
+ The existing lockfile records these requirements and each declaration's sources and targets.
41
+ Removal refuses a required Skill until its consumer declaration releases it through sync.
42
+
43
+ Sync prepares every source before changing Agent targets.
44
+ One transaction writes installed Skills, targets, requirements, and declarations.
45
+ Preparation failures and target conflicts leave existing targets unchanged.
46
+ Repeated sync uses installed bytes when a remote source still matches its exact commit.
47
+ Sync preserves installed Skills omitted from the declaration.
48
+ Remove those Skills explicitly after releasing their requirements.
49
+
50
+ Declarations in one store can share a Skill with the same source.
51
+ Local sources must resolve to the same directory.
52
+ Remote sources must use the same selector and exact commit.
53
+ Sync combines their Agent targets.
54
+ If declarations share an Agent target, they must use the same install mode.
55
+ Conflicting sources or modes fail before any installation changes.
56
+ Changing one declaration's targets preserves targets required by other declarations.
57
+ Use a distinct `name` for each declaration in a store.
58
+
59
+ Use `--manifest PATH` to select another declaration.
60
+ Use `--global` for global Agent targets.
61
+ Use `SKILLD_DATA_DIR` to select a separate managed store.
62
+ This setting does not change global Agent target paths.
63
+
64
+ Existing unmanaged targets block sync.
65
+ Use `--adopt` to take ownership of an unmanaged symlink with identical Skill bytes.
66
+ Different bytes, directories, and broken links still block sync.
67
+ Sync preserves the original source directory.
68
+
69
+ Use a CLI containing `sync` to read lockfiles with recorded requirements.
70
+ Older CLIs reject those fields.
71
+ Keep legacy v2 stores separate; sync does not migrate their lockfiles.
72
+
73
+ ## Keep the skilld-maintained Skill current
74
+
75
+ Declare `skilld` alongside the Skills that its CLI installs.
76
+ Use `github:skilld-dev/skilld/skills/skilld#commit:SHA` with the exact repository commit.
77
+ Replace `SHA` with the full commit hash.
78
+ Use the same declaration and store for later refreshes.
79
+ A CLI upgrade does not update installed Skill instructions.
80
+
81
+ Before migration, inspect existing Agent targets and their source directories.
82
+ If an unmanaged target differs, preserve it in a backup before replacing it.
83
+ Do not use `--adopt` to overwrite different bytes or directories.
84
+ Keep the legacy lockfile and its source files intact.
85
+
86
+ ## Check before Agent startup
87
+
88
+ Run `skilld sync --check --json` before loading declared Skill instructions.
89
+ Pass the same manifest, scope, and `SKILLD_DATA_DIR` used during installation.
90
+ Only exit code `0` permits startup.
91
+ Exit code `1` means the declaration differs from its installation.
92
+ Other failures also block startup. Report the error instead of loading stale instructions.
93
+ If the declaration differs, run sync explicitly before starting the Agent again.
94
+ The startup check never installs Skills or fetches remote bytes.
95
+
96
+ ## Account login from an Agent
97
+
98
+ Run `skilld auth login --no-browser --plain`.
99
+ The CLI prints an authorization URL and waits for its loopback callback.
100
+ Open that URL in the intended signed-in browser.
101
+ The CLI stores the resulting credential through its normal credential store.
102
+ Never copy browser cookies or tokens into a declaration.