enterprise-ui-architect-cli 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.
Files changed (37) hide show
  1. package/assets/SKILL.md +590 -0
  2. package/assets/claude-skills/enterprise-ui-architect/SKILL.md +600 -0
  3. package/assets/data/accessibility-checks.csv +31 -0
  4. package/assets/data/anti-patterns.csv +55 -0
  5. package/assets/data/api-integration-patterns.csv +16 -0
  6. package/assets/data/charts.csv +26 -0
  7. package/assets/data/color-palettes.csv +21 -0
  8. package/assets/data/component-standards.csv +17 -0
  9. package/assets/data/data-source-strategies.csv +11 -0
  10. package/assets/data/industries.csv +16 -0
  11. package/assets/data/page-patterns.csv +9 -0
  12. package/assets/data/pre-delivery-checklist.csv +36 -0
  13. package/assets/data/review-rubric.csv +11 -0
  14. package/assets/data/styles.csv +16 -0
  15. package/assets/data/tokens.csv +89 -0
  16. package/assets/data/typography.csv +16 -0
  17. package/assets/scripts/search.py +241 -0
  18. package/assets/templates/base/quick-reference.md +123 -0
  19. package/assets/templates/base/skill-content.md +184 -0
  20. package/assets/templates/platforms/claude.json +19 -0
  21. package/assets/templates/platforms/codex.json +19 -0
  22. package/assets/templates/platforms/copilot.json +18 -0
  23. package/assets/templates/platforms/cursor.json +36 -0
  24. package/assets/templates/platforms/windsurf.json +26 -0
  25. package/dist/commands/init.d.ts +5 -0
  26. package/dist/commands/init.d.ts.map +1 -0
  27. package/dist/commands/init.js +182 -0
  28. package/dist/commands/init.js.map +1 -0
  29. package/dist/index.d.ts +3 -0
  30. package/dist/index.d.ts.map +1 -0
  31. package/dist/index.js +72 -0
  32. package/dist/index.js.map +1 -0
  33. package/dist/utils/template.d.ts +6 -0
  34. package/dist/utils/template.d.ts.map +1 -0
  35. package/dist/utils/template.js +9 -0
  36. package/dist/utils/template.js.map +1 -0
  37. package/package.json +36 -0
