feat(packs): nine skills-dir packs, profiles as settings fragments, profile.sh on one jq pass; symlink toggling and toggle-external retired
This commit is contained in:
1 parent
f3569f2689
commit
babf232594
120 files changed
+1217
-2654
No files matched your search
+5
-90
@@ -1,80 +1,10 @@
|
||||
# ── claude-config repo ignores ──
|
||||
|
||||
# GStack skill symlinks — auto-created by gstack setup
|
||||
# Only the gstack/ dir itself + all symlinked skills inside skills/
|
||||
# Core skills linked flat by link.sh (symlinks, machine-owned); the heavy groups live in skills/pack-*/ as tracked symlinks.
|
||||
skills/gstack
|
||||
skills/autoplan
|
||||
skills/benchmark
|
||||
skills/browse
|
||||
skills/canary
|
||||
skills/careful
|
||||
skills/codex
|
||||
skills/connect-chrome
|
||||
skills/cso
|
||||
skills/design-consultation
|
||||
skills/design-html
|
||||
skills/design-review
|
||||
skills/design-shotgun
|
||||
skills/devex-review
|
||||
skills/diagram
|
||||
skills/document-release
|
||||
skills/freeze
|
||||
skills/gstack-upgrade
|
||||
skills/guard
|
||||
skills/health
|
||||
skills/investigate
|
||||
skills/land-and-deploy
|
||||
skills/learn
|
||||
skills/office-hours
|
||||
skills/open-gstack-browser
|
||||
skills/pair-agent
|
||||
skills/plan-ceo-review
|
||||
skills/plan-design-review
|
||||
skills/plan-devex-review
|
||||
skills/plan-eng-review
|
||||
skills/qa
|
||||
skills/qa-only
|
||||
skills/retro
|
||||
skills/review
|
||||
skills/setup-browser-cookies
|
||||
skills/setup-deploy
|
||||
skills/ship
|
||||
skills/unfreeze
|
||||
skills/benchmark-models
|
||||
skills/context-restore
|
||||
skills/context-save
|
||||
skills/make-pdf
|
||||
skills/plan-tune
|
||||
skills/spec
|
||||
skills/document-generate
|
||||
skills/landing-report
|
||||
skills/scrape
|
||||
skills/setup-gbrain
|
||||
skills/skillify
|
||||
skills/sync-gbrain
|
||||
# iOS device-farm skills (need a Mac daemon + Tailscale + iOS devices) —
|
||||
# not linked on this Linux host; ignored so they stay out of git if a
|
||||
# future gstack setup on a Mac host materializes the symlinks.
|
||||
skills/ios-clean
|
||||
skills/ios-design-review
|
||||
skills/ios-fix
|
||||
skills/ios-qa
|
||||
skills/ios-sync
|
||||
|
||||
# External skill symlinks — auto-created by link.sh
|
||||
skills/design-motion-principles
|
||||
skills/emil-design-eng
|
||||
skills/frontend-design
|
||||
skills/ci-cd-and-automation
|
||||
skills/deprecation-and-migration
|
||||
skills/observability-and-instrumentation
|
||||
skills/scroll-world-storytelling
|
||||
skills/build-threejs-scroll-worlds
|
||||
skills/scroll-scrubbed-visual-sequence
|
||||
skills/scroll-scrubbed-word-reveal
|
||||
skills/scroll-progress-timeline
|
||||
|
||||
# superpowers, vendored (plugins.lock.json 'superpowers')
|
||||
skills/brainstorming
|
||||
skills/writing-plans
|
||||
skills/subagent-driven-development
|
||||
@@ -83,10 +13,11 @@ skills/requesting-code-review
|
||||
skills/using-git-worktrees
|
||||
skills/writing-skills
|
||||
|
||||
# Impeccable — NOT a symlink: `impeccable skills install --scope=global`
|
||||
# writes the skill dir (and its ~15 MB engine binary) straight in through the
|
||||
# ~/.claude/skills symlink. Machine-owned, regenerated by make plugin/update.
|
||||
# Impeccable — `impeccable skills install --scope=global` writes
|
||||
# skills/impeccable/ 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/
|
||||
|
||||
# …and the 4 subagents the same installer drops through ~/.claude/agents.
|
||||
# agents/ is a tracked directory, so these need naming explicitly.
|
||||
@@ -95,17 +26,6 @@ agents/impeccable-*.md
|
||||
# External skills installed via `npx skills add` — auto-created by link.sh
|
||||
skills/darwin-skill
|
||||
|
||||
# 21st.dev skill pack symlinks — created on demand by toggle-external.sh /
|
||||
# profile.sh (the pack is DISABLED by default, so these usually don't exist).
|
||||
# A glob, not one line per skill: the `21st skills install` manifest owns the
|
||||
# membership, so the pack can gain a skill with no edit here.
|
||||
skills/21st-*
|
||||
|
||||
# Higgsfield skill pack symlinks — created on demand by toggle-external.sh
|
||||
# (`enable higgsfield` / `enable higgsfield-websites`). The pack is OFF by
|
||||
# default and in no profile, so these usually don't exist.
|
||||
skills/higgsfield-*
|
||||
|
||||
# Context7 docs-lookup skill — installed by `ctx7 setup --claude --cli`
|
||||
# (install-plugins.sh Step 6, when absent) into ~/.claude/skills (a symlink to
|
||||
# this repo's skills/). ctx7-managed and re-created on demand — not vendored here.
|
||||
@@ -115,9 +35,6 @@ skills/find-docs/
|
||||
# symlink to this repo's rules/). ctx7-managed — not vendored here.
|
||||
rules/context7.md
|
||||
|
||||
# Staging area used by lib/toggle-external.sh when disabling a tool
|
||||
skills-disabled/
|
||||
|
||||
# Local project config (per-machine, not shared)
|
||||
.claude/*
|
||||
!.claude/tasks/
|
||||
@@ -184,8 +101,6 @@ desktop.ini
|
||||
.idea/
|
||||
.vscode/
|
||||
|
||||
# Profile cache — written by lib/profile.sh, read by hooks/statusline.sh
|
||||
.active-profile
|
||||
.gstack/
|
||||
|
||||
# Frontend Design (Anthropic) — installed/refreshed from the example-skills
|
||||
|
||||
@@ -269,14 +269,14 @@ For web projects, dispatch in **a single message with two parallel Agent calls**
|
||||
|
||||
| Audit (web) | Subagent | Prompt template |
|
||||
|---------------|-------------------|-----------------|
|
||||
| SEO + GEO | `general-purpose` | "Read `~/.claude/skills/seo/SKILL.md` and execute it on this project. The /seo skill runs SEO + GEO in parallel and writes a unified report to `.claude/audits/SEO.md`. Run it in conservative mode: apply NOTHING, return the FIX BUNDLE (the handover main loop applies it — see 'Applying the bundle'). At the top of the report, the /seo skill MUST emit two distinct labeled score lines (already specified in its SKILL.md §1): `Score SEO (classique) : X.X / 20` and `Score GEO (IA) : X.X / 20`, plus the weighted global. The handover orchestrator parses SEO and GEO separately, so do not collapse them into a single `Score:` line. Return when the report file is written." |
|
||||
| SEO + GEO | `general-purpose` | "Read `~/.claude/skills/pack-seo/skills/seo/SKILL.md` and execute it on this project. The /seo skill runs SEO + GEO in parallel and writes a unified report to `.claude/audits/SEO.md`. Run it in conservative mode: apply NOTHING, return the FIX BUNDLE (the handover main loop applies it — see 'Applying the bundle'). At the top of the report, the /seo skill MUST emit two distinct labeled score lines (already specified in its SKILL.md §1): `Score SEO (classique) : X.X / 20` and `Score GEO (IA) : X.X / 20`, plus the weighted global. The handover orchestrator parses SEO and GEO separately, so do not collapse them into a single `Score:` line. Return when the report file is written." |
|
||||
| HARDEN | `general-purpose` | "Read `~/.claude/skills/harden/SKILL.md` and execute it on this project with `--fix` up to READY TO APPLY only: prepare the FIX BUNDLE (security headers, HSTS, CSP, HTTP→HTTPS redirects, canonical, 404 page), apply NOTHING — the handover main loop gates and applies it (see 'Applying the bundle'). Write report to `.claude/audits/HARDEN.md` with `Score: X/20` (or `X/100`) at the top. Return when the report file is written." |
|
||||
|
||||
Non-web variant:
|
||||
|
||||
| Audit (non-web) | Subagent | Prompt template |
|
||||
|-----------------|-------------------|-----------------|
|
||||
| CSO | `general-purpose` | "Read `~/.claude/skills/cso/SKILL.md` and execute in **daily mode** (8/10 confidence gate). Apply NOTHING: return the fixes as a FIX BUNDLE (gitignore additions and placeholder swaps tagged AUTO, dependency upgrades tagged GATED — the handover main loop applies AUTO and gates the rest, see 'Applying the bundle'). Write report to `.claude/audits/CSO.md` with `Score: X/20` (or `X/100`) at the top." |
|
||||
| CSO | `general-purpose` | "Read `~/.claude/skills/pack-gstack-dev/skills/cso/SKILL.md` and execute in **daily mode** (8/10 confidence gate). Apply NOTHING: return the fixes as a FIX BUNDLE (gitignore additions and placeholder swaps tagged AUTO, dependency upgrades tagged GATED — the handover main loop applies AUTO and gates the rest, see 'Applying the bundle'). Write report to `.claude/audits/CSO.md` with `Score: X/20` (or `X/100`) at the top." |
|
||||
|
||||
Wait for both subagents to complete (parallel return).
|
||||
|
||||
@@ -426,7 +426,7 @@ for CSO) in the format
|
||||
|
||||
Send to `general-purpose` subagent (`model: "fable"`, `effort="high"`):
|
||||
|
||||
> Read `~/.claude/skills/seo/SKILL.md` and re-run it on this project in
|
||||
> Read `~/.claude/skills/pack-seo/skills/seo/SKILL.md` and re-run it on this project in
|
||||
> **conservative (audit-only) intervention mode**: re-score and leave both
|
||||
> FIX BUNDLEs in `.claude/audits/SEO.md` ready-to-apply. Apply NOTHING and
|
||||
> ask the user NOTHING — the handover main loop is the dispatcher: it
|
||||
@@ -470,7 +470,7 @@ Send to `general-purpose` subagent (`model: "fable"`, `effort="high"`):
|
||||
|
||||
Send to `general-purpose` subagent (`model: "fable"`, `effort="high"`):
|
||||
|
||||
> Read `~/.claude/skills/cso/SKILL.md` and re-run it in **daily mode**.
|
||||
> Read `~/.claude/skills/pack-gstack-dev/skills/cso/SKILL.md` and re-run it in **daily mode**.
|
||||
> Previous score: **`<SCORE_CSO_PREVIOUS>`/20** — below threshold.
|
||||
> Iteration `<N>` of `<MAX_ITERATIONS>`. Apply NOTHING: return the fixes as
|
||||
> a FIX BUNDLE in `.claude/audits/CSO.md` — gitignore additions and secret
|
||||
@@ -679,7 +679,7 @@ VALIDATE as not-applicable rather than failed).
|
||||
|
||||
Dispatch `general-purpose` subagent (`model: "fable"`, `effort="high"`):
|
||||
|
||||
> Read `~/.claude/skills/web-validate/SKILL.md` and execute against the
|
||||
> Read `~/.claude/skills/pack-web-validate/skills/web-validate/SKILL.md` and execute against the
|
||||
> deployed URL: `<DEPLOYED_URL>`. Audit W3C HTML validity (validator.nu),
|
||||
> W3C CSS validity (jigsaw.w3.org), WCAG 2.1 a11y (axe-core, pa11y).
|
||||
> Apply NOTHING (the client controls deploy; the handover main loop applies
|
||||
|
||||
@@ -219,7 +219,7 @@ RULE: IF "monorepo" signal detected:
|
||||
|
||||
RULE: IF "frontend" signal OR .tsx/.jsx count > 0:
|
||||
→ ui-ux-pro-max ON if "design-system" signal (~400t)
|
||||
→ impeccable ON (external skill, 0t passive — ~/.claude/skills/impeccable)
|
||||
→ impeccable ON (external skill, 0t passive — ~/.claude/skills/pack-design/skills/impeccable)
|
||||
→ design-motion-principles ON if anim-lib-installed or description mentions animation/motion (external, 0t passive)
|
||||
|
||||
RULE: IF "deploy" AND "browser-qa" signals:
|
||||
|
||||
+11
-11
@@ -749,10 +749,10 @@ else
|
||||
fi
|
||||
fi
|
||||
# Symlink handled by link.sh
|
||||
if [ -L "$HOME/.claude/skills/emil-design-eng" ]; then
|
||||
ok "emil-design-eng symlink OK"
|
||||
if [ -L "$HOME/.claude/skills/pack-design/skills/emil-design-eng" ]; then
|
||||
ok "emil-design-eng linked by pack-design"
|
||||
else
|
||||
info "Symlinking — will be created by link.sh"
|
||||
info "pack-design link not present yet (git checkout)"
|
||||
fi
|
||||
echo ""
|
||||
|
||||
@@ -774,10 +774,10 @@ else
|
||||
warn "frontend-design: anthropic-agent-skills plugin not cached — install via: claude plugin install example-skills@anthropic-agent-skills"
|
||||
fi
|
||||
fi
|
||||
if [ -L "$HOME/.claude/skills/frontend-design" ]; then
|
||||
ok "frontend-design symlink OK"
|
||||
if [ -L "$HOME/.claude/skills/pack-design/skills/frontend-design" ]; then
|
||||
ok "frontend-design linked by pack-design"
|
||||
else
|
||||
info "Symlinking — will be created by link.sh"
|
||||
info "pack-design link not present yet (git checkout)"
|
||||
fi
|
||||
echo ""
|
||||
|
||||
@@ -790,10 +790,10 @@ if [ -f "$DMP_DIR/SKILL.md" ]; then
|
||||
else
|
||||
warn "design-motion-principles: not installed — clone from https://github.com/kylezantos/design-motion-principles"
|
||||
fi
|
||||
if [ -L "$HOME/.claude/skills/design-motion-principles" ]; then
|
||||
ok "design-motion-principles symlink OK"
|
||||
if [ -L "$HOME/.claude/skills/pack-design/skills/design-motion-principles" ]; then
|
||||
ok "design-motion-principles linked by pack-design"
|
||||
else
|
||||
info "Symlinking — will be created by link.sh"
|
||||
info "pack-design link not present yet (git checkout)"
|
||||
fi
|
||||
echo ""
|
||||
|
||||
@@ -1323,8 +1323,8 @@ echo " 🔄 higgsfield pack — Higgsfield CLI media skills (image, video
|
||||
echo ""
|
||||
echo " All plugins installed at: user scope (~/.claude/plugins/)"
|
||||
echo " GStack skills symlinked individually into ~/.claude/skills/ (→ submodule)"
|
||||
echo " Emil Design Eng at: ~/.claude/skills/emil-design-eng/ (symlink → skills-external)"
|
||||
echo " Frontend Design at: ~/.claude/skills/frontend-design/ (symlink → skills-external)"
|
||||
echo " Emil Design Eng at: ~/.claude/skills/pack-design/skills/emil-design-eng/ (symlink → skills-external)"
|
||||
echo " Frontend Design at: ~/.claude/skills/pack-design/skills/frontend-design/ (symlink → skills-external)"
|
||||
echo " Design Motion Principles at: ~/.claude/skills/design-motion-principles/ (symlink → skills-external)"
|
||||
echo " Agent Skills trio at: ~/.claude/skills/{observability-and-instrumentation,deprecation-and-migration,ci-cd-and-automation}/ (symlink → skills-external)"
|
||||
echo " Mengto scroll skills at: ~/.claude/skills/{scroll-world-storytelling,build-threejs-scroll-worlds,scroll-scrubbed-visual-sequence,scroll-scrubbed-word-reveal,scroll-progress-timeline}/ (symlink → skills-external)"
|
||||
|
||||
@@ -26,10 +26,11 @@ detect_superpowers() {
|
||||
# --- Toggle plugins ---
|
||||
|
||||
detect_gstack() {
|
||||
# gstack is exposed via per-skill symlinks (browse, canary, qa, …);
|
||||
# gstack is exposed via per-skill symlinks in pack-gstack-* (browse, canary, qa, …);
|
||||
# the legacy top-level symlink was removed to avoid duplicate entries.
|
||||
# Detect by checking any of its individual skills.
|
||||
[ -L "$HOME/.claude/skills/browse" ] || [ -L "$HOME/.claude/skills/qa" ]
|
||||
[ -L "$HOME/.claude/skills/pack-gstack-browser/skills/browse" ] \
|
||||
|| [ -L "$HOME/.claude/skills/pack-gstack-browser/skills/qa" ]
|
||||
}
|
||||
|
||||
detect_gsd() {
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
ship
|
||||
land-and-deploy
|
||||
setup-deploy
|
||||
autoplan
|
||||
context-save
|
||||
learn
|
||||
careful
|
||||
guard
|
||||
design-shotgun
|
||||
+7
-67
@@ -2,11 +2,11 @@
|
||||
# ============================================================
|
||||
# lib/gstack-removed.sh — the gstack skills this config never exposes
|
||||
#
|
||||
# Single source for the denylist. Sourced by lib/profile.sh
|
||||
# (enable_all_gstack, enable_skill) and lib/toggle-external.sh
|
||||
# (`enable gstack`), read by lib/tests/profile-census.test.sh. A name
|
||||
# listed here is in no profile, `max` included, and every "bring gstack
|
||||
# back" path skips it. Decided 2026-09-28 (skill-catalog prune, user go):
|
||||
# The denylist itself lives in gstack-removed.list (one name per line),
|
||||
# read here into GSTACK_REMOVED and by lib/pack-census.sh. A name listed is
|
||||
# in no pack and no profile, `max` included. Pruned 2026-09-28 (BDR-105),
|
||||
# helpers housed here per BDR-117, retired with the symlink toggling.
|
||||
# Why each name went:
|
||||
#
|
||||
# ship base = origin/HEAD = main on Gitea, skips develop
|
||||
# land-and-deploy `gh pr merge --squash --delete-branch` then deploys
|
||||
@@ -19,67 +19,7 @@
|
||||
# house permissions.deny is stricter (BDR-095)
|
||||
# design-shotgun mockups need OPENAI_API_KEY, absent
|
||||
#
|
||||
# Also hosts the gstack helpers the two scripts share (gstack_skills and
|
||||
# the park/unpark moves below). They live in this file because it is the
|
||||
# only one the fixture suites copy next to profile.sh / toggle-external.sh:
|
||||
# a new sourced file would be missing there. Each takes its directories as
|
||||
# arguments (no reliance on the caller's globals).
|
||||
#
|
||||
# No `set -euo pipefail` here (sourced lib, mirrors lib/detect-plugins.sh).
|
||||
# No `set -euo pipefail` here (sourced lib).
|
||||
# ============================================================
|
||||
|
||||
GSTACK_REMOVED=(ship land-and-deploy setup-deploy autoplan context-save
|
||||
learn careful guard design-shotgun)
|
||||
|
||||
# gstack_is_removed <name> — exit 0 when <name> is on the denylist.
|
||||
gstack_is_removed() {
|
||||
local name="$1" entry
|
||||
for entry in "${GSTACK_REMOVED[@]}"; do
|
||||
[ "$entry" = "$name" ] && return 0
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
# gstack_skills <gstack_src> — prints the directory basenames under
|
||||
# <gstack_src>/*/ that hold a SKILL.md; nothing when the dir is absent.
|
||||
# Source of truth for "which skills belong to gstack".
|
||||
gstack_skills() {
|
||||
local src="$1" d
|
||||
[ -d "$src" ] || return 0
|
||||
for d in "$src"/*/; do
|
||||
[ -f "${d}SKILL.md" ] || continue
|
||||
basename "$d"
|
||||
done
|
||||
}
|
||||
|
||||
# gstack_parked_names <disabled_dir> — prints <name> for every
|
||||
# <disabled_dir>/gstack__<name> entry (a dangling symlink is skipped).
|
||||
gstack_parked_names() {
|
||||
local entry
|
||||
[ -d "$1" ] || return 0
|
||||
for entry in "$1"/gstack__*; do
|
||||
[ -e "$entry" ] || continue
|
||||
basename "$entry" | sed 's/^gstack__//'
|
||||
done
|
||||
}
|
||||
|
||||
# gstack_park <skills_dir> <disabled_dir> <name> — moves skills/<name> to
|
||||
# skills-disabled/gstack__<name>. A stale destination is clobbered first:
|
||||
# gstack ./setup creates skills/<name>/ as directories, so mv onto an
|
||||
# existing dir would nest it (gstack__<name>/<name>/) instead of renaming.
|
||||
# Content is symlinks to the submodule, `gstack ./setup` regenerates it.
|
||||
# Call as a plain statement (never `|| …`, `if`, `!`): errexit must stay on.
|
||||
gstack_park() {
|
||||
local skills_dir="$1" disabled_dir="$2" name="$3"
|
||||
rm -rf "$disabled_dir/gstack__$name"
|
||||
mv "$skills_dir/$name" "$disabled_dir/gstack__$name"
|
||||
}
|
||||
|
||||
# gstack_unpark <skills_dir> <disabled_dir> <name> — moves
|
||||
# skills-disabled/gstack__<name> back to skills/<name>, replacing whatever
|
||||
# sits there. Same plain-statement rule as gstack_park.
|
||||
gstack_unpark() {
|
||||
local skills_dir="$1" disabled_dir="$2" name="$3"
|
||||
rm -rf "${skills_dir:?}/${name:?}"
|
||||
mv "$disabled_dir/gstack__$name" "$skills_dir/$name"
|
||||
}
|
||||
mapfile -t GSTACK_REMOVED < "$(dirname "${BASH_SOURCE[0]}")/gstack-removed.list"
|
||||
@@ -4,9 +4,8 @@
|
||||
#
|
||||
# Sourced by install-plugins.sh (Step 8.6), update-all.sh (7.3b) and
|
||||
# doctor.sh. The pack is machine-owned: cloned from upstream and moved
|
||||
# into skills-external/higgsfield-* (gitignored), then linked on demand by
|
||||
# lib/toggle-external.sh. It is listed in neither link.sh nor any profile:
|
||||
# either would re-enable a parked pack on every run (BDR-093).
|
||||
# into skills-external/higgsfield-* (gitignored), then linked by
|
||||
# skills/pack-higgsfield (`profile.sh enable higgsfield`).
|
||||
# ============================================================
|
||||
|
||||
# Upstream skills repo, single source for both installers. An env value
|
||||
@@ -38,8 +37,8 @@ _higgsfield_adopt() {
|
||||
# The stage sits next to the destination, on the same filesystem, so each
|
||||
# replacement is a rename. Prints the number of skills synced. Returns 1,
|
||||
# existing copies untouched, when the clone fails or upstream holds no
|
||||
# higgsfield-*/SKILL.md. A parked skill (skills-disabled/<name>, a symlink
|
||||
# to the source path) stays parked. Known limit: a skill that upstream
|
||||
# higgsfield-*/SKILL.md. Linked by skills/pack-higgsfield (`profile.sh
|
||||
# enable higgsfield`), never touched here. Known limit: a skill that upstream
|
||||
# removes or renames keeps its last local copy.
|
||||
higgsfield_sync_skills() {
|
||||
local dest="$1/skills-external" stage count=0
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
# 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.
|
||||
def name_of: input_filename | sub(".*/"; "");
|
||||
def dn: [(.deniedMcpServers // [])[] | .serverName] | sort;
|
||||
[inputs | {f: name_of, frag: .}] as $all
|
||||
| ($all[] | select(.f == "full.json") | .frag) as $full
|
||||
| ($full.enabledPlugins | keys) as $keys
|
||||
| ($deny | split(" ") | map(. + ".json")) as $deny_files
|
||||
| ($m | map({key: .id, value: .on}) | from_entries) as $mdef
|
||||
| $all[]
|
||||
| .f as $f | .frag as $g
|
||||
| ( if ($g.enabledPlugins | keys) != $keys
|
||||
then "RED lib/profiles/\($f): key set differs from full.json"
|
||||
else empty end ),
|
||||
( ["model-router@skills-dir", "security-guidance@claude-code-plugins"][]
|
||||
| select($g.enabledPlugins[.] != true)
|
||||
| "RED lib/profiles/\($f): \(.) must be true" ),
|
||||
( ["example-skills@anthropic-agent-skills", "brightdata-plugin@synced"][]
|
||||
| select($g.enabledPlugins[.] != false)
|
||||
| "RED lib/profiles/\($f): \(.) must be false" ),
|
||||
( (["claude.ai higgsfield", "claude.ai Higgsfield AI"] | sort) as $both
|
||||
| if (($deny_files | index($f)) != null) and (($g | dn) != $both)
|
||||
then "RED lib/profiles/\($f): must deny both higgsfield connectors"
|
||||
elif (($deny_files | index($f)) == null) and (($g | dn) | length) > 0
|
||||
then "RED lib/profiles/\($f): must deny no connector"
|
||||
else empty end ),
|
||||
( if $f == "full.json" then
|
||||
($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 )
|
||||
Executable
+130
@@ -0,0 +1,130 @@
|
||||
#!/usr/bin/env bash
|
||||
# shellcheck disable=SC2088 # the literal "~/.claude/skills" is a grep pattern
|
||||
# ============================================================
|
||||
# lib/pack-census.sh — census of the pack layout and its readers
|
||||
#
|
||||
# Packs are skills-dir plugins `skills/pack-<n>/` (manifest
|
||||
# `.claude-plugin/plugin.json`, entries `skills/<s>` = tracked relative
|
||||
# symlinks into skills-external/ or real dirs). Checks:
|
||||
# 1. manifest parses, name = folder; every entry resolves (dangling =
|
||||
# WARN; RED with --installed on a pack ON by manifest); no skill both
|
||||
# flat and in a pack; no retired gstack name (lib/gstack-removed.list).
|
||||
# 2. fragments lib/profiles/*.json: same key set as full.json; model-router
|
||||
# + security-guidance true, example-skills + brightdata false
|
||||
# everywhere; the two higgsfield connectors denied on exactly
|
||||
# DENY_PROFILES; full.json packs = manifest defaults.
|
||||
# 3. no reader of the old layout left (scope and terms in check_citers).
|
||||
# Shared by make test (lib/tests/pack-census.test.sh) and doctor.sh.
|
||||
# Prints RED/WARN lines, then `PACKS OK <p> packs <s> skills` when no RED.
|
||||
# Exit: 0 clean or WARN only · 1 any RED.
|
||||
# Usage: pack-census.sh [--repo <dir>] [--installed]
|
||||
# ============================================================
|
||||
set -euo pipefail
|
||||
|
||||
REPO="$(cd -P "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
INSTALLED=0
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
--repo) REPO="$2"; shift 2 ;;
|
||||
--installed) INSTALLED=1; shift ;;
|
||||
*) echo "pack-census: unknown option $1" >&2; exit 2 ;;
|
||||
esac
|
||||
done
|
||||
SKILLS="$REPO/skills"
|
||||
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
|
||||
red=0; packs=0; skills=0
|
||||
declare -A seen
|
||||
red() { echo "RED $*"; red=1; }
|
||||
|
||||
pack_on() {
|
||||
jq -e '.defaultEnabled != false' "$1/.claude-plugin/plugin.json" >/dev/null
|
||||
}
|
||||
|
||||
check_manifest() { # $1 pack dir
|
||||
local n m name; n="$(basename "$1")"; m="$1/.claude-plugin/plugin.json"
|
||||
[ -f "$m" ] || { red "$n: no .claude-plugin/plugin.json"; return; }
|
||||
jq -e . "$m" >/dev/null 2>&1 || { red "$n: manifest is not JSON"; return; }
|
||||
name="$(jq -r '.name // ""' "$m")"
|
||||
[ "$name" = "$n" ] || red "$n: manifest name is $name"
|
||||
}
|
||||
|
||||
check_entry() { # $1 pack dir, $2 entry path
|
||||
local n s; n="$(basename "$1")"; s="$(basename "$2")"
|
||||
if [ ! -e "$2/SKILL.md" ]; then
|
||||
if [ "$INSTALLED" = 1 ] && pack_on "$1"; then
|
||||
red "$n: $s target missing (pack ON)"
|
||||
else echo "WARN $n: $s target missing (installer not run)"; fi
|
||||
fi
|
||||
[ -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)"
|
||||
else seen[$s]="$n"; fi
|
||||
skills=$((skills+1))
|
||||
}
|
||||
|
||||
check_fragments() {
|
||||
local files=("$PROFILES"/*.json) full="$PROFILES/full.json" out
|
||||
[ -f "$full" ] || { red "lib/profiles/full.json missing"; return; }
|
||||
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; }
|
||||
}
|
||||
|
||||
manifests_json() { # [{id, on}] for every pack manifest
|
||||
jq -cn '[inputs | {id: (.name + "@skills-dir"),
|
||||
on: (.defaultEnabled != false)}]' \
|
||||
"$SKILLS"/pack-*/.claude-plugin/plugin.json 2>/dev/null || echo '[]'
|
||||
}
|
||||
|
||||
# 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.
|
||||
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")
|
||||
done
|
||||
hit="$( { grep -rno --include='*.sh' --include='*.md' --include='*.py' \
|
||||
--include='*.json' --include='Makefile' "${args[@]}" "$REPO"/hooks \
|
||||
"$REPO"/lib "$REPO"/agents "$REPO"/skills "$REPO"/rules \
|
||||
"$REPO"/templates "$REPO"/mods "$REPO"/*.sh "$REPO"/CLAUDE.global.md \
|
||||
"$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)"
|
||||
[ -n "$hit" ] || return 0
|
||||
while IFS=$'\t' read -r f m; do
|
||||
red "${f#"$REPO"/} cites $m"
|
||||
done <<<"$hit"
|
||||
}
|
||||
|
||||
main() {
|
||||
local d s p e names=()
|
||||
[ -f "$REMOVED" ] || red "lib/gstack-removed.list missing"
|
||||
for d in "$SKILLS"/*/; do
|
||||
d="${d%/}"; s="$(basename "$d")"
|
||||
case "$s" in pack-*) continue ;; esac
|
||||
[ -e "$d/SKILL.md" ] && seen[$s]="skills/$s"
|
||||
done
|
||||
for p in "$SKILLS"/pack-*/; do
|
||||
p="${p%/}"; packs=$((packs+1)); check_manifest "$p"
|
||||
for e in "$p"/skills/*; do
|
||||
[ -e "$e" ] || [ -L "$e" ] || continue
|
||||
check_entry "$p" "$e"; names+=("$(basename "$e")")
|
||||
done
|
||||
done
|
||||
check_fragments
|
||||
[ "${#names[@]}" -gt 0 ] && check_citers "${names[@]}"
|
||||
[ "$red" -eq 0 ] && echo "PACKS OK $packs packs $skills skills"
|
||||
exit "$red"
|
||||
}
|
||||
main
|
||||
@@ -0,0 +1,70 @@
|
||||
# lib/profile-state.jq — effective profile state of one project and
|
||||
# conversation, in one pass (lib/profile.sh `current`, `unset`).
|
||||
# Args: $u $p $l $f raw settings files (user, project, local, --settings;
|
||||
# "" when absent), $cj raw ~/.claude.json, $m manifests [{id,on}],
|
||||
# $mode "plain" | "human" | "json", $proj project dir, $flagname CLAUDE_PROFILE
|
||||
# or "-", $hasflag "1" when a --settings file is in force.
|
||||
# inputs = lib/profiles/*.json (one fragment per file).
|
||||
def parse: try fromjson catch {};
|
||||
def name_of: input_filename | sub(".*/"; "") | sub("\\.json$"; "");
|
||||
def ep: (.enabledPlugins // {});
|
||||
def dn: [(.deniedMcpServers // [])[] | .serverName];
|
||||
def onoff: if . then "on" else "off" end;
|
||||
def is_pack: startswith("pack-") and endswith("@skills-dir");
|
||||
def short: sub("@skills-dir$"; "");
|
||||
def src_word($s):
|
||||
if $s.source == "flag" then "conv \($s.flag)" else $s.source end;
|
||||
def listing($plugins; $on):
|
||||
[$plugins | to_entries[] | select(.value == $on) | .key | short]
|
||||
| if length == 0 then "none" else join(" ") end;
|
||||
|
||||
[inputs | {name: name_of, frag: .}] as $profiles
|
||||
| ($u | parse) as $U | ($p | parse) as $P
|
||||
| ($l | parse) as $L | ($f | parse) as $F
|
||||
| ([$profiles[].frag | ep | keys[]] | unique) as $ids
|
||||
| ($m | map({key: .id, value: .on}) | from_entries) as $mdef
|
||||
| ($ids | map({key: ., value: ($mdef[.]
|
||||
// (if endswith("@skills-dir") and (is_pack | not) then true
|
||||
else false end))}) | from_entries) as $d
|
||||
| (($d + ($U|ep) + ($P|ep) + ($L|ep) + ($F|ep))
|
||||
| with_entries(select(.key as $k | $d | has($k)))) as $plugins
|
||||
| ((($U|dn) + ($P|dn) + ($L|dn) + ($F|dn)) | unique) as $denied
|
||||
| ([$U, $P, $L, $F] | any(.disableClaudeAiConnectors == true)) as $all
|
||||
| ($F.model // $L.model // $P.model // $U.model // "-") as $model
|
||||
| (if ($F | has("model")) then "flag" elif ($L | has("model")) then "local"
|
||||
elif ($P | has("model")) then "project"
|
||||
elif ($U | has("model")) then "user" else "-" end) as $msrc
|
||||
| (if $hasflag == "1" then "flag"
|
||||
elif ((($L|ep) | length) + (($L|dn) | length)) > 0 then "local"
|
||||
else "default" end) as $src
|
||||
| (try ($cj | fromjson | .projects[$proj].disabledMcpServers // []
|
||||
| if length == 0 then "-" else join(",") end)
|
||||
catch (if $cj == "" then "-" else "unknown" end)) as $off
|
||||
| ([$profiles[] | select((.frag | ep) == $plugins
|
||||
and ((.frag | dn | sort) == ($denied | sort)) and ($all | not))
|
||||
| .name] | .[0] // "custom") as $name
|
||||
| {name: $name, source: $src, flag: $flagname, plugins: $plugins,
|
||||
denied: $denied, all_denied: $all, model: $model, model_source: $msrc,
|
||||
mcp_off: $off} as $s
|
||||
| if $mode == "json" then $s
|
||||
elif $mode == "plain" then
|
||||
( ["profile=\($s.name)", "source=\($s.source)", "flag=\($s.flag)"]
|
||||
+ [$plugins | to_entries | sort_by(.key)[] | select(.key | is_pack)
|
||||
| "\(.key | short)=\(.value | onoff)"]
|
||||
+ [$plugins | to_entries | sort_by(.key)[]
|
||||
| select(.key | is_pack | not) | "plugin:\(.key)=\(.value | onoff)"]
|
||||
+ [$denied[] | "connector:\(.)=denied"]
|
||||
+ (if $all then ["connector:*=denied"] else [] end)
|
||||
+ ["model=\($s.model)", "model-source=\($s.model_source)",
|
||||
"mcp-off=\($s.mcp_off)"] ) | .[]
|
||||
else
|
||||
( [ (if $s.mcp_off != "-"
|
||||
then "profile: custom (off: \($s.mcp_off)) [\(src_word($s))]"
|
||||
else "profile: \($s.name) [\(src_word($s))]" end),
|
||||
" on : \(listing($plugins; true))",
|
||||
" off: \(listing($plugins; false))",
|
||||
" connectors denied: \(if $all then "all"
|
||||
elif ($denied | length) == 0 then "none"
|
||||
else ($denied | join(", ")) end)",
|
||||
" model: \($s.model) (\($s.model_source))" ] ) | .[]
|
||||
end
|
||||
+251
-816
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,34 @@
|
||||
# Profiles
|
||||
|
||||
A profile is a literal Claude Code settings fragment: `enabledPlugins`
|
||||
(every pack `pack-<n>@skills-dir` and managed plugin, explicit), optional
|
||||
`deniedMcpServers` (the two higgsfield claude.ai connectors), optional
|
||||
`model`. Per project: `bash ~/.claude/lib/profile.sh set <name>` writes it
|
||||
into `.claude/settings.local.json`, then `/reload-plugins`. Per
|
||||
conversation: `cc <session> <name>` (lib/cc.sh) runs
|
||||
`claude --settings lib/profiles/<name>.json`; that conversation is frozen
|
||||
(no reload brings a pack back; relaunch instead). No profile = the manifest
|
||||
defaults = `full` with the connectors present. `deniedMcpServers` is a union
|
||||
across files: a `cc x web` over a project set to `dev` keeps the connectors
|
||||
denied; `set web` in the project brings them back next session.
|
||||
|
||||
`profile.sh list` reads these lines (format `- **name**: text`):
|
||||
|
||||
- **full**: every pack except higgsfield and extras; ui-ux-pro-max on; connectors present. The default.
|
||||
- **max**: everything on, pr-review-toolkit included; for a one-off session, not a project.
|
||||
- **minimal**: no pack, no design plugin, connectors denied; the smallest listing.
|
||||
- **dev**: gstack-dev only; backend or tooling work without UI.
|
||||
- **backend**: same packs as dev; kept as a name for backend projects.
|
||||
- **design**: design, scroll3d, gstack-design, gstack-browser, ui-ux-pro-max; connectors present.
|
||||
- **web**: design + scroll3d + web-validate + the three gstack packs + ui-ux-pro-max; public site work.
|
||||
- **web-full**: web + seo; a site with SEO/GEO on top.
|
||||
- **seo**: seo, web-validate, gstack-browser, gstack-dev; audit and fixes on a live site.
|
||||
- **qa**: gstack-browser + web-validate; dogfooding and conformance only.
|
||||
- **audit**: seo, web-validate, gstack-dev, gstack-browser, pr-review-toolkit; read-mostly audits.
|
||||
|
||||
Invariants (checked by `lib/pack-census.sh`): the same key set in every
|
||||
fragment; `model-router@skills-dir` and `security-guidance@claude-code-plugins`
|
||||
true everywhere; `example-skills@anthropic-agent-skills` and
|
||||
`brightdata-plugin@synced` false everywhere; the connectors denied on exactly
|
||||
minimal, dev, backend, seo, qa, audit; `full` equal to the manifest defaults.
|
||||
Add your own profile as another `<name>.json` with the same key set.
|
||||
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"enabledPlugins": {
|
||||
"model-router@skills-dir": true,
|
||||
"pack-design@skills-dir": false,
|
||||
"pack-scroll3d@skills-dir": false,
|
||||
"pack-seo@skills-dir": true,
|
||||
"pack-web-validate@skills-dir": true,
|
||||
"pack-gstack-dev@skills-dir": true,
|
||||
"pack-gstack-browser@skills-dir": true,
|
||||
"pack-gstack-design@skills-dir": false,
|
||||
"pack-higgsfield@skills-dir": false,
|
||||
"pack-extras@skills-dir": false,
|
||||
"ui-ux-pro-max@ui-ux-pro-max-skill": false,
|
||||
"security-guidance@claude-code-plugins": true,
|
||||
"pr-review-toolkit@claude-code-plugins": true,
|
||||
"example-skills@anthropic-agent-skills": false,
|
||||
"brightdata-plugin@synced": false
|
||||
},
|
||||
"deniedMcpServers": [
|
||||
{
|
||||
"serverName": "claude.ai higgsfield"
|
||||
},
|
||||
{
|
||||
"serverName": "claude.ai Higgsfield AI"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
# DESC: Comprehensive audit — security + SEO + GEO + W3C + perf + health
|
||||
# Activate when: doing a top-to-bottom audit pass on an existing project.
|
||||
# Wider than `seo` (adds security + dependency review).
|
||||
|
||||
# Security
|
||||
cso
|
||||
harden personal
|
||||
guardrails personal
|
||||
a11y personal
|
||||
analyze personal
|
||||
|
||||
# SEO / GEO / web standards
|
||||
seo personal
|
||||
geo personal
|
||||
web-validate personal
|
||||
|
||||
# Code + perf health
|
||||
health
|
||||
benchmark
|
||||
review
|
||||
|
||||
# Browser tooling for live audits
|
||||
browse
|
||||
open-gstack-browser
|
||||
|
||||
# Plugin: PR review toolkit (audit context for diffs)
|
||||
pr-review-toolkit plugin@claude-code-plugins
|
||||
|
||||
# CLI: graphify for code structure
|
||||
graphify cli
|
||||
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"enabledPlugins": {
|
||||
"model-router@skills-dir": true,
|
||||
"pack-design@skills-dir": false,
|
||||
"pack-scroll3d@skills-dir": false,
|
||||
"pack-seo@skills-dir": false,
|
||||
"pack-web-validate@skills-dir": false,
|
||||
"pack-gstack-dev@skills-dir": true,
|
||||
"pack-gstack-browser@skills-dir": false,
|
||||
"pack-gstack-design@skills-dir": false,
|
||||
"pack-higgsfield@skills-dir": false,
|
||||
"pack-extras@skills-dir": false,
|
||||
"ui-ux-pro-max@ui-ux-pro-max-skill": false,
|
||||
"security-guidance@claude-code-plugins": true,
|
||||
"pr-review-toolkit@claude-code-plugins": false,
|
||||
"example-skills@anthropic-agent-skills": false,
|
||||
"brightdata-plugin@synced": false
|
||||
},
|
||||
"deniedMcpServers": [
|
||||
{
|
||||
"serverName": "claude.ai higgsfield"
|
||||
},
|
||||
{
|
||||
"serverName": "claude.ai Higgsfield AI"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
# DESC: Backend / API / system dev — no design, no SEO, focused on logic
|
||||
# Activate when: building backend services, APIs, CLIs, libraries, system
|
||||
# code, data pipelines. UI/visual work is out of scope. SEO/GEO out of scope.
|
||||
|
||||
# Code work — primary
|
||||
feat personal
|
||||
ship-feature personal
|
||||
hotfix personal
|
||||
bugfix personal
|
||||
investigate
|
||||
refactor personal
|
||||
code-clean personal
|
||||
commit-change personal
|
||||
analyze personal
|
||||
|
||||
# Dev-lifecycle skills (agent-skills trio)
|
||||
observability-and-instrumentation external
|
||||
deprecation-and-migration external
|
||||
ci-cd-and-automation external
|
||||
|
||||
# Review
|
||||
review
|
||||
|
||||
# Second opinion for hard problems
|
||||
codex
|
||||
|
||||
# Security + health (always relevant for backend)
|
||||
cso
|
||||
guardrails personal
|
||||
health
|
||||
|
||||
# Session hygiene
|
||||
freeze
|
||||
unfreeze
|
||||
retro
|
||||
|
||||
# pr-review-toolkit removed (audit 2026-07-02 #12 — ~2.2k tokens, PR-only):
|
||||
# enable per PR session via `bash lib/profile.sh apply audit` or
|
||||
# claude plugin enable pr-review-toolkit@claude-code-plugins
|
||||
|
||||
# CLIs (advisory)
|
||||
ctx7 cli
|
||||
gsd cli
|
||||
graphify cli
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"enabledPlugins": {
|
||||
"model-router@skills-dir": true,
|
||||
"pack-design@skills-dir": true,
|
||||
"pack-scroll3d@skills-dir": true,
|
||||
"pack-seo@skills-dir": false,
|
||||
"pack-web-validate@skills-dir": false,
|
||||
"pack-gstack-dev@skills-dir": false,
|
||||
"pack-gstack-browser@skills-dir": true,
|
||||
"pack-gstack-design@skills-dir": true,
|
||||
"pack-higgsfield@skills-dir": false,
|
||||
"pack-extras@skills-dir": false,
|
||||
"ui-ux-pro-max@ui-ux-pro-max-skill": true,
|
||||
"security-guidance@claude-code-plugins": true,
|
||||
"pr-review-toolkit@claude-code-plugins": false,
|
||||
"example-skills@anthropic-agent-skills": false,
|
||||
"brightdata-plugin@synced": false
|
||||
}
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
# DESC: Design work — visual QA, design systems, mockups, polish
|
||||
# Activate when: building/reviewing UI, picking aesthetics, design tokens.
|
||||
# Companion CLIs (advisory): graphify (visual structure).
|
||||
#
|
||||
# Gate scope (design-tool-gate.sh): only the tools on the GATE-BLOCK lines
|
||||
# below trip the design gate. The rest of this profile (browser/plan/shotgun
|
||||
# tooling, graphify) is bundled for convenience but never blocks. Keep these
|
||||
# lines in sync when adding/removing a core design tool.
|
||||
# GATE-BLOCK: impeccable ui-ux-pro-max emil-design-eng design-html
|
||||
# GATE-BLOCK: design-motion-principles design-review design-consultation
|
||||
# GATE-BLOCK: 21st 21st-ui-build
|
||||
|
||||
# Core design skills (gstack)
|
||||
design-review
|
||||
design-consultation
|
||||
design-html
|
||||
plan-design-review
|
||||
|
||||
# Browser tooling — design-review relies on it
|
||||
browse
|
||||
open-gstack-browser
|
||||
setup-browser-cookies
|
||||
|
||||
# Plan-mode review companion (taste decisions before code)
|
||||
plan-ceo-review
|
||||
|
||||
# External: design skills
|
||||
emil-design-eng external
|
||||
frontend-design external
|
||||
design-motion-principles external
|
||||
impeccable external
|
||||
|
||||
# External: Mengto scroll-choreography skills (curl, commit-pinned)
|
||||
scroll-world-storytelling external
|
||||
build-threejs-scroll-worlds external
|
||||
scroll-scrubbed-visual-sequence external
|
||||
scroll-scrubbed-word-reveal external
|
||||
scroll-progress-timeline external
|
||||
|
||||
# Personal: motion implementation companion (skills/site-motion)
|
||||
site-motion personal
|
||||
|
||||
# External: 21st.dev pack — CLI-driven (no MCP, no API key). 21st-registry
|
||||
# and 21st-design-sync are publishing flows; installed but left parked.
|
||||
21st-ui-build external
|
||||
21st-cli-use external
|
||||
|
||||
# Plugin (auto-toggle)
|
||||
ui-ux-pro-max plugin@ui-ux-pro-max-skill
|
||||
|
||||
# CLIs (advisory only — installed/not-installed)
|
||||
# 21st is NOT advisory: it is on the GATE-BLOCK list, so a missing CLI trips
|
||||
# the design gate. Install: npm i -g @21st-dev/cli then 21st login
|
||||
21st cli
|
||||
graphify cli
|
||||
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"enabledPlugins": {
|
||||
"model-router@skills-dir": true,
|
||||
"pack-design@skills-dir": false,
|
||||
"pack-scroll3d@skills-dir": false,
|
||||
"pack-seo@skills-dir": false,
|
||||
"pack-web-validate@skills-dir": false,
|
||||
"pack-gstack-dev@skills-dir": true,
|
||||
"pack-gstack-browser@skills-dir": false,
|
||||
"pack-gstack-design@skills-dir": false,
|
||||
"pack-higgsfield@skills-dir": false,
|
||||
"pack-extras@skills-dir": false,
|
||||
"ui-ux-pro-max@ui-ux-pro-max-skill": false,
|
||||
"security-guidance@claude-code-plugins": true,
|
||||
"pr-review-toolkit@claude-code-plugins": false,
|
||||
"example-skills@anthropic-agent-skills": false,
|
||||
"brightdata-plugin@synced": false
|
||||
},
|
||||
"deniedMcpServers": [
|
||||
{
|
||||
"serverName": "claude.ai higgsfield"
|
||||
},
|
||||
{
|
||||
"serverName": "claude.ai Higgsfield AI"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
# DESC: Daily code work — small features, fixes, refactor, ship (any stack)
|
||||
# Activate when: implementing features, debugging, shipping PRs without a
|
||||
# specific frontend or backend bias. Lighter than `backend` (no security audit
|
||||
# baggage) and lighter than `web` (no design pipeline).
|
||||
|
||||
# Implementation
|
||||
feat personal
|
||||
ship-feature personal
|
||||
|
||||
# Bug fixing
|
||||
hotfix personal
|
||||
bugfix personal
|
||||
investigate
|
||||
|
||||
# Code health
|
||||
review
|
||||
refactor personal
|
||||
code-clean personal
|
||||
commit-change personal
|
||||
explain-diff personal
|
||||
guardrails personal
|
||||
a11y personal
|
||||
|
||||
# Dev-lifecycle skills (agent-skills trio)
|
||||
observability-and-instrumentation external
|
||||
deprecation-and-migration external
|
||||
ci-cd-and-automation external
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"enabledPlugins": {
|
||||
"model-router@skills-dir": true,
|
||||
"pack-design@skills-dir": true,
|
||||
"pack-scroll3d@skills-dir": true,
|
||||
"pack-seo@skills-dir": true,
|
||||
"pack-web-validate@skills-dir": true,
|
||||
"pack-gstack-dev@skills-dir": true,
|
||||
"pack-gstack-browser@skills-dir": true,
|
||||
"pack-gstack-design@skills-dir": true,
|
||||
"pack-higgsfield@skills-dir": false,
|
||||
"pack-extras@skills-dir": false,
|
||||
"ui-ux-pro-max@ui-ux-pro-max-skill": true,
|
||||
"security-guidance@claude-code-plugins": true,
|
||||
"pr-review-toolkit@claude-code-plugins": false,
|
||||
"example-skills@anthropic-agent-skills": false,
|
||||
"brightdata-plugin@synced": false
|
||||
}
|
||||
}
|
||||
@@ -1,104 +0,0 @@
|
||||
# DESC: Default profile — carries everything every other profile carries
|
||||
# (user rule 2026-09-28: full does what each profile does), minus the
|
||||
# broken or doctrine-breaking gstack skills (lib/gstack-removed.sh) and
|
||||
# the parked tools (make-pdf, diagram, 21st-ai/ui-explore/ui-review) that
|
||||
# live in `max`. One named exception: pr-review-toolkit (see below).
|
||||
|
||||
# === Brainstorm + plan-mode reviews ==================================
|
||||
office-hours
|
||||
plan-ceo-review
|
||||
plan-eng-review
|
||||
plan-design-review
|
||||
plan-devex-review
|
||||
spec
|
||||
|
||||
# === Design pipeline =================================================
|
||||
design-review
|
||||
design-consultation
|
||||
design-html
|
||||
|
||||
# === Browser + dogfooding ============================================
|
||||
browse
|
||||
open-gstack-browser
|
||||
setup-browser-cookies
|
||||
scrape
|
||||
skillify
|
||||
|
||||
# === Code work — implementation ======================================
|
||||
feat personal
|
||||
ship-feature personal
|
||||
hotfix personal
|
||||
bugfix personal
|
||||
investigate
|
||||
refactor personal
|
||||
code-clean personal
|
||||
commit-change personal
|
||||
|
||||
# === Review ===========================================================
|
||||
review
|
||||
|
||||
# === Second opinion ==================================================
|
||||
codex
|
||||
|
||||
# === SEO / GEO / standards / security ================================
|
||||
seo personal
|
||||
geo personal
|
||||
web-validate personal
|
||||
harden personal
|
||||
guardrails personal
|
||||
a11y personal
|
||||
analyze personal
|
||||
cso
|
||||
|
||||
# === Perf + canary + QA ==============================================
|
||||
health
|
||||
benchmark
|
||||
canary
|
||||
qa
|
||||
qa-only
|
||||
|
||||
# === Docs + translation ==============================================
|
||||
doc personal
|
||||
document-release
|
||||
pdf-translate personal
|
||||
explain-diff personal
|
||||
|
||||
# === Session hygiene + memory ========================================
|
||||
close personal
|
||||
prune-memory personal
|
||||
status personal
|
||||
retro
|
||||
freeze
|
||||
unfreeze
|
||||
|
||||
# === External + plugin + MCP =========================================
|
||||
emil-design-eng external
|
||||
frontend-design external
|
||||
design-motion-principles external
|
||||
impeccable external
|
||||
observability-and-instrumentation external
|
||||
deprecation-and-migration external
|
||||
ci-cd-and-automation external
|
||||
scroll-world-storytelling external
|
||||
build-threejs-scroll-worlds external
|
||||
scroll-scrubbed-visual-sequence external
|
||||
scroll-scrubbed-word-reveal external
|
||||
scroll-progress-timeline external
|
||||
ui-ux-pro-max plugin@ui-ux-pro-max-skill
|
||||
# pr-review-toolkit REMOVED from full (audit 2026-07-02 #12): heaviest
|
||||
# single plugin cost (~2.2k tokens of agent descriptions/session), useful
|
||||
# only when reviewing PRs. Reactivate per PR session:
|
||||
# claude plugin enable pr-review-toolkit@claude-code-plugins
|
||||
# or profile-based: bash lib/profile.sh apply audit (audit.profile keeps it;
|
||||
# a later `set full` re-disables it — MANAGED_PLUGINS lifecycle).
|
||||
21st-ui-build external
|
||||
21st-cli-use external
|
||||
|
||||
# Personal: motion implementation companion (skills/site-motion)
|
||||
site-motion personal
|
||||
|
||||
# === CLIs (advisory) =================================================
|
||||
21st cli
|
||||
ctx7 cli
|
||||
graphify cli
|
||||
gsd cli
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"enabledPlugins": {
|
||||
"model-router@skills-dir": true,
|
||||
"pack-design@skills-dir": true,
|
||||
"pack-scroll3d@skills-dir": true,
|
||||
"pack-seo@skills-dir": true,
|
||||
"pack-web-validate@skills-dir": true,
|
||||
"pack-gstack-dev@skills-dir": true,
|
||||
"pack-gstack-browser@skills-dir": true,
|
||||
"pack-gstack-design@skills-dir": true,
|
||||
"pack-higgsfield@skills-dir": true,
|
||||
"pack-extras@skills-dir": true,
|
||||
"ui-ux-pro-max@ui-ux-pro-max-skill": true,
|
||||
"security-guidance@claude-code-plugins": true,
|
||||
"pr-review-toolkit@claude-code-plugins": true,
|
||||
"example-skills@anthropic-agent-skills": false,
|
||||
"brightdata-plugin@synced": false
|
||||
}
|
||||
}
|
||||
@@ -1,105 +0,0 @@
|
||||
# DESC: Everything — full + the parked generation/review tools + PR review
|
||||
# SUPERSET-OF: full
|
||||
# Activate when: you need make-pdf, diagram, the 21st-ai/ui-explore/
|
||||
# ui-review generation trio, or pr-review-toolkit, on top of everything
|
||||
# full carries. Never a broken or doctrine-breaking gstack skill
|
||||
# (lib/gstack-removed.sh) — max is full's superset, not the raw catalog.
|
||||
|
||||
# === Brainstorm + plan-mode reviews ==================================
|
||||
office-hours
|
||||
plan-ceo-review
|
||||
plan-eng-review
|
||||
plan-design-review
|
||||
plan-devex-review
|
||||
spec
|
||||
|
||||
# === Design pipeline =================================================
|
||||
design-review
|
||||
design-consultation
|
||||
design-html
|
||||
|
||||
# === Browser + dogfooding ============================================
|
||||
browse
|
||||
open-gstack-browser
|
||||
setup-browser-cookies
|
||||
scrape
|
||||
skillify
|
||||
|
||||
# === Code work — implementation ======================================
|
||||
feat personal
|
||||
ship-feature personal
|
||||
hotfix personal
|
||||
bugfix personal
|
||||
investigate
|
||||
refactor personal
|
||||
code-clean personal
|
||||
commit-change personal
|
||||
|
||||
# === Review ===========================================================
|
||||
review
|
||||
|
||||
# === Second opinion ==================================================
|
||||
codex
|
||||
|
||||
# === SEO / GEO / standards / security ================================
|
||||
seo personal
|
||||
geo personal
|
||||
web-validate personal
|
||||
harden personal
|
||||
guardrails personal
|
||||
a11y personal
|
||||
analyze personal
|
||||
cso
|
||||
|
||||
# === Perf + canary + QA ==============================================
|
||||
health
|
||||
benchmark
|
||||
canary
|
||||
qa
|
||||
qa-only
|
||||
|
||||
# === Docs + translation ==============================================
|
||||
doc personal
|
||||
document-release
|
||||
diagram
|
||||
make-pdf
|
||||
pdf-translate personal
|
||||
explain-diff personal
|
||||
|
||||
# === Session hygiene + memory ========================================
|
||||
close personal
|
||||
prune-memory personal
|
||||
status personal
|
||||
retro
|
||||
freeze
|
||||
unfreeze
|
||||
|
||||
# === External + plugin + MCP =========================================
|
||||
emil-design-eng external
|
||||
frontend-design external
|
||||
design-motion-principles external
|
||||
impeccable external
|
||||
observability-and-instrumentation external
|
||||
deprecation-and-migration external
|
||||
ci-cd-and-automation external
|
||||
scroll-world-storytelling external
|
||||
build-threejs-scroll-worlds external
|
||||
scroll-scrubbed-visual-sequence external
|
||||
scroll-scrubbed-word-reveal external
|
||||
scroll-progress-timeline external
|
||||
ui-ux-pro-max plugin@ui-ux-pro-max-skill
|
||||
pr-review-toolkit plugin@claude-code-plugins
|
||||
21st-ui-build external
|
||||
21st-ui-explore external
|
||||
21st-ui-review external
|
||||
21st-cli-use external
|
||||
21st-ai external
|
||||
|
||||
# Personal: motion implementation companion (skills/site-motion)
|
||||
site-motion personal
|
||||
|
||||
# === CLIs (advisory) =================================================
|
||||
21st cli
|
||||
ctx7 cli
|
||||
graphify cli
|
||||
gsd cli
|
||||
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"enabledPlugins": {
|
||||
"model-router@skills-dir": true,
|
||||
"pack-design@skills-dir": false,
|
||||
"pack-scroll3d@skills-dir": false,
|
||||
"pack-seo@skills-dir": false,
|
||||
"pack-web-validate@skills-dir": false,
|
||||
"pack-gstack-dev@skills-dir": false,
|
||||
"pack-gstack-browser@skills-dir": false,
|
||||
"pack-gstack-design@skills-dir": false,
|
||||
"pack-higgsfield@skills-dir": false,
|
||||
"pack-extras@skills-dir": false,
|
||||
"ui-ux-pro-max@ui-ux-pro-max-skill": false,
|
||||
"security-guidance@claude-code-plugins": true,
|
||||
"pr-review-toolkit@claude-code-plugins": false,
|
||||
"example-skills@anthropic-agent-skills": false,
|
||||
"brightdata-plugin@synced": false
|
||||
},
|
||||
"deniedMcpServers": [
|
||||
{
|
||||
"serverName": "claude.ai higgsfield"
|
||||
},
|
||||
{
|
||||
"serverName": "claude.ai Higgsfield AI"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
# DESC: Strip all gstack skills (only essential personal skills + plugins remain)
|
||||
# Activate when: you want a quiet session with no gstack noise.
|
||||
#
|
||||
# Empty by design — `profile set minimal` disables every gstack skill,
|
||||
# leaves personal skills (analyze, doc, init-project, onboard, plugin-check,
|
||||
# refactor, seo, validate, harden, etc.) untouched, and makes no plugin/MCP
|
||||
# changes. To revert: `profile reset`.
|
||||
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"enabledPlugins": {
|
||||
"model-router@skills-dir": true,
|
||||
"pack-design@skills-dir": false,
|
||||
"pack-scroll3d@skills-dir": false,
|
||||
"pack-seo@skills-dir": false,
|
||||
"pack-web-validate@skills-dir": true,
|
||||
"pack-gstack-dev@skills-dir": false,
|
||||
"pack-gstack-browser@skills-dir": true,
|
||||
"pack-gstack-design@skills-dir": false,
|
||||
"pack-higgsfield@skills-dir": false,
|
||||
"pack-extras@skills-dir": false,
|
||||
"ui-ux-pro-max@ui-ux-pro-max-skill": false,
|
||||
"security-guidance@claude-code-plugins": true,
|
||||
"pr-review-toolkit@claude-code-plugins": false,
|
||||
"example-skills@anthropic-agent-skills": false,
|
||||
"brightdata-plugin@synced": false
|
||||
},
|
||||
"deniedMcpServers": [
|
||||
{
|
||||
"serverName": "claude.ai higgsfield"
|
||||
},
|
||||
{
|
||||
"serverName": "claude.ai Higgsfield AI"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
# DESC: QA + testing — site checks, perf, canary, validation
|
||||
# Activate when: running QA, checking deployed pages, perf regressions.
|
||||
|
||||
qa
|
||||
qa-only
|
||||
browse
|
||||
benchmark
|
||||
canary
|
||||
web-validate personal
|
||||
open-gstack-browser
|
||||
setup-browser-cookies
|
||||
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"enabledPlugins": {
|
||||
"model-router@skills-dir": true,
|
||||
"pack-design@skills-dir": false,
|
||||
"pack-scroll3d@skills-dir": false,
|
||||
"pack-seo@skills-dir": true,
|
||||
"pack-web-validate@skills-dir": true,
|
||||
"pack-gstack-dev@skills-dir": true,
|
||||
"pack-gstack-browser@skills-dir": true,
|
||||
"pack-gstack-design@skills-dir": false,
|
||||
"pack-higgsfield@skills-dir": false,
|
||||
"pack-extras@skills-dir": false,
|
||||
"ui-ux-pro-max@ui-ux-pro-max-skill": false,
|
||||
"security-guidance@claude-code-plugins": true,
|
||||
"pr-review-toolkit@claude-code-plugins": false,
|
||||
"example-skills@anthropic-agent-skills": false,
|
||||
"brightdata-plugin@synced": false
|
||||
},
|
||||
"deniedMcpServers": [
|
||||
{
|
||||
"serverName": "claude.ai higgsfield"
|
||||
},
|
||||
{
|
||||
"serverName": "claude.ai Higgsfield AI"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
# DESC: SEO + GEO + W3C audit — search/AI indexability + standards
|
||||
# Activate when: auditing a site for Google/Bing indexability, AI search
|
||||
# (ChatGPT/Perplexity/Claude/Gemini), W3C HTML/CSS validity, WCAG a11y.
|
||||
# No design skills, no dev skills — pure audit pipeline.
|
||||
|
||||
# SEO + GEO audits (personal)
|
||||
seo personal
|
||||
geo personal
|
||||
|
||||
# W3C HTML/CSS validity + WCAG a11y
|
||||
web-validate personal
|
||||
|
||||
# Web hardening (HSTS, CSP, redirects — affects ranking signals)
|
||||
harden personal
|
||||
|
||||
# Code analysis (read structure for audit)
|
||||
analyze personal
|
||||
|
||||
# Browser tooling — needed for live-page audits
|
||||
browse
|
||||
open-gstack-browser
|
||||
|
||||
# Health check + benchmark — Core Web Vitals, perf signals
|
||||
health # gstack
|
||||
benchmark # gstack
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"enabledPlugins": {
|
||||
"model-router@skills-dir": true,
|
||||
"pack-design@skills-dir": true,
|
||||
"pack-scroll3d@skills-dir": true,
|
||||
"pack-seo@skills-dir": true,
|
||||
"pack-web-validate@skills-dir": true,
|
||||
"pack-gstack-dev@skills-dir": true,
|
||||
"pack-gstack-browser@skills-dir": true,
|
||||
"pack-gstack-design@skills-dir": true,
|
||||
"pack-higgsfield@skills-dir": false,
|
||||
"pack-extras@skills-dir": false,
|
||||
"ui-ux-pro-max@ui-ux-pro-max-skill": true,
|
||||
"security-guidance@claude-code-plugins": true,
|
||||
"pr-review-toolkit@claude-code-plugins": false,
|
||||
"example-skills@anthropic-agent-skills": false,
|
||||
"brightdata-plugin@synced": false
|
||||
}
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
# DESC: Production website — design + dev + SEO + GEO + W3C + perf
|
||||
# Activate when: shipping a public website end-to-end. Combines `web`
|
||||
# and `seo` profiles into a single set so the same session can build,
|
||||
# polish, audit, and verify.
|
||||
|
||||
# === Design ===========================================================
|
||||
design-review
|
||||
design-consultation
|
||||
design-html
|
||||
plan-design-review
|
||||
|
||||
# === Browser + dogfooding =============================================
|
||||
browse
|
||||
open-gstack-browser
|
||||
setup-browser-cookies
|
||||
|
||||
# === Plan-mode reviews ================================================
|
||||
plan-ceo-review
|
||||
plan-eng-review
|
||||
spec
|
||||
|
||||
# === Code work ========================================================
|
||||
feat personal
|
||||
ship-feature personal
|
||||
hotfix personal
|
||||
bugfix personal
|
||||
review
|
||||
commit-change personal
|
||||
refactor personal
|
||||
|
||||
# === SEO / GEO / standards ===========================================
|
||||
seo personal
|
||||
geo personal
|
||||
web-validate personal
|
||||
harden personal
|
||||
guardrails personal
|
||||
a11y personal
|
||||
analyze personal
|
||||
|
||||
# === Perf + canary ===================================================
|
||||
health
|
||||
benchmark
|
||||
canary
|
||||
qa-only
|
||||
|
||||
# === External + plugin + MCP =========================================
|
||||
emil-design-eng external
|
||||
frontend-design external
|
||||
design-motion-principles external
|
||||
impeccable external
|
||||
scroll-world-storytelling external
|
||||
build-threejs-scroll-worlds external
|
||||
scroll-scrubbed-visual-sequence external
|
||||
scroll-scrubbed-word-reveal external
|
||||
scroll-progress-timeline external
|
||||
21st-ui-build external
|
||||
21st-cli-use external
|
||||
ui-ux-pro-max plugin@ui-ux-pro-max-skill
|
||||
|
||||
# Personal: motion implementation companion (skills/site-motion)
|
||||
site-motion personal
|
||||
|
||||
# === CLIs ============================================================
|
||||
21st cli
|
||||
ctx7 cli
|
||||
graphify cli
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"enabledPlugins": {
|
||||
"model-router@skills-dir": true,
|
||||
"pack-design@skills-dir": true,
|
||||
"pack-scroll3d@skills-dir": true,
|
||||
"pack-seo@skills-dir": false,
|
||||
"pack-web-validate@skills-dir": true,
|
||||
"pack-gstack-dev@skills-dir": true,
|
||||
"pack-gstack-browser@skills-dir": true,
|
||||
"pack-gstack-design@skills-dir": true,
|
||||
"pack-higgsfield@skills-dir": false,
|
||||
"pack-extras@skills-dir": false,
|
||||
"ui-ux-pro-max@ui-ux-pro-max-skill": true,
|
||||
"security-guidance@claude-code-plugins": true,
|
||||
"pr-review-toolkit@claude-code-plugins": false,
|
||||
"example-skills@anthropic-agent-skills": false,
|
||||
"brightdata-plugin@synced": false
|
||||
}
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
# DESC: Public website work — frontend + content + light dev
|
||||
# Activate when: building/iterating a public-facing website (landing,
|
||||
# portfolio, marketing, blog) where SEO is NOT the immediate focus.
|
||||
# For SEO/GEO audit on top, use web-full or apply seo afterwards.
|
||||
|
||||
# Design skills (gstack) — full design pipeline
|
||||
design-review
|
||||
design-consultation
|
||||
design-html
|
||||
plan-design-review
|
||||
|
||||
# Browser tooling for design + dogfooding
|
||||
browse
|
||||
open-gstack-browser
|
||||
setup-browser-cookies
|
||||
|
||||
# Plan-mode reviews relevant to web work
|
||||
plan-ceo-review
|
||||
plan-eng-review
|
||||
|
||||
# Code work skills — needed to actually build the site
|
||||
feat personal
|
||||
ship-feature personal
|
||||
hotfix personal
|
||||
review # gstack
|
||||
commit-change personal
|
||||
refactor personal
|
||||
|
||||
# Validation companion (basic W3C/a11y check during build)
|
||||
web-validate personal
|
||||
a11y personal
|
||||
|
||||
# External: design skills
|
||||
emil-design-eng external
|
||||
frontend-design external
|
||||
design-motion-principles external
|
||||
impeccable external
|
||||
|
||||
# External: Mengto scroll-choreography skills (curl, commit-pinned)
|
||||
scroll-world-storytelling external
|
||||
build-threejs-scroll-worlds external
|
||||
scroll-scrubbed-visual-sequence external
|
||||
scroll-scrubbed-word-reveal external
|
||||
scroll-progress-timeline external
|
||||
|
||||
# Personal: motion implementation companion (skills/site-motion)
|
||||
site-motion personal
|
||||
|
||||
# External: 21st.dev pack (publishing flows 21st-registry / -design-sync
|
||||
# stay parked)
|
||||
21st-ui-build external
|
||||
21st-cli-use external
|
||||
|
||||
# Plugin: UI/UX intelligence (auto-toggle)
|
||||
ui-ux-pro-max plugin@ui-ux-pro-max-skill
|
||||
|
||||
# CLI: 21st.dev component catalog + UI generation (needs `21st login`)
|
||||
21st cli
|
||||
|
||||
# CLI: ctx7 (doc lookup for fast-evolving libs like Next.js)
|
||||
ctx7 cli
|
||||
graphify cli
|
||||
@@ -539,7 +539,7 @@ tf "gitleaks allowlist store" "$REPO/.gitleaks.toml" "seo-data/tokens"
|
||||
tf "gitignore venv" "$REPO/.gitignore" ".venv-seo-data"
|
||||
|
||||
echo "── integration locks ──"
|
||||
tf "skill step0 account select" "$REPO/skills/seo/SKILL.md" "COMPTE GOOGLE"
|
||||
tf "skill step0 account select" "$REPO/skills/pack-seo/skills/seo/SKILL.md" "COMPTE GOOGLE"
|
||||
tf "analyzer calls fetch crux" "$REPO/agents/seo-analyzer.md" "fetch.sh crux"
|
||||
tf "analyzer calls fetch queries" "$REPO/agents/seo-analyzer.md" "fetch.sh queries"
|
||||
tf "analyzer gsc subsection" "$REPO/agents/seo-analyzer.md" "Performance GSC"
|
||||
@@ -548,10 +548,10 @@ tf "geo-analyzer wires schema_gen" "$REPO/agents/geo-analyzer.md" "fetch.sh sche
|
||||
tf "geo-analyzer wires content_quality" "$REPO/agents/geo-analyzer.md" "fetch.sh content_quality"
|
||||
|
||||
echo "── account-mgmt locks ──"
|
||||
tf "skill routes account verbs" "$REPO/skills/seo/SKILL.md" "forget --all"
|
||||
tf "skill connect wrapper path" "$REPO/skills/seo/SKILL.md" "lib/seo-data/connect.sh"
|
||||
tf "skill revocation notice" "$REPO/skills/seo/SKILL.md" "myaccount.google.com/permissions"
|
||||
tf "skill label charset rule" "$REPO/skills/seo/SKILL.md" "A-Za-z0-9._-"
|
||||
tf "skill routes account verbs" "$REPO/skills/pack-seo/skills/seo/SKILL.md" "forget --all"
|
||||
tf "skill connect wrapper path" "$REPO/skills/pack-seo/skills/seo/SKILL.md" "lib/seo-data/connect.sh"
|
||||
tf "skill revocation notice" "$REPO/skills/pack-seo/skills/seo/SKILL.md" "myaccount.google.com/permissions"
|
||||
tf "skill label charset rule" "$REPO/skills/pack-seo/skills/seo/SKILL.md" "A-Za-z0-9._-"
|
||||
|
||||
echo "── readme lock ──"
|
||||
tf "readme documents fetch.sh" "$REPO/lib/seo-data/README.md" "fetch.sh"
|
||||
|
||||
@@ -187,13 +187,13 @@ check T8h-template-rules-path "$rc1|$?" "0|1"
|
||||
|
||||
# ── real census: the repo's own citers against CLAUDE.global.md ──────────────
|
||||
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/impeccable/*' -not -path 'skills/synced/*' \
|
||||
-not -path 'skills/graphify/*' -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/impeccable/*' \
|
||||
-not -path 'skills/graphify/*' -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
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
# shellcheck disable=SC2015,SC2016 # A && ok || ko is deliberate (ok/ko never fail)
|
||||
set -u
|
||||
R="$(cd "$(dirname "$0")/../.." && pwd)"
|
||||
skdir() { ls -d "$R"/skills/"$1" "$R"/skills/pack-*/skills/"$1" 2>/dev/null | head -1 | sed "s#^$R/##"; }
|
||||
MOD="$R/mods/model-router"
|
||||
RJ="$MOD/routing.json"
|
||||
REG="$MOD/hooks/register.ts"
|
||||
@@ -185,7 +186,7 @@ done
|
||||
# ── (e) D3 wiring markers ────────────────────────────────────────────────
|
||||
mark() { # mark <phase> <skills...>
|
||||
local ph="$1" s; shift
|
||||
for s in "$@"; do has "skills/$s/SKILL.md" "route(phase=\"$ph\")"; done
|
||||
for s in "$@"; do has "$(skdir "$s")/SKILL.md" "route(phase=\"$ph\")"; done
|
||||
}
|
||||
mark orchestrate feat hotfix bugfix ship-feature init-project code-clean seo geo harden web-validate audit-delta
|
||||
mark apply feat hotfix bugfix ship-feature init-project
|
||||
@@ -194,7 +195,7 @@ mark plan ship-feature init-project onboard code-clean audit-delta
|
||||
mark escalate ship-feature
|
||||
[ "$(grep -o 'route(phase="escalate")' "$R/lib/verify-secure-loop.md" | wc -l)" -eq 3 ] \
|
||||
&& ok || ko "verify-secure-loop.md: escalate route must appear 3 times"
|
||||
for s in ship-feature init-project; do has "skills/$s/SKILL.md" 'effort="xhigh"'; done
|
||||
for s in ship-feature init-project; do has "$(skdir "$s")/SKILL.md" 'effort="xhigh"'; done
|
||||
has "skills/tour/SKILL.md" 'effort="xhigh"'
|
||||
n_opus="$(grep -c 'model="opus",$' "$R/skills/onboard/SKILL.md")"
|
||||
n_eff="$(grep -c 'effort="xhigh",$' "$R/skills/onboard/SKILL.md")"
|
||||
@@ -203,7 +204,7 @@ n_eff="$(grep -c 'effort="xhigh",$' "$R/skills/onboard/SKILL.md")"
|
||||
bad="$(grep 'model: "fable"' "$R/agents/client-handover-writer.md" | grep -vc 'effort="high"')"
|
||||
[ "$bad" -eq 0 ] && ok || ko "client-handover-writer: $bad model: \"fable\" line(s) without effort=\"high\""
|
||||
for s in ship-feature init-project feat bugfix web-validate seo hotfix geo harden code-clean audit-delta tour onboard; do
|
||||
has "skills/$s/SKILL.md" 'ROUTING: follow $HOME/.claude/lib/effort-shift.md'
|
||||
has "$(skdir "$s")/SKILL.md" 'ROUTING: follow $HOME/.claude/lib/effort-shift.md'
|
||||
done
|
||||
has "agents/client-handover-writer.md" 'ROUTING: follow $HOME/.claude/lib/effort-shift.md'
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
ls $HOME/.claude/skills/a2 skills-disabled/foo; bash lib/toggle-external.sh; cat .active-profile; lib/profiles/web.profile
|
||||
@@ -1,66 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
# lib/tests/gstack-removed.test.sh — GSTACK_REMOVED denylist honored by
|
||||
# every "bring gstack back" path: profile.sh `gstack on` and
|
||||
# toggle-external.sh `enable gstack` both skip a policy-removed name and
|
||||
# leave it parked, restoring only what policy allows; gstack_is_removed()
|
||||
# itself, positive + negative. Covers contract criterion 17. Hermetic:
|
||||
# fixture repo via PROFILE_REPO_OVERRIDE / TOGGLE_EXTERNAL_REPO_OVERRIDE —
|
||||
# same harness as lib/tests/profile-default.test.sh and
|
||||
# lib/tests/toggle-external-repo-resolution.test.sh.
|
||||
set -u
|
||||
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
|
||||
pass=0; fail=0
|
||||
check() { if [ "$2" = "$3" ]; then pass=$((pass+1)); else fail=$((fail+1));
|
||||
printf 'FAIL %s: got[%s] want[%s]\n' "$1" "$2" "$3"; fi; }
|
||||
check_has() { case "$2" in *"$3"*) pass=$((pass+1));; *) fail=$((fail+1));
|
||||
printf 'FAIL %s: [%s] does not contain [%s]\n' "$1" "$2" "$3";; esac; }
|
||||
check_not() { case "$2" in *"$3"*) fail=$((fail+1));
|
||||
printf 'FAIL %s: [%s] unexpectedly contains [%s]\n' "$1" "$2" "$3";; *) pass=$((pass+1));; esac; }
|
||||
|
||||
# mk_fixture <dir> — minimal repo: profile.sh + toggle-external.sh +
|
||||
# gstack-removed.sh under lib/, one removed name (ship) and one kept name
|
||||
# (browse) parked in skills-disabled/.
|
||||
mk_fixture() {
|
||||
local fx="$1"
|
||||
mkdir -p "$fx/skills" "$fx/skills-disabled/gstack__ship" \
|
||||
"$fx/skills-disabled/gstack__browse" "$fx/lib"
|
||||
cp "$ROOT/lib/profile.sh" "$ROOT/lib/toggle-external.sh" \
|
||||
"$ROOT/lib/gstack-removed.sh" "$fx/lib/"
|
||||
}
|
||||
|
||||
# --- T1-T5: profile.sh gstack on restores browse, skips + parks ship ---
|
||||
FX1="$(mktemp -d)"; mk_fixture "$FX1"
|
||||
out="$(PROFILE_REPO_OVERRIDE="$FX1" bash "$FX1/lib/profile.sh" gstack on 2>&1)"
|
||||
check T1-browse-restored "$([ -e "$FX1/skills/browse" ] && echo on || echo off)" on
|
||||
check T2-ship-parked "$([ -e "$FX1/skills-disabled/gstack__ship" ] && echo p || echo n)" p
|
||||
check T3-ship-not-live "$([ -e "$FX1/skills/ship" ] && echo on || echo off)" off
|
||||
check_has T4-skip-names-ship "$out" "ship"
|
||||
check_has T5-real-count "$out" "1 parked gstack skills restored"
|
||||
rm -rf "$FX1"
|
||||
|
||||
# --- T6-T9: toggle-external.sh enable gstack — same skip + restore ---
|
||||
FX2="$(mktemp -d)"; mk_fixture "$FX2"
|
||||
out="$(TOGGLE_EXTERNAL_REPO_OVERRIDE="$FX2" bash "$FX2/lib/toggle-external.sh" enable gstack 2>&1)"
|
||||
check T6-browse-restored "$([ -e "$FX2/skills/browse" ] && echo on || echo off)" on
|
||||
check T7-ship-parked "$([ -e "$FX2/skills-disabled/gstack__ship" ] && echo p || echo n)" p
|
||||
check T8-ship-not-live "$([ -e "$FX2/skills/ship" ] && echo on || echo off)" off
|
||||
check_has T9-skip-names-ship "$out" "ship"
|
||||
rm -rf "$FX2"
|
||||
|
||||
# --- T10-T11: toggle-external.sh, only removed names parked — 0 restored,
|
||||
# the policy message fires instead of the "re-run gstack setup" hint ---
|
||||
FX3="$(mktemp -d)"
|
||||
mkdir -p "$FX3/skills" "$FX3/skills-disabled/gstack__ship" "$FX3/lib"
|
||||
cp "$ROOT/lib/toggle-external.sh" "$ROOT/lib/gstack-removed.sh" "$FX3/lib/"
|
||||
out="$(TOGGLE_EXTERNAL_REPO_OVERRIDE="$FX3" bash "$FX3/lib/toggle-external.sh" enable gstack 2>&1)"
|
||||
check_has T10-policy-msg "$out" "policy-removed skills remain parked"
|
||||
check_not T11-no-setup-hint "$out" "re-run gstack setup"
|
||||
rm -rf "$FX3"
|
||||
|
||||
# --- T12-T13: gstack_is_removed() itself, positive + negative ---
|
||||
# shellcheck source=lib/gstack-removed.sh disable=SC1091
|
||||
source "$ROOT/lib/gstack-removed.sh"
|
||||
gstack_is_removed ship; check T12-removed-positive "$?" 0
|
||||
gstack_is_removed browse; check T13-removed-negative "$?" 1
|
||||
|
||||
printf 'PASS=%s FAIL=%s\n' "$pass" "$fail"; [ "$fail" -eq 0 ]
|
||||
@@ -2,9 +2,7 @@
|
||||
# lib/tests/higgsfield.test.sh — hermetic suite for the Higgsfield pack.
|
||||
# sync lib/higgsfield-skills.sh against a local git repo shaped like
|
||||
# upstream (no network), and its CLI probes against a fake CLI
|
||||
# toggle lib/toggle-external.sh `higgsfield` / `higgsfield-websites`
|
||||
# against a fixture tree, fake CLIs first on PATH
|
||||
# wiring static locks on the installers (order, off by default)
|
||||
# wiring static locks on the installers (order)
|
||||
# Each named case prints one `PASS <NAME>` or `FAIL <NAME>:<details>` line.
|
||||
set -u
|
||||
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
|
||||
@@ -111,7 +109,7 @@ probe() {
|
||||
# ── sync ────────────────────────────────────────────────────
|
||||
UP="$WORK/upstream"; mk_upstream "$UP"
|
||||
# The repo path carries a space on purpose: every expansion must be quoted.
|
||||
R1="$WORK/r 1"; mkdir -p "$R1/skills" "$R1/skills-disabled"
|
||||
R1="$WORK/r 1"; mkdir -p "$R1/skills"
|
||||
EXT="$R1/skills-external"
|
||||
|
||||
expect fixture "$(yn test -f "$UP/.git/HEAD")" yes
|
||||
@@ -137,16 +135,6 @@ expect stale-out "$(yn test -e "$EXT/higgsfield-generate/old.md")" no
|
||||
expect new-in "$(yn test -f "$EXT/higgsfield-generate/new.md")" yes
|
||||
verdict SYNC_REFRESH_DROPS_STALE
|
||||
|
||||
ln -s "$EXT/higgsfield-soul-id" "$R1/skills-disabled/higgsfield-soul-id"
|
||||
ln -s "$EXT/higgsfield-generate" "$R1/skills/higgsfield-generate"
|
||||
expect rc-count "$(sync_into "$R1")" "0:3"
|
||||
expect parked-link "$(yn test -L "$R1/skills-disabled/higgsfield-soul-id")" yes
|
||||
expect parked-reads \
|
||||
"$(yn test -f "$R1/skills-disabled/higgsfield-soul-id/SKILL.md")" yes
|
||||
expect not-enabled "$(yn test -e "$R1/skills/higgsfield-soul-id")" no
|
||||
expect live-reads "$(yn test -f "$R1/skills/higgsfield-generate/SKILL.md")" yes
|
||||
verdict SYNC_KEEPS_PARKED
|
||||
|
||||
BARE="$WORK/bare-upstream"; mkdir -p "$BARE"; echo "x" > "$BARE/README.md"
|
||||
git_q "$BARE" init; git_q "$BARE" add -A; git_q "$BARE" commit -m fixture
|
||||
expect no-repo "$(sync_into "$R1" "$WORK/no-such-repo")" "1:0"
|
||||
@@ -171,158 +159,10 @@ chmod +x "$GT/gtimeout"
|
||||
expect gtimeout "$(probe "$BIN:$GT:$CLEAN" higgsfield_signed_in)" "rc=0"
|
||||
verdict PROBES_SILENT
|
||||
|
||||
# ── toggle ──────────────────────────────────────────────────
|
||||
# mk_toggle_fx <dir> [skill...] — fixture repo: the toggle script plus one
|
||||
# skills-external source per named skill (none → installed-nothing tree).
|
||||
mk_toggle_fx() {
|
||||
local fx="$1" s; shift
|
||||
mkdir -p "$fx/lib" "$fx/skills"
|
||||
cp "$ROOT/lib/toggle-external.sh" "$ROOT/lib/gstack-removed.sh" "$fx/lib/"
|
||||
for s in "$@"; do
|
||||
mkdir -p "$fx/skills-external/$s"
|
||||
echo "---" > "$fx/skills-external/$s/SKILL.md"
|
||||
done
|
||||
}
|
||||
PACK=(higgsfield-generate higgsfield-soul-id higgsfield-websites)
|
||||
|
||||
# tog <fixture> <args...> — run the fixture's toggle script, fake CLIs first.
|
||||
tog() {
|
||||
local fx="$1"; shift
|
||||
TOGGLE_EXTERNAL_REPO_OVERRIDE="$fx" PATH="$BIN:$PATH" \
|
||||
bash "$fx/lib/toggle-external.sh" "$@" 2>&1
|
||||
}
|
||||
# list_row <fixture> <tool> — the status column of `list` for one tool.
|
||||
list_row() { tog "$1" list | awk -v t="$2" '$1 == t { print $2 }'; }
|
||||
|
||||
F0="$WORK/f0"; mk_toggle_fx "$F0"
|
||||
F1="$WORK/f1"; mk_toggle_fx "$F1" "${PACK[@]}"
|
||||
expect pack-missing "$(tog "$F0" status higgsfield)" missing
|
||||
expect web-missing "$(tog "$F0" status higgsfield-websites)" missing
|
||||
expect pack-disabled "$(tog "$F1" status higgsfield)" disabled
|
||||
expect web-disabled "$(tog "$F1" status higgsfield-websites)" disabled
|
||||
ln -s "$F1/skills-external/higgsfield-generate" "$F1/skills/higgsfield-generate"
|
||||
expect pack-partial "$(tog "$F1" status higgsfield)" enabled
|
||||
expect web-apart "$(tog "$F1" status higgsfield-websites)" disabled
|
||||
expect list-pack "$(list_row "$F1" higgsfield)" enabled
|
||||
expect list-web "$(list_row "$F1" higgsfield-websites)" disabled
|
||||
verdict STATUS_STATES
|
||||
|
||||
F2="$WORK/f2"; mk_toggle_fx "$F2" "${PACK[@]}"
|
||||
out="$(tog "$F2" enable higgsfield)"; rc=$?
|
||||
expect rc "$rc" 0
|
||||
expect generate "$(readlink "$F2/skills/higgsfield-generate")" \
|
||||
"$F2/skills-external/higgsfield-generate"
|
||||
expect soul-id "$(readlink "$F2/skills/higgsfield-soul-id")" \
|
||||
"$F2/skills-external/higgsfield-soul-id"
|
||||
expect no-websites "$(yn test -e "$F2/skills/higgsfield-websites")" no
|
||||
expect_has count "$out" "higgsfield enabled (2 skills: 0 restored, 2 linked)"
|
||||
out="$(tog "$F2" enable higgsfield)"; rc=$?
|
||||
expect again-rc "$rc" 0
|
||||
expect_has again "$out" "higgsfield already enabled"
|
||||
verdict ENABLE_PACK_EXCLUDES_WEBSITES
|
||||
|
||||
# The media pack is an allowlist: a synced skill nobody listed is reported,
|
||||
# never linked; neither is a listed name whose directory holds no SKILL.md.
|
||||
F8="$WORK/f 8"; mk_toggle_fx "$F8" "${PACK[@]}" higgsfield-newcomer
|
||||
mkdir -p "$F8/skills-external/higgsfield-brandkit" \
|
||||
"$F8/skills-external/higgsfield-noskill"
|
||||
out="$(tog "$F8" enable higgsfield)"; rc=$?
|
||||
expect rc "$rc" 0
|
||||
expect_has count "$out" "higgsfield enabled (2 skills: 0 restored, 2 linked)"
|
||||
expect newcomer-off "$(yn test -e "$F8/skills/higgsfield-newcomer")" no
|
||||
expect brandkit-off "$(yn test -e "$F8/skills/higgsfield-brandkit")" no
|
||||
expect_has reported "$out" "higgsfield-newcomer"
|
||||
expect_not noskill-quiet "$out" "higgsfield-noskill"
|
||||
expect links "$(entries "$F8/skills")" 2
|
||||
# Enabled is the steady state: a re-run must still name the drift.
|
||||
out="$(tog "$F8" enable higgsfield)"; rc=$?
|
||||
expect again-rc "$rc" 0
|
||||
expect_has again-state "$out" "higgsfield already enabled"
|
||||
expect_has again-reported "$out" "higgsfield-newcomer"
|
||||
verdict UNLISTED_NOT_LINKED
|
||||
|
||||
F3="$WORK/f3"; mk_toggle_fx "$F3" "${PACK[@]}"
|
||||
out="$(tog "$F3" enable higgsfield-websites)"; rc=$?
|
||||
expect rc "$rc" 0
|
||||
expect link "$(readlink "$F3/skills/higgsfield-websites")" \
|
||||
"$F3/skills-external/higgsfield-websites"
|
||||
expect no-generate "$(yn test -e "$F3/skills/higgsfield-generate")" no
|
||||
expect pack-status "$(tog "$F3" status higgsfield)" disabled
|
||||
expect web-status "$(tog "$F3" status higgsfield-websites)" enabled
|
||||
tog "$F3" disable higgsfield-websites >/dev/null
|
||||
out="$(FAKE_HF_SESSION=out tog "$F3" enable higgsfield-websites)"; rc=$?
|
||||
expect hint-rc "$rc" 0
|
||||
expect_has web-hint "$out" "higgsfield auth login"
|
||||
verdict ENABLE_WEBSITES_ALONE
|
||||
|
||||
# Continues on F2: the pack is enabled, websites is not.
|
||||
tog "$F2" enable higgsfield-websites >/dev/null
|
||||
out="$(tog "$F2" disable higgsfield)"; rc=$?
|
||||
expect rc "$rc" 0
|
||||
expect_has msg "$out" "higgsfield disabled (2 skills parked)"
|
||||
expect parked "$(yn test -L "$F2/skills-disabled/higgsfield-generate")" yes
|
||||
expect unlinked "$(yn test -e "$F2/skills/higgsfield-generate")" no
|
||||
expect web-untouched "$(yn test -e "$F2/skills/higgsfield-websites")" yes
|
||||
out="$(tog "$F2" enable higgsfield)"
|
||||
expect_has restored "$out" "2 restored, 0 linked"
|
||||
tog "$F2" disable higgsfield-websites >/dev/null
|
||||
expect web-parked "$(yn test -L "$F2/skills-disabled/higgsfield-websites")" yes
|
||||
expect pack-on "$(tog "$F2" status higgsfield)" enabled
|
||||
verdict DISABLE_PARKS
|
||||
|
||||
F4="$WORK/f4"; mk_toggle_fx "$F4" "${PACK[@]}"
|
||||
out="$(FAKE_HF_SESSION=out tog "$F4" enable higgsfield)"; rc=$?
|
||||
expect out-rc "$rc" 0
|
||||
expect out-linked "$(yn test -e "$F4/skills/higgsfield-generate")" yes
|
||||
expect_has out-hint "$out" "higgsfield auth login"
|
||||
F5="$WORK/f5"; mk_toggle_fx "$F5" "${PACK[@]}"
|
||||
out="$(FAKE_HF_SESSION=in tog "$F5" enable higgsfield)"
|
||||
expect_not in-quiet "$out" "auth login"
|
||||
expect_not in-no-token "$out" "fixture-token"
|
||||
F6="$WORK/f6"; mk_toggle_fx "$F6" "${PACK[@]}"
|
||||
out="$(TOGGLE_EXTERNAL_REPO_OVERRIDE="$F6" PATH="$CLEAN" \
|
||||
bash "$F6/lib/toggle-external.sh" enable higgsfield 2>&1)"; rc=$?
|
||||
expect absent-rc "$rc" 0
|
||||
expect absent-linked "$(yn test -e "$F6/skills/higgsfield-generate")" yes
|
||||
expect_has absent-hint "$out" "not on PATH"
|
||||
F9="$WORK/f9"; mk_toggle_fx "$F9" "${PACK[@]}"
|
||||
out="$(FAKE_HF_BINARY=missing tog "$F9" enable higgsfield)"; rc=$?
|
||||
expect shim-rc "$rc" 0
|
||||
expect_has shim-hint "$out" "does not answer"
|
||||
expect_not shim-not-login "$out" "auth login"
|
||||
verdict SIGNED_OUT_WARNS
|
||||
|
||||
out="$(tog "$F0" enable higgsfield)"; rc=$?
|
||||
expect pack-rc "$rc" 1
|
||||
expect_has pack-path "$out" "$F0/skills-external"
|
||||
out="$(tog "$F0" enable higgsfield-websites)"; rc=$?
|
||||
expect web-rc "$rc" 1
|
||||
expect_has web-path "$out" "$F0/skills-external/higgsfield-websites"
|
||||
verdict ENABLE_MISSING_ERRS
|
||||
|
||||
# The pack arms are shared with 21st: its behaviour must not move.
|
||||
F7="$WORK/f7"; mk_toggle_fx "$F7" 21st-one 21st-two
|
||||
expect off "$(tog "$F7" status 21st)" disabled
|
||||
out="$(tog "$F7" enable 21st)"
|
||||
expect_has on "$out" "21st enabled (2 skills: 0 restored, 2 linked)"
|
||||
expect_not quiet "$out" "21st login"
|
||||
expect hf-apart "$(tog "$F7" status higgsfield)" missing
|
||||
out="$(tog "$F7" disable 21st)"
|
||||
expect_has parked "$out" "21st disabled (2 skills parked)"
|
||||
verdict PACK_21ST_UNCHANGED
|
||||
|
||||
# ── wiring ──────────────────────────────────────────────────
|
||||
# count <file> <fixed string> — matching lines (0 when none).
|
||||
count() { grep -cF -- "$2" "$ROOT/$1"; }
|
||||
|
||||
# Positive control first: the pattern does bite on a line that carries it.
|
||||
expect control "$(echo 'higgsfield-x external' | grep -cF higgsfield)" 1
|
||||
expect link-sh "$(count link.sh higgsfield)" 0
|
||||
expect profile-sh "$(count lib/profile.sh higgsfield)" 0
|
||||
expect profiles \
|
||||
"$(cat "$ROOT"/lib/profiles/*.profile | grep -cF higgsfield)" 0
|
||||
verdict OFF_BY_DEFAULT_WIRING
|
||||
|
||||
# ln_first / ln_last <file> <fixed string> — line number of a match.
|
||||
ln_first() { grep -nF -- "$2" "$ROOT/$1" | head -1 | cut -d: -f1; }
|
||||
ln_last() { grep -nF -- "$2" "$ROOT/$1" | tail -1 | cut -d: -f1; }
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
# lib/tests/model-routing.test.sh — census: gate wiring + pins + executor shape (BDR-066, BDR-076)
|
||||
set -u
|
||||
R="$(cd "$(dirname "$0")/../.." && pwd)"
|
||||
skdir() { ls -d "$R"/skills/"$1" "$R"/skills/pack-*/skills/"$1" 2>/dev/null | head -1 | sed "s#^$R/##"; }
|
||||
pass=0; fail=0
|
||||
ok() { pass=$((pass+1)); }
|
||||
ko() { fail=$((fail+1)); printf 'FAIL %s\n' "$1"; }
|
||||
@@ -11,11 +12,11 @@ fm_lacks() { if awk 'NR<=10' "$R/$1" | grep -qF "$2"; then ko "$1 frontmatter mu
|
||||
|
||||
# 1) gate wired in the 17 reflection skills (orchestrators, /analyze, /guardrails, /a11y)
|
||||
for s in ship-feature init-project feat bugfix onboard seo geo web-validate harden audit-delta tour code-clean hotfix client-handover analyze guardrails a11y; do
|
||||
has "skills/$s/SKILL.md" 'lib/model-gate.md'
|
||||
has "$(skdir "$s")/SKILL.md" 'lib/model-gate.md'
|
||||
done
|
||||
# 2) gate NOT wired in the pure-execution/read-only skills (exclusion list)
|
||||
for s in commit-change doc status release-candidate refactor; do
|
||||
lacks "skills/$s/SKILL.md" 'lib/model-gate.md'
|
||||
lacks "$(skdir "$s")/SKILL.md" 'lib/model-gate.md'
|
||||
done
|
||||
# 3) executor + gate pins
|
||||
has "agents/feater.md" 'model: sonnet'
|
||||
@@ -31,7 +32,7 @@ lacks "agents/feater.md" 'AskUserQuestion'
|
||||
has "skills/ship-feature/SKILL.md" 'model: "sonnet"'
|
||||
has "skills/init-project/SKILL.md" 'model: "sonnet"'
|
||||
# 6) web-validate applies via L1 applier
|
||||
has "skills/web-validate/SKILL.md" 'subagent_type="hotfixer"'
|
||||
has "skills/pack-web-validate/skills/web-validate/SKILL.md" 'subagent_type="hotfixer"'
|
||||
# 7) wave-2 — pure-execution skills dispatch their agent (pin takes effect, off the big session model)
|
||||
has "skills/doc/SKILL.md" 'subagent_type="doc-syncer"'
|
||||
has "skills/status/SKILL.md" 'subagent_type="status-reporter"'
|
||||
@@ -105,9 +106,9 @@ lacks "agents/plugin-advisor.md" 'PHASE 1 — DETECT'
|
||||
has "lib/plugin-gate.md" 'subagent_type="plugin-probe"'
|
||||
has "lib/plugin-gate.md" 'subagent_type="plugin-advisor"'
|
||||
for s in plugin-check onboard init-project ship-feature; do
|
||||
has "skills/$s/SKILL.md" 'lib/plugin-gate.md'
|
||||
has "$(skdir "$s")/SKILL.md" 'lib/plugin-gate.md'
|
||||
# shellcheck disable=SC2016 # literal $HOME wanted: matching the exact inline-load string
|
||||
lacks "skills/$s/SKILL.md" 'Load `$HOME/.claude/agents/plugin-advisor.md`'
|
||||
lacks "$(skdir "$s")/SKILL.md" 'Load `$HOME/.claude/agents/plugin-advisor.md`'
|
||||
done
|
||||
# 14) BDR-077 W2/S2 — doc pipeline: ONE agent, TWO modes around the
|
||||
# dispatcher's gate (audit = opus via call-site override — documented
|
||||
@@ -124,10 +125,10 @@ has "skills/doc/SKILL.md" 'model="opus"'
|
||||
has "skills/doc/SKILL.md" 'MODE: patch'
|
||||
lacks "agents/scaffolder.md" 'INLINE-LOAD'
|
||||
for s in bugfix hotfix feat ship-feature init-project; do
|
||||
has "skills/$s/SKILL.md" 'MODE: audit'
|
||||
has "skills/$s/SKILL.md" 'doc-syncer", model="opus"'
|
||||
has "$(skdir "$s")/SKILL.md" 'MODE: audit'
|
||||
has "$(skdir "$s")/SKILL.md" 'doc-syncer", model="opus"'
|
||||
# shellcheck disable=SC2016 # literal $HOME wanted: matching the exact inline-load string
|
||||
lacks "skills/$s/SKILL.md" 'Load `$HOME/.claude/agents/doc-syncer.md`'
|
||||
lacks "$(skdir "$s")/SKILL.md" 'Load `$HOME/.claude/agents/doc-syncer.md`'
|
||||
done
|
||||
# 15) BDR-077 W2 — last inline execution converted: scaffolder + onboarder
|
||||
# are DISPATCHED (pins live); their gates/arbitration stay in the
|
||||
@@ -166,14 +167,14 @@ has "agents/geo-analyzer.md" 'MODE: collect'
|
||||
has "agents/geo-analyzer.md" 'MODE: judge'
|
||||
has "agents/geo-analyzer.md" 'MODE: template'
|
||||
has "agents/geo-analyzer.md" 'COLLECTION COMPLETE'
|
||||
has "skills/seo/SKILL.md" 'MODE: collect'
|
||||
has "skills/seo/SKILL.md" 'seo-analyzer", model="sonnet"'
|
||||
has "skills/seo/SKILL.md" 'never re-derive a score'
|
||||
has "skills/seo/SKILL.md" 'DISPATCHER ERROR CONTRACT'
|
||||
has "skills/geo/SKILL.md" 'MODE: collect'
|
||||
has "skills/geo/SKILL.md" 'geo-analyzer", model="sonnet"'
|
||||
has "skills/geo/SKILL.md" 'ERROR CONTRACT'
|
||||
has "skills/geo/SKILL.md" 'never re-derive a score'
|
||||
has "skills/pack-seo/skills/seo/SKILL.md" 'MODE: collect'
|
||||
has "skills/pack-seo/skills/seo/SKILL.md" 'seo-analyzer", model="sonnet"'
|
||||
has "skills/pack-seo/skills/seo/SKILL.md" 'never re-derive a score'
|
||||
has "skills/pack-seo/skills/seo/SKILL.md" 'DISPATCHER ERROR CONTRACT'
|
||||
has "skills/pack-seo/skills/geo/SKILL.md" 'MODE: collect'
|
||||
has "skills/pack-seo/skills/geo/SKILL.md" 'geo-analyzer", model="sonnet"'
|
||||
has "skills/pack-seo/skills/geo/SKILL.md" 'ERROR CONTRACT'
|
||||
has "skills/pack-seo/skills/geo/SKILL.md" 'never re-derive a score'
|
||||
has "agents/handover-doc-writer.md" 'SYNTH REPORT'
|
||||
|
||||
printf 'model-routing census: %d pass, %d fail\n' "$pass" "$fail"
|
||||
|
||||
Executable
+99
@@ -0,0 +1,99 @@
|
||||
#!/usr/bin/env bash
|
||||
# lib/tests/pack-census.test.sh — lib/pack-census.sh: pack layout (manifest
|
||||
# name = folder, entries resolve, no skill twice, retired gstack names absent),
|
||||
# fragment invariants (same key set, fixed values, deny set, full = manifest
|
||||
# defaults), old-layout citers. Fixture cases, then the hermetic part of the
|
||||
# census on the real repo (dangling targets are WARN without --installed).
|
||||
set -u
|
||||
unset CLAUDE_PROFILE CLAUDE_PROFILE_SETTINGS
|
||||
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
|
||||
pass=0; fail=0
|
||||
check() { if [ "$2" = "$3" ]; then pass=$((pass+1)); else fail=$((fail+1));
|
||||
printf 'FAIL %s: got[%s] want[%s]\n' "$1" "$2" "$3"; fi; }
|
||||
check_has() { case "$2" in *"$3"*) pass=$((pass+1));; *) fail=$((fail+1));
|
||||
printf 'FAIL %s: [%s] does not contain [%s]\n' "$1" "$2" "$3";; esac; }
|
||||
|
||||
FX="$(mktemp -d)"; trap 'rm -rf "$FX"' EXIT
|
||||
mkdir -p "$FX/lib/profiles" "$FX/hooks" "$FX/skills/core-a"; touch "$FX/skills/core-a/SKILL.md"
|
||||
printf 'gs-dead\n' > "$FX/lib/gstack-removed.list"
|
||||
mk_pack() { # name defaultEnabled skill...
|
||||
local n="$1" d="$2"; shift 2
|
||||
mkdir -p "$FX/skills/pack-$n/.claude-plugin" "$FX/skills/pack-$n/skills"
|
||||
printf '{"name":"pack-%s","version":"1.0.0","defaultEnabled":%s}\n' "$n" "$d" \
|
||||
> "$FX/skills/pack-$n/.claude-plugin/plugin.json"
|
||||
for s in "$@"; do mkdir -p "$FX/skills-external/$s"; touch "$FX/skills-external/$s/SKILL.md"
|
||||
ln -s "../../../skills-external/$s" "$FX/skills/pack-$n/skills/$s"; done
|
||||
}
|
||||
mk_pack alpha true a1 a2
|
||||
mk_pack beta false b1
|
||||
frag() { # name alpha beta deny(yes|no) — the two real connector names
|
||||
local d=""; [ "$4" = yes ] && d=', "deniedMcpServers": [{"serverName": "claude.ai higgsfield"}, {"serverName": "claude.ai Higgsfield AI"}]'
|
||||
printf '{"enabledPlugins": {"model-router@skills-dir": true, "pack-alpha@skills-dir": %s, "pack-beta@skills-dir": %s, "security-guidance@claude-code-plugins": true, "example-skills@anthropic-agent-skills": false, "brightdata-plugin@synced": false}%s}\n' \
|
||||
"$2" "$3" "$d" > "$FX/lib/profiles/$1.json"; }
|
||||
frag full true false no; frag dev false false yes
|
||||
census() { bash "$ROOT/lib/pack-census.sh" --repo "$FX" "$@" 2>&1; }
|
||||
|
||||
out="$(census)"; rc=$?
|
||||
check T1-green-rc "$rc" 0; check_has T1-green "$out" "PACKS OK 2 packs 3 skills"
|
||||
|
||||
rm -r "$FX/skills-external/b1"
|
||||
out="$(census)"; rc=$?
|
||||
check T2-off-dangling-rc "$rc" 0; check_has T2-off-dangling "$out" "WARN pack-beta: b1 target missing"
|
||||
rm -r "$FX/skills-external/a2"
|
||||
out="$(census)"; rc=$?
|
||||
check T3-on-dangling-test-rc "$rc" 0; check_has T3-on-dangling-test "$out" "WARN pack-alpha: a2 target missing"
|
||||
out="$(census --installed)"; rc=$?
|
||||
check T3-on-dangling-doctor-rc "$rc" 1; check_has T3-on-dangling-doctor "$out" "RED pack-alpha: a2 target missing (pack ON)"
|
||||
mkdir -p "$FX/skills-external/a2" "$FX/skills-external/b1"; touch "$FX/skills-external/a2/SKILL.md" "$FX/skills-external/b1/SKILL.md"
|
||||
|
||||
sed -i.bak 's/"pack-alpha"/"pack-alpho"/' "$FX/skills/pack-alpha/.claude-plugin/plugin.json"
|
||||
out="$(census)"; rc=$?
|
||||
check T4-name-rc "$rc" 1; check_has T4-name "$out" "RED pack-alpha: manifest name is pack-alpho"
|
||||
mv "$FX/skills/pack-alpha/.claude-plugin/plugin.json.bak" "$FX/skills/pack-alpha/.claude-plugin/plugin.json"
|
||||
|
||||
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)"
|
||||
rm "$FX/skills/a1"
|
||||
|
||||
ln -s "../../../skills-external/a1" "$FX/skills/pack-alpha/skills/gs-dead"
|
||||
out="$(census)"; rc=$?
|
||||
check T6-retired-rc "$rc" 1; check_has T6-retired "$out" "RED pack-alpha: gs-dead is a retired gstack skill"
|
||||
rm "$FX/skills/pack-alpha/skills/gs-dead"
|
||||
mv "$FX/lib/gstack-removed.list" "$FX/lib/gstack-removed.list.off"
|
||||
out="$(census)"; rc=$?
|
||||
check T6-nolist-rc "$rc" 1; check_has T6-nolist "$out" "RED lib/gstack-removed.list missing"
|
||||
mv "$FX/lib/gstack-removed.list.off" "$FX/lib/gstack-removed.list"
|
||||
|
||||
printf 'Read ~/.claude/skills/a1/SKILL.md\n' > "$FX/hooks/x.sh"
|
||||
cp "$ROOT/lib/tests/fixtures/pack-census-old-citers.sh" "$FX/hooks/y.sh" # the old-layout terms live in a fixture, not in this file (the census scans lib/tests/)
|
||||
out="$(census)"; rc=$?
|
||||
check T7-citer-rc "$rc" 1
|
||||
check_has T7-citer-tilde "$out" "RED hooks/x.sh cites ~/.claude/skills/a1"
|
||||
check_has T7-citer-home "$out" "RED hooks/y.sh cites \$HOME/.claude/skills/a2"
|
||||
check_has T7-citer-disabled "$out" "RED hooks/y.sh cites skills-disable""d/"
|
||||
check_has T7-citer-toggle "$out" "RED hooks/y.sh cites toggle-externa""l"
|
||||
check_has T7-citer-active "$out" "RED hooks/y.sh cites .active-profil""e"
|
||||
check_has T7-citer-profile "$out" "RED hooks/y.sh cites lib/profiles/web.profil""e"
|
||||
rm "$FX/hooks/x.sh" "$FX/hooks/y.sh"
|
||||
|
||||
# fragment invariants
|
||||
printf '{"enabledPlugins": {"model-router@skills-dir": true, "pack-alpha@skills-dir": true}}\n' > "$FX/lib/profiles/short.json"
|
||||
out="$(census)"; rc=$?
|
||||
check T8-keyset-rc "$rc" 1; check_has T8-keyset "$out" "RED lib/profiles/short.json: key set differs from full.json"
|
||||
rm "$FX/lib/profiles/short.json"
|
||||
frag full true true no
|
||||
out="$(census)"; rc=$?
|
||||
check T9-full-defaults-rc "$rc" 1; check_has T9-full-defaults "$out" "RED lib/profiles/full.json: pack-beta@skills-dir is true but the manifest default is false"
|
||||
frag full true false no
|
||||
sed -i.bak 's/"security-guidance@claude-code-plugins": true/"security-guidance@claude-code-plugins": false/' "$FX/lib/profiles/dev.json"
|
||||
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"
|
||||
|
||||
# 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"
|
||||
check T12-shellcheck "$(shellcheck "$ROOT/lib/pack-census.sh" >/dev/null 2>&1 && echo ok)" ok
|
||||
check T12-width "$(LC_ALL=C awk 'length($0) > 80' "$ROOT/lib/pack-census.sh" | wc -l | tr -d ' ')" 0
|
||||
printf 'PASS=%s FAIL=%s\n' "$pass" "$fail"; [ "$fail" -eq 0 ]
|
||||
@@ -5,6 +5,7 @@
|
||||
# adversarial behavior needs a live model (manual smoke), not a CI gate.
|
||||
set -u
|
||||
R="$(cd "$(dirname "$0")/../.." && pwd)"
|
||||
skdir() { ls -d "$R"/skills/"$1" "$R"/skills/pack-*/skills/"$1" 2>/dev/null | head -1 | sed "s#^$R/##"; }
|
||||
pass=0; fail=0
|
||||
ok() { pass=$((pass+1)); }
|
||||
ko() { fail=$((fail+1)); printf 'FAIL %s\n' "$1"; }
|
||||
@@ -41,8 +42,8 @@ has "$L" "fix-bundle"
|
||||
# 3) every reflection orchestrator wires the phase + carries a challenge summary
|
||||
# (hotfix wires it under a logic-only guard — STEP 1.8)
|
||||
for s in ship-feature init-project feat bugfix hotfix onboard audit-delta code-clean seo geo harden web-validate; do
|
||||
has "skills/$s/SKILL.md" "lib/challenge-plan.md"
|
||||
has "skills/$s/SKILL.md" "CHALLENGE SUMMARY"
|
||||
has "$(skdir "$s")/SKILL.md" "lib/challenge-plan.md"
|
||||
has "$(skdir "$s")/SKILL.md" "CHALLENGE SUMMARY"
|
||||
done
|
||||
|
||||
printf 'plan-challenge structure lock: %d pass, %d fail\n' "$pass" "$fail"
|
||||
|
||||
@@ -1,193 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
# lib/tests/profile-census.test.sh — profile catalog invariants (skill-
|
||||
# catalog prune, 2026-09-28): no GSTACK_REMOVED name listed in any
|
||||
# profile, exactly one profile carries the `# SUPERSET-OF: full` marker
|
||||
# and it is a superset of full + the parked tools + every name any
|
||||
# profile carries, and `full` carries every name any other (non-max)
|
||||
# profile carries save one named exception (pr-review-toolkit).
|
||||
#
|
||||
# Hermetic: a passing baseline fixture, then one single-change mutant per
|
||||
# invariant (each mutant is a positive control — it MUST be detected).
|
||||
# Live part runs against this repo's real lib/profiles/ (a violation
|
||||
# there fails the suite for real, same style as
|
||||
# lib/tests/skill-routing-census.test.sh).
|
||||
set -u
|
||||
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
|
||||
# shellcheck source=lib/gstack-removed.sh disable=SC1091
|
||||
source "$ROOT/lib/gstack-removed.sh"
|
||||
|
||||
# Parked = kept installed, out of `full`, listed only in the superset
|
||||
# profile (`max`). Names come from the single denylist above for REMOVED;
|
||||
# PARKED has no such shared source (it is a positive allowlist, not a
|
||||
# denylist), so it is spelled out here.
|
||||
PARKED=(make-pdf diagram 21st-ai 21st-ui-explore 21st-ui-review)
|
||||
|
||||
# full carries every name any other (non-max) profile carries, with one
|
||||
# named exception: pr-review-toolkit is deliberately out of full (audit
|
||||
# 2026-07-02 #12, heaviest single plugin, ~2.2k tokens/session, PR-only
|
||||
# use) — measured 2026-09-28: it is the only name any specialized
|
||||
# profile carries that full lacks (audit.profile).
|
||||
FULL_EXCEPTIONS=(pr-review-toolkit)
|
||||
|
||||
pass=0; fail=0
|
||||
check() { if [ "$2" = "$3" ]; then pass=$((pass+1)); else fail=$((fail+1));
|
||||
printf 'FAIL %s: got[%s] want[%s]\n' "$1" "$2" "$3"; fi; }
|
||||
|
||||
# census_check <profiles_dir> [parked_csv] [exceptions_csv] — one
|
||||
# violation code per line on stdout, rc 0 iff none. REMOVED always comes
|
||||
# from the sourced denylist (single source, never overridden);
|
||||
# PARKED/FULL_EXCEPTIONS default to the real production sets and can be
|
||||
# overridden per call (fixture runs use a small standalone catalog).
|
||||
census_check() {
|
||||
local dir="$1"
|
||||
# Unset (arg omitted, live call) falls back to the real production
|
||||
# set; an explicitly EMPTY string (fixture calls) means "none" and
|
||||
# must stay empty — hence "-" defaults, never ":-" (which would treat
|
||||
# empty the same as unset and silently pull the real set back in).
|
||||
local parked_csv="${2-$(IFS=,; echo "${PARKED[*]}")}"
|
||||
local exc_csv="${3-$(IFS=,; echo "${FULL_EXCEPTIONS[*]}")}"
|
||||
local removed_csv out
|
||||
removed_csv="$(IFS=,; echo "${GSTACK_REMOVED[*]}")"
|
||||
out=$(python3 - "$dir" "$removed_csv" "$parked_csv" "$exc_csv" <<'PY'
|
||||
import glob, os, re, sys
|
||||
|
||||
def entries(path):
|
||||
"""Entry = first whitespace token of a non-blank, non-comment line."""
|
||||
names = set()
|
||||
for line in open(path, encoding="utf-8"):
|
||||
s = line.strip()
|
||||
if s and not s.startswith("#"):
|
||||
names.add(s.split()[0])
|
||||
return names
|
||||
|
||||
def has_marker(path):
|
||||
text = open(path, encoding="utf-8").read()
|
||||
return re.search(r'^# SUPERSET-OF: full\s*$', text, re.M) is not None
|
||||
|
||||
def check_removed(by_name, removed):
|
||||
return [f"REMOVED_LISTED:{n}:{e}" for n, ents in by_name.items()
|
||||
for e in sorted(ents & removed)]
|
||||
|
||||
def find_superset(files):
|
||||
hits = [p for p in files if has_marker(p)]
|
||||
if not hits:
|
||||
return None, ["NO_SUPERSET"]
|
||||
if len(hits) > 1:
|
||||
return None, ["MANY_SUPERSETS"]
|
||||
return os.path.basename(hits[0])[:-len(".profile")], []
|
||||
|
||||
def check_superset_gap(by_name, sname, parked, exceptions):
|
||||
full = by_name.get("full", set())
|
||||
target = full | parked | exceptions
|
||||
return [f"SUPERSET_GAP:{n}" for n in sorted(target - by_name[sname])]
|
||||
|
||||
def check_max_gap(by_name, sname, removed):
|
||||
union = set().union(*by_name.values())
|
||||
gap = (union - removed) - by_name[sname]
|
||||
return [f"MAX_GAP:{n}" for n in sorted(gap)]
|
||||
|
||||
def check_full_gap(by_name, sname, removed, exceptions):
|
||||
trio = {"21st-ai", "21st-ui-explore", "21st-ui-review"}
|
||||
src = set().union(*(e for n, e in by_name.items()
|
||||
if n not in ("full", sname)))
|
||||
full = by_name.get("full", set())
|
||||
gap = src - full - removed - trio - exceptions
|
||||
return [f"FULL_GAP:{n}" for n in sorted(gap)]
|
||||
|
||||
def main():
|
||||
d, removed_csv, parked_csv, exc_csv = sys.argv[1:5]
|
||||
removed = {x for x in removed_csv.split(",") if x}
|
||||
parked = {x for x in parked_csv.split(",") if x}
|
||||
exceptions = {x for x in exc_csv.split(",") if x}
|
||||
|
||||
files = sorted(glob.glob(os.path.join(d, "*.profile")))
|
||||
by_name = {os.path.basename(p)[:-len(".profile")]: entries(p)
|
||||
for p in files}
|
||||
|
||||
violations = check_removed(by_name, removed)
|
||||
sname, sup_violations = find_superset(files)
|
||||
violations += sup_violations
|
||||
if sname:
|
||||
violations += check_superset_gap(by_name, sname, parked, exceptions)
|
||||
violations += check_max_gap(by_name, sname, removed)
|
||||
violations += check_full_gap(by_name, sname, removed, exceptions)
|
||||
|
||||
# Reason codes only, one per line; no exit here — the bash caller
|
||||
# derives pass/fail from whether this captured output is empty.
|
||||
print("\n".join(violations))
|
||||
|
||||
main()
|
||||
PY
|
||||
)
|
||||
if [ -n "$out" ]; then
|
||||
printf '%s\n' "$out"
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
# run_mutant <label> <dir> <code> <flag> — census_check on <dir> (fixture
|
||||
# PARKED override, empty FULL_EXCEPTIONS), asserts a non-zero rc AND the
|
||||
# presence of <code>; echoes <flag> when both hold (the positive-control
|
||||
# marker the contract CHECK greps for).
|
||||
run_mutant() {
|
||||
local label="$1" dir="$2" code="$3" flag="$4"
|
||||
local out rc hit nonzero
|
||||
out=$(census_check "$dir" "parked-x" ""); rc=$?
|
||||
[ -n "$out" ] && printf '%s\n' "$out"
|
||||
hit=$(printf '%s\n' "$out" | grep -qxF "$code" && echo yes || echo no)
|
||||
nonzero=$([ "$rc" -ne 0 ] && echo yes || echo no)
|
||||
check "$label-code" "$hit" yes
|
||||
check "$label-nonzero" "$nonzero" yes
|
||||
[ "$hit" = yes ] && [ "$nonzero" = yes ] && echo "$flag"
|
||||
}
|
||||
|
||||
# ── live: this repo's real profiles dir (a violation here → suite RED) ──
|
||||
live_out=$(census_check "$ROOT/lib/profiles"); live_rc=$?
|
||||
[ -n "$live_out" ] && printf '%s\n' "$live_out"
|
||||
check T1-live-clean "$live_rc" 0
|
||||
|
||||
# ── fixtures: baseline + one single-change mutant per invariant ────────
|
||||
WORK="$(mktemp -d)"; trap 'rm -rf "$WORK"' EXIT
|
||||
BASE="$WORK/baseline"
|
||||
mkdir -p "$BASE"
|
||||
cat > "$BASE/full.profile" <<'EOF'
|
||||
alpha
|
||||
beta
|
||||
EOF
|
||||
cat > "$BASE/qa.profile" <<'EOF'
|
||||
alpha
|
||||
EOF
|
||||
cat > "$BASE/max.profile" <<'EOF'
|
||||
# SUPERSET-OF: full
|
||||
alpha
|
||||
beta
|
||||
parked-x
|
||||
EOF
|
||||
|
||||
base_out=$(census_check "$BASE" "parked-x" ""); base_rc=$?
|
||||
[ -n "$base_out" ] && printf '%s\n' "$base_out"
|
||||
check T2-fixture-baseline-clean "$base_rc" 0
|
||||
[ "$base_rc" -eq 0 ] && echo FIXTURE_BASELINE_OK
|
||||
|
||||
# Mutant 1: a REMOVED name (ship) added to a profile other than full.
|
||||
M1="$WORK/mutant-removed"; cp -r "$BASE" "$M1"
|
||||
printf 'ship\n' >> "$M1/qa.profile"
|
||||
run_mutant T3-mutant-removed "$M1" 'REMOVED_LISTED:qa:ship' \
|
||||
FIXTURE_REMOVED_DETECTED
|
||||
|
||||
# Mutant 2: the superset profile drops a name full carries.
|
||||
M2="$WORK/mutant-superset"; cp -r "$BASE" "$M2"
|
||||
# BSD sed -i needs a suffix argument
|
||||
sed -i.bak '/^beta$/d' "$M2/max.profile" && rm -f "$M2/max.profile.bak"
|
||||
run_mutant T4-mutant-superset "$M2" 'SUPERSET_GAP:beta' \
|
||||
FIXTURE_SUPERSET_DETECTED
|
||||
|
||||
# Mutant 3: a non-full, non-superset profile carries a name full lacks.
|
||||
M3="$WORK/mutant-fullgap"; cp -r "$BASE" "$M3"
|
||||
printf 'gamma\n' >> "$M3/qa.profile"
|
||||
run_mutant T5-mutant-fullgap "$M3" 'FULL_GAP:gamma' \
|
||||
FIXTURE_FULLGAP_DETECTED
|
||||
|
||||
echo "PASS=$pass FAIL=$fail"
|
||||
[ "$fail" -eq 0 ]
|
||||
@@ -1,136 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
# lib/tests/profile-default.test.sh — default profile (full) when nothing is
|
||||
# selected: `current` is label-driven (BDR-030 — gstack starts off, so a
|
||||
# parked count says nothing about which profile is on), `reset` lands on
|
||||
# DEFAULT_PROFILE, `gstack off` resolves the default through active_profile(),
|
||||
# and hooks/statusline.sh falls back to the same constant. Covers contract
|
||||
# criteria 2/3/4/5. Hermetic: fixture repo via *_REPO_OVERRIDE + fake `claude`
|
||||
# on PATH — same harness as profile-set-managed.test.sh.
|
||||
set -u
|
||||
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
|
||||
pass=0; fail=0
|
||||
check() { if [ "$2" = "$3" ]; then pass=$((pass+1)); else fail=$((fail+1));
|
||||
printf 'FAIL %s: got[%s] want[%s]\n' "$1" "$2" "$3"; fi; }
|
||||
check_has() { case "$2" in *"$3"*) pass=$((pass+1));; *) fail=$((fail+1));
|
||||
printf 'FAIL %s: [%s] does not contain [%s]\n' "$1" "$2" "$3";; esac; }
|
||||
check_not() { case "$2" in *"$3"*) fail=$((fail+1));
|
||||
printf 'FAIL %s: [%s] unexpectedly contains [%s]\n' "$1" "$2" "$3";; *) pass=$((pass+1));; esac; }
|
||||
|
||||
FX="$(mktemp -d)"; trap 'rm -rf "$FX"' EXIT
|
||||
mkdir -p "$FX/skills" "$FX/skills-disabled" "$FX/lib/profiles" "$FX/bin" \
|
||||
"$FX/hooks" "$FX/skills-external/emil-design-eng" \
|
||||
"$FX/skills-external/observability-and-instrumentation"
|
||||
for g in gs-a gs-b gs-c; do
|
||||
mkdir -p "$FX/skills-external/gstack/$g"
|
||||
touch "$FX/skills-external/gstack/$g/SKILL.md"
|
||||
done
|
||||
cp "$ROOT/lib/profile.sh" "$ROOT/lib/toggle-external.sh" \
|
||||
"$ROOT/lib/gstack-removed.sh" "$FX/lib/"
|
||||
cp "$ROOT/hooks/statusline.sh" "$FX/hooks/"
|
||||
|
||||
cat > "$FX/lib/profiles/full.profile" <<'EOF'
|
||||
gs-a
|
||||
gs-b
|
||||
emil-design-eng external
|
||||
observability-and-instrumentation external
|
||||
EOF
|
||||
cat > "$FX/lib/profiles/otherish.profile" <<'EOF'
|
||||
gs-c
|
||||
EOF
|
||||
|
||||
# Fake claude: logs every call, prints nothing — skill_status greps for
|
||||
# "✔ enabled" and finds nothing, so every managed plugin reads back
|
||||
# "disabled" and set/reset never touch real plugin state.
|
||||
cat > "$FX/bin/claude" <<EOF
|
||||
#!/usr/bin/env bash
|
||||
FX="$FX"
|
||||
echo "\$*" >> "\$FX/claude-calls.log"
|
||||
exit 0
|
||||
EOF
|
||||
chmod +x "$FX/bin/claude"
|
||||
|
||||
run() { PATH="$FX/bin:$PATH" PROFILE_REPO_OVERRIDE="$FX" \
|
||||
TOGGLE_EXTERNAL_REPO_OVERRIDE="$FX" bash "$FX/lib/profile.sh" "$@"; }
|
||||
statusline() { echo '{}' | bash "$FX/hooks/statusline.sh"; }
|
||||
first_word() { printf '%s' "${1%% *}"; }
|
||||
|
||||
# --- T1: clean seed, no cache — current names the default, "not applied" ---
|
||||
out="$(run current)"
|
||||
check T1-first-word "$(first_word "$out")" full
|
||||
check_has T1-not-applied "$out" "default — not applied yet"
|
||||
check_not T1-no-all-gstack "$out" "all gstack"
|
||||
|
||||
# --- T2: clean seed, no cache — gstack off is a clean no-op (rc 0) ---
|
||||
run gstack off >/dev/null 2>&1; rc=$?
|
||||
check T2-rc "$rc" 0
|
||||
|
||||
# --- T2b: one gstack skill manually linked, no cache — off parks just it ---
|
||||
ln -s "$FX/skills-external/gstack/gs-c" "$FX/skills/gs-c"
|
||||
run gstack off >/dev/null 2>&1; rc=$?
|
||||
check T2b-rc "$rc" 0
|
||||
check T2b-gsc-parked "$([ -e "$FX/skills-disabled/gstack__gs-c" ] && echo p || echo n)" p
|
||||
check T2b-gsa-absent "$([ -e "$FX/skills/gs-a" ] && echo on || echo off)" off
|
||||
rm -rf "$FX/skills-disabled/gstack__gs-c" # back to the clean seed
|
||||
|
||||
# --- T3: cache "none" (CRLF) — off is still a clean no-op ---
|
||||
printf 'none\r\n' > "$FX/.active-profile"
|
||||
run gstack off >/dev/null 2>&1; rc=$?
|
||||
check T3-rc "$rc" 0
|
||||
|
||||
# --- T4: cache names an unknown profile — off errors, current says so ---
|
||||
printf 'ghost\n' > "$FX/.active-profile"
|
||||
run gstack off >/dev/null 2>&1; rc=$?
|
||||
check T4-rc "$rc" 1
|
||||
out="$(run current)"
|
||||
check T4-first-word "$(first_word "$out")" ghost
|
||||
check_has T4-unknown "$out" "unknown profile"
|
||||
|
||||
# --- T5: reset lands on the default profile, exclusively ---
|
||||
run reset >/dev/null 2>&1
|
||||
check T5-cache "$(cat "$FX/.active-profile" 2>/dev/null)" full
|
||||
check T5-gsa-on "$([ -e "$FX/skills/gs-a" ] && echo on || echo off)" on
|
||||
check T5-gsb-on "$([ -e "$FX/skills/gs-b" ] && echo on || echo off)" on
|
||||
check T5-gsc-off "$([ -e "$FX/skills/gs-c" ] && echo on || echo off)" off
|
||||
check T5-emil-on "$([ -e "$FX/skills/emil-design-eng" ] && echo on || echo off)" on
|
||||
check T5-obs-on "$([ -e "$FX/skills/observability-and-instrumentation" ] && echo on || echo off)" on
|
||||
out="$(run current)"
|
||||
check T5-first-word "$(first_word "$out")" full
|
||||
check_has T5-match "$out" "100% match"
|
||||
check_not T5-not-applied "$out" "not applied"
|
||||
|
||||
# --- T6: current is label-driven even for a gstack-only profile ---
|
||||
run set otherish >/dev/null 2>&1
|
||||
out="$(run current)"
|
||||
check T6-first-word "$(first_word "$out")" otherish
|
||||
run reset >/dev/null 2>&1
|
||||
check T6-gsc-parked "$([ -e "$FX/skills-disabled/gstack__gs-c" ] && echo p || echo n)" p
|
||||
check T6-gsa-on "$([ -e "$FX/skills/gs-a" ] && echo on || echo off)" on
|
||||
check T6-cache "$(cat "$FX/.active-profile" 2>/dev/null)" full
|
||||
|
||||
# --- T7: gstack on restores parked skills, keeps the profile label ---
|
||||
run set otherish >/dev/null 2>&1
|
||||
run gstack on >/dev/null 2>&1
|
||||
out="$(run current)"
|
||||
check T7-first-word "$(first_word "$out")" otherish
|
||||
check_not T7-no-default "$out" "default"
|
||||
|
||||
# --- T8-T11: statusline fallback + constant read ---
|
||||
rm -f "$FX/.active-profile"
|
||||
out="$(statusline)"
|
||||
check_has T8-full "$out" "profile: full"
|
||||
|
||||
printf 'otherish\n' > "$FX/.active-profile"
|
||||
out="$(statusline)"
|
||||
check_has T9-otherish "$out" "profile: otherish"
|
||||
|
||||
printf ' none \r' > "$FX/.active-profile"
|
||||
out="$(statusline)"
|
||||
check_has T10-full "$out" "profile: full"
|
||||
|
||||
# BSD sed -i needs a suffix argument
|
||||
sed -i.bak 's/^DEFAULT_PROFILE="full"/DEFAULT_PROFILE="otherish"/' "$FX/lib/profile.sh" && rm -f "$FX/lib/profile.sh.bak"
|
||||
rm -f "$FX/.active-profile"
|
||||
out="$(statusline)"
|
||||
check_has T11-otherish "$out" "profile: otherish"
|
||||
|
||||
printf 'PASS=%s FAIL=%s\n' "$pass" "$fail"; [ "$fail" -eq 0 ]
|
||||
@@ -1,104 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
# lib/tests/profile-set-managed.test.sh — `set` symmetry on managed
|
||||
# externals, gstack on-demand, external from-source (BDR-079). No MCP is
|
||||
# managed (MANAGED_MCPS is empty): the 21st skills are managed as externals,
|
||||
# so the pack's park/restore round-trip is what this covers on that side.
|
||||
# Hermetic: fixture repo via *_REPO_OVERRIDE + fake `claude` on PATH.
|
||||
set -u
|
||||
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
|
||||
pass=0; fail=0
|
||||
check() { if [ "$2" = "$3" ]; then pass=$((pass+1)); else fail=$((fail+1));
|
||||
printf 'FAIL %s: got[%s] want[%s]\n' "$1" "$2" "$3"; fi; }
|
||||
|
||||
FX="$(mktemp -d)"; trap 'rm -rf "$FX"' EXIT
|
||||
mkdir -p "$FX/skills" "$FX/skills-disabled" "$FX/lib/profiles" "$FX/bin" \
|
||||
"$FX/skills-external/emil-design-eng" "$FX/skills-external/other-ext" \
|
||||
"$FX/skills-external/21st-ui-build" \
|
||||
"$FX/skills-external/observability-and-instrumentation"
|
||||
for g in gs-a gs-b gs-c; do
|
||||
mkdir -p "$FX/skills-external/gstack/$g"
|
||||
touch "$FX/skills-external/gstack/$g/SKILL.md"
|
||||
done
|
||||
cp "$ROOT/lib/profile.sh" "$ROOT/lib/toggle-external.sh" \
|
||||
"$ROOT/lib/gstack-removed.sh" "$FX/lib/"
|
||||
|
||||
# Non-managed external, enabled from the start — must never be touched.
|
||||
ln -s "$FX/skills-external/other-ext" "$FX/skills/other-ext"
|
||||
|
||||
cat > "$FX/lib/profiles/designish.profile" <<'EOF'
|
||||
gs-a
|
||||
gs-b
|
||||
emil-design-eng external
|
||||
21st-ui-build external
|
||||
observability-and-instrumentation external
|
||||
EOF
|
||||
cat > "$FX/lib/profiles/backendish.profile" <<'EOF'
|
||||
gs-c
|
||||
EOF
|
||||
|
||||
# Fake claude: logs every call. No MCP state to keep — MANAGED_MCPS is empty,
|
||||
# so `set` must never reach for `claude mcp` at all (asserted below).
|
||||
cat > "$FX/bin/claude" <<EOF
|
||||
#!/usr/bin/env bash
|
||||
FX="$FX"
|
||||
echo "\$*" >> "\$FX/claude-calls.log"
|
||||
exit 0
|
||||
EOF
|
||||
chmod +x "$FX/bin/claude"
|
||||
|
||||
run() { PATH="$FX/bin:$PATH" PROFILE_REPO_OVERRIDE="$FX" \
|
||||
TOGGLE_EXTERNAL_REPO_OVERRIDE="$FX" bash "$FX/lib/profile.sh" "$@"; }
|
||||
|
||||
# --- set designish: gstack on-demand + externals from-source (21st + emil) ---
|
||||
run set designish >/dev/null 2>&1
|
||||
check T1-gsa-on "$([ -e "$FX/skills/gs-a" ] && echo on || echo off)" on
|
||||
check T2-gsb-on "$([ -e "$FX/skills/gs-b" ] && echo on || echo off)" on
|
||||
check T3-gsc-off "$([ -e "$FX/skills/gs-c" ] && echo on || echo off)" off
|
||||
check T4-emil-src "$([ -L "$FX/skills/emil-design-eng" ] && echo on || echo off)" on
|
||||
check T5-21st-src "$([ -L "$FX/skills/21st-ui-build" ] && echo on || echo off)" on
|
||||
check T5b-obs-src "$([ -L "$FX/skills/observability-and-instrumentation" ] && echo on || echo off)" on
|
||||
check T6-no-mcp "$(grep -c '^mcp ' "$FX/claude-calls.log" || true)" 0
|
||||
|
||||
# --- set backendish: managed leftovers parked/unregistered ---
|
||||
run set backendish >/dev/null 2>&1
|
||||
check T7-gsc-on "$([ -e "$FX/skills/gs-c" ] && echo on || echo off)" on
|
||||
check T8-gsa-park "$([ -e "$FX/skills-disabled/gstack__gs-a" ] && echo p || echo n)" p
|
||||
check T9-emil-off "$([ -e "$FX/skills/emil-design-eng" ] && echo on || echo off)" off
|
||||
check T10-emil-park "$([ -e "$FX/skills-disabled/emil-design-eng" ] && echo p || echo n)" p
|
||||
check T11-21st-off "$([ -e "$FX/skills/21st-ui-build" ] && echo on || echo off)" off
|
||||
check T12-21st-park "$([ -e "$FX/skills-disabled/21st-ui-build" ] && echo p || echo n)" p
|
||||
check T12b-obs-off "$([ -e "$FX/skills/observability-and-instrumentation" ] && echo on || echo off)" off
|
||||
check T12c-obs-park "$([ -e "$FX/skills-disabled/observability-and-instrumentation" ] && echo p || echo n)" p
|
||||
check T13-other-untouched "$([ -e "$FX/skills/other-ext" ] && echo on || echo off)" on
|
||||
|
||||
# --- back to designish: parked external restored (not re-sourced) ---
|
||||
run set designish >/dev/null 2>&1
|
||||
check T14-emil-back "$([ -e "$FX/skills/emil-design-eng" ] && echo on || echo off)" on
|
||||
check T15-park-gone "$([ -e "$FX/skills-disabled/emil-design-eng" ] && echo p || echo n)" n
|
||||
check T16-21st-back "$([ -e "$FX/skills/21st-ui-build" ] && echo on || echo off)" on
|
||||
check T16b-obs-back "$([ -e "$FX/skills/observability-and-instrumentation" ] && echo on || echo off)" on
|
||||
check T16c-obs-park-gone "$([ -e "$FX/skills-disabled/observability-and-instrumentation" ] && echo p || echo n)" n
|
||||
check T17-no-mcp-ever "$(grep -c '^mcp ' "$FX/claude-calls.log" || true)" 0
|
||||
|
||||
# --- a failing `claude plugin enable` must warn, never abort `set` ---
|
||||
# Guards the capture-inside-the-condition form: a bare out="$(claude …)"
|
||||
# would trip errexit and skip every entry after the plugin.
|
||||
mkdir -p "$FX/failbin"
|
||||
cat > "$FX/failbin/claude" <<'EOF'
|
||||
#!/usr/bin/env bash
|
||||
[ "$1 $2" = "plugin enable" ] && exit 1
|
||||
exit 0
|
||||
EOF
|
||||
chmod +x "$FX/failbin/claude"
|
||||
cat > "$FX/lib/profiles/pluginish.profile" <<'EOF'
|
||||
fake-plug plugin@fake-market
|
||||
gs-a
|
||||
EOF
|
||||
rm -f "$FX/skills/gs-a"
|
||||
PATH="$FX/failbin:$PATH" PROFILE_REPO_OVERRIDE="$FX" \
|
||||
TOGGLE_EXTERNAL_REPO_OVERRIDE="$FX" bash "$FX/lib/profile.sh" set pluginish \
|
||||
>/dev/null 2>&1
|
||||
check T18-failing-plugin-enable-keeps-going \
|
||||
"$([ -e "$FX/skills/gs-a" ] && echo on || echo off)" on
|
||||
|
||||
printf 'PASS=%s FAIL=%s\n' "$pass" "$fail"; [ "$fail" -eq 0 ]
|
||||
Executable
+137
@@ -0,0 +1,137 @@
|
||||
#!/usr/bin/env bash
|
||||
# lib/tests/profile.test.sh — lib/profile.sh + lib/profile-state.jq on a
|
||||
# fixture repo: fragments, the four precedence levels, the deniedMcpServers
|
||||
# union, set/unset/enable/disable merge semantics, refusals (rc 2, nothing
|
||||
# written), the /mcp toggle, root walk-up, timing. Hermetic:
|
||||
# PROFILE_REPO_OVERRIDE + PROFILE_USER_SETTINGS + PROFILE_CLAUDE_JSON, no claude.
|
||||
set -u
|
||||
unset CLAUDE_PROFILE CLAUDE_PROFILE_SETTINGS
|
||||
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
|
||||
pass=0; fail=0
|
||||
check() { if [ "$2" = "$3" ]; then pass=$((pass+1)); else fail=$((fail+1));
|
||||
printf 'FAIL %s: got[%s] want[%s]\n' "$1" "$2" "$3"; fi; }
|
||||
check_has() { case "$2" in *"$3"*) pass=$((pass+1));; *) fail=$((fail+1));
|
||||
printf 'FAIL %s: [%s] does not contain [%s]\n' "$1" "$2" "$3";; esac; }
|
||||
|
||||
FX="$(mktemp -d)"; trap 'rm -rf "$FX"' EXIT
|
||||
mkdir -p "$FX/lib/profiles" "$FX/skills" "$FX/proj/.claude" "$FX/proj/sub/deeper" "$FX/home" "$FX/nowhere"
|
||||
mk_pack() { mkdir -p "$FX/skills/pack-$1/.claude-plugin"
|
||||
printf '{"name":"pack-%s","defaultEnabled":%s}\n' "$1" "$2" > "$FX/skills/pack-$1/.claude-plugin/plugin.json"; }
|
||||
mk_pack a true; mk_pack b false # pack-c has no dir (missing)
|
||||
frag() { # name pack-a pack-b pack-c ui deny(yes|no) [model]
|
||||
local d="" m=""
|
||||
[ "$6" = yes ] && d=', "deniedMcpServers": [{"serverName": "claude.ai X"}, {"serverName": "claude.ai Y"}]'
|
||||
[ -n "${7:-}" ] && m=", \"model\": \"$7\""
|
||||
printf '{"enabledPlugins": {"model-router@skills-dir": true, "pack-a@skills-dir": %s, "pack-b@skills-dir": %s, "pack-c@skills-dir": %s, "ui@mk": %s}%s%s}\n' \
|
||||
"$2" "$3" "$4" "$5" "$d" "$m" > "$FX/lib/profiles/$1.json"; }
|
||||
frag fullx true false false true no # = manifest defaults + user ui on
|
||||
frag devx true false false false yes
|
||||
frag minix false false false false yes haiku
|
||||
printf -- '- **fullx**: everything\n- **devx**: dev only\n- **minix**: nothing\n' > "$FX/lib/profiles/README.md"
|
||||
printf '{"enabledPlugins": {"ui@mk": true}}\n' > "$FX/home/settings.json"
|
||||
printf '{}\n' > "$FX/home/claude.json"
|
||||
printf '# proj\n' > "$FX/proj/CLAUDE.md"
|
||||
P() { PROFILE_REPO_OVERRIDE="$FX" PROFILE_USER_SETTINGS="$FX/home/settings.json" \
|
||||
PROFILE_CLAUDE_JSON="$FX/home/claude.json" bash "$ROOT/lib/profile.sh" -C "$FX/proj" "$@"; }
|
||||
plain() { P current --plain | tr '\n' ' '; }
|
||||
L="$FX/proj/.claude/settings.local.json"
|
||||
|
||||
out="$(P list)"; check_has T1-list "$out" "dev only"; check_has T1-list-name "$out" "devx"
|
||||
out="$(P show devx)"; check_has T2-show-on "$out" "pack-a@skills-dir"
|
||||
check_has T2-show-missing "$out" "off missing (no skills/pack-c/)"
|
||||
check_has T2-show-deny "$out" "connectors denied: claude.ai X, claude.ai Y"
|
||||
|
||||
out="$(plain)"
|
||||
check_has T3-default "$out" "profile=fullx source=default flag=- pack-a=on pack-b=off pack-c=off plugin:model-router@skills-dir=on plugin:ui@mk=on model=- model-source=- mcp-off=-"
|
||||
out="$(P current)"; check_has T3-human "$out" "profile: fullx [default]"
|
||||
|
||||
# precedence, before any local write: project settings.json over user
|
||||
printf '{"enabledPlugins": {"pack-b@skills-dir": true}, "model": "opus"}\n' > "$FX/proj/.claude/settings.json"
|
||||
out="$(plain)"; check_has T6-project "$out" "profile=custom source=default flag=- pack-a=on pack-b=on "
|
||||
check_has T6-project-model "$out" "model=opus model-source=project "
|
||||
rm "$FX/proj/.claude/settings.json"
|
||||
|
||||
# set keeps the other keys, writes the managed ones
|
||||
printf '{"permissions": {"allow": ["Bash(ls)"]}, "model": "sonnet"}\n' > "$L"
|
||||
out="$(P set devx)"; rc=$?
|
||||
check T4-set-rc "$rc" 0; check_has T4-set-hint "$out" "/reload-plugins"
|
||||
check T4-keep-perm "$(jq -c .permissions "$L")" '{"allow":["Bash(ls)"]}'
|
||||
check T4-keep-model "$(jq -r .model "$L")" sonnet
|
||||
check T4-deny "$(jq -c '[.deniedMcpServers[].serverName]' "$L")" '["claude.ai X","claude.ai Y"]'
|
||||
out="$(plain)"
|
||||
check_has T5-local "$out" "profile=devx source=local flag=- pack-a=on pack-b=off pack-c=off plugin:model-router@skills-dir=on plugin:ui@mk=off connector:claude.ai X=denied connector:claude.ai Y=denied model=sonnet model-source=local mcp-off=-"
|
||||
|
||||
# local over project; flag over local
|
||||
printf '{"enabledPlugins": {"pack-b@skills-dir": true}}\n' > "$FX/proj/.claude/settings.json"
|
||||
out="$(plain)"; check_has T6-local-over-project "$out" "profile=devx source=local flag=- pack-a=on pack-b=off "
|
||||
printf '{"enabledPlugins": {"pack-b@skills-dir": true}}\n' > "$FX/flag.json"
|
||||
out="$(CLAUDE_PROFILE_SETTINGS="$FX/flag.json" CLAUDE_PROFILE=x plain)"
|
||||
check_has T6-flag "$out" "profile=custom source=flag flag=x pack-a=on pack-b=on "
|
||||
rm "$FX/proj/.claude/settings.json"
|
||||
|
||||
# union of deniedMcpServers: flag fullx over local devx keeps the denies → custom
|
||||
out="$(CLAUDE_PROFILE_SETTINGS="$FX/lib/profiles/fullx.json" CLAUDE_PROFILE=fullx plain)"
|
||||
check_has T7-union "$out" "profile=custom source=flag flag=fullx "
|
||||
check_has T7-union-denied "$out" "connector:claude.ai X=denied "
|
||||
|
||||
# refusals
|
||||
cp "$L" "$FX/before.json"; printf '{"enabledPlugins": \n' > "$L"; cp "$L" "$FX/broken.json"
|
||||
out="$(P set devx 2>&1)"; rc=$?
|
||||
check T8-invalid-rc "$rc" 2; check_has T8-invalid-msg "$out" "not valid JSON"
|
||||
check T8-invalid-untouched "$(cmp -s "$FX/broken.json" "$L" && echo same)" same
|
||||
cp "$FX/before.json" "$L"
|
||||
out="$(PROFILE_REPO_OVERRIDE="$FX" PROFILE_USER_SETTINGS="$FX/home/settings.json" PROFILE_CLAUDE_JSON="$FX/home/claude.json" \
|
||||
bash "$ROOT/lib/profile.sh" -C "$FX/nowhere" set devx 2>&1)"; rc=$?
|
||||
check T9-root-rc "$rc" 2; check_has T9-root-msg "$out" "not a project root"; check T9-root-nothing "$(ls -A "$FX/nowhere")" ""
|
||||
out="$(P set nope 2>&1)"; rc=$?; check T10-unknown-rc "$rc" 2; check_has T10-unknown-list "$out" "fullx"
|
||||
|
||||
# enable / disable, three spellings, flag note
|
||||
P enable b >/dev/null; check T11-enable "$(jq -r '.enabledPlugins["pack-b@skills-dir"]' "$L")" true
|
||||
P disable pack-b >/dev/null; check T11-disable "$(jq -r '.enabledPlugins["pack-b@skills-dir"]' "$L")" false
|
||||
P enable pack-b@skills-dir >/dev/null; check T11-enable-id "$(jq -r '.enabledPlugins["pack-b@skills-dir"]' "$L")" true
|
||||
out="$(P enable zzz 2>&1)"; rc=$?; check T11-unknown "$rc" 2
|
||||
out="$(CLAUDE_PROFILE_SETTINGS="$FX/flag.json" CLAUDE_PROFILE=x P enable a 2>&1)"
|
||||
check_has T11-flag-note "$out" "relaunch: cc <name> <profile>"
|
||||
P disable b >/dev/null
|
||||
|
||||
# unset: managed keys gone, permissions kept; model removed only when it is the profile's
|
||||
P unset >/dev/null
|
||||
check T12-unset-ep "$(jq -c '.enabledPlugins // "gone"' "$L")" '"gone"'
|
||||
check T12-unset-deny "$(jq -c '.deniedMcpServers // "gone"' "$L")" '"gone"'
|
||||
check T12-unset-perm "$(jq -c .permissions "$L")" '{"allow":["Bash(ls)"]}'
|
||||
check T12-unset-model-kept "$(jq -r .model "$L")" sonnet
|
||||
P set minix >/dev/null; check T12-minix-model "$(jq -r .model "$L")" haiku
|
||||
P unset >/dev/null; check T12-minix-model-gone "$(jq -r '.model // "gone"' "$L")" gone
|
||||
|
||||
# /mcp toggle; unreadable ~/.claude.json; disableClaudeAiConnectors any-source
|
||||
printf '{"projects": {"%s": {"disabledMcpServers": ["foo", "bar"]}}}\n' "$FX/proj" > "$FX/home/claude.json"
|
||||
out="$(P current)"; check_has T13-mcp-off "$out" "profile: custom (off: foo,bar) [default]"
|
||||
out="$(plain)"; check_has T13-mcp-off-plain "$out" "mcp-off=foo,bar"
|
||||
printf '{broken\n' > "$FX/home/claude.json"
|
||||
out="$(plain)"; rc=$?; check T14-unknown-rc "$rc" 0; check_has T14-unknown "$out" "mcp-off=unknown"
|
||||
printf '{}\n' > "$FX/home/claude.json"
|
||||
printf '{"enabledPlugins": {"ui@mk": true}, "disableClaudeAiConnectors": true}\n' > "$FX/home/settings.json"
|
||||
out="$(plain)"; check_has T15-all-denied "$out" "connector:*=denied"; check_has T15-custom "$out" "profile=custom "
|
||||
printf '{"enabledPlugins": {"ui@mk": true}}\n' > "$FX/home/settings.json"
|
||||
|
||||
# a missing pack still written; diff
|
||||
P set devx >/dev/null; check T16-missing-written "$(jq -r '.enabledPlugins["pack-c@skills-dir"]' "$L")" false
|
||||
out="$(P diff fullx)"; check_has T17-diff-ui "$out" "ui@mk: off → on"
|
||||
check_has T17-diff-conn "$out" "connectors denied: claude.ai X, claude.ai Y → "
|
||||
out="$(P diff devx)"; check T17-nodiff "$out" "no difference from devx"
|
||||
|
||||
# shellcheck + width
|
||||
check T18-shellcheck "$(shellcheck "$ROOT/lib/profile.sh" >/dev/null 2>&1 && echo ok)" ok
|
||||
check T18-width "$(LC_ALL=C awk 'length($0) > 80' "$ROOT/lib/profile.sh" "$ROOT/lib/profile-state.jq" | wc -l | tr -d ' ')" 0
|
||||
|
||||
# root walk-up from a subdirectory; a bare dir stays itself
|
||||
out="$(PROFILE_REPO_OVERRIDE="$FX" PROFILE_USER_SETTINGS="$FX/home/settings.json" PROFILE_CLAUDE_JSON="$FX/home/claude.json" \
|
||||
bash "$ROOT/lib/profile.sh" -C "$FX/proj/sub/deeper" current --plain | tr '\n' ' ')"
|
||||
check_has T19-walkup "$out" "profile=devx source=local "
|
||||
|
||||
# timing: two jq calls, under 100 ms here (spec target 50 ms, measured in Task 12)
|
||||
t0=$(date +%s%N); P current --plain >/dev/null; t1=$(date +%s%N)
|
||||
ms=$(( (t1 - t0) / 1000000 )); echo "current --plain: ${ms} ms"
|
||||
check T20-timing "$([ "$ms" -le 100 ] && echo fast || echo "slow:${ms}ms")" fast
|
||||
|
||||
printf 'PASS=%s FAIL=%s\n' "$pass" "$fail"; [ "$fail" -eq 0 ]
|
||||
@@ -19,12 +19,12 @@ GEO=agents/geo-analyzer.md
|
||||
# skills/geo STEP 1B) fail-closes on this exact shape
|
||||
has "$SEO" 'SEO JUDGE — VERDICT: ERROR('
|
||||
has "$GEO" 'GEO JUDGE — VERDICT: ERROR('
|
||||
has "skills/seo/SKILL.md" 'SEO JUDGE — VERDICT: ERROR('
|
||||
has "skills/geo/SKILL.md" 'GEO JUDGE — VERDICT: ERROR('
|
||||
has "skills/pack-seo/skills/seo/SKILL.md" 'SEO JUDGE — VERDICT: ERROR('
|
||||
has "skills/pack-seo/skills/geo/SKILL.md" 'GEO JUDGE — VERDICT: ERROR('
|
||||
|
||||
# 2) fix-bundle section + apply sentinel — parsed by /seo STEP 1b/1.5 and
|
||||
# /geo STEP 1b/2 before any L1 apply
|
||||
for f in "$SEO" "$GEO" skills/seo/SKILL.md skills/geo/SKILL.md; do
|
||||
for f in "$SEO" "$GEO" skills/pack-seo/skills/seo/SKILL.md skills/pack-seo/skills/geo/SKILL.md; do
|
||||
has "$f" '## FIX BUNDLE'
|
||||
has "$f" 'READY TO APPLY — awaiting dispatcher confirmation'
|
||||
done
|
||||
@@ -32,8 +32,8 @@ done
|
||||
# 3) signals handoff — judge loads the collect artifact fail-closed
|
||||
has "$SEO" '.audit/seo-signals-'
|
||||
has "$GEO" '.audit/geo-signals-'
|
||||
has "skills/seo/SKILL.md" '.audit/seo-signals-<RUNID_SEO>.md'
|
||||
has "skills/geo/SKILL.md" '.audit/geo-signals-<RUNID>.md'
|
||||
has "skills/pack-seo/skills/seo/SKILL.md" '.audit/seo-signals-<RUNID_SEO>.md'
|
||||
has "skills/pack-seo/skills/geo/SKILL.md" '.audit/geo-signals-<RUNID>.md'
|
||||
|
||||
# 4) STEP numbering — dispatchers reference agent step ranges literally:
|
||||
# /seo: "STEP 2-5" collect · "STEP 6-11" seo judge · "STEP 6-12" geo
|
||||
@@ -43,14 +43,14 @@ has "skills/geo/SKILL.md" '.audit/geo-signals-<RUNID>.md'
|
||||
# and the ranges on the dispatcher side.
|
||||
for n in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14; do has "$SEO" "## STEP $n —"; done
|
||||
for n in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15; do has "$GEO" "## STEP $n —"; done
|
||||
has "skills/seo/SKILL.md" 'STEP 2-5'
|
||||
has "skills/seo/SKILL.md" 'STEP 6-11'
|
||||
has "skills/seo/SKILL.md" 'STEP 6-12'
|
||||
has "skills/seo/SKILL.md" 'STEP 12-14'
|
||||
has "skills/seo/SKILL.md" 'STEP 13-15'
|
||||
has "skills/geo/SKILL.md" 'STEP 0-5'
|
||||
has "skills/geo/SKILL.md" '6-12, report scoring' # "STEP\n6-12" line-wraps
|
||||
has "skills/geo/SKILL.md" 'STEP 13-15'
|
||||
has "skills/pack-seo/skills/seo/SKILL.md" 'STEP 2-5'
|
||||
has "skills/pack-seo/skills/seo/SKILL.md" 'STEP 6-11'
|
||||
has "skills/pack-seo/skills/seo/SKILL.md" 'STEP 6-12'
|
||||
has "skills/pack-seo/skills/seo/SKILL.md" 'STEP 12-14'
|
||||
has "skills/pack-seo/skills/seo/SKILL.md" 'STEP 13-15'
|
||||
has "skills/pack-seo/skills/geo/SKILL.md" 'STEP 0-5'
|
||||
has "skills/pack-seo/skills/geo/SKILL.md" '6-12, report scoring' # "STEP\n6-12" line-wraps
|
||||
has "skills/pack-seo/skills/geo/SKILL.md" 'STEP 13-15'
|
||||
|
||||
# 5) collect-mode report emission (dispatcher waits on it between phases)
|
||||
has "$SEO" 'COLLECT REPORT'
|
||||
@@ -71,7 +71,7 @@ has "$SEO" 'applier: bash'
|
||||
# The emit instruction lives in /seo's DISPATCH PROMPTS, not in the agent
|
||||
# specs (geo-analyzer.md never mentions it; seo-analyzer.md only once,
|
||||
# incidentally — NOT locked, it is prose). Lock the dispatcher side only.
|
||||
has "skills/seo/SKILL.md" 'CROSS-AGENT NOTES TO'
|
||||
has "skills/pack-seo/skills/seo/SKILL.md" 'CROSS-AGENT NOTES TO'
|
||||
|
||||
# 8) trajectory block — mandatory in envelopes (/geo audit-end deliverables,
|
||||
# /seo §1 merge)
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
# lib/tests/toggle-external-repo-resolution.test.sh
|
||||
#
|
||||
# Regression test for J4-20 (BLK-006 class): toggle-external.sh:34 resolved
|
||||
# REPO with a LOGICAL `cd` (no -P). Direct invocation via a symlinked path —
|
||||
# exactly the real ~/.claude/lib -> <repo>/lib layout — resolves REPO to the
|
||||
# SYMLINK's logical parent instead of the physical repo root, so every path
|
||||
# derived from it (SKILLS_DIR, DISABLED_DIR) points at the wrong tree.
|
||||
set -u
|
||||
HELPER_SRC="$(cd "$(dirname "$0")/../.." && pwd)/lib/toggle-external.sh"
|
||||
pass=0; fail=0
|
||||
check() { if [ "$2" = "$3" ]; then pass=$((pass+1)); else fail=$((fail+1));
|
||||
printf 'FAIL %s: got[%s] want[%s]\n' "$1" "$2" "$3"; fi; }
|
||||
|
||||
SANDBOX="$(mktemp -d)"
|
||||
mkdir -p "$SANDBOX/repo/lib" "$SANDBOX/repo/skills-external/emil-design-eng" \
|
||||
"$SANDBOX/repo/skills-external/observability-and-instrumentation" \
|
||||
"$SANDBOX/repo/skills" "$SANDBOX/home/.claude"
|
||||
cp "$HELPER_SRC" "$SANDBOX/repo/lib/toggle-external.sh"
|
||||
cp "$(dirname "$HELPER_SRC")/gstack-removed.sh" "$SANDBOX/repo/lib/"
|
||||
# mark emil-design-eng ENABLED in the real (physical) repo tree
|
||||
ln -s "$SANDBOX/repo/skills-external/emil-design-eng" "$SANDBOX/repo/skills/emil-design-eng"
|
||||
# replicate the real ~/.claude/lib -> <repo>/lib symlink
|
||||
ln -s "$SANDBOX/repo/lib" "$SANDBOX/home/.claude/lib"
|
||||
|
||||
out="$(bash "$SANDBOX/home/.claude/lib/toggle-external.sh" status emil-design-eng)"
|
||||
check T1-repo-resolves-through-symlink "$out" enabled
|
||||
|
||||
# Same case arm, generalized to $tool for the agent-skills trio (this PR) —
|
||||
# left unlinked, so it must resolve through the symlink as "disabled", not
|
||||
# "missing" (which would mean REPO fell back to the wrong tree again).
|
||||
out="$(bash "$SANDBOX/home/.claude/lib/toggle-external.sh" status observability-and-instrumentation)"
|
||||
check T2-generalized-tool-resolves-through-symlink "$out" disabled
|
||||
|
||||
rm -rf "$SANDBOX"
|
||||
printf 'PASS=%s FAIL=%s\n' "$pass" "$fail"; [ "$fail" -eq 0 ]
|
||||
@@ -1,382 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
# ============================================================
|
||||
# lib/toggle-external.sh — enable/disable non-plugin tools
|
||||
#
|
||||
# Marketplace plugins are toggled by `claude plugin enable|disable`.
|
||||
# Tools distributed outside the marketplace (gstack submodule, emil
|
||||
# curl install, npx-installed skills) have no such lever — they live
|
||||
# as symlinks inside skills/. This script moves those symlinks
|
||||
# to/from skills-disabled/ so Claude Code stops/starts scanning them.
|
||||
#
|
||||
# A multi-skill pack (gstack, 21st, higgsfield) toggles all of its skills
|
||||
# at once.
|
||||
#
|
||||
# Usage:
|
||||
# toggle-external.sh list
|
||||
# toggle-external.sh status <tool>
|
||||
# toggle-external.sh enable <tool>
|
||||
# toggle-external.sh disable <tool>
|
||||
#
|
||||
# Managed tools:
|
||||
# gstack — per-skill symlinks populated by gstack's own setup
|
||||
# emil-design-eng — single symlink → skills-external/emil-design-eng
|
||||
# darwin-skill — single symlink → ~/.agents/skills/darwin-skill
|
||||
# 21st — 21st.dev skill pack (needs the `21st` CLI + login)
|
||||
# higgsfield — Higgsfield media pack (needs the CLI + login)
|
||||
# higgsfield-websites — single skill, landing-page aid (named ask only)
|
||||
# observability-and-instrumentation, deprecation-and-migration,
|
||||
# ci-cd-and-automation — the agent-skills trio, same single-symlink shape
|
||||
# as emil-design-eng (commit-pinned instead of main-branch tracking)
|
||||
# scroll-world-storytelling, build-threejs-scroll-worlds,
|
||||
# scroll-scrubbed-visual-sequence, scroll-scrubbed-word-reveal,
|
||||
# scroll-progress-timeline — the Mengto scroll skills, same shape
|
||||
#
|
||||
# For fine-grained activation (only design skills, only qa skills, only
|
||||
# audit skills, etc.) instead of all-or-nothing gstack toggling, use:
|
||||
# bash lib/profile.sh list
|
||||
# bash lib/profile.sh set <design|dev|qa|audit|minimal>
|
||||
# bash lib/profile.sh reset # back to the default profile (full)
|
||||
# ============================================================
|
||||
set -euo pipefail
|
||||
|
||||
REPO="${TOGGLE_EXTERNAL_REPO_OVERRIDE:-$(cd -P "$(dirname "$0")/.." && pwd)}"
|
||||
SKILLS_DIR="$REPO/skills"
|
||||
DISABLED_DIR="$REPO/skills-disabled"
|
||||
GSTACK_SRC="$REPO/skills-external/gstack" # gstack submodule: its skills
|
||||
|
||||
# GSTACK_REMOVED + gstack_is_removed() — single source, honored by the
|
||||
# `enable gstack` loop below — plus the gstack helpers shared with
|
||||
# profile.sh (gstack_skills, gstack_park, gstack_unpark, gstack_parked_names).
|
||||
# Resolved from $0 like REPO above, not from $REPO/lib — gstack-removed.sh
|
||||
# sits next to this file wherever it runs.
|
||||
# shellcheck source=lib/gstack-removed.sh disable=SC1091
|
||||
source "$(dirname "$0")/gstack-removed.sh"
|
||||
|
||||
GREEN='\033[0;32m'; YELLOW='\033[1;33m'; RED='\033[0;31m'; NC='\033[0m'
|
||||
ok() { echo -e "${GREEN}✓${NC} $1"; }
|
||||
warn() { echo -e "${YELLOW}⚠${NC} $1"; }
|
||||
err() { echo -e "${RED}✗${NC} $1"; }
|
||||
|
||||
# All non-plugin tools this script can toggle, in `list` order. The one
|
||||
# roster: tool_kind() derives every tool's kind from it.
|
||||
MANAGED_TOOLS=(gstack emil-design-eng darwin-skill 21st higgsfield
|
||||
higgsfield-websites
|
||||
observability-and-instrumentation deprecation-and-migration
|
||||
ci-cd-and-automation
|
||||
scroll-world-storytelling build-threejs-scroll-worlds
|
||||
scroll-scrubbed-visual-sequence scroll-scrubbed-word-reveal
|
||||
scroll-progress-timeline)
|
||||
|
||||
# Prints the kind of a tool: gstack | pack (21st, higgsfield) | single (one
|
||||
# symlink: every other MANAGED_TOOLS entry) | unknown. Exact-match loop, so
|
||||
# a name with spaces or glob characters can never match a roster entry.
|
||||
tool_kind() {
|
||||
local tool="$1" managed
|
||||
case "$tool" in
|
||||
gstack) echo gstack; return ;;
|
||||
21st|higgsfield) echo pack; return ;;
|
||||
esac
|
||||
for managed in "${MANAGED_TOOLS[@]}"; do
|
||||
[ "$managed" = "$tool" ] && { echo single; return; }
|
||||
done
|
||||
echo unknown
|
||||
}
|
||||
|
||||
# Prints where a single-symlink tool is linked from: ~/.agents/skills for
|
||||
# darwin-skill, skills-external/ for the others.
|
||||
tool_source() {
|
||||
case "$1" in
|
||||
darwin-skill) echo "$HOME/.agents/skills/$1" ;;
|
||||
*) echo "$REPO/skills-external/$1" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Prints the skill names that belong to the "21st" pack. Source of truth:
|
||||
# skills-external/21st-* — the `21st skills install` run in install-plugins.sh
|
||||
# owns that list, so adding a skill upstream needs no edit here.
|
||||
twentyfirst_skills() {
|
||||
local d
|
||||
for d in "$REPO"/skills-external/21st-*/; do
|
||||
[ -f "${d}SKILL.md" ] || continue
|
||||
basename "$d"
|
||||
done
|
||||
}
|
||||
|
||||
# Media skills of the "higgsfield" pack: an explicit allowlist. Upstream is
|
||||
# unpinned, so a skill it adds or renames must never be linked by
|
||||
# `enable higgsfield` without an edit here (default deny).
|
||||
# higgsfield-websites is its own tool: landing-page aid, named ask only.
|
||||
HIGGSFIELD_MEDIA_SKILLS=(higgsfield-generate higgsfield-soul-id
|
||||
higgsfield-product-photoshoot higgsfield-brandkit
|
||||
higgsfield-marketplace-cards higgsfield-video-explainer
|
||||
higgsfield-youtube-thumbnail)
|
||||
|
||||
# Prints the allowlisted media skills synced under skills-external/.
|
||||
higgsfield_skills() {
|
||||
local name
|
||||
for name in "${HIGGSFIELD_MEDIA_SKILLS[@]}"; do
|
||||
[ -f "$REPO/skills-external/$name/SKILL.md" ] && echo "$name"
|
||||
done
|
||||
return 0
|
||||
}
|
||||
|
||||
# Prints the synced higgsfield-* skills no tool owns: neither on the media
|
||||
# allowlist nor higgsfield-websites. Upstream added or renamed something.
|
||||
higgsfield_unlisted() {
|
||||
local d name
|
||||
for d in "$REPO"/skills-external/higgsfield-*/; do
|
||||
[ -f "${d}SKILL.md" ] || continue
|
||||
name="$(basename "$d")"
|
||||
case " ${HIGGSFIELD_MEDIA_SKILLS[*]} higgsfield-websites " in
|
||||
*" $name "*) ;;
|
||||
*) echo "$name" ;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
# Prints the member skills of a multi-skill pack tool (21st, higgsfield).
|
||||
pack_skills() {
|
||||
case "$1" in
|
||||
21st) twentyfirst_skills ;;
|
||||
higgsfield) higgsfield_skills ;;
|
||||
esac
|
||||
}
|
||||
|
||||
# bounded <cmd...> — run a CLI probe silently, 15 s at most when a timeout
|
||||
# tool exists (`timeout`, or `gtimeout` from Homebrew coreutils on macOS):
|
||||
# a closed-source binary must never hang a toggle, and what it prints (a
|
||||
# token) must never reach the terminal. Twin of _higgsfield_probe in
|
||||
# lib/higgsfield-skills.sh, kept here so the only file sourced beside this
|
||||
# script stays gstack-removed.sh (the fixture suites copy just those two).
|
||||
bounded() {
|
||||
local tool
|
||||
for tool in timeout gtimeout; do
|
||||
if command -v "$tool" >/dev/null 2>&1; then
|
||||
"$tool" 15 "$@" </dev/null >/dev/null 2>&1
|
||||
return
|
||||
fi
|
||||
done
|
||||
"$@" </dev/null >/dev/null 2>&1
|
||||
}
|
||||
|
||||
# Post-enable notes for a pack. Its skills shell out to a CLI: without it
|
||||
# (or without a session) they can only report failure. Warn, never block:
|
||||
# the pack is still correctly wired and `make plugin` installs the CLI.
|
||||
pack_hints() {
|
||||
local name
|
||||
case "$1" in
|
||||
21st)
|
||||
if ! command -v 21st >/dev/null 2>&1; then
|
||||
warn "the \`21st\` CLI is not on PATH — install it: npm i -g @21st-dev/cli"
|
||||
elif ! grep -q '^Logged in as ' <<<"$(21st whoami 2>/dev/null)"; then
|
||||
warn "not signed in to 21st — component retrieval and 21st AI need: 21st login"
|
||||
fi
|
||||
;;
|
||||
higgsfield)
|
||||
if ! command -v higgsfield >/dev/null 2>&1; then
|
||||
warn "the \`higgsfield\` CLI is not on PATH — run: make plugin"
|
||||
elif ! bounded higgsfield version; then
|
||||
warn "the \`higgsfield\` CLI does not answer (npm shim without its binary) — run: make plugin"
|
||||
elif ! bounded higgsfield auth token; then
|
||||
warn "not signed in to Higgsfield — generation needs: higgsfield auth login"
|
||||
fi
|
||||
while read -r name; do
|
||||
warn "$name is synced but on no allowlist, not linked — see HIGGSFIELD_MEDIA_SKILLS in lib/toggle-external.sh"
|
||||
done < <(higgsfield_unlisted)
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Prints "enabled" / "disabled" / "missing" for a tool.
|
||||
status_tool() {
|
||||
local tool="$1" installed=0 name
|
||||
case "$(tool_kind "$tool")" in
|
||||
gstack)
|
||||
[ -d "$GSTACK_SRC" ] || { echo "missing"; return; }
|
||||
while read -r name; do
|
||||
[ -e "$SKILLS_DIR/$name" ] && { echo "enabled"; return; }
|
||||
done < <(gstack_skills "$GSTACK_SRC")
|
||||
echo "disabled"
|
||||
;;
|
||||
single)
|
||||
[ -d "$(tool_source "$tool")" ] || { echo "missing"; return; }
|
||||
[ -e "$SKILLS_DIR/$tool" ] && echo "enabled" || echo "disabled"
|
||||
;;
|
||||
pack)
|
||||
while read -r name; do
|
||||
installed=1
|
||||
[ -e "$SKILLS_DIR/$name" ] && { echo "enabled"; return; }
|
||||
done < <(pack_skills "$tool")
|
||||
[ "$installed" -eq 1 ] && echo "disabled" || echo "missing"
|
||||
;;
|
||||
*)
|
||||
echo "unknown"; return 1 ;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Parks every live gstack skill (twin of profile.sh's disable_skill gstack
|
||||
# arm, kept separate: the messages differ).
|
||||
disable_gstack() {
|
||||
local moved=0 name
|
||||
while read -r name; do
|
||||
[ -e "$SKILLS_DIR/$name" ] || continue
|
||||
gstack_park "$SKILLS_DIR" "$DISABLED_DIR" "$name"
|
||||
moved=$((moved + 1))
|
||||
done < <(gstack_skills "$GSTACK_SRC")
|
||||
ok "gstack disabled ($moved symlinks moved)"
|
||||
}
|
||||
|
||||
# Parks one single-symlink external tool.
|
||||
disable_external_single() {
|
||||
local tool="$1"
|
||||
if [ -e "$SKILLS_DIR/$tool" ]; then
|
||||
rm -rf "${DISABLED_DIR:?}/${tool:?}"
|
||||
mv "$SKILLS_DIR/$tool" "$DISABLED_DIR/$tool"
|
||||
ok "$tool disabled"
|
||||
else
|
||||
warn "$tool already disabled"
|
||||
fi
|
||||
}
|
||||
|
||||
# Parks every live skill of a pack (21st, higgsfield). Parked under the
|
||||
# plain skill name — same convention as the other externals, so profile.sh's
|
||||
# park/restore path stays interoperable.
|
||||
disable_pack() {
|
||||
local tool="$1" parked=0 name
|
||||
while read -r name; do
|
||||
[ -e "$SKILLS_DIR/$name" ] || continue
|
||||
rm -rf "${DISABLED_DIR:?}/${name:?}"
|
||||
mv "$SKILLS_DIR/$name" "$DISABLED_DIR/$name"
|
||||
parked=$((parked + 1))
|
||||
done < <(pack_skills "$tool")
|
||||
if [ "$parked" -gt 0 ]; then
|
||||
ok "$tool disabled ($parked skills parked)"
|
||||
else
|
||||
warn "$tool already disabled"
|
||||
fi
|
||||
}
|
||||
|
||||
disable_tool() {
|
||||
local tool="$1"
|
||||
mkdir -p "$DISABLED_DIR"
|
||||
case "$(tool_kind "$tool")" in
|
||||
gstack) disable_gstack ;;
|
||||
single) disable_external_single "$tool" ;;
|
||||
pack) disable_pack "$tool" ;;
|
||||
*) err "Unknown tool: $tool"; return 1 ;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Re-links the gstack skills parked as gstack__<name>, honoring the
|
||||
# policy denylist (lib/gstack-removed.sh).
|
||||
enable_gstack() {
|
||||
local moved=0 skipped=0 name
|
||||
while IFS= read -r name; do
|
||||
if gstack_is_removed "$name"; then
|
||||
warn "skipped (removed by policy, lib/gstack-removed.sh): $name"
|
||||
skipped=$((skipped + 1))
|
||||
continue
|
||||
fi
|
||||
gstack_unpark "$SKILLS_DIR" "$DISABLED_DIR" "$name"
|
||||
moved=$((moved + 1))
|
||||
done < <(gstack_parked_names "$DISABLED_DIR")
|
||||
if [ "$moved" -eq 0 ] && [ "$skipped" -ge 1 ]; then
|
||||
warn "only policy-removed skills remain parked (lib/gstack-removed.sh)"
|
||||
elif [ "$moved" -eq 0 ]; then
|
||||
warn "gstack was not disabled — re-run gstack setup to (re)create symlinks"
|
||||
else
|
||||
ok "gstack enabled ($moved symlinks restored)"
|
||||
fi
|
||||
}
|
||||
|
||||
# Enables one single-symlink external tool: restore from the parking dir,
|
||||
# else link its source (see tool_source).
|
||||
enable_external_single() {
|
||||
local tool="$1" src
|
||||
src="$(tool_source "$tool")"
|
||||
if [ -e "$DISABLED_DIR/$tool" ]; then
|
||||
rm -rf "${SKILLS_DIR:?}/${tool:?}"
|
||||
mv "$DISABLED_DIR/$tool" "$SKILLS_DIR/$tool"
|
||||
ok "$tool enabled"
|
||||
elif [ -e "$SKILLS_DIR/$tool" ]; then
|
||||
warn "$tool already enabled"
|
||||
elif [ -d "$src" ]; then
|
||||
ln -sf "$src" "$SKILLS_DIR/$tool"
|
||||
ok "$tool enabled (symlink created → $src)"
|
||||
else
|
||||
err "$tool not installed at $src — run: make plugin"
|
||||
return 1
|
||||
fi
|
||||
if [ "$tool" = "higgsfield-websites" ]; then pack_hints higgsfield; fi
|
||||
}
|
||||
|
||||
# Enables a multi-skill pack (21st, higgsfield): restore parked skills,
|
||||
# link the missing ones, then print the CLI hints.
|
||||
enable_pack() {
|
||||
local tool="$1" restored=0 linked=0
|
||||
while read -r name; do
|
||||
if [ -e "$DISABLED_DIR/$name" ]; then
|
||||
rm -rf "${SKILLS_DIR:?}/${name:?}"
|
||||
mv "$DISABLED_DIR/$name" "$SKILLS_DIR/$name"
|
||||
restored=$((restored + 1))
|
||||
elif [ -e "$SKILLS_DIR/$name" ]; then
|
||||
: # already enabled
|
||||
else
|
||||
ln -sf "$REPO/skills-external/$name" "$SKILLS_DIR/$name"
|
||||
linked=$((linked + 1))
|
||||
fi
|
||||
done < <(pack_skills "$tool")
|
||||
if [ "$((restored + linked))" -eq 0 ]; then
|
||||
if [ "$(status_tool "$tool")" = "missing" ]; then
|
||||
err "$tool pack not installed in $REPO/skills-external — run: make plugin"
|
||||
return 1
|
||||
fi
|
||||
warn "$tool already enabled"
|
||||
# Enabled is the steady state, and Claude re-runs this on every
|
||||
# media ask: the hints (upstream drift, CLI, session) show here too.
|
||||
if [ "$tool" = "higgsfield" ]; then pack_hints higgsfield; fi
|
||||
return 0
|
||||
fi
|
||||
ok "$tool enabled ($((restored + linked)) skills: $restored restored, $linked linked)"
|
||||
pack_hints "$tool"
|
||||
}
|
||||
|
||||
enable_tool() {
|
||||
local tool="$1"
|
||||
case "$(tool_kind "$tool")" in
|
||||
gstack) enable_gstack ;;
|
||||
single) enable_external_single "$tool" ;;
|
||||
pack) enable_pack "$tool" ;;
|
||||
*) err "Unknown tool: $tool"; return 1 ;;
|
||||
esac
|
||||
}
|
||||
|
||||
list_all() {
|
||||
local t
|
||||
printf "%-20s %s\n" "TOOL" "STATUS"
|
||||
printf "%-20s %s\n" "----" "------"
|
||||
for t in "${MANAGED_TOOLS[@]}"; do
|
||||
printf "%-20s %s\n" "$t" "$(status_tool "$t")"
|
||||
done
|
||||
}
|
||||
|
||||
usage() {
|
||||
# Header comment = lines 3 .. closing banner (dropped); no numeric range,
|
||||
# so a longer tool list can no longer fall out of --help.
|
||||
sed -n '3,/^# ====/p' "$0" | sed '$d' | sed 's/^# \?//'
|
||||
exit "${1:-0}"
|
||||
}
|
||||
|
||||
main() {
|
||||
local cmd="${1:-}"
|
||||
case "$cmd" in
|
||||
list) list_all ;;
|
||||
status) [ $# -ge 2 ] || usage 1; status_tool "$2" ;;
|
||||
enable) [ $# -ge 2 ] || usage 1; enable_tool "$2" ;;
|
||||
disable) [ $# -ge 2 ] || usage 1; disable_tool "$2" ;;
|
||||
""|-h|--help|help) usage 0 ;;
|
||||
*) err "Unknown command: $cmd"; usage 1 ;;
|
||||
esac
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"name": "pack-design",
|
||||
"version": "1.0.0",
|
||||
"description": "Design and UI skills: impeccable, Emil design eng, frontend-design, motion, 21st build + CLI, site-motion.",
|
||||
"author": { "name": "bchanot" },
|
||||
"defaultEnabled": true
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
../../../skills-external/21st-cli-use
|
||||
+1
@@ -0,0 +1 @@
|
||||
../../../skills-external/21st-ui-build
|
||||
@@ -0,0 +1 @@
|
||||
../../../skills-external/design-motion-principles
|
||||
@@ -0,0 +1 @@
|
||||
../../../skills-external/emil-design-eng
|
||||
@@ -0,0 +1 @@
|
||||
../../../skills-external/frontend-design
|
||||
+1
@@ -0,0 +1 @@
|
||||
../../../skills-external/impeccable
|
||||
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"name": "pack-extras",
|
||||
"version": "1.0.0",
|
||||
"description": "Occasional skills: diagram, make-pdf, 21st-ai, 21st-ui-explore, 21st-ui-review. OFF by default.",
|
||||
"author": { "name": "bchanot" },
|
||||
"defaultEnabled": false
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
../../../skills-external/21st-ai
|
||||
@@ -0,0 +1 @@
|
||||
../../../skills-external/21st-ui-explore
|
||||
@@ -0,0 +1 @@
|
||||
../../../skills-external/21st-ui-review
|
||||
+1
@@ -0,0 +1 @@
|
||||
../../../skills-external/gstack/diagram
|
||||
+1
@@ -0,0 +1 @@
|
||||
../../../skills-external/gstack/make-pdf
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"name": "pack-gstack-browser",
|
||||
"version": "1.0.0",
|
||||
"description": "gstack browser tooling: browse, scrape, qa, benchmark, canary.",
|
||||
"author": { "name": "bchanot" },
|
||||
"defaultEnabled": true
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
../../../skills-external/gstack/benchmark
|
||||
@@ -0,0 +1 @@
|
||||
../../../skills-external/gstack/browse
|
||||
@@ -0,0 +1 @@
|
||||
../../../skills-external/gstack/canary
|
||||
@@ -0,0 +1 @@
|
||||
../../../skills-external/gstack/open-gstack-browser
|
||||
+1
@@ -0,0 +1 @@
|
||||
../../../skills-external/gstack/qa
|
||||
@@ -0,0 +1 @@
|
||||
../../../skills-external/gstack/qa-only
|
||||
@@ -0,0 +1 @@
|
||||
../../../skills-external/gstack/scrape
|
||||
@@ -0,0 +1 @@
|
||||
../../../skills-external/gstack/setup-browser-cookies
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"name": "pack-gstack-design",
|
||||
"version": "1.0.0",
|
||||
"description": "gstack design pipeline: design-review, design-consultation, design-html, plan-design-review.",
|
||||
"author": { "name": "bchanot" },
|
||||
"defaultEnabled": true
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
../../../skills-external/gstack/design-consultation
|
||||
@@ -0,0 +1 @@
|
||||
../../../skills-external/gstack/design-html
|
||||
@@ -0,0 +1 @@
|
||||
../../../skills-external/gstack/design-review
|
||||
@@ -0,0 +1 @@
|
||||
../../../skills-external/gstack/plan-design-review
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"name": "pack-gstack-dev",
|
||||
"version": "1.0.0",
|
||||
"description": "gstack engineering skills: review, investigate, codex, cso, health, freeze, retro, spec, skillify, office-hours, plan reviews, document-release.",
|
||||
"author": { "name": "bchanot" },
|
||||
"defaultEnabled": true
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
../../../skills-external/gstack/codex
|
||||
+1
@@ -0,0 +1 @@
|
||||
../../../skills-external/gstack/cso
|
||||
@@ -0,0 +1 @@
|
||||
../../../skills-external/gstack/document-release
|
||||
+1
@@ -0,0 +1 @@
|
||||
../../../skills-external/gstack/freeze
|
||||
+1
@@ -0,0 +1 @@
|
||||
../../../skills-external/gstack/health
|
||||
@@ -0,0 +1 @@
|
||||
../../../skills-external/gstack/investigate
|
||||
@@ -0,0 +1 @@
|
||||
../../../skills-external/gstack/office-hours
|
||||
@@ -0,0 +1 @@
|
||||
../../../skills-external/gstack/plan-ceo-review
|
||||
@@ -0,0 +1 @@
|
||||
../../../skills-external/gstack/plan-devex-review
|
||||
@@ -0,0 +1 @@
|
||||
../../../skills-external/gstack/plan-eng-review
|
||||
+1
@@ -0,0 +1 @@
|
||||
../../../skills-external/gstack/retro
|
||||
+1
@@ -0,0 +1 @@
|
||||
../../../skills-external/gstack/review
|
||||
+1
@@ -0,0 +1 @@
|
||||
../../../skills-external/gstack/skillify
|
||||
+1
@@ -0,0 +1 @@
|
||||
../../../skills-external/gstack/spec
|
||||
+1
@@ -0,0 +1 @@
|
||||
../../../skills-external/gstack/unfreeze
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"name": "pack-higgsfield",
|
||||
"version": "1.0.0",
|
||||
"description": "Higgsfield media generation skills (paid runs). OFF by default: profile.sh enable higgsfield.",
|
||||
"author": { "name": "bchanot" },
|
||||
"defaultEnabled": false
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
../../../skills-external/higgsfield-brandkit
|
||||
@@ -0,0 +1 @@
|
||||
../../../skills-external/higgsfield-generate
|
||||
@@ -0,0 +1 @@
|
||||
../../../skills-external/higgsfield-marketplace-cards
|
||||
Loaded 100 of 120 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user