#!/usr/bin/env bash
# Adom Native Browser — installs the bundled skills so the AI knows the nbrowser_* surface.
# (The extension itself loads into Chrome/Edge via "Load unpacked" from extension/, or the Web Store.)
# Installs to BOTH agent skill homes: ~/.claude/skills AND ~/.codex/skills (a container may run
# Claude OR Codex — Bridge SDK Artifact 2). ALL skills ship as skills/<name>/SKILL.md (SKILLPACK
# layout); the dev/publish skills carry user-invocable:false so users are never offered them.
set -e
LEGACY="adom-browser-extension"   # renamed to adom-native-browser (2026-08); remove the stale copy
SKILLS="adom-native-browser driving-the-extension native-browser-safety installing-the-extension uninstalling-the-extension native-browser-recording driving-the-extension-demo driving-the-desktop driving-sites reading-google-messages"
for HOME_DIR in "${HOME}/.claude/skills" "${HOME}/.codex/skills"; do
  for old in $LEGACY; do
    [ -d "$HOME_DIR/$old" ] && rm -rf "$HOME_DIR/$old" && echo "removed legacy skill $old from $HOME_DIR"
  done
  for name in $SKILLS; do
    mkdir -p "$HOME_DIR/$name"
    cp "skills/$name/SKILL.md" "$HOME_DIR/$name/SKILL.md"
  done
  echo "installed ${SKILLS// /, } -> $HOME_DIR"
done
echo "Skills installed to Claude + Codex homes. Nothing else lands here: the bridge runtime auto-installs on your desktop via Bridge, and your AI can install the browser extension into Chrome/Edge for you - just ask it."
