From 9327b4fcd07f3926a5d3b78c82a2585cae04b36f Mon Sep 17 00:00:00 2001 From: bchanot Date: Mon, 2 Nov 2026 11:48:46 +0100 Subject: [PATCH] fix(census,install): moved dirs scanned, real-dir remedy, impeccable adoption, retired list carries its rationale Census scans the four moved dirs and bare skills// citers, warns on a pack id with no manifest, refuses equal fragments. Installers adopt a real skills/impeccable with mv, never rm. --- .gitignore | 2 +- install-plugins.sh | 19 +++++++++------ lib/gstack-removed.list | 16 +++++++++++++ lib/pack-census-fragments.jq | 17 +++++++++++--- lib/pack-census.sh | 23 +++++++++++++------ lib/tests/doctrine-citers.test.sh | 5 ++-- lib/tests/pack-census.test.sh | 17 +++++++++++++- lib/tests/seo-geo-contract.test.sh | 4 ++-- plugins.lock.json | 4 ++-- .../pack-design/skills/site-motion/SKILL.md | 2 +- .../skills/seo/resources/depth-matrix.md | 4 ++-- update-all.sh | 6 +++++ 12 files changed, 91 insertions(+), 28 deletions(-) diff --git a/.gitignore b/.gitignore index 7e565ba..04f26a6 100644 --- a/.gitignore +++ b/.gitignore @@ -14,7 +14,7 @@ skills/using-git-worktrees skills/writing-skills # Impeccable — `impeccable skills install --scope=global` writes -# skills/impeccable/ through the ~/.claude/skills symlink; install-plugins.sh +# impeccable/ into the skills dir through the ~/.claude/skills symlink; install-plugins.sh # moves it to skills-external/impeccable (pack-design links it). Machine-owned. skills/impeccable skills-external/impeccable/ diff --git a/install-plugins.sh b/install-plugins.sh index 23d2eee..10c2c5c 100644 --- a/install-plugins.sh +++ b/install-plugins.sh @@ -796,7 +796,7 @@ echo "" # 61 deterministic detector rules (`impeccable detect`, exit 0/2), the # /impeccable skill (23 verbs) and 4 `impeccable-*` subagents. # -# GLOBAL scope, no staging: the installer writes skills/impeccable/ through +# GLOBAL scope, no staging: the installer writes impeccable/ into skills/ through # the ~/.claude/skills symlink (skill + its self-contained engine binary) and ~/.claude/agents/ # impeccable-*.md, and both of those are symlinks into this repo — so the # global install IS the repo install. Machine-owned and gitignored on both @@ -814,6 +814,12 @@ echo "── Step 8d: Impeccable — design detector, skill + agents ──" echo "" IMP_SKILL_DIR="$REPO/skills/impeccable" IMP_HOME="$REPO/skills-external/impeccable" +# A real skills/impeccable (older install) is adopted, never removed. +if [ ! -e "$IMP_HOME" ] && [ -f "$IMP_SKILL_DIR/SKILL.md" ] \ + && [ ! -L "$IMP_SKILL_DIR" ]; then + mkdir -p "$REPO/skills-external" + (cd "$REPO" && mv skills/impeccable skills-external/impeccable) +fi IMP_VER=$(pinned_version "impeccable") NODE_MAJOR=$(node -v 2>/dev/null | sed 's/^v//' | cut -d. -f1) @@ -986,11 +992,10 @@ echo "" # credits. Its skills come from github.com/higgsfield-ai/skills, cloned by # lib/higgsfield-skills.sh into skills-external/higgsfield-* (gitignored). # -# Nothing is linked here. The pack is OFF by default and belongs to no -# profile: `bash lib/profile.sh enable higgsfield` turns the media skills -# on, `enable higgsfield-websites` the landing-page aid. Keeping it out of -# link.sh and of every profile is what stops a re-run from re-enabling it -# (BDR-093). +# Nothing is linked here. pack-higgsfield is OFF by default and ON in `max` +# only; `bash lib/profile.sh enable higgsfield` turns it on elsewhere. Its +# 8 skills include `higgsfield-websites`. Keeping it out of link.sh is what +# stops a re-run from re-enabling it (BDR-093). echo "── Step 8.6: Higgsfield CLI + skill pack ───────────────────" echo "" # shellcheck source=lib/higgsfield-skills.sh disable=SC1091 @@ -1266,7 +1271,7 @@ echo " 🔄 agent-skills trio — observability-and-instrumentation, deprec echo " 🔄 mengto scroll skills — scroll-world-storytelling, build-threejs-scroll-worlds, scroll-scrubbed-visual-sequence, scroll-scrubbed-word-reveal, scroll-progress-timeline (curl → symlink, pinned commit)" echo " 🔄 darwin-skill — autonomous skill optimizer (npx skills, ~/.agents/skills/)" echo " 🔄 21st skill pack — 21st.dev CLI skills; linked by skills/pack-design and skills/pack-extras (bash lib/profile.sh set | enable , then /reload-plugins)" -echo " 🔄 higgsfield pack — Higgsfield CLI media skills (image, video, audio, brand), OFF by default (bash lib/profile.sh enable higgsfield, then /reload-plugins; landing-page aid: enable higgsfield-websites)" +echo " 🔄 higgsfield pack — Higgsfield CLI media skills (image, video, audio, brand), OFF by default (bash lib/profile.sh enable higgsfield, then /reload-plugins; landing-page aid: \`higgsfield-websites\` ships in pack-higgsfield)" echo "" echo " All plugins installed at: user scope (~/.claude/plugins/)" echo " GStack skills live in packs skills/pack-gstack-*/ (symlinks into the submodule)" diff --git a/lib/gstack-removed.list b/lib/gstack-removed.list index 0d8fc6f..3a49d3a 100644 --- a/lib/gstack-removed.list +++ b/lib/gstack-removed.list @@ -1,3 +1,19 @@ +# The gstack skills this config never exposes: one name per line, read by +# lib/pack-census.sh (grep -qx), so these comment lines never match. +# A name listed is in no pack and no profile, `max` included. Pruned +# 2026-09-28 (BDR-105); the helpers once housed in lib/gstack-removed.sh +# are gone with the symlink toggling (BDR-117). +# Why each name went: +# ship base = origin/HEAD = main on Gitea, skips develop +# land-and-deploy `gh pr merge --squash --delete-branch` then deploys +# setup-deploy companion of land-and-deploy (Claude never deploys) +# autoplan reads ~/.claude/skills/gstack/plan-*/ paths that do +# not exist in this install +# context-save its pair context-restore is not linked; never used +# learn parallel JSONL store outside .claude/memory, unused +# careful, guard hooks exit 127 (missing bin path), vacuous; the house +# permissions.deny is stricter (BDR-095) +# design-shotgun mockups need OPENAI_API_KEY, absent ship land-and-deploy setup-deploy diff --git a/lib/pack-census-fragments.jq b/lib/pack-census-fragments.jq index dcec72f..163d95b 100644 --- a/lib/pack-census-fragments.jq +++ b/lib/pack-census-fragments.jq @@ -1,6 +1,7 @@ # lib/pack-census-fragments.jq — fragment invariants (lib/pack-census.sh). # $m = manifests [{id,on}], $deny = space-separated profiles that deny the -# two higgsfield connectors; inputs = lib/profiles/*.json. Prints RED lines. +# two higgsfield connectors; inputs = lib/profiles/*.json. Prints RED lines, +# and WARN lines for a pack id with no manifest. def name_of: input_filename | sub(".*/"; ""); def dn: [(.deniedMcpServers // [])[] | .serverName] | sort; [inputs | {f: name_of, frag: .}] as $all @@ -8,7 +9,12 @@ def dn: [(.deniedMcpServers // [])[] | .serverName] | sort; | ($full.enabledPlugins | keys) as $keys | ($deny | split(" ") | map(. + ".json")) as $deny_files | ($m | map({key: .id, value: .on}) | from_entries) as $mdef -| $all[] +| ($m | map(.id)) as $mids +| ( [$all[] | {f, ep: .frag.enabledPlugins, d: (.frag | dn)}] as $s + | ($s | to_entries[]) as $e + | $s[$e.key + 1:][] | select(.ep == $e.value.ep and .d == $e.value.d) + | "RED lib/profiles/\($e.value.f) and \(.f) are identical fragments" ), + ( $all[] | .f as $f | .frag as $g | ( if ($g.enabledPlugins | keys) != $keys then "RED lib/profiles/\($f): key set differs from full.json" @@ -29,4 +35,9 @@ def dn: [(.deniedMcpServers // [])[] | .serverName] | sort; ($mdef | to_entries[] | select($g.enabledPlugins[.key] != .value) | "RED lib/profiles/full.json: \(.key) is \($g.enabledPlugins[.key])" + " but the manifest default is \(.value)") - else empty end ) + else empty end ), + ( $g.enabledPlugins | keys[] + | select(startswith("pack-") and endswith("@skills-dir") + and (. as $k | $mids | index($k) == null)) + | sub("@skills-dir$"; "") as $n + | "WARN lib/profiles/\($f): names \($n) with no skills/\($n)/" ) ) diff --git a/lib/pack-census.sh b/lib/pack-census.sh index bd9a68e..82cae4b 100755 --- a/lib/pack-census.sh +++ b/lib/pack-census.sh @@ -35,7 +35,7 @@ PROFILES="$REPO/lib/profiles" REMOVED="$REPO/lib/gstack-removed.list" HERE="$(cd -P "$(dirname "${BASH_SOURCE[0]}")" && pwd)" FRAG_JQ="$HERE/pack-census-fragments.jq" -DENY_PROFILES="audit backend dev minimal qa seo" # spec § 2 +DENY_PROFILES="audit dev minimal qa seo" # spec § 2 red=0; packs=0; skills=0 declare -A seen red() { echo "RED $*"; red=1; } @@ -52,6 +52,11 @@ check_manifest() { # $1 pack dir [ "$name" = "$n" ] || red "$n: manifest name is $name" } +dup_remedy() { # $1 skill listed flat and in a pack + if [ -L "$SKILLS/$1" ]; then echo "rm skills/$1 (a flat link)" + else echo "mv skills/$1 skills-external/$1 (a real dir)"; fi +} + check_entry() { # $1 pack dir, $2 entry path local n s; n="$(basename "$1")"; s="$(basename "$2")" if [ ! -e "$2/SKILL.md" ]; then @@ -62,7 +67,7 @@ check_entry() { # $1 pack dir, $2 entry path [ -f "$REMOVED" ] && grep -qx -- "$s" "$REMOVED" \ && red "$n: $s is a retired gstack skill" if [ -n "${seen[$s]:-}" ]; then - red "$s listed twice: ${seen[$s]} and $n — rm ${seen[$s]} (a flat link)" + red "$s listed twice: ${seen[$s]} and $n; run: $(dup_remedy "$s")" else seen[$s]="$n"; fi skills=$((skills+1)) } @@ -73,7 +78,8 @@ check_fragments() { out="$(jq -rn --arg deny "$DENY_PROFILES" --argjson m "$(manifests_json)" \ -f "$FRAG_JQ" "${files[@]}")" \ || { red "lib/profiles: a fragment is not JSON"; return; } - [ -z "$out" ] || { echo "$out"; red=1; } + [ -z "$out" ] || echo "$out" + ! grep -q '^RED' <<<"$out" || red=1 } manifests_json() { # [{id, on}] for every pack manifest @@ -82,6 +88,8 @@ manifests_json() { # [{id, on}] for every pack manifest "$SKILLS"/pack-*/.claude-plugin/plugin.json 2>/dev/null || echo '[]' } +# A bare `skills//` is stale; the layout is +# `skills/pack-/skills//`, and a path with any prefix passes. # The old-layout terms are written with a bracketed last letter so this # file never matches itself; the test's fixture strings live in # lib/tests/fixtures/ (excluded) for the same reason. @@ -89,7 +97,8 @@ check_citers() { # $@ pack skill names → one grep over the contract scope local args=(-e 'skills-disable[d]/' -e 'toggle-externa[l]' -e '\.active-profil[e]' -e 'lib/profiles/[a-z-]*\.profil[e]') n hit for n in "$@"; do - args+=(-e "~/.claude/skills/$n\b" -e "\$HOME/.claude/skills/$n\b") + args+=(-e "~/.claude/skills/$n\b" -e "\$HOME/.claude/skills/$n\b" + -e "\(^\|[^A-Za-z0-9_./}~-]\)skills/$n/") done hit="$( { grep -rno --include='*.sh' --include='*.md' --include='*.py' \ --include='*.json' --include='Makefile' "${args[@]}" "$REPO"/hooks \ @@ -98,9 +107,9 @@ check_citers() { # $@ pack skill names → one grep over the contract scope "$REPO"/README.md "$REPO"/USAGE.md "$REPO"/ARCHITECTURE.md \ "$REPO"/Makefile "$REPO"/plugins.lock.json 2>/dev/null grep -nHo "${args[@]}" "$REPO"/.gitignore 2>/dev/null; } \ - | grep -v -e '/lib/tests/fixtures/' -e '/skills/pack-' \ - -e '/skills-external/' \ - | sed 's#:[0-9]*:#\t#' | sort -u || true)" + | grep -v -e '/lib/tests/fixtures/' -e '/skills-external/' \ + | sed -E 's#:[0-9]*:#\t#; s#\t[^\t](skills/[^/\t]+/)$#\t\1#' \ + | sort -u || true)" [ -n "$hit" ] || return 0 while IFS=$'\t' read -r f m; do red "${f#"$REPO"/} cites $m" diff --git a/lib/tests/doctrine-citers.test.sh b/lib/tests/doctrine-citers.test.sh index 0b49664..688d763 100644 --- a/lib/tests/doctrine-citers.test.sh +++ b/lib/tests/doctrine-citers.test.sh @@ -186,14 +186,15 @@ citers_check_files "$FIX" "$FIX/t2.md" >/dev/null check T8h-template-rules-path "$rc1|$?" "0|1" # ── real census: the repo's own citers against CLAUDE.global.md ────────────── +# (`impeccabl[e]` is a glob: the pack census must not read it as a citer.) mapfile -t FILES < <(cd "$ROOT" && find skills agents lib rules hooks -type f \( -name '*.md' -o -name '*.sh' \) \ - -not -path 'skills/graphify/*' -not -path 'skills-external/impeccable/*' -not -path 'skills/synced/*' \ + -not -path 'skills/graphify/*' -not -path 'skills/impeccabl[e]/*' -not -path 'skills-external/impeccable/*' -not -path 'skills/synced/*' \ -not -path 'agents/impeccable-*' -not -path 'lib/tests/*' | sort) # T6 also scans the templates and this repo's own project rules; T3 must not # (there `CLAUDE.md` means a project CLAUDE.md, not the doctrine). mapfile -t FILES_ALL < <(cd "$ROOT" && find skills agents lib rules hooks \ templates .claude/rules -type f \( -name '*.md' -o -name '*.sh' \) \ - -not -path 'skills/graphify/*' -not -path 'skills-external/impeccable/*' \ + -not -path 'skills/graphify/*' -not -path 'skills/impeccabl[e]/*' -not -path 'skills-external/impeccable/*' \ -not -path 'skills/synced/*' -not -path 'agents/impeccable-*' \ -not -path 'lib/tests/*' | sort) # T8f: the T6 list reaches the two blind trees, the T3 list does not diff --git a/lib/tests/pack-census.test.sh b/lib/tests/pack-census.test.sh index b74668b..32b6c35 100755 --- a/lib/tests/pack-census.test.sh +++ b/lib/tests/pack-census.test.sh @@ -53,8 +53,12 @@ mv "$FX/skills/pack-alpha/.claude-plugin/plugin.json.bak" "$FX/skills/pack-alpha ln -s ../skills-external/a1 "$FX/skills/a1" out="$(census)"; rc=$? -check T5-dup-rc "$rc" 1; check_has T5-dup "$out" "RED a1 listed twice: skills/a1 and pack-alpha — rm skills/a1 (a flat link)" +check T5-dup-rc "$rc" 1; check_has T5-dup "$out" "RED a1 listed twice: skills/a1 and pack-alpha; run: rm skills/a1 (a flat link)" rm "$FX/skills/a1" +mkdir "$FX/skills/a1"; touch "$FX/skills/a1/SKILL.md" +out="$(census)" +check_has T5-dup-real "$out" "run: mv skills/a1 skills-external/a1 (a real dir)" +rm -r "$FX/skills/a1" ln -s "../../../skills-external/a1" "$FX/skills/pack-alpha/skills/gs-dead" out="$(census)"; rc=$? @@ -91,6 +95,17 @@ out="$(census)"; rc=$? check T10-fixed-rc "$rc" 1; check_has T10-fixed "$out" "RED lib/profiles/dev.json: security-guidance@claude-code-plugins must be true" mv "$FX/lib/profiles/dev.json.bak" "$FX/lib/profiles/dev.json" +# identical fragments; a pack id with no manifest (WARN, not RED) +cp "$FX/lib/profiles/dev.json" "$FX/lib/profiles/zdev.json" +out="$(census)"; rc=$? +check T13-same-rc "$rc" 1 +check_has T13-same "$out" "RED lib/profiles/dev.json and zdev.json are identical fragments" +rm "$FX/lib/profiles/zdev.json" +sed 's/pack-beta@skills-dir": false/pack-beta@skills-dir": false, "pack-ghost@skills-dir": false/' "$FX/lib/profiles/dev.json" > "$FX/lib/profiles/ghost.json" +out="$(census)"; rc=$? +check_has T14-ghost "$out" "WARN lib/profiles/ghost.json: names pack-ghost with no skills/pack-ghost/" +rm "$FX/lib/profiles/ghost.json" + # real repo, hermetic part out="$(bash "$ROOT/lib/pack-census.sh" 2>&1)"; rc=$? check T11-real-rc "$rc" 0; check_has T11-real "$out" "PACKS OK 9 packs 55 skills" diff --git a/lib/tests/seo-geo-contract.test.sh b/lib/tests/seo-geo-contract.test.sh index 4181a4d..c9056e2 100644 --- a/lib/tests/seo-geo-contract.test.sh +++ b/lib/tests/seo-geo-contract.test.sh @@ -15,8 +15,8 @@ has() { if grep -qF "$2" "$R/$1"; then ok; else ko "$1 missing: $2"; fi; } SEO=agents/seo-analyzer.md GEO=agents/geo-analyzer.md -# 1) judge verdict grammar — DISPATCHER ERROR CONTRACT (skills/seo STEP 1, -# skills/geo STEP 1B) fail-closes on this exact shape +# 1) judge verdict grammar — DISPATCHER ERROR CONTRACT (skills/pack-seo/skills/seo STEP 1, +# skills/pack-seo/skills/geo STEP 1B) fail-closes on this exact shape has "$SEO" 'SEO JUDGE — VERDICT: ERROR(' has "$GEO" 'GEO JUDGE — VERDICT: ERROR(' has "skills/pack-seo/skills/seo/SKILL.md" 'SEO JUDGE — VERDICT: ERROR(' diff --git a/plugins.lock.json b/plugins.lock.json index 67c69df..7060b06 100644 --- a/plugins.lock.json +++ b/plugins.lock.json @@ -28,7 +28,7 @@ "higgsfield": { "source": "npm:@higgsfield/cli", "version": "latest", - "note": "Higgsfield CLI (bins `higgsfield`, `higgs`) — image, video, audio and brand media generation, metered credits; auth is `higgsfield auth login` (browser). Install: npm install -g @higgsfield/cli. The package vendors its binary in a postinstall script; if npm holds it back, add --allow-scripts=@higgsfield/cli. The upstream skills are git-cloned from https://github.com/higgsfield-ai/skills (tracks main, no pin) into skills-external/higgsfield-* by lib/higgsfield-skills.sh (install-plugins.sh Step 8.6, refreshed by update-all.sh); a skill upstream removes keeps its last local copy. OFF by default and in no profile: `bash lib/profile.sh enable higgsfield` links the 7 allowlisted media skills (HIGGSFIELD_MEDIA_SKILLS), `enable higgsfield-websites` the landing-page aid." + "note": "Higgsfield CLI (bins `higgsfield`, `higgs`) — image, video, audio and brand media generation, metered credits; auth is `higgsfield auth login` (browser). Install: npm install -g @higgsfield/cli. The package vendors its binary in a postinstall script; if npm holds it back, add --allow-scripts=@higgsfield/cli. The upstream skills are git-cloned from https://github.com/higgsfield-ai/skills (tracks main, no pin) into skills-external/higgsfield-* by lib/higgsfield-skills.sh (install-plugins.sh Step 8.6, refreshed by update-all.sh); a skill upstream removes keeps its last local copy. 8 skills in pack-higgsfield (OFF by default, ON in max; `profile.sh enable higgsfield`)." }, "graphifyy": { "source": "pypi:graphifyy", @@ -44,7 +44,7 @@ }, "emil-design-eng": { "source": "https://github.com/emilkowalski/skill", - "path": "skills/emil-design-eng/SKILL.md", + "path": "./skills/emil-design-eng/SKILL.md", "managed_by": "curl", "note": "Emil Kowalski's design engineering skill — UI polish, animations, component craft. Machine-owned: curl'd to skills-external/emil-design-eng/ (gitignored, re-fetched by update-all.sh), linked by skills/pack-design." }, diff --git a/skills/pack-design/skills/site-motion/SKILL.md b/skills/pack-design/skills/site-motion/SKILL.md index 3f2f7b8..be243bd 100644 --- a/skills/pack-design/skills/site-motion/SKILL.md +++ b/skills/pack-design/skills/site-motion/SKILL.md @@ -38,7 +38,7 @@ top of it. how a route transition should morph, how a WebGL hero should degrade → this skill. - Linting already-shipped motion against anti-slop rules → - `skills/impeccable/reference/animate.md` (`impeccable detect`) as the + `skills/pack-design/skills/impeccable/reference/animate.md` (`impeccable detect`) as the deterministic floor, or design-motion-principles' own audit workflow (`skills-external/design-motion-principles/workflows/audit.md`). - Non-motion defaults (fonts, color, spacing, the public-site checklist) diff --git a/skills/pack-seo/skills/seo/resources/depth-matrix.md b/skills/pack-seo/skills/seo/resources/depth-matrix.md index 7d6327d..d26db29 100644 --- a/skills/pack-seo/skills/seo/resources/depth-matrix.md +++ b/skills/pack-seo/skills/seo/resources/depth-matrix.md @@ -18,7 +18,7 @@ Owned by the agents, not this file — classical SEO weights are in weights varying by business type); GEO weights are in `agents/geo-analyzer.md` (STEP 10, 6 axes FULL / 5 axes LOCAL). Combined score formula (0.80/0.20 classical/GEO local-B2C, 0.75/0.25 SaaS/national) is -in `skills/seo/SKILL.md` (~line 273). +in `skills/pack-seo/skills/seo/SKILL.md` (~line 273). # Dedup rules — overlap with sibling skills @@ -32,6 +32,6 @@ in `skills/seo/SKILL.md` (~line 273). # Envelope schema for `.claude/audits/SEO.md` -Owned by `skills/seo/SKILL.md` (~lines 278-352, the real §0-§15 structure), +Owned by `skills/pack-seo/skills/seo/SKILL.md` (~lines 278-352, the real §0-§15 structure), not this file — both agents' envelopes are keyed to it (`agents/seo-analyzer.md` STEP 13, `agents/geo-analyzer.md` STEP 14). diff --git a/update-all.sh b/update-all.sh index c070913..c33cb8d 100644 --- a/update-all.sh +++ b/update-all.sh @@ -410,6 +410,12 @@ echo "" echo "── Updating impeccable..." IMP_SKILL_DIR="$REPO/skills/impeccable" IMP_HOME="$REPO/skills-external/impeccable" +# A real skills/impeccable (older install) is adopted, never removed. +if [ ! -e "$IMP_HOME" ] && [ -f "$IMP_SKILL_DIR/SKILL.md" ] \ + && [ ! -L "$IMP_SKILL_DIR" ]; then + mkdir -p "$REPO/skills-external" + (cd "$REPO" && mv skills/impeccable skills-external/impeccable) +fi if [ ! -f "$IMP_HOME/SKILL.md" ]; then info "impeccable not installed — skipping (run: make plugin)" else