skillshop 4.0.0 → 4.1.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 +30 -6
- package/docs/installation-and-dependency-state.md +76 -0
- package/docs/package-library-compatibility.md +3 -3
- package/docs/releases/4.1.0.md +12 -0
- package/package.json +4 -2
- package/skills-content/skillshop/SKILL.md +23 -9
- package/src/cli.js +27 -0
- package/src/dependencies.js +282 -0
- package/src/github-library.js +21 -9
- package/src/import.js +15 -0
- package/src/index.js +2 -0
- package/src/installation-state.js +113 -0
- package/src/legacy-cli.js +186 -87
- package/src/user-install.js +34 -1
- package/templates/skillshop-library/README.md +2 -0
package/README.md
CHANGED
|
@@ -36,6 +36,30 @@ skillshop sync # updates all recorded project and global
|
|
|
36
36
|
|
|
37
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
38
|
|
|
39
|
+
### Installation ownership and project dependencies
|
|
40
|
+
|
|
41
|
+
Every installed skills directory has its own `.skillshop-lock`. This is a local ownership manifest, not a project dependency lockfile. It records which installer owns each named directory and its source. Personal-library, bundled, package, package-import, and dependency workflows preserve one another's entries. An existing unmanaged or foreign-owned directory is never implicitly adopted, including with package import `--force`.
|
|
42
|
+
|
|
43
|
+
For reproducible project requirements, opt into a separate dependency workflow:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
skillshop dependency add @alice/review@v1.2.0
|
|
47
|
+
skillshop dependency add @alice/triage@0123456789abcdef0123456789abcdef01234567
|
|
48
|
+
skillshop install # restore declared dependencies
|
|
49
|
+
skillshop ci # restore with a frozen lock
|
|
50
|
+
skillshop dependency remove review
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
`dependency add` writes `skillshop.json` and `skillshop-lock.json` at the project root and installs the skill. Commit both files. A reference can select a Git tag, branch, or full commit; omitting it resolves the current default branch. The lock records the exact resolved Git commit and SHA-256 integrity of the complete skill tree. It never follows a moved tag or branch during restore. These refs select repository revisions, not semver ranges or the version field in `SKILL.md`.
|
|
54
|
+
|
|
55
|
+
The project manifest declares `skillsDirectory` (default `.agents/skills`), independently of personal agent settings. Dependency installs use upstream sources directly; they do not create or modify your personal library. `skillshop sync`, ordinary named updates, and Skillshop upgrades leave dependency-owned content alone. Use `skillshop dependency update [name]` to re-resolve upstream refs, or add a different ref; ordinary installs reuse matching lock entries. `skillshop ci` or `skillshop install --frozen-lockfile` fails before installation if the dependency declaration and lock disagree.
|
|
56
|
+
|
|
57
|
+
Use `skillshop dependency install` as an explicit alias for restore. For skills distributed through npm application packages, continue using npm's dependency declarations and package lock to pin the package; the destination `.skillshop-lock` records installation ownership only.
|
|
58
|
+
|
|
59
|
+
`skillshop upgrade` automatically migrates legacy project-root `.skillshop-lock` / `.skillz-lock` files and `~/.skillshop/global-skills.json` (or the legacy state home) within its upgrade scope. Replacements are validated and saved before old records are removed, even when skill versions have not changed. Invalid/conflicting ownership or unsafe paths are preserved and reported as an incomplete migration. Unregistered repositories can be discovered with `skillshop migrate ~/workspace`. Installing the CLI directly with npm does not run migration hooks; use `skillshop migrate` or subsequent ownership-reconciling commands.
|
|
60
|
+
|
|
61
|
+
See [installation and dependency state](docs/installation-and-dependency-state.md) for schemas, migration boundaries, and ownership rules.
|
|
62
|
+
|
|
39
63
|
### Install a bundled registry skill (compatibility mode)
|
|
40
64
|
|
|
41
65
|
When no personal library is selected, the bundled registry remains available:
|
|
@@ -47,7 +71,7 @@ skillshop one-shot
|
|
|
47
71
|
skillshop one-shot --global
|
|
48
72
|
```
|
|
49
73
|
|
|
50
|
-
Run project installs inside a Git repository. Skillshop records
|
|
74
|
+
Run project installs inside a Git repository. Skillshop records ownership in `.skillshop-lock` inside each destination skills directory, for example `.agents/skills/.skillshop-lock`. It adds its local manifests and managed skill paths to the repository's local Git exclude file. In this compatibility mode it also installs bundled `skillshop` guidance. Global installs use the same directory-local format, for example `~/.agents/skills/.skillshop-lock`.
|
|
51
75
|
|
|
52
76
|
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.
|
|
53
77
|
|
|
@@ -61,7 +85,7 @@ skillshop uninstall one-shot
|
|
|
61
85
|
skillshop uninstall one-shot --global
|
|
62
86
|
```
|
|
63
87
|
|
|
64
|
-
`update` refreshes skills
|
|
88
|
+
`update` refreshes Skillshop-owned personal or bundled skills in the current project from their recorded source. `update --push` updates registered projects. Use `skillshop sync` to propagate personal-library changes to recorded local and global copies. Project and global uninstall remove only Skillshop CLI-owned copies recorded in the destination manifests. They refuse unmanaged skills and copies owned by packages or project dependencies.
|
|
65
89
|
|
|
66
90
|
### Upgrade Skillshop
|
|
67
91
|
|
|
@@ -71,7 +95,7 @@ skillshop upgrade
|
|
|
71
95
|
|
|
72
96
|
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.
|
|
73
97
|
|
|
74
|
-
After npm succeeds, the newly installed CLI runs in a fresh process
|
|
98
|
+
After npm succeeds, the newly installed CLI runs in a fresh process. It migrates legacy ownership records, then refreshes only existing CLI-owned copies 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.
|
|
75
99
|
|
|
76
100
|
`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.
|
|
77
101
|
|
|
@@ -140,7 +164,7 @@ A distributor can declare which exported skills a global npm install should plac
|
|
|
140
164
|
npm install --global @example/skill-library
|
|
141
165
|
```
|
|
142
166
|
|
|
143
|
-
Those declared skills are copied during the package's install script. This package installer targets `~/.agents/skills` by default, independently of the agents selected with `skillshop init`. Updating the package replaces
|
|
167
|
+
Those declared skills are copied during the package's install script. This package installer targets `~/.agents/skills` by default, independently of the agents selected with `skillshop init`. Updating the package replaces its own recorded user skills, refuses unmanaged or foreign-owned collisions, and removes its own copies when their declarations are removed. If scripts are disabled, run `skillshop install-user /path/to/installed-package` manually.
|
|
144
168
|
|
|
145
169
|
To copy one exported skill into a project instead:
|
|
146
170
|
|
|
@@ -162,9 +186,9 @@ cd ~/work/sample-app
|
|
|
162
186
|
skillshop changelog
|
|
163
187
|
```
|
|
164
188
|
|
|
165
|
-
The global command writes `~/.agents/skills/one-shot/SKILL.md`. The project command writes `.agents/skills/changelog/SKILL.md` and `.agents/skills/skillshop/SKILL.md` inside `sample-app`, then records both managed skills in `.skillshop-lock`. It does not copy `one-shot` into the project. Running `skillshop update` in `sample-app` refreshes the locked project skills; run `skillshop one-shot --global` again to replace the global copy.
|
|
189
|
+
The global command writes `~/.agents/skills/one-shot/SKILL.md`. The project command writes `.agents/skills/changelog/SKILL.md` and `.agents/skills/skillshop/SKILL.md` inside `sample-app`, then records both managed skills in `.agents/skills/.skillshop-lock`. It does not copy `one-shot` into the project. Running `skillshop update` in `sample-app` refreshes the locked project skills; run `skillshop one-shot --global` again to replace the global copy.
|
|
166
190
|
|
|
167
|
-
Package imports
|
|
191
|
+
Package imports record package-import ownership in the destination manifest and remain separate from personal-library sync and project dependency locking. `import` copies a snapshot from another package; `skillshop update` does not refresh that snapshot. `export` names a skill for consumers of a package and does not install it anywhere.
|
|
168
192
|
|
|
169
193
|
## For project owners: distribute skills
|
|
170
194
|
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Installed ownership and project dependency locks
|
|
2
|
+
|
|
3
|
+
Skillshop separates editable source libraries, installed ownership, and reproducible project requirements. Installing a personal skill does not make it a project dependency. Applications distributed through npm continue to use npm's own dependency declarations and package lock.
|
|
4
|
+
|
|
5
|
+
## Destination ownership
|
|
6
|
+
|
|
7
|
+
Every destination skills directory has one `.skillshop-lock`. The destination itself identifies installed paths; entries do not repeat absolute destination paths or point to a second authoritative registry.
|
|
8
|
+
|
|
9
|
+
```json
|
|
10
|
+
{
|
|
11
|
+
"manifestVersion": 1,
|
|
12
|
+
"skills": {
|
|
13
|
+
"review": {
|
|
14
|
+
"owner": { "kind": "skillshop", "id": "project" },
|
|
15
|
+
"source": {
|
|
16
|
+
"kind": "personal-library",
|
|
17
|
+
"root": "/Users/example/skillshop-library",
|
|
18
|
+
"skill": "review",
|
|
19
|
+
"skillDirectory": "skills/review"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
CLI-owned copies use owner kind `skillshop` and id `project` or `global`. Project dependency copies use kind `dependency`, id `project`. These local ids survive moving an entire project directory. Package lifecycle installers use kind `package` and the package name as id; explicit snapshot imports use kind `package-import`. Package ids remain stable across versions and npm installation paths. Anonymous manifest-object imports use their source directory as id and should supply a package name for stable ownership.
|
|
27
|
+
|
|
28
|
+
Each installer reads the destination manifest, checks ownership, and preserves entries belonging to other installers. Matching ownership permits updates. Existing directories without ownership records and records belonging to other owners are rejected. `import --force` permits replacing an existing matching package-import copy; it does not adopt unrelated directories. Global CLI uninstall checks ownership too. Package declaration updates prune only that package's obsolete copies; `uninstallUserSkill` provides explicit same-owner removal.
|
|
29
|
+
|
|
30
|
+
The files `~/.skillshop/installations.json` and `repositories.json` are discovery indexes, not ownership authorities. Deleting or editing an index does not grant ownership. Known standard installation directories can still be discovered from the project or home directory. `sync` uses the source roots recorded in destination manifests, independently of the currently selected library.
|
|
31
|
+
|
|
32
|
+
Ownership manifests are local machine state. Personal/bundled installation commands locally exclude their manifests and owned directories through Git's `info/exclude`. Dependency commands maintain a separate bounded exclude block for generated dependency content and destination manifests. Unrelated installed skill directories are not blanket-excluded. Project declarations and dependency locks remain commit candidates.
|
|
33
|
+
|
|
34
|
+
## Project declarations and immutable resolution
|
|
35
|
+
|
|
36
|
+
Add a dependency explicitly:
|
|
37
|
+
|
|
38
|
+
```sh
|
|
39
|
+
skillshop dependency add @alice/review@v1.2.0
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
This writes a project-owned `skillshop.json`:
|
|
43
|
+
|
|
44
|
+
```json
|
|
45
|
+
{
|
|
46
|
+
"schemaVersion": 1,
|
|
47
|
+
"skillsDirectory": ".agents/skills",
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"review": "@alice/review@v1.2.0"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
A corresponding `skillshop-lock.json` records each requested reference, conventional GitHub repository URL, exact resolved commit, and `sha256-` integrity. It also records the project installation directory, so a frozen restore detects destination configuration changes. It contains no personal-library paths or machine-specific destination paths.
|
|
55
|
+
|
|
56
|
+
Refs can select a Git tag, branch, or full commit hash. An omitted ref resolves the repository's default branch. These are Git revisions; there is no semver-range solver or historical registry of `SKILL.md` version fields. A moved upstream tag cannot change an existing lock entry. The complete directory is fetched from the locked commit, and integrity covers ordered paths, file bytes, and executable bits, including hidden files, scripts and binary references. Repository code is never executed while fetching.
|
|
57
|
+
|
|
58
|
+
`skillshop install` and `skillshop dependency install` restore declared dependencies. Unchanged entries reuse their locked commit; a new or changed declaration resolves its ref. Already correct owned copies are left in place without upstream requests. Missing copies are restored and edited copies are repaired against the lock. Restoration requires upstream access when the required content is not already installed correctly.
|
|
59
|
+
|
|
60
|
+
`skillshop ci`, `skillshop install --frozen-lockfile`, and `skillshop dependency install --frozen-lockfile` refuse a missing or stale lock before changing output. Use `skillshop dependency update [name]` to re-resolve selected or all upstream refs, or add a different ref. `skillshop dependency remove review` removes the declaration, locked resolution and matching owned copy while preserving other owners. Ordinary personal sync/update and CLI upgrade never refresh dependency copies.
|
|
61
|
+
|
|
62
|
+
All required downloads, integrity checks and ownership checks finish before dependency content changes. Replacement/removal uses temporary directories and backups. A failed content or metadata write restores prior content, ownership and project declarations. Manifest writes use atomic rename. These records are ownership and reproducibility data, not process mutexes; concurrent writers targeting the same directory are not supported.
|
|
63
|
+
|
|
64
|
+
Dependency APIs are exported from `skillshop/dependencies`: `addDependency`, `installDependencies`, `updateDependencies`, and `removeDependency`. They accept `cwd`; install accepts `frozen`. For CLI commands, the nearest project manifest takes precedence while ascending to the nearest Git root. Outside Git, an existing ancestor manifest is used; otherwise the working directory is the project boundary.
|
|
65
|
+
|
|
66
|
+
## Migration and upgrade boundaries
|
|
67
|
+
|
|
68
|
+
The new CLI reads legacy project-root `.skillshop-lock` / `.skillz-lock` files and the old state-home `global-skills.json`. It validates their schemas, owned paths and any existing destination claims before repair or migration. Divergent simultaneous legacy root files are rejected. Only explicit ownership records are migrated; scanning directories does not adopt arbitrary skills.
|
|
69
|
+
|
|
70
|
+
Replacement manifests are saved beside installed skills before legacy records are removed. Retry is safe when a prior attempt saved only part of the replacement state. Malformed JSON, conflicting source/ownership records, and symlinked paths are preserved and reported rather than silently discarded. Upgrading does not merge or overwrite application-owned directories.
|
|
71
|
+
|
|
72
|
+
`skillshop upgrade` installs the new npm package first and uses its fresh CLI for migration and version-based bundled refresh. A project-local npm installation migrates only its owning project's state. A global installation migrates global state and registered projects. Migration runs even for unchanged-version and personal-library copies. Same-version bundled edits survive; changed-version bundled refresh retains its existing replacement behavior. Missing copies are not recreated by ownership migration.
|
|
73
|
+
|
|
74
|
+
Direct `npm install --global skillshop` replaces the CLI but does not run migration hooks. The next ownership-reconciling command can migrate its current project and global state; `skillshop migrate ~/workspace` discovers additional repositories. Personal-library initialization, downloading, listing and instruction-rendering commands retain their existing isolation from legacy reconciliation.
|
|
75
|
+
|
|
76
|
+
Using an old CLI after migration is unsupported: old versions do not understand directory-local manifests. Reinstalling skills with an old package installer can also bypass the new ownership protections. Keep application integrations on the updated Skillshop API.
|
|
@@ -79,7 +79,7 @@ To copy selected skills during a global npm install, add `skillshop.userInstall`
|
|
|
79
79
|
|
|
80
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
81
|
|
|
82
|
-
An install
|
|
82
|
+
An install records package ownership in `.skillshop-lock` inside the destination skills directory. It replaces only copies already owned by the same package and rejects unmanaged or foreign-owned destinations. A later install removes copies owned by that package when their names are removed from `userInstall`; other owners remain untouched. Package names identify owners across versions and installation paths. Applications can explicitly remove an owned skill with `uninstallUserSkill` from `skillshop/user-install`.
|
|
83
83
|
|
|
84
84
|
### 3. Check and pack the package
|
|
85
85
|
|
|
@@ -162,7 +162,7 @@ skillshop import <library>:<skill> [--global] [--to <directory>] [--force]
|
|
|
162
162
|
skillshop install-user [package-dir] [--if-global] [--to <skills-dir>]
|
|
163
163
|
```
|
|
164
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`
|
|
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` targets `~/.agents/skills/<skill>` and replaces only a matching package-import-owned copy. `unexport` changes the package's public skill list; it does not delete the source directory. Remove a skill from `userInstall` before unexporting it.
|
|
166
166
|
|
|
167
167
|
Applications can use the same operations without invoking the CLI:
|
|
168
168
|
|
|
@@ -191,4 +191,4 @@ await importSkill({
|
|
|
191
191
|
|
|
192
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
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`.
|
|
194
|
+
`importSkill({ overwrite: true })` replaces a destination only when that copy is already owned by the same package-import source; it does not authorize taking ownership of unrelated content. Its optional `merge: true` mode overlays packaged files and preserves unrelated destination files. User-level installation always uses replacement of matching package-owned copies, even when called through `installDeclaredUserSkills`. Merge mode also requires matching ownership for existing targets.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Skillshop 4.1.0
|
|
2
|
+
|
|
3
|
+
Separate installed skill ownership from reproducible project dependencies.
|
|
4
|
+
|
|
5
|
+
- Store ownership in `.skillshop-lock` beside installed skills, with automatic migration of tracked legacy project/global records during `skillshop upgrade`.
|
|
6
|
+
- Add committed `skillshop.json` declarations and `skillshop-lock.json` resolutions that pin exact Git commits and complete-tree SHA-256 integrity.
|
|
7
|
+
- Add `skillshop dependency add/install/update/remove`, dependency restore through `skillshop install`, and frozen restore through `skillshop ci`.
|
|
8
|
+
- Reject unmanaged and foreign-owned collisions, protect global uninstall, and prune removed application declarations only for their recorded package owner.
|
|
9
|
+
|
|
10
|
+
Migration preserves unmanaged skills and same-version bundled edits. Invalid ownership records and unsafe paths are preserved and reported. Direct npm installation replaces the CLI without migration hooks; run `skillshop migrate ~/workspace` to discover and migrate additional repositories. Older CLI versions cannot read the new ownership format.
|
|
11
|
+
|
|
12
|
+
Validated with the full automated suite, isolated local/global upgrade fixtures, and packed CLI installation/dependency smoke tests.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "skillshop",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"description": "Install and sync agent skills from personal folder libraries",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -13,7 +13,9 @@
|
|
|
13
13
|
"./export": "./src/export.js",
|
|
14
14
|
"./import": "./src/import.js",
|
|
15
15
|
"./user-install": "./src/user-install.js",
|
|
16
|
-
"./specifier": "./src/specifier.js"
|
|
16
|
+
"./specifier": "./src/specifier.js",
|
|
17
|
+
"./dependencies": "./src/dependencies.js",
|
|
18
|
+
"./installation-state": "./src/installation-state.js"
|
|
17
19
|
},
|
|
18
20
|
"files": [
|
|
19
21
|
"agents-content/",
|
|
@@ -3,12 +3,12 @@ name: skillshop
|
|
|
3
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.
|
|
6
|
+
version: "2026.10.28.1"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# Skillshop — Personal Skill Libraries and Local Registry
|
|
10
10
|
|
|
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
|
|
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; each destination skills directory contains a `.skillshop-lock` ownership manifest for its installed copies. Project-root `skillshop.json` and `skillshop-lock.json` separately declare and lock reproducible project dependencies. Directories absent from ownership records belong to the project or another installer.
|
|
12
12
|
|
|
13
13
|
## Personal folder libraries
|
|
14
14
|
|
|
@@ -37,6 +37,20 @@ Most ordinary non-agent commands reconcile the current project's lockfile, regis
|
|
|
37
37
|
|
|
38
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.
|
|
39
39
|
|
|
40
|
+
## Project skill dependencies
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
skillshop dependency add @alice/review@v1.2.0
|
|
44
|
+
skillshop dependency install
|
|
45
|
+
skillshop install
|
|
46
|
+
skillshop ci
|
|
47
|
+
skillshop dependency remove review
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
`dependency add` declares a GitHub skill in project-root `skillshop.json` and resolves its tag, branch or commit into an exact commit and complete-tree SHA-256 integrity in `skillshop-lock.json`. Commit both files. `skillsDirectory` defaults to `.agents/skills` and is project-owned, independent of user agent selection. Restore reuses the locked commit even when upstream refs move. `ci` and `install --frozen-lockfile` refuse missing/stale locks. These operations bypass personal libraries and unrelated legacy state. Dependency copies are not changed by personal sync, named update or CLI upgrade. Use npm's own lockfile for npm-distributed package dependencies.
|
|
51
|
+
|
|
52
|
+
All installers record/check ownership in the destination `.skillshop-lock`; unmanaged/foreign-owned collisions must fail. Package updates prune removed declarations only for that same package owner. Import `--force` authorizes replacement of the same package-import owner, not adoption of arbitrary directories.
|
|
53
|
+
|
|
40
54
|
## Configure agents
|
|
41
55
|
|
|
42
56
|
```bash
|
|
@@ -98,7 +112,7 @@ skillshop i <name>
|
|
|
98
112
|
skillshop add <name>
|
|
99
113
|
```
|
|
100
114
|
|
|
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
|
|
115
|
+
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`; destination `.skillshop-lock` files and their 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.
|
|
102
116
|
|
|
103
117
|
To require the exact version currently available from the local registry:
|
|
104
118
|
|
|
@@ -109,7 +123,7 @@ skillshop install <name> --version <version>
|
|
|
109
123
|
skillshop <name> --global
|
|
110
124
|
```
|
|
111
125
|
|
|
112
|
-
`--global` (or `-g`) installs into every configured system skill path without a project lockfile.
|
|
126
|
+
`--global` (or `-g`) installs into every configured system skill path without a project lockfile. Ownership is recorded in `.skillshop-lock` inside each global skills directory. 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.
|
|
113
127
|
|
|
114
128
|
## Update managed skills
|
|
115
129
|
|
|
@@ -122,7 +136,7 @@ skillshop update --push
|
|
|
122
136
|
skillshop up --push
|
|
123
137
|
```
|
|
124
138
|
|
|
125
|
-
`update` with no name replaces every skill listed in the current repository's
|
|
139
|
+
`update` with no name replaces every skill listed in the current repository's directory-local ownership manifests and updates its locked metadata. A name updates only that managed skill. `--push` updates every centrally registered repository and cannot be combined with a skill name. Updates and installs replace local edits; keep edits in the registry if they should survive these operations. Global installs cannot be updated with this command; reinstall them by name with `--global`.
|
|
126
140
|
|
|
127
141
|
## Upgrade Skillshop
|
|
128
142
|
|
|
@@ -132,7 +146,7 @@ skillshop upgrade
|
|
|
132
146
|
|
|
133
147
|
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`.
|
|
134
148
|
|
|
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.
|
|
149
|
+
After npm succeeds, the new package's CLI starts in a fresh process. It migrates valid legacy project-root and global ownership records to destination manifests before refreshing skills, even when versions are unchanged. Old records are removed only after replacement manifests are saved. Conflicting, malformed or unsafe state is preserved and reported. 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.
|
|
136
150
|
|
|
137
151
|
## Migrate existing repositories
|
|
138
152
|
|
|
@@ -153,7 +167,7 @@ skillshop rm <name>
|
|
|
153
167
|
skillshop uninstall <name> --global
|
|
154
168
|
```
|
|
155
169
|
|
|
156
|
-
Local uninstall removes every managed copy of the named directory only when it is listed in `.skillshop-lock`, then removes its lock entry. It must leave unlisted directories alone. Later updates honor the remaining lock entries and do not restore an uninstalled skill.
|
|
170
|
+
Local uninstall removes every managed copy of the named directory only when it is listed in `.skillshop-lock`, then removes its lock entry. It must leave unlisted directories alone. Later updates honor the remaining lock entries and do not restore an uninstalled skill. Global uninstall also requires CLI ownership; it must preserve application-owned and unmanaged skills. Use `dependency remove` for dependency-owned copies.
|
|
157
171
|
|
|
158
172
|
## Inspect the registry and CLI
|
|
159
173
|
|
|
@@ -173,6 +187,6 @@ skillshop -h
|
|
|
173
187
|
- Do not manually add unrelated skills to `.skillshop-lock`.
|
|
174
188
|
- Do not remove or overwrite unlisted skill directories.
|
|
175
189
|
- Installed copies can be edited, but installs and updates replace them. Preserve durable edits in the registry.
|
|
176
|
-
- Do not add lock-managed skill directories or `.skillshop-lock` to Git; they are
|
|
177
|
-
- Global installation with `skillshop <name> --global` writes to the configured system paths and records
|
|
190
|
+
- Do not add lock-managed skill directories or `.skillshop-lock` to Git; they are local installation state. Commit `skillshop.json` and `skillshop-lock.json` when using project dependencies.
|
|
191
|
+
- Global installation with `skillshop <name> --global` writes to the configured system paths and records ownership in each destination skills directory's `.skillshop-lock`.
|
|
178
192
|
- Use `skillshop list` to inspect available local-registry names, versions, and authors.
|
package/src/cli.js
CHANGED
|
@@ -8,6 +8,7 @@ import { importSkill, resolveSkill } from './import.js';
|
|
|
8
8
|
import { installDeclaredUserSkills } from './user-install.js';
|
|
9
9
|
import { reconcileLegacyState, runLegacyCli } from './legacy-cli.js';
|
|
10
10
|
import { parseLibrarySkillReference, skillName } from './specifier.js';
|
|
11
|
+
import { addDependency, installDependencies, removeDependency, updateDependencies } from './dependencies.js';
|
|
11
12
|
|
|
12
13
|
function help() {
|
|
13
14
|
console.log(`
|
|
@@ -23,6 +24,18 @@ Personal folder library commands:
|
|
|
23
24
|
Create or select a source folder with skillshop library init. Download @owner/skill adds a GitHub skill to that folder without installing it.
|
|
24
25
|
Install @owner/skill downloads when needed, then installs the complete source tree. Bare install names use the selected personal library. Sync updates recorded project and global copies from their saved source roots.
|
|
25
26
|
No npm package manifest or author metadata is required. Existing npm package export/import APIs remain available for compatibility.`);
|
|
27
|
+
console.log(`
|
|
28
|
+
Project skill dependencies (separate from personal-library installs):
|
|
29
|
+
|
|
30
|
+
skillshop dependency add @<owner>/<skill>[@<tag-or-commit>]
|
|
31
|
+
skillshop dependency install [--frozen-lockfile]
|
|
32
|
+
skillshop dependency update [name]
|
|
33
|
+
skillshop dependency remove <name>
|
|
34
|
+
skillshop install Restore declared project dependencies
|
|
35
|
+
skillshop ci Restore with a frozen dependency lock
|
|
36
|
+
|
|
37
|
+
Commit skillshop.json and skillshop-lock.json. Installed ownership lives in each skills directory's .skillshop-lock.
|
|
38
|
+
Dependency restores use exact locked Git commits and content integrity; personal sync does not update them.`);
|
|
26
39
|
}
|
|
27
40
|
|
|
28
41
|
function flag(args, name) {
|
|
@@ -42,6 +55,20 @@ const libraryCommands = new Set(['export', 'unexport', 'validate', 'build', 'res
|
|
|
42
55
|
|
|
43
56
|
async function main(argv, { libraryNamespace = false } = {}) {
|
|
44
57
|
const [command, ...args] = argv;
|
|
58
|
+
if (command === 'dependency' || command === 'ci' || (command === 'install' && (args.length === 0 || (args.length === 1 && args[0] === '--frozen-lockfile')))) {
|
|
59
|
+
if (args.includes('--help') || args.includes('-h')) return help();
|
|
60
|
+
let result;
|
|
61
|
+
if (command === 'dependency' && args[0] === 'add' && args.length === 2) result = addDependency(args[1]);
|
|
62
|
+
else if (command === 'dependency' && args[0] === 'remove' && args.length === 2) result = removeDependency(args[1]);
|
|
63
|
+
else if (command === 'dependency' && args[0] === 'update' && (args.length === 1 || args.length === 2)) result = updateDependencies(args[1] ?? null);
|
|
64
|
+
else if (command === 'ci' && args.length === 0) result = installDependencies({ frozen: true });
|
|
65
|
+
else if (command === 'install') result = installDependencies({ frozen: args.includes('--frozen-lockfile') });
|
|
66
|
+
else if (command === 'dependency' && args[0] === 'install' && (args.length === 1 || (args.length === 2 && args[1] === '--frozen-lockfile'))) {
|
|
67
|
+
result = installDependencies({ frozen: args.includes('--frozen-lockfile') });
|
|
68
|
+
} else throw new Error('Usage: skillshop dependency add @owner/skill[@ref] | install [--frozen-lockfile] | update [name] | remove <name>');
|
|
69
|
+
console.log(`Project skill dependencies: ${Object.keys(result.lock.dependencies).length} locked, ${result.changed} installation change(s) at ${result.root}`);
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
45
72
|
if (!libraryNamespace && command === 'library') {
|
|
46
73
|
if (args[0] === 'init' || args[0] === 'list') return runLegacyCli(argv);
|
|
47
74
|
if (!args.length || args[0] === '--help' || args[0] === '-h') return help();
|