Sfoglia il codice sorgente

fix(install): refresh skills/_lib (shared term.sh) instead of skipping it

install.sh skipped skills/_lib entirely ("not a skill"), so the shared terminal
library at ~/.claude/skills/_lib/term.sh was never refreshed after the first
install. Any skill script using a newer term.sh feature (TERM_DOT, brand glyphs,
term_pip_bar) then died with "unbound variable" under `set -u` against the stale
copy — surfaced by loop-ops: repo suite 116/116 but the installed suite 82/116
(loop-scaffold/loop-check/loop-doctor all exit 1). Now refreshes _lib like any
skill dir (still not validated or counted as a skill). install.ps1 already copied
it. Installed loop-ops suite back to 116/116.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
0xDarkMatter 6 giorni fa
parent
commit
77215456bf
1 ha cambiato i file con 10 aggiunte e 2 eliminazioni
  1. 10 2
      scripts/install.sh

+ 10 - 2
scripts/install.sh

@@ -158,8 +158,16 @@ for skill_dir in "$PROJECT_ROOT/skills"/*/; do
     [ -d "$skill_dir" ] || continue
     skill_name=$(basename "$skill_dir")
 
-    # Skip _lib (shared library used by multiple skills, not a skill itself)
-    [ "$skill_name" = "_lib" ] && continue
+    # _lib is the shared terminal library (skills/_lib/term.sh) that many skill
+    # scripts source. It is NOT a skill, but it MUST be refreshed — scripts that
+    # use newer term.sh features (TERM_DOT, brand glyphs, term_pip_bar) break with
+    # an "unbound variable" under `set -u` against a stale copy.
+    if [ "$skill_name" = "_lib" ]; then
+        rm -rf "$CLAUDE_DIR/skills/_lib"
+        cp -r "${skill_dir%/}" "$CLAUDE_DIR/skills/"
+        echo -e "  ${GREEN}_lib/${NC} (shared term library)"
+        continue
+    fi
 
     # Remove existing and copy fresh. Strip trailing slash from $skill_dir
     # so cp creates a subdirectory rather than merging contents (the *.*/* glob