#!/usr/bin/env bash # Install skills// into ~/.claude/skills// (or $CLAUDE_SKILLS_DIR) # Usage: install.sh [name...] (no args = all) set -euo pipefail ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" SRC="$ROOT/skills" TARGET="${CLAUDE_SKILLS_DIR:-$HOME/.claude/skills}" if [ "$#" -eq 0 ]; then mapfile -t names < <(find "$SRC" -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | sort) else names=("$@") fi mkdir -p "$TARGET" for name in "${names[@]}"; do src_dir="$SRC/$name" dst_dir="$TARGET/$name" if [ ! -d "$src_dir" ]; then echo "skip: $name (not found in skills/)" >&2 continue fi if [ ! -f "$src_dir/SKILL.md" ]; then echo "skip: $name (missing SKILL.md)" >&2 continue fi rm -rf "$dst_dir" cp -R "$src_dir" "$dst_dir" echo "installed: $name → $dst_dir" done