@neuctra/ui-mcp 0.3.1 → 0.4.2

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/README.md CHANGED
@@ -36,8 +36,8 @@ generated from your actual TypeScript source. No guessing, no file-spelunking.
36
36
  neuctra-ui-package/src/components/basic/*.tsx (your actual component source)
37
37
  │
38
38
  │ npm run registry:generate (ts-morph reads props/JSDoc/defaults,
39
- │ scrapes one example per component
40
- │ from neuctra-ui-docs)
39
+ │ scrapes one description + example per
40
+ │ component from neuctra-ui-docs-v2)
41
41
  ▼
42
42
  neuctra-ui-package/registry/components.json (source of truth)
43
43
  │
@@ -47,14 +47,14 @@ neuctra-ui-mcp/data/components.json (this package's local copy)
47
47
  │
48
48
  │ read once at server startup
49
49
  ▼
50
- neuctra-ui-mcp/src/server.mjs (defines 4 MCP tools over that data)
50
+ neuctra-ui-mcp/src/server.mjs (defines 5 MCP tools over that data)
51
51
  │
52
52
  │ spoken over stdio (stdin/stdout), JSON-RPC under the hood
53
53
  ▼
54
54
  Claude Code / Cursor / Antigravity / any MCP client
55
55
  ```
56
56
 
57
- Two independently-regenerable files feed the server:
57
+ Three independently-regenerable files feed the server:
58
58
 
59
59
  - **`data/components.json`** — synced from `neuctra-ui-package/registry/components.json`.
60
60
  Never edit this by hand; run `npm run sync-registry` after the upstream file changes.
@@ -64,6 +64,13 @@ Two independently-regenerable files feed the server:
64
64
  the color-token rules ("never hardcode colors"), the anti-AI-look rules ("no
65
65
  gradients/shadows/blurs/glows/emoji-icons"), the recommended `@neuctra/ui-cli init`
66
66
  setup command, and how the standalone `toast()` API works.
67
+ - **`data/aiDesignRules.json`** — also hand-curated, no generator. A 51-section
68
+ product/UX design guide (design philosophy, visual hierarchy, page/sidebar/navigation
69
+ structure, per-component usage guidance, spacing/color/border/radius/shadow
70
+ conventions, responsive design, accessibility, and a final UI quality checklist).
71
+ `theme.json`'s `rules`/`antiAiLookRules` are the mechanical, CSS-level rules; this file
72
+ is the higher-level product-design layer — both are served together by
73
+ `get_design_rules`.
67
74
 
68
75
  ---
69
76
 
@@ -81,14 +88,45 @@ The host starts your server as a subprocess and talks to it over **stdio** — y
81
88
  server's stdout carries JSON-RPC messages, not human-readable logs (that's why
82
89
  `bin/cli.mjs` prints nothing except protocol traffic; use `console.error`, never
83
90
  `console.log`, if you ever add debug output). On connect, the client asks "what tools do
84
- you have?", gets back the 4 tool definitions below, and adds them to the AI's available
91
+ you have?", gets back the 5 tool definitions below, and adds them to the AI's available
85
92
  actions — the same way the tools listed in *this* conversation's system prompt work.
86
93
  From then on, the AI decides on its own when a tool call would help, calls it, and reads
87
94
  the result back into its context before continuing.
88
95
 
89
96
  ---
90
97
 
91
- ## 4. The four tools, in detail
98
+ ## 4. Recommended workflow
99
+
100
+ The tools are designed to be called in roughly this order when generating UI, not
101
+ grabbed ad hoc:
102
+
103
+ 1. **`get_design_rules`** — call this first, before picking any component. It returns
104
+ the styling rules, the anti-AI-look rules, and the 51-section product/UX guide. This
105
+ shapes *what* to build (hierarchy, when a group actually needs `Card`, when `Modal`
106
+ vs `Drawer`, etc.) before you start reaching for components.
107
+ 2. **`get_theme`** — call alongside step 1, not instead of it. Tokens without the design
108
+ rules just tell you which colors exist, not how to use them well.
109
+ 3. **`list_components`** (filtered by category) or **`search_components`** (keyword) —
110
+ confirm which real components exist for what you need. This matters specifically
111
+ because the design guide can describe a *pattern* (e.g. a sidebar nav item) without
112
+ there being a dedicated component for it — don't assume one exists, confirm here.
113
+ 4. **`get_component`** — full spec for every component before writing code against it.
114
+ Do this every time you touch a component you haven't already pulled specs for in the
115
+ current conversation, not just once at the start. Never guess prop names from memory.
116
+ 5. **Write the UI**, applying the design rules, the tokens, and the exact props from
117
+ step 4.
118
+ 6. **Self-check** against the "Final UI Quality Checklist" section (§49, found by
119
+ its `number` field in `productDesignGuide.sections` — not by array index) and
120
+ `antiAiLookRules` from `get_design_rules` before considering the UI
121
+ done — reread them, don't just rely on having read them once at the start.
122
+
123
+ Steps 1–2 only need to happen once per session/task, not once per component — refetching
124
+ `get_theme`/`get_design_rules` for every single component would be wasteful. Step 4 is
125
+ the one that repeats for every new component.
126
+
127
+ ---
128
+
129
+ ## 5. The five tools, in detail
92
130
 
93
131
  ### `list_components`
94
132
 
@@ -157,36 +195,24 @@ state", "icon button". Matches against name, category, description, and prop nam
157
195
 
158
196
  ### `get_theme`
159
197
 
160
- Returns the semantic color token system, the styling rules for using it, and three more
161
- sections aimed squarely at making generated UI indistinguishable from a human design
162
- pass: a set of **anti-AI-look rules** (no gradients, no decorative shadows/blurs/glows,
163
- no emoji-as-icons — see below), a **setup** block pointing the AI at the
164
- `@neuctra/ui-cli` `init` command instead of hand-writing token CSS or a theme context,
165
- and a **toastNote** explaining the standalone `toast()` import. Without `get_theme`, an
166
- AI would happily write `className="bg-blue-500"` or reach for a purple-to-pink gradient
167
- hero, both of which ignore the consumer's actual theme and read as generic AI output.
198
+ Returns the semantic color token system: the token list itself, a **setup** block
199
+ pointing the AI at the `@neuctra/ui-cli` `init` command instead of hand-writing token CSS
200
+ or a theme context, and a **toastNote** explaining the standalone `toast()` import.
201
+ Without `get_theme`, an AI would happily write `className="bg-blue-500"`, ignoring the
202
+ consumer's actual theme. `get_theme` does **not** carry the design/anti-AI-look rules —
203
+ see `get_design_rules` below for those; call both together, not one instead of the other.
168
204
 
169
205
  **Response shape:**
170
206
  ```jsonc
171
207
  {
172
208
  "system": "Tailwind CSS v4, semantic CSS-variable tokens mapped via @theme, toggled by a .dark class...",
173
- "rules": [
174
- "Never use hardcoded Tailwind palette colors...",
175
- "Always use the semantic token classes below...",
176
- // ...
177
- ],
178
- "antiAiLookRules": [
179
- "No gradients on backgrounds, buttons, or text...",
180
- "No decorative box-shadows, drop-shadows, or glow effects...",
181
- "No backdrop-blur / glassmorphism...",
182
- // ...17 rules total — the visual tells that make UI read as AI-generated
183
- ],
184
209
  "tokens": [
185
210
  { "token": "primary", "className": "bg-primary / text-primary / border-primary",
186
211
  "pairsWith": "primary-foreground", "light": "#00c214", "dark": "#00c214",
187
212
  "usage": "Brand color: primary buttons, active states, links, focus accents." },
188
213
  // ...23 tokens total
189
214
  ],
215
+ "note": "Values shown are the CLI-generated defaults...",
190
216
  "setup": {
191
217
  "recommendedCommand": "npx @neuctra/ui-cli@latest init",
192
218
  "whatItDoes": ["Installs @neuctra/ui.", "Checks/upgrades React and Tailwind CSS.", "..."],
@@ -196,9 +222,52 @@ hero, both of which ignore the consumer's actual theme and read as generic AI ou
196
222
  }
197
223
  ```
198
224
 
225
+ ### `get_design_rules`
226
+
227
+ Returns every design rule generated UI must follow, at two levels: the mechanical
228
+ **`stylingRules`** (token usage, surface/background conventions, component composition
229
+ requirements — e.g. `CardBody` is compulsory whenever `Card` has body content, since
230
+ `Card` itself renders no padding — and component-specific gotchas like Dropdown's
231
+ trigger already stopping propagation internally) and **`antiAiLookRules`** (no
232
+ gradients/shadows/blurs/glows/emoji-icons/em-dashes — the visual tells that make UI read
233
+ as AI-generated), plus **`productDesignGuide`** — a 51-section product/UX design guide
234
+ covering design philosophy, visual hierarchy, page/sidebar/navigation structure,
235
+ per-component usage guidance (when to reach for `Card` vs plain whitespace, `Modal` vs
236
+ `Drawer`, `Table` vs `List`, etc.), spacing/color/border/radius/shadow conventions,
237
+ responsive design, accessibility, interaction design, and a final UI quality checklist.
238
+
239
+ Call this before generating any UI — see the recommended workflow above.
240
+
241
+ **Response shape (trimmed):**
242
+ ```jsonc
243
+ {
244
+ "stylingRules": [
245
+ "Theme colors only, compulsory, no exceptions...",
246
+ "Use the Card component, not a hand-rolled lookalike...",
247
+ // ...9 rules total
248
+ ],
249
+ "antiAiLookRules": [
250
+ "No gradients, compulsory...",
251
+ "No shadows, compulsory...",
252
+ "No blur effects, compulsory...",
253
+ // ...17 rules total
254
+ ],
255
+ "productDesignGuide": {
256
+ "title": "Neuctra UI — AI Design Rules",
257
+ "intro": "You are a senior product designer and frontend UI engineer using `@neuctra/ui`...",
258
+ "sections": [
259
+ { "number": 1, "title": "Core Design Philosophy", "content": "..." },
260
+ { "number": 7, "title": "Cards", "content": "..." },
261
+ // ...51 sections total
262
+ ],
263
+ "goldenRule": { "title": "Golden Rule", "content": "..." }
264
+ }
265
+ }
266
+ ```
267
+
199
268
  ---
200
269
 
201
- ## 5. Local development
270
+ ## 6. Local development
202
271
 
203
272
  ```bash
204
273
  npm install
@@ -208,14 +277,14 @@ npm start # runs the server on stdio — it will sit there silent
208
277
 
209
278
  `npm start` alone won't show you anything (it's waiting for a client to speak JSON-RPC
210
279
  to it, not for a human to type at it). To actually exercise it, either wire it into a
211
- real client (section 6) or write a small script using
280
+ real client (section 7) or write a small script using
212
281
  `@modelcontextprotocol/sdk`'s `Client` + `StdioClientTransport` to spawn `bin/cli.mjs`
213
282
  and call the tools programmatically — that's how this server was verified while building
214
283
  it.
215
284
 
216
285
  ---
217
286
 
218
- ## 6. Connecting it to a client
287
+ ## 7. Connecting it to a client
219
288
 
220
289
  All MCP clients use the same JSON shape — the differences are just *where* the config
221
290
  file lives.
@@ -256,7 +325,7 @@ Restart the client after editing its config — servers are only launched on sta
256
325
 
257
326
  ---
258
327
 
259
- ## 7. Keeping the registry in sync
328
+ ## 8. Keeping the registry in sync
260
329
 
261
330
  The registry is generated, not hand-maintained. Whenever a component's props change:
262
331
 
@@ -271,12 +340,14 @@ npm run sync-registry # copies the updated file in
271
340
  `registry:generate` also runs automatically as part of `neuctra-ui-package`'s
272
341
  `prepublishOnly`, and `sync-registry` runs automatically as part of this package's own
273
342
  `prepublishOnly` — so a normal `npm publish` in each package keeps things current without
274
- remembering these steps by hand. `data/theme.json` is the one file with no generator;
275
- edit it directly if the token set in `neuctra-ui-cli/lib/update-css.js` ever changes.
343
+ remembering these steps by hand. `data/theme.json` and `data/aiDesignRules.json` are the
344
+ two files with no generator; edit them directly — `theme.json` if the token set in
345
+ `neuctra-ui-cli/lib/update-css.js` ever changes or a rule needs adding, `aiDesignRules.json`
346
+ if the product-design guidance itself needs revising.
276
347
 
277
348
  ---
278
349
 
279
- ## 8. Publishing
350
+ ## 9. Publishing
280
351
 
281
352
  ```bash
282
353
  npm run sync-registry
@@ -285,25 +356,26 @@ npm publish --access public # --access public is required: scoped packages def
285
356
 
286
357
  ---
287
358
 
288
- ## 9. Project structure
359
+ ## 10. Project structure
289
360
 
290
361
  ```
291
362
  neuctra-ui-mcp/
292
363
  ├── bin/
293
364
  │ └── cli.mjs # entry point: connects the server to a stdio transport
294
365
  ├── src/
295
- │ └── server.mjs # defines the 4 tools and their handlers
366
+ │ └── server.mjs # defines the 5 tools and their handlers
296
367
  ├── scripts/
297
368
  │ └── sync-registry.mjs # copies registry/components.json from neuctra-ui-package
298
369
  ├── data/
299
370
  │ ├── components.json # synced (generated) — don't edit by hand
300
- │ └── theme.json # hand-curated token/rules data
371
+ │ ├── theme.json # hand-curated token + styling/anti-AI-look rules
372
+ │ └── aiDesignRules.json # hand-curated 51-section product/UX design guide
301
373
  └── package.json
302
374
  ```
303
375
 
304
376
  ---
305
377
 
306
- ## 10. Extending it
378
+ ## 11. Extending it
307
379
 
308
380
  To add a new tool (e.g. `get_example` returning just the code snippet, or
309
381
  `list_categories`), open `src/server.mjs` and add another `server.registerTool(...)`
@@ -0,0 +1,265 @@
1
+ {
2
+ "title": "Neuctra UI — AI Design Rules",
3
+ "intro": "You are a senior product designer and frontend UI engineer using `@neuctra/ui`.\n\nYour goal is NOT to simply place components on a page.\n\nYour goal is to create interfaces that feel:\n\n* Modern\n* Human-designed\n* Visually balanced\n* Clean\n* Calm\n* Premium\n* Product-focused\n* Easy to scan\n* Consistent\n* Responsive\n* Accessible\n* Intentional rather than template-generated\n\nUse `@neuctra/ui` components whenever an appropriate component exists.",
4
+ "sections": [
5
+ {
6
+ "number": 1,
7
+ "title": "Core Design Philosophy",
8
+ "content": "Every UI decision must have a reason.\n\nDo not generate interfaces by randomly combining components.\n\nThink in this order:\n\n1. What is the user's primary goal?\n2. What information is most important?\n3. What action should receive the most visual attention?\n4. What information can be grouped together?\n5. What should be visually secondary?\n6. What can be hidden until needed?\n7. Which component best communicates the purpose?\n\nPrefer:\n\n> hierarchy → spacing → grouping → interaction → decoration\n\nover:\n\n> components → colors → decoration\n\nThe interface should still look good even if all decorative elements are removed."
9
+ },
10
+ {
11
+ "number": 2,
12
+ "title": "Visual Hierarchy",
13
+ "content": "Every page must have a clear hierarchy.\n\nUse approximately:\n\n### Level 1 — Primary\n\nThe most important thing on the page.\n\nExamples:\n\n* Page title\n* Main dashboard metric\n* Primary action\n* Main content\n\nUse:\n\n* Large heading\n* Strong typography\n* Primary Button\n* Card when grouping is necessary\n\n### Level 2 — Secondary\n\nSupporting information.\n\nExamples:\n\n* Description\n* Secondary metrics\n* Filters\n* Supporting actions\n\nUse:\n\n* Text\n* Badge\n* Chip\n* Button\n* Card\n\n### Level 3 — Tertiary\n\nLow-priority information.\n\nExamples:\n\n* Metadata\n* timestamps\n* categories\n* hints\n* supporting labels\n\nUse:\n\n* muted text\n* Badge\n* Chip\n* Kbd\n* Tooltip\n\nNever make tertiary information visually compete with the primary content."
14
+ },
15
+ {
16
+ "number": 3,
17
+ "title": "Page Structure",
18
+ "content": "Use a predictable structure:\n\n```text\nPage\n ├── Page Header\n │ ├── Title\n │ ├── Description\n │ └── Primary Action\n │\n ├── Optional Context / Callout\n │\n ├── Filters / Controls\n │\n └── Main Content\n```\n\nDo not add every section automatically.\n\nIf the page does not need a Callout, Card, Badge, or Divider, do not use it.\n\nLess UI is often better UI."
19
+ },
20
+ {
21
+ "number": 4,
22
+ "title": "Sidebar Design",
23
+ "content": "The sidebar is navigation, not content.\n\nKeep it visually quiet.\n\n@neuctra/ui has no dedicated Navigation/Sidebar/NavLink component — hand-build nav items from Button's ghost or link variant (icon + label), Text for section labels, and Divider for grouping.\n\nRecommended structure:\n\n```text\nLogo / Product\nVersion\n\nMain Navigation\n\nSection Label\nNavigation items\n\nSection Label\nNavigation items\n\nResources\n\nAbout\n```\n\nUse:\n\n* Button (ghost/link variant) for primary navigation links\n* Text for section labels/grouping\n* Badge for small status/version information\n* Icon Button for compact actions\n* Tooltip when labels are hidden\n* Divider only when separation improves scanning\n\nDo not:\n\n* Put large cards inside the sidebar\n* Use excessive borders\n* Use multiple competing accent colors\n* Put descriptions beside every navigation item\n* Turn every navigation item into a Badge or Chip\n* Add decorative illustrations unnecessarily\n\nThe sidebar should support the page, not dominate it."
24
+ },
25
+ {
26
+ "number": 5,
27
+ "title": "Navigation Grouping",
28
+ "content": "Group navigation according to the user's mental model. 'Navigation items' here means hand-built links (Button ghost/link variant), not a dedicated component — see the note in the Sidebar Design section.\n\nFor example:\n\n```text\nGetting Started\n\nOverview\nFull Setup Guide\nTheme Toggle\n\nAI & Integrations\n\nNeuctra UI MCP\n\nLayout & Structure\n\nContainer\nCard\nDivider\n\nTypography & Media\n\nText\nImage\nAvatar\nAvatar Group\nBadge\nChip\nKbd\n```\n\nSection labels should be:\n\n* Small\n* Muted\n* Uppercase or subtle typography\n* Visually separated from navigation items\n\nDo not over-group.\n\nA section should contain enough related items to justify the heading."
29
+ },
30
+ {
31
+ "number": 6,
32
+ "title": "Navigation Item Rules",
33
+ "content": "Navigation items (hand-built from Button's ghost/link variant — there is no dedicated Navigation component) should have:\n\n* Clear label\n* Optional icon\n* Strong hover state\n* Obvious active state\n* Comfortable click target\n\nRecommended hierarchy:\n\n```text\nInactive:\nmuted foreground\n\nHover:\nsubtle background\n\nActive:\nprimary-tinted background\nprimary/strong foreground\n```\n\nAvoid making every item look like a Button.\n\nNavigation should visually feel different from action controls."
34
+ },
35
+ {
36
+ "number": 7,
37
+ "title": "Cards",
38
+ "content": "Use `Card` when content represents a meaningful visual group.\n\nGood:\n\n```text\nCard\n ├── CardHeader (optional)\n ├── CardBody (compulsory whenever there's body content)\n └── CardFooter (optional)\n```\n\n`Card` itself renders no padding — it's just the border/background/radius shell. All spacing lives in `CardHeader`/`CardBody`/`CardFooter`. Content placed directly inside `<Card>` without `<CardBody>` renders flush against the border with no padding and visibly breaks the layout, so once you've decided to use Card, wrapping its body content in `<CardBody>` is not optional the way `CardHeader`/`CardFooter` are.\n\nUse Cards for:\n\n* Dashboard statistics\n* Settings groups\n* Product previews\n* Related information\n* Independent content blocks\n\nDo NOT wrap everything in Cards.\n\nAvoid:\n\n```text\nPage\n └── Card\n └── Card\n └── Card\n```\n\nNested cards should be rare.\n\nIf content is already visually grouped by whitespace, a Card may not be necessary."
39
+ },
40
+ {
41
+ "number": 8,
42
+ "title": "Container",
43
+ "content": "Use `Container` to control readable page width.\n\nPrefer:\n\n```text\nFull viewport\n └── Container\n └── Content\n```\n\nDo not allow text-heavy interfaces to become excessively wide.\n\nFor documentation:\n\n* Keep reading width comfortable.\n* Allow code examples to use more horizontal space.\n* Keep navigation independent from the reading column."
44
+ },
45
+ {
46
+ "number": 9,
47
+ "title": "Divider",
48
+ "content": "Use `Divider` only when whitespace is insufficient to communicate separation.\n\nPrefer:\n\n```text\nSection\n\nlarge spacing\n\nNext Section\n```\n\nover:\n\n```text\nSection\n────────────\nNext Section\n```\n\nUse Dividers primarily for:\n\n* Navigation groups\n* Dense settings\n* Table-like layouts\n* Clearly separated sections\n\nDo not place Dividers everywhere."
49
+ },
50
+ {
51
+ "number": 10,
52
+ "title": "Typography",
53
+ "content": "Typography should create hierarchy without requiring excessive decoration.\n\nRecommended hierarchy:\n\n```text\nPage title\n↓\nSection title\n↓\nComponent title\n↓\nBody text\n↓\nMetadata\n```\n\nUse:\n\n* Strong weight for headings\n* Regular weight for descriptions\n* `text-secondary` for paragraphs and descriptions\n* Muted color for metadata\n* Comfortable line-height for reading\n\nAvoid:\n\n* Excessive bold text\n* Too many font sizes\n* All-caps body text\n* Huge headings on every page\n* Centering everything"
54
+ },
55
+ {
56
+ "number": 11,
57
+ "title": "Badge",
58
+ "content": "Use `Badge` for compact semantic information.\n\nGood:\n\n```text\nv1.0\nNew\nBeta\nActive\nDeprecated\nSuccess\nWarning\n```\n\nBad:\n\n```text\nEvery navigation item\nEvery card\nEvery paragraph\nEvery heading\n```\n\nA Badge should communicate information, not decoration."
59
+ },
60
+ {
61
+ "number": 12,
62
+ "title": "Chip",
63
+ "content": "Use `Chip` for lightweight categories or selectable labels.\n\nGood:\n\n```text\nReact\nTailwind\nTypeScript\nFrontend\nDesign\n```\n\nUse Chip when users may perceive the value as a category, filter, or tag.\n\nDo not use Badge and Chip interchangeably."
64
+ },
65
+ {
66
+ "number": 13,
67
+ "title": "Button",
68
+ "content": "Buttons represent actions.\n\nHierarchy:\n\n```text\nPrimary Button\nSecondary Button\nTertiary / subtle Button\nDestructive Button\n```\n\nEvery page should generally have one visually dominant primary action, when an important action exists.\n\nAvoid having multiple primary buttons competing with each other.\n\nExample:\n\n```text\nCreate Project ← Primary\n\nImport Export ← Secondary\n```"
69
+ },
70
+ {
71
+ "number": 14,
72
+ "title": "Icon Button",
73
+ "content": "Use `Icon Button` when the action is universally understandable from the icon or when space is limited.\n\nGood examples:\n\n* Close\n* Search\n* Settings\n* More\n* Edit\n* Delete\n* Copy\n* Previous\n* Next\n\nUse `Tooltip` when an icon's meaning is not immediately obvious.\n\nNever sacrifice usability for minimalism."
74
+ },
75
+ {
76
+ "number": 15,
77
+ "title": "Input / Form Components",
78
+ "content": "Forms should feel calm and structured.\n\nRecommended:\n\n```text\nForm Section\n ├── Label\n ├── Input\n ├── Description\n └── Error\n```\n\nGroup related fields.\n\nDo not place every field in a separate Card.\n\nUse:\n\n* Input for text\n* Textarea for long text\n* Select for predefined options\n* Checkbox for independent choices\n* RadioGroup for mutually exclusive choices\n* Switch for immediate on/off settings\n* Slider for ranges\n* Number Input for numeric values\n* Date Picker for dates\n* Time Picker for times\n* File Upload for files"
79
+ },
80
+ {
81
+ "number": 16,
82
+ "title": "Modal",
83
+ "content": "Use Modal for focused decisions or short tasks.\n\nGood:\n\n* Confirm deletion\n* Create item\n* Edit item\n* Important settings\n* Focused forms\n\nDo not use Modal for:\n\n* Long documentation\n* Large dashboards\n* Complex workflows\n* Information that deserves its own page\n\nIf the content requires significant scrolling, consider a page or Drawer instead."
84
+ },
85
+ {
86
+ "number": 17,
87
+ "title": "Drawer",
88
+ "content": "Use Drawer for contextual content that should remain connected to the current page.\n\nGood:\n\n* Filters\n* Detail views\n* Editing\n* Mobile navigation\n* Secondary settings\n\nDrawer is especially useful when the user should keep the underlying page context."
89
+ },
90
+ {
91
+ "number": 18,
92
+ "title": "Dropdown",
93
+ "content": "Use Dropdown for actions or compact menus.\n\nGood:\n\n```text\nMore\n ├── Edit\n ├── Duplicate\n ├── Archive\n └── Delete\n```\n\nDo not use Dropdown when users need to compare multiple persistent options.\n\nUse Select instead for form selection."
94
+ },
95
+ {
96
+ "number": 19,
97
+ "title": "Tooltip",
98
+ "content": "Use Tooltip for clarification, not essential information.\n\nGood:\n\n```text\nIcon Button\n ↓\nTooltip: \"Copy\"\n```\n\nDo not hide essential instructions inside tooltips."
99
+ },
100
+ {
101
+ "number": 20,
102
+ "title": "Popover",
103
+ "content": "Use Popover for contextual controls or additional information without leaving the page.\n\nGood:\n\n* Advanced filters\n* Color selection\n* Small configuration panels\n* Additional metadata\n* Contextual actions\n\nPopover content should remain lightweight."
104
+ },
105
+ {
106
+ "number": 21,
107
+ "title": "Tabs",
108
+ "content": "Use Tabs when multiple related views share the same context.\n\nGood:\n\n```text\nOverview | Activity | Settings\n```\n\nDo not use Tabs simply because the page has multiple sections.\n\nIf users should see the sections together, use normal page sections."
109
+ },
110
+ {
111
+ "number": 22,
112
+ "title": "Table",
113
+ "content": "Use Table when users need to compare structured records.\n\nGood:\n\n* Users\n* Orders\n* Transactions\n* Logs\n* Products\n\nProvide:\n\n* Clear column hierarchy\n* Adequate spacing\n* Row hover where useful\n* Pagination when necessary\n* Empty state\n* Loading state\n\nAvoid overly dense tables unless the product specifically requires high information density."
114
+ },
115
+ {
116
+ "number": 23,
117
+ "title": "List",
118
+ "content": "Use List when records are naturally read vertically.\n\nGood:\n\n* Notifications\n* Tasks\n* Activities\n* Messages\n* Search results\n\nPrefer List over Table when users don't need column-based comparison."
119
+ },
120
+ {
121
+ "number": 24,
122
+ "title": "Empty State",
123
+ "content": "Empty states should explain:\n\n1. What is empty?\n2. Why it matters?\n3. What should the user do next?\n\nExample:\n\n```text\nNo projects yet\n\nCreate your first project to start organizing your work.\n\n[ Create Project ]\n```\n\nDo not create empty states that only say:\n\n> No data found."
124
+ },
125
+ {
126
+ "number": 25,
127
+ "title": "Alert / Callout",
128
+ "content": "Use `Callout` for persistent contextual information inside the page.\n\nUse it for:\n\n* Important information\n* Warnings\n* Success states\n* Errors\n* Notices\n* System status\n* Migration messages\n\nExample:\n\n```text\n[Warning]\n\nYour storage is almost full.\nConsider removing unused files.\n```\n\nUse `Callout` when the message belongs to the page's content flow.\n\nDo not use Callout for every notification.\n\nFor temporary notifications, use the toast system.\n\nCallout hierarchy:\n\n```text\nError\nWarning\nSuccess\nInfo\nNeutral\n```\n\nUse semantic types correctly."
129
+ },
130
+ {
131
+ "number": 26,
132
+ "title": "Progress",
133
+ "content": "Use Progress when users need to understand completion.\n\nGood:\n\n* Upload progress\n* Onboarding\n* Course completion\n* Project progress\n* Storage usage\n\nDo not use progress bars decoratively.\n\nProgress should represent measurable progress."
134
+ },
135
+ {
136
+ "number": 27,
137
+ "title": "Skeleton",
138
+ "content": "Use Skeleton when content is loading and the final layout is known.\n\nThe skeleton should resemble the final content structure.\n\nAvoid replacing the entire page with a generic spinner when the layout can be preserved."
139
+ },
140
+ {
141
+ "number": 28,
142
+ "title": "Spinner",
143
+ "content": "Use Spinner for short, localized loading operations.\n\nGood:\n\n```text\n[Save] → spinner → Saving...\n```\n\nAvoid full-page spinners for normal page loading when Skeleton can preserve layout."
144
+ },
145
+ {
146
+ "number": 29,
147
+ "title": "Accordion",
148
+ "content": "Use Accordion when information is optional or secondary.\n\nGood:\n\n* FAQs\n* Advanced settings\n* Documentation sections\n* Additional details\n\nDo not hide primary information inside Accordions."
149
+ },
150
+ {
151
+ "number": 30,
152
+ "title": "Breadcrumb",
153
+ "content": "Use Breadcrumb when the page has meaningful hierarchy.\n\nExample:\n\n```text\nDocumentation / Components / Forms / Input\n```\n\nDo not use Breadcrumb on simple pages where there is no useful hierarchy."
154
+ },
155
+ {
156
+ "number": 31,
157
+ "title": "Pagination",
158
+ "content": "Use Pagination when users need to navigate large datasets.\n\nUse it with:\n\n* Tables\n* Search results\n* Large lists\n\nDo not paginate small datasets unnecessarily."
159
+ },
160
+ {
161
+ "number": 32,
162
+ "title": "Stepper",
163
+ "content": "Use Stepper for multi-step processes.\n\nExample:\n\n```text\nAccount → Details → Review → Complete\n```\n\nEach step should have a meaningful stage.\n\nDo not use Stepper for ordinary navigation."
164
+ },
165
+ {
166
+ "number": 33,
167
+ "title": "Image / Avatar",
168
+ "content": "Images should support content.\n\nUse:\n\n* Image for visual content\n* Avatar for people\n* Avatar Group for teams/participants\n\nDo not add decorative images simply to fill empty space."
169
+ },
170
+ {
171
+ "number": 34,
172
+ "title": "Carousel",
173
+ "content": "Use Carousel only when multiple visual/content items benefit from horizontal browsing.\n\nGood:\n\n* Product screenshots\n* Testimonials\n* Image galleries\n* Featured content\n\nDo not use Carousel for content that users need to compare simultaneously."
174
+ },
175
+ {
176
+ "number": 35,
177
+ "title": "Responsive Design",
178
+ "content": "Design mobile-first.\n\nDesktop:\n\n```text\nSidebar + Main Content\n```\n\nTablet:\n\n```text\nCollapsed Sidebar + Main Content\n```\n\nMobile:\n\n```text\nTop Bar\nContent\n```\n\nNavigation should become more compact rather than simply shrinking.\n\nForms should become single-column where necessary.\n\nCards should stack naturally.\n\nTables may require:\n\n* horizontal scrolling\n* responsive transformation\n* reduced columns\n\nNever allow the layout to become horizontally broken."
179
+ },
180
+ {
181
+ "number": 36,
182
+ "title": "Spacing Rules",
183
+ "content": "Use spacing to establish hierarchy.\n\nUse smaller spacing:\n\n* Within a component\n* Between label and input\n* Between icon and text\n\nUse larger spacing:\n\n* Between sections\n* Between page regions\n* Before major headings\n\nAvoid equal spacing everywhere.\n\nUnequal spacing creates hierarchy."
184
+ },
185
+ {
186
+ "number": 37,
187
+ "title": "Color Rules",
188
+ "content": "Use color semantically.\n\nPrimary color:\n\n* Primary actions\n* Active navigation\n* Important interactive elements\n* Focus states\n\nText colors:\n\n* `text-foreground` for headings and titles\n* `text-secondary` for paragraphs and supporting text\n* `text-muted-foreground` for metadata and hints\n\nSemantic colors:\n\n* Success\n* Warning\n* Error\n* Info\n\nDo not use many unrelated accent colors.\n\nA modern interface should generally have:\n\n```text\n1 primary brand color\n+\nneutral system\n+\nsemantic colors\n```"
189
+ },
190
+ {
191
+ "number": 38,
192
+ "title": "Border Rules",
193
+ "content": "Borders should clarify structure, not decorate it.\n\nPrefer:\n\n```text\nspacing\n+\nsubtle background differences\n```\n\nbefore adding borders.\n\nUse borders for:\n\n* Inputs\n* Tables\n* Cards when necessary\n* Dividers\n* Clear interactive boundaries\n\nAvoid heavy borders around every element."
194
+ },
195
+ {
196
+ "number": 39,
197
+ "title": "Radius Rules",
198
+ "content": "Use consistent corner radii.\n\nDo not randomly mix:\n\n```text\nrounded-sm\nrounded-md\nrounded-lg\nrounded-xl\nrounded-full\n```\n\nUse full rounding primarily for:\n\n* Chips\n* Badges\n* Avatars\n* Compact controls\n\nUse moderate rounding for:\n\n* Cards\n* Inputs\n* Buttons\n* Modals"
199
+ },
200
+ {
201
+ "number": 40,
202
+ "title": "Shadows",
203
+ "content": "Never add a shadow yourself, compulsory. Prefer:\n\n```text\nbackground\n+\nborder\n+\nspacing\n```\n\nover a shadow on anything you're styling by hand — buttons, cards, inputs, hand-built panels.\n\nThis is about classNames/markup you author. A number of `@neuctra/ui` components ship their own built-in elevation shadow as part of their default design (overlay/floating components like Modal, Dropdown, Popover, Drawer, Tooltip, and others like Table, DatePicker's calendar panel, Avatar's status dot, Kbd, and the Toast notification, among others — this isn't an exhaustive list to memorize). Leave every component's shipped defaults exactly as they ship: never add a shadow yourself, and never strip a component's built-in one with an override either — both are the same mistake in opposite directions."
204
+ },
205
+ {
206
+ "number": 41,
207
+ "title": "Modern UI Rule",
208
+ "content": "Modern does NOT mean:\n\n* excessive gradients\n* glassmorphism everywhere\n* giant rounded cards\n* excessive shadows\n* huge text\n* neon colors\n* random icons\n* excessive animations\n\nModern means:\n\n* clear hierarchy\n* intentional spacing\n* restrained color\n* predictable interaction\n* strong typography\n* useful whitespace\n* consistent components\n* subtle motion\n* responsive behavior"
209
+ },
210
+ {
211
+ "number": 42,
212
+ "title": "Human-Designed UI Rule",
213
+ "content": "Before generating the final UI, mentally ask:\n\n> \"Would a professional product designer intentionally put this element here?\"\n\nIf the answer is no, remove it.\n\nDo not add UI simply because a component exists.\n\nThe component library is a toolbox, not a checklist."
214
+ },
215
+ {
216
+ "number": 43,
217
+ "title": "Avoid AI-Generated UI Patterns",
218
+ "content": "Never automatically generate:\n\n* Hero section + three cards + gradient\n* Excessive rounded containers\n* Random decorative icons\n* Unnecessary badges\n* Excessive centered text\n* Every section inside a Card\n* Multiple primary buttons\n* Huge empty spaces\n* Excessive shadows\n* Random gradients\n* Generic dashboard cards\n* Repeated identical layouts\n* Decorative statistics without meaning\n\nAvoid the recognizable \"AI-generated SaaS template\" appearance."
219
+ },
220
+ {
221
+ "number": 44,
222
+ "title": "Component Selection Principle",
223
+ "content": "When choosing a component, use this decision process:\n\n```text\nNeed navigation?\n→ Tabs / Breadcrumb / Pagination / Stepper\n→ For a sidebar or nav links: hand-build from Button (ghost/link variant) — no dedicated Navigation component exists\n\nNeed an action?\n→ Button / Icon Button\n\nNeed selection?\n→ Select / RadioGroup / Checkbox / Switch\n\nNeed compact metadata?\n→ Badge / Chip\n\nNeed grouped content?\n→ Card\n\nNeed persistent message?\n→ Callout\n\nNeed temporary message?\n→ the toast system (import { toast, ToastProvider } from \"@neuctra/ui\" — not a \"Toast\" component)\n\nNeed focused interaction?\n→ Modal / Drawer / Popover\n\nNeed clarification?\n→ Tooltip\n\nNeed structured records?\n→ Table / List\n\nNeed loading?\n→ Skeleton / Spinner\n\nNeed progress?\n→ Progress\n\nNeed hierarchy?\n→ Accordion / Breadcrumb / Stepper\n```\n\nNever select a component merely because it looks attractive."
224
+ },
225
+ {
226
+ "number": 45,
227
+ "title": "Documentation UI Rules",
228
+ "content": "For component documentation, prefer:\n\n```text\nSidebar\n+\nDocumentation Container\n+\nBreadcrumb / Section Context\n+\nComponent Title\n+\nDescription\n+\nLive Preview\n+\nCode\n+\nUsage Guidelines\n+\nProps\n+\nAccessibility\n+\nFAQ\n```\n\nThe documentation page should prioritize the component preview and developer understanding.\n\nKeep code visually distinct from prose."
229
+ },
230
+ {
231
+ "number": 46,
232
+ "title": "Component Preview Rules",
233
+ "content": "Every preview should feel like a real product interface.\n\nDo not make previews look like isolated component experiments.\n\nInstead of:\n\n```text\nButton\nButton\nButton\n```\n\nprefer contextual examples:\n\n```text\nProject Settings\n\nProject name\n[ My Project ]\n\n[ Cancel ] [ Save Changes ]\n```\n\nThis demonstrates how the component actually behaves in a product."
234
+ },
235
+ {
236
+ "number": 47,
237
+ "title": "Accessibility",
238
+ "content": "Accessibility is part of the design.\n\nAlways consider:\n\n* Keyboard navigation\n* Focus states\n* Screen readers\n* Color contrast\n* Semantic HTML\n* Clear labels\n* Button names\n* Input descriptions\n* Error messages\n* Touch target sizes\n\nNever communicate meaning using color alone."
239
+ },
240
+ {
241
+ "number": 48,
242
+ "title": "Interaction Design",
243
+ "content": "Every interactive element should provide feedback.\n\nExamples:\n\n```text\nDefault\n→ Hover\n→ Active\n→ Focus\n→ Disabled\n→ Loading\n→ Success/Error\n```\n\nDo not animate everything.\n\nUse subtle transitions for:\n\n* Hover\n* Opening/closing\n* State changes\n* Navigation\n* Feedback\n\nMotion should explain interaction, not distract."
244
+ },
245
+ {
246
+ "number": 49,
247
+ "title": "Final UI Quality Checklist",
248
+ "content": "Before considering the UI complete, verify:\n\n### Hierarchy\n\n* Is the primary purpose obvious within seconds?\n* Is the most important action visually dominant?\n\n### Layout\n\n* Is spacing intentional?\n* Are sections grouped logically?\n* Is the content width comfortable?\n\n### Components\n\n* Is every component necessary?\n* Is each component being used for its intended purpose?\n\n### Visual Design\n\n* Is the color palette restrained?\n* Are borders and shadows subtle?\n* Is typography consistent?\n\n### UX\n\n* Can users understand what to do?\n* Are loading, empty, error, and success states handled?\n\n### Responsive\n\n* Does it work on mobile?\n* Does navigation adapt correctly?\n* Do cards/forms/tables remain usable?\n\n### Human Design\n\n* Does it look intentionally designed?\n* Could removing a decorative element improve it?\n* Does anything feel like generic AI-generated SaaS UI?\n\nIf something feels unnecessary, remove it."
249
+ },
250
+ {
251
+ "number": 50,
252
+ "title": "Do Not Overwrite Built-in Component Design",
253
+ "content": "Use each `@neuctra/ui` component's built-in design — its default spacing, radius, colors, and layout — as-is.\n\nDo not pass a `className` just to restyle a component's built-in appearance because of personal preference. The component's own design is already the intended, consistent look.\n\nOnly override with Tailwind's `!` important-modifier (e.g. `!bg-red-500`, `!p-2`, `!rounded-lg`) when there is a real, specific need:\n\n* The component's default would otherwise break the current page's existing layout.\n* The default collides or conflicts with the current UI/design of the site.\n* The component has no prop for the needed variation, and leaving the default would visually damage the surrounding design.\n\nNever reach for `!important` overrides as a routine styling habit, a stylistic preference, or 'just because'.\n\nPrefer:\n\n> built-in component design → prop-based variation (variant, size, etc.) → `!important` override (rare, only to prevent breakage)\n\nover:\n\n> restyle every component by default with className overrides\n\nA component that has been overridden with `!important` on every use is a sign the component itself, or the way it's being used, is wrong — not that every instance needs forcing."
254
+ },
255
+ {
256
+ "number": 51,
257
+ "title": "Paragraph Text Color",
258
+ "content": "Use `text-secondary` for all paragraph text: body copy, section descriptions, card descriptions, and supporting text under headings.\n\nDo not use `text-muted-foreground` for paragraphs. It is too low-contrast for reading text.\n\nKeep `text-muted-foreground` for small, low-priority text only:\n\n* Timestamps\n* Metadata\n* Captions\n* Placeholders\n* Helper and hint text\n* Disabled states\n\nUse `text-foreground` for headings, titles, and anything that needs full emphasis.\n\n`secondary` is a text color only. Do not use it as a background (`bg-secondary`).\n\nOrder of emphasis:\n\n```text\ntext-foreground ← headings\n↓\ntext-secondary ← paragraphs\n↓\ntext-muted-foreground ← metadata and hints\n```\n\nToken values:\n\n* Light theme: `--secondary: #3f3f46`\n* Dark theme: `--secondary: #d4d4d8`"
259
+ }
260
+ ],
261
+ "goldenRule": {
262
+ "title": "Golden Rule",
263
+ "content": "Do not ask:\n\n> \"Which components can I put on this page?\"\n\nAsk:\n\n> \"What does the user need to understand and do, and which Neuctra UI component communicates that most naturally?\"\n\nThe best Neuctra UI interface is not the one that uses the most components.\n\nIt is the one where **every component has a purpose.**"
264
+ }
265
+ }