skillshop 2.2.0 → 4.0.0

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
@@ -1,6 +1,6 @@
1
1
  # Skillshop
2
2
 
3
- Skillshop installs and manages agent skills. Its CLI includes a bundled skill registry, with the same named install, update, and agent configuration commands as the earlier `skillz` CLI. It also lets project owners export skills from their own npm packages. A skill is a directory containing `SKILL.md` and any supporting files.
3
+ Skillshop installs and manages agent skills. For user-authored skills, a plain folder library is the source of truth. Download individual skills from GitHub, install them into project or global destinations, and sync later source edits across recorded copies. The bundled registry and npm package-library APIs remain available for compatibility. A skill is a directory containing `SKILL.md` and any supporting files.
4
4
 
5
5
  The command is `skillshop`; `sk` runs the same CLI. The previous `skillz` command is no longer an executable alias. Existing `.skillz-lock` and `~/.skillz` state remain readable.
6
6
 
@@ -15,26 +15,41 @@ skillshop init
15
15
 
16
16
  `skillshop init` asks which agents you use and saves their destinations in `~/.skillshop/config.json`. It is optional for project skill installs: without saved agent selection, Skillshop uses the nearest existing `.agents`, `.github`, or `.codex` directory and falls back to project-root `.agents/skills`. Run `skillshop init` to choose system-wide defaults; change that selection later with `skillshop config agents`. Codex and OpenCode use `.agents/skills` inside projects and `~/.agents/skills` for user-level installs. Copilot and Claude use their own skill directories. Shared destinations get one copy.
17
17
 
18
- ### Install a named skill
19
-
20
- List the skills bundled with Skillshop, then install one:
18
+ ### Use a personal folder library
21
19
 
22
20
  ```bash
23
- skillshop list
24
- skillshop one-shot
25
- # Equivalent: skillshop install one-shot
21
+ skillshop library init # selects ~/skillshop-library
22
+ skillshop library init ./my-skills # selects or adopts an existing folder
23
+ skillshop library list
24
+ skillshop download @alice/review # adds source only
25
+ skillshop install @alice/review # downloads if absent, then installs locally
26
+ skillshop install @alice/review --global
27
+ skillshop install review # installs an existing selected source
28
+ skillshop sync # updates all recorded project and global copies
26
29
  ```
27
30
 
28
- Run a project install inside a Git repository. Skillshop copies the skill into each configured project destination and records managed copies in `.skillshop-lock`. It also installs the `skillshop` guidance skill. The lockfile and managed skill directories go into the repository's local Git exclude file, leaving unrelated skill directories alone.
31
+ `library init` can create a missing folder or select an existing library. It preserves existing skill directories and config; no `package.json`, npm metadata, or version field is required. Without an explicit directory it selects the visible `~/skillshop-library` folder. The library config is `skillshop-library.json`; the default source directory is `skills/`. A skill can contain any regular files and nested folders, including hidden references and executable scripts.
32
+
33
+ `download @owner/skill` reads `https://github.com/owner/skillshop-library.git` and copies only `skills/skill` into the selected personal library. The `@` marks a remote owner/skill reference; it is not part of the GitHub owner or repository URL. Download does not install the skill. `install @owner/skill` downloads when that source is absent, then installs from the library. If the same repository source is already present, local edits are reused without an upstream fetch. `install name` installs a matching skill from the selected library. Once a library is selected, named installs and `skillshop list` use that library; they do not fall back to bundled skills or add bundled guidance. Add `--global` to install into configured user directories. Unprefixed `owner/skill` inputs are rejected; use `@owner/skill` for remote references.
29
34
 
30
- To install a named skill for your user account instead:
35
+ `download @owner/skill --force` explicitly replaces the personal source directory after validation. A same-name authored or different-source skill otherwise fails safely. `skillshop sync` copies the current full directory from each recorded personal source to its Skillshop-managed project and global copies. It includes file additions, edits, removals, hidden files, binary contents, and modes; stale extras inside those owned copies are removed. Sync never fetches GitHub and changing the selected library does not redirect existing copies.
36
+
37
+ `sync` is also the explicit migration step for older tracked bundled installs. `library init` does not migrate them. If a selected library already has a skill, that source wins and tracked bundle copies are synchronized from it. Otherwise, Skillshop imports a missing source only when every surviving tracked project and global copy agrees across full paths, bytes, and modes. Divergent copies and unreadable ownership state are reported. Unknown source kinds, unmanaged directories, and imported snapshots are left untouched; if they prevent a complete consensus decision, sync reports that conflict. Missing recorded destinations are pruned, never recreated. Keep durable edits in the personal source; sync intentionally replaces local edits inside an owned installed copy.
38
+
39
+ ### Install a bundled registry skill (compatibility mode)
40
+
41
+ When no personal library is selected, the bundled registry remains available:
31
42
 
32
43
  ```bash
44
+ skillshop list
45
+ skillshop one-shot
46
+ # Equivalent: skillshop install one-shot
33
47
  skillshop one-shot --global
34
- # Equivalent: sk install one-shot --global
35
48
  ```
