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. Never rm skill directories or edit ~/.agents/.skill-lock.json.
  • Skills whose source in npx -y skills ls -g --json is local or null, 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

  1. 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".
  2. Find own sources. The user's login is gh api user --jq .login, or git config --global user.name if gh is unavailable. Own sources are the installed sources whose owner matches it, ignoring case. Add any owner/repo in $ARGUMENTS.
  3. Install in full. For each own source, record ls -g names, run npx -y skills add <source> -g --skill '*' -y, then diff ls -g to 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.
  4. Confirm removals. If step 1 reported deleted skills, ask once with AskUserQuestion: Remove all (recommended), Choose individually, Keep all. Otherwise skip to step 6.
  5. Remove. npx -y skills remove -g <name>... -y.
  6. Verify. Run npx -y skills ls -g --json: no removed skill appears.
Installs
11
Repository
liaoann/skills
First Seen
13 days ago