Files
skills/scripts/install.sh
Kevin Veen-Birkenbach 751488f4a2
Some checks failed
🧪 Test / 🧪 Lock + lint (push) Has been cancelled
🔄 Update / 🧠 Update skills-lock.json (push) Has been cancelled
feat(skills): rename shortcuts skill and auto-enable caveman/ponytail on install
Rename the portable conversation-shortcut skill from agent-shortcuts to
shortcuts and re-prefix every token to soc* (sobu, soco, socobu, socon,
sona, sote) so each token mirrors its command and never places two
consonants next to each other. make install and make project now also
register the caveman and ponytail marketplaces and enable both plugins in
the target's .claude/settings.json so their SessionStart hooks activate
every session; the merge is non-destructive, idempotent, and leaves an
unparseable settings.json untouched.

- skills/shortcuts/SKILL.md: new name and soc* token table
- tests/test_shortcuts.py: assert present, sorted, soc-prefixed, no cluster
- remove skills/agent-shortcuts and tests/test_agent_shortcuts.py
- scripts/enable-plugins.js: node JSON merge helper
- scripts/install.sh: run the helper after copying skills
- README.md: document the auto-enable behavior

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-10 14:59:17 +02:00

56 lines
1.6 KiB
Bash

#!/usr/bin/env bash
# Render the skills from skills-lock.json and copy them into TARGET.
# TARGET defaults to $HOME (global install); pass a project root to
# equip that project. Skills land in <TARGET>/.agents/skills and are
# mirrored to <TARGET>/.claude/skills.
set -euo pipefail
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd -- "${SCRIPT_DIR}/.." && pwd)"
TARGET="${TARGET:-${HOME}}"
log() { printf '%s\n' "$*"; }
warn() { printf '%s\n' "$*" >&2; }
if ! command -v npx &>/dev/null; then
warn "skills: npx not found — install Node.js first: https://nodejs.org"
exit 1
fi
if [[ ! -d "${TARGET}" ]]; then
warn "skills: TARGET does not exist: ${TARGET}"
exit 2
fi
cd "${REPO_ROOT}"
log "skills: restoring from skills-lock.json..."
npx --yes skills experimental_install
src="${REPO_ROOT}/.agents/skills"
if [[ ! -d "${src}" ]]; then
warn "skills: ${src} not found after install."
exit 1
fi
if [[ -d "${REPO_ROOT}/skills" ]]; then
log "skills: adding first-party skills from skills/..."
cp -a "${REPO_ROOT}/skills/." "${src}/"
fi
for dst in "${TARGET}/.agents/skills" "${TARGET}/.claude/skills"; do
log "skills: copying -> ${dst}"
rm -rf "${dst}"
mkdir -p "${dst}"
cp -a "${src}/." "${dst}/"
done
settings="${TARGET}/.claude/settings.json"
if command -v node &>/dev/null; then
log "skills: auto-enabling caveman + ponytail plugins in ${settings}"
node "${REPO_ROOT}/scripts/enable-plugins.js" "${settings}"
else
warn "skills: node not found; skipped auto-enabling caveman/ponytail plugins."
fi
log "skills: done. Restart your agent to load the skills."