36
49
 
37
- For Codex or OpenCode, this writes `~/.agents/skills/one-shot`. A global install replaces an existing skill directory with that name, including local edits and extra files. Global installs use `~/.skillshop/global-skills.json` for bookkeeping. Except for `skillshop upgrade`, ordinary non-agent-instruction CLI runs reconcile recorded installations. Upgrade skips reconciliation in the old process and refreshes changed copies from the newly installed package in a fresh process. Agent instruction commands also bypass reconciliation and do not install the bundled registry.
50
+ Run project installs inside a Git repository. Skillshop records copies in `.skillshop-lock` and adds only its managed paths to the repository's local Git exclude file. In this compatibility mode it also installs bundled `skillshop` guidance. A global bundled install writes `~/.skillshop/global-skills.json`; for Codex or OpenCode it targets `~/.agents/skills`.
51
+
52
+ In bundled compatibility mode, most ordinary commands reconcile recorded bundled installations. When a personal library is selected, `list` and named installs join library, download, qualified install, sync, upgrade, and agent instruction commands in bypassing that legacy reconciliation. Upgrade refreshes changed-version bundled copies from the newly installed package in a fresh process. Same-version bundled copies keep local edits; a changed-version replacement overwrites edits in that managed copy. To keep durable local changes, initialize a personal library, use `skillshop sync` to adopt tracked bundled copies where their contents agree, edit the library source, then sync it to owned copies. Personal-library copies are excluded from bundled refresh.
38
53
 
39
54
  ### Update or remove skills
40
55
 
@@ -46,7 +61,7 @@ skillshop uninstall one-shot
46
61
  skillshop uninstall one-shot --global
47
62
  ```
48
63
 
49
- `update` replaces skills managed in the current project's lockfile. `update --push` updates registered projects. Neither command updates global copies; reinstall a global skill by name with `--global`. Project uninstall removes only a skill recorded in `.skillshop-lock`. Global uninstall removes the named skill from configured user directories.
64
+ `update` refreshes skills managed in the current project's lockfile from their recorded source. `update --push` updates registered projects. Use `skillshop sync` to propagate personal-library changes to recorded local and global copies. Project uninstall removes only a skill recorded in `.skillshop-lock`. Global uninstall removes the named skill from configured user directories.
50
65
 
51
66
  ### Upgrade Skillshop
52
67
 
@@ -56,7 +71,7 @@ skillshop upgrade
56
71
 
57
72
  The command upgrades the npm installation that supplied the invoked CLI. A project-local installation updates Skillshop in the owning npm project and preserves the dependency section where it is already declared. It refreshes only that project's recorded Skillshop-managed skill copies. A global installation updates its npm prefix, then refreshes recorded global copies and copies in registered projects; it does not update those projects' package manifests. Running from a source checkout keeps the historical global-install behavior and does not edit the checkout's package manifest.
58
73
 
59
- After npm succeeds, the newly installed CLI runs in a fresh process and refreshes only existing copies recorded in `.skillshop-lock` or `~/.skillshop/global-skills.json` whose bundled skill version changed. Same-version copies retain their local bodies. A changed-version replacement overwrites local edits in that managed copy; make durable edits in the bundled source. Deleted paths are pruned from ownership records instead of recreated. Unmanaged directories and package-import snapshots are not adopted. An npm install failure stops before copy refresh; a later refresh failure reports that Skillshop was upgraded and gives a nonzero result with the partial-refresh summary.
74
+ After npm succeeds, the newly installed CLI runs in a fresh process and refreshes only existing copies recorded in `.skillshop-lock` or `~/.skillshop/global-skills.json` whose bundled skill version changed. Same-version copies retain local edits. A changed-version replacement overwrites local edits in that managed copy. For durable local changes, initialize a personal library, explicitly sync to adopt tracked bundled copies when their surviving copies agree, then edit the library source and sync. Deleted paths are pruned from ownership records instead of recreated. Unmanaged directories and package-import snapshots are not adopted. An npm install failure stops before copy refresh; a later refresh failure reports that Skillshop was upgraded and gives a nonzero result with the partial-refresh summary.
60
75
 
61
76
  `skillshop init` is optional. It configures agent destinations and is not required to upgrade Skillshop. The upgrade command never initializes, renders, or rewrites project `AGENTS.md` files or instruction templates.
62
77
 
@@ -153,189 +168,31 @@ Package imports are separate from this lockfile workflow. `import` copies a snap
153
168
 
154
169
  ## For project owners: distribute skills
155
170
 
156
- ### 1. Export the skills
171
+ ### Personal skills: share a folder through GitHub
157
172
 
158
- In an npm package, put each skill in a directory with a `SKILL.md`. For example:
173
+ The recommended authoring format is a normal folder. Fork the bundled template at [`templates/skillshop-library`](templates/skillshop-library) or create the same layout in a GitHub repository named `skillshop-library`:
159
174
 
160
175
  ```text
