@nucleux/mcp 0.4.5 → 0.5.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/README.md +140 -60
- package/dist/index.js +8909 -412
- package/package.json +4 -2
- package/skills/nucleux-design/SKILL.md +85 -0
- package/templates/AGENTS.md +73 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nucleux/mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.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-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,85 @@
|
|
|
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. The `nucleux` MCP
|
|
22
|
+
server holds its curated page patterns and exact component contracts. Work
|
|
23
|
+
design-first: find the pattern, read the contracts, then write code.
|
|
24
|
+
|
|
25
|
+
## Rules
|
|
26
|
+
|
|
27
|
+
1. Inspect the project before changing files. Keep its framework, router,
|
|
28
|
+
state management, business logic and file layout.
|
|
29
|
+
2. Look for a Nucleux pattern (`search_patterns`) before laying out any page.
|
|
30
|
+
Prefer a whole pattern over assembling unrelated components.
|
|
31
|
+
3. Read the contract (`get_component`) before using a component. Use only the
|
|
32
|
+
imports, props and variant values it lists. Never guess a Nucleux export,
|
|
33
|
+
prop or variant. If it is not in the catalog, it does not exist.
|
|
34
|
+
4. Do not rebuild something Nucleux already ships (navigation, tables, cards,
|
|
35
|
+
dialogs, sheets, form controls, empty/error states). If you must, say why
|
|
36
|
+
in your summary.
|
|
37
|
+
5. Style with the semantic token classes (`bg-background`, `text-foreground`,
|
|
38
|
+
`text-muted-foreground`, `border-border`, `bg-primary`, `text-destructive`…).
|
|
39
|
+
No hex colors, no arbitrary color values. Use the same variant for the same
|
|
40
|
+
meaning everywhere (one `cta` primary action per page, `destructive` only
|
|
41
|
+
for destructive actions).
|
|
42
|
+
6. Every page must work from 360px wide: follow each pattern's responsive rules.
|
|
43
|
+
7. Accessibility is part of done: labels for every control, `aria-label` on
|
|
44
|
+
icon-only buttons, visible focus, status not conveyed by color alone.
|
|
45
|
+
8. Every data view handles loading, empty and error (the `page-states` pattern).
|
|
46
|
+
9. When Nucleux has no pattern or component for a need, build it from Nucleux
|
|
47
|
+
primitives (or the ShadCN equivalent the tools name), keep it on Nucleux
|
|
48
|
+
tokens, and report the gap. Never present an invented component as Nucleux.
|
|
49
|
+
10. Nucleux is not mandatory. If the project already uses another component
|
|
50
|
+
system and the user did not ask to switch, extend that system and say so.
|
|
51
|
+
|
|
52
|
+
## Workflow
|
|
53
|
+
|
|
54
|
+
**A. Inspect the project.** Find the framework (Vite, Next.js, Remix…), package
|
|
55
|
+
manager (lockfile), TypeScript, Tailwind version and config, router, existing
|
|
56
|
+
component system, and any installed `@nucleux/*` packages. If Nucleux is not set
|
|
57
|
+
up, call `get_setup` and follow it exactly.
|
|
58
|
+
|
|
59
|
+
**B. Analyse the request.** List the pages, the main user journeys, the key
|
|
60
|
+
interactions on each page, and what matters most on each screen. Ask only about
|
|
61
|
+
ambiguities that change the architecture; pick sensible defaults otherwise.
|
|
62
|
+
|
|
63
|
+
**C. Discover.** For each page call `search_patterns` with what the page is for,
|
|
64
|
+
then `get_pattern` for the best match (`app-shell` for the frame, plus one
|
|
65
|
+
pattern per page). Call `get_component` for every component you will use that
|
|
66
|
+
you have not read in this session. Use `search_components` for needs inside a
|
|
67
|
+
page that no pattern covers.
|
|
68
|
+
|
|
69
|
+
**D. Plan.** Write a short plan: shared layout, then each route →
|
|
70
|
+
pattern(s) → components → app-specific pieces you will write → states. Mark
|
|
71
|
+
anything Nucleux does not cover. Check the plan with `validate_design` (pattern
|
|
72
|
+
ids plus the components and props you intend to use) and fix every error.
|
|
73
|
+
|
|
74
|
+
**E. Implement.** Build the shared shell once and wrap every route in it.
|
|
75
|
+
Start each page from its pattern's example, replace the sample data with the
|
|
76
|
+
app's data model, and keep app-specific components (a TaskCard bound to your
|
|
77
|
+
data) in the app, composed from Nucleux parts.
|
|
78
|
+
|
|
79
|
+
**F. Validate.** Run the project's type check, lint, tests and production build;
|
|
80
|
+
fix every error. Re-check each page against its pattern's responsive and
|
|
81
|
+
accessibility rules.
|
|
82
|
+
|
|
83
|
+
**G. Report.** Summarise the pages built, the patterns and components used per
|
|
84
|
+
page, design decisions, the checks you ran and their results, anything you built
|
|
85
|
+
custom and why, and the gaps or open issues.
|
|
@@ -0,0 +1,73 @@
|
|
|
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. The `nucleux` MCP
|
|
10
|
+
server holds its curated page patterns and exact component contracts. Work
|
|
11
|
+
design-first: find the pattern, read the contracts, then write code.
|
|
12
|
+
|
|
13
|
+
### Rules
|
|
14
|
+
|
|
15
|
+
1. Inspect the project before changing files. Keep its framework, router,
|
|
16
|
+
state management, business logic and file layout.
|
|
17
|
+
2. Look for a Nucleux pattern (`search_patterns`) before laying out any page.
|
|
18
|
+
Prefer a whole pattern over assembling unrelated components.
|
|
19
|
+
3. Read the contract (`get_component`) before using a component. Use only the
|
|
20
|
+
imports, props and variant values it lists. Never guess a Nucleux export,
|
|
21
|
+
prop or variant. If it is not in the catalog, it does not exist.
|
|
22
|
+
4. Do not rebuild something Nucleux already ships (navigation, tables, cards,
|
|
23
|
+
dialogs, sheets, form controls, empty/error states). If you must, say why
|
|
24
|
+
in your summary.
|
|
25
|
+
5. Style with the semantic token classes (`bg-background`, `text-foreground`,
|
|
26
|
+
`text-muted-foreground`, `border-border`, `bg-primary`, `text-destructive`…).
|
|
27
|
+
No hex colors, no arbitrary color values. Use the same variant for the same
|
|
28
|
+
meaning everywhere (one `cta` primary action per page, `destructive` only
|
|
29
|
+
for destructive actions).
|
|
30
|
+
6. Every page must work from 360px wide: follow each pattern's responsive rules.
|
|
31
|
+
7. Accessibility is part of done: labels for every control, `aria-label` on
|
|
32
|
+
icon-only buttons, visible focus, status not conveyed by color alone.
|
|
33
|
+
8. Every data view handles loading, empty and error (the `page-states` pattern).
|
|
34
|
+
9. When Nucleux has no pattern or component for a need, build it from Nucleux
|
|
35
|
+
primitives (or the ShadCN equivalent the tools name), keep it on Nucleux
|
|
36
|
+
tokens, and report the gap. Never present an invented component as Nucleux.
|
|
37
|
+
10. Nucleux is not mandatory. If the project already uses another component
|
|
38
|
+
system and the user did not ask to switch, extend that system and say so.
|
|
39
|
+
|
|
40
|
+
### Workflow
|
|
41
|
+
|
|
42
|
+
**A. Inspect the project.** Find the framework (Vite, Next.js, Remix…), package
|
|
43
|
+
manager (lockfile), TypeScript, Tailwind version and config, router, existing
|
|
44
|
+
component system, and any installed `@nucleux/*` packages. If Nucleux is not set
|
|
45
|
+
up, call `get_setup` and follow it exactly.
|
|
46
|
+
|
|
47
|
+
**B. Analyse the request.** List the pages, the main user journeys, the key
|
|
48
|
+
interactions on each page, and what matters most on each screen. Ask only about
|
|
49
|
+
ambiguities that change the architecture; pick sensible defaults otherwise.
|
|
50
|
+
|
|
51
|
+
**C. Discover.** For each page call `search_patterns` with what the page is for,
|
|
52
|
+
then `get_pattern` for the best match (`app-shell` for the frame, plus one
|
|
53
|
+
pattern per page). Call `get_component` for every component you will use that
|
|
54
|
+
you have not read in this session. Use `search_components` for needs inside a
|
|
55
|
+
page that no pattern covers.
|
|
56
|
+
|
|
57
|
+
**D. Plan.** Write a short plan: shared layout, then each route →
|
|
58
|
+
pattern(s) → components → app-specific pieces you will write → states. Mark
|
|
59
|
+
anything Nucleux does not cover. Check the plan with `validate_design` (pattern
|
|
60
|
+
ids plus the components and props you intend to use) and fix every error.
|
|
61
|
+
|
|
62
|
+
**E. Implement.** Build the shared shell once and wrap every route in it.
|
|
63
|
+
Start each page from its pattern's example, replace the sample data with the
|
|
64
|
+
app's data model, and keep app-specific components (a TaskCard bound to your
|
|
65
|
+
data) in the app, composed from Nucleux parts.
|
|
66
|
+
|
|
67
|
+
**F. Validate.** Run the project's type check, lint, tests and production build;
|
|
68
|
+
fix every error. Re-check each page against its pattern's responsive and
|
|
69
|
+
accessibility rules.
|
|
70
|
+
|
|
71
|
+
**G. Report.** Summarise the pages built, the patterns and components used per
|
|
72
|
+
page, design decisions, the checks you ran and their results, anything you built
|
|
73
|
+
custom and why, and the gaps or open issues.
|