From 663b6cbe2202d7df8e643c23bb34ea82529fc935 Mon Sep 17 00:00:00 2001 From: Bastien Chanot Date: Wed, 26 Aug 2026 11:17:16 +0200 Subject: [PATCH] =?UTF-8?q?optimize=20skills-perso:=20d8=20=E2=80=94=20det?= =?UTF-8?q?ection=20rebuilt=20on=20link.sh=20symlink=20convention=20(8/32?= =?UTF-8?q?=20->=2031/31)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- skills/skills-perso/SKILL.md | 80 +++++++++++++----------------------- 1 file changed, 29 insertions(+), 51 deletions(-) diff --git a/skills/skills-perso/SKILL.md b/skills/skills-perso/SKILL.md index 60e5756..4283d45 100644 --- a/skills/skills-perso/SKILL.md +++ b/skills/skills-perso/SKILL.md @@ -19,56 +19,35 @@ List only **user-created** skills from `~/.claude/skills/`, excluding framework ## How to detect user-created skills -A skill is **personal** if it satisfies AT LEAST ONE of these signals (in priority order): +The install convention (`link.sh`) IS the discriminator — no content heuristics: -1. **Explicit marker** — frontmatter contains `owner: user` (preferred — unambiguous, future-proof) -2. **Agent-reference heuristic** — SKILL.md body references an agent file from `~/.claude/agents/` on a non-comment line -3. **Allowlist** — skill name is in the explicit allowlist below (for self-contained personal skills that do not delegate) - -Allowlist of self-contained personal skills (no agent delegation): `skills-perso`. - -Framework / gstack skills always FAIL all three signals — that is how they are excluded. +1. **External/framework skills are symlinks** (gstack, npx skills, third-party) → excluded. +2. **Personal skills are real directories** containing a `SKILL.md` → included. +3. **Machine-generated skills** (e.g. `find-docs`, written by `install-plugins.sh`) + are real dirs but gitignored in the config repo → excluded via `git check-ignore`. Run this command to get the list of personal skills: ```bash -ALLOWLIST="skills-perso" +SKILLS_DIR=$(readlink -f ~/.claude/skills) # resolves into the config repo when wired by link.sh -is_personal() { - local skill_file="$1" skill_name="$2" - # Signal 1: explicit marker - if grep -qE '^owner:[[:space:]]*user\b' "$skill_file" 2>/dev/null; then - return 0 - fi - # Signal 2: agent reference on a non-comment line - if grep -nE '\$HOME/\.claude/agents/|~/\.claude/agents/|\.claude/agents/' "$skill_file" 2>/dev/null \ - | grep -vE '^[0-9]+:[[:space:]]*(#|