mirror of
https://github.com/mattpocock/skills.git
synced 2026-04-30 14:03:53 +07:00
3e3ca9b9fa
Co-authored-by: Copilot <copilot@github.com>
24 lines
572 B
Bash
Executable File
24 lines
572 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
# Links all skills in the repository to ~/.claude/skills, so that
|
|
# they can be used by the local Claude CLI.
|
|
|
|
REPO="$(cd "$(dirname "$0")/.." && pwd)"
|
|
DEST="$HOME/.claude/skills"
|
|
mkdir -p "$DEST"
|
|
|
|
find "$REPO/skills" -name SKILL.md -not -path '*/node_modules/*' -print0 |
|
|
while IFS= read -r -d '' skill_md; do
|
|
src="$(dirname "$skill_md")"
|
|
name="$(basename "$src")"
|
|
target="$DEST/$name"
|
|
|
|
if [ -e "$target" ] && [ ! -L "$target" ]; then
|
|
rm -rf "$target"
|
|
fi
|
|
|
|
ln -sfn "$src" "$target"
|
|
echo "linked $name -> $src"
|
|
done
|