From 358b0f5289bf2138828cf1af5f1316b64b8b1056 Mon Sep 17 00:00:00 2001 From: Gilles Soulier Date: Sat, 16 May 2026 10:31:13 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20install.sh=20=E2=80=94=20section=20GLOBA?= =?UTF-8?q?L=20:=20d=C3=A9tection=20skills=20sans=20sous-dossier=20cat?= =?UTF-8?q?=C3=A9gorie?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problème : .codex/skills/ha-log-investigator/SKILL.md n'a pas de niveau catégorie contrairement à .claude/skills/infra/ha-log-investigator/SKILL.md. Le parsing cat/skill était donc faux pour codex (cat=skill, skill="SKILL"). Fix : - gen_global_section() détecte la profondeur via le nombre de / dans le chemin - cat_name vide si skill directement sous skills/ (structure codex) - find exclut les dossiers cachés (*.system*, etc.) via -not -path '*/.*' - preview_script g: construit le chemin selon présence ou non de cat_name Co-Authored-By: Claude Sonnet 4.6 --- install.sh | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index c11d63c..5ba0a57 100755 --- a/install.sh +++ b/install.sh @@ -597,10 +597,21 @@ gen_global_section() { [[ -z "$base" ]] && continue while IFS= read -r skill_md; do rel="${skill_md#${base}/skills/}" - cat_name="${rel%%/*}"; rest="${rel#*/}"; skill_name="${rest%%/*}" + local path_part="${rel%/SKILL.md}" + local slashes="${path_part//[^\/]/}" + local cat_name skill_name display + if [[ "${#slashes}" -ge 1 ]]; then + cat_name="${path_part%%/*}" + skill_name="${path_part#*/}" + display="${cat_name}/${skill_name}" + else + cat_name="" + skill_name="$path_part" + display="$skill_name" + fi ver=$(grep "^version:" "$skill_md" 2>/dev/null | head -1 | awk '{print $2}') - global_lines+=("g:${agent}|${cat_name}|${skill_name}\t ${GRV_GRAY}${cat_name}/${skill_name}${RESET} ${GRV_GRAY}[${agent}]${RESET} ${GRV_GRAY}v${ver:-?}${RESET}") - done < <(find "${base}/skills" -name "SKILL.md" 2>/dev/null | sort) + global_lines+=("g:${agent}|${cat_name}|${skill_name}\t ${GRV_GRAY}${display}${RESET} ${GRV_GRAY}[${agent}]${RESET} ${GRV_GRAY}v${ver:-?}${RESET}") + done < <(find "${base}/skills" -name "SKILL.md" -not -path '*/.*' 2>/dev/null | sort) done if [[ ${#global_lines[@]} -eq 0 ]]; then printf "d:-\t${GRV_GRAY} (aucun skill installé globalement)${RESET}\n" @@ -664,7 +675,11 @@ elif [[ "$type" == "g" || ( "$type" == "d" && "$value" != "-" && "$value" != "se hermes) base="$HOME/.hermes" ;; *) exit 0 ;; esac - skill_file="${base}/skills/${cat_name}/${skill_name}/SKILL.md" + if [[ -n "$cat_name" ]]; then + skill_file="${base}/skills/${cat_name}/${skill_name}/SKILL.md" + else + skill_file="${base}/skills/${skill_name}/SKILL.md" + fi if [[ -f "$skill_file" ]]; then if command -v bat &>/dev/null; then bat --style=numbers,header --color=always --language=markdown "$skill_file"