mirror of
https://github.com/obra/superpowers.git
synced 2026-05-03 23:59:05 +08:00
Add unified scripts system with find-skills and run
Consolidates skill discovery and adds generic runner for cross-platform compatibility. Changes: - Created scripts/find-skills: Unified tool (show all + filter by pattern) - Shows descriptions by default - Searches personal first, then core (shadowing) - Logs searches for gap analysis - Bash 3.2 compatible - Created scripts/run: Generic runner for any skill script - Searches personal superpowers first, then core - Enables running arbitrary skill scripts without CLAUDE_PLUGIN_ROOT env var - Example: scripts/run skills/collaboration/remembering-conversations/tool/search-conversations - Fixed bash 3.2 compatibility in list-skills, skills-search - Replaced associative arrays with newline-delimited lists - Works on macOS default bash (3.2) and Linux bash 4+ - Updated all documentation to reference scripts/find-skills - Removed redundant wrapper scripts This solves the CLAUDE_PLUGIN_ROOT environment variable issue - scripts can now be called from anywhere without needing the env var set.
This commit is contained in:
@@ -69,8 +69,8 @@ path_matches_core=$(echo "$all_skills_core" | grep -E "$@" 2>/dev/null || true)
|
||||
# Combine all matches
|
||||
all_matches=$(printf "%s\n%s\n%s\n%s" "$content_matches_personal" "$content_matches_core" "$path_matches_personal" "$path_matches_core" | grep -v '^$' || true)
|
||||
|
||||
# Deduplicate by skill path (personal shadows core)
|
||||
declare -A seen_skills
|
||||
# Deduplicate by skill path (personal shadows core) - bash 3.2 compatible
|
||||
seen_skills_list=""
|
||||
results=""
|
||||
while IFS= read -r file; do
|
||||
# Extract skill path relative to its base directory
|
||||
@@ -82,8 +82,8 @@ while IFS= read -r file; do
|
||||
skill_path="${skill_path%/SKILL.md}"
|
||||
|
||||
# Only include if we haven't seen this skill path yet
|
||||
if [[ -z "${seen_skills[$skill_path]:-}" ]]; then
|
||||
seen_skills["$skill_path"]=1
|
||||
if ! echo "$seen_skills_list" | grep -q "^${skill_path}$"; then
|
||||
seen_skills_list="${seen_skills_list}${skill_path}"$'\n'
|
||||
results="${results}${file}"$'\n'
|
||||
fi
|
||||
done <<< "$all_matches"
|
||||
|
||||
Reference in New Issue
Block a user