#!/bin/bash
# adom-component-page: install the skill, its templates and its runnable scripts.
# Self-contained: no adompkg, no network. Safe to re-run.
set -euo pipefail
DIR="$(cd "$(dirname "$0")" && pwd)"
DEST="${HOME}/.claude/skills/adom-component-page"

mkdir -p "$DEST"
install -m 0644 "$DIR/SKILL.md" "$DEST/SKILL.md"

# Symlink the directories the skill references by path so its commands work as written
# and edits in the module dir propagate without a reinstall.
for d in templates scripts reference; do
  [ -d "$DIR/$d" ] && ln -sfn "$DIR/$d" "$DEST/$d"
done

echo "installed: adom-component-page -> $DEST"
echo "entry point: SKILL.md"
echo "  templates/  readme.html + page.json skeletons"
echo "  scripts/    inject_layers.py (fab/silk/courtyard fill), build_switcher.py"
echo "  reference/  worked-example.md (the AMS1117 build, every command in order)"