diff --git a/doctor.sh b/doctor.sh index b95732a..1ef011c 100644 --- a/doctor.sh +++ b/doctor.sh @@ -509,7 +509,8 @@ CLAUDE_MD_CHARS=$(wc -c < "$REPO/CLAUDE.global.md" 2>/dev/null || echo 0) CLAUDE_MD_TOKENS=$((CLAUDE_MD_CHARS / 4)) # Skill descriptions across the whole live catalog — every SKILL.md -# reachable through ~/.claude/skills/*/SKILL.md, symlinks included +# reachable through ~/.claude/skills/*/SKILL.md and +# ~/.claude/skills/pack-*/skills/*/SKILL.md, symlinks included # (lib/doctor-skills.sh; catches a `|`/`>` block-scalar description that # the old `grep '^description:' | head -1` counted as 0 chars, and a # symlinked skill dir that the old `find -maxdepth 2` without `-L` missed). @@ -605,9 +606,10 @@ else fi # Check expected skills are present. Repo-owned skills only: gstack skills -# (health, status, …) are OFF by default and toggled per profile — requiring -# them here false-warns on a default install, and "run link.sh" cannot -# restore them (they are profile-managed, not link.sh-managed). +# ship in three packs (pack-gstack-dev/-browser/-design; on by manifest +# default = full, off per project or conversation by a profile) and live +# under skills/pack-gstack-*/skills/, while the check below reads +# $HOME/.claude/skills//SKILL.md, so they are excluded here. EXPECTED_SKILLS=( "analyze" "doc" "init-project" "onboard" "plugin-check" "refactor" "ship-feature" "status" diff --git a/install-plugins.sh b/install-plugins.sh index 8736fee..a732642 100644 --- a/install-plugins.sh +++ b/install-plugins.sh @@ -25,22 +25,25 @@ else warn "Cannot write log to $REPO — continuing without log file" fi -# Load shared detection library -# shellcheck source=lib/detect-plugins.sh disable=SC1091 -source "$REPO/lib/detect-plugins.sh" +# Load shared libraries # shellcheck source=lib/gstack-playwright.sh disable=SC1091 source "$REPO/lib/gstack-playwright.sh" # shellcheck source=lib/gstack-links.sh disable=SC1091 source "$REPO/lib/gstack-links.sh" # ── Guard hand-curated config against installer drift ──────── -# graphify's installer (Step 7) rewrites CLAUDE.md + .claude/settings.json -# (clobbers the curated graphify section + injects aggressive MANDATORY -# hooks), and `claude plugin install` (Step 5) flips enable-states in -# settings.json. These 4 files are maintained by hand + commit, never by -# the installer. Snapshot them now and restore on exit so a run leaves them -# exactly as it found them. Pre-existing local edits are preserved; only the -# installer's drift is undone. NOTE: this makes these files install-immutable +# graphify's installer (Step 7) runs `graphify install` (appends a +# `# graphify` block to ~/.claude/CLAUDE.md = CLAUDE.global.md, which holds +# the curated `## graphify` section: it matches the heading and appends, +# it does not clobber) and `graphify claude install` (writes CLAUDE.md and +# .claude/settings.json in the caller's cwd, injecting aggressive MANDATORY +# hooks). The EXIT trap restores the 4 $REPO files in GUARDED_CONFIGS +# (fully effective when run from $REPO, e.g. `make plugin`). `claude plugin +# install` (Step 5) flips enable-states in settings.json. These 4 files are +# maintained by hand + commit, never by the installer. Snapshot them now and +# restore on exit so a run leaves them exactly as it found them. Pre-existing +# local edits are preserved; only the installer's drift is undone. NOTE: this +# makes these files install-immutable # — anything the installer should add to them must be committed by hand. # CLAUDE.md = project memory (graphify's rewrite target); CLAUDE.global.md # = user-scope global memory (deployed as ~/.claude/CLAUDE.md). diff --git a/lib/detect-plugins.sh b/lib/detect-plugins.sh index 2507dd4..11c55aa 100644 --- a/lib/detect-plugins.sh +++ b/lib/detect-plugins.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # ============================================================ # lib/detect-plugins.sh — Single source of truth for plugin detection -# Sourced by: session-start.sh, doctor.sh, install-plugins.sh, update-all.sh +# Sourced by: session-start.sh, doctor.sh # # Each function returns 0 (detected) or 1 (not detected). # No output — callers handle messaging. diff --git a/lib/doctor-skills.sh b/lib/doctor-skills.sh index 19ba1ae..bcbba51 100644 --- a/lib/doctor-skills.sh +++ b/lib/doctor-skills.sh @@ -3,7 +3,8 @@ # lib/doctor-skills.sh — doctor.sh's skill-catalog stats # # `skill_catalog_stats ` counts every skill reachable -# through /*/SKILL.md (symlinks included — Python's +# through /*/SKILL.md and /pack-*/skills/*/SKILL.md +# (symlinks included — Python's # glob.glob follows them, verified: a symlinked skill dir matches the # pattern the same as a real one) and sums their description length, # reusing lib/skill-routing-census.py's extract_description() (handles diff --git a/lib/gstack-links.sh b/lib/gstack-links.sh index 39719e5..e7756b1 100644 --- a/lib/gstack-links.sh +++ b/lib/gstack-links.sh @@ -6,7 +6,8 @@ # assets (bin/, browse/dist/, design/dist/, lib/diagram-render/dist/, # ETHOS.md, scripts/jargon-list.json, freeze/bin/, */sections/*.md, # review/checklist.md + specialists/, …) that per-skill SKILL.md -# symlinks never expose (BDR-030 links gstack skills individually). +# symlinks never expose (BDR-030 links gstack skills individually +# (superseded by BDR-134: packs)). # `link_gstack_helpers()` walks the submodule ONCE and mirrors every one # of those assets under , so make-pdf, diagram, the freeze hook, # cso/plan-*-review sections etc. actually resolve — before this, only diff --git a/lib/tests/curated-config-guard.test.sh b/lib/tests/curated-config-guard.test.sh index 72245e2..279a61b 100644 --- a/lib/tests/curated-config-guard.test.sh +++ b/lib/tests/curated-config-guard.test.sh @@ -6,7 +6,7 @@ # single-occurrence + column-0 closing brace) so drift in install-plugins.sh # propagates into this test instead of testing a stale copy. GUARDED_CONFIGS, # CFG_SNAPSHOT, REPO and an info() stub are defined here — the array literal -# at install-plugins.sh:43-44 is outside the extracted range. +# GUARDED_CONFIGS array in install-plugins.sh is outside the extracted range. set -u INSTALL_SH="$(cd "$(dirname "$0")/../.." && pwd)/install-plugins.sh" pass=0; fail=0 diff --git a/link.sh b/link.sh index 5fee1c1..8b75a24 100644 --- a/link.sh +++ b/link.sh @@ -54,8 +54,8 @@ for item in hooks githooks agents skills lib templates rules; do CHANGED=$((CHANGED + 1)) done -# GStack is exposed via per-skill symlinks under skills/ (browse, -# canary, autoplan, design-review, …) created by gstack's own `./setup`, +# GStack skills are tracked links under skills/pack-gstack-*/skills/ +# -> skills-external/gstack/ (packs, BDR-134), # PLUS a shared helper tree at skills/gstack/ mirroring every asset the # skills hardcode (bin/, browse/dist/, ETHOS.md, …) that a per-skill # symlink never exposes — see lib/gstack-links.sh. The helper tree diff --git a/update-all.sh b/update-all.sh index 8d08bea..bbba001 100644 --- a/update-all.sh +++ b/update-all.sh @@ -14,9 +14,7 @@ info() { echo -e "${BLUE}→${NC} $1"; } REPO="$(cd "$(dirname "$0")" && pwd)" VERSION=$(cat "$REPO/version.txt" 2>/dev/null || echo "unknown") -# Load shared detection library -# shellcheck source=lib/detect-plugins.sh disable=SC1091 -source "$REPO/lib/detect-plugins.sh" +# Load shared libraries # shellcheck source=lib/gstack-playwright.sh disable=SC1091 source "$REPO/lib/gstack-playwright.sh" # shellcheck source=lib/gstack-links.sh disable=SC1091