161
- my-library/
162
- package.json
163
- .agents/skills/review/SKILL.md
164
- .agents/skills/triage/SKILL.md
165
- ```
166
-
167
- For example, `.agents/skills/review/SKILL.md` could contain:
168
-
169
- ```markdown
170
- ---
171
- name: review
172
- description: Review a proposed code change
173
- ---
174
-
175
- # Review
176
-
177
- Read the diff, identify concrete defects, and cite the affected files.
178
- ```
179
-
180
- Keep any references or scripts needed by the skill beside its `SKILL.md`; Skillshop copies the whole directory.
181
-
182
- Add Skillshop, initialize the export list, and name the skill you want to publish:
183
-
184
- ```bash
185
- npm install skillshop
186
- npx skillshop library init
187
- npx skillshop export skill:review ./.agents/skills/review
188
- npx skillshop export skill:triage ./.agents/skills/triage
189
- ```
190
-
191
- This writes `skillshop.library.json`:
192
-
193
- ```json
194
- {
195
- "schemaVersion": 1,
196
- "exports": {
197
- "skill:review": "./.agents/skills/review",
198
- "skill:triage": "./.agents/skills/triage"
199
- }
200
- }
201
- ```
202
-
203
- The `exports` map is an explicit allowlist. Skillshop does not scan your repository for other skills. `skillshop export` also builds the library; run `skillshop build` after editing the JSON by hand. The build generates `skillshop.manifest.mjs`, adds the package's `./skillshop` export, and includes declared local skill directories in `package.json#files` when that field exists. Commit the resulting package files with your source.
204
-
205
- ### 2. Declare user-level installation, if needed
206
-
207
- To copy selected skills during a global npm install, add `skillshop.userInstall` and the generic lifecycle command to the distributor's `package.json`:
208
-
209
- ```json
210
- {
211
- "name": "@example/skill-library",
212
- "version": "1.0.0",
213
- "dependencies": {
214
- "skillshop": "^2.1.0"
215
- },
216
- "files": [],
217
- "scripts": {
218
- "prepack": "skillshop build",
219
- "postinstall": "skillshop install-user . --if-global"
220
- },
221
- "skillshop": {
222
- "userInstall": ["skill:review"]
223
- }
224
- }
225
- ```
226
-
227
- Every `userInstall` entry must be unique and appear in `skillshop.library.json`. In this example, `skill:review` installs for the user on a global npm install. `skill:triage` remains available for explicit project imports. The runtime dependency makes the `skillshop` command available to npm's `postinstall` script. `--if-global` skips the user copy on a project-local install. npm's `--ignore-scripts` skips `postinstall` entirely.
228
-
229
- An install replaces each declared destination directory. If a later release removes a name from `userInstall`, Skillshop does not delete a copy previously installed in a user's directory.
230
-
231
- ### 3. Check and pack the package
232
-
233
- ```bash
234
- npx skillshop library list
235
- npx skillshop validate
236
- npx skillshop build
237
- npm pack --dry-run
238
- ```
239
-
240
- Check that the npm package contains `skillshop.manifest.mjs`, every exported `SKILL.md`, and any assets those skills need. The export list controls what Skillshop can resolve; it does not prevent your own broad `files` patterns from publishing other files. A real `npm pack` and global install from its tarball are useful checks before a release.
241
-
242
- After checking the tarball, publish the package with `npm publish`. Use `npm publish --access public` for a public scoped package.
243
-
244
- ### Example: what happens after publication
245
-
246
- With the two-skill package above published as `@example/skill-library`, a global install copies only the declared `skill:review` to the user's skill directory:
247
-
248
- ```bash
249
- npm install --global @example/skill-library
250
- # ~/.agents/skills/review/SKILL.md now comes from the package
176
+ skillshop-library/
177
+ skillshop-library.json
178
+ skills/
179
+ review/
180
+ SKILL.md
181
+ references/
182
+ scripts/
251
183
  ```
252
184
 
253
- An application that needs `skill:triage` can install the package locally and copy that exported skill into its own repository:
185
+ The config declares the relative source directory. Each skill needs a standard `SKILL.md` with `name` and `description`; author/version metadata is optional. Put references, scripts, and other assets beside it. Skillshop downloads the complete directory and preserves executable modes.
254
186
 
