create-modoock-app 1.0.1 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/README.md +68 -237
  2. package/dist/cli.js +112 -43
  3. package/package.json +22 -22
  4. package/template/.cursor/hooks/gate-ui-pack.mjs +108 -0
  5. package/template/.cursor/hooks.json +18 -0
  6. package/template/.cursor/rules/honey.mdc +11 -3
  7. package/template/AGENTS.md +13 -12
  8. package/template/README.md +225 -175
  9. package/template/app/(local)/components/page.tsx +3 -3
  10. package/template/app/(local)/design-system/page.tsx +2 -2
  11. package/template/components/layout/app-layout.tsx +16 -5
  12. package/template/components/layout/header.tsx +19 -1
  13. package/template/components/layout/side-nav.tsx +103 -30
  14. package/template/postcss.config.mjs +7 -7
  15. package/template/public/identity/full_logo_black.svg +26 -26
  16. package/template/public/identity/full_logo_color.svg +37 -37
  17. package/template/public/identity/full_logo_white.svg +33 -33
  18. package/template/public/identity/logo_icon_black.svg +5 -5
  19. package/template/public/identity/logo_icon_color.svg +12 -12
  20. package/template/public/identity/logo_icon_white.svg +12 -12
  21. package/template/components/ui/action-stack.tsx +0 -42
  22. package/template/components/ui/badge.tsx +0 -43
  23. package/template/components/ui/button.tsx +0 -104
  24. package/template/components/ui/icon.tsx +0 -78
  25. package/template/components/ui/index.ts +0 -28
  26. package/template/components/ui/input.tsx +0 -376
  27. package/template/components/ui/loader.tsx +0 -78
  28. package/template/components/ui/metric-bar.tsx +0 -49
  29. package/template/components/ui/modal.tsx +0 -177
  30. package/template/components/ui/select.tsx +0 -458
  31. package/template/components/ui/stepper.tsx +0 -96
  32. package/template/components/ui/tab.tsx +0 -85
  33. package/template/components/ui/user-table.tsx +0 -806
  34. package/template/knowledge-base/design-system/components/action-stack.mdc +0 -17
  35. package/template/knowledge-base/design-system/components/badges.mdc +0 -16
  36. package/template/knowledge-base/design-system/components/buttons.mdc +0 -21
  37. package/template/knowledge-base/design-system/components/detail-header.mdc +0 -17
  38. package/template/knowledge-base/design-system/components/dropdowns.mdc +0 -12
  39. package/template/knowledge-base/design-system/components/info-list.mdc +0 -17
  40. package/template/knowledge-base/design-system/components/inputs.mdc +0 -23
  41. package/template/knowledge-base/design-system/components/menu.mdc +0 -20
  42. package/template/knowledge-base/design-system/components/modals.mdc +0 -24
  43. package/template/knowledge-base/design-system/components/selects.mdc +0 -39
  44. package/template/knowledge-base/design-system/components/stepper.mdc +0 -18
  45. package/template/knowledge-base/design-system/components/tables.mdc +0 -59
  46. package/template/knowledge-base/design-system/components/tabs.mdc +0 -17
  47. package/template/knowledge-base/design-system/components.mdc +0 -91
  48. package/template/knowledge-base/design-system/tokens.mdc +0 -24
  49. package/template/knowledge-base/examples/bad/README.md +0 -8
  50. package/template/knowledge-base/examples/good/README.md +0 -13
  51. package/template/knowledge-base/metadata/catalog.yaml +0 -245
  52. package/template/knowledge-base/patterns/components/reuse-existing.mdc +0 -26
  53. package/template/knowledge-base/patterns/data-fetching/local-data.mdc +0 -20
  54. package/template/knowledge-base/patterns/layouts/app-shell.mdc +0 -20
  55. package/template/knowledge-base/patterns/pages/data-table-page.mdc +0 -31
  56. package/template/knowledge-base/patterns/pages/workflow-page.mdc +0 -27
  57. package/template/knowledge-base/rules/accessibility/responsive.mdc +0 -31
  58. package/template/knowledge-base/rules/architecture/layout.mdc +0 -52
  59. package/template/knowledge-base/rules/architecture/single-screen.mdc +0 -62
  60. package/template/knowledge-base/rules/code-quality/jsx.mdc +0 -19
  61. package/template/knowledge-base/rules/global/naming.mdc +0 -12
  62. package/template/knowledge-base/rules/global/technology.mdc +0 -19
  63. package/template/knowledge-base/rules/global/ui-copy.mdc +0 -20
  64. package/template/knowledge-base/rules/performance/client.mdc +0 -20
  65. package/template/knowledge-base/rules/ui/information-density.mdc +0 -36
  66. package/template/knowledge-base/rules/ui/interaction.mdc +0 -47
  67. package/template/knowledge-base/rules/ui/simple-ui.mdc +0 -58
  68. package/template/knowledge-base/validation/accessibility.mdc +0 -13
  69. package/template/knowledge-base/validation/architecture.mdc +0 -10
  70. package/template/knowledge-base/validation/ast-grep/do-what-brooooooklyn-said.yml +0 -15
  71. package/template/knowledge-base/validation/ast-grep/no-nested-links.yml +0 -12
  72. package/template/knowledge-base/validation/ast-grep/rewrite-svg-attribute.yml +0 -19
  73. package/template/knowledge-base/validation/code-quality.mdc +0 -18
  74. package/template/knowledge-base/validation/performance.mdc +0 -11
  75. package/template/knowledge-base/validation/ui.mdc +0 -26
@@ -1,213 +1,225 @@
1
1
  # Modoock Projects Boilerplate
