this repo has no description
at main 45 lines 1.0 kB view raw
1#!/usr/bin/env bash 2set -euo pipefail 3 4SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" 5TARGET="${1:-claude}" 6 7case "$TARGET" in 8 claude) 9 SKILLS_DEST="$HOME/.claude/skills" 10 GLOBAL_CONTEXT="$HOME/.claude/CLAUDE.md" 11 ;; 12 pi) 13 SKILLS_DEST="$HOME/.pi/agent/skills" 14 GLOBAL_CONTEXT="$HOME/.pi/agent/AGENTS.md" 15 ;; 16 *) 17 echo "usage: $0 [claude|pi]" >&2 18 exit 1 19 ;; 20esac 21 22# Symlink GLOBAL_CONTEXT.md -> target global context file 23if [ -L "$GLOBAL_CONTEXT" ]; then 24 echo "skipped GLOBAL_CONTEXT.md (already linked)" 25else 26 ln -s "$SCRIPT_DIR/GLOBAL_CONTEXT.md" "$GLOBAL_CONTEXT" 27 echo "linked GLOBAL_CONTEXT.md -> $GLOBAL_CONTEXT" 28fi 29 30mkdir -p "$SKILLS_DEST" 31 32for skill in "$SCRIPT_DIR"/skills/*/; do 33 name="$(basename "$skill")" 34 target="$SKILLS_DEST/$name" 35 36 if [ -e "$target" ] || [ -L "$target" ]; then 37 echo "skipped $name (already exists)" 38 continue 39 fi 40 41 ln -s "$skill" "$target" 42 echo "linked $name -> $target" 43done 44 45echo "done. $(ls -1d "$SKILLS_DEST"/*/ 2>/dev/null | wc -l | tr -d ' ') skills installed to $SKILLS_DEST"