Repository navigation
Expand file tree
/
Copy pathsync-skills.sh
More file actions
75 lines (65 loc) · 1.85 KB
/
Copy pathsync-skills.sh
File metadata and controls
75 lines (65 loc) · 1.85 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/usr/bin/env bash
#
# sync-skills.sh — Sync the Full edition skills to the global Claude Code skills directory.
#
# Usage:
# bash scripts/sync-skills.sh [full|lite]
#
# Run from anywhere — paths are computed relative to the script's location.
# Works on Linux, macOS, and Windows (Git Bash / WSL).
#
# What it does:
# 1. Selects the Full or Lite source directory
# 2. Removes this framework's Full and Lite skills from ~/.claude/skills/
# 3. Copies the selected edition into ~/.claude/skills/
# 4. Reports what was synced
#
# This script is idempotent — running it multiple times has the same effect
# as running it once. Unrelated global skills are preserved.
set -euo pipefail
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
SKILLS_DEST="$HOME/.claude/skills"
EDITION="${1:-full}"
case "$EDITION" in
full)
SKILLS_SRC="$REPO_ROOT/skills"
;;
lite)
SKILLS_SRC="$REPO_ROOT/lite/skills"
;;
*)
echo "Usage: bash scripts/sync-skills.sh [full|lite]" >&2
exit 2
;;
esac
MANAGED_SKILLS=(
spec-gen
project-init
readme-craft
spec-gen-lite
project-init-lite
)
if [ ! -d "$SKILLS_SRC" ]; then
echo "Error: skills directory not found at $SKILLS_SRC" >&2
echo "Check that this is a complete ai-dev-context-framework checkout." >&2
exit 1
fi
mkdir -p "$SKILLS_DEST"
echo "Syncing AI Development Context Framework $EDITION edition skills"
echo " source: $SKILLS_SRC"
echo " target: $SKILLS_DEST"
echo
echo " cleaning managed Full and Lite skill directories"
for skill_name in "${MANAGED_SKILLS[@]}"; do
rm -rf "$SKILLS_DEST/$skill_name"
done
count=0
for skill_dir in "$SKILLS_SRC"/*/; do
skill_name="$(basename "$skill_dir")"
echo " → $skill_name"
cp -r "$skill_dir" "$SKILLS_DEST/$skill_name"
count=$((count + 1))
done
echo
echo "Done. $count skill(s) synced. Current ~/.claude/skills/:"
ls "$SKILLS_DEST"