d7256e6f8c
~/dev/skills/skills/boss/ was visually awkward (skills/skills read twice) and structurally unnecessary — the skills ARE the repo's main content, not a sub-collection inside it. Layout changes: - boss/SKILL.md moves to the repo root - skills/README.md (migration notes) moves to docs/migration.md where documentation-about-the-system belongs - install.sh discovers skills via the SKILL.md marker file instead of a hardcoded skills/<name>/ path, so future skill additions just drop in at the root Cross-references in boss/SKILL.md (../README.md, ../brainstorm, etc.) now resolve against the repo root instead of the old skills/ subdir, which is what they describe: top-level README is the skill table; sibling skill dirs are the other migrated skills.
57 lines
1.6 KiB
Bash
Executable File
57 lines
1.6 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Install the skills plugin globally into ~/.claude/.
|
|
#
|
|
# Each top-level directory that contains a SKILL.md is treated as
|
|
# a skill. For each such <name>, creates symlinks:
|
|
# ~/.claude/skills/<name> -> <repo>/<name>
|
|
# ~/.claude/agents/<name> -> <repo>/<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"
|
|
}
|
|
|
|
for d in "$REPO_DIR"/*/; do
|
|
[ -d "$d" ] || continue
|
|
[ -f "$d/SKILL.md" ] || continue
|
|
name="$(basename "$d")"
|
|
link_one "${d%/}" "$CLAUDE_SKILLS/$name"
|
|
if [ -d "$d/agents" ]; then
|
|
link_one "${d%/}/agents" "$CLAUDE_AGENTS/$name"
|
|
fi
|
|
done
|
|
|
|
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"
|