Repository navigation
feat(cli): lock, update and sync skills from skillx add; project scope, several runtimes, commit refs - #168
Merged
Merged
Conversation
…scope, several runtimes and commit refs - skillx.lock/v1 gains an optional `added` list in a packages lock: the repository (no credentials), the skill's directory, the ref to follow, the commit read and the skill tree digest. `skillx add` writes it for git sources (`--lock`, `--no-lock`); a local directory is never locked. - `skillx update` re-reads added skills from their recorded source (all, or `add:<name>`), and refreshes a lock that already pins them; `uninstall add:<name>` drops the entry. - `skillx sync --locked` fetches each locked commit and installs the skill only when its tree digest is the locked one, planned together with the lock's packages. - `@ref` and `/tree/<ref>` accept a full commit id, fetched on its own (`init` + `fetch --depth 1 <url> <commit>`) and checked after the read. - `--runtime` takes several runtimes for one read, planned before any is written; `--project` installs into ./.claude/skills or ./.agents/skills with installer state kept apart per project, on every installer command. Closes #166 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FL32rxE1XR42zxaKTD3MpW
- Refuse a project whose .claude/.agents, skills or staging directory is a symlink or junction, at context creation and again under the install lock; key project state by the project's real path. - Read a commit id only when a branch or tag of the named repository contains it (commits-only fetch of the default branch, then all branches and tags), so a commit pushed only to a fork is refused. - update picks the skill from the directory it was installed from, refuses an ambiguous name, and keeps updating and locking the other sources when one fails, then reports every failure. - add reports a later runtime's failure with the targets already installed and never lets the lock write mask it; a local add drops the lock entry it replaces. - A lock path holding @ resolves to the whole repository; init a SHA-256 repository for a 64-hex commit; classify an unknown commit as not_found. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FL32rxE1XR42zxaKTD3MpW
…checks - A local add drops a lock pin only for a skill that target had from git, and leaves an unreadable lock alone. - The branch-or-tag check of a commit tries the recorded ref first, then the default branch, and falls through to every branch and tag when a remote has no HEAD. - update reports a non-CLI failure as unexpected_error and names the owners it did update; a failed lock write on a partial add is reported. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FL32rxE1XR42zxaKTD3MpW
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #166. Follows #120. Overlaps with #163 in
git-source.ts,add-source.tsand the docs line saying commit SHAs are not accepted, so whichever PR merges second has to resolve those files.What changes
Lock, update, sync
skillx addreads from git is now pinned as anaddedentry in the packages lock (skillx.lock.json). The entry records the repository URL (with no credentials), the directory, the ref to follow, the commit and theagentkit.skill-tree/v1tree digest.packages/contracts/src/install-lock-added.tsand is validated with the rest of the lock.packages.skillx updatere-reads each added skill from its recorded source.conflict.details.failures.skillx sync --lockedfetches each locked commit and installs the skill only if its tree digest matches the lock. Any other digest is anintegrity_error.add:<name>also drops its lock entry.Scope and runtimes
--runtimecan be repeated or comma-separated. The source is read once, and every runtime is planned before any is written.details.installed,details.lockPath).--projectinstalls into./.claude/skills(Claude Code) or./.agents/skills(Codex). It is also accepted byinstall,update,uninstall,listandsync.$SKILLX_HOME/projects/<hash of the real path>..claude,.agents, the skills directory or the staging directory is a symlink or junction, the command fails withconflict. This is checked when the context is created and again under the install lock.Commit refs
@<sha>and/tree/<sha>accept a full 40- or 64-hex commit. It is fetched withgit initand thengit fetch --depth 1 <url> <sha>.--filter=tree:0.Docs:
docs/cli-reference.md(theskillx addsection, lock, update and sync, runtimes and scope, the installer usage lines, and the lockfileaddedfield).Decisions
install.--no-lockskips it.addedentries. The docs say so.Review
I ran two isolated subagent reviews.
updatepicking the skill by name;updatestopping at the first failing source;Verification
pnpm typecheckpasses for every workspace.pnpm test: 156 files, 2884 passed, 3 skipped.proposal-detector-cost, failed once while another test run was using the CPU. It passes when run alone and is unrelated to this change.add-lock-refresh.test.ts,add-update-safety.test.tsandinstall-lock.test.ts. They cover:.claudeand skills directories;anthropics/skills:--projectinto claude-code and codex;addedentry written to the lock;sync --lockedrestoring the skill after its state was wiped, including through a followed@mainref;update --project;list --project;.clauderefused withconflict;not_found;integrity_error.Generated by Claude Code