@nucleux/mcp 0.4.6 → 0.6.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nucleux/mcp",
3
- "version": "0.4.6",
3
+ "version": "0.6.0",
4
4
  "type": "module",
5
5
  "description": "Model Context Protocol server for the Nucleux agentic UI component library — lets AI coding agents discover, search, and correctly use @nucleux components.",
6
6
  "bin": {
@@ -9,6 +9,8 @@
9
9
  "main": "./dist/index.js",
10
10
  "files": [
11
11
  "dist",
12
+ "skills",
13
+ "templates",
12
14
  "README.md"
13
15
  ],
14
16
  "dependencies": {
@@ -45,7 +47,7 @@
45
47
  "node": ">=18"
46
48
  },
47
49
  "scripts": {
48
- "prebuild": "node ../../scripts/gen-mcp-catalog.mjs && node ../../scripts/gen-html-snippets.mjs",
50
+ "prebuild": "node ../../scripts/gen-mcp-catalog.mjs && node ../../scripts/gen-llms.mjs && node ../../scripts/gen-mcp-knowledge.mjs && node ../../scripts/gen-agent-files.mjs && node ../../scripts/gen-html-snippets.mjs",
49
51
  "build": "tsup"
50
52
  }
51
53
  }
@@ -0,0 +1,101 @@
1
+ ---
2
+ name: nucleux-design
3
+ description: Build or extend React UI with the Nucleux design system (@nucleux/react) — app shells, dashboards, list/table pages, settings and loading/empty/error states — design-first, from curated patterns and exact component contracts. Use when asked to build pages or an app with Nucleux, or when the project depends on @nucleux packages.
4
+ ---
5
+
6
+ <!-- Generated from knowledge/workflow.md by scripts/gen-agent-files.mjs. Do not edit. -->
7
+
8
+ # Nucleux design workflow
9
+
10
+ ## Requires the nucleux MCP server
11
+
12
+ The steps below call the `nucleux` MCP tools (`search_patterns`, `get_pattern`,
13
+ `get_component`, `get_setup`). If they are not available, stop and tell the
14
+ user to add the server, then continue once it is connected:
15
+
16
+ - Claude Code: `claude mcp add nucleux -- npx -y @nucleux/mcp`
17
+ - Codex: `codex mcp add nucleux -- npx -y @nucleux/mcp`
18
+
19
+ Do not fall back to guessing Nucleux APIs.
20
+
21
+ Nucleux (`@nucleux/react`) is a React + Tailwind design system in two families:
22
+ shadcn-style (`Button`, `Disclosure`, …) and Material 3 (`Md3Button`,
23
+ `Md3Disclosure`, …). The `nucleux` MCP server holds its curated page patterns and
24
+ exact component contracts. Work design-first: find the pattern, read the
25
+ contracts, then write code.
26
+
27
+ ## Rules
28
+
29
+ 1. Inspect the project before changing files. Keep its framework, router,
30
+ state management, business logic and file layout.
31
+ 2. Look for a Nucleux pattern (`search_patterns`) before laying out any page.
32
+ Prefer a whole pattern over assembling unrelated components.
33
+ 3. Read the contract (`get_component`) before using a component. Use only the
34
+ imports, props and variant values it lists. Never guess a Nucleux export,
35
+ prop or variant. If it is not in the catalog, it does not exist.
36
+ 4. Pick one family per app and do not mix them: Material 3 (`Md3*`) when the
37
+ project already uses Material Design or the user asks for it, otherwise
38
+ shadcn. Patterns are written with shadcn components; in a Material 3 app use
39
+ each one's `Md3` twin, and where Material 3 has none (e.g. `DataTable`), the
40
+ shadcn component under the `md3-theme` class. Agentic components have the
41
+ same props in both families.
42
+ 5. For AI features use the agentic components (nucleux.in's patterns):
43
+ `Disclosure` and `Caveat` for AI output, `Consent` before acting,
44
+ `OpenInput`/`InitialCta`/`SuggestedPrompts` for asking, `Attachments`,
45
+ `VoiceInput` and friends for input, `ModelSelection`, `KnowledgeBase`,
46
+ `Connector` and `McpConnection` for context. Search for them with
47
+ `search_components` instead of building your own.
48
+ 6. Do not rebuild something Nucleux already ships (navigation, tables, cards,
49
+ dialogs, sheets, form controls, empty/error states). If you must, say why
50
+ in your summary.
51
+ 7. Style with the semantic token classes (`bg-background`, `text-foreground`,
52
+ `text-muted-foreground`, `border-border`, `bg-primary`, `text-destructive`…;
53
+ in a Material 3 app the `md-*` roles: `bg-md-surface`, `text-md-on-surface`,
54
+ `bg-md-primary-container`…).
55
+ No hex colors, no arbitrary color values. Use the same variant for the same
56
+ meaning everywhere (one `cta` primary action per page, `destructive` only
57
+ for destructive actions).
58
+ 8. Every page must work from 360px wide: follow each pattern's responsive rules.
59
+ 9. Accessibility is part of done: labels for every control, `aria-label` on
60
+ icon-only buttons, visible focus, status not conveyed by color alone.
61
+ 10. Every data view handles loading, empty and error (the `page-states` pattern).
62
+ 11. When Nucleux has no pattern or component for a need, build it from Nucleux
63
+ primitives (or the ShadCN equivalent the tools name), keep it on Nucleux
64
+ tokens, and report the gap. Never present an invented component as Nucleux.
65
+ 12. Nucleux is not mandatory. If the project already uses another component
66
+ system and the user did not ask to switch, extend that system and say so.
67
+
68
+ ## Workflow
69
+
70
+ **A. Inspect the project.** Find the framework (Vite, Next.js, Remix…), package
71
+ manager (lockfile), TypeScript, Tailwind version and config, router, existing
72
+ component system, and any installed `@nucleux/*` packages. If Nucleux is not set
73
+ up, call `get_setup` and follow it exactly.
74
+
75
+ **B. Analyse the request.** List the pages, the main user journeys, the key
76
+ interactions on each page, and what matters most on each screen. Ask only about
77
+ ambiguities that change the architecture; pick sensible defaults otherwise.
78
+
79
+ **C. Discover.** For each page call `search_patterns` with what the page is for,
80
+ then `get_pattern` for the best match (`app-shell` for the frame, plus one
81
+ pattern per page). Call `get_component` for every component you will use that
82
+ you have not read in this session. Use `search_components` for needs inside a
83
+ page that no pattern covers.
84
+
85
+ **D. Plan.** Write a short plan: shared layout, then each route →
86
+ pattern(s) → components → app-specific pieces you will write → states. Mark
87
+ anything Nucleux does not cover. Check the plan with `validate_design` (pattern
88
+ ids plus the components and props you intend to use) and fix every error.
89
+
90
+ **E. Implement.** Build the shared shell once and wrap every route in it.
91
+ Start each page from its pattern's example, replace the sample data with the
92
+ app's data model, and keep app-specific components (a TaskCard bound to your
93
+ data) in the app, composed from Nucleux parts.
94
+
95
+ **F. Validate.** Run the project's type check, lint, tests and production build;
96
+ fix every error. Re-check each page against its pattern's responsive and
97
+ accessibility rules.
98
+
99
+ **G. Report.** Summarise the pages built, the patterns and components used per
100
+ page, design decisions, the checks you ran and their results, anything you built
101
+ custom and why, and the gaps or open issues.
@@ -0,0 +1,89 @@
1
+ <!-- Generated from knowledge/workflow.md by scripts/gen-agent-files.mjs. Do not edit. -->
2
+
3
+ ## UI: Nucleux design system
4
+
5
+ This project builds its UI with Nucleux (`@nucleux/react`). Use the `nucleux`
6
+ MCP server (`npx -y @nucleux/mcp`) for patterns and component contracts; the
7
+ `nucleux-design` skill holds the same workflow.
8
+
9
+ Nucleux (`@nucleux/react`) is a React + Tailwind design system in two families:
10
+ shadcn-style (`Button`, `Disclosure`, …) and Material 3 (`Md3Button`,
11
+ `Md3Disclosure`, …). The `nucleux` MCP server holds its curated page patterns and
12
+ exact component contracts. Work design-first: find the pattern, read the
13
+ contracts, then write code.
14
+
15
+ ### Rules
16
+
17
+ 1. Inspect the project before changing files. Keep its framework, router,
18
+ state management, business logic and file layout.
19
+ 2. Look for a Nucleux pattern (`search_patterns`) before laying out any page.
20
+ Prefer a whole pattern over assembling unrelated components.
21
+ 3. Read the contract (`get_component`) before using a component. Use only the
22
+ imports, props and variant values it lists. Never guess a Nucleux export,
23
+ prop or variant. If it is not in the catalog, it does not exist.
24
+ 4. Pick one family per app and do not mix them: Material 3 (`Md3*`) when the
25
+ project already uses Material Design or the user asks for it, otherwise
26
+ shadcn. Patterns are written with shadcn components; in a Material 3 app use
27
+ each one's `Md3` twin, and where Material 3 has none (e.g. `DataTable`), the
28
+ shadcn component under the `md3-theme` class. Agentic components have the
29
+ same props in both families.
30
+ 5. For AI features use the agentic components (nucleux.in's patterns):
31
+ `Disclosure` and `Caveat` for AI output, `Consent` before acting,
32
+ `OpenInput`/`InitialCta`/`SuggestedPrompts` for asking, `Attachments`,
33
+ `VoiceInput` and friends for input, `ModelSelection`, `KnowledgeBase`,
34
+ `Connector` and `McpConnection` for context. Search for them with
35
+ `search_components` instead of building your own.
36
+ 6. Do not rebuild something Nucleux already ships (navigation, tables, cards,
37
+ dialogs, sheets, form controls, empty/error states). If you must, say why
38
+ in your summary.
39
+ 7. Style with the semantic token classes (`bg-background`, `text-foreground`,
40
+ `text-muted-foreground`, `border-border`, `bg-primary`, `text-destructive`…;
41
+ in a Material 3 app the `md-*` roles: `bg-md-surface`, `text-md-on-surface`,
42
+ `bg-md-primary-container`…).
43
+ No hex colors, no arbitrary color values. Use the same variant for the same
44
+ meaning everywhere (one `cta` primary action per page, `destructive` only
45
+ for destructive actions).
46
+ 8. Every page must work from 360px wide: follow each pattern's responsive rules.
47
+ 9. Accessibility is part of done: labels for every control, `aria-label` on
48
+ icon-only buttons, visible focus, status not conveyed by color alone.
49
+ 10. Every data view handles loading, empty and error (the `page-states` pattern).
50
+ 11. When Nucleux has no pattern or component for a need, build it from Nucleux
51
+ primitives (or the ShadCN equivalent the tools name), keep it on Nucleux
52
+ tokens, and report the gap. Never present an invented component as Nucleux.
53
+ 12. Nucleux is not mandatory. If the project already uses another component
54
+ system and the user did not ask to switch, extend that system and say so.
55
+
56
+ ### Workflow
57
+
58
+ **A. Inspect the project.** Find the framework (Vite, Next.js, Remix…), package
59
+ manager (lockfile), TypeScript, Tailwind version and config, router, existing
60
+ component system, and any installed `@nucleux/*` packages. If Nucleux is not set
61
+ up, call `get_setup` and follow it exactly.
62
+
63
+ **B. Analyse the request.** List the pages, the main user journeys, the key
64
+ interactions on each page, and what matters most on each screen. Ask only about
65
+ ambiguities that change the architecture; pick sensible defaults otherwise.
66
+
67
+ **C. Discover.** For each page call `search_patterns` with what the page is for,
68
+ then `get_pattern` for the best match (`app-shell` for the frame, plus one
69
+ pattern per page). Call `get_component` for every component you will use that
70
+ you have not read in this session. Use `search_components` for needs inside a
71
+ page that no pattern covers.
72
+
73
+ **D. Plan.** Write a short plan: shared layout, then each route →
74
+ pattern(s) → components → app-specific pieces you will write → states. Mark
75
+ anything Nucleux does not cover. Check the plan with `validate_design` (pattern
76
+ ids plus the components and props you intend to use) and fix every error.
77
+
78
+ **E. Implement.** Build the shared shell once and wrap every route in it.
79
+ Start each page from its pattern's example, replace the sample data with the
80
+ app's data model, and keep app-specific components (a TaskCard bound to your
81
+ data) in the app, composed from Nucleux parts.
82
+
83
+ **F. Validate.** Run the project's type check, lint, tests and production build;
84
+ fix every error. Re-check each page against its pattern's responsive and
85
+ accessibility rules.
86
+
87
+ **G. Report.** Summarise the pages built, the patterns and components used per
88
+ page, design decisions, the checks you ran and their results, anything you built
89
+ custom and why, and the gaps or open issues.