#!/bin/bash
set -e
PKG_DIR="$(cd "$(dirname "$0")" && pwd)"
SKILLS_DIR="$HOME/.claude/skills"
mkdir -p "$SKILLS_DIR/kicad-pcb-viewer"
if [ -f "$PKG_DIR/SKILL.md" ]; then
  cp "$PKG_DIR/SKILL.md" "$SKILLS_DIR/kicad-pcb-viewer/SKILL.md"
fi
for skill_dir in "$PKG_DIR/skills"/*/; do
  [ -d "$skill_dir" ] || continue
  skill_name=$(basename "$skill_dir")
  mkdir -p "$SKILLS_DIR/$skill_name"
  cp -r "$skill_dir"* "$SKILLS_DIR/$skill_name/"
done
echo "Installed kicad-pcb-viewer"
