From 88cc7b1c907dba95b00320191eab76bb2f0615ff Mon Sep 17 00:00:00 2001 From: bastien Date: Wed, 6 May 2026 18:16:57 +0200 Subject: [PATCH] optimize(skills-perso): tri-signal detection (marker/agent-ref/allowlist) + empty fallback (d8 target) --- skills/skills-perso/SKILL.md | 46 ++++++++++++++++++++++++++++++++---- 1 file changed, 41 insertions(+), 5 deletions(-) diff --git a/skills/skills-perso/SKILL.md b/skills/skills-perso/SKILL.md index 5fa3693..f724e01 100644 --- a/skills/skills-perso/SKILL.md +++ b/skills/skills-perso/SKILL.md @@ -20,22 +20,58 @@ List only **user-created** skills from `~/.claude/skills/`, excluding framework ## How to detect user-created skills -A skill is **personal** if its SKILL.md references an agent file from -`~/.claude/agents/`. All user-created skills delegate work to a dedicated agent, -while framework/gstack skills do not. +A skill is **personal** if it satisfies AT LEAST ONE of these signals (in priority order): + +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. Run this command to get the list of personal skills: ```bash +ALLOWLIST="skills-perso" + +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:]]*(#|