feat(ctx7): coverage extension — fast-libs single source + reminder hook + executor briefs (BDR-078)

- lib/fast-libs.sh: detect/cache-status verbs, JS+Python manifests,
  7-day cache freshness, LC_ALL=C sort — replaces 3 hardcoded lists
  (ship-feature 0c, init-project 5c, onboard 3.5)
- hooks/ctx7-reminder.sh: once-per-session UserPromptSubmit nudge when
  the project carries fast-libs and .ctx7-cache/ is missing/stale
- find-docs: before-writing-code trigger + cache-first rule; dist is
  machine-owned (gitignored) so the durable patch lives in
  install-plugins.sh STEP ctx7 (idempotent, grep-guarded)
- feater/bugfixer briefs: fast-lib docs rule (fresh cache read, else
  2-topic ctx7 fetch, else NOTES cache miss + proceed)
- tests: lib/tests/fast-libs.test.sh (11 checks); shellcheck + full
  make test green (review-guards 5/0)
This commit is contained in:
Bastien Chanot
2026-07-20 10:45:06 +02:00
parent 6838d5a8fa
commit b7026e4bda
14 changed files with 277 additions and 9 deletions
+3 -1
View File
@@ -114,7 +114,9 @@ report carries the rendered README draft as `[CREATE-AUTO]`; re-dispatch
that plan to write it. No stop (README bootstrap is unconditional).
## STEP 5c — CTX7 PRE-FETCH (if fast-libs detected)
If `fast-libs` signal was detected in STEP 0 (Next.js, React 18+, Prisma, Supabase, Drizzle, etc.):
If `fast-libs` signal was detected in STEP 0 — single source of truth:
`bash ~/.claude/lib/fast-libs.sh detect .` (Next.js, React, Prisma,
Supabase, Drizzle… — BDR-078):
1. Create `.ctx7-cache/` directory in project root.
2. For each detected fast-lib, fetch core docs:
```bash
+4 -7
View File
@@ -207,13 +207,10 @@ ls .ctx7-cache/ 2>/dev/null
```
### Détection fast-libs
Parse manifests selon l'archétype :
- **nextjs-app-router** → chercher : next, react, prisma, @supabase/*, drizzle-orm, next-auth, @clerk/*
- **react-spa** → chercher : react, @tanstack/*, zustand, jotai
- **rest-api-node** → chercher : fastify, @nestjs/*, prisma, drizzle-orm
- **rest-api-python** → chercher : fastapi, pydantic, sqlalchemy (si ≥ 2.0)
- **astro-static** → chercher : astro, @astrojs/*
- **wordpress / cli-tool / library / dotfiles-meta / static-html** → souvent aucune fast-lib, audit léger
Source unique : `bash ~/.claude/lib/fast-libs.sh detect .` (deps JS/TS via
package.json + Python via requirements/pyproject — liste centralisée,
BDR-078). Archétypes wordpress / cli-tool / library / dotfiles-meta /
static-html → souvent aucune fast-lib, audit léger.
### Vérification cache
Pour chaque fast-lib détectée :
+2 -1
View File
@@ -52,7 +52,8 @@ ls .gsd/ROADMAP.md 2>/dev/null | head -1
STOP.
## STEP 0c — CTX7 CACHE CHECK (if fast-libs in project)
Check if the project uses fast-evolving libs (scan `package.json` for next, react, prisma, supabase, drizzle, expo):
Check if the project uses fast-moving libs — single source of truth:
`bash ~/.claude/lib/fast-libs.sh detect .` (exit 1 = none; BDR-078):
1. If `.ctx7-cache/` exists with recent files (<7 days old) → print `📚 ctx7 cache found: <libs>` and continue.
2. If `.ctx7-cache/` missing or stale AND `ctx7` is installed AND fast-libs detected:
```bash