create-modoock-app 1.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.
- package/dist/cli.js +52 -0
- package/package.json +21 -0
- package/template/.cursor/agents/code-reviewer.md +25 -0
- package/template/.cursor/rules/agents.mdc +9 -0
- package/template/.cursor/rules/honey.mdc +226 -0
- package/template/.cursor/rules/ui.mdc +18 -0
- package/template/.cursor/skills/debug/SKILL.md +29 -0
- package/template/.dcdignore +3 -0
- package/template/AGENTS.md +89 -0
- package/template/CLAUDE.md +2 -0
- package/template/README.md +339 -0
- package/template/app/(local)/components/page.tsx +886 -0
- package/template/app/(local)/design-system/page.tsx +1140 -0
- package/template/app/(local)/layout.tsx +5 -0
- package/template/app/(local)/page.tsx +59 -0
- package/template/app/auth/layout.tsx +7 -0
- package/template/app/auth/login/page.tsx +76 -0
- package/template/app/favicon.ico +0 -0
- package/template/app/globals.css +365 -0
- package/template/app/layout.tsx +28 -0
- package/template/components/layout/app-layout.tsx +30 -0
- package/template/components/layout/header.tsx +72 -0
- package/template/components/layout/index.ts +3 -0
- package/template/components/layout/side-nav.tsx +163 -0
- package/template/components/shared/detail-header.tsx +39 -0
- package/template/components/shared/index.ts +8 -0
- package/template/components/shared/info-card.tsx +75 -0
- package/template/components/shared/summary-card.tsx +31 -0
- package/template/components/shared/table-section.tsx +38 -0
- package/template/components/shared/timeline-list.tsx +31 -0
- package/template/components/ui/action-stack.tsx +42 -0
- package/template/components/ui/badge.tsx +43 -0
- package/template/components/ui/button.tsx +104 -0
- package/template/components/ui/icon.tsx +78 -0
- package/template/components/ui/index.ts +28 -0
- package/template/components/ui/input.tsx +376 -0
- package/template/components/ui/loader.tsx +78 -0
- package/template/components/ui/metric-bar.tsx +49 -0
- package/template/components/ui/modal.tsx +177 -0
- package/template/components/ui/select.tsx +458 -0
- package/template/components/ui/stepper.tsx +96 -0
- package/template/components/ui/tab.tsx +85 -0
- package/template/components/ui/user-table.tsx +806 -0
- package/template/eslint.config.mjs +18 -0
- package/template/knowledge-base/design-system/components/action-stack.mdc +17 -0
- package/template/knowledge-base/design-system/components/badges.mdc +16 -0
- package/template/knowledge-base/design-system/components/buttons.mdc +21 -0
- package/template/knowledge-base/design-system/components/detail-header.mdc +17 -0
- package/template/knowledge-base/design-system/components/dropdowns.mdc +12 -0
- package/template/knowledge-base/design-system/components/info-list.mdc +17 -0
- package/template/knowledge-base/design-system/components/inputs.mdc +23 -0
- package/template/knowledge-base/design-system/components/menu.mdc +20 -0
- package/template/knowledge-base/design-system/components/modals.mdc +24 -0
- package/template/knowledge-base/design-system/components/selects.mdc +39 -0
- package/template/knowledge-base/design-system/components/stepper.mdc +18 -0
- package/template/knowledge-base/design-system/components/tables.mdc +59 -0
- package/template/knowledge-base/design-system/components/tabs.mdc +17 -0
- package/template/knowledge-base/design-system/components.mdc +91 -0
- package/template/knowledge-base/design-system/tokens.mdc +24 -0
- package/template/knowledge-base/examples/bad/README.md +8 -0
- package/template/knowledge-base/examples/good/README.md +13 -0
- package/template/knowledge-base/metadata/catalog.yaml +245 -0
- package/template/knowledge-base/patterns/components/reuse-existing.mdc +26 -0
- package/template/knowledge-base/patterns/data-fetching/local-data.mdc +20 -0
- package/template/knowledge-base/patterns/layouts/app-shell.mdc +20 -0
- package/template/knowledge-base/patterns/pages/data-table-page.mdc +31 -0
- package/template/knowledge-base/patterns/pages/workflow-page.mdc +27 -0
- package/template/knowledge-base/rules/accessibility/responsive.mdc +31 -0
- package/template/knowledge-base/rules/architecture/layout.mdc +52 -0
- package/template/knowledge-base/rules/architecture/single-screen.mdc +62 -0
- package/template/knowledge-base/rules/code-quality/jsx.mdc +19 -0
- package/template/knowledge-base/rules/global/naming.mdc +12 -0
- package/template/knowledge-base/rules/global/technology.mdc +19 -0
- package/template/knowledge-base/rules/global/ui-copy.mdc +20 -0
- package/template/knowledge-base/rules/performance/client.mdc +20 -0
- package/template/knowledge-base/rules/ui/information-density.mdc +36 -0
- package/template/knowledge-base/rules/ui/interaction.mdc +47 -0
- package/template/knowledge-base/rules/ui/simple-ui.mdc +58 -0
- package/template/knowledge-base/validation/accessibility.mdc +13 -0
- package/template/knowledge-base/validation/architecture.mdc +10 -0
- package/template/knowledge-base/validation/ast-grep/do-what-brooooooklyn-said.yml +15 -0
- package/template/knowledge-base/validation/ast-grep/no-nested-links.yml +12 -0
- package/template/knowledge-base/validation/ast-grep/rewrite-svg-attribute.yml +19 -0
- package/template/knowledge-base/validation/code-quality.mdc +18 -0
- package/template/knowledge-base/validation/performance.mdc +11 -0
- package/template/knowledge-base/validation/ui.mdc +26 -0
- package/template/next.config.ts +21 -0
- package/template/package-lock.json +6938 -0
- package/template/package.json +30 -0
- package/template/postcss.config.mjs +7 -0
- package/template/public/identity/full_logo_black.svg +27 -0
- package/template/public/identity/full_logo_color.svg +38 -0
- package/template/public/identity/full_logo_white.svg +34 -0
- package/template/public/identity/logo_icon_black.svg +6 -0
- package/template/public/identity/logo_icon_color.svg +13 -0
- package/template/public/identity/logo_icon_white.svg +13 -0
- package/template/public/login-hero.png +0 -0
- package/template/sgconfig.yml +11 -0
- package/template/tsconfig.json +43 -0
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
# Index for every agent (Cursor, Claude, Codex, Copilot). Rule text stays in `path`.
|
|
2
|
+
# Component inventory is `components/*/index.ts`, not this file.
|
|
3
|
+
# `load: ui` — open when editing `app/**` or `components/**`. Omit `load` = demand (match `description`).
|
|
4
|
+
# `open:` — after opening that entry's `path`, also open these paths. Do not copy rule text here.
|
|
5
|
+
# `design-system/components/*.mdc` here are extra rules only.
|
|
6
|
+
|
|
7
|
+
files:
|
|
8
|
+
- path: knowledge-base/rules/global/naming.mdc
|
|
9
|
+
description: Naming conventions for product code
|
|
10
|
+
alwaysApply: false
|
|
11
|
+
kind: rules
|
|
12
|
+
scope: global
|
|
13
|
+
|
|
14
|
+
- path: knowledge-base/rules/global/technology.mdc
|
|
15
|
+
description: Project technology stack
|
|
16
|
+
globs: [app/**/*.tsx, components/**/*.tsx]
|
|
17
|
+
alwaysApply: false
|
|
18
|
+
kind: rules
|
|
19
|
+
scope: global
|
|
20
|
+
|
|
21
|
+
- path: knowledge-base/rules/global/ui-copy.mdc
|
|
22
|
+
description: UI copy rules — all user-facing text in French
|
|
23
|
+
globs: [app/**/*.tsx, components/**/*.tsx]
|
|
24
|
+
alwaysApply: false
|
|
25
|
+
priority: medium
|
|
26
|
+
tags: [copy, text, label, error, empty-state, language, french]
|
|
27
|
+
kind: rules
|
|
28
|
+
scope: global
|
|
29
|
+
|
|
30
|
+
- path: knowledge-base/rules/architecture/layout.mdc
|
|
31
|
+
description: Global layout rules
|
|
32
|
+
load: ui
|
|
33
|
+
globs: [app/**/*.tsx]
|
|
34
|
+
alwaysApply: false
|
|
35
|
+
priority: high
|
|
36
|
+
tags: [layout, page, grid, container]
|
|
37
|
+
kind: rules
|
|
38
|
+
scope: architecture
|
|
39
|
+
|
|
40
|
+
- path: knowledge-base/rules/architecture/single-screen.mdc
|
|
41
|
+
description: One page = one screen — no global page scroll
|
|
42
|
+
globs: [app/**/*.tsx, components/**/*.tsx]
|
|
43
|
+
alwaysApply: false
|
|
44
|
+
priority: high
|
|
45
|
+
tags: [ux, single-screen, no-scroll, non-expert, layout, visibility]
|
|
46
|
+
kind: rules
|
|
47
|
+
scope: architecture
|
|
48
|
+
|
|
49
|
+
- path: knowledge-base/rules/ui/simple-ui.mdc
|
|
50
|
+
description: Simple, uncluttered UI for non-expert users
|
|
51
|
+
load: ui
|
|
52
|
+
globs: [app/**/*.tsx, components/**/*.tsx]
|
|
53
|
+
alwaysApply: false
|
|
54
|
+
priority: high
|
|
55
|
+
tags: [ux, simplicity, clarity, layout, non-expert, overlap]
|
|
56
|
+
kind: rules
|
|
57
|
+
scope: ui
|
|
58
|
+
|
|
59
|
+
- path: knowledge-base/rules/ui/information-density.mdc
|
|
60
|
+
description: Information density — each fact appears once
|
|
61
|
+
globs: [app/**/*.tsx, components/**/*.tsx]
|
|
62
|
+
alwaysApply: false
|
|
63
|
+
priority: medium
|
|
64
|
+
tags: [ux, density, dashboard, information, readability]
|
|
65
|
+
kind: rules
|
|
66
|
+
scope: ui
|
|
67
|
+
|
|
68
|
+
- path: knowledge-base/rules/ui/interaction.mdc
|
|
69
|
+
description: Keyboard, focus, forms and status cues for non-expert users
|
|
70
|
+
globs: [app/**/*.tsx, components/**/*.tsx]
|
|
71
|
+
alwaysApply: false
|
|
72
|
+
priority: high
|
|
73
|
+
tags: [ux, interaction, keyboard, focus, form, a11y]
|
|
74
|
+
kind: rules
|
|
75
|
+
scope: ui
|
|
76
|
+
|
|
77
|
+
- path: knowledge-base/rules/accessibility/responsive.mdc
|
|
78
|
+
description: Responsive design rules
|
|
79
|
+
globs: [app/**/*.tsx, components/**/*.tsx]
|
|
80
|
+
alwaysApply: false
|
|
81
|
+
priority: high
|
|
82
|
+
tags: [responsive, mobile, tablet, desktop, accessible]
|
|
83
|
+
kind: rules
|
|
84
|
+
scope: accessibility
|
|
85
|
+
|
|
86
|
+
- path: knowledge-base/rules/code-quality/jsx.mdc
|
|
87
|
+
description: JSX constraints already scanned by ast-grep
|
|
88
|
+
globs: [app/**/*.tsx, components/**/*.tsx]
|
|
89
|
+
alwaysApply: false
|
|
90
|
+
priority: high
|
|
91
|
+
tags: [jsx, tsx, ast-grep, react, code-quality]
|
|
92
|
+
kind: rules
|
|
93
|
+
scope: global
|
|
94
|
+
|
|
95
|
+
- path: knowledge-base/rules/performance/client.mdc
|
|
96
|
+
description: Client performance — existing stack, motion, wrapper and Honey constraints
|
|
97
|
+
globs: [app/**/*.tsx, components/**/*.tsx]
|
|
98
|
+
alwaysApply: false
|
|
99
|
+
priority: medium
|
|
100
|
+
tags: [performance, bundle, motion, honey]
|
|
101
|
+
kind: rules
|
|
102
|
+
scope: global
|
|
103
|
+
|
|
104
|
+
- path: knowledge-base/design-system/tokens.mdc
|
|
105
|
+
description: Enterprise Design System
|
|
106
|
+
load: ui
|
|
107
|
+
globs: [app/**/*.tsx, components/**/*.tsx]
|
|
108
|
+
alwaysApply: false
|
|
109
|
+
priority: high
|
|
110
|
+
tags: [design, system, component, consistency]
|
|
111
|
+
kind: design-system
|
|
112
|
+
|
|
113
|
+
- path: knowledge-base/design-system/components.mdc
|
|
114
|
+
description: Component reuse, location and page composition
|
|
115
|
+
load: ui
|
|
116
|
+
globs: [app/**/*.tsx, components/**/*.tsx]
|
|
117
|
+
alwaysApply: false
|
|
118
|
+
priority: high
|
|
119
|
+
tags: [component, reusable, props]
|
|
120
|
+
kind: design-system
|
|
121
|
+
|
|
122
|
+
- path: knowledge-base/design-system/components/buttons.mdc
|
|
123
|
+
description: Button component and usage
|
|
124
|
+
alwaysApply: false
|
|
125
|
+
priority: high
|
|
126
|
+
tags: [button, buttons, component, ui, design-system]
|
|
127
|
+
kind: design-system
|
|
128
|
+
|
|
129
|
+
- path: knowledge-base/design-system/components/badges.mdc
|
|
130
|
+
description: Badge component and usage
|
|
131
|
+
alwaysApply: false
|
|
132
|
+
priority: high
|
|
133
|
+
tags: [badge, status, component, ui, design-system]
|
|
134
|
+
kind: design-system
|
|
135
|
+
|
|
136
|
+
- path: knowledge-base/design-system/components/dropdowns.mdc
|
|
137
|
+
description: Dropdown behavior — only one dropdown open at a time
|
|
138
|
+
alwaysApply: false
|
|
139
|
+
priority: medium
|
|
140
|
+
tags: [dropdown, select, menu, filter]
|
|
141
|
+
kind: design-system
|
|
142
|
+
|
|
143
|
+
- path: knowledge-base/design-system/components/tabs.mdc
|
|
144
|
+
description: Tabbed navigation component and usage
|
|
145
|
+
alwaysApply: false
|
|
146
|
+
priority: high
|
|
147
|
+
tags: [tabs, navigation, pages, component, ui, design-system]
|
|
148
|
+
kind: design-system
|
|
149
|
+
|
|
150
|
+
- path: knowledge-base/design-system/components/selects.mdc
|
|
151
|
+
description: Select with search component and usage
|
|
152
|
+
alwaysApply: false
|
|
153
|
+
priority: high
|
|
154
|
+
tags: [select, dropdown, search, form, field, ui, component]
|
|
155
|
+
kind: design-system
|
|
156
|
+
|
|
157
|
+
- path: knowledge-base/design-system/components/tables.mdc
|
|
158
|
+
description: Table rules — one table per page, fixed header, pagination
|
|
159
|
+
alwaysApply: false
|
|
160
|
+
priority: high
|
|
161
|
+
tags: [table, dashboard, data, pagination, filter, list]
|
|
162
|
+
kind: design-system
|
|
163
|
+
|
|
164
|
+
- path: knowledge-base/design-system/components/inputs.mdc
|
|
165
|
+
description: Input component and usage
|
|
166
|
+
alwaysApply: false
|
|
167
|
+
priority: high
|
|
168
|
+
tags: [input, form, field, search, ui, component]
|
|
169
|
+
kind: design-system
|
|
170
|
+
|
|
171
|
+
- path: knowledge-base/design-system/components/modals.mdc
|
|
172
|
+
description: Modal component and usage
|
|
173
|
+
alwaysApply: false
|
|
174
|
+
priority: high
|
|
175
|
+
tags: [modal, dialog, component, ui, design-system]
|
|
176
|
+
kind: design-system
|
|
177
|
+
|
|
178
|
+
- path: knowledge-base/design-system/components/stepper.mdc
|
|
179
|
+
description: Stepper — visual lifecycle of a request or case
|
|
180
|
+
globs: [app/**/*.tsx, components/**/*.tsx]
|
|
181
|
+
alwaysApply: false
|
|
182
|
+
priority: high
|
|
183
|
+
tags: [stepper, workflow, lifecycle, component, ui, design-system]
|
|
184
|
+
kind: design-system
|
|
185
|
+
|
|
186
|
+
- path: knowledge-base/design-system/components/action-stack.mdc
|
|
187
|
+
description: Action stack — contextual buttons for the current state of a record
|
|
188
|
+
globs: [app/**/*.tsx, components/**/*.tsx]
|
|
189
|
+
alwaysApply: false
|
|
190
|
+
priority: high
|
|
191
|
+
tags: [actions, buttons, workflow, component, ui, design-system]
|
|
192
|
+
kind: design-system
|
|
193
|
+
|
|
194
|
+
- path: knowledge-base/design-system/components/detail-header.mdc
|
|
195
|
+
description: Detail header — identity strip of a fiche
|
|
196
|
+
globs: [app/**/*.tsx, components/**/*.tsx]
|
|
197
|
+
alwaysApply: false
|
|
198
|
+
priority: high
|
|
199
|
+
tags: [header, fiche, detail, component, shared, design-system]
|
|
200
|
+
kind: design-system
|
|
201
|
+
|
|
202
|
+
- path: knowledge-base/design-system/components/info-list.mdc
|
|
203
|
+
description: InfoList — label/value rows inside InfoCard
|
|
204
|
+
globs: [app/**/*.tsx, components/**/*.tsx]
|
|
205
|
+
alwaysApply: false
|
|
206
|
+
priority: medium
|
|
207
|
+
tags: [infolist, card, fiche, component, shared]
|
|
208
|
+
kind: design-system
|
|
209
|
+
|
|
210
|
+
- path: knowledge-base/design-system/components/menu.mdc
|
|
211
|
+
description: Menu component behavior and responsive states
|
|
212
|
+
alwaysApply: false
|
|
213
|
+
priority: high
|
|
214
|
+
tags: [menu, navigation, sidebar, component, ui]
|
|
215
|
+
kind: design-system
|
|
216
|
+
|
|
217
|
+
patterns:
|
|
218
|
+
- id: data-table-page
|
|
219
|
+
path: knowledge-base/patterns/pages/data-table-page.mdc
|
|
220
|
+
description: How this repo implements a list page
|
|
221
|
+
open:
|
|
222
|
+
- knowledge-base/design-system/components/tables.mdc
|
|
223
|
+
- id: workflow-page
|
|
224
|
+
path: knowledge-base/patterns/pages/workflow-page.mdc
|
|
225
|
+
description: How this repo implements a workflow / dossier page
|
|
226
|
+
open:
|
|
227
|
+
- knowledge-base/design-system/components/stepper.mdc
|
|
228
|
+
- knowledge-base/design-system/components/action-stack.mdc
|
|
229
|
+
- knowledge-base/design-system/components/detail-header.mdc
|
|
230
|
+
- id: reuse-existing
|
|
231
|
+
path: knowledge-base/patterns/components/reuse-existing.mdc
|
|
232
|
+
description: Reuse an existing component
|
|
233
|
+
- id: local-data
|
|
234
|
+
path: knowledge-base/patterns/data-fetching/local-data.mdc
|
|
235
|
+
description: Local demo data
|
|
236
|
+
- id: app-shell
|
|
237
|
+
path: knowledge-base/patterns/layouts/app-shell.mdc
|
|
238
|
+
description: App shell / chrome
|
|
239
|
+
|
|
240
|
+
validation:
|
|
241
|
+
- path: knowledge-base/validation/architecture.mdc
|
|
242
|
+
- path: knowledge-base/validation/ui.mdc
|
|
243
|
+
- path: knowledge-base/validation/performance.mdc
|
|
244
|
+
- path: knowledge-base/validation/accessibility.mdc
|
|
245
|
+
- path: knowledge-base/validation/code-quality.mdc
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
alwaysApply: true
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Pattern: reuse existing components
|
|
6
|
+
|
|
7
|
+
How this repository builds UI.
|
|
8
|
+
|
|
9
|
+
## Use when
|
|
10
|
+
|
|
11
|
+
The task needs a button, field, select, table, badge, modal, tab, icon or layout block.
|
|
12
|
+
|
|
13
|
+
## Good
|
|
14
|
+
|
|
15
|
+
- `components/ui/index.ts`
|
|
16
|
+
- `components/layout/index.ts`
|
|
17
|
+
- `components/shared/index.ts`
|
|
18
|
+
|
|
19
|
+
## Do not
|
|
20
|
+
|
|
21
|
+
- Recreate a primitive that already exists in those indexes.
|
|
22
|
+
- Invent a component because it has no `.mdc`.
|
|
23
|
+
|
|
24
|
+
## Constraints
|
|
25
|
+
|
|
26
|
+
See `knowledge-base/design-system/components.mdc`. Do not copy it here.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Pattern: local data
|
|
2
|
+
|
|
3
|
+
How this repository supplies list and detail data.
|
|
4
|
+
|
|
5
|
+
## Use when
|
|
6
|
+
|
|
7
|
+
A page needs a list, a detail record, or derived demo data.
|
|
8
|
+
|
|
9
|
+
## Good
|
|
10
|
+
|
|
11
|
+
- `app/projects/projects-data.ts`
|
|
12
|
+
- `app/equipment/equipment-data.ts`
|
|
13
|
+
- `app/infrastructure/infrastructure-data.ts`
|
|
14
|
+
|
|
15
|
+
## Do not
|
|
16
|
+
|
|
17
|
+
- Add an API, a client `fetch`, or a new data library for these demo modules.
|
|
18
|
+
- Duplicate the same dataset in the page file.
|
|
19
|
+
|
|
20
|
+
Large generated sets use a fixed seed so server and client stay identical.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Pattern: app shell
|
|
2
|
+
|
|
3
|
+
How this repository wraps pages.
|
|
4
|
+
|
|
5
|
+
## Use when
|
|
6
|
+
|
|
7
|
+
Adding or changing a page that must sit in the application chrome.
|
|
8
|
+
|
|
9
|
+
## Good
|
|
10
|
+
|
|
11
|
+
- `components/layout/app-layout.tsx`
|
|
12
|
+
- `app/layout.tsx`
|
|
13
|
+
|
|
14
|
+
## Do not
|
|
15
|
+
|
|
16
|
+
- Recreate a header, side menu or page frame in the page file.
|
|
17
|
+
|
|
18
|
+
## Constraints
|
|
19
|
+
|
|
20
|
+
Scroll and page types: `knowledge-base/rules/architecture/layout.mdc`. Do not copy them here.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Pattern: data-table page
|
|
2
|
+
|
|
3
|
+
How this repository implements a page that displays a large dataset.
|
|
4
|
+
|
|
5
|
+
## Use when
|
|
6
|
+
|
|
7
|
+
A page displays a list or table as its main content.
|
|
8
|
+
|
|
9
|
+
## Module
|
|
10
|
+
|
|
11
|
+
- One list page = one entity.
|
|
12
|
+
- Related records (runs, events, incidents…) go on `/[id]`, not as extra list tabs.
|
|
13
|
+
- Good: `app/projects/page.tsx` + `app/projects/[id]/page.tsx`.
|
|
14
|
+
|
|
15
|
+
## Good
|
|
16
|
+
|
|
17
|
+
- `app/projects/page.tsx`
|
|
18
|
+
- `app/equipment/page.tsx`
|
|
19
|
+
- `app/infrastructure/page.tsx`
|
|
20
|
+
- `app/tables/page.tsx`
|
|
21
|
+
- `components/ui/user-table.tsx`
|
|
22
|
+
|
|
23
|
+
## Do not
|
|
24
|
+
|
|
25
|
+
- Create a new table implementation.
|
|
26
|
+
- Show more than one table at a time.
|
|
27
|
+
- Put more than one entity's list on the list page (tabs or not).
|
|
28
|
+
|
|
29
|
+
## Constraints
|
|
30
|
+
|
|
31
|
+
Catalog `open:` loads `tables.mdc`. `layout.mdc` is `load: ui`. Do not copy them here.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Pattern: workflow / dossier page
|
|
2
|
+
|
|
3
|
+
How this repository implements a page that processes one record.
|
|
4
|
+
|
|
5
|
+
## Use when
|
|
6
|
+
|
|
7
|
+
The operator must understand one request or case, see its lifecycle, and take
|
|
8
|
+
the next action. Not a list, not a dashboard table.
|
|
9
|
+
|
|
10
|
+
## Good
|
|
11
|
+
|
|
12
|
+
- `app/change-request/page.tsx`
|
|
13
|
+
- `components/ui/stepper.tsx`
|
|
14
|
+
- `components/ui/action-stack.tsx`
|
|
15
|
+
- `components/shared/detail-header.tsx`
|
|
16
|
+
- `components/shared/info-card.tsx` (`InfoList` `layout="stacked"`)
|
|
17
|
+
- `components/shared/timeline-list.tsx`
|
|
18
|
+
|
|
19
|
+
## Do not
|
|
20
|
+
|
|
21
|
+
- Use `UserTable` as the main surface.
|
|
22
|
+
- Copy stepper / action-stack / fiche-header JSX into the page file.
|
|
23
|
+
- Force the dashboard "summary + one table" / no-page-scroll shape.
|
|
24
|
+
|
|
25
|
+
## Constraints
|
|
26
|
+
|
|
27
|
+
Catalog `open:` loads stepper / action-stack / detail-header. `layout.mdc` and `components.mdc` are `load: ui`. Do not copy them here.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Responsive design rules
|
|
3
|
+
globs: app/**/*.tsx,components/**/*.tsx
|
|
4
|
+
alwaysApply: false
|
|
5
|
+
priority: high
|
|
6
|
+
tags: [responsive, mobile, tablet, desktop, accessible]
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Responsive
|
|
10
|
+
|
|
11
|
+
- Adapt the interface to small screens.
|
|
12
|
+
|
|
13
|
+
- Adapt the interface to tablets.
|
|
14
|
+
|
|
15
|
+
- Adapt the interface to large screens.
|
|
16
|
+
|
|
17
|
+
## Reflow and small screens
|
|
18
|
+
|
|
19
|
+
- Under the `md` breakpoint (viewport width < 896px), when the layout reflows
|
|
20
|
+
(elements stack vertically because of the resize), the page MUST become
|
|
21
|
+
scrollable: all elements must remain reachable. No data or element may be
|
|
22
|
+
clipped or hidden. Scroll rules and implementation: see
|
|
23
|
+
`knowledge-base/rules/architecture/layout.mdc` and `components/layout/app-layout.tsx`.
|
|
24
|
+
- Under the same breakpoint, tables MUST transform into stacked cards carrying
|
|
25
|
+
ALL the column values of their rows (visible, or revealed by the card
|
|
26
|
+
in-place toggle): no hidden column, no horizontal
|
|
27
|
+
scroll. See `knowledge-base/design-system/components/tables.mdc` and `components/ui/user-table.tsx`.
|
|
28
|
+
- At `md+`, the global vertical page scroll is allowed on non-dashboard pages
|
|
29
|
+
when the content genuinely requires it, while dashboard pages still fit the
|
|
30
|
+
viewport and never scroll (rules: see `knowledge-base/rules/architecture/layout.mdc`).
|
|
31
|
+
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Global layout rules
|
|
3
|
+
globs: app/**/*.tsx
|
|
4
|
+
alwaysApply: false
|
|
5
|
+
priority: high
|
|
6
|
+
tags: [layout, page, grid, container]
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Layout
|
|
10
|
+
|
|
11
|
+
This file is the single technical reference for the scroll rules.
|
|
12
|
+
`knowledge-base/rules/accessibility/responsive.mdc` and `knowledge-base/rules/architecture/single-screen.mdc`
|
|
13
|
+
state the rule and refer here; the `<main>` implementation details live in the
|
|
14
|
+
comment inside `components/layout/app-layout.tsx`.
|
|
15
|
+
|
|
16
|
+
- Favor a contained interface — no global page scroll on dashboard and compact-detail
|
|
17
|
+
pages; workflow / dossier and other pages may use page scroll when the content
|
|
18
|
+
genuinely requires it.
|
|
19
|
+
|
|
20
|
+
- Use a container only on large screens.
|
|
21
|
+
|
|
22
|
+
- Remove the container on medium and small screens.
|
|
23
|
+
|
|
24
|
+
- ## Page Types and Scroll Behavior
|
|
25
|
+
|
|
26
|
+
Classify the page by its job, then apply the matching block. Example of a
|
|
27
|
+
workflow / dossier: `app/change-request/page.tsx`.
|
|
28
|
+
|
|
29
|
+
### Dashboard, list, and compact-detail pages
|
|
30
|
+
|
|
31
|
+
List or summary+table (`/`, `/projects`, `/equipment`, `/infrastructure`,
|
|
32
|
+
`/interventions`, `/research`, `/infrastructure/incidents`) and compact tabbed
|
|
33
|
+
detail (`/equipment/[id]`, `/projects/[id]`, `/infrastructure/[id]`,
|
|
34
|
+
`/infrastructure/incidents/[id]`).
|
|
35
|
+
|
|
36
|
+
- At `md+`, the page MUST NOT create or allow page-level vertical scrolling.
|
|
37
|
+
- At `md+`, internal component scrolling is allowed when the component
|
|
38
|
+
content requires it.
|
|
39
|
+
- Below `md`, page-level vertical scrolling is allowed.
|
|
40
|
+
- Below `md`, internal component scrolling MUST NOT be used.
|
|
41
|
+
- On mobile, overflowing content MUST remain reachable through page-level
|
|
42
|
+
scrolling.
|
|
43
|
+
|
|
44
|
+
### Workflow / dossier and other pages
|
|
45
|
+
|
|
46
|
+
One record to process (stepper, details, contextual actions), plus pages
|
|
47
|
+
such as `/change-request`, `/tables`, `/design-system`.
|
|
48
|
+
|
|
49
|
+
- Page-level vertical scrolling is allowed when the content genuinely
|
|
50
|
+
requires it.
|
|
51
|
+
- Internal component scrolling may be used when appropriate.
|
|
52
|
+
- Avoid unnecessary nested scrolling.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: One page = one screen — no global page scroll, secondary info via in-place toggling
|
|
3
|
+
globs: app/**/*.tsx, components/**/*.tsx
|
|
4
|
+
alwaysApply: false
|
|
5
|
+
priority: high
|
|
6
|
+
tags: [ux, single-screen, no-scroll, non-expert, layout, visibility]
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Single Screen — "1 page = 1 screen"
|
|
10
|
+
|
|
11
|
+
The application targets users with little experience of information
|
|
12
|
+
systems: the essential information should be immediately visible and
|
|
13
|
+
easy to understand without unnecessary navigation or scrolling.
|
|
14
|
+
|
|
15
|
+
- Scroll behavior is defined exclusively in
|
|
16
|
+
`knowledge-base/rules/architecture/layout.mdc`.
|
|
17
|
+
- The main information must be visible and understandable at a glance,
|
|
18
|
+
without requiring prior interaction.
|
|
19
|
+
- Dashboard pages should preserve a coherent single-screen view at `md+`.
|
|
20
|
+
Workflow / dossier pages follow **Other pages** in `layout.mdc` (page scroll
|
|
21
|
+
when the content requires it).
|
|
22
|
+
- When the amount of information exceeds the available space, do not
|
|
23
|
+
automatically extend a **dashboard or compact-detail** page. Organize, prioritize, condense, or
|
|
24
|
+
progressively reveal secondary information while keeping the main view
|
|
25
|
+
clear and coherent.
|
|
26
|
+
- The interface should preserve access to secondary information without
|
|
27
|
+
unnecessarily breaking the user's context or forcing them to navigate
|
|
28
|
+
to another page.
|
|
29
|
+
- Choose the organization pattern according to the content, hierarchy,
|
|
30
|
+
interaction needs, and available space. Do not treat any specific
|
|
31
|
+
component or pattern as mandatory.
|
|
32
|
+
- Possible patterns include, but are not limited to:
|
|
33
|
+
- tabs or segmented views;
|
|
34
|
+
- expandable or collapsible sections;
|
|
35
|
+
- contextual panels or drawers;
|
|
36
|
+
- modals;
|
|
37
|
+
- pagination;
|
|
38
|
+
- search and filtering;
|
|
39
|
+
- compact data organization;
|
|
40
|
+
- progressive disclosure;
|
|
41
|
+
- component-level scrolling when permitted by the global layout rules;
|
|
42
|
+
- or another existing Design System pattern that better preserves
|
|
43
|
+
clarity and coherence.
|
|
44
|
+
- Prefer reusing existing components and established Design System
|
|
45
|
+
patterns rather than introducing a new interaction pattern without need.
|
|
46
|
+
- Do not add interactions merely to avoid scrolling. The chosen pattern
|
|
47
|
+
must make the information easier to understand and access.
|
|
48
|
+
- Prefer compact cards and tables and avoid large empty areas
|
|
49
|
+
(see `knowledge-base/rules/ui/information-density.mdc`).
|
|
50
|
+
- Use direct, simple vocabulary adapted to non-expert users
|
|
51
|
+
(see `knowledge-base/rules/global/ui-copy.mdc`).
|
|
52
|
+
|
|
53
|
+
## References
|
|
54
|
+
|
|
55
|
+
See:
|
|
56
|
+
- `knowledge-base/rules/architecture/layout.mdc` (scroll rules, technical source)
|
|
57
|
+
- `app/page.tsx`
|
|
58
|
+
- `app/change-request/page.tsx` (workflow / dossier; may page-scroll)
|
|
59
|
+
- `components/layout/app-layout.tsx`
|
|
60
|
+
- `components/ui/user-table.tsx`
|
|
61
|
+
- `components/ui/tab.tsx`
|
|
62
|
+
- `components/ui/modal.tsx`
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: JSX constraints already scanned by ast-grep
|
|
3
|
+
globs: app/**/*.tsx, components/**/*.tsx
|
|
4
|
+
alwaysApply: false
|
|
5
|
+
priority: high
|
|
6
|
+
tags: [jsx, tsx, ast-grep, react, code-quality]
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# JSX
|
|
10
|
+
|
|
11
|
+
`sg:scan` only proves these structural facts. UX, copy and scroll stay in `knowledge-base/validation/` + the agent. Catalog origin: https://ast-grep.github.io/catalog/tsx/
|
|
12
|
+
|
|
13
|
+
How to detect: `knowledge-base/validation/code-quality.mdc`.
|
|
14
|
+
|
|
15
|
+
- Do not use `$A && $B` inside a JSX expression (except in a `className` / attribute). Write `{$A ? $B : null}`.
|
|
16
|
+
- Do not nest `<a>` inside `<a>`.
|
|
17
|
+
- Hyphenated SVG attributes in JSX must be camelCase. Do not rename valid React `aria-*` / `data-*`.
|
|
18
|
+
|
|
19
|
+
Do not apply catalog auto-fixes (`ast-grep scan -U`) on existing app JSX.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Naming conventions for product code
|
|
3
|
+
alwaysApply: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Naming
|
|
7
|
+
|
|
8
|
+
Do not put agent/planning vocabulary into the product codebase.
|
|
9
|
+
|
|
10
|
+
- Avoid planning words in file names, exports, components, routes, API paths and UI copy.
|
|
11
|
+
- Use domain and product terminology instead.
|
|
12
|
+
- Planning vocabulary is allowed only inside implementation documents.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Project technology stack
|
|
3
|
+
globs: app/**/*.tsx,components/**/*.tsx
|
|
4
|
+
alwaysApply: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Technology
|
|
8
|
+
|
|
9
|
+
- Stack: Next.js 16 (App Router), React 19, TypeScript 5, Tailwind CSS 4.
|
|
10
|
+
`package.json` is the source of truth for the exact versions.
|
|
11
|
+
|
|
12
|
+
- Icons: `lucide-react` is the only icon library. Always use it through the
|
|
13
|
+
existing `Icon` component (`components/ui/icon.tsx`, exported from
|
|
14
|
+
`components/ui/index.ts`), picking only `name`, `variant` and `size`.
|
|
15
|
+
Never add another icon library.
|
|
16
|
+
|
|
17
|
+
- Animations: use the Tailwind CSS built-in animation and transition
|
|
18
|
+
utilities (`animate-*`, `transition-*`). Do not add an animation library
|
|
19
|
+
(e.g. framer-motion) or custom keyframes without developer validation.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: UI copy rules — all user-facing text in French, intuitive structure over redundant explanatory copy
|
|
3
|
+
globs: app/**/*.tsx,components/**/*.tsx
|
|
4
|
+
alwaysApply: false
|
|
5
|
+
priority: medium
|
|
6
|
+
tags: [copy, text, label, error, empty-state, language, french]
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# UI Copy
|
|
10
|
+
|
|
11
|
+
- All user-facing text is in French (the app's language): page titles, menu
|
|
12
|
+
items, labels, buttons, placeholders, helper texts, toasts, empty states and
|
|
13
|
+
error messages. Never generate English user-facing copy.
|
|
14
|
+
- Use direct, consistent vocabulary adapted to the user's level.
|
|
15
|
+
- Describe errors with the cause and the possible action to resolve them.
|
|
16
|
+
- Give empty states a short explanation and a useful next action.
|
|
17
|
+
- Prefer precise action labels over generic wording.
|
|
18
|
+
- Do not add pedagogical paragraphs that explain how to read the screen.
|
|
19
|
+
Structure, labels, empty states and errors are enough.
|
|
20
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Client performance — existing stack, motion, wrapper and Honey constraints
|
|
3
|
+
globs: app/**/*.tsx, components/**/*.tsx
|
|
4
|
+
alwaysApply: false
|
|
5
|
+
priority: medium
|
|
6
|
+
tags: [performance, bundle, motion, honey]
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Performance
|
|
10
|
+
|
|
11
|
+
No backend, no Core Web Vitals treatise. These constraints already live in the source files; this file is the topic index.
|
|
12
|
+
|
|
13
|
+
How to detect: `knowledge-base/validation/performance.mdc`.
|
|
14
|
+
|
|
15
|
+
- Do not add a second icon library. Use `lucide-react` through `Icon` only. Source: `knowledge-base/rules/global/technology.mdc`.
|
|
16
|
+
- Do not add an animation library or custom keyframes without developer validation. Use Tailwind `animate-*` / `transition-*`. Source: `knowledge-base/rules/global/technology.mdc`.
|
|
17
|
+
- Honor `prefers-reduced-motion`. Do not use `transition: all`. Source: `knowledge-base/rules/ui/interaction.mdc`.
|
|
18
|
+
- Do not add a wrapper that serves no layout or styling purpose. Source: `knowledge-base/design-system/components.mdc`.
|
|
19
|
+
- Do not wrap a value that never changes in `useMemo` or `useCallback`. Source: `knowledge-base/design-system/components.mdc`.
|
|
20
|
+
- Do not write code that need not exist. Source: `.cursor/rules/honey.mdc`.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Information density — each fact appears once (no duplicated values or counts), compact cards and tables
|
|
3
|
+
globs: app/**/*.tsx,components/**/*.tsx
|
|
4
|
+
alwaysApply: false
|
|
5
|
+
priority: medium
|
|
6
|
+
tags: [ux, density, dashboard, information, readability]
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Information Density
|
|
10
|
+
|
|
11
|
+
## Clarity over density
|
|
12
|
+
|
|
13
|
+
- Compact but readable: visual density is fine, information overload is not.
|
|
14
|
+
A page overloaded with information becomes unreadable for non-expert users
|
|
15
|
+
(see `knowledge-base/rules/ui/simple-ui.mdc`).
|
|
16
|
+
- Prefer compact cards. On dashboard and list pages, prefer compact tables.
|
|
17
|
+
|
|
18
|
+
- Limit the information displayed in a Card so that the user can easily remember its position.
|
|
19
|
+
|
|
20
|
+
- Give sections breathing room with consistent spacing, without creating
|
|
21
|
+
useless large empty areas.
|
|
22
|
+
|
|
23
|
+
## Information appears once
|
|
24
|
+
|
|
25
|
+
- Each fact must have a single visible location per screen: never show the
|
|
26
|
+
same value more than once (header + card + list = unnecessary repetition).
|
|
27
|
+
|
|
28
|
+
- When a value is already displayed in the page header or a filter, do not
|
|
29
|
+
repeat it inside the content.
|
|
30
|
+
|
|
31
|
+
- A count belongs only to the header of its own list/table and must not be
|
|
32
|
+
duplicated in summary cards.
|
|
33
|
+
|
|
34
|
+
- Prefer a single compact summary that links to the detail view over
|
|
35
|
+
duplicating the full data inline.
|
|
36
|
+
|