diff --git a/.claude/memory/decisions.md b/.claude/memory/decisions.md index c9c90e1..4c48cd8 100644 --- a/.claude/memory/decisions.md +++ b/.claude/memory/decisions.md @@ -1568,3 +1568,11 @@ Supersedes [[BDR-030]]. - **Why**: only this repo had `### Actionable`; every other project's digest showed no TODO, so D1 kept the Read; a cap drop with no Read = silent loss → marker. - **Alternatives rejected**: move open items under Actionable per repo (conflicts: faunosteo feature branch edits TODO.md +231/-10, game +8); keep the Read forever (always-on cost D1 wanted gone); onboarder.md stub edited (FILE SCOPE; fallback covers it). - **Reference**: feature/digest-todo-fallback 1124758 + 63bea87; contract .claude/tasks/contracts/2026-11-12-digest-todo-fallback-2130.md; 3 lenses CONCERNS (0 BLOCKER) → r2 → confirmation CONCERNS → r3; GATE 0 MET; verifier 5/6 MET + criterion 5 (make test) closed by orchestrator run; security PASS. Supersedes D1's "TODO.md stays read at start". See [[BDR-125]]. + +## BDR-148 — Design-toolchain hook retired: path rule + always-on pointer carry design routing; supersedes hook clauses of BDR-125 Am.7, BDR-130, BDR-098, BDR-021 [accepted] (2026-11-13) +- **Context**: block E (user 2026-11-12 "hook design : SUPPRIMER"). Measure 2026-10-31 (journal, TODO "Measure the design hook's re-Read cost"): 59 fires, 0 Reads of `rules/web-building.md`, fires on non-design prompts. feature/design-hook-removal 9c038fd. +- **Decision**: hook `hooks/design-toolchain-reminder.sh` + its test + its `UserPromptSubmit` entry deleted. Design routing carriers = `rules/web-building.md` path rule (component/style file edits) + one always-on CLAUDE.global.md line "Design / UI → Read web-building.md § Design work" (new-file turns the path rule misses). No replacement hook. +- **Why**: hook cost one Bash per prompt, zero measured effect; path rule + pointer line already cover the trigger set. Fewer per-turn hooks = BDR-125 "no per-turn nag". +- **Alternatives rejected**: narrow the hook's signals (still 0 Reads measured, nothing proves a narrower set reads); keep as log-only (user data log `~/.claude/logs/design-toolchain-fires.log` left in place, no new writes). +- **Heading pin**: only the "Design work" prefix stays pinned (CLAUDE.global.md citer, doctrine-citers census row `rules/web-building.md:Design work`, `_citers_resolve` prefix match). Full heading "Design work — full toolchain" has no citer left; T7c (real hook fixture) → T8i synthetic one-line fixture, quoted label kept whole. +- **Supersedes / amends**: BDR-125 Amendment 7 "hook one-liner" carrier clause; BDR-130 "hook one-liner says Read it" + "hook = pointer"; BDR-098 "design hook needs the section in context" + hook heading-match reference; BDR-021 Durability "design-toolchain-reminder.sh quotes it". Hand-off: open sessions log a non-blocking hook error per prompt until restarted. diff --git a/.claude/memory/journal.md b/.claude/memory/journal.md index 4308adb..afa56cc 100644 --- a/.claude/memory/journal.md +++ b/.claude/memory/journal.md @@ -734,3 +734,4 @@ rules: ## 2026-11-13 - 2026-11-13: /hotfix blk022-burial (block E4): lib/tests/guard-bash.test.sh (SKIP-only, 214 cases) + 2 census ALLOW rows deleted; BLK-022 superseded by BDR-125 phase 2 (static rules + routing guard); security PASS (LOW: no executable destructive-command suite left, accepted). +- /feat design-hook-removal (block E1): hooks/design-toolchain-reminder.sh + test + UserPromptSubmit entry deleted (9c038fd), T7c → T8i synthetic fixture, docs 19ec5b7 (CHANGELOG Removed wording = doc-syncer draft, user asked no mid-run questions). BDR-148. Gates 0 MET / 1 four oracles MET / 2 PASS, make test all green. Open sessions log one non-blocking hook error per prompt until restart. diff --git a/.claude/tasks/contracts/2026-11-13-design-hook-removal-0100.md b/.claude/tasks/contracts/2026-11-13-design-hook-removal-0100.md new file mode 100644 index 0000000..42c2118 --- /dev/null +++ b/.claude/tasks/contracts/2026-11-13-design-hook-removal-0100.md @@ -0,0 +1,34 @@ +# CONTRACT — design-hook-removal (E1) +- date: 2026-11-13 | flow: feat | branch: feature/design-hook-removal (off develop) +- status: active + +## REQUEST (verbatim — IMMUTABLE) +E1 design hook removal (user decision 2026-11-12, block E: "hook design : SUPPRIMER", web-building.md loads by path; measured 2026-10-31: 59 fires, 0 Reads of web-building.md; fires on non-design prompts). Delete hooks/design-toolchain-reminder.sh and lib/tests/design-toolchain-reminder.test.sh; remove its UserPromptSubmit entry from settings.json (hooks.UserPromptSubmit[0].hooks[0], "Checking design signals...", keep ctx7-reminder); rules/web-building.md:50 drop "the design-toolchain hook reinforces it"; lib/tests/doctrine-citers.test.sh T7c uses the hook file as its real fixture for "pointer label checked whole" → retarget onto a synthetic fixture file under $FIX carrying the same pointer line (keep the property tested). The always-on CLAUDE.global.md "Design / UI → Read web-building.md § Design work" line stays (covers new-file turns the path rule misses). ARCHITECTURE.md:23 hooks comment → doc sync. The user's log ~/.claude/logs/design-toolchain-fires.log is left in place (user data). + +## CLARIFICATIONS +- [gated 2026-11-12, user brief block E "hook design : SUPPRIMER"] deleted test authorized: lib/tests/design-toolchain-reminder.test.sh goes with the hook it tested (floor DELETED_TEST waived by the REQUEST, this line names it). +- [gated, challenge r2] T7c replaced by T8i on a one-line synthetic fixture (exact extracted row), not a count-2 copy. + +## ACCEPTANCE CRITERIA +1. Hook, its test and its registration gone; ctx7 reminder still registered; settings.json valid. + CHECK: echo $(ls hooks/design-toolchain-reminder.sh lib/tests/design-toolchain-reminder.test.sh 2>/dev/null | wc -l)$(jq -r '.hooks.UserPromptSubmit[].hooks[].command' settings.json | grep -c design-toolchain)$(jq -r '.hooks.UserPromptSubmit[].hooks[].command' settings.json | grep -c ctx7-reminder) + EXPECT: 001 + EVIDENCE: MET exit=0 marker-found :: 001 +2. web-building.md no longer names the hook. + CHECK: grep -c 'design-toolchain hook' rules/web-building.md; true + EXPECT: 0 + EVIDENCE: MET exit=0 marker-found :: 0 +3. (r2: as T8i on a one-line synthetic fixture, exact extracted row) doctrine-citers T7c still tests "label checked whole" on a synthetic fixture; census green. + CHECK: bash lib/tests/doctrine-citers.test.sh 2>&1 | tail -1 + EXPECT: FAIL=0 + EVIDENCE: MET exit=0 marker-found :: PASS=23 FAIL=0 +4. No live reference to the deleted files outside history (.claude/, CHANGELOG.md, ARCHITECTURE.md handled by doc sync). + CHECK: git grep -c 'design-toolchain-reminder' -- ':!.claude' ':!CHANGELOG.md' ':!ARCHITECTURE.md' | wc -l + EXPECT: 0 + EVIDENCE: MET exit=0 marker-found :: 0 +5. make test green with bun on PATH (manual, > 120 s). + (manual: run 2026-11-13 on the feater diff, `PATH=$HOME/.bun/bin:$PATH make test` → "SUITE: all GREEN / all suites green", rc=0) +6. After STEP 6 doc sync, ARCHITECTURE.md names no design-toolchain hook (manual check at commit). + +## FILE SCOPE +hooks/design-toolchain-reminder.sh (delete), lib/tests/design-toolchain-reminder.test.sh (delete), settings.json (one hooks entry), rules/web-building.md (:50), lib/tests/doctrine-citers.test.sh (T7c). ARCHITECTURE.md:23 → STEP 6 doc sync. diff --git a/.claude/tasks/contracts/2026-11-13-npm-global-deny-0030.md b/.claude/tasks/contracts/2026-11-13-npm-global-deny-0030.md new file mode 100644 index 0000000..cf9a953 --- /dev/null +++ b/.claude/tasks/contracts/2026-11-13-npm-global-deny-0030.md @@ -0,0 +1,26 @@ +# CONTRACT — npm-global-deny (hotfix) +- date: 2026-11-13 | flow: hotfix | branch: bugfix/npm-global-deny (off develop) +- status: active + +## REQUEST (verbatim — IMMUTABLE) +settings.json npm -g (user decision 2026-11-12, block E; was "user hand edit pending", user confirmed at start: edit on a branch, classifier test with `npm install -g --dry-run cowsay`): remove the four `permissions.deny` entries `Bash(npm install -g *)`, `Bash(npm i -g *)`, `Bash(npm install --global *)`, `Bash(npm i --global *)` (settings.json:143-146) so the autoMode soft_deny "Global npm installs" entry (settings.json:600) decides instead of a hard deny. The push-guard T42 non-weakening lock (lib/tests/push-guard.test.sh ~:331-336, `removed-ok` heredoc) must justify them: replace the two dead rows (`Bash(docker run * -v /:*)`, `Bash(git push * :*)`, absent from the 3.0.0 release so no longer needed) with the four npm rows under a `# soft_deny "Global npm installs" decides (user 2026-11-12)` comment; `removed_ok_until` stays 3.0.0. 2 files, no logic. + +## ACCEPTANCE CRITERIA +1. No npm -g deny entry left; settings.json valid JSON. + CHECK: jq -r '.permissions.deny[]' settings.json | grep -c '^Bash(npm' ; true + EXPECT: 0 + EVIDENCE: PENDING +2. push-guard suite green (T41/T42/T42e). + CHECK: make test suite=lib/tests/push-guard.test.sh 2>&1 | grep -E "T42 base:|FAIL=0" | tail -1 + EXPECT: FAIL=0 + EVIDENCE: PENDING +3. Live: `npm install -g --dry-run cowsay` no longer hits a static deny; the classifier decides (outcome recorded in the journal). + +## FILE SCOPE +settings.json, lib/tests/push-guard.test.sh. templates/settings/SETTINGS.md:115 ("are in permissions.deny") → STEP 5 doc sync. + +## CLARIFICATIONS +- [gated 2026-11-13, orchestrator: the "stays 3.0.0" pin was the orchestrator's own wording, not the user's; two lenses MAJOR] `removed_ok_until=3.1.0` (the release that ships this removal, BDR-145); TODO "after 3.0.0 … empty the removed-ok list" reworded to "first bump past 3.1.0". +- [gated] T42d retargeted: simulate removing the four npm entries (comment updated), so it models this edit instead of the six already-gone entries. +- [gated] Live test expected verdict, written BEFORE running: `npm install -g --dry-run cowsay` is no longer refused by a static deny; the classifier applies soft_deny "Global npm installs" (held until the package is named this turn with the vetting statement) — any classifier outcome other than a static-rule refusal proves the edit; a static refusal in this session → re-run in a fresh session before concluding (settings snapshot at session start). +- [gated] Live window: settings.json is symlinked into ~/.claude; the change is live machine-wide from the executor's write; rollback = checkout develop's settings.json. diff --git a/.claude/tasks/contracts/2026-11-13-skill-routing-descriptions-0120.md b/.claude/tasks/contracts/2026-11-13-skill-routing-descriptions-0120.md new file mode 100644 index 0000000..46c5745 --- /dev/null +++ b/.claude/tasks/contracts/2026-11-13-skill-routing-descriptions-0120.md @@ -0,0 +1,38 @@ +# CONTRACT — skill-routing-descriptions (E2) +- date: 2026-11-13 | flow: feat | branch: feature/skill-routing-descriptions (off develop) +- status: active + +## REQUEST (verbatim — IMMUTABLE) +E2 (user decision 2026-11-12, block E: "lignes « Skill routing » → `description:` des skills concernés"; phase 1 deferred item, phase 3 bullet: "the Skill routing table lines move into our own skills' `description:`, ≤3 lines for vendored aliases stay in CLAUDE.global.md"). CLAUDE.global.md § "Skill routing": every line whose target is one of OUR skills moves into (or is already carried by) that skill's `description:`; lines for vendored / gstack / pack-off cases stay. + +## CLARIFICATIONS +- [gated 2026-11-13 r3: plan § r3 is the final CLAUDE.global.md text; gstack ship retired per BDR-105; triggers "stack trace + fix" and "ship this feature"] +- [gated 2026-11-13 r2, supersedes the clarification below where they differ] kept always-on: a gstack line (investigate / ship only on explicit ask, bugs → bugfix, ship/PR → ship-feature, deploy → deploy) and the pack-aware SEO/GEO/W3C + cso line; dropped: file-count, tour, reconcile, capitalize/close lines; descriptions gain triggers only (bugfix "error", "500", "stack trace"; ship-feature "open a PR", "ship this feature"). +- [gated 2026-11-13, orchestrator per user brief] Dropped from CLAUDE.global.md (already in the target description): "feat / hotfix / bugfix distinguished by file count", "tour", "reconcile", "Before /clear or /compact → capitalize; ritual → close", "SEO+GEO → seo (GEO only → geo); W3C + WCAG → web-validate" (cso part stays: gstack). Moved: "Bug / error / 500 → bugfix … investigate only on explicit ask (gstack: cross-project learnings, /freeze, long open-ended investigation)" → skills/bugfix description; "Ship / PR → ship-feature (never gstack ship: base origin/HEAD = main skips develop); deploy → deploy (runbook, the user runs it)" → skills/ship-feature description (ship part) — deploy description already says "hands off for out-of-band execution". Kept: office-hours, document-release / doc fallback, Design / UI pointer, plan-eng-review, superpowers aliases block, cso, media generation, the gstack-OFF paragraph (reworded "use the fallback above" → "use the fallback the skill descriptions or the lines above name"). +- [gated] the 3-line "≤3 lines for vendored aliases" target is a phase 3 estimate, not a hard cap: superpowers aliases stay as one block (4 aliases). + +## ACCEPTANCE CRITERIA +1. Dropped lines gone from CLAUDE.global.md (r3 text is final); the two kept lines present; line count lower than develop's. + CHECK: cd /home/bchanot/Documents/claude && echo $(grep -c 'gstack investigate only on explicit ask\|W3C + WCAG → web-validate' CLAUDE.global.md)$( [ $(wc -l < CLAUDE.global.md) -lt $(git show develop:CLAUDE.global.md | wc -l) ] && echo LT) + EXPECT: 2LT + EVIDENCE: PENDING +1b. Dropped lines absent. + CHECK: cd /home/bchanot/Documents/claude && echo $(grep -c 'distinguished by file count\|Grouped all-axes sweep\|Open-work inventory\|Before /clear or /compact\|Bug / error / 500' CLAUDE.global.md) + EXPECT: 0 + EVIDENCE: PENDING +2. bugfix and ship-feature descriptions gain the r3 triggers. + CHECK: cd /home/bchanot/Documents/claude && echo $(grep -c '"stack trace + fix"' skills/bugfix/SKILL.md)$(grep -c '"ship this feature"' skills/ship-feature/SKILL.md) + EXPECT: 11 + EVIDENCE: PENDING +3. Census + skill frontmatter suites green. + CHECK: cd /home/bchanot/Documents/claude && bash lib/tests/doctrine-citers.test.sh 2>&1 | tail -1 + EXPECT: FAIL=0 + EVIDENCE: PENDING +4. make test green (manual, bun on PATH); skill-routing-census no new WARN/FAIL. +5. Both frontmatters parse as YAML. + CHECK: cd /home/bchanot/Documents/claude && python3 -I -c 'import yaml,sys; [yaml.safe_load(open(f).read().split("---")[1]) for f in sys.argv[1:]]; print("YAML-OK")' skills/bugfix/SKILL.md skills/ship-feature/SKILL.md + EXPECT: YAML-OK + EVIDENCE: PENDING + +## FILE SCOPE +CLAUDE.global.md (§ Skill routing), skills/bugfix/SKILL.md (frontmatter), skills/ship-feature/SKILL.md (frontmatter). README/USAGE routing mirrors → STEP 6 doc sync. diff --git a/.claude/tasks/plans/2026-11-13-design-hook-removal-0100.md b/.claude/tasks/plans/2026-11-13-design-hook-removal-0100.md new file mode 100644 index 0000000..8b453c4 --- /dev/null +++ b/.claude/tasks/plans/2026-11-13-design-hook-removal-0100.md @@ -0,0 +1,19 @@ +# PLAN — design-hook-removal (r1) +- `git rm hooks/design-toolchain-reminder.sh lib/tests/design-toolchain-reminder.test.sh`. +- settings.json: in `hooks.UserPromptSubmit[0].hooks`, delete the object whose command is `bash ~/.claude/hooks/design-toolchain-reminder.sh` (statusMessage "Checking design signals..."); the ctx7-reminder object stays as the array's only entry; JSON valid (`jq .`). Edit with a text edit of those 6 lines, not a jq rewrite (keeps file formatting). +- rules/web-building.md:49-50: "Single source for design routing; the design-toolchain hook reinforces it." → "Single source for design routing." (wrap kept ≤ 80). +- lib/tests/doctrine-citers.test.sh T7c: SUPERSEDED, see r2 T8i below (r1 asked for a count-2 fixture; a one-line fixture gives 1). +- Edge: `.githooks`/link.sh never listed the hook (checked); fast-libs test reads ctx7 only; doctor has no design hook check. +- Disposition: honors BDR-125 phase 1 (path rule = carrier; the always-on pointer line in CLAUDE.global.md stays for new-file turns), BDR-131 measure (0 Reads), cleanup rule (citers patched same branch). + +## r2 (correctness FATAL(1), robustness CONCERNS(1), simplicity CONCERNS(1)) — r2 wins over r1 +- T7c BLOCKER (all 3 lenses: r1's "count 2" came from TWO hook lines :6 and :78; a one-line fixture gives 1): delete T7c from the T7 "real citers" block; add in the synthetic T8 block a check `T8i-tilde-quoted-label-whole`: `printf '%s\n' ' ~/.claude/rules/web-building.md § "Design work — full toolchain"' > "$FIX/pointer.sh"` (double quotes and em dash byte-for-byte as the retired hook's line 78) then `check T8i-tilde-quoted-label-whole "$(_citers_extract_files "$FIX/pointer.sh" | cut -d: -f3-)" 'rules/web-building.md:Design work — full toolchain'` (exact row: proves the `~/.claude/` prefix is stripped AND the label kept whole). Comment: "the retired design hook's pointer shape: ~ prefix + quoted label" — never the hook's filename (AC4 greps lib/tests). +- Order: edit settings.json FIRST (remove the registration), THEN `git rm` the hook and its test (both paths are live through ~/.claude symlinks; the reverse order makes every open session's prompts exit 127 in between). +- New AC6 (after STEP 6 doc sync): `grep -c design-toolchain ARCHITECTURE.md` → 0. +- Disposition corrected: measurement = journal 2026-10-31 / TODO "Measure the design hook's re-Read cost" (59 fires, 0 Reads), not BDR-131. CAPITALIZE: one BDR via memory.sh superseding BDR-125 Amendment 7's "design hook one-liner" carrier clause and the hook-based heading-durability rationale in BDR-021 / BDR-098 (the always-on CLAUDE.global.md pointer + doctrine-citers census keep the heading pinned). +- Hand-off note: restart open sessions (a session still holding the old hook list logs a non-blocking hook error on each prompt until restarted). + +## r3 (confirmation SOLID, 5 MINOR folded; no further challenge) +- T8 block header comment (doctrine-citers.test.sh:143-144) → `T8a-T8i` and the list gains "quoted label kept whole". +- Heading pin corrected: only the "Design work" prefix stays pinned (CLAUDE.global.md:282 citer, census row `rules/web-building.md:Design work`; `_citers_resolve` accepts a prefix + space/—/(/:). The full heading "Design work — full toolchain" loses its last citer, which nothing needs once the hook is gone. +- CAPITALIZE: the superseding BDR also names BDR-130's hook clause ("hook one-liner says Read it", "hook = pointer") in its supersedes/amends line, beside BDR-125 Amendment 7, BDR-021, BDR-098. diff --git a/.claude/tasks/plans/2026-11-13-npm-global-deny-0030.md b/.claude/tasks/plans/2026-11-13-npm-global-deny-0030.md new file mode 100644 index 0000000..e78ff2d --- /dev/null +++ b/.claude/tasks/plans/2026-11-13-npm-global-deny-0030.md @@ -0,0 +1,8 @@ +# PLAN — npm-global-deny (hotfix fix) +Root cause: the four static deny lines override the classifier, so the soft_deny "Global npm installs" (vet then clear on a named package) never runs for the common spellings (TODO "user hand edit pending" since 2026-09-30, BDR-090: ask does not prompt under auto, soft_deny is the prompt tier). +Edit: +1. settings.json: delete lines 143-146 (the four `Bash(npm … -g|--global *)` deny entries); nothing else; soft_deny entry :600 unchanged (already names `npm install -g`, `npm i -g`, `npm add -g`, `--global`, flag after package). +2. lib/tests/push-guard.test.sh removed-ok heredoc (~:331-336): delete the two dead rows + their comments (`Bash(docker run * -v /:*)`, `Bash(git push * :*)`: absent from main = 3.0.0, so T42 no longer needs them), add + `# soft_deny "Global npm installs" decides (user 2026-11-12)` + the four npm entries verbatim. `removed_ok_until=3.0.0` unchanged (next bump empties the list, TODO line). +Smoke: `jq . settings.json >/dev/null`, `bash lib/tests/push-guard.test.sh` (tail shows the pass line), then live `npm install -g --dry-run cowsay` in the main loop after commit. +Risk accepted by the user: global installs rest on the classifier + soft_deny prose (vet, user names package this turn). diff --git a/.claude/tasks/plans/2026-11-13-skill-routing-descriptions-0120.md b/.claude/tasks/plans/2026-11-13-skill-routing-descriptions-0120.md new file mode 100644 index 0000000..de84191 --- /dev/null +++ b/.claude/tasks/plans/2026-11-13-skill-routing-descriptions-0120.md @@ -0,0 +1,37 @@ +# PLAN — skill-routing-descriptions (r1) +- CLAUDE.global.md:270-302: delete lines "- Bug / error / 500 → bugfix …" (3 lines), "- feat / hotfix / bugfix distinguished …", "- Ship / PR → ship-feature … runs it)" (3 lines), "- Grouped all-axes sweep … → tour", "- Open-work inventory … → reconcile", "- Before /clear or /compact → capitalize; end-of-session ritual → close"; rewrite "- SEO+GEO → seo … → web-validate;\n security audit (secrets, CVE, OWASP) → cso" to "- Security audit (secrets, CVE, OWASP) → cso"; last paragraph "use the fallback above, else say so" → "use the fallback their descriptions or the lines above name, else say so". Intro sentence stays. +- skills/bugfix/SKILL.md description (YAML block `|`): append two lines: ` Also: error / 500 / stack trace. gstack /investigate only on explicit` / ` ask (cross-project learnings, /freeze, long open-ended investigation).` (keep ≤ 80 cols, same indentation). +- skills/ship-feature/SKILL.md description (single-quoted YAML string): append inside the quotes ` Ship / PR → this skill, never gstack ship (its base origin/HEAD = main skips develop).` — single quotes inside must be doubled if any (none in the added text). +- Edge: the skill listing budget (SLASH_COMMAND_TOOL_CHAR_BUDGET) grows by ~200 chars: accepted (CLAUDE.global.md shrinks by ~10 lines, always-on). +- Tests: no suite pins these lines (doctrine-citers cites headings/labels; "Skill routing" heading kept); YAML parse check: `python3 -I -c 'import yaml,sys…'` not available → `claude plugin validate` not applicable; run `make test` (skills frontmatter census, model-routing census reads descriptions? check: lib/tests/effort-routing or routing census reads `description:` only for presence). +- Disposition: honors BDR-125 phase 1/3 (routing lines → descriptions, vendored aliases stay), BDR-130 (CLAUDE.global.md density), BDR-022 (no .claude content in public docs). + +## r2 (correctness CONCERNS(2), robustness CONCERNS(3), simplicity SOLID; no BLOCKER) — r2 wins over r1 +- KEPT always-on (robustness MAJOR 1+2): (a) one gstack line replacing the Bug and Ship lines: `- gstack investigate / ship only on explicit ask: bug, error, 500 → bugfix (contract, verifier and security gates, registries); ship / PR → ship-feature; deploy → deploy (runbook, the user runs it)` — counterweight to gstack's own "Bugs/errors → /investigate" routing injection; (b) the SEO/GEO/W3C line kept, pack-aware: `- SEO+GEO → seo (GEO only → geo); W3C + WCAG → web-validate (packs: off → \`profile.sh enable \` or say so); security audit (secrets, CVE, OWASP) → cso`. +- DROPPED (carried by always-listed descriptions of our core skills): "feat / hotfix / bugfix distinguished by file count", "Grouped all-axes sweep → tour", "Open-work inventory → reconcile", "Before /clear or /compact → capitalize; ritual → close". +- Descriptions (simplicity MINOR 1-2, correctness MINOR 3): bugfix `Trigger:` list gains `"error", "500", "stack trace"` (no new "Also:" line); ship-feature description gains PR triggers `"open a PR", "ship this feature"` at the end of its sentence list (no "never gstack ship" text: gstack ship is retired from every pack, lib/gstack-removed.list). No bare "ship" (deploy owns "ship to prod"). +- OFF paragraph: `gstack or other packs OFF (\`profile.sh current\`) → their skills are gone: use the fallback our skills' descriptions or the lines above name, else say so.` +- Oracles (correctness/robustness MAJOR): AC2 → `echo $(grep -c '"stack trace"' skills/bugfix/SKILL.md)$(grep -c '"open a PR"' skills/ship-feature/SKILL.md)` EXPECT `11`; new AC5 YAML: `python3 -I -c 'import yaml,sys; [yaml.safe_load(open(f).read().split("---")[1]) for f in sys.argv[1:]]; print("YAML-OK")' skills/bugfix/SKILL.md skills/ship-feature/SKILL.md` EXPECT `YAML-OK`; suite under watch: lib/tests/skill-routing-census.test.sh (no new WARN/FAIL). +- Accepted: no persistence pin for the description triggers (darwin rewrite risk, MINOR). + +## r3 (confirmation CONCERNS(1), no BLOCKER; folded, no further challenge) — FINAL TEXT, r1 body above is VOID for CLAUDE.global.md +Result in CLAUDE.global.md § Skill routing (replace lines 270-302 by exactly this list, intro sentence kept): +- Product idea, "worth building?" → office-hours +- gstack investigate only on explicit ask: bug, error, 500 → bugfix (contract, + verifier and security gates, registries). gstack ship is retired (BDR-105): + ship / PR → ship-feature; deploy → deploy (runbook, the user runs it) +- Docs post-ship → document-release (doc if gstack off); stale-doc audit → doc +- Design / UI (build, system, audit, polish) → Read + `~/.claude/rules/web-building.md` § "Design work" first +- Architecture review → plan-eng-review +- superpowers aliases block (unchanged, 6 lines) +- SEO+GEO → seo (GEO only → geo); W3C + WCAG → web-validate. Pack off → + propose `profile.sh enable seo` (seo, geo) or `enable web-validate`, the + user runs `/reload-plugins`; else say so. Security audit (secrets, CVE, + OWASP) → cso +- Media generation block (unchanged) +gstack or other packs OFF (`profile.sh current`) → their skills (investigate, +qa, review, health, retro, office-hours, seo, web-validate…) are gone: use the +fallback our skills' descriptions or the lines above name, else say so. +Descriptions: bugfix `Trigger:` list gains `"error", "500", "stack trace + fix"`; ship-feature gains the trigger `"ship this feature"` (no "open a PR": no skill opens a PR). +Oracles (contract): every CHECK prefixed `cd /home/bchanot/Documents/claude &&`; AC1 also asserts presence: `grep -c 'gstack investigate only on explicit ask\|W3C + WCAG → web-validate' CLAUDE.global.md` → 2; line count below develop's; AC2 → `"stack trace + fix"` + `"ship this feature"` → 11. diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index b597d3a..ca13591 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -20,7 +20,7 @@ claude-config/ ├── update-all.sh # One-command update for all components ├── Makefile # Unified entry point: make install / doctor / update / test (make help) ├── plugins.lock.json # Version pinning for non-marketplace dependencies and vendored skills -├── hooks/ # Claude Code hooks: session start, statusline, RTK rewrite, ctx7 + design-toolchain reminders, attention notify, unpushed-work guard, manual-mode push guard, system-dir extraction guard, instruction-load log, memory digest and memory feedback reminder at session start, code-limits line-width signal +├── hooks/ # Claude Code hooks: session start, statusline, RTK rewrite, ctx7 reminder, attention notify, unpushed-work guard, manual-mode push guard, system-dir extraction guard, instruction-load log, memory digest and memory feedback reminder at session start, code-limits line-width signal ├── githooks/ # Generated git hooks (pre-commit, post-commit, post-merge, reference-transaction), git's global core.hooksPath ├── .githooks/ # This repo's own copy of the same hooks ├── .claude/rules/ # This repo's project path rules (paths: frontmatter), loaded on Read of a matching file diff --git a/CHANGELOG.md b/CHANGELOG.md index 91ccc8b..9d4887b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,9 @@ Format follows [Keep a Changelog](https://keepachangelog.com/) and this project - **memory recall**: a prompt after 30 minutes idle now needs 8 content words, up from 5 (a context's first prompt or a design/analysis prompt still needs 5), and the haiku rerank keeps at most 2 entries, down from 3. Measured on the first feedback gate: idle precision 44 %, third pick 35 %. - **memory digest TODO lines**: with no `## Actionable` (or `### Actionable`) section, the digest now shows the TODO file's first 3 unchecked top-level items instead of none, and items inside HTML comments are ignored. When the 800-character cap drops TODO lines, a `- todo: +N not shown, read .claude/tasks/TODO.md` line counts them. `/init-project`, `/onboard` and `/capitalize` seed new TODO files with a `## Actionable` section. The session-start doctrine (`CLAUDE.global.md`) now trusts the digest and reads `.claude/tasks/TODO.md` only when no digest prints or the task needs it. +### Removed +- `hooks/design-toolchain-reminder.sh`, its `UserPromptSubmit` entry in `settings.json` (`ctx7-reminder` stays the only one) and its suite `lib/tests/design-toolchain-reminder.test.sh`. Measured 2026-10-31: 59 fires, 0 Reads of `rules/web-building.md`. Design routing stays with the `rules/web-building.md` path rule and the `CLAUDE.global.md` pointer. The fire log `~/.claude/logs/design-toolchain-fires.log` is left in place. + ## [3.0.0] — 2026-11-12 ### Added diff --git a/hooks/design-toolchain-reminder.sh b/hooks/design-toolchain-reminder.sh deleted file mode 100755 index 165b822..0000000 --- a/hooks/design-toolchain-reminder.sh +++ /dev/null @@ -1,82 +0,0 @@ -#!/usr/bin/env bash -# design-toolchain-reminder.sh -# -# UserPromptSubmit hook. When the prompt carries a UI/design signal, point the -# model at the design toolchain section (tiered by scope). Since BDR-125 -# phase 1 it lives in rules/web-building.md § "Design work — full toolchain", -# not in CLAUDE.global.md: it loads by itself on a UI file Read, and a -# chat-only design request needs this pointer. A UserPromptSubmit hook's -# stdout is appended to the model's context. -# -# This is a soft nudge: the tiered rule itself says trivial work uses NO -# toolchain, so a false positive (e.g. "API design") costs only a reminder the -# model can disregard. Always exits 0 so it never blocks prompt submission. -# -# Every fire appends one line (time, matched token, prompt excerpt) to -# ~/.claude/logs/design-toolchain-fires.log — a counter so the next "is it -# over-firing?" decision is measured, not anecdotal. - -set -euo pipefail - -input="$(cat)" - -# Extract the user's prompt from the hook JSON; fall back to the raw stdin if -# python or the expected field is unavailable. -prompt="$(printf '%s' "$input" \ - | python3 -c 'import sys, json; print(json.load(sys.stdin).get("prompt", ""))' \ - 2>/dev/null || true)" -[ -z "$prompt" ] && prompt="$input" - -# Harness-generated turns (task notifications, sub-agent hand-backs: 857 of -# 2,779 logged fires on 2026-10-28) are not user requests — never fire on -# them (the Design work trigger = a design/UI *request*). -case "$prompt" in - ''*|' \bdashboard\b -# so a filename like ecc_dashboard.py no longer matches while "admin dashboard" -# still does. animation kept (rarely non-UI). -# Tightened 2026-07-30 (3rd pass): dropped \bux\b — bare "ux" matched inside -# French prose ("changement ux vu…"; 2 logged FPs, both FR). \bui\b KEPT -# (zero logged FP, one logged true positive). NB: the log records only the -# FIRST match per fire (head -1), so per-token FP rates aren't derivable. -pattern='redesign|refonte|refont|ui/ux|ux/ui|\bui\b|ui kit|design system' -pattern+='|design-system|front-?end design|\bnavbar\b|\bsidebar\b|\bmodal\b' -pattern+='|\bbouton\b|\bbutton\b|formulaire|\bhero\b|\bheader\b|\bfooter\b' -pattern+='|dropdown|tooltip|\bbadge\b|\bchart\b|graphique|accordion|carousel' -pattern+='|\bslider\b|landing|\bdashboard\b|homepage|home page|\baccueil\b' -pattern+='|\bécran\b|\becran\b|portfolio|maquette|mockup|wireframe|prototype' -pattern+='|\bjoli\b|\bjolie\b|\bbeau\b|\bbelle\b|esth[eé]tique|aesthetic' -pattern+='|\bvisuel\b|\bvisual\b|embellir|fignol|peaufin|polish|styliser' -pattern+='|styling|stylesheet|\bskin\b|charte graphique|\bbrand\b|branding' -pattern+='|\blogo\b|favicon|ic[oô]ne|\bicon\b|\bcss\b|tailwind|shadcn|couleur' -pattern+='|gradient|d[eé]grad[eé]|\bombre\b|spacing|espacement|\bmarge\b' -pattern+='|\bpadding\b|\bmargin\b|\bradius\b|arrondi|\bhover\b|dark mode' -pattern+='|light mode|typograph|\bfont\b|\bfonts\b|font pairing|\bpolice\b' -pattern+='|animation|\bmotion\b|micro-interaction|keyframe|glassmorph|neumorph' -pattern+='|claymorph|skeuomorph|brutalis|bento|minimalis|responsive|figma' - -if printf '%s' "$lc" | grep -Eq "$pattern"; then - # Counter: log the fire (time, matched token, excerpt) — best-effort, never blocks. - logf="${HOME}/.claude/logs/design-toolchain-fires.log" - mkdir -p "$(dirname "$logf")" 2>/dev/null || true - printf '%s\t%s\t%s\n' "$(date -Iseconds)" \ - "$(printf '%s' "$lc" | grep -oiE "$pattern" | head -1 || true)" \ - "$(printf '%s' "$prompt" | tr '\n\t' ' ' | cut -c1-100)" >> "$logf" 2>/dev/null || true - cat <<'EOF' -Design work detected → Read ~/.claude/rules/web-building.md § "Design work — full toolchain" first. Trivial (≤2 files, cosmetic) → /hotfix. -EOF -fi - -exit 0 diff --git a/lib/tests/design-toolchain-reminder.test.sh b/lib/tests/design-toolchain-reminder.test.sh deleted file mode 100644 index 69df979..0000000 --- a/lib/tests/design-toolchain-reminder.test.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/env bash -# lib/tests/design-toolchain-reminder.test.sh -set -u -H="$(cd "$(dirname "$0")/../.." && pwd)/hooks/design-toolchain-reminder.sh" -# Every hook call runs under a throwaway HOME (the fire log is -# $HOME/.claude/logs/design-toolchain-fires.log): the suite never writes the -# real one (1,770 of 2,779 logged fires were this suite's prompts, 2026-10-28). -T="$(mktemp -d)"; trap 'rm -rf "$T"' EXIT -export HOME="$T" -LINE='Design work detected → Read ~/.claude/rules/web-building.md § "Design work — full toolchain" first. Trivial (≤2 files, cosmetic) → /hotfix.' -pass=0; fail=0 -check() { if [ "$2" = "$3" ]; then pass=$((pass+1)); else fail=$((fail+1)); - printf 'FAIL %s: got[%s] want[%s]\n' "$1" "$2" "$3"; fi; } -# fire() -> "fire" if the hook emits the reminder, else "quiet". -fire() { if printf '{"prompt":"%s"}' "$1" | bash "$H" | grep -q 'full toolchain'; then - echo fire; else echo quiet; fi; } - -# --- Dropped/neutralized tokens must be QUIET (non-UI senses) --- -check D1-design "$(fire 'a design decision for the API')" quiet -check D2-component "$(fire 'this system component')" quiet -check D3-composant "$(fire 'le composant backend')" quiet -check D4-theme "$(fire 'the theme of the audit')" quiet -check D5-transition "$(fire 'state transition to develop')" quiet -check D6-frontend "$(fire 'frontend architecture')" quiet -check D7-palette "$(fire 'a palette of options')" quiet -check D8-dash-file "$(fire 'ecc_dashboard.py')" quiet - -# --- Harness-generated inputs must be QUIET even with UI tokens --- -check D9-tasknotif "$(fire ' x add css header fonts')" quiet -check D10-notif-file "$(fire ' design-motion-principles keyframe done')" quiet -check D11-bare-ux "$(fire 'changement ux vu de tes trouvailles')" quiet -check D12-agent-msg "$(fire ' [Subagent hand-back] add css header fonts')" quiet - -# --- Real UI signals must still FIRE --- -check F1-button "$(fire 'add a button')" fire -check F2-navbar "$(fire 'the navbar layout')" fire -check F3-landing "$(fire 'build a landing page')" fire -check F4-glass "$(fire 'a glassmorphism card')" fire -check F5-redesign "$(fire 'redesign the app')" fire -check F6-frontdesign "$(fire 'frontend design work')" fire -check F7-admin-dash "$(fire 'admin dashboard screen')" fire -check F8-animation "$(fire 'add an animation')" fire -check F9-designsys "$(fire 'our design system')" fire -check F10-bare-ui "$(fire 'revois l'\''ui du panneau admin')" fire -check F11-pasted "$(fire ' add a button')" fire - -# --- The one-liner is a contract (LRN-104): exact text --- -check O1-exact-line "$(printf '{"prompt":"add a button"}' | bash "$H")" "$LINE" -# the fires above landed in the throwaway HOME, positively (not a global count) -check G1-fires-in-temp-home "$([ -s "$T/.claude/logs/design-toolchain-fires.log" ] && echo yes)" yes - -# --- Fire is logged (time + token + excerpt) --- -tmp="$(mktemp -d)" -printf '{"prompt":"a glassmorphism card"}' | HOME="$tmp" bash "$H" >/dev/null 2>&1 -check L1-logged "$(grep -c 'glassmorph' "$tmp/.claude/logs/design-toolchain-fires.log" 2>/dev/null)" 1 -rm -rf "$tmp" - -printf 'PASS=%s FAIL=%s\n' "$pass" "$fail"; [ "$fail" -eq 0 ] diff --git a/lib/tests/doctrine-citers.test.sh b/lib/tests/doctrine-citers.test.sh index 688d763..d8546e7 100644 --- a/lib/tests/doctrine-citers.test.sh +++ b/lib/tests/doctrine-citers.test.sh @@ -140,8 +140,8 @@ check T5d-quoted-label-whole "$(printf '%s\n' "$out" | grep -c 'full kit')" 1 check T5b-missing-file-named "$(printf '%s\n' "$out" | grep -c 'rules/none.md')" 1 check T5c-prefix-not-a-heading "$(printf '%s\n' "$out" | grep -c '"Version"')" 1 -# T8a-T8h: blind spots of the file-citation census (nested dirs, project -# rules, home prefixes, left boundary, templates) +# T8a-T8i: blind spots of the file-citation census (nested dirs, project +# rules, home prefixes, left boundary, templates, quoted label kept whole) mkdir -p "$FIX/lib/sub" "$FIX/.claude/rules" "$FIX/templates/project-rules" printf '## Alpha\n' > "$FIX/lib/sub/x.md" printf 'nested: lib/sub/x.md § Alpha\n' > "$FIX/n1.md" @@ -184,6 +184,9 @@ printf 'tpl: templates/project-rules/t.md § Zeta.\n' > "$FIX/t2.md" citers_check_files "$FIX" "$FIX/t1.md" >/dev/null; rc1=$? citers_check_files "$FIX" "$FIX/t2.md" >/dev/null check T8h-template-rules-path "$rc1|$?" "0|1" +# the retired design hook's pointer shape: ~ prefix + quoted label +printf '%s\n' ' ~/.claude/rules/web-building.md § "Design work — full toolchain"' > "$FIX/pointer.sh" +check T8i-tilde-quoted-label-whole "$(_citers_extract_files "$FIX/pointer.sh" | cut -d: -f3-)" 'rules/web-building.md:Design work — full toolchain' # ── real census: the repo's own citers against CLAUDE.global.md ────────────── # (`impeccabl[e]` is a glob: the pack census must not read it as a citer.) @@ -222,9 +225,6 @@ sed 's/^## Versioning$/## Version policy/' "$ROOT/rules/rest-api.md" > "$FIX/cop (cd "$ROOT" && citers_check_files "$FIX/copy" lib/architecture-defaults.md \ lib/project-archetypes/rest-api-node.md) >/dev/null check T7b-real-rename-bites "$?" 2 -# the hook's pointer is checked whole, not as its "Design work" prefix -check T7c-hook-label-whole "$(cd "$ROOT" && _citers_extract_files hooks/design-toolchain-reminder.sh \ - | grep -c ':rules/web-building.md:Design work — full toolchain$')" 2 echo "PASS=$pass FAIL=$fail" [ "$fail" -eq 0 ] diff --git a/rules/web-building.md b/rules/web-building.md index cab3783..bf9dd6a 100644 --- a/rules/web-building.md +++ b/rules/web-building.md @@ -47,7 +47,7 @@ with /seo, /harden, /web-validate. ## Design work — full toolchain (tiered by scope) Trigger = UI work: editing a component/style file (.tsx/.vue/.svelte/.css…) or a design/UI request, not the word "design" alone. Single source for -design routing; the design-toolchain hook reinforces it. +design routing. - Trivial (≤2 files, one cosmetic value) → /hotfix, no toolchain. - Build UI (component, page, redesign) → impeccable (build path: init, shape, new-work, craft floor, fresh finish reviewer) + ui-ux-pro-max + diff --git a/settings.json b/settings.json index 77fda30..365b2b0 100644 --- a/settings.json +++ b/settings.json @@ -511,12 +511,6 @@ "UserPromptSubmit": [ { "hooks": [ - { - "type": "command", - "command": "bash ~/.claude/hooks/design-toolchain-reminder.sh", - "timeout": 5, - "statusMessage": "Checking design signals..." - }, { "type": "command", "command": "bash ~/.claude/hooks/ctx7-reminder.sh",