docs(plugin-gate): probe reads current --plain, advisor emits profile.sh set/enable, /profile rewritten for packs
This commit is contained in:
1 parent
350e658b60
commit
58958229d9
7 files changed
+105
-254
No files matched your search
+23
-51
@@ -19,7 +19,7 @@ Detection is NOT your job (plugin-probe did it); applying is NOT your job
|
||||
## INPUT — PROBE REPORT (ground truth, from plugin-probe)
|
||||
|
||||
The dispatcher passes `REQUEST` (the project description, verbatim) and the
|
||||
full `PROBE REPORT` (fields: PLUGINS, EXTERNAL, PROFILE, CLIS, MANIFESTS,
|
||||
full `PROBE REPORT` (fields: PROFILE, PLUGINS, CLIS, MANIFESTS,
|
||||
FRAMEWORK-DEPS, TSX-JSX-COUNT, DOCKER-COUNT, ANIM, MONOREPO, EMBEDDED,
|
||||
CHECKPOINT). Treat it as ground truth — never re-detect, never invent a
|
||||
field. PROBE REPORT missing or a field absent → emit
|
||||
@@ -271,60 +271,32 @@ RULE: IF `complex-arch` signal (multiple services, event bus, distributed system
|
||||
|
||||
---
|
||||
|
||||
## TOGGLING EXTERNAL TOOLS
|
||||
## WRITING A PROFILE OR A PACK
|
||||
|
||||
Marketplace plugins toggle via `claude plugin enable|disable <name>@<marketplace>`.
|
||||
Non-marketplace tools (gstack per-skill symlinks, emil-design-eng, darwin-skill)
|
||||
toggle via `bash $HOME/.claude/lib/toggle-external.sh enable|disable <tool>`.
|
||||
Everything switches through `lib/profile.sh`, per project, never the user
|
||||
scope. Emit the exact command; never write files directly.
|
||||
|
||||
When a recommendation flips the state of one of those tools, emit the exact
|
||||
command — never write files directly.
|
||||
|
||||
```
|
||||
# Enable gstack for a browser-QA signal:
|
||||
bash $HOME/.claude/lib/toggle-external.sh enable gstack
|
||||
|
||||
# Disable darwin-skill when passive cost is too high for a hotfix:
|
||||
bash $HOME/.claude/lib/toggle-external.sh disable darwin-skill
|
||||
```
|
||||
|
||||
`higgsfield` / `higgsfield-websites`: never recommended from project signals.
|
||||
They drive a paid generation service; explicit user ask only (CLAUDE.md
|
||||
"Skill routing").
|
||||
|
||||
### Skill profiles (fine-grained partitioning, with plugin + MCP toggle)
|
||||
|
||||
For task-shaped activation (web only, seo only, backend only, design only,
|
||||
etc.) prefer `lib/profile.sh` over toggling all of gstack at once. Profiles
|
||||
activate a curated subset of skills + plugins + MCPs and disable the rest of
|
||||
gstack + managed plugins — sessions stay focused and passive token cost drops.
|
||||
|
||||
`profile set <name>` actually toggles plugins (`claude plugin enable|disable`)
|
||||
and external skill packs (delegates to `lib/toggle-external.sh`) — not just
|
||||
advisory. No MCP server is auto-toggled today. Always-on plugins (`security-guidance`)
|
||||
and the vendored superpowers skills are never toggled by a profile. Managed
|
||||
plugins that `set` may toggle:
|
||||
`ui-ux-pro-max@ui-ux-pro-max-skill`, `plugin-dev@claude-code-plugins`,
|
||||
`pr-review-toolkit@claude-code-plugins`. Other plugins are never auto-toggled.
|
||||
|
||||
When the project signal matches one of the canonical profiles, recommend the
|
||||
matching `profile set` command:
|
||||
|
||||
| Signal | Recommended profile | Command |
|
||||
| Signal | Profile | Command |
|
||||
|---|---|---|
|
||||
| `frontend` public website (no backend, no SEO focus) | `web` | `bash $HOME/.claude/lib/profile.sh set web` |
|
||||
| audit-only: SEO + GEO + W3C + WCAG | `seo` | `bash $HOME/.claude/lib/profile.sh set seo` |
|
||||
| public website end-to-end (build + audit) | `web-full` | `bash $HOME/.claude/lib/profile.sh set web-full` |
|
||||
| backend / API / system / library (no UI, no SEO) | `backend` | `bash $HOME/.claude/lib/profile.sh set backend` |
|
||||
| `design-system` (heavy UI work, no dev) | `design` | `bash $HOME/.claude/lib/profile.sh set design` |
|
||||
| `simple` / hotfix / typical dev session | `dev` | `bash $HOME/.claude/lib/profile.sh set dev` |
|
||||
| `browser-qa` (e2e tests, no design work) | `qa` | `bash $HOME/.claude/lib/profile.sh set qa` |
|
||||
| comprehensive audit (security + SEO + perf) | `audit` | `bash $HOME/.claude/lib/profile.sh set audit` |
|
||||
| narrow session, minimal noise | `minimal` | `bash $HOME/.claude/lib/profile.sh set minimal` |
|
||||
| public website, no SEO focus | `web` | `bash $HOME/.claude/lib/profile.sh set web` |
|
||||
| audit-only: SEO + GEO + W3C + WCAG | `seo` | `… set seo` |
|
||||
| public website end-to-end | `web-full` | `… set web-full` |
|
||||
| backend / API / library | `backend` | `… set backend` |
|
||||
| heavy UI, no dev | `design` | `… set design` |
|
||||
| typical dev session | `dev` | `… set dev` |
|
||||
| browser QA only | `qa` | `… set qa` |
|
||||
| comprehensive audit | `audit` | `… set audit` |
|
||||
| narrow session | `minimal` | `… set minimal` |
|
||||
| one pack on top | — | `bash $HOME/.claude/lib/profile.sh enable <design|scroll3d|seo|web-validate|gstack-dev|gstack-browser|gstack-design|higgsfield|extras>` |
|
||||
|
||||
To go back to the default profile: `bash $HOME/.claude/lib/profile.sh reset`
|
||||
(= `set full`: enables full's list, parks non-listed gstack/managed items,
|
||||
toggles the managed plugins like any `set`).
|
||||
Read `PROFILE :` first: when it says `source=flag`, a pack it turns off
|
||||
cannot be enabled in this conversation; recommend `relaunch: cc <name>
|
||||
<profile>` instead of an `enable`. No profile = `full` (manifest defaults);
|
||||
`unset` returns to it. Every write needs `/reload-plugins` to load the
|
||||
packs; connectors and model apply to the next session.
|
||||
|
||||
`higgsfield`: never recommended from project signals. It drives a paid
|
||||
generation service; explicit user ask only (CLAUDE.md "Skill routing").
|
||||
|
||||
## BLOCK if
|
||||
|
||||
|
||||
+9
-14
@@ -15,17 +15,13 @@ Facts only — no signals, no recommendations, no complexity scoring.
|
||||
## PROBES (run all; a failing probe reports its fallback string, never aborts)
|
||||
|
||||
```bash
|
||||
# Claude Code plugins
|
||||
# Packs, managed plugins, connectors, model: the effective state of THIS
|
||||
# project and conversation (lib/profile.sh, no claude call)
|
||||
bash "$HOME/.claude/lib/profile.sh" -C "$PWD" current --plain 2>/dev/null || echo "profile-unavailable"
|
||||
|
||||
# Marketplace plugins actually installed (ids, enabled state)
|
||||
claude plugin list 2>/dev/null || echo "plugin-list-unavailable"
|
||||
|
||||
# External (non-marketplace) tools status — gstack, emil-design-eng,
|
||||
# darwin-skill. Managed by lib/toggle-external.sh since
|
||||
# `claude plugin enable|disable` does not apply to them.
|
||||
bash "$HOME/.claude/lib/toggle-external.sh" list 2>/dev/null || echo "toggle-external-unavailable"
|
||||
|
||||
# Active skill profile — design / dev / qa / audit / minimal / custom.
|
||||
bash "$HOME/.claude/lib/profile.sh" current 2>/dev/null || echo "profile-unavailable"
|
||||
|
||||
# Context7 CLI
|
||||
command -v ctx7 &>/dev/null && ctx7 --version 2>/dev/null | head -1 || echo "ctx7-not-installed"
|
||||
|
||||
@@ -60,7 +56,7 @@ ls src/*.c 2>/dev/null | head -3
|
||||
ls package.json Cargo.toml go.mod pubspec.yaml setup.py pyproject.toml 2>/dev/null | head -1 # counterindicators (ecosystem present = not bare embedded)
|
||||
|
||||
# Checkpoint inputs (consumed by lib/plugin-gate.md's validation checkpoint)
|
||||
[ -x "$HOME/.claude/lib/toggle-external.sh" ] && echo "toggle-script: executable" || echo "toggle-script: UNAVAILABLE"
|
||||
[ -f "$HOME/.claude/lib/profile.sh" ] && echo "profile-sh: available" || echo "profile-sh: UNAVAILABLE"
|
||||
ls "$HOME/.claude/plugins/cache" 2>/dev/null | head -10
|
||||
ls "$HOME/.agents/skills" 2>/dev/null | head -10
|
||||
```
|
||||
@@ -69,9 +65,8 @@ ls "$HOME/.agents/skills" 2>/dev/null | head -10
|
||||
|
||||
```
|
||||
PROBE REPORT
|
||||
PLUGINS : <claude plugin list output, one per line>
|
||||
EXTERNAL : <toggle-external list output>
|
||||
PROFILE : <profile current output>
|
||||
PROFILE : <current --plain block, verbatim>
|
||||
PLUGINS : <claude plugin list output>
|
||||
CLIS : ctx7=<v|absent> gsd=<v|absent> rtk=<v|absent>
|
||||
MANIFESTS : <files found>
|
||||
FRAMEWORK-DEPS: <exact "dep": "version" pairs, or framework-deps-none>
|
||||
@@ -80,7 +75,7 @@ DOCKER-COUNT : <n>
|
||||
ANIM : eligibility=<status|package|reason> installed=<lib|no>
|
||||
MONOREPO : dirs=<hits> configs=<hits> parent=<hits>
|
||||
EMBEDDED : cmake-pio=<hits> linker=<hits> makefile=<y/n> src-c=<hits> ecosystem=<first manifest|none>
|
||||
CHECKPOINT : toggle-script=<executable|UNAVAILABLE> plugin-dirs=<cache+skills listing>
|
||||
CHECKPOINT : profile-sh=<available|UNAVAILABLE> plugin-dirs=<cache+skills listing>
|
||||
```
|
||||
|
||||
## RULES
|
||||
|
||||
+17
-37
@@ -15,15 +15,14 @@ Agent(subagent_type="plugin-probe", description="plugin gate — probe",
|
||||
## 2. VALIDATION CHECKPOINT (main loop — between probe and reasoner)
|
||||
|
||||
Validate the PROBE REPORT before any reasoning:
|
||||
- `EXTERNAL` non-empty AND each listed plugin's directory appears under
|
||||
`CHECKPOINT plugin-dirs`.
|
||||
- `PROFILE` block holds a `profile=` line.
|
||||
- At least one project signal present (MANIFESTS / FRAMEWORK-DEPS /
|
||||
TSX-JSX-COUNT > 0 / DOCKER-COUNT > 0 / EMBEDDED hits). Else print
|
||||
`⚠️ No project signals detected — recommendations will be conservative.`
|
||||
and continue.
|
||||
- `CHECKPOINT toggle-script=UNAVAILABLE` → print `⚠️ toggle script
|
||||
unavailable — recommendations will be advisory only, no auto-activation.`
|
||||
and SKIP step 5 (apply) entirely.
|
||||
- `CHECKPOINT profile-sh=UNAVAILABLE` → print `⚠️ profile.sh unavailable —
|
||||
recommendations will be advisory only, no auto-activation.` and SKIP
|
||||
step 5 (apply) entirely.
|
||||
- PROBE REPORT missing/unparsable → retry the probe ONCE fresh; a 2nd
|
||||
failure → STOP and surface (never reason over invented detection).
|
||||
|
||||
@@ -55,36 +54,17 @@ If any plugin has ⚡ ENABLE status:
|
||||
⚡ Pre-fetch ctx7 docs for next.js, prisma
|
||||
Apply these changes? (yes / no / customize)
|
||||
```
|
||||
2. "yes" → apply via the exact commands the advisor emitted. "customize" →
|
||||
user picks. "no" → proceed with current config.
|
||||
2. "yes" → run the advisor's commands in order, each one `bash
|
||||
"$HOME/.claude/lib/profile.sh" -C <PROJECT_ROOT> set <name>` or `enable
|
||||
<pack>`. Each call writes `.claude/settings.local.json` atomically or
|
||||
refuses (rc 2, nothing written), so there is nothing to roll back: stop at
|
||||
the first non-zero rc, print its stderr, and continue with the current
|
||||
config. "customize" → user picks. "no" → proceed with current config.
|
||||
3. After a successful write print `✅ Applied N change(s) — run
|
||||
/reload-plugins to load the packs in this session (connectors and model:
|
||||
next session).` In a `--settings` conversation (`PROFILE :` block says
|
||||
`source=flag`) the advisor emits no enable for a pack the flag turns off;
|
||||
it says `relaunch: cc <name> <profile>` instead.
|
||||
|
||||
**Never auto-activate without showing the list and getting confirmation.**
|
||||
|
||||
### Rollback on partial failure
|
||||
|
||||
Track each toggle; roll back the partial set rather than leave a
|
||||
half-applied configuration:
|
||||
|
||||
```bash
|
||||
applied=()
|
||||
for change in "${PROPOSED_CHANGES[@]}"; do
|
||||
if bash "$HOME/.claude/lib/toggle-external.sh" enable "$change"; then
|
||||
applied+=("$change")
|
||||
else
|
||||
echo "❌ failed to enable $change — rolling back ${#applied[@]} prior change(s)"
|
||||
for prior in "${applied[@]}"; do
|
||||
bash "$HOME/.claude/lib/toggle-external.sh" disable "$prior" \
|
||||
|| echo "⚠️ rollback of $prior also failed — manual cleanup required: see ~/.claude/plugins/cache"
|
||||
done
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
```
|
||||
|
||||
Surface: `✅ Applied N change(s).` — or on failure:
|
||||
|
||||
```
|
||||
⚠️ Toggle failed at change <name>. Rolled back the N prior change(s).
|
||||
To inspect manually: ls ~/.claude/plugins/cache; bash ~/.claude/lib/toggle-external.sh list
|
||||
Re-run /plugin-check after fixing the underlying cause (e.g. permissions).
|
||||
```
|
||||
**Never auto-activate without showing the list and getting confirmation.
|
||||
Never write the user scope.**
|
||||
@@ -421,7 +421,7 @@ Agent(
|
||||
**Décision selon plugin state :**
|
||||
```bash
|
||||
# gstack actif ?
|
||||
bash $HOME/.claude/lib/toggle-external.sh list 2>/dev/null | grep -E "^gstack\s+(enabled|on)"
|
||||
bash $HOME/.claude/lib/profile.sh -C "$PWD" current --plain 2>/dev/null | grep -q '^pack-gstack-dev=on'
|
||||
```
|
||||
|
||||
- **gstack ON** → invoquer le skill cso via Skill tool en lui passant le contexte archétype :
|
||||
@@ -605,7 +605,7 @@ Options :
|
||||
Pré-check ressources navigateur :
|
||||
```bash
|
||||
# gstack actif ?
|
||||
bash $HOME/.claude/lib/toggle-external.sh list 2>/dev/null | grep -E "^gstack\s+(enabled|on)"
|
||||
bash $HOME/.claude/lib/profile.sh -C "$PWD" current --plain 2>/dev/null | grep -q '^pack-gstack-browser=on'
|
||||
# URL déployée fournie par l'utilisateur en STEP 3 ?
|
||||
echo "${BRIEF_deployed_url:-none}"
|
||||
# dev server launchable ?
|
||||
|
||||
@@ -12,8 +12,9 @@ plugin-probe (sonnet) → validation checkpoint → dispatch plugin-advisor
|
||||
dispatched, gates in this loop).
|
||||
|
||||
/plugin-check is READ-ONLY advisory: SKIP the gate's step 5 (apply) — show
|
||||
the advisor's exact toggle commands for the user instead. Never write; user
|
||||
toggles via `claude plugin enable/disable`.
|
||||
the advisor's exact commands for the user instead. Never write: the user runs
|
||||
them (`lib/profile.sh` `set <profile>` / `enable <pack>` writes the
|
||||
project's `.claude/settings.local.json`, never the user scope).
|
||||
|
||||
If `$HOME/.claude/lib/plugin-gate.md` unreachable: emit `Plugin gate include
|
||||
missing.` and STOP.
|
||||
|
||||
+48
-145
@@ -2,159 +2,62 @@
|
||||
name: profile
|
||||
effort: low
|
||||
description: |
|
||||
Partition Claude skills by purpose: design, dev, qa, audit, minimal.
|
||||
Toggles symlinks between skills/ and skills-disabled/ to keep only
|
||||
the skills relevant to the current kind of work.
|
||||
Trigger: "profile", "skill profile", "design profile", "qa profile",
|
||||
"switch to design", "set profile", "active profile", "quel profil",
|
||||
"profil design", "active les skills design", "désactive gstack",
|
||||
"réduire le bruit gstack".
|
||||
argument-hint: list | show <name> | current | apply <name> | set <name> | reset | gstack on|off | diff <a> <b>
|
||||
allowed-tools:
|
||||
- Bash
|
||||
- Read
|
||||
Set the pack profile of THIS project (writes .claude/settings.local.json)
|
||||
or show the effective one of this conversation. Packs are skills-dir
|
||||
plugins (design, scroll3d, seo, web-validate, gstack-dev/-browser/-design,
|
||||
higgsfield, extras); a profile is a settings fragment lib/profiles/<n>.json.
|
||||
Trigger: "profile", "skill profile", "design profile", "set profile",
|
||||
"active profile", "quel profil", "profil design", "active les skills
|
||||
design", "enable higgsfield", "désactive gstack", "réduire le listing".
|
||||
argument-hint: list | show <name> | current | set <name> | unset | enable <pack> | disable <pack> | diff <name>
|
||||
---
|
||||
|
||||
# profile
|
||||
# /profile — packs per project and per conversation
|
||||
|
||||
Activate a curated subset of skills for a specific kind of work — instead of
|
||||
carrying every gstack + personal skill in every session.
|
||||
Run `bash "$HOME/.claude/lib/profile.sh" -C "$PWD" $ARGUMENTS` and show its
|
||||
output. With no argument, run `current` and then `list`.
|
||||
|
||||
## When to invoke
|
||||
## What a profile is
|
||||
|
||||
- User asks to switch profile (`set design`, `profile dev`, `quel profil actif`).
|
||||
- User wants to see what's in a profile (`profile show qa`).
|
||||
- User wants to compare profiles (`profile diff design qa`).
|
||||
- User asks to "reduce gstack noise" or "only design skills".
|
||||
`lib/profiles/<name>.json` holds `enabledPlugins` (every pack and managed
|
||||
plugin, explicit), optional `deniedMcpServers` (the two higgsfield claude.ai
|
||||
connectors) and optional `model`. Descriptions: `lib/profiles/README.md`.
|
||||
|
||||
## Profiles available
|
||||
- Per project: `set <name>` merges the fragment into
|
||||
`.claude/settings.local.json` (other keys kept). Then `/reload-plugins`
|
||||
loads the packs in this session; connectors and model apply to the next
|
||||
session.
|
||||
- Per conversation: `cc <session> <name>` (lib/cc.sh) runs
|
||||
`claude --settings lib/profiles/<name>.json`. That conversation is frozen:
|
||||
editing the fragment or the local file changes nothing here, and a pack the
|
||||
fragment turns off cannot come back; start another `cc`.
|
||||
- No profile: the manifest defaults, which equal `full` with the connectors
|
||||
present.
|
||||
|
||||
| Profile | Use case |
|
||||
|------------|----------|
|
||||
| `web` | Public website work — frontend + content + light dev |
|
||||
| `seo` | SEO + GEO + W3C audit — search/AI indexability + standards |
|
||||
| `web-full` | Production website end-to-end — `web` + `seo` combined |
|
||||
| `full` | Default — everything the other profiles carry, minus broken or doctrine-breaking gstack |
|
||||
| `max` | Everything — full + parked tools (make-pdf, diagram, 21st generation trio) + pr-review-toolkit |
|
||||
| `backend` | Backend / API / system dev — no design, no SEO |
|
||||
| `design` | Visual QA, design systems, mockups, polish |
|
||||
| `dev` | Daily code work — features, fixes, refactor, ship (any stack) |
|
||||
| `qa` | Site testing, perf, canary, validation |
|
||||
| `audit` | Comprehensive audit — security + SEO + GEO + W3C + perf + health |
|
||||
| `minimal` | Strip all gstack skills (quiet session) |
|
||||
## Verbs
|
||||
|
||||
## Mechanism
|
||||
| verb | effect |
|
||||
|---|---|
|
||||
| `list` | names + descriptions |
|
||||
| `show <n>` | the fragment: packs on/off, denied connectors, model; `missing` on a pack with no `skills/pack-<n>/` |
|
||||
| `current [--plain]` | effective state of this project and conversation; `--plain` is what gates and the statusline read |
|
||||
| `set <n>` | write the fragment into the local file |
|
||||
| `unset` | remove the managed keys from the local file |
|
||||
| `enable <pack>` / `disable <pack>` | one pack (`design`, `pack-design` or a plugin id) |
|
||||
| `diff <n>` | effective state against a fragment |
|
||||
|
||||
Each profile is a plain-text file under `lib/profiles/<name>.profile` that
|
||||
lists items + types:
|
||||
Refusals (rc 2, nothing written): unknown profile or pack, not a project
|
||||
root (no `CLAUDE.md`, no `.git`), unreadable or invalid local JSON.
|
||||
|
||||
| Type | Toggle mechanism |
|
||||
|-------------------------|------------------|
|
||||
| `gstack` | symlink move skills/ ↔ skills-disabled/gstack__\<name\> |
|
||||
| `personal` | symlink move skills/ ↔ skills-disabled/\<name\> (no prefix) |
|
||||
| `external` | symlink move skills/ ↔ skills-disabled/\<name\> |
|
||||
| `plugin@<marketplace>` | `claude plugin enable\|disable <name>@<marketplace>` (auto) |
|
||||
| `mcp` | advisory — prints manual `claude mcp add …` command (no server is managed today: `MANAGED_MCPS` is empty since 21st.dev moved to a CLI) |
|
||||
| `cli` | advisory only — reports installed/not-installed |
|
||||
## Rules
|
||||
|
||||
**Always-on plugins** (`security-guidance`) and the vendored superpowers
|
||||
skills are never toggled by a profile — `set` will refuse to disable the
|
||||
plugin even if the profile omits it, and the 7 superpowers skills are
|
||||
linked outside any profile.
|
||||
**Managed plugins** that `set` may disable when not in profile:
|
||||
`ui-ux-pro-max@ui-ux-pro-max-skill`, `plugin-dev@claude-code-plugins`,
|
||||
`pr-review-toolkit@claude-code-plugins`. Other plugins are never auto-toggled.
|
||||
**Managed externals** (`emil-design-eng`, `frontend-design`,
|
||||
`design-motion-principles`, `impeccable`, and the five 21st design skills
|
||||
`21st-ui-build`, `21st-ui-explore`, `21st-ui-review`, `21st-cli-use`,
|
||||
`21st-ai`) follow the same symmetry (BDR-079): `set` enables them when the
|
||||
profile lists them (from parked state, or from `skills-external/` if the
|
||||
symlink never existed) and parks them when it does not — e.g. `set backend`
|
||||
after design work turns emil and the 21st pack off. `darwin-skill`,
|
||||
`21st-registry`, `21st-design-sync` and any other unlisted external are never
|
||||
auto-touched. gstack works the same
|
||||
all the way down: a profile listing gstack skills while the whole pack is
|
||||
off (via `toggle-external.sh`) re-enables JUST those skills on demand.
|
||||
|
||||
**Default profile**: `full` is in force whenever `.active-profile` is
|
||||
absent, empty, or the legacy `none` (statusline, `current`, `gstack off`,
|
||||
`reset` all resolve it the same way). `reset` applies it (`set full`,
|
||||
exclusive); a fresh `make plugin` applies it too when nothing has ever
|
||||
been selected.
|
||||
|
||||
## Commands
|
||||
|
||||
```bash
|
||||
# List available profiles
|
||||
bash "$HOME/.claude/lib/profile.sh" list
|
||||
|
||||
# Show profile contents + per-skill status
|
||||
bash "$HOME/.claude/lib/profile.sh" show <name>
|
||||
|
||||
# Report the active profile (label + match %)
|
||||
bash "$HOME/.claude/lib/profile.sh" current
|
||||
|
||||
# Enable skills in profile (additive — keeps others enabled)
|
||||
bash "$HOME/.claude/lib/profile.sh" apply <name>
|
||||
|
||||
# Enable only skills in profile (disables non-listed gstack skills)
|
||||
bash "$HOME/.claude/lib/profile.sh" set <name>
|
||||
|
||||
# Go to the default profile (full) — exclusive, same as `set full`
|
||||
bash "$HOME/.claude/lib/profile.sh" reset
|
||||
|
||||
# Toggle gstack only, keeping the active-profile label intact
|
||||
bash "$HOME/.claude/lib/profile.sh" gstack on # restore parked gstack skills on top of the current profile
|
||||
bash "$HOME/.claude/lib/profile.sh" gstack off # disable gstack skills not in the active profile
|
||||
|
||||
# Compare two profiles
|
||||
bash "$HOME/.claude/lib/profile.sh" diff <a> <b>
|
||||
```
|
||||
|
||||
## Execution
|
||||
|
||||
Run `lib/profile.sh` with the user's arguments. If user passed nothing, default
|
||||
to `list`. If user named a profile without a verb (e.g. "profile design"),
|
||||
treat it as `set <name>` — but confirm first because `set` disables other gstack
|
||||
skills.
|
||||
|
||||
```bash
|
||||
bash "$HOME/.claude/lib/profile.sh" $ARGUMENTS
|
||||
```
|
||||
|
||||
## Failure modes
|
||||
|
||||
| Trigger | First move | If still stuck |
|
||||
|---|---|---|
|
||||
| `lib/profile.sh` absent (foreign machine, links broken) | `test -f "$HOME/.claude/lib/profile.sh"` before any verb; missing → propose `bash link.sh` from the config repo | STOP — never hand-move symlinks to emulate the script |
|
||||
| Unknown profile name (rc=1, `✗ Profile not found`) | Show `list` output + the closest existing name ("`desing` → did you mean `design`?") | Let the user pick — never guess-and-`set` |
|
||||
| Unknown verb (rc=1 + usage) | Re-map the request to the argument-hint verbs, retry once | Show usage, ask |
|
||||
| `set`/`apply` exits nonzero MID-TOGGLE (permission, plugin CLI failure) | State may be PARTIAL. Run `current` to show what actually took; name the failed item from the script's output | run `current`, then re-run `set <name>` or `reset` (both are full exclusive applies, not an always-safe undo) |
|
||||
| Plugin/MCP leg fails (marketplace/network) while symlink leg succeeded | Report the split state explicitly + print the manual `claude plugin`/`claude mcp` command for the failed leg | — |
|
||||
| `current` names a profile other than the one just set | Cache (`.active-profile`) was written by another tool or hand-edited — show the raw script output to the user | Never hand-patch `.active-profile` — re-run `set <name>` (or `reset`) to force it back |
|
||||
|
||||
## Output policy
|
||||
|
||||
- After `set` / `apply` / `reset` / `gstack on|off`: show the count of skills
|
||||
moved + tell the user to start a new Claude session to pick up the changes
|
||||
(Claude scans `skills/` at session start).
|
||||
- After `current`: report the active profile + match %; `default — not
|
||||
applied yet` means the default profile is in force but not yet applied —
|
||||
point the user at `reset`.
|
||||
- After `show`: render the grouped output directly — no extra commentary unless
|
||||
the user asks.
|
||||
|
||||
## Tradeoffs to mention if asked
|
||||
|
||||
- gstack skills still depend on `~/.claude/skills/gstack/bin/` for telemetry,
|
||||
update-check, learnings — script doesn't touch that infra. Disabled skills
|
||||
are just hidden from Claude Code's scanner; the gstack repo stays installed.
|
||||
- Profile changes DO toggle the managed Claude Code plugins (ui-ux-pro-max,
|
||||
plugin-dev, pr-review-toolkit) and the managed external packs
|
||||
(emil-design-eng, frontend-design, design-motion-principles, impeccable,
|
||||
the 21st design skills) — in BOTH directions: `set` enables what the profile
|
||||
lists and disables the managed leftovers it doesn't (BDR-008, BDR-079).
|
||||
Anything outside those allowlists stays manual: `claude plugin
|
||||
enable|disable`, `bash lib/toggle-external.sh enable|disable <tool>`.
|
||||
- `set` is destructive in the sense that it disables non-listed gstack skills.
|
||||
Use `apply` if the user wants additive behavior.
|
||||
- Never write the user scope (`~/.claude/settings.json`); never run
|
||||
`claude plugin enable|disable`. A pack need found mid-skill is proposed to
|
||||
the user (`set <n>` or `enable <pack>` + `/reload-plugins`, or a relaunch
|
||||
under `--settings`), written only on consent (lib/plugin-gate.md).
|
||||
- `deniedMcpServers` is a union across settings files: a `cc x web` over a
|
||||
project set to `dev` keeps the connectors denied; `set web` in the
|
||||
project brings them back for the next session.
|
||||
- `max` turns on `pack-extras` (diagram, make-pdf, 21st-ai, 21st-ui-explore,
|
||||
21st-ui-review); `pack-higgsfield` is on in `max` only, else `enable
|
||||
higgsfield` for a named media ask.
|
||||
@@ -1,5 +1,5 @@
|
||||
[
|
||||
{"id": 1, "prompt": "profile list", "expected": "Skill runs `bash $HOME/.claude/lib/profile.sh list` and prints the table of every profile defined under lib/profiles/*.profile (10 today, incl. web, full, minimal) without extra commentary."},
|
||||
{"id": 2, "prompt": "active les skills design — désactive le bruit gstack", "expected": "Skill interprets this as `set design` (destructive — disables non-listed gstack skills), confirms first since `set` is destructive, then runs `bash $HOME/.claude/lib/profile.sh set design` and reports the count of skills moved plus the reminder to start a new Claude session to pick up changes."},
|
||||
{"id": 3, "prompt": "quel profil est actif?", "expected": "Skill runs `bash $HOME/.claude/lib/profile.sh current` and reports the detected active profile with its match percentage; does NOT toggle any symlinks."}
|
||||
{"id": 1, "prompt": "profile list", "expected": "Skill runs `bash $HOME/.claude/lib/profile.sh -C \"$PWD\" list` and prints the profiles defined under lib/profiles/*.json (web, full, minimal, ...) without extra commentary."},
|
||||
{"id": 2, "prompt": "active les skills design — désactive le bruit gstack", "expected": "Skill interprets this as `set design`, runs `bash $HOME/.claude/lib/profile.sh -C \"$PWD\" set design`, and reminds to run /reload-plugins (connectors and model apply to the next session)."},
|
||||
{"id": 3, "prompt": "quel profil est actif?", "expected": "Skill runs `bash $HOME/.claude/lib/profile.sh -C \"$PWD\" current` and reports 'profile: <name> [local|default|conv ...]'; writes nothing."}
|
||||
]
|
||||
Reference in new issue
Block a user