fix(skills-perso): detect personal skills via agent reference

Personal skills are identified by checking if their SKILL.md references
an agent file from ~/.claude/agents/. Adds agent column to output table.
Replaces unreliable git history heuristic.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
bastien 2026-04-15 20:41:22 +02:00
parent 2d53b8f70c
commit a7f4a25cc3

View File

@ -20,10 +20,9 @@ List only **user-created** skills from `~/.claude/skills/`, excluding framework
## How to detect user-created skills ## How to detect user-created skills
Use git history to identify skills added in bulk commits (framework installs). A skill is **personal** if its SKILL.md references an agent file from
A skill is considered **framework** if its SKILL.md was first added in a commit `~/.claude/agents/`. All user-created skills delegate work to a dedicated agent,
that also added 5+ other SKILL.md files. User-created skills are added in small while framework/gstack skills do not.
commits (1-3 SKILL.md files at a time).
Run this command to get the list of personal skills: Run this command to get the list of personal skills:
@ -33,10 +32,9 @@ for dir in ~/.claude/skills/*/; do
skill=$(basename "${dir%/}") skill=$(basename "${dir%/}")
skill_file="${dir}SKILL.md" skill_file="${dir}SKILL.md"
[ -f "$skill_file" ] || continue [ -f "$skill_file" ] || continue
commit=$(git -C ~/Documents/claude log --diff-filter=A --format='%H' -1 -- "skills/${skill}/SKILL.md" 2>/dev/null) if [ "$skill" = "skills-perso" ] || grep -qE '\$HOME/\.claude/agents/|~/\.claude/agents/|\.claude/agents/' "$skill_file" 2>/dev/null; then
[ -z "$commit" ] && continue echo "$skill"
count=$(git -C ~/Documents/claude diff-tree --no-commit-id --name-only -r "$commit" -- 'skills/*/SKILL.md' 2>/dev/null | wc -l) fi
[ "$count" -le 3 ] && echo "$skill"
done done
``` ```
@ -45,20 +43,21 @@ done
1. Run the detection command above to get the list of personal skill names. 1. Run the detection command above to get the list of personal skill names.
2. For each personal skill, read the first 15 lines of its `SKILL.md`. 2. For each personal skill, read the first 15 lines of its `SKILL.md`.
3. Extract `name` and `description` from the YAML frontmatter. 3. Extract `name` and `description` from the YAML frontmatter.
4. Display a clean table with two columns: **Skill** and **Description** (first line of description only, trimmed). 4. Also extract the agent file it references (the `.md` filename from `~/.claude/agents/`).
5. At the end, show the total count of personal skills (and mention how many framework skills were excluded). 5. Display a clean table with three columns: **Skill**, **Agent**, and **Description** (first line of description only, trimmed).
6. At the end, show the total count of personal skills (and mention how many framework skills were excluded).
## Output format ## Output format
``` ```
## Personal Skills (~/.claude/skills/) ## Personal Skills (~/.claude/skills/)
| Skill | Description | | Skill | Agent | Description |
|-------|-------------| |-------|-------|-------------|
| feat | Small feature implementation (1-5 files)... | | feat | feater.md | Small feature implementation (1-5 files)... |
| ... | ... | | ... | ... | ... |
**Total: N personal skills** (M framework skills excluded) **Total: N personal skills** (M framework/external skills excluded)
``` ```
Keep descriptions to one line (~80 chars max, truncate with "..." if needed). Keep descriptions to one line (~80 chars max, truncate with "..." if needed).