When to invoke
- User wants to share a project-local skill with other repos
- User says "elevate skill", "share this skill", "move skill to ai-skills"
Steps
- Discover local skills: List directories in
.claude/skills/ whose name is NOT a key in skills-lock.json (if it exists). These are locally-authored project skills. - Ask which skill to elevate: Present the list and let the user choose.
- Find ai-skills repo: Use
$AI_SKILLS_REPO if set, else try ~/projects/camacho/ai-skills, else ask the user. - Copy to ai-skills:
cp -r.claude/skills/<name> <ai-skills-path>/skills/<name> Verify the SKILL.md has correct frontmatter (name matches folder name). - Commit + push in ai-skills:
cd <ai-skills-path> git add skills/<name> git commit -m "feat: add <name> skill" git push - Remove local copy and install from repo:
rm -rf.claude/skills/<name> npx skills add <ai-skills-path> --skill <name> -a claude-code -y - Commit in current project:
git add skills-lock.json.claude/skills/ git commit -m "chore: elevate <name> skill to ai-skills"
Discovery logic
# Local skills = dirs in .claude/skills/ NOT tracked by lockfile
if [ -f skills-lock.json ]; then
LOCKED=$(python3 -c "import json; print(' '.join(json.load(open('skills-lock.json'))['skills'].keys()))")
fi
for dir in .claude/skills/*/; do
name=$(basename "$dir")
if ! echo "$LOCKED" | grep -qw "$name"; then
echo "$name (local)"
fi
done