Răsfoiți Sursa

Add list-skills tool for Claude

- Shell script (not .md) that lists all skill names
- Shows paths like 'testing/test-driven-development'
- Helps Claude avoid useless skill searches
- Added to getting-started workflow
Jesse Vincent 11 luni în urmă
părinte
comite
0b58a84e6e

+ 0 - 13
commands/list-skills.md

@@ -1,13 +0,0 @@
----
-description: List all available skills by name
----
-
-Run this command to see what skills exist:
-
-```bash
-find ${CLAUDE_PLUGIN_ROOT}/skills -name "SKILL.md" -type f | sed 's|.*/skills/||; s|/SKILL.md||' | sort
-```
-
-This shows skill paths like `testing/test-driven-development` without loading descriptions.
-
-Use skills-search when you need to find something specific.

+ 8 - 3
skills/getting-started/SKILL.md

@@ -37,13 +37,18 @@ Your personal wiki of proven techniques, patterns, and tools at `${CLAUDE_PLUGIN
 
 ## Mandatory Workflow 2: Before ANY Task
 
-**1. Search skills:**
+**1. List available skills** (to avoid useless searches):
+```bash
+${CLAUDE_PLUGIN_ROOT}/skills/getting-started/list-skills
+```
+
+**2. Search skills** (when you need something specific):
 ```bash
 ${CLAUDE_PLUGIN_ROOT}/skills/getting-started/skills-search PATTERN
 ```
 
-**2. Search conversations:**
-Dispatch subagent (see Workflow 2) to check for relevant past work.
+**3. Search conversations:**
+Dispatch subagent (see Workflow 3) to check for relevant past work.
 
 **If skills found:**
 1. READ the skill: `${CLAUDE_PLUGIN_ROOT}/skills/path/skill-name/SKILL.md`

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

@@ -0,0 +1,22 @@
+#!/usr/bin/env bash
+# list-skills - Show all available skill names without descriptions
+# For Claude to quickly see what exists before searching
+
+set -euo pipefail
+
+# Detect if running from 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)"
+else
+    # Running from repo
+    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
+
+exit 0