255
187
  ```bash
256
- cd ~/work/sample-app
257
- npm install @example/skill-library skillshop
258
- npx skillshop import @example/skill-library:triage
259
- ```
260
-
261
- After the distributor publishes an update, reinstalling the package globally replaces the user's `review` directory. The application's `triage` snapshot stays as it was until the application updates the package and imports again with `--force`. The two installation paths are independent.
262
-
263
- ### Re-export a skill from another library
264
-
265
- A package can expose a selected upstream skill under its own name:
266
-
267
- ```bash
268
- npm install @example/upstream
269
- npx skillshop export skill:review --from @example/upstream --skill skill:review
270
- ```
271
-
272
- The resulting export in `skillshop.library.json` is:
273
-
274
- ```json
275
- {
276
- "skill:review": {
277
- "from": "@example/upstream",
278
- "skill": "skill:review"
279
- }
280
- }
281
- ```
282
-
283
- That object is one entry inside the manifest's `exports` map. The upstream package must be a runtime dependency or a non-optional peer dependency. Re-exporting is explicit; depending on another library does not expose all of its skills.
284
-
285
- ## CLI and JavaScript API
286
-
287
- ```text
288
- skillshop init
289
- skillshop config agents
290
- skillshop list
291
- skillshop <name> [--global]
292
- skillshop install <name> [--global]
293
- skillshop update [name]
294
- skillshop update --push
295
- skillshop uninstall <name> [--global]
296
- skillshop agents init [--project <directory>]
297
- skillshop agents [--project <directory>] [--check]
298
- skillshop agents --global
299
- skillshop migrate [root ...]
300
- skillshop library init
301
- skillshop library list
302
- skillshop export skill:<name> <directory>
303
- skillshop export skill:<name> --from <package> [--skill skill:<source-name>]
304
- skillshop unexport skill:<name>
305
- skillshop validate
306
- skillshop build
307
- skillshop resolve <library>:<skill>
308
- skillshop import <library>:<skill> [--global] [--to <directory>] [--force]
309
- skillshop install-user [package-dir] [--if-global] [--to <skills-dir>]
188
+ skillshop download @alice/review
189
+ skillshop install @alice/review
190
+ skillshop install @alice/review --global
191
+ skillshop sync
310
192
  ```
311
193
 
312
- `init` and `list` keep their bundled-registry meanings. `library init`, `library list`, `validate`, and `build` operate on the package library in the current directory. In a `library:skill` reference, `library` can be an installed package name or a local package directory. `import` defaults to `.agents/skills/<skill>`; `--global` replaces `~/.agents/skills/<skill>`. `unexport` changes the package's public skill list; it does not delete the source directory. Remove a skill from `userInstall` before unexporting it.
313
-
314
- Applications can use the same operations without invoking the CLI:
315
-
316
- ```js
317
- import { exportSkill, reexportSkill, buildSkillLibrary } from 'skillshop/export';
318
- import { resolveSkill, importSkill } from 'skillshop/import';
319
- import { installDeclaredUserSkills } from 'skillshop/user-install';
320
- ```
321
-
322
- For example, an application can read an exported skill directly from an installed package, or copy it into a workspace it manages:
323
-
324
- ```js
325
- import { readFile } from 'node:fs/promises';
326
- import { resolveSkill, importSkill } from 'skillshop/import';
327
-
328
- const reference = '@example/skill-library:triage';
329
- const { manifestPath } = await resolveSkill({ reference });
330
- const instructions = await readFile(manifestPath, 'utf8');
331
- // Pass instructions to your agent runtime.
332
-
333
- await importSkill({
334
- reference,
335
- overwrite: true,
336
- });
337
- ```
194
+ `download @owner/skill` adds a source to the personal folder library without installing it. `install @owner/skill` downloads if needed and installs from that source; subsequent local edits are reused. `install name` uses a bare name for an existing library source. `sync` updates recorded local and global copies from the saved source roots. It never fetches upstream. See [the forkable library template](templates/skillshop-library/README.md) for its full layout and command details.
338
195
 
339
- `resolveSkill` leaves the skill inside the installed package. `importSkill` copies its complete directory, including files alongside `SKILL.md`. Set `overwrite: true` only when the application intends to replace an existing destination.
196
+ ### Existing package API compatibility
340
197
 