@@ -0,0 +1,590 @@
1
+ # Enterprise UI Architect
2
+
3
+ ## Description
4
+ This skill provides expert UI/UX and frontend architecture guidance for premium enterprise admin panels. It combines enterprise-inspired visual composition with MUI v7 component implementation, Ant Design-level engineering discipline, and design system intelligence.
5
+
6
+ ## When to Apply
7
+ Use this skill when:
8
+ - building admin dashboards with MUI
9
+ - building CRUD list pages with MUI + TanStack Table
10
+ - building complex forms with MUI + react-hook-form
11
+ - building detail pages with MUI
12
+ - building settings pages with MUI
13
+ - building wizard/multi-step forms with MUI
14
+ - building auth pages with MUI
15
+ - generating a complete design system for an admin product
16
+ - reviewing UI implementation quality
17
+ - refactoring tables, forms, cards, drawers, dialogs, sidebars, navbars
18
+ - improving visual polish
19
+ - improving MUI architecture
20
+ - enforcing design tokens
21
+ - checking accessibility and responsiveness
22
+
23
+ ## Core Philosophy
24
+ Premium enterprise admin panels are the visual reference.
25
+ MUI v7 is the implementation engine.
26
+ Ant Design principles guide the architecture.
27
+ Design system intelligence drives consistency.
28
+
29
+ Premium enterprise admin panels provide:
30
+ - premium admin dashboard feeling
31
+ - card composition
32
+ - sidebar/navbar inspiration
33
+ - layout hierarchy
34
+ - dashboard page rhythm
35
+ - polished status chips
36
+ - spacing inspiration
37
+ - visual hierarchy
38
+
39
+ MUI v7 provides:
40
+ - production-grade React components
41
+ - theme system with CSS variables
42
+ - emotion/styled styling
43
+ - accessibility baseline
44
+ - rtl support
45
+ - dense admin-friendly sizing
46
+
47
+ Ant Design principles provide:
48
+ - component API discipline
49
+ - TypeScript-first props
50
+ - predictable Form/Table patterns
51
+ - Drawer/Dialog usage rules
52
+ - design token thinking
53
+ - enterprise interaction quality
54
+ - reusable abstractions
55
+ - accessibility and state discipline
56
+
57
+ ## Design System Generation
58
+ When starting a new admin dashboard project, generate a design system first:
59
+
60
+ ```bash
61
+ python src/enterprise-ui-architect/scripts/search.py \
62
+ --query "fintech" \
63
+ --design-system \
64
+ --product "MyBank Admin" \
65
+ --format markdown
66
+ ```
67
+
68
+ The design system generator analyzes the industry and outputs:
69
+ - **Recommended Pattern** — page structure and CTA placement
70
+ - **Style Priority** — best matching UI styles for the industry
71
+ - **Color Palette** — primary, secondary, accent, semantic colors
72
+ - **Typography** — heading and body font pairings with Google Fonts imports
73
+ - **Key Effects** — animations, transitions, interactions
74
+ - **Anti-Patterns** — what NOT to do for this industry
75
+ - **Pre-Delivery Checklist** — validation before shipping
76
+
77
+ ### Persist Design System (Master + Overrides)
78
+
79
+ Save the generated design system for hierarchical retrieval across sessions:
80
+
81
+ ```bash
82
+ python src/enterprise-ui-architect/scripts/search.py \
83
+ --query "saas" \
84
+ --design-system \
85
+ --persist \
86
+ --product "MyApp"
87
+ ```
88
+
89
+ This creates:
90
+ ```
91
+ design-system/
92
+ ├── MASTER.md # Global Source of Truth
93
+ └── pages/
94
+ └── dashboard.md # Page-specific overrides
95
+ ```
96
+
97
+ When building a specific page, check for page overrides first, then fall back to MASTER.
98
+
99
+ ## Component Stack
100
+ - **UI Components**: `@mui/material` v7
101
+ - **Forms**: `react-hook-form` + `Controller`
102
+ - **Tables**: `@tanstack/react-table`
103
+ - **Styling**: MUI theme tokens + Tailwind utilities (secondary)
104
+ - **Icons**: Tabler Icons (`tabler-*` classes)
105
+ - **Validation**: `valibot` / `zod` via `@hookform/resolvers`
106
+ - **Charts**: Recharts / ApexCharts / MUI X-Charts
107
+ - **Data Fetching**: TanStack Query (preferred) or SWR
108
+ - **Real-Time**: WebSocket / STOMP / Socket.io / SSE
109
+ - **API Mocking**: MSW (Mock Service Worker) for development
110
+
111
+ ## Layout Architecture
112
+ Enterprise admin panels support configurable layout modes:
113
+
114
+ ### Skin Variants
115
+ - `default`: shadow-based cards and surfaces
116
+ - `bordered`: outlined cards with no shadow, border-driven aesthetics
117
+ - Set via `data-skin` attribute on layout wrapper
118
+ - Affects Card, Dialog, Drawer, Menu, Popover, Snackbar styling
119
+
120
+ ### Navbar Modes
121
+ - `fixed`: sticky header at top
122
+ - `floating`: rounded, shadowed, inset from edges
123
+ - `detached`: rounded bottom corners, scroll shadow
124
+ - `attached`: full-width, border-bottom
125
+ - `blur`: backdrop-filter blur on scroll
126
+ - Navbar content width: `compact` (1440px) or `wide` (full-bleed)
127
+
128
+ ### Sidebar
129
+ - Width: 260px expanded, 71px collapsed
130
+ - `semiDark`: dark sidebar in light mode via `data-dark` attribute
131
+ - Collapse behavior: hover to expand, toggle lock, breakpoint auto-collapse
132
+ - Scroll shadow overlay at top when scrolled
133
+
134
+ ### Content & Footer
135
+ - Content padding: 24px (`theme.spacing(6)`)
136
+ - Content max-width: 1440px in compact mode
137
+ - Footer: `detached` (rounded top, separate) or `attached` (full-width)
138
+ - Footer content width independent of main content width
139
+
140
+ ## Theme Augmentation
141
+ MUI v7 requires module augmentation for custom variants and theme properties:
142
+
143
+ ```typescript
144
+ // types.ts
145
+ import '@mui/material/Button';
146
+ import '@mui/material/Chip';
147
+ import '@mui/material/Pagination';
148
+
149
+ declare module '@mui/material/Button' {
150
+ interface ButtonPropsVariantOverrides {
151
+ tonal: true;
152
+ }
153
+ }
154
+ declare module '@mui/material/Chip' {
155
+ interface ChipPropsVariantOverrides {
156
+ tonal: true;
157
+ }
158
+ }
159
+ declare module '@mui/material/Pagination' {
160
+ interface PaginationPropsVariantOverrides {
161
+ tonal: true;
162
+ }
163
+ }
164
+ ```
165
+
166
+ Custom theme properties:
167
+ ```typescript
168
+ declare module '@mui/material/styles' {
169
+ interface Theme {
170
+ customShadows: {
171
+ xs: string; sm: string; md: string; lg: string; xl: string;
172
+ primarySm: string; primaryMd: string; primaryLg: string;
173
+ successSm: string; errorSm: string; warningSm: string; infoSm: string;
174
+ };
175
+ mainColorChannels: {
176
+ light: string; dark: string; lightShadow: string; darkShadow: string;
177
+ };
178
+ }
179
+ interface Shape {
180
+ customBorderRadius: { xs: number; sm: number; md: number; lg: number; xl: number };
181
+ }
182
+ }
183
+ ```
184
+
185
+ ## Next.js Setup
186
+ For Next.js App Router with MUI v7:
187
+
188
+ ```tsx
189
+ import { AppRouterCacheProvider } from '@mui/material-nextjs/v14-appRouter';
190
+ import { ThemeProvider } from '@mui/material/styles';
191
+ import CssBaseline from '@mui/material/CssBaseline';
192
+ import { createTheme } from '@mui/material/styles';
193
+
194
+ const theme = createTheme({
195
+ cssVariables: { colorSchemeSelector: 'data' },
196
+ colorSchemes: { light: { palette: { ... } }, dark: { palette: { ... } } },
197
+ // ...other config
198
+ });
199
+
200
+ export default function RootLayout({ children }) {
201
+ return (
202
+ <AppRouterCacheProvider>
203
+ <ThemeProvider theme={theme}>
204
+ <CssBaseline />
205
+ {children}
206
+ </ThemeProvider>
207
+ </AppRouterCacheProvider>
208
+ );
209
+ }
210
+ ```
211
+
212
+ Key setup points:
213
+ - Always use `AppRouterCacheProvider` from `@mui/material-nextjs`
214
+ - Always render `CssBaseline` inside `ThemeProvider`
215
+ - Use `cssVariables: { colorSchemeSelector: 'data' }` for data-attribute theming
216
+ - Build theme config first, then pass to `createTheme()`
217
+ - Use `slotProps` instead of legacy `InputProps` / `InputLabelProps`
218
+
219
+ ## Industry-Specific Reasoning
220
+ The skill includes reasoning rules for 15 admin panel industries:
221
+
222
+ | Industry | Pattern | Style Priority | Color Mood |
223
+ |---|---|---|---|
224
+ | SaaS / B2B | Feature-Rich Dashboard + Onboarding | Bento Grid, Minimalism, Soft UI | Corporate blue + white + accent |
225
+ | Fintech / Banking | Data-Dense Dashboard + Transaction Table | Minimalism, Dark Mode, Glassmorphism | Deep navy + emerald + gold |
226
+ | Healthcare | Patient List + Appointment Calendar | Minimalism, Accessible, Soft UI | Soft teal + white + warm gray |
227
+ | E-commerce Admin | Order Management + Inventory Grid | Bento Grid, Data-Dense | Orange accent + white + dark sidebar |
228
+ | Logistics | Map + Shipment Tracker + Fleet Table | Real-Time Monitoring, Glassmorphism | Deep blue + bright cyan + amber |
229
+ | HR / People | Employee Directory + Org Chart | Minimalism, Soft UI, Bento Grid | Warm purple + soft gray + white |
230
+ | CRM / Sales | Pipeline Board + Contact List | Bento Grid, Soft UI | Electric blue + white + warm gray |
231
+ | ERP / Manufacturing | Production Dashboard + Inventory | Data-Dense, Executive | Industrial gray + safety orange |
232
+ | Education | Course List + Student Progress | Minimalism, Accessible, Soft UI | Academic blue + warm white |
233
+ | Government | Case Management + Document List | Minimalism, Accessible, Flat | Official blue + white + gray |
234
+ | Cybersecurity | Alert Feed + Threat Map | Dark Mode, HUD Sci-Fi | Deep black + alert red + cyber cyan |
235
+ | Real Estate | Property Grid + Map + Lead Pipeline | Bento Grid, Soft UI | Premium navy + gold accent |
236
+ | Energy | Grid Monitor + Meter Readings | Real-Time Monitoring, Data-Dense | Power blue + grid yellow + outage red |
237
+ | Media | Asset Library + Editorial Calendar | Minimalism, Bento Grid | Dark charcoal + vibrant accent |
238
+ | Nonprofit | Donor CRM + Campaign Tracker | Soft UI, Accessible, Minimalism | Hope blue + growth green + warm white |
239
+
240
+ Generate industry-specific guidance with:
241
+ ```bash
242
+ python scripts/search.py --query "fintech" --domain industries -n 1
243
+ ```
244
+
245
+ ## UI Styles for Admin Dashboards
246
+ The skill includes 15 admin-appropriate UI styles:
247
+
248
+ | Style | Best For | Suitability |
249
+ |---|---|---|
250
+ | Minimalism & Swiss Style | Enterprise dashboards, documentation | 10/10 |
251
+ | Bento Box Grid | Admin dashboards, analytics, widgets | 10/10 |
252
+ | Dark Mode (OLED) | DevOps, cybersecurity, night operations | 9/10 |
253
+ | Soft UI Evolution | HR, healthcare, wellness, support | 9/10 |
254
+ | Glassmorphism | Financial dashboards, premium SaaS | 7/10 |
255
+ | Data-Dense Dashboard | Trading, ERP, manufacturing, power users | 10/10 |
256
+ | Executive Dashboard | C-suite, board meetings, high-level KPIs | 8/10 |
257
+ | Real-Time Monitoring | DevOps, IoT, logistics, network ops | 9/10 |
258
+ | Accessible & Inclusive | Government, healthcare, education | 10/10 |
259
+ | AI-Native UI | AI platforms, chatbots, copilot admin | 7/10 |
260
+
261
+ Search styles with:
262
+ ```bash
263
+ python scripts/search.py --query "minimal" --domain styles -n 3
264
+ ```
265
+
266
+ ## Color Palette Selection
267
+ 20 admin-specific color palettes are included, matched to industries:
268
+
269
+ ```bash
270
+ python scripts/search.py --query "fintech" --domain color-palettes -n 3
271
+ ```
272
+
273
+ Each palette includes: primary, secondary, accent, success, warning, error, info, background, text colors.
274
+
275
+ ## Typography Pairing
276
+ 15 curated font pairings for admin UIs:
277
+
278
+ ```bash
279
+ python scripts/search.py --query "clean" --domain typography -n 3
280
+ ```
281
+
282
+ Each pairing includes: heading font, body font, Google Fonts imports, mood description, best-for industries.
283
+
284
+ ## Chart Selection for Dashboards
285
+ 25 chart types mapped to admin use cases:
286
+
287
+ ```bash
288
+ python scripts/search.py --query "revenue" --domain charts -n 5
289
+ ```
290
+
291
+ Common admin chart patterns:
292
+ - **Revenue/Growth**: Line Chart, Area Chart, Sparkline
293
+ - **Comparisons**: Bar Chart, Grouped Bar, Horizontal Bar
294
+ - **Proportions**: Donut Chart, Pie Chart, Treemap
295
+ - **Real-time**: Gauge Chart, Metric Cards, Live Counter
296
+ - **Project/Timeline**: Gantt Chart, Timeline
297
+ - **Geographic**: Map, Choropleth
298
+ - **Correlation**: Scatter Plot, Heatmap
299
+
300
+ ## Pre-Delivery Checklist
301
+ Every page must pass these checks before shipping:
302
+
303
+ ### Universal Checks (All Pages)
304
+ - [ ] All interactive elements have hover states and cursor-pointer
305
+ - [ ] Focus states are visible and consistent
306
+ - [ ] No emojis as icons — only SVG or icon font
307
+ - [ ] Text contrast meets 4.5:1 minimum
308
+ - [ ] prefers-reduced-motion respected
309
+ - [ ] Responsive at 375px, 768px, 1024px, 1440px
310
+ - [ ] Loading states for all async operations
311
+ - [ ] Empty states for every list/table/grid
312
+ - [ ] Error states with helpful messages
313
+ - [ ] Browser back button works for filter/sort/page state
314
+
315
+ ### Page-Specific Checks
316
+ - **CRUD List**: Table row actions keyboard accessible, pagination updates URL, search debounced 300-500ms
317
+ - **Complex Form**: Dirty form confirmation, submit disabled while invalid, sections collapse on mobile
318
+ - **Dashboard**: Skeleton screens not spinners, charts have loading/empty states, auto-refresh reasonable
319
+ - **Detail**: Back navigation returns to correct list state, related data lazy-loaded
320
+ - **Settings**: Sections save independently or explicit global save, toggles have immediate feedback
321
+ - **Wizard**: Step validation prevents forward, progress indicator visible, summary review before submit
322
+ - **Auth**: Password visibility toggle, first input focused on load
323
+
324
+ Run checklist validation:
325
+ ```bash
326
+ python scripts/search.py --query "crud-list" --domain pre-delivery-checklist -n 10
327
+ ```
328
+
329
+ ## Expert Panel
330
+ The assistant must internally review decisions from these expert roles:
331
+ 1. UI/UX Architect
332
+ 2. Design System Architect
333
+ 3. MUI Component Reviewer
334
+ 4. Frontend Implementation Reviewer
335
+ 5. Accessibility Reviewer
336
+ 6. Cursor Codebase Reviewer
337
+
338
+ Do not output fake panel discussion unless requested.
339
+ Use the panel to improve the final answer.
340
+
341
+ ## Required Codebase Inspection
342
+ Before editing code:
343
+ 1. Detect stack: React, Next.js, Vite, Vue, Nuxt, TypeScript, JavaScript.
344
+ 2. Detect styling: CSS Modules, SCSS, Tailwind, Emotion, styled-components, CSS variables, tokens.
345
+ 3. Detect MUI version if present.
346
+ 4. Search for existing:
347
+ - PageLayout
348
+ - Card wrapper
349
+ - Table abstraction
350
+ - Form abstraction
351
+ - Drawer/Dialog helpers
352
+ - StatusChip/Badge
353
+ - theme tokens
354
+ - sidebar/navbar components
355
+ 5. Reuse existing conventions.
356
+ 6. Do not introduce unnecessary abstractions.
357
+
358
+ ## Backend Data Detection & Integration
359
+ Before building any chart table or form the assistant must detect the data source:
360
+
361
+ ### Detection Rules
362
+ 1. **Check for backend presence**: Look for `package.json` proxy, `vite.config.ts` proxy, `.env` API URLs, `openapi.yaml`, Swagger docs, Spring Boot repo, NestJS repo, or existing API calls in the codebase.
363
+ 2. **Check for real-time endpoints**: Look for WebSocket, STOMP, Socket.io, SSE, or GraphQL subscription configurations.
364
+ 3. **Check for existing API layer**: Look for `api/`, `services/`, `hooks/` directories with fetch/axios/TanStack Query usage.
365
+
366
+ ### Decision Matrix
367
+ | Scenario | Frontend Approach | Mock Strategy | Real-Time |
368
+ |---|---|---|---|
369
+ | Backend exists + API documented | Connect real API immediately | None — use real data | WebSocket/STOMP/SSE or polling |
370
+ | Backend exists + API not documented | Explore endpoints reverse engineer | MSW with discovered endpoints | Polling fallback |
371
+ | Backend in development not ready | MSW or json-server with agreed contract | MSW browser + server worker | Simulated polling |
372
+ | No backend frontend-first | json-server or localStorage mock | json-server db.json | Simulated polling |
373
+ | Backend unstable | Retry logic + circuit breaker | MSW fallback mode | Cached data + stale indicator |
374
+
375
+ ### Chart + Backend Integration
376
+ When building charts with backend data:
377
+ - Always use TanStack Query `useQuery` to fetch chart data
378
+ - Map API response to chart format in `select` option or adapter function
379
+ - Use `staleTime` and `refetchInterval` for real-time dashboards
380
+ - Show loading skeletons (not spinners) while chart data loads
381
+ - Show error state with retry button on API failure
382
+ - Use `placeholderData` to show previous data while refetching
383
+
384
+ ### Mock Data Strategy
385
+ When backend is not available:
386
+ - **MSW (preferred)**: Mock REST/GraphQL endpoints at network level. Share mock contract with backend team.
387
+ - **json-server**: Full fake REST API for rapid prototyping.
388
+ - **localStorage**: Simple persistence for demo data.
389
+ - **Never**: Hardcode mock data inside chart components or pages.
390
+
391
+ ### Real-Time Data Patterns
392
+ | Backend Stack | Frontend Pattern |
393
+ |---|---|
394
+ | Spring Boot + STOMP | SockJS + STOMP.js + Zustand/TanStack Query |
395
+ | Node.js + Socket.io | Socket.io-client + event-driven store |
396
+ | Any + SSE | EventSource with reconnect polyfill |
397
+ | Any + polling | TanStack Query `refetchInterval` |
398
+ | GraphQL + subscriptions | Apollo Client subscriptions or TanStack Query polling |
399
+
400
+ ## Operating Modes
401
+ Support these modes:
402
+ - Implementation
403
+ - Review
404
+ - Refactor
405
+ - Planning / Architecture
406
+ - Design System Generation
407
+ - Data Source Integration
408
+ - Cursor Prompt Generation
409
+
410
+ ## Page Pattern Mapping
411
+ Include detailed guidance for:
412
+ - CRUD List Page
413
+ - Complex Form Page
414
+ - Dashboard Page
415
+ - Detail Page
416
+ - Settings Page
417
+ - Wizard Page
418
+ - Auth Page
419
+ - Blank Layout
420
+
421
+ For each page type, include:
422
+ - Visual pattern
423
+ - MUI architectural equivalent
424
+ - reusable components
425
+ - required states
426
+ - accessibility requirements
427
+ - responsive behavior
428
+ - anti-patterns
429
+
430
+ ## Drawer vs Dialog vs Page Rules
431
+ Use Dialog for:
432
+ - delete confirmation
433
+ - simple yes/no confirmation
434
+ - small focused form
435
+
436
+ Use Drawer for:
437
+ - quick create
438
+ - quick edit
439
+ - advanced filters
440
+ - record preview
441
+ - side details
442
+
443
+ Use full page for:
444
+ - complex forms
445
+ - multi-section edit
446
+ - workflows
447
+ - heavy validation
448
+ - wizard-like creation
449
+
450
+ Never put complex multi-section forms inside a small dialog.
451
+
452
+ ## Table Standard
453
+ Every production table should use `@tanstack/react-table` and support:
454
+ - typed column config via `createColumnHelper`
455
+ - stable row keys
456
+ - sorting
457
+ - filtering (faceted + global)
458
+ - search (debounced 500ms)
459
+ - pagination via MUI `Pagination` (`shape='rounded'` `variant='tonal'`)
460
+ - server-side pagination when needed
461
+ - loading state
462
+ - empty state
463
+ - error state
464
+ - row actions via `OptionMenu`
465
+ - optional bulk actions via `rowSelection`
466
+ - status chips via MUI `Chip` (`variant='tonal'`)
467
+ - formatted date/number values
468
+ - responsive behavior (horizontal scroll)
469
+ - accessible headers
470
+ - controlled filter/sort/page state
471
+ - header height 56px, body row height 50px
472
+ - horizontal borders only, no vertical borders
473
+ - first/last column padding 24px, internal columns 16px
474
+
475
+ ## Form Standard
476
+ Every production form should use `react-hook-form` and support:
477
+ - typed values via `defaultValues` generic
478
+ - validation rules (inline or schema via resolver)
479
+ - field-level errors via `formState.errors`
480
+ - helper text under fields
481
+ - required indicators
482
+ - submit loading via `CircularProgress` in button
483
+ - disabled state
484
+ - cancel/reset via `reset()`
485
+ - dirty state protection
486
+ - responsive field grid via MUI `Grid` (`spacing={6}`)
487
+ - logical sections separated by `Divider` + `Typography` headers
488
+ - accessible labels (`htmlFor` on label)
489
+ - success/error feedback
490
+ - MUI `TextField` with label-above-input pattern (`slotProps={{ inputLabel: { shrink: true, style: { transform: 'none' } } }}`)
491
+ - focus state: 2px border + `primary-sm` shadow
492
+ - start adornments for icons via `InputAdornment` in `slotProps={{ input: { startAdornment: ... } }}`
493
+
494
+ ## Theme and Styling Standard
495
+ Prefer:
496
+ - MUI theme tokens (`theme.palette`, `theme.spacing`, `theme.shape`)
497
+ - CSS variables via MUI `cssVariables`
498
+ - shared spacing scale (`theme.spacing(factor)`)
499
+ - shared typography scale (`theme.typography`)
500
+ - semantic color roles (`primary`, `success`, `warning`, `error`, `info`)
501
+ - reusable variants (`contained`, `tonal`, `outlined`)
502
+ - Tailwind utilities for layout/flex/grid only
503
+ - `slotProps` over legacy `InputProps` / `InputLabelProps`
504
+
505
+ Avoid:
506
+ - random hex colors
507
+ - random margins
508
+ - random font sizes
509
+ - inconsistent border radius
510
+ - one-off shadows
511
+ - heavy inline `sx` props on generic primitives
512
+ - business-specific styling inside generic UI primitives
513
+ - using `item` prop on MUI v7 `Grid`
514
+
515
+ ## Keyboard Navigation
516
+ MUI components require specific keyboard patterns:
517
+
518
+ | Component | Keyboard Pattern |
519
+ |---|---|
520
+ | Autocomplete | Arrow keys navigate, Enter selects, Escape clears, Home/End in popup |
521
+ | Select | Space opens, arrows navigate, Enter selects, typeahead supported |
522
+ | Tabs | Left/Right arrows change tabs (not Tab key); Tab enters panel content |
523
+ | Accordion | Enter/Space toggles; arrows move between headers |
524
+ | Slider | Arrow keys adjust by step; Home/End to min/max; PageUp/PageDown |
525
+ | Switch | Space toggles (not Enter) |
526
+ | RadioGroup | Arrow keys change selection; Tab enters group |
527
+ | DatePicker | Arrow keys navigate calendar; PageUp/PageDown for months |
528
+ | Menu | Arrow keys navigate items; Escape closes; Enter activates |
529
+ | Dialog | Escape closes; Tab traps focus; Return focus to trigger on close |
530
+
531
+ ## Review Output Format
532
+ When reviewing implementation, always output:
533
+
534
+ ### 1. Verdict
535
+ Choose:
536
+ - Excellent
537
+ - Good but needs refinement
538
+ - Visually acceptable but structurally weak
539
+ - Not production-ready
540
+ - Needs redesign
541
+
542
+ ### 2. Premium Admin Visual Alignment
543
+ Evaluate:
544
+ - layout
545
+ - cards
546
+ - spacing
547
+ - dashboard feel
548
+ - sidebar/navbar consistency
549
+ - hierarchy
550
+ - table/form presentation
551
+
552
+ ### 3. MUI Architecture Alignment
553
+ Evaluate:
554
+ - component API
555
+ - reusable abstractions
556
+ - typed props
557
+ - form architecture (RHF + Controller)
558
+ - table architecture (TanStack + MUI Pagination)
559
+ - drawer/dialog usage
560
+ - theme/token usage
561
+ - predictable states
562
+
563
+ ### 4. Main Problems
564
+ For each:
565
+ - what is wrong
566
+ - why it matters
567
+ - how to fix it
568
+
569
+ ### 5. Production Readiness Score
570
+ Score 1-10:
571
+ - Premium Admin Visual Quality
572
+ - MUI Architecture Quality
573
+ - Component Reusability
574
+ - Form Quality
575
+ - Table Quality
576
+ - State Handling
577
+ - Responsiveness
578
+ - Accessibility
579
+ - Maintainability
580
+ - Production Readiness
581
+
582
+ ### 6. Exact Fix Plan
583
+ Step-by-step practical fixes.
584
+
585
+ ### 7. Final Decision
586
+ Choose:
587
+ - approve
588
+ - approve with minor changes
589
+ - request changes
590
+ - reject and redesign