| name | sync-skills |
| description | Use when syncing skills from local folders, GitHub URLs, or skillsmp.com pages to multiple AI coding tool directories |
Sync Skills
Overview
Automatically sync skills from multiple sources to all installed AI coding tool directories. Lists all existing target directories for user confirmation before syncing.
When to Use
digraph when_sync {
"Need to sync skill?" [shape=diamond];
"Source type?" [shape=diamond];
"Local folder" [shape=box];
"GitHub URL" [shape=box];
"skillsmp.com URL" [shape=box];
"Need to sync skill?" -> "Source type?";
"Source type?" -> "Local folder" [label="Local path"];
"Source type?" -> "GitHub URL" [label="github.com"];
"Source type?" -> "skillsmp.com URL" [label="skillsmp.com"];
}
Use when:
- User provides local skill folder path
- User provides GitHub repository URL
- User provides skillsmp.com skill detail page URL
- Need to distribute skill across multiple AI tools
How it works:
- Auto-detect source type from input
- Prepare skill content based on source
- Check all target directories (only existing ones)
- List existing targets for user confirmation
- Copy/clone to each confirmed target
Target Directories
Checks these paths in order, only syncs if directory exists:
| Tool | Project Level | User Level |
|---|
| Claude Code | .claude/skills | ~/.claude/skills |
| GitHub Copilot | .github/skills | ~/.copilot/skills |
| Google Antigravity | .agent/skills | ~/.gemini/antigravity/skills |
| Cursor | .cursor/skills | ~/.cursor/skills |
| OpenCode | .opencode/skill | ~/.config/opencode/skill |
| OpenAI Codex | .codex/skills | ~/.codex/skills |
| Gemini CLI | .gemini/skills | ~/.gemini/skills |
| Windsurf | .windsurf/skills | ~/.codeium/windsurf/skills |
| Qwen Code | .qwen/skills | ~/.qwen/skills |
| Qoder | .qoder/skills | ~/.qoder/skills |
| OpenClaw | .openclaw/skills | ~/.openclaw/skills |
Quick Reference
Basic Usage:
./sync-skill.sh <source>
Examples:
./sync-skill.sh /Users/user/skills/my-skill
./sync-skill.sh https://github.com/user/skill-repo
./sync-skill.sh https://skillsmp.com/skills/skill-name
Source Type Detection
/Users/user/skills/my-skill
./skills/my-skill
~/skills/my-skill
https://github.com/user/skill-repo
https://github.com/user/skill-repo.git
git@github.com:user/skill-repo.git
https://skillsmp.com/skills/skill-name
https://www.skillsmp.com/skills/skill-name
Sync Commands by Source Type
Local folder:
cp -r /path/to/skill-name ~/.claude/skills/
cp -r /path/to/skill-name ~/.qoder/skills/
GitHub:
git clone https://github.com/user/skill-repo.git /tmp/skill-sync
cp -r /tmp/skill-sync/skill-name ~/.claude/skills/
rm -rf /tmp/skill-sync
skillsmp.com:
curl -s https://skillsmp.com/skills/skill-name > /tmp/skill-page.html
Implementation
Executable script: See sync-skill.sh in this skill directory.
Features:
- Auto-detects source type (local, GitHub, skillsmp.com)
- Checks all target directories for existence
- Lists existing targets and waits for user confirmation before syncing
- Only syncs to user-confirmed directories
- Overwrites existing skills without prompting
- Cleans up temporary files after use
- Provides clear output with emoji indicators
Exit codes:
- 0: Success
- 1: Error (missing source, clone failure, etc.)
Using from AI assistant:
When user asks to sync a skill, invoke the script with appropriate source:
./sync-skill.sh /path/to/my-skill
./sync-skill.sh https://github.com/user/skill
Source Detection
function detectSource(input) {
if (input.startsWith('/') || input.startsWith('./') || input.startsWith('~')) {
return { type: 'local', path: input };
}
if (input.includes('github.com')) {
const url = input.replace(/\.git$/, '');
return { type: 'github', url };
}
if (input.includes('skillsmp.com')) {
return { type: 'skillsmp', url: input };
}
throw new Error(`Unknown source type: ${input}`);
}
Directory Existence Check and Confirmation
check_and_sync() {
local source=$1
local skill_name=$2
local targets=(
"$HOME/.claude/skills"
"$HOME/.qoder/skills"
"$HOME/.copilot/skills"
)
local existing_targets=()
for target in "${targets[@]}"; do
if [ -d "$target" ]; then
existing_targets+=("$target")
fi
done
if [ ${#existing_targets[@]} -eq 0 ]; then
echo "โ No target directories found. Please install at least one AI coding tool."
exit 1
fi
echo "๐ Found ${#existing_targets[@]} existing target directory(s):"
echo ""
for i in "${!existing_targets[@]}"; do
-p confirm
[[ ! =~ ^[Yy]$ ]];
1
target ;
}
GitHub Repository Handling
git clone https://github.com/user/repo.git /tmp/skill-sync-XXXXX
if [ -f /tmp/skill-sync-XXXXX/SKILL.md ]; then
skill_folder="/tmp/skill-sync-XXXXX"
elif [ -d /tmp/skill-sync-XXXXx/skills/* ]; then
skill_folder="/tmp/skill-sync-XXXXx/skills/*"
fi
for target in "${existing_targets[@]}"; do
cp -r "$skill_folder" "$target/"
done
rm -rf /tmp/skill-sync-XXXXX
skillsmp.com Page Handling
url="https://skillsmp.com/skills/skill-name"
curl -s "$url" > /tmp/skill-page.html
skill_name=$(grep -o '<h1[^>]*>.*</h1>' /tmp/skill-page.html | sed 's/<[^>]*>//g')
mkdir -p "/tmp/$skill_name"
for target in "${existing_targets[@]}"; do
cp -r "/tmp/$skill_name" "$target/"
done
Common Mistakes
| Mistake | Fix |
|---|
| Syncing without user confirmation | Always list targets and wait for y/N confirmation |
| Syncing to non-existent directories | Always check -d before copying |
| Leaving temp files | Always cleanup /tmp/skill-sync-* after use |
| GitHub subdirectory confusion | Check for SKILL.md in root and subdirectories |
| Not handling .git suffix | Strip .git from URLs before cloning |
| skillsmp.com parsing failures | Inspect page structure first, adapt parsing |
| Forgetting to show skill name | Always display skill name in confirmation prompt |
Conflict Handling
Policy: Always overwrite existing skills
If a skill with the same name exists in a target directory:
- Overwrite without prompting
- Log what was overwritten:
"Overwriting existing skill at $target/$skill_name"
- No backup (user should use git if they need history)
Rationale: Sync operations are expected to update content. If user wants to preserve local changes, they should manage version control separately.