diff --git a/.claude/audits/BUGS-FOUND.md b/.claude/audits/BUGS-FOUND.md index dd1d3c4..e49f2c0 100644 --- a/.claude/audits/BUGS-FOUND.md +++ b/.claude/audits/BUGS-FOUND.md @@ -22,3 +22,11 @@ - lib/memory.sh `memory_legacy_status` default range (`## ID` to the next `## BLK-`) — on a v1 registry a `### BLK-` entry after a `## BLK-` entry feeds its status line to the `##` entry: a resolved `###` entry can close the open `##` entry above it, which then leaves the handover §5 (the `###` ID itself is flagged unreadable). Severity: low (rare dialect, flagged indirectly). Discovered while: /bugfix G5 verifier. Not fixed. - agents/handover-doc-writer.md:83 + agents/client-handover-writer.md:1201-1202 — `ROOT=""` pastes the root into a double-quoted literal, and the printed remedy `memory.sh -C status …` leaves `` unquoted: a root with `"`, `$(…)`, a backtick or a space breaks the line or splits the path. Value is the operator's own `git rev-parse --show-toplevel`, not registry data. Severity: low. Discovered while: /bugfix G5 security gate. Not fixed. - lib/profile-state.jq (`jq -r` output read by lib/detect-plugins.sh `list_on_plugins` / `detect_gstack`) — a settings value carrying a newline can forge a `plugin:=on` line in the PROFILE_PLAIN text, so the banner or status shows a plugin ON that is not. Display-only, pre-existing for detect_gstack. Severity: low. Discovered while: /bugfix G1+G4 security gate 2026-11-10. Not fixed. + + +- agents/plugin-advisor.md embedded RULE (~:217) — the `embedded` signal can come from REQUEST keywords alone ("driver", "kernel", :58) and maps to `↻ SET : minimal`, against the gated rule "minimal reachable from project-level signals only" (only DISABLE is limited to project signals, :124-126). Gate confirmation limits it. Severity: medium (gated decision not fully enforced). Discovered while: /feat D3 verifier 2026-11-11. Not fixed. +- lib/plugin-gate.md:49-51 — pack `extras` accepted from an advisor token, but pack-extras bundles 21st-ai (credit-metered generate/iterate), same reason as the higgsfield exclusion; no advisor rule emits it. Severity: medium. Discovered while: /feat D3 security gate. Not fixed. +- skills/onboard/SKILL.md:255 + agents/plugin-advisor.md:289 — say `make plugin` installs a pinned ctx7; plugins.lock.json pins "latest" (install-plugins.sh:573-574). Fix the wording or pin ctx7. Severity: low. Discovered while: /feat D3 security gate. Not fixed. +- agents/plugin-advisor.md:281 BLOCK "Superpowers skills missing → make plugin" + lib/plugin-gate.md:61 "A) fix plugins" undefined — cwd-dependent `make plugin` in an onboarded foreign repo; qualify with the claude-config repo or make it print-only. Severity: low. Discovered while: /feat D3 security gate. Not fixed. +- lib/plugin-gate.md templates — tokens and `""` sit in double quotes (`$()` / backticks still expand; protection = the prose closed-list check); linked worktree: the apply check compares `--show-toplevel` but profile.sh writes at the parent of `--git-common-dir` (confirmed path ≠ written path, same repo); PROJECT_ROOT = $HOME as a git repo passes the check and find_root writes `~/.claude/settings.local.json`. Severity: low (defense in depth). Discovered while: /feat D3 security gates. Not fixed. +- skills/onboard/SKILL.md:387-762 and skills/tour/SKILL.md:155 — still "gstack ON/OFF" (packs vocabulary elsewhere since D3); cosmetic: unwrapped lines skills/plugin-check/SKILL.md:17, lib/plugin-gate.md:45, USAGE.md:182, USAGE.md:1022 transcript without the ↻ glyph. Severity: low. Discovered while: /feat D3 verifier. Not fixed. diff --git a/.claude/memory/decisions.md b/.claude/memory/decisions.md index 632bdf2..e0e9bc0 100644 --- a/.claude/memory/decisions.md +++ b/.claude/memory/decisions.md @@ -1530,3 +1530,9 @@ Supersedes [[BDR-030]]. - **Alternatives rejected**: `syncClaudeAiSkills: false` (moves synced skills to `~/.claude/skills/.trash/`, not reversible per project); skillOverrides in profile fragments (session without profile reads no fragment); lower budget (40000 = 50000 once synced off, no gain). - **Also 2026-11-09**: user removed Higgsfield + unused claude.ai connectors at account level → MCP instr 2.4k → 0.77k on full; profile `deniedMcpServers` now dead (cleanup queued). Full headless 32.2k → 26.9k total. - **Amends** [[BDR-134]] "nothing global": account-level noise cut globally, packs/profiles untouched. Ref: feature/claude-ai-skills-off 47438f4, contract .claude/tasks/contracts/2026-11-09-claude-ai-skills-off-1253.md. See [[BDR-125]]. + +## BDR-142 — Plugin advisor emits tokens; profile set only on a project without profile, gate validates and applies [accepted] (2026-11-11) +- **Decision**: plugin advisor emits tokens only: `↻ SET `, `⚡ ENABLE` / `⚠️ DISABLE `. SET only when source=default AND profile=full AND target != full; else enable/disable deltas against current (or SET target). Hotfix/quick-fix request never changes profile. DISABLE from project-level probe signals only. Under source=flag: no write, `relaunch: cc` only. Monorepo = one profile at git root (union). lib/plugin-gate.md (main loop) checks tokens vs closed lists (profiles web/seo/dev/design/qa/audit/minimal, 8 packs w/o higgsfield, 2 managed full ids), builds `profile.sh -C ""` cmds from fixed templates, prints `diff` turns off/on, applies only when git toplevel == root, SET first, prints undo. +- **Why**: `set` merges whole fragment (every managed key): a recommendation on a project with chosen packs or a custom state wiped them silently (web project told "backend → dev" lost 6 packs). Advisor has no Bash: lists it "computed" were invented; gate holds the shell. Bare `ui-ux-pro-max` id refused rc 2. +- **Alternatives rejected**: set anytime with turns-off list (clobbers custom/chosen packs); hotfix → set minimal (task-scoped mass disable, persists project-wide); advisor printing full commands (unvalidated token reaches shell). +- **Ref**: feature/banner-drop-plugin-dev 80f56ef + 9b12b12, plan .claude/tasks/plans/2026-11-11-advisor-packs-vocabulary-1000.md (r3, 2 challenge rounds, 4 exec rounds). Follow-ups in BUGS-FOUND (embedded keyword → SET minimal, extras metered pack, quoting). See [[BDR-134]]. diff --git a/.claude/memory/journal.md b/.claude/memory/journal.md index 9884e0e..957d912 100644 --- a/.claude/memory/journal.md +++ b/.claude/memory/journal.md @@ -719,3 +719,4 @@ rules: ## 2026-11-11 - 2026-11-11: /bugfix G5 handover blocker status: 2 challenge rounds -> r3 reconcile_blk_classify (open/closed/unreadable), STEP 9 rooted on PACKAGE root, mandatory SYNTH MEMORY line relayed to user; gates MET/CONFORME/PASS first pass; commit 93a8e19 + changelog; G6-G9 + 2 LOW logged in BUGS-FOUND; BLK-048, LRN-276. +- 2026-11-11: G5 merged c0347eb. 3.0.0 scope set (D1-D6, dead denies, MIGRATION). /feat D2+D3 on feature/banner-drop-plugin-dev: 2 challenge rounds, RUN A banner (plugin-dev gone, OFF row hidden) 80f56ef, RUN B advisor packs vocabulary 9b12b12 after 2 verifier + 1 security rounds; docs; 6 follow-ups in BUGS-FOUND; BDR-142, LRN-277. diff --git a/.claude/memory/learnings.md b/.claude/memory/learnings.md index 6bae354..3da8f98 100644 --- a/.claude/memory/learnings.md +++ b/.claude/memory/learnings.md @@ -2031,3 +2031,8 @@ Rule: when editing a doctrine file under structure locks, grep the test's lock s - **Context**: G5 handover fix. Agent prompt carries bash snippet (STEP 9). Census grep on tokens stays green when snippet logic breaks; retyped copy in test drifts from shipped one. - **Pattern**: test extracts shipped fenced block (awk: first ```bash fence under its heading), sed swaps placeholders (root, lib dir) for fixture paths, runs with `bash `; negative control = HEAD block prints nothing. Status consumer classifies by ONE known word: closed → omit, known open word → list, anything else → unreadable bucket, flagged to user, never dropped, never substring close. - **Future application**: any agent/skill prompt holding shell (handover, reconcile, status-reporter); any new reader of registry status. + +## LRN-277 — Shell-derived facts belong to the agent with Bash; executor briefs forbid stdin readers (2026-11-11) +- **Context**: D3 plan r2 had advisor print "turns off: "; advisor tools Read/Glob/Grep, no Bash. Two challengers caught it: list would be invented. Same run: sonnet executors left stdin-blocked background jobs 3x (`python3 -`, `cat >>`, empty heredoc), one holding a stale compound command. +- **Pattern**: before assigning a computation to an agent, check its `tools:` frontmatter; shell-derived facts belong to the component that runs Bash (main-loop gate), the report-only agent names inputs only. Executor briefs forbid stdin readers without input (`cat` no file, `cat >>`, `python3 -`), require one simple foreground command per call; orchestrator TaskStops any leftover job named in the report before GATE 0. +- **Future application**: any plan splitting work between a reasoner agent and a gate; every feater/bugfixer brief. diff --git a/.claude/tasks/TODO.md b/.claude/tasks/TODO.md index f3bbc04..b7431f8 100644 --- a/.claude/tasks/TODO.md +++ b/.claude/tasks/TODO.md @@ -134,13 +134,13 @@ Shared rules for every phase: ### Actionable - [ ] BDR-125 obsolescence pass (2026-11-09, /code-clean on chore/bdr125-obsolescence-clean; report `.claude/tasks/plans/2026-11-09-bdr125-obsolescence-clean-1650.md`): phases 0/1/2 clean, 4a-4d code clean, 5 all declared artifacts gone; clean scope A1 + B4a-e executed; bugs G1-G5 in `.claude/audits/BUGS-FOUND.md`. User decisions queued below (D1-D6), each with evidence in the report: - [ ] D1 doctrine: CLAUDE.global.md:52-54 "Session start 1. Read `.claude/memory/`" + skills/capitalize/SKILL.md:375, while the 4c digest delivers open BLK + TODO + last journal at start (4a meant to fix the "load every session" premise) - - [ ] D2 visible: banner "OFF : plugin-dev" (plugin dropped 2026-07-02): lib/detect-plugins.sh:43-47, hooks/session-start.sh:106,111,180,210, agents/plugin-advisor.md:59,181,199,242,250-255 - - [ ] D3 visible (= docs backlog P34): packs vocabulary in agents/plugin-advisor.md (:99 PROFILE template in the old `profile.sh current` format, :126-129 rollback, gstack ON/OFF rules, context7 ON) and USAGE.md:181,232,233,1090,1092,1095 + - [x] D2 visible (done 80f56ef, feature/banner-drop-plugin-dev): banner "OFF : plugin-dev" (plugin dropped 2026-07-02): lib/detect-plugins.sh:43-47, hooks/session-start.sh:106,111,180,210, agents/plugin-advisor.md:59,181,199,242,250-255 + - [x] D3 visible (done 9b12b12, BDR-142; follow-ups in BUGS-FOUND) (= docs backlog P34): packs vocabulary in agents/plugin-advisor.md (:99 PROFILE template in the old `profile.sh current` format, :126-129 rollback, gstack ON/OFF rules, context7 ON) and USAGE.md:181,232,233,1090,1092,1095 - [ ] D4 skill behavior: skills/prune-memory STEP 1.A/3 detection (per-entry frontmatter, raw `status:` lines) → read statuses via `memory.sh index` (v1 + v2); keep example IDs 9xx (RED-7) - [ ] D5 user rules: rules/web-security.md vs rules/secure-by-default.md: strict duplicates (web-security :11, :19, "Login rate limiting," in :20) and password wording conflict ("bcrypt/argon2" vs "argon2id (bcrypt or scrypt otherwise)"); cookie flags, upload type/size, forced HTTPS, security headers are unique to web-security - [x] G1+G4 fixed (bugfix/banner-effective-profile, merged a655b06); G3 fixed (merged 9f9821e); G2 hand figures removed (bugfix/passive-cost-source, plan `.claude/tasks/plans/2026-11-10-passive-cost-source-1330.md` r3); G5 fixed (bugfix/handover-memory-status, 93a8e19, plan `.claude/tasks/plans/2026-11-10-handover-memory-status-1600.md` r3); follow-ups G6-G9 + 2 LOW quoting in BUGS-FOUND - [ ] feature (G2 split, user 2026-11-10): measured passive-cost API, one source for doctor / /status / plugin-advisor (probe COSTS field). Spec input = the two challenge rounds in the G2 plan: unit = pack or ON plugin (skills + agents + commands descriptions; pr-review-toolkit ~1550t, example-skills ~2350t), doctor counts OFF packs (higgsfield, extras), `detect_plugin_dev` globs the wrong cache level and ignores enabled state, `?` for not-installed or empty units, rc-0 sentinels (`costs-unavailable`/`unknown`) for doctor's `set -euo pipefail`, profile.sh failure → unknown, `python3 -I` (probe runs in the user's project), installPath from installed_plugins.json. Doctor keeps its measured ui-ux 670 until then. - - [ ] D3 add-ons from G2 (plugin-advisor.md): plan-budget WARN :317 (unreachable: plugin-gate never sends PLAN, detect_plan gone), :42 "absolute COST ESTIMATE still reported", :105 `(budget: ~t | n/a)`, :222 "passive cost estimate = highest-cost package profile", "0t passive" claims for impeccable / design-motion-principles (:226 :227 :268 :269); USAGE.md :248 "Budget Pro (~11k tokens/5h)", :494 `(~400t)`, :923 `(~200t)`; session-banner.test.sh SB10 `gone()` passes on a missing file (add an existence check) + - [x] D3 add-ons (done 9b12b12) from G2 (plugin-advisor.md): plan-budget WARN :317 (unreachable: plugin-gate never sends PLAN, detect_plan gone), :42 "absolute COST ESTIMATE still reported", :105 `(budget: ~t | n/a)`, :222 "passive cost estimate = highest-cost package profile", "0t passive" claims for impeccable / design-motion-principles (:226 :227 :268 :269); USAGE.md :248 "Budget Pro (~11k tokens/5h)", :494 `(~400t)`, :923 `(~200t)`; session-banner.test.sh SB10 `gone()` passes on a missing file (add an existence check) - [ ] D6 project rule: .claude/rules/graphify-vendored.md says `graphify install --platform claude` "touches nothing else", but graphifyy 0.9.67 appends a `# graphify` block to ~/.claude/CLAUDE.md (= CLAUDE.global.md); `graphify claude install` writes into the caller's cwd, so the install-plugins.sh trap protects $REPO only when run from $REPO - [ ] parked (code-clean 2026-11-09): hooks/rtk-rewrite.sh:84 no-op `[ "$CMD" = "$REWRITTEN" ] && REWRITTEN="$CMD"`: remove with the next real rtk-hook edit, re-pin `hooks/.rtk-hook.sha256` + rtk-rewrite.test.sh T13 in the same step - [ ] deferred (BDR-123): remap inline-writing best-tier skills (design Build stack, writing-skills, deprecation-and-migration, /tour single-project, /audit-delta 3d, /harden STEP 3); stale citers skills/feat/SKILL.md:6, skills/code-clean/SKILL.md:36; + impeccable row in routing.json (design Build stack has none; frontend-design has `reflect`; census test pins the table) diff --git a/.claude/tasks/contracts/2026-11-11-advisor-packs-vocabulary-1130.md b/.claude/tasks/contracts/2026-11-11-advisor-packs-vocabulary-1130.md new file mode 100644 index 0000000..e5b6ccd --- /dev/null +++ b/.claude/tasks/contracts/2026-11-11-advisor-packs-vocabulary-1130.md @@ -0,0 +1,39 @@ +# CONTRACT — advisor-packs-vocabulary +- date: 2026-11-11 | flow: feat | branch: feature/banner-drop-plugin-dev (RUN B, commits in place after RUN A) +- status: active + +## REQUEST (verbatim — IMMUTABLE) +D2 + D3 from .claude/tasks/TODO.md § Release 3.0.0 scope (user decisions 2026-11-11, [gated]). D2: plugin-dev was dropped 2026-07-02 but the banner prints "OFF : plugin-dev": remove plugin-dev everywhere (lib/detect-plugins.sh `detect_plugin_dev` :43-47, hooks/session-start.sh :106,111,180,210, agents/plugin-advisor.md :59,181,199,242,250-255); the ⚫ OFF row disappears when empty. D3: rewrite agents/plugin-advisor.md and USAGE.md to the packs vocabulary (report .claude/tasks/plans/2026-11-09-bdr125-obsolescence-clean-1650.md D3: :99 PROFILE template in the old `profile.sh current` format, :126-129 toggle+rollback (plugin-gate says atomic), gstack ON/OFF rules :81-85,139-149,209,216,226,259, "context7 ON" :144,233; USAGE.md :181,232,233,1090,1092,1095), no budget/token claims, plus the G2 add-ons (TODO "D3 add-ons from G2": plan-budget WARN :317, :42, :105, :222, "0t passive" claims :226 :227 :268 :269; USAGE.md :248, :494, :923; lib/tests/session-banner.test.sh SB10 `gone()` must fail on a missing file). Line numbers predate the G1-G5 merges: re-locate. Regression tests in lib/tests/session-banner.test.sh. make test needs GATES_TIMEOUT=600 + PATH=$HOME/.bun/bin:$PATH (LRN-271). Foreign-code style. In force: BDR-134 (profiles single source), BDR-100 (patch every citer), BDR-125, LRN-274, LRN-275. + +## CLARIFICATIONS +Q: one run or two? / A: two sequential /feat runs; RUN A (banner side) committed on this branch; THIS contract = RUN B (agents/plugin-advisor.md incl. its plugin-dev lines, lib/plugin-gate.md, USAGE.md, lib/tests/session-banner.test.sh) (orchestrator) +Q: plan? / A: .claude/tasks/plans/2026-11-11-advisor-packs-vocabulary-1000.md r3 § RUN B is binding (orchestrator, after two challenge rounds) +Q: profile mapping? / A: Backend API → dev (+ctx7 if fast libs); Frontend SPA/SSR → design; public website → web; Full-stack SaaS → full; CLI / library → dev; quick fix → minimal; design system → design; multi-session / enterprise → current profile or dev + gsd CLI (user, 2026-11-11) [gated] +Q: when may the advisor propose `profile.sh set`? / A: only when the project has no profile yet; otherwise per-pack enable/disable deltas; any set line lists what it turns off (user, 2026-11-11) [gated] +Q: USAGE scope? / A: every non-COST line of the plan's step 6 list rewritten; the 6 transcript `COST: ~Nt` lines and the Pattern-header estimates untouched (user, 2026-11-11) [gated] +Q: CHECK 3 matched `120000 tokens` (USAGE:202, literal /route show sample) via `0 token`? / A: oracle defect, pattern anchored `(^|[^0-9])0 token` as in SB10 (orchestrator, 2026-11-11, after GATE 0 run 1) +Q: GATE 1 ECARTS(2) + GATE 2 PASS with MEDIUM/LOW findings: fold all into one fresh-executor round? / A: yes; gap list `.claude/tasks/plans/2026-11-11-advisor-packs-vocabulary-round2-gaps.md`; FILE SCOPE adds skills/onboard/SKILL.md (ctx7 setup citer, BDR-100) (orchestrator, 2026-11-11) +Q: hotfix / quick-fix request on a project without profile: SET minimal (mapping) or no change? / A: no profile change; a hotfix request only points to /hotfix or /bugfix; minimal stays reachable from project-level signals only (user, 2026-11-11) [gated] +Q: GATE 1 round 2 ECARTS(2) + GATE 2 round 2 LOWs? / A: one fresh-executor round 3, gap list `.claude/tasks/plans/2026-11-11-advisor-packs-vocabulary-round3-gaps.md` (orchestrator, 2026-11-11) +Q: GATE 1 round 3 CONFORME, GATE 2 BLOCK(1) (onboard `make plugin` in a foreign cwd) + MEDIUM (max via SET) + verifier notes? / A: one fresh-executor security round, gap list `.claude/tasks/plans/2026-11-11-advisor-packs-vocabulary-security1-gaps.md`; FILE SCOPE adds skills/plugin-check/SKILL.md:14-17 (BDR-100 citer; RUN B now 6 files, over the /feat cap of 5 by two one-line citers, accepted) (orchestrator, 2026-11-11) + +## ACCEPTANCE CRITERIA +1. Advisor in packs vocabulary: no plugin-dev, PLAN, plan budget, "0t passive", rollback, "gstack ON/OFF", `[plugin]` slot, `ctx7 setup`, "passive tokens"; DECISION TABLE and Recommended sets table gone; full ids for managed plugins; `↻ SET` slot gated on source=default. + CHECK: cd /home/bchanot/Documents/claude && ! grep -qE 'plugin-dev|PLAN:|plan budget|0t passive|rollback|gstack ON|gstack OFF|\[plugin\]|ctx7 setup|passive tokens|## DECISION TABLE|Recommended sets' agents/plugin-advisor.md && grep -q 'ui-ux-pro-max@ui-ux-pro-max-skill' agents/plugin-advisor.md && grep -q 'pr-review-toolkit@claude-code-plugins' agents/plugin-advisor.md && grep -q '↻ SET' agents/plugin-advisor.md && grep -q 'source=default' agents/plugin-advisor.md && echo ADVISOR-OK + EXPECT: ADVISOR-OK + EVIDENCE: MET exit=0 marker-found :: ADVISOR-OK +2. Gate: the main loop prints `profile.sh diff` for a SET, applies only at the git root, SET first, disable form present, no ctx7 pre-fetch, no bare ui-ux-pro-max enable. + CHECK: cd /home/bchanot/Documents/claude && grep -q 'diff' lib/plugin-gate.md && grep -q 'rev-parse --show-toplevel' lib/plugin-gate.md && grep -q 'disable' lib/plugin-gate.md && grep -q 'unset' lib/plugin-gate.md && ! grep -qE 'Pre-fetch ctx7|Enable ui-ux-pro-max \(' lib/plugin-gate.md && echo GATE-OK + EXPECT: GATE-OK + EVIDENCE: MET exit=0 marker-found :: GATE-OK +3. USAGE: no old-vocabulary or zero-token claim outside the kept COST lines. + CHECK: cd /home/bchanot/Documents/claude && ! grep -E '0 t passif|(^|[^0-9])0 token|gstack ON|gstack OFF|context7 ON|tout OFF|\(~[1-9][0-9]*t\)|DISABLE: .*context7' USAGE.md | grep -qv 'COST' && echo USAGE-OK + EXPECT: USAGE-OK + EVIDENCE: MET exit=0 marker-found :: USAGE-OK +4. Regression locks + full suite green. + CHECK: cd /home/bchanot/Documents/claude && grep -q 'lib/plugin-gate.md' lib/tests/session-banner.test.sh && grep -q 'USAGE.md' lib/tests/session-banner.test.sh && GATES_TIMEOUT=600 PATH="$HOME/.bun/bin:$PATH" make test 2>&1 | tail -1 | grep -q 'all suites green' && shellcheck -S warning lib/tests/session-banner.test.sh && echo GREEN + EXPECT: GREEN + EVIDENCE: MET exit=0 marker-found :: GREEN + +## FILE SCOPE +agents/plugin-advisor.md, lib/plugin-gate.md, USAGE.md, lib/tests/session-banner.test.sh, skills/onboard/SKILL.md (:254-257 ctx7 install lines only), skills/plugin-check/SKILL.md (:14-17 only) diff --git a/.claude/tasks/contracts/2026-11-11-banner-drop-plugin-dev-1100.md b/.claude/tasks/contracts/2026-11-11-banner-drop-plugin-dev-1100.md new file mode 100644 index 0000000..6311759 --- /dev/null +++ b/.claude/tasks/contracts/2026-11-11-banner-drop-plugin-dev-1100.md @@ -0,0 +1,28 @@ +# CONTRACT — banner-drop-plugin-dev +- date: 2026-11-11 | flow: feat | branch: feature/banner-drop-plugin-dev +- status: active + +## REQUEST (verbatim — IMMUTABLE) +D2 + D3 from .claude/tasks/TODO.md § Release 3.0.0 scope (user decisions 2026-11-11, [gated]). D2: plugin-dev was dropped 2026-07-02 but the banner prints "OFF : plugin-dev": remove plugin-dev everywhere (lib/detect-plugins.sh `detect_plugin_dev` :43-47, hooks/session-start.sh :106,111,180,210, agents/plugin-advisor.md :59,181,199,242,250-255); the ⚫ OFF row disappears when empty. D3: rewrite agents/plugin-advisor.md and USAGE.md to the packs vocabulary (report .claude/tasks/plans/2026-11-09-bdr125-obsolescence-clean-1650.md D3: :99 PROFILE template in the old `profile.sh current` format, :126-129 toggle+rollback (plugin-gate says atomic), gstack ON/OFF rules :81-85,139-149,209,216,226,259, "context7 ON" :144,233; USAGE.md :181,232,233,1090,1092,1095), no budget/token claims, plus the G2 add-ons (TODO "D3 add-ons from G2": plan-budget WARN :317, :42, :105, :222, "0t passive" claims :226 :227 :268 :269; USAGE.md :248, :494, :923; lib/tests/session-banner.test.sh SB10 `gone()` must fail on a missing file). Line numbers predate the G1-G5 merges: re-locate. Regression tests in lib/tests/session-banner.test.sh. make test needs GATES_TIMEOUT=600 + PATH=$HOME/.bun/bin:$PATH (LRN-271). Foreign-code style. In force: BDR-134 (profiles single source), BDR-100 (patch every citer), BDR-125, LRN-274, LRN-275. + +## CLARIFICATIONS +Q: one run or two? / A: two sequential /feat runs (advisor side needs lib/plugin-gate.md: 6 files > /feat cap). THIS contract = RUN A (D2 banner side: lib/detect-plugins.sh, hooks/session-start.sh, lib/tests/session-banner.test.sh); the plugin-dev lines of agents/plugin-advisor.md go to RUN B with D3 (orchestrator) +Q: plan? / A: .claude/tasks/plans/2026-11-11-advisor-packs-vocabulary-1000.md r3 § RUN A is the binding plan (orchestrator, after two challenge rounds) +Q: OFF row when every toggle is on? / A: no line at all (user, 2026-11-11) [gated] + +## ACCEPTANCE CRITERIA +1. plugin-dev gone from the banner side and the OFF row absent when every toggle is on, with a positive control; `gone()` fails on a missing file; suite green. + CHECK: cd /home/bchanot/Documents/claude && GATES_TIMEOUT=600 PATH="$HOME/.bun/bin:$PATH" make test suite=lib/tests/session-banner.test.sh 2>&1 | tail -1 | grep -q 'all suites green' && grep -q 'SB11' lib/tests/session-banner.test.sh && ! grep -qi 'plugin.dev' lib/detect-plugins.sh hooks/session-start.sh && grep -q 'ctx7' lib/tests/session-banner.test.sh && echo BANNER-OK + EXPECT: BANNER-OK + EVIDENCE: MET exit=0 marker-found :: BANNER-OK +2. The dead >4 split branches of the toggle rows are gone; the 40-char budget is named in a comment. + CHECK: cd /home/bchanot/Documents/claude && ! grep -q '_inactive_count\|_active_count\|INACTIVE_STR\|ACTIVE_STR=' hooks/session-start.sh && grep -q '40' hooks/session-start.sh && echo COLLAPSED + EXPECT: COLLAPSED + EVIDENCE: MET exit=0 marker-found :: COLLAPSED +3. Build/tests green (full suite); shellcheck at warning level clean on the touched shell files. + CHECK: cd /home/bchanot/Documents/claude && shellcheck -S warning lib/detect-plugins.sh hooks/session-start.sh lib/tests/session-banner.test.sh && GATES_TIMEOUT=600 PATH="$HOME/.bun/bin:$PATH" make test 2>&1 | tail -1 | grep -q 'all suites green' && echo GREEN + EXPECT: GREEN + EVIDENCE: MET exit=0 marker-found :: GREEN + +## FILE SCOPE +lib/detect-plugins.sh, hooks/session-start.sh, lib/tests/session-banner.test.sh diff --git a/.claude/tasks/plans/2026-11-11-advisor-packs-vocabulary-1000.md b/.claude/tasks/plans/2026-11-11-advisor-packs-vocabulary-1000.md new file mode 100644 index 0000000..8ad7f16 --- /dev/null +++ b/.claude/tasks/plans/2026-11-11-advisor-packs-vocabulary-1000.md @@ -0,0 +1,67 @@ +# FEAT — advisor-packs-vocabulary (D2+D3, 2026-11-11) — r3 after two challenge rounds (final) + +Source: .claude/tasks/TODO.md § Release 3.0.0 scope (user decisions 2026-11-11 [gated]); evidence .claude/tasks/plans/2026-11-09-bdr125-obsolescence-clean-1650.md D2/D3; TODO "D3 add-ons from G2". +Two /feat runs, sequential: RUN A = D2 banner side (3 files), RUN B = D3 advisor side + the plugin-dev advisor lines (4 files; lib/plugin-gate.md makes 6 files for one run, over the /feat cap). + +## Context +- plugin-dev dropped 2026-07-02 (install-plugins.sh:527-529 history comment stays). Live citers: `detect_plugin_dev` (lib/detect-plugins.sh:67-71), banner toggle loop (hooks/session-start.sh:106,111), `_toggle_owned` (:173), plugin-advisor (:63, :185, :203, :246, :254-260). Banner prints `⚫ OFF : plugin-dev`. +- Packs (BDR-134): every switch is `lib/profile.sh` (`set `, `unset`, `enable|disable `, `diff ` prints `id: on → off` lines). `set` merges the WHOLE fragment (every managed key) into `/.claude/settings.local.json`; root = git root (find_root walks up to .claude/, CLAUDE.md or .git below $HOME; no root → rc 2). gstack = packs gstack-dev / gstack-browser / gstack-design; impeccable + design-motion-principles = pack design; managed plugins (full id only, the bare name resolves to a non-existent pack, rc 2): `ui-ux-pro-max@ui-ux-pro-max-skill` (on in design, web, full, max), `pr-review-toolkit@claude-code-plugins` (on in audit, max); context7 = `ctx7` CLI (find-docs skill always loads), gsd = external CLI; `dev` = gstack-dev on. +- `source=default` + `profile=full` = no project profile and the manifest defaults; `source=default` with another profile name = pack keys from shared/user scope (custom). +- Under `source=flag` every profile.sh write affects other sessions only (lib/profile.sh:196-199). +- The advisor has no Bash (tools: Read, Glob, Grep): it can never run `profile.sh diff`; the gate (main loop) can. + +## User decisions [gated] +- D2: remove plugin-dev everywhere; ⚫ OFF row disappears when empty. +- D3: advisor + USAGE in packs vocabulary, no budget/token claims. +- Profile mapping approved: Backend API → dev (+ctx7 if fast libs); Frontend SPA/SSR → design; public website → web; Full-stack SaaS → full; CLI / library → dev; quick fix → minimal; design system → design; multi-session / enterprise → current profile or dev + gsd CLI. +- Profile switch policy: `set ` ONLY when the project has no profile yet; otherwise per-pack `enable` / `disable` deltas. Any `set` line lists what it turns off. +- USAGE scope: the 6 transcript `COST: ~Nt` lines (:363 :497 :551 :649 :711 :1018) and the Pattern-header session estimates stay; every other non-COST line in the sweep list below is rewritten (user 2026-11-11, round 2). + +## RUN A — D2 banner side (/feat, 3 files) +1. `lib/detect-plugins.sh`: delete `detect_plugin_dev` (:67-71). +2. `hooks/session-start.sh`: + - toggle loop `for plugin in gstack uiux_pro_max context7 graphifyy`, with a comment that the four display names (38 chars) must fit the 40-char field (a fifth toggle needs a split again); delete the `plugin_dev)` case line; `_toggle_owned` drops `plugin-dev`. + - collapse the toggle rows (:202-232) to `printf "│ 🟢 ON : %-40s│\n" "${TOGGLE_ACTIVE[*]:-none}"` and `if [ ${#TOGGLE_INACTIVE[@]} -gt 0 ]; then printf "│ ⚫ OFF : %-40s│\n" "${TOGGLE_INACTIVE[*]}"; fi`; delete ACTIVE_STR / INACTIVE_STR / `_active_count` / `_inactive_count` and their unsets; drop the stale "split across 2 lines if >4" comment; reword the ✅ row comment (:183-185) so it no longer cites the toggle row's split policy (the ✅ row keeps its greedy split, unchanged). +3. `lib/tests/session-banner.test.sh`: + - printf `ctx7` and `graphify` stub executables into `$WORK/stub` next to rtk (already first on PATH). + - SB11 on SB3's existing `out` (h1 + pfull): 🟢 ON row has gstack, ui-ux-pro-max, context7, graphify (= 1 each, the positive control); `row '⚫ OFF'` is empty. + - `gone()` echoes 0 when `$ROOT/$1` is missing; SB10 adds `gone lib/detect-plugins.sh detect_plugin_dev` = 1 and `gone hooks/session-start.sh 'plugin.dev'` = 1. + - SB1-toggle-off-uiux (existing) keeps proving the OFF row prints when non-empty. + +## RUN B — D3 advisor side (/feat, 4 files) +4. `agents/plugin-advisor.md` (voice kept). File-wide rule: every recommendation names a pack, a profile, a managed plugin by full id, or a CLI (ctx7, gsd); "gstack ON/OFF" never appears (gstack = the three packs). + a. INPUT: delete the PLAN paragraph (:40-43). + b. PHASE 2: delete the `skill-creation` row (:63). + c. PHASE 2.5 tiers (:85-91) in profiles: simple → `minimal` (or `dev` for code work), moderate → current profile + ctx7 if fast-libs, complex → + pack gstack-browser if browser-QA, gsd if multi-session; graphify 200-file rule unchanged (BDR-097). Never "no gstack" next to a profile that enables gstack-dev. + d. PHASE 3 template: `ACTIVE:` unchanged; `PROFILE: (source=)`; `↻ SET : — [reason]` ONLY when source=default AND profile=full AND the target differs from full (target = full → `✅ KEEP`, no SET); the SET line names the profile only (the gate prints what it 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); `✅ KEEP : [pack or plugin] — [reason]`; `⚡ ENABLE : [pack or plugin] — [reason] — bash $HOME/.claude/lib/profile.sh enable `; `⚠️ DISABLE : [pack or plugin] — [reason] — bash $HOME/.claude/lib/profile.sh disable `, emitted only from project-level probe signals (manifests, deps, file counts), never from REQUEST-only signals (simple, hotfix, "this task"); `ℹ️ OPTIONAL: [pack or plugin] — [marginal benefit]`; under source=flag: no profile.sh command at all, only `relaunch: cc ` when a needed pack is off; delete the `PLAN:` line (:106). + e. Apply note (:130-134): "Apply and confirmation are the DISPATCHER'S job" (the word "rollback" goes); atomic profile.sh writes; "emits the EXACT profile.sh commands". + f. DECISION TABLE (:138-153) deleted: the Conditional RULES become the only signal → recommendation source (every table row has its RULE twin; the backend row :152 lives in the WRITING table). The RULES in packs vocabulary: mobile → packs gstack-browser + gstack-design off; deploy + browser-qa → packs gstack-dev + gstack-browser; browser-qa alone → pack gstack-browser; frontend / design-system → one line "pack design ON" (impeccable + design-motion-principles) + `ui-ux-pro-max@ui-ux-pro-max-skill` per the existing condition; the design-system WARN fires when pack design and ui-ux-pro-max are both off; fast-libs → "ctx7 CLI installed (find-docs skill always loads)", never ENABLE/DISABLE; gsd lines (:155, :234, :240) → "external CLI, nothing loads in Claude Code"; drop every "0t passive", "Saves passive tokens", "passive tokens saved". Keep the "Skill routing by task size" subsection (:157-171) as is. + g. Recommended sets table (:191-207) deleted. WRITING A PROFILE table (:283-294): fold the approved labels into the existing rows' Signal cells (backend / API / CLI / library → dev, + ctx7 if fast libs; frontend SPA/SSR, heavy UI, design system → design; public website → web; quick fix / narrow session → minimal); add rows only for full-stack SaaS → full and multi-session / enterprise → current profile or dev + gsd CLI. The id list (:296-297) adds `ui-ux-pro-max@ui-ux-pro-max-skill` and `pr-review-toolkit@claude-code-plugins` (full ids). The section states the switch policy (set only at source=default + profile=full; else deltas; under flag only relaunch). + h. Monorepo RULE (:217-222): one profile for the whole repo (profile.sh writes at the git root) = the union of the packages' needs, plus enable deltas; delete the per-package recommendation lines and "passive cost estimate" (:222). + i. Embedded RULE: "all packs off (profile `minimal`)"; simple/hotfix RULE: "profile `minimal` when source=default, else nothing (no task-scoped DISABLE)"; delete the two plugin-dev RULEs (:254-260) and the compat row `plugin-dev ↔ superpowers` (:185); compat gstack rows say "gstack packs". + j. BLOCK: delete "Full-product + gstack not installed" (:311). WARN: delete the plan-budget line (:317); "Active toggle plugins not needed for this task (dead passive cost)" → "Active packs no project signal needs"; context7 WARN fix (:320) → "`make plugin` (installs ctx7 and wires find-docs)", drop `ctx7 setup --claude`. +5. `lib/plugin-gate.md`: + - step 4 (present, main loop): for a `↻ SET ` line run `bash "$HOME/.claude/lib/profile.sh" -C diff ` and print its `→ off` lines under it as "turns off" (none → "turns off: nothing"). + - step 5 (apply): trigger = a `↻ SET`, `⚡ ENABLE` or `⚠️ DISABLE` line. Apply only when `git -C rev-parse --show-toplevel` equals PROJECT_ROOT; otherwise print the commands and apply nothing ("no git root yet: run them after git init"). Order: the SET first, then the deltas (after "customize" too). Command forms: `set `, `enable `, `disable `. The confirmation says the change is project-wide and persists in `/.claude/settings.local.json`. Undo printed after a write: after a SET `profile.sh unset`, after deltas the inverse enable/disable. PROPOSED CHANGES example: `↻ Set profile dev (backend detected) — turns off: `, `⚡ Enable pack design (frontend detected)`, `⚡ Enable ui-ux-pro-max@ui-ux-pro-max-skill`; no ctx7 pre-fetch line. Under source=flag nothing is applied (relaunch line only). +6. `USAGE.md` (French, voice kept). Rewrite to the packs vocabulary and the approved mapping, drop every "0 token / 0 t passif / 0t / sans coût passif / ~Nt" claim, on these lines only: :181, :229, :232, :233, :236, :237, :240 (GSD: "CLI externe, rien ne se charge dans Claude Code"), :326 ("cso si le pack gstack-dev est actif"), :417-418, :494-496, :547, :550, :647-648, :709-710, :715 (drop "3000t de"), :810, :923, :1021-1023, :1031, :1055, :1078, :1090, :1092, :1094, :1095, :1096. Untouched: the 6 COST lines, Pattern-header estimates (:250 :271 :298 :359 :366 :369 :383 :400), :248 (already points to make doctor), :978. Transcript advisor lines show what the new advisor can emit (packs, profiles, full ids; context7 only as "ctx7 installé" / WARN). +7. `lib/tests/session-banner.test.sh` SB10: `gone agents/plugin-advisor.md 'plugin-dev|PLAN:|plan budget|0t passive|rollback|gstack ON|gstack OFF|\[plugin\]|ctx7 setup|passive tokens'` = 1 (the old `'plan budget'` filter arg is dropped); `gone lib/plugin-gate.md 'Pre-fetch ctx7|Enable ui-ux-pro-max \('` = 1; `has` lib/plugin-gate.md `profile.sh" -C` + `diff` and `rev-parse --show-toplevel` = 1; `has` agents/plugin-advisor.md `ui-ux-pro-max@ui-ux-pro-max-skill` = 1; `gone USAGE.md '0 t passif|0 token|gstack ON|gstack OFF|context7 ON|~[1-9][0-9]*t\)'` = 1 with a filter that keeps the 6 COST lines (`'COST'`). + +## Edge cases +- Banner width: 40-char field, longest toggle row 38 (comment in the loop). +- A stale user-scope `plugin-dev@…: true` key would now show in the ✅ row: truthful, by design (none on this machine). +- doctor.sh / status-reporter do not call `detect_plugin_dev` (grep 2026-11-11). +- /init-project STEP 0 runs before `git init`: the gate shows the commands and applies nothing (step 5 git-root check); applying after STEP 5f is left to the user (skills/init-project not in scope). +- source=default with a non-full profile (shared or user scope pack keys): no SET, deltas only. +- source=flag: no write at all. +- CHANGELOG history lines naming plugin-dev stay. + +## Disposition +honors BDR-134 (profile.sh single switch, project-scoped, never user scope), BDR-100 + LRN-169 (every citer patched), BDR-125 (D2 deletes what the plugin-dev drop obsoleted), BDR-097 (graphify rule untouched), LRN-093 (SB11 positive control), LRN-274 (detect-plugins: deletion only), LRN-275, LRN-271. + +## Files +RUN A: lib/detect-plugins.sh, hooks/session-start.sh, lib/tests/session-banner.test.sh. +RUN B: agents/plugin-advisor.md, lib/plugin-gate.md, USAGE.md, lib/tests/session-banner.test.sh. + +## Challenge summary +- Round 1: correctness FATAL(3), robustness CONCERNS(3), simplicity CONCERNS(3) → r2 (run split, SET slot, full ids, monorepo union, banner collapse, tests). +- Round 2 (cap reached, no round 3): correctness CONCERNS(2), robustness CONCERNS(4), simplicity CONCERNS(3), no BLOCKER. Folded into r3: the turns-off list moves to the gate (advisor has no Bash), SET only at default+full and never equal to full, deltas against the target, SET first, git-root apply check, DISABLE from project signals only, undo lines, no writes under flag, DECISION TABLE deleted (RULES = one source), WRITING table folded not appended, pack design one line, pr-review-toolkit full id, USAGE sweep widened (user), SB11 on SB3's output. diff --git a/.claude/tasks/plans/2026-11-11-advisor-packs-vocabulary-round2-gaps.md b/.claude/tasks/plans/2026-11-11-advisor-packs-vocabulary-round2-gaps.md new file mode 100644 index 0000000..49ee6f3 --- /dev/null +++ b/.claude/tasks/plans/2026-11-11-advisor-packs-vocabulary-round2-gaps.md @@ -0,0 +1,27 @@ +# RUN B — round 2 gaps (GATE 1 ECARTS(2) + GATE 2 findings), 2026-11-11 + +Apply on top of the current working tree (RUN B edits are in place, uncommitted). Binding plan: .claude/tasks/plans/2026-11-11-advisor-packs-vocabulary-1000.md r3 (RUN B + User decisions [gated]). + +## Verifier gaps (must close) +G1. lib/plugin-gate.md step 5: the PROPOSED CHANGES consent prompt (before "Apply these changes? (yes / no / customize)") must say the change is project-wide and persists in `/.claude/settings.local.json`. Today it only appears after the write. +G2. USAGE.md :647 and :710 read "→ DISABLE: pack design, packs gstack (profil dev ou minimal)": `dev` turns pack gstack-dev ON, so the line contradicts itself, and "packs gstack" is a collective gstack OFF. Rewrite both to what the new advisor emits for that scenario (CLI / library, source=default + full): a `↻ SET : dev` line (gate shows what it turns off), no DISABLE of a pack dev enables, never "packs gstack" as a group. + +## Transcript accuracy (same class as G2, verifier notes) +G3. USAGE.md :418 and :496 show DISABLE lines from description-only /plugin-check runs before init (source=default + full): the new advisor emits a `↻ SET : ` there (mobile → the profile the RULES give; public website → `web`, which keeps gstack-dev and gstack-browser on), never a REQUEST-only DISABLE. :494 and :548 ENABLE pack design + ui-ux-pro-max that `full` already turns on: show them as KEEP (or covered by the SET target), not ENABLE. +G4. USAGE.md :1091 `"design élaboré" / tokens → ui-ux-pro-max ON`: same rewrite as its twin :231. +G5. USAGE.md :240 keeps the banned frame "n'est pas X : c'est Y": reword as a plain statement (e.g. "GSD v2 est un CLI externe, rien ne se charge dans Claude Code. …"). :704 heading "zéro token inutile": reword without a token claim. Em-dashes inside the rewritten structured transcript lines (:326 tree prefix, :494 template separator, :1055 STEP line) may stay (structured formats, not prose). + +## Rule tensions (advisor) +G6. agents/plugin-advisor.md simple/hotfix RULE (:214): a REQUEST-only "simple"/"hotfix" signal drives NO SET and NO DISABLE (both are project-wide, persistent); it recommends the lightweight skill only. `minimal` stays reachable from project-level signals (embedded RULE, WRITING table "narrow session" row). +G7. lib/plugin-gate.md step 4: when `profile.sh -C "" diff ` exits non-zero (no project root yet, e.g. /init-project STEP 0 before git init), print "turns off: unknown (no project root yet)" and continue; step 5 already applies nothing in that case. + +## Security findings (GATE 2 PASS, fixed here) +S1 (MEDIUM). lib/plugin-gate.md: the main loop builds every command from the fixed template only; before running ANY command (step-4 diff included) it checks the advisor's token: profile name against the profiles in `lib/profiles/` (`^[a-z0-9][a-z0-9-]*$` and an existing `lib/profiles/.json`), pack against the documented pack list (design, scroll3d, seo, web-validate, gstack-dev, gstack-browser, gstack-design, higgsfield, extras), plugin against the two managed full ids (`ui-ux-pro-max@ui-ux-pro-max-skill`, `pr-review-toolkit@claude-code-plugins`). A token that matches none is printed as rejected and skipped, never pasted into a shell. Tokens are quoted in the template. +S2 (LOW). lib/plugin-gate.md: quote the root everywhere in the templates: `-C ""`, `git -C "" rev-parse --show-toplevel`. +S3 (LOW). agents/plugin-advisor.md: the emitted command form names the token only, the gate builds the command: e.g. `⚡ ENABLE : pack design — — enable design` (or keep the full form but with `-C ""` and `"$HOME/.claude/lib/profile.sh"` quoted). Pick ONE form and make advisor template, WRITING section and gate agree; the gate never runs the advisor's line verbatim. + +## Out-of-scope citer (BDR-100) +C1. skills/onboard/SKILL.md:254 `npm install -g ctx7 && ctx7 setup --claude` → `make plugin` (installs ctx7 and wires find-docs), same as the advisor WARN; only that line. + +## Tests +T1. lib/tests/session-banner.test.sh SB10: lock `has` lib/plugin-gate.md 'rejected' (S1) and `gone` lib/plugin-gate.md "-C " (unquoted form, S2) = 1; `gone USAGE.md 'packs gstack \(|DISABLE: pack design, packs gstack'` = 1; `gone skills/onboard/SKILL.md 'ctx7 setup'` = 1. Keep every existing lock green. diff --git a/.claude/tasks/plans/2026-11-11-advisor-packs-vocabulary-round3-gaps.md b/.claude/tasks/plans/2026-11-11-advisor-packs-vocabulary-round3-gaps.md new file mode 100644 index 0000000..084bed7 --- /dev/null +++ b/.claude/tasks/plans/2026-11-11-advisor-packs-vocabulary-round3-gaps.md @@ -0,0 +1,28 @@ +# RUN B — round 3 gaps (GATE 1 round 2 ECARTS(2) + GATE 2 round 2 LOWs), 2026-11-11 + +Apply on top of the current working tree (RUN B rounds 1-2 in place, uncommitted). Binding: plan r3 (.claude/tasks/plans/2026-11-11-advisor-packs-vocabulary-1000.md), round-2 gaps (…-round2-gaps.md), contract CLARIFICATIONS. + +## User decision (2026-11-11) [gated] +A hotfix / quick-fix REQUEST never changes the profile: it only points to /hotfix or /bugfix. `minimal` stays reachable from project-level signals only (embedded RULE, "narrow session" row). This replaces the "quick fix → minimal" mapping row. + +## Verifier gaps (must close) +R1. agents/plugin-advisor.md WRITING table: rows whose profile is `full` (public website end-to-end ~:252, full-stack SaaS ~:255) emit `✅ KEEP` (no SET), per the PHASE 3 rule "target = full → ✅ KEEP, no SET". +R2. USAGE.md :648 and :711: the SET line names the profile only: `↻ SET : dev`. Drop the parenthetical turns-off list (it was wrong: `profile.sh diff dev` from full lists 7 ids). If the transcript shows the gate's line, it must be the real one: `turns off: pack-design, pack-scroll3d, pack-seo, pack-web-validate, pack-gstack-browser, pack-gstack-design, ui-ux-pro-max@ui-ux-pro-max-skill`. + +## Hotfix decision (apply) +R3. agents/plugin-advisor.md: the WRITING row "quick fix, narrow session → ↻ SET : minimal" (~:258) becomes "narrow session (project-level) → ↻ SET : minimal"; quick fix / hotfix appears only in the simple/hotfix RULE (no SET, no DISABLE, skill pointer). USAGE.md :237 and :1097 ("Hotfix → profil minimal") → "Hotfix / script rapide → aucun changement de profil (/hotfix ou /bugfix)". + +## Security LOWs + verifier notes (fix) +R4. lib/plugin-gate.md:46 profile check path anchored: `$HOME/.claude/lib/profiles/.json` (the gate runs from a consumer project's main loop). +R5. lib/plugin-gate.md closed pack list: `higgsfield` is NOT accepted from advisor tokens (paid service, explicit user ask only); say so next to the list. +R6. lib/plugin-gate.md:54-55: correct the premise: `diff` fails on a bad name, unknown profile or missing dir (not "no project root": find_root returns rc 0); on any non-zero exit print "turns off: unknown" and continue. +R7. lib/plugin-gate.md: keep `-C ""` and its argument on one line in every template (no line break right after `-C`), so the one-line lock catches an unquoted root. +R8. USAGE.md :551 Example 3: drop the OPTIONAL line that suggests packs `full` already turns on (target full = KEEP). +R9. agents/plugin-advisor.md:165-166: remove the double blank line. + +## Tests +T2. lib/tests/session-banner.test.sh SB10: `gone agents/plugin-advisor.md 'SET : full'` = 1; `gone USAGE.md 'le gate liste ce que le profil coupe'` = 1; `has` lib/plugin-gate.md `$HOME/.claude/lib/profiles/` = 1; `gone lib/plugin-gate.md -- '-C *$'` = 1 (no `-C` at line end). Keep every existing lock green. + +## Logged, not fixed (orchestrator → BUGS-FOUND) +- worktree: gate compares `--show-toplevel` but profile.sh writes at the parent of `--git-common-dir`; in a linked worktree the confirmed path and the written path differ (same repo). +- `""` double quotes still expand `$(…)`; value comes from the main loop. diff --git a/.claude/tasks/plans/2026-11-11-advisor-packs-vocabulary-security1-gaps.md b/.claude/tasks/plans/2026-11-11-advisor-packs-vocabulary-security1-gaps.md new file mode 100644 index 0000000..f316694 --- /dev/null +++ b/.claude/tasks/plans/2026-11-11-advisor-packs-vocabulary-security1-gaps.md @@ -0,0 +1,23 @@ +# RUN B — security round 1 (GATE 2 BLOCK(1) after GATE 1 CONFORME), 2026-11-11 + +Apply on top of the current working tree (RUN B rounds 1-3 in place, uncommitted). Binding: plan r3, round-2 and round-3 gap lists, contract CLARIFICATIONS. + +## BLOCKING (HIGH) — must close +B1. skills/onboard/SKILL.md:254 (consent prompt :257 "yes install now"): the install action must not depend on the working directory and must never run `make plugin` / install-plugins.sh (/onboard runs inside a foreign repo: a bare `make plugin` runs that repo's Makefile, or install-plugins.sh with its sudo / curl|sh paths). Replace with the one cwd-independent command `npm install -g ctx7` (what install-plugins.sh STEP 6 runs), and add on the next line, as text the user may run themselves: "version épinglée et find-docs : `make plugin` depuis le dépôt claude-config". The "yes install now" answer runs only `npm install -g ctx7`. +B1b. agents/plugin-advisor.md context7 WARN (~:281, ~:289 "Fix: `make plugin`"): same wording: fix = `npm install -g ctx7`; `make plugin` named only as "from the claude-config repo". + +## MEDIUM — close in the same round +M1. lib/plugin-gate.md token check: a SET profile token is accepted only from the advisor's own set {web, seo, dev, design, qa, audit, minimal} (no `full`: target full is KEEP; no `max`: it turns higgsfield, extras and pr-review-toolkit on; no user-added profile from an advisor token). A profile outside that set is printed as rejected. +M2. lib/plugin-gate.md step 4: for a SET print both the `→ off` lines ("turns off") and the `→ on` lines ("turns on") of `profile.sh diff`. + +## Citer left behind (verifier N1, BDR-100) +C2. skills/plugin-check/SKILL.md:14-17: "show the advisor's exact commands" → the main loop shows the commands it builds from the gate's step-5 templates (`set` / `enable` / `disable`, with `-C ""`), after the gate's token check; the user runs them. Only those lines. + +## Advisor consistency (verifier N2) +N2. agents/plugin-advisor.md PHASE 2.5 (~:79-84): tiers decide tool depth only (ctx7, gstack-browser for browser-QA, gsd, graphify rule); they name no profile. Profile choice lives only in the WRITING table, signals only in the RULES (as :145 states). Remove "profile `minimal` (or `dev`…)" and "current profile" from the tiers; drop examples that contradict the WRITING table (site vitrine / landing page → web). + +## Style (verifier N4) +S4. lib/tests/session-banner.test.sh:160 and :173 back under 80 chars (split the pattern string the way neighbouring checks do). USAGE.md:237 arrow aligned with its block; USAGE.md:419 the ui-ux-pro-max OPTIONAL on its own `→ OPTIONAL:` line. lib/plugin-gate.md:92 `` → ``. + +## Tests +T3. SB10: `gone skills/onboard/SKILL.md 'make plugin`? *\(installe'` = 1 (the old cwd-dependent install line gone); `has` lib/plugin-gate.md 'turns on' = 1; `gone lib/plugin-gate.md 'higgsfield,'`… keep existing; `has` lib/plugin-gate.md the accepted SET set line (e.g. 'web, seo, dev, design, qa, audit, minimal') = 1; `gone skills/plugin-check/SKILL.md "advisor's exact commands"` = 1. All lines ≤ 80 chars.