2
2
 
3
- Boilerplate d’application web Modoock : une interface d’entreprise destinée à des utilisateurs peu habitués aux systèmes d’information. Le projet sert à la fois de **socle de développement** (design system, composants réutilisables, règles) et de **démonstration** de plusieurs modules métier, avec des données locales fictives.
3
+ Modoock web-app boilerplate: an enterprise UI for people who are not used to information systems. The repo is both a **development base** (design system, reusable components, rules) and a **demo** of several business modules, with local fake data.
4
4
 
5
- L’interface est en français. Chaque page métier vise une lecture immédiate : un écran, un objectif, un tableau principal, les détails secondaires dans une fiche ou un onglet.
5
+ The UI is in French. Each business page aims at immediate reading: one screen, one goal, one main table, secondary details in a record or a tab.
6
6
 
7
- ## Objectif
7
+ ## Goal
8
8
 
9
- Fournir un point de départ cohérent pour construire des applications Modoock :
9
+ Provide a consistent starting point for Modoock apps:
10
10
 
11
- - une identité visuelle unique (tokens, typographie, couleurs) ;
12
- - des composants d’interface réutilisables, sans HTML brut quand un composant existe déjà ;
13
- - des pages dashboard sans scroll global sur grand écran ;
14
- - des règles de développement centralisées dans `knowledge-base/` ;
15
- - des modules d’exemple (projets, équipements, infrastructure, recherche) pour illustrer les patterns.
11
+ - a single visual identity (tokens, type, color);
12
+ - reusable UI components, no raw HTML when a component already exists;
13
+ - dashboard pages with no page-level scroll on large screens;
14
+ - development rules centralized in `knowledge-base/`;
15
+ - sample modules (projects, equipment, infrastructure, research) to illustrate the patterns.
16
16
 
17
- Il n’y a pas de backend : les listes et fiches s’appuient sur des fichiers de données déterministes dans `app/`.
17
+ There is no backend: lists and records use deterministic data files under `app/`.
18
18
 
19
19
  ## Stack
20
20
 
21
- | Élément | Choix |
21
+ | Piece | Choice |
22
22
  | --- | --- |
23
23
  | Framework | Next.js 16 (App Router) |
24
24
  | UI | React 19, TypeScript 5 |
25
- | Styles | Tailwind CSS 4, tokens dans `app/globals.css` |
26
- | Icônes | `lucide-react`, uniquement via le composant `Icon` |
27
- | Police | Montserrat (`next/font`) |
28
- | Qualité | ESLint (`eslint-config-next`) |
25
+ | Styles | Tailwind CSS 4, tokens in `app/globals.css` |
26
+ | Icons | `lucide-react`, only through the `Icon` component |
27
+ | Font | Montserrat (`next/font`) |
28
+ | Quality | ESLint (`eslint-config-next`), TypeScript, ast-grep (`npm run sg:scan`) |
29
29
 
30
- Les versions exactes sont dans `package.json`. Aucune autre librairie d’icônes ou d’animation n’est prévue.
30
+ Exact versions live in `package.json`. No extra icon or animation library is planned.
31
31
 
32
- ## Démarrage
32
+ ## Getting started
33
33
 
34
34
  ```bash
35
35
  npm install
36
36
  npm run dev
37
37
  ```
38
38
 
