Files
custom-claude-skills/scripts/install.sh
Paul O'Reilly 5a59d463de Fix skill frontmatter and simplify distill skill instructions
Replace non-ASCII characters in log and distill-best-practices
frontmatter that silently prevented skill loading. Simplify distill
skill instructions. Update install.sh for new skills.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 11:15:45 +13:00

53 lines
1.6 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
# Symlink all skills from this repo into the active Claude profile's skills/
# directory so they're available across all Claude Code projects.
#
# Uses CLAUDE_CONFIG_DIR if set (active profile), otherwise falls back to ~/.claude.
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_DIR="$(dirname "$SCRIPT_DIR")"
SKILLS_SRC="$REPO_DIR/skills"
SKILLS_DST="${CLAUDE_CONFIG_DIR:-$HOME/.claude}/skills"
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m'
mkdir -p "$SKILLS_DST"
installed=0
skipped=0
for skill_dir in "$SKILLS_SRC"/*/; do
[ -d "$skill_dir" ] || continue
skill_name="$(basename "$skill_dir")"
target="$SKILLS_DST/$skill_name"
if [ -L "$target" ]; then
existing="$(readlink -f "$target")"
expected="$(readlink -f "$skill_dir")"
if [ "$existing" = "$expected" ]; then
echo -e "${YELLOW}SKIP${NC} $skill_name (already linked)"
skipped=$((skipped + 1))
continue
else
echo -e "${YELLOW}UPDATE${NC} $skill_name (repointing symlink)"
rm "$target"
fi
elif [ -e "$target" ]; then
echo -e "${YELLOW}SKIP${NC} $skill_name (non-symlink exists at $target — remove manually to update)"
skipped=$((skipped + 1))
continue
fi
ln -s "$skill_dir" "$target"
echo -e "${GREEN}INSTALLED${NC} $skill_name$target"
installed=$((installed + 1))
done
echo ""
echo "Done. Installed: $installed, Skipped: $skipped"
echo "Skills are now available as slash commands in Claude Code (e.g. /reflect M8)"