-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall-skills.sh
More file actions
executable file
·58 lines (49 loc) · 1.4 KB
/
install-skills.sh
File metadata and controls
executable file
·58 lines (49 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/usr/bin/env bash
set -euo pipefail
# Installs Claude Code skills from this repo.
# Usage:
# bash install-skills.sh # user-level (~/.claude/skills/)
# bash install-skills.sh --project # project-level (./.claude/skills/)
# bash install-skills.sh --project /path/dir # project-level in specific repo
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
SKILLS_SRC="$SCRIPT_DIR/skills"
# Parse arguments
PROJECT_MODE=false
PROJECT_DIR="."
while [[ $# -gt 0 ]]; do
case $1 in
--project)
PROJECT_MODE=true
shift
if [[ $# -gt 0 && "$1" != -* ]]; then
PROJECT_DIR="$1"
shift
fi
;;
*)
echo "[ERROR] Unknown option: $1"
echo "Usage: bash install-skills.sh [--project [DIR]]"
exit 1
;;
esac
done
if [[ "$PROJECT_MODE" == true ]]; then
SKILLS_DEST="$(cd "$PROJECT_DIR" && pwd)/.claude/skills"
else
SKILLS_DEST="$HOME/.claude/skills"
fi
if [ ! -d "$SKILLS_SRC" ]; then
echo "[ERROR] Skills directory not found: $SKILLS_SRC"
exit 1
fi
mkdir -p "$SKILLS_DEST"
for skill_dir in "$SKILLS_SRC"/*/; do
skill_name="$(basename "$skill_dir")"
dest="$SKILLS_DEST/$skill_name"
mkdir -p "$dest"
cp "$skill_dir/SKILL.md" "$dest/SKILL.md"
echo "[OK] Installed $skill_name skill to $dest"
done
echo
echo "[DONE] Skills installed to: $SKILLS_DEST"
echo " Restart Claude Code to pick up new skills."