39
- Ouvrir [http://localhost:3000](http://localhost:3000).
39
+ Open [http://localhost:3000](http://localhost:3000).
40
40
 
41
- Autres commandes :
41
+ Other commands:
42
42
 
43
43
  ```bash
44
44
  npm run lint # ESLint
45
- npm run typecheck # TypeScript, dont props JSX
46
- npm run sg:scan # faits structurels
47
- npm run build # build de production
48
- npm run start # serveur de production
45
+ npm run typecheck # TypeScript, including JSX props
46
+ npm run sg:scan # ast-grep (structural facts, lot A)
47
+ npm run build # production build
48
+ npm run start # production server
49
49
  ```
50
50
 
51
51
  ## Architecture
52
52
 
53
53
  ```
54
- app/ Pages (App Router) et données de démonstration
54
+ app/ Pages (App Router) and demo data
55
55
  components/
56
- ui/ Composants génériques du Design System
57
- layout/ Structure de l’application (header, menu, layout)
58
- shared/ Blocs métier réutilisés par plusieurs pages
56
+ ui/ Generic Design System components
57
+ layout/ App chrome (header, menu, layout)
58
+ shared/ Cross-page business blocks
59
59
  knowledge-base/
60
- rules/ Contraintes (global, architecture, ui, accessibility)
61
- patterns/ Comment le repo résout une classe de problème
62
- examples/ Exemples good/ et bad/
63
- design-system/ Tokens et contraintes de composants
64
- validation/ Comment détecter une violation
65
- metadata/ catalog.yaml — index de charge (load, open, description)
66
- .cursor/rules/ agents.mdc (pointeur vers AGENTS.md), honey.mdc (style), ui.mdc (rappel Cursor)
60
+ rules/ Constraints (global, architecture, ui, accessibility)
61
+ patterns/ How this repo solves a class of problem
62
+ design-system/ Tokens and component constraints
63
+ validation/ How to detect a violation (human)
64
+ ast-grep/ Mechanical proofs (`sg:scan`)
65
+ metadata/ catalog.yaml — load index (load, open, description)
66
+ .cursor/
67
+ rules/ agents.mdc (pointer), honey.mdc, ui.mdc (glob reminder)
68
+ hooks.json Cursor bind (deny UI writes until the pack is read)
69
+ hooks/ gate-ui-pack.mjs
70
+ AGENTS.md Canonical router (every agent)
67
71
  ```
68
72
 
69
- Chaque dossier de composants expose son API publique dans un `index.ts`. Les pages importent depuis ces index, pas depuis les fichiers internes.
73
+ Each component folder exposes its public API in an `index.ts`. Pages import from those indexes, not from internal files.
70
74
 
71
75
  ### Layout
72
76
 
73
- `AppLayout` entoure toute l’application :
77
+ `AppLayout` wraps the whole app:
74
78
 
75
- - **SideNav** : menu latéral bleu (couleur primaire), repliable (icônes seules / icônes + libellés).
76
- - **Header** : titre de page, description éventuelle, retour arrière et actualisation.
79
+ - **SideNav**: blue (primary) side menu, collapsible (icons only / icons + labels).
80
+ - **Header**: page title, optional description, back and refresh.
77
81
 
78
- Sur `md+`, les pages dashboard et fiche restent dans la hauteur de l’écran : le tableau ou les cartes défilent à l’intérieur. Sous `md`, le scroll de page est autorisé et les tableaux deviennent des cartes empilées.
82
+ On `md+`, dashboard and compact-detail pages stay within the viewport: the table or cards scroll inside. Below `md`, page scroll is allowed and tables become stacked cards.
79
83
 
80
84
  ## Modules
81
85
 
82
- | Route | Module | Rôle |
86
+ | Route | Module | Role |
83
87
  | --- | --- | --- |
84
- | `/` | Dashboard | Vitrine des champs, boutons, icônes, loaders et d’un tableau d’exemple |
85
- | `/projects` | Projets | Portefeuille : recherche, filtres, synthèse, tableau, fiche `/projects/[id]` |
86
- | `/equipment` | Équipements | Parc (ex. médical) : statuts, maintenance, fiche avec onglets |
87
- | `/infrastructure` | Infrastructure | Catalogue de services : métriques, filtres, actions groupées, fiche service |
88
- | `/infrastructure/incidents` | Incidents | Incidents liés aux services, fiche avec timeline |
89
- | `/research` | Recherche | Expériences, datasets, runs, événements, comparaison de métriques |
90
- | `/tables` | Tables | Quatre attitudes de tableau (Sprinter, Analyste, Focus, À la une) |
91
- | `/design-system` | Design System | Documentation visuelle des tokens et composants |
88
+ | `/` | Dashboard | Showcase of fields, buttons, icons, loaders, and a sample table |
89
+ | `/projects` | Projects | Portfolio: search, filters, summary, table, record `/projects/[id]` |
90
+ | `/equipment` | Equipment | Fleet (e.g. medical): statuses, maintenance, tabbed record |
91
+ | `/infrastructure` | Infrastructure | Service catalog: metrics, filters, bulk actions, service record |
92
+ | `/infrastructure/incidents` | Incidents | Incidents tied to services, record with timeline |
93
+ | `/research` | Research | Experiments, datasets, runs, events, metric comparison |
94
+ | `/tables` | Tables | Four table attitudes (Sprinter, Analyste, Focus, À la une) |
95
+ | `/design-system` | Design System | Visual documentation of tokens and components |
92
96
 
93
- ### Projets
97
+ ### Projects
94
98
 
95
- Vue globale du portefeuille (environ 300 projets générés de façon déterministe). Statut, priorité, équipe, chef de projet, avancement, échéance, budget, tâches et activité récente. La fiche détaille l’équipe, les dates, l’avancement et le budget, plus l’historique d’activité.
99
+ Portfolio overview (about 300 projects, generated deterministically). Status, priority, team, project lead, progress, due date, budget, tasks, and recent activity. The record details team, dates, progress and budget, plus activity history.
96
100
 
97
- ### Équipements
101
+ ### Equipment
98
102
 
99
- Suivi d’un parc : opérationnel, maintenance, intervention urgente, hors service. La fiche regroupe informations, incidents, interventions et historique de maintenance.
103
+ Fleet tracking: operational, maintenance, urgent intervention, out of service. The record groups information, incidents, interventions, and maintenance history.
100
104
 
101
- ### Infrastructure et incidents
105
+ ### Infrastructure and incidents
102
106
 
103
- Services (environnement, région, type, équipe, CPU, mémoire, latence, erreurs, déploiements). Sélection multiple, export CSV et actions simulées (redémarrage, coupure du monitoring). Les incidents ont gravité, statut, impact et historique.
107
+ Services (environment, region, type, team, CPU, memory, latency, errors, deployments). Multi-select, CSV export, and simulated actions (restart, monitoring off). Incidents have severity, status, impact, and history.
104
108
 
105
- ### Recherche
109
+ ### Research
106
110
 
107
- Expériences par domaine (vision, NLP, robotique, IA générative, bioinformatique, climat), avec datasets, runs et événements. Un onglet compare les métriques de plusieurs expériences.
111
+ Experiments by domain (vision, NLP, robotics, generative AI, bioinformatics, climate), with datasets, runs, and events. A tab compares metrics across experiments.
108
112
 
109
- ## Flux du contexte (règles, composants, code)
113
+ ## Context flow (rules, components, code)
110
114
 
111
- Le projet ne se pilote pas depuis `app/`. On travaille dans un **contexte** : une demande, des règles, un catalogue de composants, des tokens. `app/` n’est que le banc de test de cette chaîne.
115
+ The project is not driven from `app/`. Work happens in a **context**: a request, rules, a component catalog, tokens. `app/` is only the test bench for that chain.
112
116
 
113
- Les règles restent dans `knowledge-base/`. Elles ne sont **pas** déplacées vers `.cursor/rules/` : Cursor, Claude, Codex et Copilot suivent le **même** index (`catalog.yaml`) et le **même** routeur.
117
+ Rules stay in `knowledge-base/`. They are **not** moved into `.cursor/rules/`: Cursor, Claude, Codex, and Copilot follow the **same** index (`catalog.yaml`) and the **same** router.
114
118
 
115
- ### Qui fait quoi
119
+ ### Who does what
116
120
 
117
- | Pièce | Rôle | On y va pour… |
121
+ | Piece | Role | Go there to… |
118
122
  | --- | --- | --- |
119
- | Demande (prompt) | Périmètre | **Quoi** faire, rien de plus |
120
- | `knowledge-base/` | Texte des règles | **Comment** le faire |
121
- | `knowledge-base/metadata/catalog.yaml` | Index de charge | **Quel fichier** ouvrir, et avec quoi |
122
- | `AGENTS.md` | Routeur canonique | Procédure de charge, pas les règles |
123
- | `CLAUDE.md` | Import Claude Code | `@AGENTS.md` et `@.cursor/rules/honey.mdc` — ne pas y recopier le texte |
124
- | `.cursor/rules/agents.mdc` | Pointeur Cursor | Follow `AGENTS.md` — ne pas y recopier le routeur |
125
- | `.cursor/rules/ui.mdc` | Rappel Cursor (glob UI) | Même procédure que le routeur |
126
- | `.cursor/rules/honey.mdc` | Style d’écriture (tous les agents, un fichier) | Moins de code, moins de prose — ne pas recopier ni découper |
127
- | `components/*/index.ts` | Ce qui existe | Réutiliser l’export ; pas de `.mdc` obligatoire |
128
- | `knowledge-base/design-system/components/*.mdc` | Règles particulières | Seulement si le catalog les liste |
129
- | `knowledge-base/validation/` + `ast-grep/` | Détection | Comment échouer ; `npm run sg:scan` |
130
- | `app/globals.css` | Tokens | Pas de valeur visuelle en dur |
131
-
132
- Codex / Copilot / Cursor lisent `AGENTS.md` (Always = ouvrir `honey.mdc` s’il n’est pas déjà en contexte). Claude Code lit `CLAUDE.md`, qui importe `@AGENTS.md` et `@.cursor/rules/honey.mdc`. Cursor injecte `honey.mdc` (always-on) et `agents.mdc` (pointeur) ; `ui.mdc` si un `.tsx` d’`app/` ou `components/` est ouvert. Ne pas recopier le routeur ni Honey.
133
-
134
- ### Schéma global
123
+ | Request (prompt) | Scope | **What** to do, nothing more |
124
+ | `knowledge-base/` | Rule text | **How** to do it |
125
+ | `knowledge-base/metadata/catalog.yaml` | Load index | **Which file** to open, and with what |
126
+ | `AGENTS.md` | Canonical router | Load procedure, not the rules |
127
+ | `CLAUDE.md` | Claude Code import | `@AGENTS.md` and `@.cursor/rules/honey.mdc` — do not copy the text there |
128
+ | `.cursor/rules/agents.mdc` | Cursor pointer | Follow `AGENTS.md` — do not copy the router there |
129
+ | `.cursor/rules/honey.mdc` | Writing style (every agent, one file) | Less code, less prose — do not copy or split |
130
+ | `.cursor/rules/ui.mdc` | Cursor reminder (UI glob) | Same procedure as the router — not a second rulebook |
131
+ | `.cursor/hooks.json` + `hooks/gate-ui-pack.mjs` | Cursor bind | Deny `Write` / `StrReplace` / `Delete` under `app/` and `components/` until the UI pack has been `Read` this conversation. jsonl log of `Read`s (temp). Shell and Tab are not gated |
132
+ | `components/*/index.ts` | What exists | Reuse the export; no `.mdc` required |
133
+ | `knowledge-base/design-system/components/*.mdc` | Extra rules | Only if the catalog lists them |
134
+ | `knowledge-base/validation/` | Fails (human + pointers) | How to fail; what the scanner cannot prove |
135
+ | `knowledge-base/validation/ast-grep/` | Proofs | `npm run sg:scan` — dumb YAML, one rule = one fail |
136
+ | `app/globals.css` | Tokens | No hard-coded visual values |
137
+
138
+ Codex / Copilot / Cursor read `AGENTS.md` (Always = open `honey.mdc` if it is not already in context). Claude Code reads `CLAUDE.md`, which imports `@AGENTS.md` and `@.cursor/rules/honey.mdc`. Cursor injects `honey.mdc` (always-on) and `agents.mdc` (pointer); `ui.mdc` if an `app/` or `components/` `.tsx` is open. Cursor then **denies** writes under `app/` and `components/` until the `load: ui` pack has been `Read` (hook). Do not copy the router or Honey.
139
+
140
+ ### Global diagram
135
141
 
136
142
  ```
137
143
  USER TASK
138
144
  │
139
145
  ▼
140
- AGENTS.md ← routeur canonique
146
+ AGENTS.md ← canonical router
141
147
  ▲
142
148
  ├── CLAUDE.md (@AGENTS.md) ← Claude Code
143
- └── .cursor/rules/agents.mdc ← pointeur Cursor
149
+ └── .cursor/rules/agents.mdc ← Cursor pointer
144
150
  │
145
151
  ▼
146
- catalog.yaml ← index unique
152
+ catalog.yaml ← single index
147
153
  │
148
- ├── load: ui ──► path (socle à chaque edit UI)
149
- ├── description match ──► path (à la demande)
150
- └── open: ──► paths liés (graphe du pattern / de la règle)
154
+ ├── load: ui ──► path (pack on every UI edit)
155
+ ├── description match ──► path (on demand)
156
+ └── open: ──► related paths (pattern / rule graph)
151
157
  │
152
158
  ▼
153
- knowledge-base/**/*.mdc + components/*/index.ts ← contraintes + API réelle
159
+ knowledge-base/**/*.mdc + components/*/index.ts ← constraints + real API
160
+ │
161
+ │ Cursor only: hook deny Write app/ + components/
162
+ │ until catalog.yaml + load: ui + components/*/index.ts are Read
154
163
  │
155
164
  ▼
156
165
  CODE
157
166
  │
158
167
  ├── npm run lint → ESLint
159
- ├── npm run typecheck → TypeScript (props JSX = type public)
160
- ├── npm run sg:scan → faits structurels prouvables (reste stupide)
161
- ├── validation/*.mdc → Design System / UX / architecture
162
- └── agent → contexte et jugement
168
+ ├── npm run typecheck → TypeScript (JSX props = public type)
169
+ ├── npm run sg:scan → structural facts (TSX catalog + lot A)
170
+ ├── validation/*.mdc → still-human fails (copy, scroll, UX…)
171
+ └── agent → context and judgment
163
172
  ```
164
173
 
165
- ### 1. Routeur multi-agents
174
+ ### 1. Multi-agent router
166
175
 
167
- `AGENTS.md` est la seule copie de la procédure. `CLAUDE.md` l’importe (`@AGENTS.md`) et importe Honey. `agents.mdc` pointe vers `AGENTS.md` (le pied Next.js de `AGENTS.md` ne se copie pas).
176
+ `AGENTS.md` is the only copy of the procedure. `CLAUDE.md` imports it (`@AGENTS.md`) and imports Honey. `agents.mdc` points at `AGENTS.md` (do not copy the Next.js footer that `next dev` may append to `AGENTS.md`).
168
177
 
169
178
  ```
170
179
  Codex / Copilot Claude Cursor
171
180
  │ │ │
172
181
  ▼ ▼ ▼
173
182
  AGENTS.md CLAUDE.md AGENTS.md
174
- + open honey.mdc @AGENTS.md + honey.mdc (injecté)
175
- @honey.mdc + agents.mdc (pointeur)
183
+ + open honey.mdc @AGENTS.md + honey.mdc (injected)
184
+ @honey.mdc + agents.mdc (pointer)
176
185
  │ │ │
177
186
  └────────────┬───────┴──────────────────────┘
178
187
  ▼
179
188
  catalog.yaml
180
189
  ```
181
190
 
182
- Honey : un fichier, tous les agents, pas de copie, pas de découpage. Cursor l’injecte ; Codex / Copilot l’ouvrent (Always) ; Claude Code l’importe. Cursor seulement : `ui.mdc` (glob UI) = rappel de charge, pas un 2ᵉ rulebook.
191
+ Honey: one file, every agent, no copy, no split. Cursor injects it; Codex / Copilot open it (Always); Claude Code imports it. Cursor only: `ui.mdc` (UI glob) is a reminder; the **bind** is the hook (not a second rulebook).
183
192
 
184
- Honey n’est **pas** généré (`skills/honey/SKILL.md` / `scripts/build-rules.js` n’existent pas). On l’édite dans `.cursor/rules/honey.mdc`.
193
+ Honey is **not** generated (`skills/honey/SKILL.md` / `scripts/build-rules.js` do not exist). Edit it in `.cursor/rules/honey.mdc`.
185
194
 
186
- ### 2. Catalog — schéma d’une entrée
195
+ ### 2. Catalog — entry schema
187
196
 
188
- `knowledge-base/metadata/catalog.yaml` : sections `files`, `patterns`, `validation`.
197
+ `knowledge-base/metadata/catalog.yaml`: sections `files`, `patterns`, `validation`.
189
198
 
190
199
  ```yaml
191
200
  # files: / patterns:
192
- - path: knowledge-base/…/exemple.mdc # obligatoire — chemin exact
193
- description: … # match à la demande
194
- load: ui # optionnel — socle UI
195
- open: # optionnel — graphe de charge
196
- - knowledge-base/…/autre.mdc
201
+ - path: knowledge-base/…/example.mdc # required — exact path
202
+ description: … # on-demand match
203
+ load: ui # optional — UI pack
204
+ open: # optional — load graph
205
+ - knowledge-base/…/other.mdc
206
+ # patterns only:
207
+ # id: data-table-page # alias (ui.mdc)
197
208
  ```
198
209
 
199
- | Champ | Effet |
210
+ | Field | Effect |
200
211
  | --- | --- |
201
- | `path` | Fichier à ouvrir (nom exact : `tabs.mdc`, pas `tab.mdc`) |
202
- | `description` | Si elle matche le besoin → ouvrir `path` |
203
- | `load: ui` | Edit `app/**` ou `components/**` → ouvrir `path` sans matcher |
204
- | `open:` | Après `path`, ouvrir aussi ces fichiers (ne pas y recopier les règles) |
212
+ | `path` | File to open (exact name: `tabs.mdc`, not `tab.mdc`) |
213
+ | `description` | If it matches the need → open `path` |
214
+ | `load: ui` | UI pack. Cursor: the hook **requires** a `Read` of these `path`s (plus `catalog.yaml` and `components/*/index.ts`) before any write under `app/` or `components/`. Other agents follow `AGENTS.md` (hint) |
215
+ | `open:` | After `path`, also open these files (do not copy the rules into them) |
216
+ | `id` | Patterns only — alias (`data-table-page`, `workflow-page`) |
205
217
 
206
- Sans `load` : à la demande seulement. `alwaysApply` / `globs` dans le catalog sont des métadonnées ; **seul** `.cursor/rules/` injecte dans Cursor.
218
+ With no `load`: on demand only. `catalog.yaml` injects nothing. Cursor injects via `.cursor/rules/` (hints) and **gates** via `.cursor/hooks` (UI writes).
207
219
 
208
- **Socle actuel** (`load: ui`) : `components.mdc`, `tokens.mdc`, `simple-ui.mdc`, `layout.mdc`.
220
+ **Current pack** (`load: ui`): `components.mdc`, `tokens.mdc`, `simple-ui.mdc`, `layout.mdc`, `ui-copy.mdc`.
209
221
 
210
- **Graphe actuel** (`open:`) :
222
+ **Current graph** (`open:`):
211
223
 
212
224
  ```
213
225
  data-table-page.mdc ──open──► tables.mdc
@@ -216,124 +228,162 @@ workflow-page.mdc ──open──► stepper.mdc
216
228
  detail-header.mdc
217
229
  ```
218
230
 
219
- (`layout.mdc` et `components.mdc` sont déjà `load: ui`, pas besoin de les re-lister.)
231
+ (`layout.mdc` and `components.mdc` are already `load: ui`, no need to list them again.)
232
+
233
+ ### Cursor bind (hook)
234
+
235
+ Files: `.cursor/hooks.json`, `.cursor/hooks/gate-ui-pack.mjs`.
236
+
237
+ Cursor rules stay hints. The hook is the bind:
238
+
239
+ 1. Parse `catalog.yaml` → every `load: ui` + `components/*/index.ts` + the catalog.
240
+ 2. `preToolUse` (`Write` / `StrReplace` / `Delete` / `Edit`) under `app/` or `components/` → **deny** until those files have been `Read` **without** `offset` / `limit` this conversation.
241
+ 3. `postToolUse` (`Read`) → stamp + one jsonl line (`t`, `cid`, `path`) in the OS temp dir: `modoock-ui-pack/{conversation_id}.jsonl`.
242
+ 4. `preCompact` → stamp cleared (the pack left context). The jsonl stays.
243
+
244
+ Out of scope (on purpose): `AGENTS.md`, `knowledge-base/`, Shell, Tab, `description` / `open:` matching (still a hint). Hook crash → allow (the rest of the repo is not bricked).
245
+
246
+ Codex / Claude Code do not run this hook: they follow `AGENTS.md` only.
247
+
248
+ ### ast-grep (lot A)
249
+
250
+ `sgconfig.yml` → `knowledge-base/validation/ast-grep/`. One YAML rule = one fail already listed in `validation/*.mdc`. The scanner does not copy constraint text.
251
+
252
+ Already there (official TSX catalog): `no-nested-links`, `rewrite-svg-attribute`, `do-what-brooooooklyn-said` (`&&` in JSX, **warning**).
253
+
254
+ Lot A (**error**, except layout chrome as warning):
255
+
256
+ | id | Fail |
257
+ | --- | --- |
258
+ | `no-raw-native` | `<button>` / `<input>` / `<select>` / `<table>` in `app/` (`/design-system` gallery ignored; `components/ui` = primitives) |
259
+ | `no-raw-native-chrome` | Same as warning on `components/layout` and `components/shared` |
260
+ | `no-div-as-control` | `<div>` with a control `role` (`button`, `link`, …) |
261
+ | `no-transition-all` | `transition-all` / `transition: all` |
262
+ | `no-disable-zoom` | `maximumScale: 1` / `userScalable: false` / equivalent meta |
263
+ | `no-memo-without-deps` | `useMemo` / `useCallback` with no deps array |
264
+ | `no-js-layout-size` | `offsetHeight` / `clientHeight` / `ResizeObserver` |
265
+ | `no-password-field-outside-auth` | password `name` / `autoComplete` outside `app/auth` |
266
+ | `no-block-typing` | inline `preventDefault` on `onPaste` / `onKeyDown` |
267
+ | `no-two-tables` | two `UserTable` or `<table>` on one page |
268
+
269
+ Copy, scroll, information density, destructive confirmation, “ask don’t invent”: still `validation/*.mdc` + the agent. Do not run `ast-grep scan -U` on existing app JSX to silence a warning.
220
270
 
221
- ### 3. Découverte des composants
271
+ ### 3. Component discovery
222
272
 
223
273
  ```
224
274
  CODE KNOWLEDGE BASE
225
275
  components/*/index.ts design-system/components/*.mdc
226
276
  │ │
227
277
  ▼ ▼
228
- « qu’est-ce qui existe ? » « quelles règles en plus ? »
229
- Icon, Loader, TimelineList… seulement si catalog.yaml liste le fichier
230
- pas de .mdc obligatoire
278
+ “what exists?” “any extra rules?”
279
+ Icon, Loader, TimelineList… only if catalog.yaml lists the file
280
+ no .mdc required
231
281
  ```
232
282
 
233
- Règle écrite une fois : `knowledge-base/design-system/components.mdc` (`## Discovery`). Pas de `.mdc` = on utilise l’export, on n’invente pas un wrapper.
283
+ Written once: `knowledge-base/design-system/components.mdc` (`## Discovery`). No `.mdc` = use the export, do not invent a wrapper.
234
284
 
235
- ### 4. Couches de charge (tous les agents)
285
+ ### 4. Load layers (every agent)
236
286
 
237
287
  ```
238
- Toujours → routeur + honey.mdc
239
- Edit UI → catalog load: ui + index.ts
240
- Besoin → catalog description → path → open:
241
- Après code → knowledge-base/validation/ (fichier du thème) ; code-reviewer sur le diff
288
+ Always → router + honey.mdc
289
+ UI edit → catalog load: ui + index.ts; Cursor: hook deny until the pack is Read
290
+ On demand → catalog description → path → open: (hint)
291
+ After code → lint / typecheck / sg:scan; validation/*.mdc for the theme (still human); code-reviewer on the diff
242
292
  ```
243
293
 
244
- ### 5. Découpe d’un module (page liste)
294
+ ### 5. Splitting a module (list page)
245
295
 
246
- Pattern `knowledge-base/patterns/pages/data-table-page.mdc` :
296
+ Pattern `knowledge-base/patterns/pages/data-table-page.mdc`:
247
297
 
248
298
  ```
249
- /entité → une liste, une entité
250
- /entité/[id] → le lié (incidents, runs, events…)
299
+ /entity → one list, one entity
300
+ /entity/[id] → related records (incidents, runs, events…)
251
301
  ```
252
302
 
253
- Interdit : plusieurs listes d’entités sur la page liste (onglets ou non). Good : `/projects` + `/projects/[id]`. Fail : `knowledge-base/validation/ui.mdc`.
303
+ Forbidden: more than one entity list on the list page (tabs or not). Good: `/projects` + `/projects/[id]`. Fail: `knowledge-base/validation/ui.mdc`.
254
304
 
255
- ### 6. Ajouter une règle plus tard
305
+ ### 6. Adding a rule later
256
306
 
257
- Le texte va dans un `.mdc` sous `knowledge-base/`. **Proposer d’abord** (New rules), attendre le oui.
307
+ The text goes in a `.mdc` under `knowledge-base/`. **Propose first** (New rules), wait for yes.
258
308
 
259
- | Cas | Fichiers à toucher |
309
+ | Case | Files to touch |
260
310
  | --- | --- |
261
- | Phrase dans une règle déjà listée | Ce `.mdc` seulement |
262
- | Nouveau fichier de règle | `.mdc` + entrée `catalog.yaml` (`path` + `description`) |
263
- | Socle à chaque edit UI | + `load: ui` sur cette entrée |
264
- | Charger avec un pattern | + `open:` sur l’entrée pattern |
265
- | Composant, API suffisante | Export `index.ts` seulement |
266
- | Composant + règles particulières | `.mdc` + entrée catalog (sans `load: ui`) |
267
- | Fail structurel prouvable | YAML dans `validation/ast-grep/` (`sg:scan` reste stupide) |
268
- | Fail DS / UX / architecture | + ligne dans `validation/*.mdc` |
269
- | Changer la **procédure** de charge | `AGENTS.md` seulement (`ui.mdc` s’il répète). Ne pas recopier dans `CLAUDE.md` / `agents.mdc` |
311
+ | Sentence in a rule already listed | That `.mdc` only |
312
+ | New rule file | `.mdc` + `catalog.yaml` entry (`path` + `description`) |
313
+ | Pack on every UI edit | + `load: ui` on that entry |
314
+ | Load with a pattern | + `open:` on the pattern entry |
315
+ | Component, API is enough | `index.ts` export only |
316
+ | Component + extra rules | `.mdc` + catalog entry (no `load: ui`) |
317
+ | Provable structural fail | YAML in `validation/ast-grep/` (`sg:scan` stays dumb). Lot A is already there |
318
+ | DS / UX / architecture fail | + line in `validation/*.mdc` |
319
+ | Cursor bind (UI pack, jsonl) | `.cursor/hooks.json` / `hooks/gate-ui-pack.mjs` — not a `.mdc` |
320
+ | Change the load **procedure** | `AGENTS.md` only (`ui.mdc` if it repeats). Do not copy into `CLAUDE.md` / `agents.mdc` |
270
321
 
271
- On ne recopie pas la table besoin → fichier dans le README ni dans le routeur.
322
+ Do not copy the need → file table into the README or the router.
272
323
 
273
- ### Comment interagir avec ce contexte
324
+ ### How to work in this context
274
325
 
275
- **Avant d’écrire :**
326
+ **Before writing:**
276
327
 
277
- 1. Lire la demande telle quelle — ne pas l’étendre.
278
- 2. Inspecter le code déjà là (composants et usages).
279
- 3. Ouvrir `catalog.yaml` : tous les `load: ui` si edit UI ; puis les `description` qui matchent ; puis chaque `open:`.
280
- 4. Lire `components/*/index.ts` — c’est le catalogue réel.
281
- 5. Réutiliser : export existant → pattern → composition. Primitive Design System nouvelle / dépendance / token / archi globale → question au développeur (format AGENTS.md). Ne pas cacher la primitive dans la page.
328
+ 1. Read the request as-is — do not expand it.
329
+ 2. Inspect the code already there (components and usages).
330
+ 3. Open `catalog.yaml`: every `load: ui` on a UI edit; then matching `description`s; then each `open:`. Cursor will block the UI write until the pack is read.
331
+ 4. Read `components/*/index.ts` — that is the real catalog.
332
+ 5. Reuse: existing export → pattern → composition. Anything the request did not decide (missing part, unclear idea, choice, preference) → question, wait. Do not generate the gap. Do not hide a Design System primitive in the page.
282
333
 
283
- **Pendant :**
334
+ **During:**
284
335
 
285
- - Chaque décision vient de la demande ou d’une règle existante.
286
- - Plusieurs options → question, partie en pause.
287
- - Ne pas inventer une règle, ne pas modifier `knowledge-base/` sans accord.
288
- - Cas récurrent non couvert → proposer une règle et son `path` catalog, attendre.
336
+ - Every decision comes from the request or an existing rule — otherwise question, that part pauses.
337
+ - Do not invent a rule, do not change `knowledge-base/` without agreement.
338
+ - Recurring uncovered case → propose a rule and its catalog `path`, wait.
289
339
 
290
- **Après :**
340
+ **After:**
291
341
 
292
- - Contrôler via `knowledge-base/validation/` du thème.
293
- - Nouvel export → `index.ts` du dossier.
294
- - `npm run lint`, `npm run typecheck` et `npm run sg:scan` (corriger les **error**). Typecheck prouve que les props JSX existent sur le type du composant.
295
- - Signaler hypothèses et choix encore ouverts.
342
+ - Check `knowledge-base/validation/` for the theme.
343
+ - New export → that folder’s `index.ts`.
344
+ - `npm run lint`, `npm run typecheck` and `npm run sg:scan` (fix **errors**). Typecheck proves JSX props exist on the component type.
345
+ - Report hypotheses and still-open choices.
296
346
 
297
- ## Composants
347
+ ## Components
298
348
 
299
349
  ### UI (`components/ui/`)
300
350
 
301
- `ClickableButton`, `Input`, `Textarea`, `Badge`, `UserTable`, `Select` / `MultiSelect` / `SelectFilter`, `Modal`, `Tabs`, `Icon`, `Loader`, `MetricBar`.
351
+ `ClickableButton`, `Input`, `Textarea`, `Badge`, `UserTable`, `Select` / `MultiSelect` / `SelectFilter`, `Modal`, `Tabs`, `Icon`, `Loader`, `MetricBar`, `Stepper`, `ActionStack`.
302
352
 
303
- `UserTable` gère tri, pagination, message vide, transposition, et sous `md` le passage tableau → cartes (toutes les colonnes restent accessibles).
353
+ `UserTable` handles sort, pagination, empty message, transpose, and below `md` table → cards (every column stays reachable).
304
354
 
305
355
  ### Shared (`components/shared/`)
306
356
 
307
- `SummaryCard` (chiffre clé), `InfoCard` / `InfoList` (fiches détail), `TableSection`, `TimelineList`.
357
+ `SummaryCard` (key figure), `InfoCard` / `InfoList` (detail records), `DetailHeader`, `TableSection`, `TimelineList`.
308
358
 
309
359
  ### Layout (`components/layout/`)
310
360
 
311
361
  `AppLayout`, `Header`, `SideNav`.
312
362
 
313
- Avant d’ajouter un composant, consulter ces `index.ts`. Un composant Design System nouveau demande une validation. Une page qui suit un pattern existant, non.
363
+ Before adding a component, read these `index.ts` files. A new Design System component needs validation. An existing pattern does not authorize inventing the rest.
314
364
 
315
365
  ## Design System
316
366
 
317
- Les tokens vivent dans `app/globals.css` : couleurs (primary bleu, success, warning, danger, info, accent), typographie, espacements, rayons.
367
+ Tokens live in `app/globals.css`: colors (primary blue, success, warning, danger, info, accent), type, spacing, radii.
318
368
 
319
- - L’orange / jaune est réservé aux alertes critiques, jamais comme couleur décorative.
320
- - Les pages ne redéfinissent pas de couleurs, tailles ou espacements déjà tokenisés.
321
- - La page `/design-system` documente le langage visuel.
369
+ - Orange / yellow is reserved for critical alerts, never as decoration.
370
+ - Pages do not redefine colors, sizes, or spacing that already exist as tokens.
371
+ - The `/design-system` page documents the visual language.
322
372
 
323
- ## Données
373
+ ## Data
324
374
 
325
- Chaque module métier a un fichier `*-data.ts` à côté de ses pages. Les jeux volumineux (projets, infrastructure, incidents) sont générés avec une **graine fixe** pour rester identiques entre serveur et client.
375
+ Each business module has a `*-data.ts` file next to its pages. Large sets (projects, infrastructure, incidents) are generated with a **fixed seed** so server and client stay identical.
326
376
 
327
- Il n’y a pas d’API, d’authentification ni de persistance : les actions (export, redémarrage, etc.) sont simulées dans le navigateur.
377
+ There is no API, authentication, or persistence: actions (export, restart, etc.) are simulated in the browser.
328
378
 
329
- ## Conventions de développement
379
+ ## Development conventions
330
380
 
331
- `knowledge-base/` est la source de vérité. Charge et index : section **Flux du contexte** ci-dessus (`catalog.yaml` : `load`, `description`, `open:`).
381
+ `knowledge-base/` is the source of truth. Load and index: **Context flow** above (`catalog.yaml`: `load`, `description`, `open:`).
332
382
 
333
- Principes appliqués au quotidien :
383
+ Day-to-day principles:
334
384
 
335
- - textes d’interface en français, vocabulaire direct ;
336
- - une page liste = une entité ; le lié va sur `/[id]` ;
337
- - un seul tableau visible à la fois ;
338
- - pas de nouvelle dépendance, couleur, composant Design System ou convention sans poser la question ; si oui, implémenter ;
339
- - code minimal : rien « au cas où ».
385
+ - UI copy in French, direct wording;
386
+ - one list page = one entity; related records go to `/[id]`;
387
+ - one table visible at a time;
388
+ - do not invent what the request did not decide (missing part, choice, preference) — ask, then implement;
389
+ - minimal code: nothing “just in case”.