341
- `importSkill({ overwrite: true })` replaces a destination. Its optional `merge: true` mode overlays packaged files and preserves unrelated destination files. User-level installation always uses replacement, even when called through `installDeclaredUserSkills`.
198
+ The published npm export/import APIs remain supported for existing consumers. Their authoring, lifecycle, and JavaScript API guide is in [Package library compatibility](docs/package-library-compatibility.md). New user-authored libraries can use the folder and GitHub workflow above without npm packaging.
@@ -0,0 +1,194 @@
1
+ # Package library compatibility
2
+
3
+ This guide documents the existing npm package export/import APIs. It is retained for consumers of those published APIs. It is not required for personal folder libraries or GitHub skill sharing.
4
+
5
+ ### Package API compatibility: export skills from npm packages
6
+
7
+ The npm export/import API remains supported for existing package-based libraries. It is not required for personal skill authoring.
8
+
9
+ #### 1. Export the skills
10
+
11
+ In an npm package, put each skill in a directory with a `SKILL.md`. For example:
12
+
13
+ ```text
14
+ my-library/
15
+ package.json
16
+ .agents/skills/review/SKILL.md
17
+ .agents/skills/triage/SKILL.md
18
+ ```
19
+
20
+ For example, `.agents/skills/review/SKILL.md` could contain:
21
+
22
+ ```markdown
23
+ ---
24
+ name: review
25
+ description: Review a proposed code change
26
+ ---
27
+
28
+ # Review
29
+
30
+ Read the diff, identify concrete defects, and cite the affected files.
31
+ ```
32
+
33
+ Keep any references or scripts needed by the skill beside its `SKILL.md`; Skillshop copies the whole directory.
34
+
35
+ Add Skillshop, initialize the export list, and name the skill you want to publish:
36
+
37
+ ```bash
38
+ npm install skillshop
39
+ npx skillshop library init
40
+ npx skillshop export skill:review ./.agents/skills/review
41
+ npx skillshop export skill:triage ./.agents/skills/triage
42
+ ```
43
+
44
+ This writes `skillshop.library.json`:
45
+
46
+ ```json
47
+ {
48
+ "schemaVersion": 1,
49
+ "exports": {
50
+ "skill:review": "./.agents/skills/review",
51
+ "skill:triage": "./.agents/skills/triage"
52
+ }
53
+ }
54
+ ```
55
+
56
+ The `exports` map is an explicit allowlist. Skillshop does not scan your repository for other skills. `skillshop export` also builds the library; run `skillshop build` after editing the JSON by hand. The build generates `skillshop.manifest.mjs`, adds the package's `./skillshop` export, and includes declared local skill directories in `package.json#files` when that field exists. Commit the resulting package files with your source.
57
+
58
+ ### 2. Declare user-level installation, if needed
59
+
60
+ To copy selected skills during a global npm install, add `skillshop.userInstall` and the generic lifecycle command to the distributor's `package.json`:
61
+
62
+ ```json
63
+ {
64
+ "name": "@example/skill-library",
65
+ "version": "1.0.0",
66
+ "dependencies": {
67
+ "skillshop": "^2.1.0"
68
+ },
69
+ "files": [],
70
+ "scripts": {
71
+ "prepack": "skillshop build",
72
+ "postinstall": "skillshop install-user . --if-global"
73
+ },
74
+ "skillshop": {
75
+ "userInstall": ["skill:review"]
76
+ }
77
+ }
78
+ ```
79
+
80
+ Every `userInstall` entry must be unique and appear in `skillshop.library.json`. In this example, `skill:review` installs for the user on a global npm install. `skill:triage` remains available for explicit project imports. The runtime dependency makes the `skillshop` command available to npm's `postinstall` script. `--if-global` skips the user copy on a project-local install. npm's `--ignore-scripts` skips `postinstall` entirely.
81
+
82
+ An install replaces each declared destination directory. If a later release removes a name from `userInstall`, Skillshop does not delete a copy previously installed in a user's directory.
83
+
84
+ ### 3. Check and pack the package
85
+
86
+ ```bash
87
+ npx skillshop library list
88
+ npx skillshop validate
89
+ npx skillshop build
90
+ npm pack --dry-run
91
+ ```
92
+
93
+ Check that the npm package contains `skillshop.manifest.mjs`, every exported `SKILL.md`, and any assets those skills need. The export list controls what Skillshop can resolve; it does not prevent your own broad `files` patterns from publishing other files. A real `npm pack` and global install from its tarball are useful checks before a release.
94
+
95
+ After checking the tarball, publish the package with `npm publish`. Use `npm publish --access public` for a public scoped package.
96
+
97
+ ### Example: what happens after publication
98
+
99
+ With the two-skill package above published as `@example/skill-library`, a global install copies only the declared `skill:review` to the user's skill directory:
100
+
101
+ ```bash
102
+ npm install --global @example/skill-library
103
+ # ~/.agents/skills/review/SKILL.md now comes from the package
104
+ ```
105
+
106
+ An application that needs `skill:triage` can install the package locally and copy that exported skill into its own repository:
107
+
108
+ ```bash
109
+ cd ~/work/sample-app
110
+ npm install @example/skill-library skillshop
111
+ npx skillshop import @example/skill-library:triage
112
+ ```
113
+
114
+ After the distributor publishes an update, reinstalling the package globally replaces the user's `review` directory. The application's `triage` snapshot stays as it was until the application updates the package and imports again with `--force`. The two installation paths are independent.
115
+
116
+ ### Re-export a skill from another library
117
+
118
+ A package can expose a selected upstream skill under its own name:
119
+
120
+ ```bash
121
+ npm install @example/upstream
122
+ npx skillshop export skill:review --from @example/upstream --skill skill:review
123
+ ```
124
+
125
+ The resulting export in `skillshop.library.json` is:
126
+
127
+ ```json
128
+ {
129
+ "skill:review": {
130
+ "from": "@example/upstream",
131
+ "skill": "skill:review"
132
+ }
133
+ }
134
+ ```
135
+
136
+ That object is one entry inside the manifest's `exports` map. The upstream package must be a runtime dependency or a non-optional peer dependency. Re-exporting is explicit; depending on another library does not expose all of its skills.
137
+
138
+ ## CLI and JavaScript API
139
+
140
+ ```text
141
+ skillshop init
142
+ skillshop config agents
143
+ skillshop list
144
+ skillshop <name> [--global]
145
+ skillshop install <name> [--global]
146
+ skillshop update [name]
147
+ skillshop update --push
148
+ skillshop uninstall <name> [--global]
149
+ skillshop agents init [--project <directory>]
150
+ skillshop agents [--project <directory>] [--check]
151
+ skillshop agents --global
152
+ skillshop migrate [root ...]
153
+ skillshop library init
154
+ skillshop library list
155
+ skillshop export skill:<name> <directory>
156
+ skillshop export skill:<name> --from <package> [--skill skill:<source-name>]
157
+ skillshop unexport skill:<name>
158
+ skillshop validate
159
+ skillshop build
160
+ skillshop resolve <library>:<skill>
161
+ skillshop import <library>:<skill> [--global] [--to <directory>] [--force]
162
+ skillshop install-user [package-dir] [--if-global] [--to <skills-dir>]
163
+ ```
164
+
165
+ `init` and `list` keep their bundled-registry meanings. `library init`, `library list`, `validate`, and `build` operate on the package library in the current directory. In a `library:skill` reference, `library` can be an installed package name or a local package directory. `import` defaults to `.agents/skills/<skill>`; `--global` replaces `~/.agents/skills/<skill>`. `unexport` changes the package's public skill list; it does not delete the source directory. Remove a skill from `userInstall` before unexporting it.
166
+
167
+ Applications can use the same operations without invoking the CLI:
168
+
169
+ ```js
170
+ import { exportSkill, reexportSkill, buildSkillLibrary } from 'skillshop/export';
171
+ import { resolveSkill, importSkill } from 'skillshop/import';
172
+ import { installDeclaredUserSkills } from 'skillshop/user-install';
173
+ ```
174
+
175
+ For example, an application can read an exported skill directly from an installed package, or copy it into a workspace it manages:
176
+
177
+ ```js
178
+ import { readFile } from 'node:fs/promises';
179
+ import { resolveSkill, importSkill } from 'skillshop/import';
180
+
181
+ const reference = '@example/skill-library:triage';
182
+ const { manifestPath } = await resolveSkill({ reference });
183
+ const instructions = await readFile(manifestPath, 'utf8');
184
+ // Pass instructions to your agent runtime.
185
+
186
+ await importSkill({
187
+ reference,
188
+ overwrite: true,
189
+ });
190
+ ```
191
+
192
+ `resolveSkill` leaves the skill inside the installed package. `importSkill` copies its complete directory, including files alongside `SKILL.md`. Set `overwrite: true` only when the application intends to replace an existing destination.
193
+
194
+ `importSkill({ overwrite: true })` replaces a destination. Its optional `merge: true` mode overlays packaged files and preserves unrelated destination files. User-level installation always uses replacement, even when called through `installDeclaredUserSkills`.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "skillshop",
3
- "version": "2.2.0",
4
- "description": "Build, export, resolve, and install portable agent skill libraries",
3
+ "version": "4.0.0",
4
+ "description": "Install and sync agent skills from personal folder libraries",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "skillshop": "./src/cli.js",
@@ -18,6 +18,8 @@
18
18
  "files": [
19
19
  "agents-content/",
20
20
  "skills-content/",
21
+ "templates/",
22
+ "docs/",
21
23
  "src/",
22
24
  "README.md"
23
25
  ],
