sync-skills
Installation
SKILL.md
Sync Skills
Run as an agent, the skills CLI never asks, so npx skills update -g skips skills deleted upstream, and nothing installs skills a source added later. This skill does both.
Rules
- Change installs only through
npx -y skills update/add/remove. Neverrmskill directories or edit~/.agents/.skill-lock.json. - Skills whose
sourceinnpx -y skills ls -g --jsonislocalornull, and anything that command does not list (such as~/.claude/skills/synced/), are out of scope. - Install in full only the user's own sources and those in
$ARGUMENTS. The user picked skills by hand from every other source; never install or list their uninstalled skills. - Remove only after the user confirms.
Workflow
- Update. Run
npx -y skills update -g -y 2>&1 | sed 's/\x1b\[[0-9;]*m//g'. Record the updated skills, any source it "Failed to check", and each list under "appear to have been deleted upstream". - Find own sources. The user's login is
gh api user --jq .login, orgit config --global user.nameifghis unavailable. Own sources are the installed sources whose owner matches it, ignoring case. Add anyowner/repoin$ARGUMENTS. - Install in full. For each own source, record
ls -gnames, runnpx -y skills add <source> -g --skill '*' -y, then diffls -gto find what was newly installed. A failure for an agent the CLI says does not support global installs is not a failure of the skill. Report a skill the CLI skipped with a parse error under Failed. - Confirm removals. If step 1 reported deleted skills, ask once with AskUserQuestion: Remove all (recommended), Choose individually, Keep all. Otherwise skip to step 6.
- Remove.
npx -y skills remove -g <name>... -y. - Verify. Run
npx -y skills ls -g --json: no removed skill appears.