From 0b92935d6de7d771a171c27cfc2ed760f75e6450 Mon Sep 17 00:00:00 2001 From: Bastien Chanot Date: Wed, 24 Jun 2026 14:22:36 +0200 Subject: [PATCH] feat(profile): activate gstack skills on-demand per profile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gstack stays OFF by default (no per-skill symlink in skills/, zero context cost). enable_skill now gains a gstack branch: a skill absent from skills/ and skills-disabled/ but present in the skills-external/gstack submodule is symlinked in on demand when a profile lists it; disable_gstack_not_in() parks it again on an unrelated profile. This makes `set full` (which lists 35 gstack skills) work without 35 bogus "missing — try: bash link.sh" warnings, without abandoning the OFF-by-default policy. The old remedy message was wrong (link.sh never creates gstack skills) and is replaced with submodule-aware messages. Refs BDR-030. Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_0169vjUD1sP9Nx4ZiCa8wvAw --- lib/profile.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/profile.sh b/lib/profile.sh index a801537..90982c1 100755 --- a/lib/profile.sh +++ b/lib/profile.sh @@ -45,6 +45,7 @@ set -euo pipefail REPO="$(cd -P "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" SKILLS_DIR="$REPO/skills" DISABLED_DIR="$REPO/skills-disabled" +GSTACK_SRC="$REPO/skills-external/gstack" # gstack submodule — source of truth for gstack skills PROFILES_DIR="$REPO/lib/profiles" TOGGLE_EXTERNAL="$REPO/lib/toggle-external.sh" ACTIVE_CACHE="$REPO/.active-profile" # statusline reads this — keep fast (single-line file, profile name only) @@ -247,8 +248,19 @@ enable_skill() { ok "enabled: $skill" elif [ -e "$SKILLS_DIR/$skill" ]; then : # already enabled — silent + elif [ -d "$GSTACK_SRC/$skill" ]; then + # gstack is OFF by default: its skills live only in the submodule, + # never pre-symlinked into skills/. A profile that lists this gstack + # skill activates it on demand by symlinking the submodule skill dir + # in. disable_gstack_not_in() parks it again when an unrelated profile + # is set. The gstack/bin + browse/dist infra it relies on is created + # by link.sh, independent of this. + ln -sf "$GSTACK_SRC/$skill" "$SKILLS_DIR/$skill" + ok "enabled: $skill (gstack on-demand)" + elif [ ! -d "$GSTACK_SRC" ]; then + warn "missing: $skill — gstack submodule absent, run: git submodule update --init" else - warn "missing: $skill — try: bash link.sh" + warn "missing: $skill — not found in gstack submodule ($GSTACK_SRC)" fi ;; external|personal)