Просмотр исходного кода

Remove old list-skills and skills-search tools

Consolidated into scripts/find-skills. The old tools in skills/getting-started/
are no longer needed - all functionality is now in scripts/find-skills which:
- Shows all skills with descriptions (default)
- Filters by pattern (when pattern provided)
- Searches both personal and core skills
- Works without CLAUDE_PLUGIN_ROOT environment variable
Jesse Vincent 11 месяцев назад
Родитель
Сommit
03b34d3942
2 измененных файлов с 0 добавлено и 179 удалено
  1. 0 52
      skills/getting-started/list-skills
  2. 0 127
      skills/getting-started/skills-search

+ 0 - 52
skills/getting-started/list-skills

@@ -1,52 +0,0 @@
-#!/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 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
-    CORE_SKILLS_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
-else
-    # Running from repo
-    CORE_SKILLS_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
-fi
-
-# 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 (bash 3.2 compatible)
-seen_skills_list=""
-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_list="${seen_skills_list}${skill_path}"$'\n'
-            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" ]]; then
-        # Skip if already seen in personal skills
-        echo "$seen_skills_list" | grep -q "^${skill_path}$" && continue
-        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

+ 0 - 127
skills/getting-started/skills-search

@@ -1,127 +0,0 @@
-#!/usr/bin/env bash
-# skills-search - Find relevant skills using grep patterns
-# Logs all searches for gap analysis (gardening skill processes the log)
-# Searches personal skills first, then core skills (personal shadows core)
-
-set -euo pipefail
-
-# 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
-    CORE_SKILLS_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
-else
-    # Running from repo
-    CORE_SKILLS_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
-fi
-
-# 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"
-LOG_FILE="${PERSONAL_SUPERPOWERS_DIR}/search-log.jsonl"
-
-# Show usage if no arguments
-if [[ $# -eq 0 ]]; then
-    cat <<'EOF'
-Usage: skills-search PATTERN [PATTERN...]
-
-Searches skills using grep patterns.
-
-Examples:
-  skills-search 'test.*driven|TDD'
-  skills-search 'debug.*systematic|root.cause'
-  skills-search 'refactor|extract'
-  skills-search 'async.*test|flaky|timeout'
-  skills-search 'validat.*input'
-
-The search is logged. Failed searches help identify missing skills.
-EOF
-    exit 1
-fi
-
-# Log the search for gap analysis
-timestamp=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
-query="$*"
-echo "{\"timestamp\":\"$timestamp\",\"query\":\"$query\"}" >> "$LOG_FILE" 2>/dev/null || true
-
-# Search both personal and core skills directories
-# Personal skills take precedence (searched first)
-
-# Content search: grep file contents from both locations
-content_matches_personal=""
-content_matches_core=""
-if [[ -d "$PERSONAL_SKILLS_DIR" ]]; then
-    content_matches_personal=$(grep -E -r "$@" "$PERSONAL_SKILLS_DIR/" --include="SKILL.md" -l 2>/dev/null || true)
-fi
-content_matches_core=$(grep -E -r "$@" "$CORE_SKILLS_DIR/" --include="SKILL.md" -l 2>/dev/null || true)
-
-# Filename search: find all SKILL.md paths, then grep the paths themselves
-all_skills_personal=""
-all_skills_core=""
-if [[ -d "$PERSONAL_SKILLS_DIR" ]]; then
-    all_skills_personal=$(find "$PERSONAL_SKILLS_DIR/" -name "SKILL.md" -type f 2>/dev/null || true)
-fi
-all_skills_core=$(find "$CORE_SKILLS_DIR/" -name "SKILL.md" -type f 2>/dev/null || true)
-
-path_matches_personal=$(echo "$all_skills_personal" | grep -E "$@" 2>/dev/null || true)
-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) - bash 3.2 compatible
-seen_skills_list=""
-results=""
-while IFS= read -r file; do
-    # Extract skill path relative to its base directory
-    if [[ "$file" == "$PERSONAL_SKILLS_DIR"* ]]; then
-        skill_path="${file#$PERSONAL_SKILLS_DIR/}"
-    else
-        skill_path="${file#$CORE_SKILLS_DIR/}"
-    fi
-    skill_path="${skill_path%/SKILL.md}"
-
-    # Only include if we haven't seen this skill path yet
-    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"
-
-results=$(echo "$results" | grep -v '^$' | sort -u || true)
-
-if [[ -z "$results" ]]; then
-    echo "❌ No skills found matching: $*"
-    echo ""
-    echo "Search logged. If a skill should exist, it will be created."
-    echo "Proceed carefully - document your approach."
-    exit 0
-fi
-
-echo "✅ Found skills:"
-echo ""
-
-# Display results with metadata
-echo "$results" | while read -r file; do
-    # Extract description from frontmatter
-    description=$(grep "^description:" "$file" 2>/dev/null | sed 's/description: *//' || echo "")
-
-    # Get relative path without @ prefix or /SKILL.md suffix
-    # Handle both personal and core skills
-    if [[ "$file" == "$PERSONAL_SKILLS_DIR"* ]]; then
-        rel_path="${file#$PERSONAL_SKILLS_DIR/}"
-    else
-        rel_path="${file#$CORE_SKILLS_DIR/}"
-    fi
-    rel_path="skills/${rel_path%/SKILL.md}"
-
-    if [[ -n "$description" ]]; then
-        echo "$rel_path - $description"
-    else
-        echo "$rel_path"
-    fi
-done
-
-echo ""
-
-exit 0