@nexub/mcp 3.3.0 → 3.4.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 CHANGED
@@ -37,6 +37,15 @@ claude plugin install nexub-ds@nexub
37
37
  | `get_tokens` | Color roles, typography, spacing, shape, elevation, motion, with Tailwind utilities (`section: "Motion"`) |
38
38
  | `get_react_native` | Mobile apps: `@nexub/react-native` setup, components, screen patterns and mobile rules |
39
39
 
40
+ ## Prompts
41
+
42
+ Ready-made starting points, listed by your client (in Claude Code: `/mcp__nexub-ds__build_screen`). Each carries the guidelines, so the model has the rules without a separate call.
43
+
44
+ | Prompt | Arguments |
45
+ | --- | --- |
46
+ | `build_screen` | `screen`: what to build; `platform`: `web` (default) or `mobile` |
47
+ | `review_screen` | `code`: the UI to review against the checklist (optional) |
48
+
40
49
  ## Staying current
41
50
 
42
51
  The server reports the reference of the version it was published with, and it is versioned with `@nexub/react`. `npx -y @nexub/mcp` always fetches the latest release. Pin `@nexub/mcp@<version>` to match an older install.
@@ -1,6 +1,6 @@
1
1
  # Component index
2
2
 
3
- Nexub DS v3.3.0. Open `components/<slug>.md` for props, examples and accessibility notes.
3
+ Nexub DS v3.4.0. Open `components/<slug>.md` for props, examples and accessibility notes.
4
4
  Never use a component marked deprecated.
5
5
 
6
6
  ## Components — Actions
@@ -1,6 +1,6 @@
1
1
  # Tokens
2
2
 
3
- Nexub DS v3.3.0. Every token is a CSS custom property from `@nexub/tokens/css` (loaded by `@nexub/themes/base`).
3
+ Nexub DS v3.4.0. Every token is a CSS custom property from `@nexub/tokens/css` (loaded by `@nexub/themes/base`).
4
4
  The Tailwind preset (`@nexub/tokens/tailwind`) maps them to utilities. Never hardcode a hex, px spacing or shadow that a token covers.
5
5
 
6
6
  ## Color roles
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nexub/mcp",
3
- "version": "3.3.0",
3
+ "version": "3.4.0",
4
4
  "description": "MCP server for Nexub Design System: gives Claude, Cursor and any MCP client the components, patterns, tokens and design rules of the installed release.",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/server.js CHANGED
@@ -102,6 +102,45 @@ export function createServer() {
102
102
  async () => text(read('references/react-native.md')),
103
103
  );
104
104
 
105
+ // Prompts: ready-made starting points the user picks in their MCP client
106
+ // (e.g. "/mcp__nexub-ds__build_screen" in Claude Code). Each one carries the
107
+ // guidelines, so the model has the rules without a separate tool call.
108
+ const guidelines = () => read('SKILL.md').replace(/^---\n[\s\S]*?\n---\n/, '');
109
+ const user = (t) => ({ messages: [{ role: 'user', content: { type: 'text', text: t } }] });
110
+
111
+ server.registerPrompt(
112
+ 'build_screen',
113
+ {
114
+ title: 'Build a screen with Nexub',
115
+ description: 'Build a page or screen from a short description, using only Nexub components, patterns and tokens.',
116
+ argsSchema: {
117
+ screen: z.string().describe('What to build, e.g. "billing settings with plan, payment method and invoices"'),
118
+ platform: z.string().optional().describe('"web" (default) or "mobile"'),
119
+ },
120
+ },
121
+ ({ screen, platform }) =>
122
+ user(
123
+ `Build this ${platform === 'mobile' ? 'React Native screen with @nexub/react-native' : 'screen with @nexub/react and @nexub/patterns'}: ${screen}\n\n` +
124
+ 'Start from the matching row of "How to build a screen", call get_component for any component whose props you are unsure of, ' +
125
+ `use only tokens (no hex, no arbitrary px), and finish with the "Before you finish" checklist.\n\n---\n\n${guidelines()}`,
126
+ ),
127
+ );
128
+
129
+ server.registerPrompt(
130
+ 'review_screen',
131
+ {
132
+ title: 'Review UI against Nexub',
133
+ description: 'Review UI code against the Nexub checklist and fix what is not a Nexub component or token.',
134
+ argsSchema: { code: z.string().optional().describe('The code to review. Leave empty to review the open file.') },
135
+ },
136
+ ({ code }) =>
137
+ user(
138
+ 'Review this UI against the Nexub "Before you finish" checklist. List each problem with the line, then fix it: ' +
139
+ 'swap custom controls for Nexub components, hex or palette colours for role tokens, arbitrary values for scale tokens, ' +
140
+ `and add missing labels.\n\n${code ? `\`\`\`tsx\n${code}\n\`\`\`\n\n` : ''}---\n\n${guidelines()}`,
141
+ ),
142
+ );
143
+
105
144
  return server;
106
145
  }
107
146