re-skill — Skill Update Manager
You are managing updates for Claude Code skills installed via git clone in ~/.claude/skills/. Follow these steps in order.
If an argument was provided (e.g., /re-skill my-skill), only process that single skill. Otherwise, process all discovered skills.
Step 1: Initialize Registry
Read the registry file at ~/.config/re-skill/registry.json. If it doesn't exist, create it with this structure:
{
"version": 1,
"lastGlobalCheck": null,
"skills": {}
}
Create the directory ~/.config/re-skill/ if needed (mkdir -p).
Step 2: Scan & Discover Skills
List all directories in ~/.claude/skills/*/. For each directory that contains a .git folder, collect:
- •Name: directory basename
- •Remote URL:
git -C <path> remote get-url origin(may fail if no remote) - •Current commit:
git -C <path> rev-parse HEAD - •Default branch: try
git -C <path> symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's|refs/remotes/origin/||', fall back to checking fororigin/mainthenorigin/master, thengit -C <path> remote show origin | grep 'HEAD branch' - •Local modifications:
git -C <path> status --porcelain - •Diff of modifications:
git -C <path> diffandgit -C <path> diff --cached
Skip directories without .git — they are not git-cloned skills.
If a specific skill name was given as argument and it doesn't exist or has no .git, report the error and stop.
Step 3: First-Run Onboarding
For each discovered skill that is not yet in the registry and has local modifications (non-empty porcelain output or diff):
- •Show the user the diff output so they can see what was changed
- •Use AskUserQuestion to ask them to describe what these customizations do and why they were made. For example, a user might have wrapped script commands with
doppler runfor secrets injection, or adjusted prompts for their workflow. - •Store the skill in the registry with their description under
customizations
For skills not in the registry that have no local modifications, register them silently with an empty customizations array.
Step 4: Check for Updates
For each skill being processed:
- •Run
git -C <path> fetch originto get latest remote state - •Compare local HEAD with remote:
git -C <path> rev-list HEAD..origin/<branch> --count - •If there are new commits, collect the log:
git -C <path> log --oneline HEAD..origin/<branch> - •If a version file exists (e.g.,
package.json,.claude-plugin/plugin.json), note current and incoming versions
If fetch fails (network error, no remote), report the error for that skill and continue with the next one.
Skills with 0 new commits are "up to date" — note this and move on.
Step 5: Present Changes
For each skill with available updates, use AskUserQuestion to present:
- •Number of new commits
- •Commit log (abbreviated)
- •Version change if detectable (e.g.,
1.0.0 → 1.1.0) - •Whether the user has local customizations that will need reapplication
Ask the user to choose:
- •Update now — proceed with backup and update
- •Skip — leave this skill as-is
- •View full diff — show
git -C <path> diff HEAD..origin/<branch>before deciding
Step 6: Backup & Apply Update
Backups are always created before any update. This is not optional.
For each skill the user chose to update:
Backup
- •Create backup directory:
~/.config/re-skill/backups/<skill-name>/<timestamp>/where timestamp is ISO-like (e.g.,2026-02-08T16-00-00) - •Copy the entire skill directory into the backup:
cp -a ~/.claude/skills/<skill-name>/. ~/.config/re-skill/backups/<skill-name>/<timestamp>/ - •Confirm backup was created successfully before proceeding
Apply
- •If there are local modifications:
git -C <path> stash - •Pull updates:
git -C <path> pull origin <branch> - •If there were stashed changes:
git -C <path> stash pop - •Update the registry entry with new commit hash, timestamp, etc.
Step 7: Handle Conflicts
If git stash pop fails due to conflicts:
- •Show the conflicted files:
git -C <path> diff --name-only --diff-filter=U - •For each conflicted file, show the conflict markers using Read
- •Use AskUserQuestion to ask the user how to resolve each conflict:
- •Keep upstream version — accept the new version, discard local change
- •Keep local version — keep the customization, discard upstream change
- •Manual merge — user provides the resolved content
- •After resolution, stage the files and complete the merge:
git -C <path> add <file> && git -C <path> reset - •Remind the user that the pre-update backup is available at
~/.config/re-skill/backups/<skill-name>/<timestamp>/if they want to reference the original
Step 8: Marketplace Migration Check
For each skill processed, use WebSearch to search for: "<skill-name>" Claude Code plugin marketplace
If results suggest the skill is now available as an official plugin:
- •Inform the user: "This skill appears to be available as an official plugin. You could install it via the plugin marketplace for automatic updates. Note: local customizations would not be preserved by the plugin system."
- •Do not auto-migrate. Just inform.
If no results or inconclusive, skip silently.
Step 9: Summary
Display a summary table of all processed skills:
| Skill | Status | Version | Customizations | Backup |
|---|---|---|---|---|
| (name) | Up to date / Updated / Skipped / Error | (commit or version) | (count or "none") | (path or n/a) |
Update lastGlobalCheck in the registry and write it back to ~/.config/re-skill/registry.json.
Important Behaviors
- •Never update without confirmation — every destructive action goes through AskUserQuestion
- •Always backup before updating — the full skill directory is copied before any git operations
- •Graceful degradation — if one skill fails, continue processing the rest
- •Registry is the source of truth — always read before modifying, always write after changes
- •No assumptions about installed skills — everything is discovered dynamically by scanning the filesystem