@@ -1,18 +1,39 @@
1
1
  ---
2
2
  name: skillshop
3
- description: Manage repository-local agent skills, Skillshop upgrades, and project agent instructions. Use when a repository has a .skillshop-lock or the user asks to install, uninstall, pin, list, update, or upgrade Skillshop-managed copies, or initialize, render, or check project AGENTS.md instructions.
3
+ description: Manage personal folder skill libraries, GitHub skill downloads, owned-copy sync, repository-local agent skills, Skillshop upgrades, and project agent instructions. Use when the user asks to initialize or list a personal library, download or install @owner/skill, install a bare personal skill name, sync personal sources, manage Skillshop copies, upgrade Skillshop, or initialize, render, or check project AGENTS.md instructions.
4
4
  metadata:
5
5
  author: Daniel Fosco
6
- version: "2026.10.23"
6
+ version: "2026.10.23.1"
7
7
  ---
8
8
 
9
- # Skillshop — Local Skill Registry
9
+ # Skillshop — Personal Skill Libraries and Local Registry
10
10
 
11
- Use the `skillshop` CLI to manage skills in this repository. The project-root `.skillshop-lock` is the source of truth for which skill directories are managed by skillshop; directories absent from the lock belong to the project or another installer.
11
+ Use the `skillshop` CLI to manage personal folder libraries and their recorded installed copies. A personal library is the source of truth for user-authored skills; `.skillshop-lock` and `~/.skillshop/global-skills.json` record which project and global directories Skillshop installed from those sources. Directories absent from ownership records belong to the project or another installer.
12
+
13
+ ## Personal folder libraries
14
+
15
+ ```bash
16
+ skillshop library init # selects ~/skillshop-library
17
+ skillshop library init ./my-skills # creates or adopts an existing folder
18
+ skillshop library list
19
+ skillshop download @alice/review # adds source without installing
20
+ skillshop install @alice/review # downloads if missing, then installs locally
21
+ skillshop install @alice/review --global
22
+ skillshop install review # installs an existing selected source
23
+ skillshop sync # syncs all recorded personal copies
24
+ ```
25
+
26
+ The library is an ordinary folder. It needs no `package.json`, npm author metadata, build step, or version field. `skillshop library init` selects the visible default `~/skillshop-library` or creates/adopts the explicit directory. It preserves existing library skills and config. `skillshop library list` shows the selected source folder.
27
+
28
+ The plain `skillshop-library.json` config names a relative `skillsDirectory` (default `skills`). Each skill is a directory with `SKILL.md` declaring `name` and `description`; references, scripts, hidden files, binary assets, and executable modes are included in the full directory.
29
+
30
+ `skillshop download @owner/skill` fetches `https://github.com/owner/skillshop-library.git` and adds only the requested `skills/skill` directory to the personal library. The leading `@` marks remote syntax and is stripped from the GitHub owner; the repository URL contains no `@`. Unprefixed `owner/skill` inputs are rejected. Download does not install the skill. Same-name authored or different-source collisions fail. `skillshop download @owner/skill --force` explicitly replaces that source after validating the remote tree. `skillshop install @owner/skill` downloads only when the source is absent. An existing same-origin source, including local edits, is reused without an upstream fetch. `skillshop install name` uses a bare name for a source already in the selected personal library.
31
+
32
+ `skillshop sync` updates copies recorded as personal-library installs and is the explicit migration step for tracked legacy bundled copies. It compares and copies the complete source tree, including path and mode changes, repairs edits made inside an installed copy, and removes stale extras inside that owned skill directory. It uses the source root recorded at install time, even after another library is selected. Sync does not fetch upstream. `skillshop library init` never migrates. For a tracked bundle copy, an existing selected-library source wins. If the source is missing, it is imported only when every surviving tracked project and global copy agrees in paths, bytes, and modes. Divergence, unknown source kinds, unreadable ownership state, unmanaged directories, and package-import snapshots are preserved and reported. A missing personal source reports an error and preserves existing destinations. Missing destinations are pruned from their ownership records and are not recreated. Keep durable edits in the personal source; sync replaces edits made in its owned installed copies.
12
33
 
