mirror of
https://github.com/obra/superpowers.git
synced 2026-04-21 17:09:07 +08:00
Add personal superpowers overlay system
Enables users to write and manage their own skills alongside core skills.
## Key Features:
- Auto-setup on first session: Creates ~/.config/superpowers/ git repo
- Two-tier skills: Personal skills shadow core skills when paths match
- Environment variable support: PERSONAL_SUPERPOWERS_DIR, XDG_CONFIG_HOME
- GitHub integration: Optional public repo creation for sharing skills
- CLI-agnostic: Works across Claude Code, Codex CLI, Gemini CLI (future)
## Changes:
- Added hooks/setup-personal-superpowers.sh - Auto-initializes personal repo
- Updated hooks/session-start.sh - Runs setup, offers GitHub repo creation
- Updated list-skills, skills-search - Search both personal and core skills
- Renamed skills/meta/creating-skills → writing-skills
- Added skills/meta/setting-up-personal-superpowers - Setup documentation
- Added skills/meta/sharing-skills - Contribution workflow
- Removed skills/meta/installing-skills - Old ~/.clank system
- Removed all INDEX.md files - Replaced by list-skills tool
- Updated README.md, getting-started - Document personal skills workflow
## Architecture:
~/.config/superpowers/skills/ # Personal (user-created, git-tracked)
${CLAUDE_PLUGIN_ROOT}/skills/ # Core (read-only, from plugin)
Search order: Personal first, core second (first match wins)
This commit is contained in:
@@ -1,22 +1,50 @@
|
||||
#!/usr/bin/env bash
|
||||
# list-skills - Show all available skill names without descriptions
|
||||
# For Claude to quickly see what exists before searching
|
||||
# Searches personal skills first, then core skills (personal shadows core)
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
# Detect if running from repo or installed location
|
||||
# Detect core skills directory (repo or installed location)
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
if [[ "$SCRIPT_DIR" == *"/.claude/plugins/cache/"* ]]; then
|
||||
# Installed as plugin
|
||||
SKILLS_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
|
||||
CORE_SKILLS_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
|
||||
else
|
||||
# Running from repo
|
||||
SKILLS_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
|
||||
CORE_SKILLS_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
|
||||
fi
|
||||
|
||||
# Find all SKILL.md files and extract their paths
|
||||
find "$SKILLS_DIR" -name "SKILL.md" -type f | \
|
||||
sed "s|$SKILLS_DIR/||; s|/SKILL.md||" | \
|
||||
sort
|
||||
# Use PERSONAL_SUPERPOWERS_DIR if set, otherwise XDG_CONFIG_HOME/superpowers, otherwise ~/.config/superpowers
|
||||
PERSONAL_SUPERPOWERS_DIR="${PERSONAL_SUPERPOWERS_DIR:-${XDG_CONFIG_HOME:-$HOME/.config}/superpowers}"
|
||||
PERSONAL_SKILLS_DIR="${PERSONAL_SUPERPOWERS_DIR}/skills"
|
||||
|
||||
# Collect all skill paths with deduplication
|
||||
declare -A seen_skills
|
||||
all_skills=()
|
||||
|
||||
# Personal skills first (take precedence)
|
||||
if [[ -d "$PERSONAL_SKILLS_DIR" ]]; then
|
||||
while IFS= read -r file; do
|
||||
skill_path="${file#$PERSONAL_SKILLS_DIR/}"
|
||||
skill_path="${skill_path%/SKILL.md}"
|
||||
if [[ -n "$skill_path" ]]; then
|
||||
seen_skills["$skill_path"]=1
|
||||
all_skills+=("$skill_path")
|
||||
fi
|
||||
done < <(find "$PERSONAL_SKILLS_DIR" -name "SKILL.md" -type f 2>/dev/null || true)
|
||||
fi
|
||||
|
||||
# Core skills (only if not shadowed by personal)
|
||||
while IFS= read -r file; do
|
||||
skill_path="${file#$CORE_SKILLS_DIR/}"
|
||||
skill_path="${skill_path%/SKILL.md}"
|
||||
if [[ -n "$skill_path" ]] && [[ -z "${seen_skills[$skill_path]:-}" ]]; then
|
||||
all_skills+=("$skill_path")
|
||||
fi
|
||||
done < <(find "$CORE_SKILLS_DIR" -name "SKILL.md" -type f 2>/dev/null || true)
|
||||
|
||||
# Sort and output
|
||||
printf "%s\n" "${all_skills[@]}" | sort
|
||||
|
||||
exit 0
|
||||
|
||||
Reference in New Issue
Block a user