feat(advisor): packs vocabulary, profile set only on a project without profile

The advisor emits tokens (SET / ENABLE / DISABLE); the plugin gate checks
them against closed lists, prints what a set turns off and on, applies
at the git root only, set first. USAGE and onboard follow; plugin-dev gone.
This commit is contained in:
bchanot committed 2026-11-11 19:00:14 +01:00
1 parent 80f56ef815
commit 9b12b1226c
6 files changed
+211 -175

No files matched your search

+41 -40
View File
@@ -178,8 +178,8 @@ Tu veux...
> Cette table couvre les skills personnels principaux. `/seo` et `/geo` (pack-seo)
> et `/web-validate` (pack-web-validate) vivent dans des packs : un profil qui laisse
> le pack éteint les masque (`/profile current`). Les plugins (gstack,
> pr-review-toolkit…) et marketplaces externes en ajoutent beaucoup d'autres ;
> le pack éteint les masque (`/profile current`). Les packs gstack-dev,
> gstack-browser et gstack-design, les plugins (pr-review-toolkit…) et marketplaces externes en ajoutent beaucoup d'autres ;
> `/skills-perso` liste tes skills personnels.
---
@@ -226,18 +226,18 @@ Le mod `mods/memory/` note les échecs Bash et les jalons de la session pour que
## Les plugins — décision rapide
```
Toujours actifs (0 token) : security-guidance, rtk
Toujours actifs : security-guidance, rtk
Design élaboré/system → ui-ux-pro-max ON
Deploy + QA browser → gstack ON
Next.js/React/Prisma → context7 ON (WARN si absent, pas BLOCK)
Multi-session (>1 jour) → gsd v2 CLI (gsd dans terminal)
Design élaboré/system → pack design + ui-ux-pro-max@ui-ux-pro-max-skill
Deploy + QA browser → packs gstack-dev + gstack-browser
Next.js/React/Prisma → CLI ctx7 installé (WARN si absent, pas BLOCK)
Multi-session (>1 jour) → gsd CLI (gsd dans terminal)
Backend/CLI seulement → tout OFF (skills superpowers vendorisés, toujours actifs, 0 t passif)
Hotfix/quick fix → tout OFF (skills superpowers vendorisés, toujours actifs, 0 t passif)
Backend/CLI seulement → profil dev (skills superpowers vendorisés, toujours actifs)
Hotfix / script rapide → aucun changement de profil (/hotfix ou /bugfix)
```
**GSD v2** n'est pas un plugin Claude Code — c'est un CLI externe. Il ne consomme pas de tokens passifs. Tu le lances dans un terminal séparé avec `gsd`, puis `/gsd auto` pour le mode autonome.
**GSD** est un CLI externe, rien ne se charge dans Claude Code. Tu le lances dans un terminal séparé avec `gsd`, puis `/gsd auto` pour le mode autonome.
**Profils et packs.** Un profil se règle par projet (`/profile set web` puis `/reload-plugins`) ou par conversation (`cc <nom> web`, la conversation est figée: relance-la pour changer). Neuf profils: `full`, `max`, `minimal`, `dev`, `design`, `web`, `seo`, `qa`, `audit`. Sans profil, c'est `full`. Un `--settings` édité en cours de session reste sans effet. `cc` est une fonction de `lib/cc.sh`, à sourcer depuis `~/.bashrc` (`[ -f "$HOME/.claude/lib/cc.sh" ] && . "$HOME/.claude/lib/cc.sh"`) ; `make doctor` le signale tant qu'elle manque.
@@ -323,7 +323,7 @@ cd mon-projet-existant/
| 5 | Analyze read-only (analyzer agent) | .onboard-audit/analyze.md |
| 6 | Audits parallèles selon archétype : | .onboard-audit/*.md (9 fichiers max) |
| | — dette tech (general-purpose, audit read-only) |
| | — sécurité (cso si gstack ON, sinon OWASP fallback) |
| | — sécurité (cso si le pack gstack-dev est actif, sinon OWASP fallback) |
| | — docs drift (doc-syncer) |
| | — SEO + GEO (si public) |
| | — design UI/UX (si frontend) |
@@ -414,8 +414,10 @@ Ajouter un archétype : créer `~/.claude/lib/project-archetypes/<name>.md` (voi
/plugin-check "App mobile React Native Expo liste de courses, offline-first, SQLite, notifications push"
→ SIGNALS: frontend (mobile), fast-libs (Expo SDK)
→ WARN: context7 si Expo SDK 51+ utilisé (fast-libs)
→ OFF: gstack (mobile, pas de browser QA), ui-ux-pro-max (optionnel)
→ WARN: ctx7 CLI si Expo SDK 51+ utilisé (fast-libs)
→ ↻ SET: dev (mobile)
→ ⚡ ENABLE: pack design (frontend mobile, delta sur le profil dev)
→ OPTIONAL: ui-ux-pro-max@ui-ux-pro-max-skill
→ BLOCKING: none
```
@@ -491,9 +493,9 @@ gsd
/plugin-check "Site vitrine Next.js 14 studio photo, design élaboré, animations Framer Motion, galerie, dark mode, SEO"
→ SIGNALS: frontend, design-system, fast-libs(Next.js)
→ ENABLE: ui-ux-pro-max (~400t) — "design élaboré" signal fort
→ WARN: context7 non configuré → taper "force" pour continuer (ou configurer avant)
→ OFF: gstack (vitrine statique, pas de deploy complexe)
→ ↻ SET: web (site public)
→ KEEP: pack design + ui-ux-pro-max@ui-ux-pro-max-skill — "design élaboré" signal fort
→ WARN: ctx7 non configuré → taper "force" pour continuer (ou configurer avant)
→ COST: ~1600t passif (comfortable)
```
@@ -544,10 +546,9 @@ Sans ui-ux-pro-max : "Tailwind avec palette neutre, Inter". La différence est v
/plugin-check "Jeu de puzzle web React + FastAPI + PostgreSQL. Auth JWT, collection de cartes, boutique in-app, leaderboard. Multi-session, dev sur plusieurs semaines."
→ SIGNALS: frontend, fast-libs(React), deploy, multi-session
→ ENABLE: context7
→ ENABLE: ui-ux-pro-max (cartes visuelles, cohérence design)
→ CLI: gsd v2 RECOMMANDÉ (multi-session détecté)
→ OPTIONAL: gstack si deploy CI + browser QA prévus
→ KEEP: ctx7 CLI installé (find-docs, fast-libs React)
→ KEEP: pack design + ui-ux-pro-max@ui-ux-pro-max-skill (cartes visuelles, cohérence design)
→ CLI: gsd RECOMMANDÉ (multi-session détecté)
→ COST: ~1800t passif (avec context7)
```
@@ -644,8 +645,8 @@ ONBOARD COMPLETE: mycli
/plugin-check "Rust CLI, pas de frontend, pas de deploy"
→ SIGNALS: none (CLI pur)
→ DISABLE: ui-ux-pro-max, gstack, context7
→ (skills superpowers vendorisés, toujours actifs, 0 t passif)
→ ↻ SET: dev
→ (skills superpowers vendorisés, toujours actifs)
→ COST: ~800t (minimal)
→ ACTION REQUIRED? NO
```
@@ -701,18 +702,18 @@ DO NOT TOUCH:
**Contexte :** outil en ligne de commande, pas de frontend, pas de serveur, pas de Docker. Le cas le plus simple — illustre que le système fonctionne aussi bien sur les projets petits que complexes.
**Setup plugins — zéro token inutile :**
**Setup plugins — seulement ce que le projet demande :**
```
/plugin-check "CLI Rust, convertisseur de fichiers JSON/CSV/TOML, pas de réseau, pas de frontend"
→ SIGNALS: none (CLI pur, pas de deploy, pas de frontend)
→ (skills superpowers vendorisés, toujours actifs, 0 t passif)
→ DISABLE: ui-ux-pro-max, gstack, context7
→ (skills superpowers vendorisés, toujours actifs)
→ ↻ SET: dev
→ COST: ~800t (base seulement)
→ ACTION REQUIRED? NO
```
L'intérêt ici est de voir que `/plugin-check` est aussi utile pour confirmer qu'on n'a **rien** à activer, évitant de polluer le contexte avec 3000t de plugins inutiles.
L'intérêt ici est de voir que `/plugin-check` est aussi utile pour confirmer qu'on n'a **rien** à activer, évitant de polluer le contexte avec des packs inutiles.
**Prompt init (complet, pas de questions) :**
```
@@ -807,7 +808,7 @@ Simple à valider. L'architecture proposée est plate, pas de surprise.
**Contexte :** module `services/payment_service.py` dans un projet FastAPI existant. Écrit il y a 2 ans, jamais refactorisé. Violations connues : fonctions de 80 lignes, global state, pas de tests unitaires, logique métier mélangée avec appels HTTP.
**Setup :** projet déjà onboardé (CLAUDE.md présent), skills superpowers vendorisés (toujours actifs, 0 t passif), plugins inutiles désactivés.
**Setup :** projet déjà onboardé (CLAUDE.md présent), skills superpowers vendorisés (toujours actifs), packs inutiles désactivés.
#### Étape 1 — Analyse avant toute modification
@@ -920,7 +921,7 @@ PROJECT STATUS
CONFIG
Version : v2.5.0
Plugins ON: context7 (~200t), skills superpowers vendorisés (toujours actifs, 0 t passif)
Plugins ON: ctx7 CLI, skills superpowers vendorisés (toujours actifs)
GSD v2 : installed (3.0.0)
PROJECT
@@ -1018,9 +1019,9 @@ SIGNALS: simple, CLI/embedded
COST: ~0t (skills superpowers vendorisés, toujours actifs, 0 t passif)
RECOMMENDATIONS:
DISABLE : ui-ux-pro-max, gstack, context7
SET : minimal (embedded : tous les packs éteints)
NOTE : skills superpowers (brainstorming, writing-plans...) restent
disponibles par nom bare sans coût passif, même pour un
disponibles par nom bare, même pour un
firmware minimal.
```
@@ -1028,7 +1029,7 @@ RECOMMENDATIONS:
```
# Pas de /init-project, pas de GSD ; skills superpowers vendorisés
# (toujours actifs, 0 t passif) mais non invoqués ici
# (toujours actifs) mais non invoqués ici
# 1. Comprendre avant de modifier
/analyze src/drivers/uart.c
@@ -1052,7 +1053,7 @@ OUTPUT:
/ship-feature "Corriger l'accès non-atomique au ring_buffer_head dans l'ISR"
STEP 0b — CLAUDE.md found
STEP 0 — plugin check: skills superpowers vendorisés (toujours actifs, 0 t passif)
STEP 0 — plugin check: skills superpowers vendorisés (toujours actifs)
STEP 1 — BRAINSTORM (rapide, contexte déjà clair depuis /analyze):
Design: protéger ring_buffer_head avec __disable_irq()/__enable_irq()
@@ -1075,7 +1076,7 @@ STEP 4 — IMPLEMENT (subagents légers, modifications chirurgicales)
```
**Points clés :**
- `/plugin-check` confirme qu'aucun plugin inutile n'est actif (skills superpowers vendorisés, toujours actifs, 0 t passif).
- `/plugin-check` confirme qu'aucun pack inutile n'est actif (skills superpowers vendorisés, toujours actifs).
- `/analyze` est particulièrement utile sur du code C bas-niveau : l'analyzer identifie les accès non-atomiques, les race conditions, les violations de normes, **sans proposer de fix**.
- Pour un firmware, le workflow `analyze → ship-feature` peut se réduire à `analyze → edit direct` si la modification est triviale.
- GSD v2 n'est jamais pertinent pour du firmware : les sessions sont courtes et les tâches atomiques.
@@ -1087,11 +1088,11 @@ STEP 4 — IMPLEMENT (subagents légers, modifications chirurgicales)
Description contient... → Plugin
─────────────────────────────────────────────────────
Next.js 13+ / App Router → context7 WARN
Prisma / Supabase → context7 ON
"design élaboré" / tokens → ui-ux-pro-max ON
Docker + QA browser → gstack ON
"plusieurs semaines" → gsd v2 CLI
Rust / Python / Go / C → tout OFF (skills superpowers vendorisés, 0t)
Mobile / Flutter / RN → gstack OFF
Hotfix / script rapide → tout OFF (skills superpowers vendorisés, 0t)
Prisma / Supabase → ctx7 installé
"design élaboré" / tokens → pack design + ui-ux-pro-max@ui-ux-pro-max-skill
Docker + QA browser → packs gstack-dev + gstack-browser
"plusieurs semaines" → gsd CLI
Rust / Python / Go / C → profil dev (skills superpowers vendorisés)
Mobile / Flutter / RN → packs gstack-browser + gstack-design off
Hotfix / script rapide → aucun changement de profil (/hotfix ou /bugfix)
```
+85 -116
View File
@@ -37,11 +37,6 @@ CLIs from `CLIS`. `PLUGINS` alone is installed state, never per-project.
supabase/@supabase/supabase-js, drizzle-orm, expo. Never re-scan the
manifest to make this split.
`REQUEST` MAY carry `PLAN: Max|Pro|Free` from the dispatcher. Echo it in
the output. Absent → output `PLAN: unknown (not provided)` and SKIP the
plan-budget WARN (absolute COST ESTIMATE still reported). Never assume a
plan.
---
## PHASE 2 — ANALYZE
@@ -60,7 +55,6 @@ Detect signals from REQUEST + the PROBE REPORT fields:
| `fast-libs` | Next.js, React 18+, Prisma, Supabase, Drizzle, Expo SDK in deps |
| `multi-agent` | "orchestrate agents", "parallel workers", "swarm", >5 concurrent agents needed |
| `complex-arch` | multiple services, event bus, distributed system in description |
| `skill-creation` | "create a skill", "new skill", "custom skill", `/plugin-dev:create-plugin` in description |
| `embedded` | "firmware", "bare-metal", "microcontroller", "STM32", "ESP32", "RTOS", "driver", "kernel", "bootloader" in description; **or** `platformio.ini` present; **or** linker script (`*.ld`, `*.lds`) present; **or** `Makefile` + `src/*.c` + no `package.json`/`Cargo.toml`/`go.mod`/`setup.py`/`pyproject.toml` (C project without standard ecosystems). Note: `.c` files with a Rust/Node/Go manifest = FFI binding, NOT embedded. |
| `simple` | single file, hotfix, quick script, no frontend, no deploy |
| `anim-lib-eligible` | PROBE REPORT `ANIM` field: `eligibility=eligible|…` (React/Vue/Svelte stack) |
@@ -82,11 +76,11 @@ Factors (weighted):
| Infra/deploy | 15% | Local only | Single deploy target | Multi-env, CI/CD, containers, monitoring |
**Score thresholds:**
- **0-30% (simple)**: superpowers skills only (vendored, always on). No gstack, no gsd, no ctx7, no graphify.
_Examples: site vitrine, landing page, script CLI, simple CRUD._
- **30-60% (moderate)**: + context7 if fast-libs. graphify only once the codebase passes 200 tracked code files (session-start banner informs, the user decides — BDR-097), never at scaffold.
- **0-30% (simple)**: superpowers skills always on (vendored). No gsd, no ctx7, no graphify.
_Examples: script CLI, simple CRUD._
- **30-60% (moderate)**: ctx7 CLI if fast-libs. graphify only once the codebase passes 200 tracked code files (session-start banner informs, the user decides — BDR-097), never at scaffold.
_Examples: blog with auth, dashboard with charts, API with validation._
- **60-85% (complex)**: + gstack if browser-QA, + gsd if multi-session. graphify: same 200-file rule, likely reached — say so, do not pre-enable.
- **60-85% (complex)**: + pack gstack-browser if browser-QA, + gsd CLI if multi-session. graphify: same 200-file rule, likely reached — say so, do not pre-enable.
_Examples: SaaS with billing, game with social features, e-commerce._
- **85-100% (enterprise)**: all tools justified.
_Examples: multi-service platform, real-time collab app, marketplace._
@@ -99,19 +93,19 @@ Output: `COMPLEXITY: <score>% — <label>` with one-line justification.
```
PLUGIN CHECK
ACTIVE: [plugin — status, one line each]
PROFILE: [active skill profile — name + match%, or "<name> (default — not applied yet …)"]
ACTIVE: [pack, plugin id or CLI — status, one line each]
PROFILE: <profile> (source=<local|flag|default>)
SIGNALS: [detected signals]
COMPLEXITY: <score>% — <simple|moderate|complex|enterprise>
PLAN: <Max|Pro|Free (echoed from REQUEST) | unknown (not provided)> (budget: ~<N>t | n/a)
COST ESTIMATE: run make doctor (measured; no per-plugin constants here)
RECOMMENDATIONS:
✅ KEEP : [plugin] — [reason]
⚡ ENABLE : [plugin] — [reason] — [install/enable cmd]
⚠️ DISABLE : [plugin] — [token cost saved, not needed here]
ℹ️ OPTIONAL: [plugin] — [marginal benefit, low priority]
🖥️ CLI : [gsd v2] — [run 'gsd' in terminal if multi-session]
↻ SET : <profile> — [reason]
✅ KEEP : [pack or plugin] — [reason]
⚡ ENABLE : [pack or plugin] — [reason] — enable <pack | full plugin id>
⚠️ DISABLE : [pack or plugin] — [reason] — disable <pack | full plugin id>
ℹ️ OPTIONAL: [pack or plugin] — [marginal benefit, low priority]
🖥️ CLI : [gsd] — [run 'gsd' in terminal if multi-session]
ANIMATION LIB:
✅ <lib> installed (anim-lib-installed)
@@ -123,36 +117,35 @@ BLOCKING: [issues] or none
ACTION REQUIRED? YES / NO
```
`↻ SET` is emitted ONLY when `source=default` AND `profile=full` AND the
target profile differs from `full` (target = `full` → `✅ KEEP`, no SET). It
names the profile only: the gate prints what the profile turns off. With a
SET line, every ENABLE / DISABLE is a delta against the TARGET profile (a
pack the target turns off but the project needs = ENABLE). `⚠️ DISABLE` comes
only from project-level probe signals (manifests, deps, file counts), never
from REQUEST-only signals (simple, hotfix, "this task"). Under `source=flag`
no profile.sh command at all: only `relaunch: cc <name> <profile>` when a
needed pack is off.
> ANIMATION LIB is **read-only** in this report. The advisor never installs
> packages itself — it just states the status. Installation happens in
> `/init-project` STEP 5e (auto) or `/onboard` STEP 2.5 (opt-in).
> **Apply, confirmation, and rollback are the DISPATCHER'S job** —
> **Apply and confirmation are the DISPATCHER'S job** —
> `lib/plugin-gate.md` steps 4-5 (main loop: present, ACTION-REQUIRED stop,
> PROPOSED-CHANGES confirmation, toggle + rollback). This agent only
> recommends and emits the EXACT toggle commands. It never applies, never
> asks the user (it cannot — it is dispatched).
> PROPOSED-CHANGES confirmation, profile.sh writes, atomic). This agent only
> recommends and emits the token to apply (profile, pack or full plugin id);
> the gate builds the profile.sh command from a fixed template. It never
> applies, never asks the user (it cannot — it is dispatched).
---
## DECISION TABLE
## SIGNAL → RECOMMENDATION
| Signal | Enable / Use | Disable / Skip | Notes |
|---|---|---|---|
| `frontend` | impeccable, ui-ux-pro-max, design-motion-principles | — | UI design + polish + motion. design-motion-principles = motion/animation, impeccable = the Build path: /impeccable verbs + deterministic detector (`npx impeccable detect`, 61 rules) — all external, symlinked |
| `mobile` (React Native/Expo/Flutter) | — | gstack (no browser QA), Docker N/A | ui-ux-pro-max optional |
| `monorepo` | per-package plugin recommendations | avoid recommending gstack for whole repo if only one package has browser QA | Specify which plugin applies to which package |
| `design-system` | impeccable, ui-ux-pro-max, design-motion-principles | — | Design tokens, theme, Storybook, motion; impeccable init persists the design context (DESIGN.md/PRODUCT.md) |
| `deploy` + `browser-qa` | gstack | — | Full-product workflow |
| `multi-session` | gsd v2 CLI | — | Run `gsd` in terminal, not CC plugin |
| `fast-libs` | context7 | — | Doc freshness critical |
| `multi-agent` + `complex-arch` | gsd v2 CLI | — | GSD v2 preferred for multi-session coordination |
| `simple` / single-session | — | gsd, gstack, ui-ux-pro-max | Saves passive tokens |
| `embedded` / firmware | — | all toggles (superpowers skills vendored, always on) | workflow: /analyze → /hotfix or /bugfix or /ship-feature |
| backend/lib/CLI only | — | ui-ux-pro-max, gstack | passive tokens saved |
| small project / hotfix | — | gstack, gsd | Use /hotfix, /bugfix, or /feat |
The Conditional RULES below are the only source: each signal maps to packs,
a profile, a managed plugin or a CLI.
**GSD v2 note:** `gsd-pi` is a standalone CLI (Pi SDK), not a Claude Code plugin. Zero passive token cost in CC sessions. Recommend when: feature > 1 day, multiple isolated context windows needed, crash recovery, cost tracking, or parallel workers. Usage: `gsd` in terminal → `/gsd auto`.
**GSD note:** `gsd-pi` is a standalone CLI (Pi SDK), not a Claude Code plugin: external CLI, nothing loads in Claude Code. Recommend when: feature > 1 day, multiple isolated context windows needed, crash recovery, cost tracking, or parallel workers. Usage: `gsd` in terminal → `/gsd auto`.
### Skill routing by task size
@@ -178,99 +171,69 @@ When the plugin-advisor detects a `simple` or `hotfix` signal, suggest the appro
| Pair | Relation | Verdict |
|---|---|---|
| gstack ↔ gsd v2 | ✅ Complementary | GStack = full-product CC workflow. GSD v2 = multi-session CLI. Different scopes, no conflict. |
| superpowers ↔ gsd v2 | ✅ Complementary | superpowers skills (vendored) = single-session execution. GSD v2 = multi-session CLI orchestration. No conflict. |
| superpowers ↔ gstack | ✅ Complementary | Used together in /init-project and /ship-feature. superpowers skills (vendored) = engine, GStack = full-product skills. |
| gstack packs ↔ gsd | ✅ Complementary | gstack packs = full-product CC workflow. GSD = multi-session CLI. Different scopes, no conflict. |
| superpowers ↔ gsd | ✅ Complementary | superpowers skills (vendored) = single-session execution. GSD = multi-session CLI orchestration. No conflict. |
| superpowers ↔ gstack packs | ✅ Complementary | Used together in /init-project and /ship-feature. superpowers skills (vendored) = engine, gstack packs = full-product skills. |
| context7 ↔ any | ✅ Independent | Doc lookup CLI (ctx7), no workflow overlap. Always safe to combine. |
| plugin-dev ↔ superpowers | ⚠️ Minor overlap | superpowers skills (vendored) can create skills too (writing-skills). Keep plugin-dev only when actively building new plugins. |
| ui-ux-pro-max ↔ gstack | ✅ Complementary | GStack = deploy/QA layer; ui-ux-pro-max = UI quality layer. Different concerns. |
| ui-ux-pro-max ↔ gstack packs | ✅ Complementary | gstack packs = deploy/QA layer; ui-ux-pro-max = UI quality layer. Different concerns. |
| pr-review-toolkit ↔ superpowers | ✅ Complementary | `requesting-code-review` (vendored superpowers skill) and /pr-review-toolkit:review-pr cover different review styles. |
| rtk ↔ any | ✅ Independent | Hook-only token compression. Zero interaction with any plugin. |
| security-guidance ↔ any | ✅ Independent | Hooks + out-of-band LLM reviews (agentic review on commit/push; Stop diff review disabled by ENABLE_STOP_REVIEW=0). No context injection unless a regex hits. |
### Recommended sets by project type
| Project type | Plugins ON | OFF |
|---|---|---|
| Backend API / microservice | (superpowers skills always on), context7 (if fast libs) | ui-ux-pro-max, gstack |
| Frontend SPA / SSR | (superpowers skills always on), ui-ux-pro-max, impeccable, design-motion-principles, context7 | gstack |
| Full-stack SaaS | (superpowers skills always on), gstack, ui-ux-pro-max, impeccable, design-motion-principles, context7 | — |
| CLI tool / library | (superpowers skills always on) | all toggles |
| Multi-session large feature | (superpowers skills always on) + gsd v2 CLI (external) | — |
| Quick fix / hotfix | (superpowers skills always on) | all toggles |
| Design system / component lib | (superpowers skills always on), ui-ux-pro-max, impeccable, design-motion-principles | gstack, gsd |
| Fast-evolving libs (Next.js etc.) | (superpowers skills always on), context7 | — |
| Enterprise multi-agent orchestration | (superpowers skills always on) + gsd v2 (external) | plugin-dev |
> rtk is always on at 0 context tokens; security-guidance is always on and
> costs quota out of band (LLM reviews), not context — both omitted from
> the estimates
### Conditional rules
```
RULE: IF "mobile" signal (React Native/Expo/Flutter detected):
→ gstack OFF — no browser QA on mobile
→ packs gstack-browser + gstack-design off — no browser QA on mobile
→ Docker NOT relevant — no server-side containerization for mobile
→ ui-ux-pro-max OPTIONAL — only if design system complexity is high
→ ui-ux-pro-max@ui-ux-pro-max-skill OPTIONAL — only if design system complexity is high
RULE: IF "monorepo" signal detected:
→ scan each top-level package individually for frontend/deploy/fast-libs signals
→ recommend plugins per-package, NOT for the whole repo
→ if only apps/api/ has deploy: gstack only if apps/api/ has browser QA too
→ NOTE in output: "Plugin X recommended for apps/web/ — disable for apps/api/"
→ passive cost estimate = highest-cost package profile (other packages add nothing)
→ ONE profile for the whole repo (profile.sh writes at the git root)
→ = the union of the packages' needs (frontend, deploy, fast-libs), plus enable deltas
→ pack gstack-browser only if some package has browser QA
RULE: IF "frontend" signal OR .tsx/.jsx count > 0:
→ ui-ux-pro-max ON if "design-system" signal
→ 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)
→ pack design ON (impeccable + design-motion-principles, external skills — ~/.claude/skills/pack-design/skills/impeccable)
→ ui-ux-pro-max@ui-ux-pro-max-skill ON if "design-system" signal
RULE: IF "deploy" AND "browser-qa" signals:
→ gstack ON — full-product workflow
→ packs gstack-dev + gstack-browser ON — full-product workflow
RULE: IF "multi-session" OR multi-day feature:
→ Recommend gsd v2 CLI: npm install -g gsd-pi → gsd → /gsd auto
→ Zero passive CC token cost
→ Recommend gsd CLI: npm install -g gsd-pi → gsd → /gsd auto
→ external CLI, nothing loads in Claude Code
RULE: IF "fast-libs" (Next.js/React 18+/Prisma/Supabase/Drizzle):
→ context7 ON (CLI; its find-docs skill always loads)
→ ctx7 CLI installed (find-docs skill always loads); never ENABLE/DISABLE
RULE: IF "multi-agent" AND "complex-arch":
→ gsd v2 CLI recommended (0t passive, multi-session coordination)
→ gsd CLI recommended (external CLI, nothing loads in Claude Code; multi-session coordination)
RULE: IF "simple" OR "hotfix":
→ Disable all toggles, base only.
→ recommend the lightweight skill only (see Skill routing by task size); a REQUEST-only
signal drives no SET and no DISABLE (both are project-wide, persistent)
RULE: IF "embedded" signal (firmware, bare-metal, microcontroller, or Makefile+C without Node/Rust/Go):
→ Disable ALL toggles including gstack, context7, plugin-dev
→ all packs off (profile `minimal`)
→ superpowers skills stay on (vendored, no toggle): useful for initial
design brainstorm on complex drivers, unnecessary for single-function
patches; just don't invoke them, no disable needed
→ GSD v2 CLI: not recommended (sessions are short, tasks are atomic)
→ GSD CLI: not recommended (sessions are short, tasks are atomic)
→ Recommend workflow: /analyze <file> → /hotfix (patch) or /bugfix (investigation) or /ship-feature (multi-file)
→ NOTE: print "embedded project detected — minimal plugin footprint recommended"
RULE: IF plugin-dev ON AND no `skill-creation` signal detected:
→ WARN: plugin-dev active but no skill-creation signal (saves its passive tokens if disabled)
→ Disable unless you're actively building custom plugins or skills
RULE: IF `skill-creation` signal:
→ plugin-dev ON
→ superpowers skills (vendored, always on): used for skill scaffolding (writing-skills)
RULE: IF `browser-qa` signal (e2e tests, Playwright/Cypress/Puppeteer in deps):
→ gstack ON — browser automation and QA
→ context7 OPTIONAL (depends on framework version)
→ pack gstack-browser ON — browser automation and QA
→ ctx7 CLI OPTIONAL (depends on framework version)
RULE: IF `design-system` signal (tokens, theme files, Storybook present):
→ ui-ux-pro-max ON
→ impeccable ON (external skill, 0t passive)
→ design-motion-principles ON (external skill, 0t passive)
→ WARN if all three OFF with this signal: significant design gap
→ pack design ON (impeccable + design-motion-principles, external skills)
→ ui-ux-pro-max@ui-ux-pro-max-skill ON
→ WARN if pack design and ui-ux-pro-max@ui-ux-pro-max-skill are both off with this signal: significant design gap
RULE: IF `complex-arch` signal (multiple services, event bus, distributed system):
→ gsd v2 CLI recommended for multi-session coordination
→ gsd CLI recommended for multi-session coordination
```
---
@@ -278,29 +241,37 @@ RULE: IF `complex-arch` signal (multiple services, event bus, distributed system
## WRITING A PROFILE OR A PACK
Everything switches through `lib/profile.sh`, per project, never the user
scope. Emit the exact command; never write files directly.
scope. Emit the token only (profile, pack or full plugin id); the gate builds
the command. Never write files directly.
| Signal | Profile | Command |
| Signal | Profile | Emitted line |
|---|---|---|
| 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 | `full` | `… set full` |
| backend / API / library | `dev` | `… set dev` |
| 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 <pack>` |
| public website, no SEO focus | `web` | `↻ SET : web` |
| audit-only: SEO + GEO + W3C + WCAG | `seo` | `↻ SET : seo` |
| public website end-to-end | `full` | `✅ KEEP` (no SET) |
| backend / API / CLI / library, typical dev session (+ ctx7 if fast libs) | `dev` | `↻ SET : dev` |
| frontend SPA / SSR, heavy UI, design system | `design` | `↻ SET : design` |
| full-stack SaaS | `full` | `✅ KEEP` (no SET) |
| browser QA only | `qa` | `↻ SET : qa` |
| comprehensive audit | `audit` | `↻ SET : audit` |
| narrow session (project-level) | `minimal` | `↻ SET : minimal` |
| multi-session / enterprise | current profile, or `dev` + gsd CLI | `↻ SET : dev` |
| one pack on top | — | `⚡ ENABLE : … — enable <pack or full plugin id>` |
| one pack off | — | `⚠️ DISABLE : … — disable <pack or full plugin id>` |
`<pack>` is one of design, scroll3d, seo, web-validate, gstack-dev,
gstack-browser, gstack-design, higgsfield, extras.
gstack-browser, gstack-design, higgsfield, extras. Managed plugins take
their full id, never the bare name: `ui-ux-pro-max@ui-ux-pro-max-skill`,
`pr-review-toolkit@claude-code-plugins`.
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.
Read `PROFILE :` first. `set` only when `source=default` AND `profile=full`
(no project profile yet); any other state gets per-pack enable / disable
deltas. `source=default` with another profile name = pack keys from shared
or user scope: deltas only. Under `source=flag` a pack it turns off cannot
be enabled in this conversation: recommend `relaunch: cc <name> <profile>`
instead of any ENABLE / DISABLE / SET line. 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").
@@ -308,16 +279,14 @@ generation service; explicit user ask only (CLAUDE.md "Skill routing").
## BLOCK if
- Superpowers skills missing → `make plugin` (vendors them) then `make link`
- Full-product (UI+deploy+QA) + gstack not installed
## WARN (no block)
- Active toggle plugins not needed for this task (dead passive cost)
- Active packs no project signal needs
- Multi-session feature + `gsd` CLI not installed → `npm install -g gsd-pi`
- Total passive cost > 50% of plan budget (Pro: ~5500t, Max: ~10000t, Free: ~2500t) — only when PLAN was provided; PLAN unknown → skip this WARN
- **Next.js/React 18+/Prisma/Supabase detected + context7 not configured**
→ Risk: Claude may generate code using outdated APIs (App Router changes frequently)
→ Fix: `npm install -g ctx7 && ctx7 setup --claude`
→ Fix: `npm install -g ctx7` (`make plugin` from the claude-config repo pins the version and wires find-docs)
→ Or standalone: `ctx7 docs /vercel/next.js "middleware"`
→ Free higher rate limits: `ctx7 login` (OAuth) or API key from context7.com/dashboard
→ Type "force" to proceed without context7 (not recommended for fast-evolving libs)
+45 -15
View File
@@ -39,32 +39,62 @@ PROBE REPORT (ground truth — do not re-detect):
## 4. PRESENT + BLOCKING GATE (main loop)
Show the returned PLUGIN CHECK block.
Show the returned PLUGIN CHECK block. The advisor emits tokens only; the
main loop builds every command from the fixed templates of step 5, never
pastes the advisor's text into a shell. Before running ANY command (the
step-4 diff included) check each token: a profile name is one of the advisor's own set
(web, seo, dev, design, qa, audit, minimal; never `full`, `max` or a
user-added profile) and matches `^[a-z0-9][a-z0-9-]*$` with an existing
`$HOME/.claude/lib/profiles/<name>.json`;
a pack is one of design, scroll3d, seo, web-validate, gstack-dev,
gstack-browser, gstack-design, extras (`higgsfield` is never accepted from an
advisor token: paid service, explicit user ask only); a plugin is one of the
two managed full ids `ui-ux-pro-max@ui-ux-pro-max-skill`,
`pr-review-toolkit@claude-code-plugins`. A token matching none is printed as
rejected and skipped, never run.
For a `↻ SET <profile>` line run
`bash "$HOME/.claude/lib/profile.sh" -C "<PROJECT_ROOT>" diff "<profile>"` and
print its `→ off` lines under it as "turns off" (none → "turns off: nothing")
and its `→ on` lines as "turns on" (none → "turns on: nothing").
The diff exits non-zero on a bad name, an unknown profile or a missing
profiles dir: on any non-zero exit print "turns off: unknown" and continue.
- `ACTION REQUIRED? YES` → offer: A) fix plugins B) type "force". STOP until
answered.
- OK → print `✅ Plugin check passed — [active plugins] — complexity: <score>%`.
## 5. APPLY GATE (main loop: only when the flow auto-activates)
If any plugin has ⚡ ENABLE status:
1. List the changes:
Trigger: a `↻ SET`, `⚡ ENABLE` or `⚠️ DISABLE` line. Under `source=flag`
(`PROFILE :` block) the advisor emits only `relaunch: cc <name> <profile>`:
nothing is applied. Apply only when
`git -C "<PROJECT_ROOT>" rev-parse --show-toplevel` equals PROJECT_ROOT;
otherwise print the commands and apply nothing ("no git root yet: run them
after git init").
1. List the changes, saying they are project-wide and persist in
`<PROJECT_ROOT>/.claude/settings.local.json`:
```
PROPOSED CHANGES:
⚡ Enable ui-ux-pro-max (frontend detected, complexity 65%)
⚡ Pre-fetch ctx7 docs for next.js, prisma
PROPOSED CHANGES (project-wide, persisted in
<PROJECT_ROOT>/.claude/settings.local.json):
↻ Set profile dev (backend detected) — turns off: <diff lines>
⚡ Enable pack design (frontend detected, complexity 65%)
⚡ Enable ui-ux-pro-max@ui-ux-pro-max-skill
Apply these changes? (yes / no / customize)
```
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.
2. "yes" → run the changes in order, the SET first, then the deltas (after
"customize" too). Each one is
`bash "$HOME/.claude/lib/profile.sh" -C "<PROJECT_ROOT>" set "<name>"`,
`... enable "<pack | full plugin id>"` or
`... disable "<pack | full plugin id>"` (same prefix). Each call
writes `.claude/settings.local.json` atomically or refuses (rc 2, nothing
written): 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.
next session).` Say the change is project-wide and persists in
`<PROJECT_ROOT>/.claude/settings.local.json`. Print the undo: after a SET:
`bash "$HOME/.claude/lib/profile.sh" -C "<PROJECT_ROOT>" unset`, after
deltas the inverse enable / disable.
**Never auto-activate without showing the list and getting confirmation.
Never write the user scope.**
+33 -1
View File
@@ -155,7 +155,39 @@ check SB10-hook-plugin-dev "$(gone hooks/session-start.sh 'plugin.dev')" 1
check SB10-reporter-const "$(gone agents/status-reporter.md \
'PLUGIN_TOKENS|~[1-9][0-9-]*t')" 1
check SB10-advisor-figures "$(gone agents/plugin-advisor.md \
'~[1-9][0-9-]*t' 'plan budget')" 1
'~[1-9][0-9-]*t')" 1
check SB10-advisor-vocab "$(gone agents/plugin-advisor.md \
'plugin-dev|PLAN:|plan budget|0t passive|rollback|gstack ON|gstack OFF|'\
'\[plugin\]|ctx7 setup|passive tokens')" 1
check SB10-gate-vocab "$(gone lib/plugin-gate.md \
'Pre-fetch ctx7|Enable ui-ux-pro-max \(')" 1
gate="$(cat "$ROOT/lib/plugin-gate.md")"
check SB10-gate-diff "$(has "$gate" 'profile.sh" -C')" 1
check SB10-gate-diff2 "$(has "$gate" 'diff "<profile>"')" 1
check SB10-gate-root "$(has "$gate" 'rev-parse --show-toplevel')" 1
check SB10-gate-rejected "$(has "$gate" 'rejected')" 1
check SB10-gate-quoted "$(gone lib/plugin-gate.md '-C <PROJECT_ROOT>')" 1
check SB10-advisor-fullid "$(has "$(cat "$ROOT/agents/plugin-advisor.md")" \
'ui-ux-pro-max@ui-ux-pro-max-skill')" 1
# anchored: "120000 tokens" (the /route show sample) is not a 0-token claim
check SB10-usage-vocab "$(gone USAGE.md \
'0 t passif|(^|[^0-9])0 token|gstack ON|gstack OFF|context7 ON|'\
'~[1-9][0-9]*t\)' COST)" 1
check SB10-usage-packs-group "$(gone USAGE.md \
'packs gstack \(|DISABLE: pack design, packs gstack')" 1
check SB10-advisor-keep-full "$(gone agents/plugin-advisor.md 'SET : full')" 1
check SB10-usage-gate-lists "$(gone USAGE.md \
'le gate liste ce que le profil coupe')" 1
check SB10-gate-profiles-path "$(has "$gate" '$HOME/.claude/lib/profiles/')" 1
check SB10-gate-C-oneline "$(gone lib/plugin-gate.md '-C *$')" 1
check SB10-onboard-ctx7 "$(gone skills/onboard/SKILL.md 'ctx7 setup')" 1
check SB10-onboard-install "$(gone skills/onboard/SKILL.md \
'make plugin`? *\(installe')" 1
check SB10-gate-turns-on "$(has "$gate" 'turns on')" 1
check SB10-gate-set-tokens "$(has "$gate" \
'web, seo, dev, design, qa, audit, minimal')" 1
check SB10-check-cmds "$(gone skills/plugin-check/SKILL.md \
"advisor's exact commands")" 1
printf 'session-banner: %d passed, %d failed\n' "$pass" "$fail"
[ "$fail" -eq 0 ]
+4 -1
View File
@@ -251,10 +251,13 @@ Pour chaque fast-lib détectée :
```
⚠️ ctx7 non installé — risque de code utilisant des APIs obsolètes
sur : [liste fast-libs]
Install : `npm install -g ctx7 && ctx7 setup --claude`
Install : `npm install -g ctx7`
Version épinglée et find-docs : `make plugin` depuis le dépôt claude-config
Ou continuer sans (non recommandé pour fast-libs).
```
Demander : `yes install now / continue without / skip audit`.
`yes install now` lance uniquement `npm install -g ctx7` (jamais
`make plugin`, qui dépend du répertoire courant).
- **Pas de fast-lib** → skip silencieusement.
+3 -2
View File
@@ -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 commands for the user instead. Never write: the user runs
them (`lib/profile.sh` `set <profile>` / `enable <pack>` writes the
the commands the main loop builds from the gate's step-5 templates (`set` /
`enable` / `disable`, with `-C "<PROJECT_ROOT>"`), after the gate's token
check, 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