13
34
  This registry is hand-maintained. `metadata.author` is original-author attribution, not ownership. The user can adapt skills locally. skillshop does not read other installers' state or update their skills; the user resolves name collisions.
14
35
 
15
- Every non-`agents` invocation, including help, version, and failed commands, reconciles the current project's lockfile, registration, and Git exclusions, except `skillshop upgrade`. Agent instruction commands also bypass reconciliation. Upgrade skips the old process's pre/post reconciliation, installs the npm package first, then starts the installed CLI in a fresh process to refresh only changed-version copies recorded in Skillshop's project/global ownership files. A failed npm install must not touch managed copies; report any partial copy refresh and return failure. Never adopt unmanaged directories or package-import snapshots, and do not recreate deleted paths. Reconciliation removes missing installation paths and stale repository registrations. Tracked installed frontmatter is repaired without replacing bodies or extra fields: names match directory names, author/version use the installation record, and missing descriptions use the bundled skill. Incomplete records fall back to installed or bundled metadata. Valid files are not rewritten. Invalid lockfiles, unsafe paths, and unsupported frontmatter must be reported, not discarded. Do not silently untrack Git files; that remains an explicit migration operation.
36
+ Most ordinary non-agent commands reconcile the current project's lockfile, registration, and Git exclusions. Personal library, download, qualified install, sync, upgrade, and agent-instruction commands bypass that legacy reconciliation. In personal mode, `skillshop list` and named installs also bypass it. Upgrade installs the npm package first, then starts the installed CLI in a fresh process to refresh changed-version bundled copies recorded in Skillshop's project/global ownership files. Personal-source copies are excluded from bundled refresh. A failed npm install must not touch managed copies; report any partial copy refresh and return failure. Never adopt unmanaged directories or package-import snapshots, and do not recreate deleted paths. Reconciliation removes missing installation paths and stale repository registrations. Tracked bundled installed frontmatter is repaired without replacing bodies or extra fields. Invalid lockfiles, unsafe paths, and unsupported frontmatter must be reported, not discarded. Do not silently untrack Git files; that remains an explicit migration operation.
16
37
 
17
38
  `skillshop init` is optional for upgrade. It configures agent destinations but does not install the npm package or refresh managed skill copies. Upgrade never generates or edits `AGENTS.md` files or project instruction templates.
18
39
 
@@ -66,7 +87,7 @@ For npm consumers, declare explicit scripts rather than relying on an install ho
66
87
 
67
88
  Commit the template and block sources together with the rendered root `AGENTS.md`; commit `package.json` and the npm lockfile when Skillshop is a development dependency. Run `npm run agents:check` in CI to detect stale or missing generated output.
