Files
Skills/install.sh
T
Brummel de26df1727 nest agents under their dispatching skill
Top-level agents/ was an arbitrary flat layout from the skeleton
commit, with no substantive reason behind it. Mirroring AILang's
convention (skills/<name>/agents/<agent>.md) is strictly better:
it makes the "no orphan agents" rule structurally true — you
cannot place an agent file outside a skill — and it keeps the
skill/agent binding visible at first glance.

Claude Code's user-level discovery is unaffected: install.sh now
symlinks ~/.claude/agents/<name> to skills/<name>/agents/ for
each skill that has an agents/ subdirectory. The .claude/
registry stays flat; the source tree stays nested. The two
checklists previously living in agents/README.md are folded
into skills/README.md.
2026-05-28 15:02:11 +02:00

57 lines
1.6 KiB
Bash
Executable File

#!/usr/bin/env bash
# Install the skills plugin globally into ~/.claude/.
#
# For each skill <name> under skills/<name>/, creates symlinks:
# ~/.claude/skills/<name> -> <repo>/skills/<name>
# ~/.claude/agents/<name> -> <repo>/skills/<name>/agents (if that dir exists)
#
# Idempotent — existing symlinks pointing to this repo are left
# alone; existing entries that point elsewhere are reported and
# skipped.
set -euo pipefail
REPO_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
CLAUDE_SKILLS="$HOME/.claude/skills"
CLAUDE_AGENTS="$HOME/.claude/agents"
mkdir -p "$CLAUDE_SKILLS" "$CLAUDE_AGENTS"
link_one() {
local src="$1"
local dst="$2"
if [ -L "$dst" ]; then
local existing
existing="$(readlink "$dst")"
if [ "$existing" = "$src" ]; then
echo "ok $dst -> $src"
return 0
fi
echo "skip $dst already symlinked to $existing"
return 0
fi
if [ -e "$dst" ]; then
echo "skip $dst exists and is not a symlink"
return 0
fi
ln -s "$src" "$dst"
echo "link $dst -> $src"
}
if [ -d "$REPO_DIR/skills" ]; then
for s in "$REPO_DIR"/skills/*/; do
[ -d "$s" ] || continue
name="$(basename "$s")"
link_one "$s" "$CLAUDE_SKILLS/$name"
if [ -d "$s/agents" ]; then
link_one "$s/agents" "$CLAUDE_AGENTS/$name"
fi
done
fi
echo
echo "Install complete."
echo "Next: drop a profile into each project that should use the plugin:"
echo " cp $REPO_DIR/templates/project-profile.yml <project>/.claude/dev-cycle-profile.yml"