agentleFS
herohuaherohua/skills/sync-skills/SKILL.md

sync-skills

Skill1 starsChanged 3 months agoMITView on GitHub

Sync local Claude Code skills from GitHub repositories into ~/.claude/skills. Use this whenever the user asks to update, refresh, fetch, pull, or install skills from anthropics/skills, herohua/skills, or similar skill repositories, especially for commands like /sync-skills.

  • Deletes or force-pushes

15 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

16 rules. 0 are common, 6 are distinctive, and 10 are very specific to this project.

  • 0

    Common

    Most of the 13 edited versions we read keep these.

  • 6

    Distinctive

    This author's own choices. Worth a look.

  • 10

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Update the local skills directory at ~/.claude/skills from these repositories:

    line 10
  2. Very specific:

    Keep local skills current while avoiding accidental deletion of unrelated directories.

    line 19
  3. Very specific:

    Only sync directories that contain a SKILL.md file.

    line 23
  4. Distinctive:

    Do not delete directories that are not being replaced from the current source repo.

    line 27
  5. Very specific:

    Use gh for fetching or cloning.

    line 28
  6. Very specific:

    Do not assume Python is installed.

    line 29
  7. Very specific:

    If gh authentication fails, stop and ask the user to run gh auth login.

    line 30
  8. Distinctive:

    Prefer replacing each targeted skill directory atomically by deleting that one directory and copying in the refreshed version, but only …

    line 33
  9. Distinctive:

    When invoked without extra arguments, sync both repositories:

    line 37
  10. Distinctive:

    If any skill names overlap between the two repos, stop and ask the user whether to allow those specific cross-source overwrites.

    line 42
  11. Very specific:

    If approved, copy each official skills/<name> folder that contains SKILL.md into ~/.claude/skills/<name>.

    line 43
  12. Very specific:

    If $ARGUMENTS mentions one source only, support it:

    line 49
  13. Very specific:

    If $ARGUMENTS is ambiguous, ask the user whether to sync official, personal, or both.

    line 54
  14. Distinctive:

    Use bash commands like these, adjusted only if needed:

    line 58
  15. Very specific:

    Run an overlap check first using gh --jq and shell.

    line 74
  16. Distinctive:

    If nothing was synced because authentication or repository access failed, say so plainly and stop.

    line 84

“Common” is measured: kept by at least 6 in 10 of the 13 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Sync Skills

Update the local skills directory at ~/.claude/skills from these repositories:

  • Official skills: https://github.com/anthropics/skills
  • Personal skills: https://github.com/herohua/skills

This skill is for the user's local environment. Prefer generic home-folder references such as ~/.claude/... in user-facing text, and avoid exposing the account name or absolute home path.

Goal

Keep local skills current while avoiding accidental deletion of unrelated directories.

Safety rules

  • Only sync directories that contain a SKILL.md file.
  • For anthropics/skills, only sync directories under the repository's skills/ subdirectory.
  • For herohua/skills, only sync top-level directories that contain SKILL.md.
  • Preserve all non-target directories in ~/.claude/skills.
  • Do not delete directories that are not being replaced from the current source repo.
  • Use gh for fetching or cloning.
  • Do not assume Python is installed. Prefer gh --jq and shell for overlap detection and sync steps.
  • If gh authentication fails, stop and ask the user to run gh auth login.
  • Same-source refresh is allowed without confirmation: official skills may overwrite their own local copies, and personal skills may overwrite their own local copies.
  • Cross-source overwrite is not allowed without confirmation. If a skill name exists in both repos, or the current sync would replace a skill that belongs to the other source, stop and ask the user before proceeding.
  • Prefer replacing each targeted skill directory atomically by deleting that one directory and copying in the refreshed version, but only after the overwrite rules above are satisfied.

Default behavior

When invoked without extra arguments, sync both repositories:

  1. Clone anthropics/skills to a temporary directory.
  2. Clone herohua/skills to a temporary directory.
  3. Build the set of official skill names and personal skill names using gh --jq and shell.
  4. If any skill names overlap between the two repos, stop and ask the user whether to allow those specific cross-source overwrites.
  5. If approved, copy each official skills/<name> folder that contains SKILL.md into ~/.claude/skills/<name>.
  6. Then copy each personal top-level <name> folder that contains SKILL.md into ~/.claude/skills/<name>.
  7. Print a concise summary of synced skill names and any confirmed overlap decisions.

Optional behavior

If $ARGUMENTS mentions one source only, support it:

  • official or anthropics: sync only anthropics/skills
  • personal or herohua: sync only herohua/skills

If $ARGUMENTS is ambiguous, ask the user whether to sync official, personal, or both.

Recommended commands

Use bash commands like these, adjusted only if needed:

Sync official skills

target_dir="$HOME/.claude/skills" && tmpdir=$(mktemp -d) && gh repo clone anthropics/skills "$tmpdir/skills-repo" -- --depth=1 && for d in "$tmpdir/skills-repo/skills"/*; do if [ -d "$d" ] && [ -f "$d/SKILL.md" ]; then name=$(basename "$d"); rm -rf "$target_dir/$name"; cp -R "$d" "$target_dir/$name"; printf 'synced %s\n' "$name"; fi; done

Sync personal skills

target_dir="$HOME/.claude/skills" && tmpdir=$(mktemp -d) && gh repo clone herohua/skills "$tmpdir/personal-skills" -- --depth=1 && for d in "$tmpdir/personal-skills"/*; do if [ -d "$d" ] && [ -f "$d/SKILL.md" ]; then name=$(basename "$d"); rm -rf "$target_dir/$name"; cp -R "$d" "$target_dir/$name"; printf 'synced %s\n' "$name"; fi; done

Sync both in sequence

Run an overlap check first using gh --jq and shell. If there is no cross-source overlap, sync the official repo first, then the personal repo.

Reporting back

After syncing, report:

  • Which repo or repos were synced
  • Which skill directories were updated
  • That non-target directories were preserved

If nothing was synced because authentication or repository access failed, say so plainly and stop.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.