68
89
 
69
- ## Install a skill
90
+ ## Install a bundled skill when no personal library is selected
70
91
 
71
92
  Run commands from anywhere inside the repository:
72
93
 
@@ -77,7 +98,7 @@ skillshop i <name>
77
98
  skillshop add <name>
78
99
  ```
79
100
 
80
- The CLI installs the full skill package into every configured project path, refreshes every skill already listed in `.skillshop-lock`, and updates the lockfile. Changing the configured agents migrates managed local copies on the next install or update. Local installs are recorded in `~/.skillshop/repositories.json`; `.skillshop-lock` and its managed skill paths are added to the repository's Git `info/exclude`.
101
+ Without a selected personal library, the CLI installs the full skill package into every configured project path, refreshes every skill already listed in `.skillshop-lock`, and updates the lockfile. Changing the configured agents migrates managed local copies on the next install or update. Local installs are recorded in `~/.skillshop/repositories.json`; `.skillshop-lock` and its managed skill paths are added to the repository's Git `info/exclude`. With a personal library selected, `skillshop list` and unqualified named installs use that library only; they do not reconcile bundled copies or add bundled `skillshop` guidance.
81
102
 
82
103
  To require the exact version currently available from the local registry:
83
104
 
@@ -88,7 +109,7 @@ skillshop install <name> --version <version>
88
109
  skillshop <name> --global
89
110
  ```
90
111
 
91
- `--global` (or `-g`) installs into every configured system skill path without a project lockfile. Installs are recorded in `~/.skillshop/global-skills.json`. Except for `skillshop upgrade`, ordinary commands other than `skillshop agents` can repair their frontmatter and prune missing paths. Agent-instruction commands bypass that reconciliation. `skillshop upgrade` instead refreshes recorded global and registered project copies only after npm succeeds and a fresh CLI starts. Same-version copies keep local body edits; a changed-version refresh replaces the managed copy and overwrites local edits. Older installs are recorded on explicit reinstall; do not adopt other global skills. Global copies are not migrated when the agent setting changes, so remove unwanted global skills before reconfiguration. The local registry contains one current version per skill. `--version` (or `-v`) is an exact compatibility check; do not claim that an unavailable historical version can be resolved.
112
+ `--global` (or `-g`) installs into every configured system skill path without a project lockfile. Installs are recorded in `~/.skillshop/global-skills.json`. For bundled tracked installs, most ordinary commands can repair frontmatter and prune missing paths. Personal library, download, qualified install, sync, upgrade, and agent-instruction commands bypass that legacy reconciliation. In personal mode, `skillshop list` and named installs bypass it too. `skillshop upgrade` refreshes recorded bundled global and registered project copies only after npm succeeds and a fresh CLI starts. Same-version bundled copies keep local body edits; a changed-version refresh replaces that managed copy and overwrites its local edits. For durable personal edits, select a folder library, use explicit sync to adopt agreeing tracked copies, and edit the library source. Personal-library copies are excluded from bundled refresh. Explicit `skillshop sync` never scans untracked directories. Global copies are not migrated when the agent setting changes, so remove unwanted global skills before reconfiguration. The local registry contains one current version per skill. `--version` (or `-v`) is an exact compatibility check; do not claim that an unavailable historical version can be resolved.
92
113
 
93
114
  ## Update managed skills
94
115
 
@@ -111,7 +132,7 @@ skillshop upgrade
111
132
 
112
133
  Upgrade targets the npm installation that supplied the invoked CLI. A local npm dependency updates in its owning project and stays in its existing dependency section; only that project's locked Skillshop copies are refreshed. A global npm installation updates its active prefix and refreshes recorded global copies plus copies in registered projects without changing those projects' npm manifests. A source checkout retains the compatibility behavior of installing Skillshop globally, without editing the checkout's `package.json`.
113
134
 
114
- After npm succeeds, the new package's CLI starts in a fresh process. It replaces existing recorded copies only when the bundled skill version changed, preserving local bodies for same-version copies. Changed-version replacement overwrites local edits in that managed copy; make durable changes in the bundled skill source. Missing paths are pruned from records rather than recreated. Unmanaged skills and imported snapshots remain untouched. Install failure prevents refresh; refresh failure reports the npm stage as successful and returns nonzero with a partial-result summary. Upgrade does not run agent initialization or project instruction generation.
135
+ After npm succeeds, the new package's CLI starts in a fresh process. It replaces existing recorded copies only when the bundled skill version changed, preserving local bodies for same-version copies. Changed-version replacement overwrites local edits in that managed copy. For durable personal edits, select a library, explicitly sync to adopt agreeing tracked copies, then edit the library source and sync. Missing paths are pruned from records rather than recreated. Unmanaged skills and imported snapshots remain untouched. Install failure prevents refresh; refresh failure reports the npm stage as successful and returns nonzero with a partial-result summary. Upgrade does not run agent initialization or project instruction generation.
115
136
 
116
137
  ## Migrate existing repositories
117
138