@atomixstudio/mcp 1.0.14 → 1.0.16
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 +117 -122
- package/dist/index.js +46 -100
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,21 +1,6 @@
|
|
|
1
1
|
# @atomixstudio/mcp
|
|
2
2
|
|
|
3
|
-
MCP (Model Context Protocol) server and CLI for Atomix Design System. Query and sync design tokens
|
|
4
|
-
|
|
5
|
-
## Quick Start (CLI)
|
|
6
|
-
|
|
7
|
-
The easiest way to use Atomix is via the CLI:
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
# Sync tokens + AI rules (default behavior)
|
|
11
|
-
npx heyatomix sync
|
|
12
|
-
|
|
13
|
-
# Sync tokens only (skip AI rules)
|
|
14
|
-
npx heyatomix sync --no-rules
|
|
15
|
-
|
|
16
|
-
# Create config file
|
|
17
|
-
npx heyatomix init
|
|
18
|
-
```
|
|
3
|
+
MCP (Model Context Protocol) server and CLI for Atomix Design System. Query and sync design tokens from AI coding tools (Cursor, Claude Desktop, Windsurf, etc.) or from the command line.
|
|
19
4
|
|
|
20
5
|
## Getting Your Credentials
|
|
21
6
|
|
|
@@ -24,79 +9,9 @@ npx heyatomix init
|
|
|
24
9
|
3. Click **Publish** to make your DS available via API
|
|
25
10
|
4. Your `ds-id` is in the URL: `atomixstudio.eu/ds/[ds-id]`
|
|
26
11
|
|
|
27
|
-
## CLI Commands
|
|
28
|
-
|
|
29
|
-
### `heyatomix sync`
|
|
30
|
-
|
|
31
|
-
Sync design tokens and AI rules to your project. **Both tokens and AI guidance rules sync by default** since the rules reference tokens.
|
|
32
|
-
|
|
33
|
-
```bash
|
|
34
|
-
npx heyatomix sync # Sync tokens + AI rules
|
|
35
|
-
npx heyatomix sync --no-rules # Sync tokens only
|
|
36
|
-
npx heyatomix sync -o src/tokens.css # Custom output path
|
|
37
|
-
npx heyatomix sync --format scss # Output as SCSS
|
|
38
|
-
npx heyatomix sync -y # Auto-confirm changes
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
**⚠️ Important: File Structure**
|
|
42
|
-
|
|
43
|
-
The output file (e.g., `tokens.css`) is **completely rewritten** on each sync:
|
|
44
|
-
|
|
45
|
-
- ✅ **Preserved**: CSS custom properties (variables) - both design system tokens and custom variables
|
|
46
|
-
- ❌ **Lost**: Regular CSS rules (selectors, classes, media queries, etc.)
|
|
47
|
-
|
|
48
|
-
**Best Practice**: Keep your tokens file separate from custom CSS. Use a separate file (e.g., `custom.css` or `styles.css`) for custom styles.
|
|
49
|
-
|
|
50
|
-
### `heyatomix init`
|
|
51
|
-
|
|
52
|
-
Create a `.atomixrc` config file:
|
|
53
|
-
|
|
54
|
-
```bash
|
|
55
|
-
npx heyatomix init
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
This creates:
|
|
59
|
-
|
|
60
|
-
```json
|
|
61
|
-
{
|
|
62
|
-
"dsId": "your-design-system-id",
|
|
63
|
-
"output": "./tokens.css",
|
|
64
|
-
"format": "css"
|
|
65
|
-
}
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
### CLI Options
|
|
69
|
-
|
|
70
|
-
| Option | Description |
|
|
71
|
-
|--------|-------------|
|
|
72
|
-
| `--ds-id` | Design system ID (or set in .atomixrc) |
|
|
73
|
-
| `--api-key` | API key for private design systems |
|
|
74
|
-
| `--output, -o` | Output file path [./tokens.css] |
|
|
75
|
-
| `--format` | Output format (see below) |
|
|
76
|
-
| `--no-rules` | Skip syncing AI rules (tokens + rules sync by default) |
|
|
77
|
-
| `--rules-dir` | Directory for rules files [project root] |
|
|
78
|
-
| `-y, --yes` | Auto-confirm changes |
|
|
79
|
-
|
|
80
|
-
### Output Formats
|
|
81
|
-
|
|
82
|
-
**Web:**
|
|
83
|
-
- `css` — CSS custom properties (`:root { --var: value }`)
|
|
84
|
-
- `scss` — CSS vars + SCSS variables (`$var: value`)
|
|
85
|
-
- `less` — CSS vars + Less variables (`@var: value`)
|
|
86
|
-
- `json` — Raw token JSON
|
|
87
|
-
- `ts` — TypeScript with types
|
|
88
|
-
- `js` — JavaScript module
|
|
89
|
-
|
|
90
|
-
**Native:**
|
|
91
|
-
- `swift` — Swift/SwiftUI for iOS
|
|
92
|
-
- `kotlin` — Kotlin/Compose for Android
|
|
93
|
-
- `dart` — Dart for Flutter
|
|
94
|
-
|
|
95
|
-
All formats include **light and dark mode** values.
|
|
96
|
-
|
|
97
12
|
## MCP Server Setup
|
|
98
13
|
|
|
99
|
-
|
|
14
|
+
Connect your AI tool so it can query your design system directly.
|
|
100
15
|
|
|
101
16
|
### Cursor IDE
|
|
102
17
|
|
|
@@ -134,7 +49,7 @@ Create `.windsurf/mcp.json` in your project root (same format as Cursor).
|
|
|
134
49
|
|
|
135
50
|
## MCP Tools
|
|
136
51
|
|
|
137
|
-
Once connected, AI
|
|
52
|
+
Once connected, the AI can call these tools:
|
|
138
53
|
|
|
139
54
|
| Tool | Description |
|
|
140
55
|
|------|-------------|
|
|
@@ -146,43 +61,49 @@ Once connected, AI tools can use these:
|
|
|
146
61
|
| `getAIToolRules(tool)` | Generate AI coding rules for your design system |
|
|
147
62
|
| `exportMCPConfig(tool)` | Get MCP configuration for different tools |
|
|
148
63
|
| `getSetupInstructions(tool)` | Get detailed setup guide |
|
|
149
|
-
| `getDependencies(platform?, stack?)` | Get suggested dependencies (icons, fonts, SKILL.md,
|
|
64
|
+
| `getDependencies(platform?, stack?)` | Get suggested dependencies (icons, fonts, SKILL.md, token files). Optional: `platform` (web, ios, android), `stack` (e.g. react, vue, next). Use with **/--getstarted** prompt. |
|
|
150
65
|
|
|
151
66
|
### getDependencies
|
|
152
67
|
|
|
153
|
-
Returns DS-derived suggestions so the
|
|
154
|
-
|
|
155
|
-
**Parameters (optional):**
|
|
68
|
+
Returns DS-derived suggestions so the AI can build a "Suggested" vs "Already present" list and, after user approval, install or copy assets.
|
|
156
69
|
|
|
157
|
-
|
|
158
|
-
|-----------|-------------|
|
|
159
|
-
| `platform` | `web`, `ios`, or `android` |
|
|
160
|
-
| `stack` | e.g. `react`, `vue`, `next`, `swift`, `kotlin` |
|
|
70
|
+
**Parameters (optional):** `platform` — `web`, `ios`, or `android`; `stack` — e.g. `react`, `vue`, `next`, `swift`, `kotlin`.
|
|
161
71
|
|
|
162
72
|
**Returns (JSON):**
|
|
163
73
|
|
|
164
|
-
- **iconLibrary** — `package`, `nativePackage`, and a
|
|
165
|
-
- **fonts** — Font family names from typography tokens +
|
|
74
|
+
- **iconLibrary** — `package`, `nativePackage`, and a performance hint (use individual SVG imports for tree-shaking).
|
|
75
|
+
- **fonts** — Font family names from typography tokens + performance hint (self-hosted `@font-face`, `font-display: swap`).
|
|
166
76
|
- **skill** — `path` (e.g. `.cursor/skills/atomix-ds/SKILL.md`) and `content` (generic, platform-agnostic SKILL.md).
|
|
167
|
-
- **
|
|
168
|
-
- **tokenFiles** — e.g. `["tokens.css", "tokens.json"]` with short copy instructions.
|
|
77
|
+
- **tokenFiles** — e.g. `["tokens.css", "tokens.json"]` with copy instructions.
|
|
169
78
|
|
|
170
|
-
If the design system
|
|
79
|
+
If the design system is unavailable, the tool may fail; the client should tell the user the design system could not be reached.
|
|
171
80
|
|
|
172
|
-
##
|
|
81
|
+
## MCP Prompts
|
|
173
82
|
|
|
174
|
-
|
|
83
|
+
Run these prompts from your AI tool (e.g. **/--hello**, **/--getstarted**):
|
|
84
|
+
|
|
85
|
+
| Prompt | Description |
|
|
86
|
+
|--------|-------------|
|
|
87
|
+
| **/--hello** | Get started — overview, tokens, and tools. Run this first. |
|
|
88
|
+
| **/--getstarted** | Get started with design system in project. Three phases; creates files only after you approve. |
|
|
89
|
+
| **/--rules** | Governance rules for your AI tool (Cursor, Copilot, Windsurf, etc.). |
|
|
90
|
+
| **/--sync** | Sync tokens to a local file. Use **/--refactor** to migrate deprecated tokens. |
|
|
91
|
+
| **/--refactor** | Migrate deprecated tokens in codebase. Run after **/--sync**. |
|
|
92
|
+
|
|
93
|
+
## --getstarted (get started)
|
|
94
|
+
|
|
95
|
+
The **/--getstarted** prompt suggests dependencies for your design system so you can get up and running quickly. It does **not** install anything by default; the AI presents a list and asks before making changes.
|
|
175
96
|
|
|
176
97
|
**Flow (phased instructions):**
|
|
177
98
|
|
|
178
99
|
1. **Resolve platform and stack** — Infer from the project (e.g. `package.json`, `build.gradle`) or **ask the user** if the project gives no hint (e.g. blank repo). Do not assume web or any default.
|
|
179
|
-
2. **Get suggested dependencies** — Call `getDependencies(platform, stack)`. If the call fails
|
|
100
|
+
2. **Get suggested dependencies** — Call `getDependencies(platform, stack)`. If the call fails, tell the user the design system could not be reached and stop.
|
|
180
101
|
3. **Scan codebase and build suggestion list** — Scan for `package.json` (or equivalent), existing skill path, token files, font/icon usage. Build **Suggested dependencies** (from getDependencies minus what's present) and **Already present**. Do not install or copy anything in this phase.
|
|
181
102
|
4. **Present list and ask before install** — Reply with "Suggested dependencies: …" and "Already present: …" and state: "Do not install or copy anything until you confirm. Would you like me to install or add these?" Only perform steps the user approves.
|
|
182
103
|
5. **Optional: suggest global styles** — If the project has no global styles that use the design system tokens, ask verbatim: "Your project doesn't appear to have global styles that use the design system tokens (e.g. semantic typography scale or semantic color classes). Would you like me to suggest or generate a minimal set (e.g. typography scale + semantic utilities) so you can develop consistently with the DS?"
|
|
183
|
-
6. **Report what was created** — After any install/copy steps, list what was created or updated (e.g. "Installed: lucide-react. Added: .cursor/skills/atomix-ds/SKILL.md.
|
|
104
|
+
6. **Report what was created** — After any install/copy steps, list what was created or updated (e.g. "Installed: lucide-react. Added: .cursor/skills/atomix-ds/SKILL.md. Synced: tokens.css.").
|
|
184
105
|
|
|
185
|
-
**Single SKILL.md:** The
|
|
106
|
+
**Single SKILL.md:** The getstarted flow suggests adding a generic, coding-platform agnostic SKILL at `.cursor/skills/atomix-ds/SKILL.md`. It instructs the AI to call `getAIToolRules({ tool: "<tool>" })` where `<tool>` matches the current environment (cursor, windsurf, copilot, cline, continue, zed, generic).
|
|
186
107
|
|
|
187
108
|
## Token Categories
|
|
188
109
|
|
|
@@ -196,9 +117,91 @@ The **install** prompt suggests dependencies for your design system so you can g
|
|
|
196
117
|
- **motion** — Duration and easing tokens
|
|
197
118
|
- **zIndex** — Layer tokens
|
|
198
119
|
|
|
199
|
-
##
|
|
120
|
+
## Example Usage (MCP)
|
|
121
|
+
|
|
122
|
+
Once MCP is connected, you can say:
|
|
123
|
+
|
|
124
|
+
> "Sync my design tokens to tokens.css"
|
|
125
|
+
|
|
126
|
+
> "What color tokens are available?"
|
|
127
|
+
|
|
128
|
+
> "Use the correct spacing token for 16px padding"
|
|
129
|
+
|
|
130
|
+
> "Validate this: style={{ backgroundColor: '#007061' }}"
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## CLI
|
|
135
|
+
|
|
136
|
+
Use the CLI when you prefer commands over the AI, or in scripts/CI.
|
|
137
|
+
|
|
138
|
+
### Quick Start (CLI)
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
# Sync tokens + AI rules (default behavior)
|
|
142
|
+
npx heyatomix sync
|
|
143
|
+
|
|
144
|
+
# Sync tokens only (skip AI rules)
|
|
145
|
+
npx heyatomix sync --no-rules
|
|
146
|
+
|
|
147
|
+
# Create config file
|
|
148
|
+
npx heyatomix init
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### `heyatomix sync`
|
|
152
|
+
|
|
153
|
+
Sync design tokens and AI rules to your project. **Both tokens and AI guidance rules sync by default** since the rules reference tokens.
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
npx heyatomix sync # Sync tokens + AI rules
|
|
157
|
+
npx heyatomix sync --no-rules # Sync tokens only
|
|
158
|
+
npx heyatomix sync -o src/tokens.css # Custom output path
|
|
159
|
+
npx heyatomix sync --format scss # Output as SCSS
|
|
160
|
+
npx heyatomix sync -y # Auto-confirm changes
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
**File structure:** The output file (e.g., `tokens.css`) is **completely rewritten** on each sync. Preserved: CSS custom properties (variables). Lost: regular CSS rules (selectors, classes, media queries). Keep your tokens file separate from custom CSS (e.g. use `custom.css` for custom styles).
|
|
164
|
+
|
|
165
|
+
### `heyatomix init`
|
|
166
|
+
|
|
167
|
+
Create a `.atomixrc` config file:
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
npx heyatomix init
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
Creates:
|
|
200
174
|
|
|
201
|
-
|
|
175
|
+
```json
|
|
176
|
+
{
|
|
177
|
+
"dsId": "your-design-system-id",
|
|
178
|
+
"output": "./tokens.css",
|
|
179
|
+
"format": "css"
|
|
180
|
+
}
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### CLI Options
|
|
184
|
+
|
|
185
|
+
| Option | Description |
|
|
186
|
+
|--------|-------------|
|
|
187
|
+
| `--ds-id` | Design system ID (or set in .atomixrc) |
|
|
188
|
+
| `--api-key` | API key for private design systems |
|
|
189
|
+
| `--output, -o` | Output file path [./tokens.css] |
|
|
190
|
+
| `--format` | Output format (see below) |
|
|
191
|
+
| `--no-rules` | Skip syncing AI rules (tokens + rules sync by default) |
|
|
192
|
+
| `--rules-dir` | Directory for rules files [project root] |
|
|
193
|
+
| `-y, --yes` | Auto-confirm changes |
|
|
194
|
+
|
|
195
|
+
### Output Formats
|
|
196
|
+
|
|
197
|
+
**Web:** `css`, `scss`, `less`, `json`, `ts`, `js`
|
|
198
|
+
**Native:** `swift`, `kotlin`, `dart`
|
|
199
|
+
|
|
200
|
+
All formats include **light and dark mode** values.
|
|
201
|
+
|
|
202
|
+
### AI Rules Files (CLI)
|
|
203
|
+
|
|
204
|
+
By default, `sync` also updates AI rules files:
|
|
202
205
|
|
|
203
206
|
| File | AI Tool |
|
|
204
207
|
|------|---------|
|
|
@@ -209,25 +212,13 @@ By default, `sync` also updates AI rules files based on which AI tools you use:
|
|
|
209
212
|
| `.github/copilot-instructions.md` | Copilot |
|
|
210
213
|
| `AI_GUIDELINES.md` | Generic |
|
|
211
214
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
## Example Usage
|
|
215
|
-
|
|
216
|
-
**CLI:**
|
|
215
|
+
### Example Usage (CLI)
|
|
217
216
|
|
|
218
217
|
```bash
|
|
219
218
|
npx heyatomix sync
|
|
220
219
|
```
|
|
221
220
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
> "Sync my design tokens to tokens.css"
|
|
225
|
-
|
|
226
|
-
> "What color tokens are available?"
|
|
227
|
-
|
|
228
|
-
> "Use the correct spacing token for 16px padding"
|
|
229
|
-
|
|
230
|
-
> "Validate this: style={{ backgroundColor: '#007061' }}"
|
|
221
|
+
---
|
|
231
222
|
|
|
232
223
|
## Package Aliases
|
|
233
224
|
|
|
@@ -237,6 +228,10 @@ npx heyatomix sync
|
|
|
237
228
|
| `@atomixstudio/mcp` | Full MCP server + CLI |
|
|
238
229
|
| `atomix-sync` | Legacy alias (deprecated) |
|
|
239
230
|
|
|
231
|
+
## Troubleshooting
|
|
232
|
+
|
|
233
|
+
**MCP shows old prompts or tools after updating:** Your IDE or npx may be using a cached version. Quit the IDE, clear the npx cache (`rm -rf ~/.npm/_npx` on macOS/Linux, or delete the `_npx` folder inside your [npm cache directory](https://docs.npmjs.com/cli/v10/commands/npm-cache)), then reopen the IDE and reconnect the MCP server.
|
|
234
|
+
|
|
240
235
|
## Links
|
|
241
236
|
|
|
242
237
|
- [Atomix Studio](https://atomixstudio.eu)
|
package/dist/index.js
CHANGED
|
@@ -1345,7 +1345,7 @@ var TOKEN_CATEGORIES = ["colors", "typography", "spacing", "sizing", "shadows",
|
|
|
1345
1345
|
var server = new Server(
|
|
1346
1346
|
{
|
|
1347
1347
|
name: "atomix-mcp-user",
|
|
1348
|
-
version: "1.0.
|
|
1348
|
+
version: "1.0.15"
|
|
1349
1349
|
},
|
|
1350
1350
|
{
|
|
1351
1351
|
capabilities: {
|
|
@@ -1490,7 +1490,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
1490
1490
|
},
|
|
1491
1491
|
{
|
|
1492
1492
|
name: "getDependencies",
|
|
1493
|
-
description: "Get suggested dependencies for this design system (icon package, fonts, SKILL.md, token files). Use with atomix
|
|
1493
|
+
description: "Get suggested dependencies for this design system (icon package, fonts, SKILL.md, token files). Use with atomix-setup prompt. Optional platform and stack for tailored suggestions.",
|
|
1494
1494
|
inputSchema: {
|
|
1495
1495
|
type: "object",
|
|
1496
1496
|
properties: {
|
|
@@ -2159,23 +2159,8 @@ description: Use this design system when editing UI, design system files, or whe
|
|
|
2159
2159
|
var AI_TOOLS = ["cursor", "copilot", "windsurf", "cline", "continue", "zed", "generic"];
|
|
2160
2160
|
server.setRequestHandler(ListResourcesRequestSchema, async () => {
|
|
2161
2161
|
try {
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
const resources = [
|
|
2165
|
-
{
|
|
2166
|
-
uri: "atomix://hello",
|
|
2167
|
-
name: `Welcome to ${data.meta.name}`,
|
|
2168
|
-
description: `Design system overview with ${stats.total} tokens and ${stats.governanceRules} governance rules`,
|
|
2169
|
-
mimeType: "text/markdown"
|
|
2170
|
-
},
|
|
2171
|
-
...AI_TOOLS.map((tool) => ({
|
|
2172
|
-
uri: `atomix://rules/${tool}`,
|
|
2173
|
-
name: `${tool.charAt(0).toUpperCase() + tool.slice(1)} Rules`,
|
|
2174
|
-
description: `Design system rules file for ${tool}`,
|
|
2175
|
-
mimeType: "text/markdown"
|
|
2176
|
-
}))
|
|
2177
|
-
];
|
|
2178
|
-
return { resources };
|
|
2162
|
+
await fetchDesignSystemForMCP();
|
|
2163
|
+
return { resources: [] };
|
|
2179
2164
|
} catch {
|
|
2180
2165
|
return {
|
|
2181
2166
|
resources: [
|
|
@@ -2254,75 +2239,31 @@ Get your DS ID from: https://atomixstudio.eu/ds/[your-ds-id]`
|
|
|
2254
2239
|
});
|
|
2255
2240
|
server.setRequestHandler(ListPromptsRequestSchema, async () => {
|
|
2256
2241
|
const prompts = [
|
|
2242
|
+
{ name: "--hello", description: "Get started with this design system - overview, tokens, and tools. Run this first!" },
|
|
2257
2243
|
{
|
|
2258
|
-
name: "
|
|
2259
|
-
description: "
|
|
2260
|
-
},
|
|
2261
|
-
{
|
|
2262
|
-
name: "design-system-rules",
|
|
2263
|
-
description: "Get the design system governance rules for your AI coding tool",
|
|
2244
|
+
name: "--setup",
|
|
2245
|
+
description: "Setup design system in project. Three phases: scan, report and ask, then create only after you approve.",
|
|
2264
2246
|
arguments: [
|
|
2265
|
-
{
|
|
2266
|
-
|
|
2267
|
-
description: "AI tool to generate rules for (cursor, copilot, windsurf, cline, continue, zed, generic)",
|
|
2268
|
-
required: false
|
|
2269
|
-
}
|
|
2247
|
+
{ name: "platform", description: "Target platform (web, ios, android). Optional.", required: false },
|
|
2248
|
+
{ name: "stack", description: "Stack or framework (e.g. react, vue, next, swift, kotlin). Optional.", required: false }
|
|
2270
2249
|
]
|
|
2271
2250
|
},
|
|
2272
2251
|
{
|
|
2273
|
-
name: "
|
|
2274
|
-
description: "
|
|
2275
|
-
},
|
|
2276
|
-
{
|
|
2277
|
-
name: "radius",
|
|
2278
|
-
description: "List all border radius tokens with their values in a table format"
|
|
2279
|
-
},
|
|
2280
|
-
{
|
|
2281
|
-
name: "color",
|
|
2282
|
-
description: "List all color tokens with light/dark mode values in a table format"
|
|
2283
|
-
},
|
|
2284
|
-
{
|
|
2285
|
-
name: "typography",
|
|
2286
|
-
description: "List all typography tokens with their values in a table format"
|
|
2287
|
-
},
|
|
2288
|
-
{
|
|
2289
|
-
name: "shadow",
|
|
2290
|
-
description: "List all shadow/elevation tokens with their values in a table format"
|
|
2291
|
-
},
|
|
2292
|
-
{
|
|
2293
|
-
name: "border",
|
|
2294
|
-
description: "List all border width tokens with their values in a table format"
|
|
2295
|
-
},
|
|
2296
|
-
{
|
|
2297
|
-
name: "sizing",
|
|
2298
|
-
description: "List all sizing tokens (height, icon) with their values in a table format"
|
|
2299
|
-
},
|
|
2300
|
-
{
|
|
2301
|
-
name: "motion",
|
|
2302
|
-
description: "List all motion tokens (duration, easing) with their values in a table format"
|
|
2303
|
-
},
|
|
2304
|
-
{
|
|
2305
|
-
name: "sync",
|
|
2306
|
-
description: "Sync design tokens (./tokens.css). Safe: Adds new tokens, updates existing values, marks deprecated tokens. Supports formats: css, scss, less, json, ts, js, swift, kotlin, dart. Use /refactor to migrate deprecated tokens."
|
|
2307
|
-
},
|
|
2308
|
-
{
|
|
2309
|
-
name: "refactor",
|
|
2310
|
-
description: "Migrate deprecated tokens in codebase. Scans for deprecated tokens marked by /sync and suggests replacements. Run after /sync to update code."
|
|
2311
|
-
},
|
|
2312
|
-
{
|
|
2313
|
-
name: "setup",
|
|
2314
|
-
description: "Suggest dependencies for this design system (icons, fonts, SKILL.md, tokens). Three phases: scan, report and ask, then create only after approval.",
|
|
2252
|
+
name: "--rules",
|
|
2253
|
+
description: "Get the design system governance rules for your AI coding tool",
|
|
2315
2254
|
arguments: [
|
|
2316
|
-
{ name: "
|
|
2317
|
-
{ name: "stack", description: "Stack or framework (e.g. react, vue, next, swift, kotlin). Optional.", required: false }
|
|
2255
|
+
{ name: "tool", description: "AI tool (cursor, copilot, windsurf, cline, continue, zed, generic). Optional.", required: false }
|
|
2318
2256
|
]
|
|
2319
|
-
}
|
|
2257
|
+
},
|
|
2258
|
+
{ name: "--sync", description: "Sync tokens to a local file. Safe: adds new, updates existing, marks deprecated. Use /--refactor to migrate." },
|
|
2259
|
+
{ name: "--refactor", description: "Migrate deprecated tokens in codebase. Run after /--sync." }
|
|
2320
2260
|
];
|
|
2321
2261
|
return { prompts };
|
|
2322
2262
|
});
|
|
2323
2263
|
server.setRequestHandler(GetPromptRequestSchema, async (request) => {
|
|
2324
2264
|
const { name, arguments: args } = request.params;
|
|
2325
|
-
const
|
|
2265
|
+
const canonicalName = name === "--hello" ? "hello" : name === "--setup" ? "atomix-setup" : name === "--rules" ? "design-system-rules" : name === "--sync" ? "sync" : name === "--refactor" ? "refactor" : name;
|
|
2266
|
+
const shouldForceRefresh = canonicalName === "sync";
|
|
2326
2267
|
let data = null;
|
|
2327
2268
|
let stats = null;
|
|
2328
2269
|
try {
|
|
@@ -2427,9 +2368,18 @@ Configure the MCP server in your Cursor settings, then restart Cursor.`
|
|
|
2427
2368
|
lines.push(instructions);
|
|
2428
2369
|
return lines.join("\n");
|
|
2429
2370
|
};
|
|
2430
|
-
switch (
|
|
2371
|
+
switch (canonicalName) {
|
|
2431
2372
|
case "hello": {
|
|
2432
2373
|
const welcome = generateWelcomeMessage(data, stats);
|
|
2374
|
+
const helloInstruction = `You are showing the Atomix design system welcome. You MUST do the following in order:
|
|
2375
|
+
|
|
2376
|
+
1. **First** \u2014 Copy and draw the ASCII art block exactly as it appears below (the code block with the arrow pattern). Output it verbatim before any other text. Do not summarize, skip, or replace it with a description.
|
|
2377
|
+
2. **Then** \u2014 Output the rest of the welcome message (markdown) exactly as given.
|
|
2378
|
+
|
|
2379
|
+
Do not add any introduction or commentary before the ASCII art. The ASCII art must be the very first thing you output.
|
|
2380
|
+
|
|
2381
|
+
---
|
|
2382
|
+
${welcome}`;
|
|
2433
2383
|
return {
|
|
2434
2384
|
description: `Hello \u2014 ${data.meta.name} Design System`,
|
|
2435
2385
|
messages: [
|
|
@@ -2437,7 +2387,7 @@ Configure the MCP server in your Cursor settings, then restart Cursor.`
|
|
|
2437
2387
|
role: "user",
|
|
2438
2388
|
content: {
|
|
2439
2389
|
type: "text",
|
|
2440
|
-
text:
|
|
2390
|
+
text: helloInstruction
|
|
2441
2391
|
}
|
|
2442
2392
|
}
|
|
2443
2393
|
]
|
|
@@ -2743,8 +2693,16 @@ Use \`/color\`, \`/spacing\`, \`/radius\`, \`/typography\`, \`/shadow\`, \`/bord
|
|
|
2743
2693
|
]
|
|
2744
2694
|
};
|
|
2745
2695
|
}
|
|
2746
|
-
case "setup": {
|
|
2747
|
-
const setupInstructions = `You are running **atomix
|
|
2696
|
+
case "atomix-setup": {
|
|
2697
|
+
const setupInstructions = `You are running **atomix-setup** (design system setup). Three phases only.
|
|
2698
|
+
|
|
2699
|
+
**Rule:** Do not create, write, or modify any file until Phase 3 and only after the user has explicitly approved (e.g. replied "Yes", "Yes for all", "Go ahead"). Creating or modifying files before the user approves is a rule violation.
|
|
2700
|
+
|
|
2701
|
+
## Todo list (required)
|
|
2702
|
+
|
|
2703
|
+
- **Create a todo list** at the start with items for Phase 1, Phase 2, and Phase 3 (e.g. "Phase 1: Scan", "Phase 2: Report and ask", "Phase 3: Create after approval").
|
|
2704
|
+
- Work **step by step**: complete Phase 1, then Phase 2; do not run Phase 3 until the user has replied with approval.
|
|
2705
|
+
- Mark todo items completed as you finish each phase. Use this pattern so the user and you can track progress.
|
|
2748
2706
|
|
|
2749
2707
|
## Phase 1 \u2013 Scan
|
|
2750
2708
|
|
|
@@ -2776,9 +2734,9 @@ Use \`/color\`, \`/spacing\`, \`/radius\`, \`/typography\`, \`/shadow\`, \`/bord
|
|
|
2776
2734
|
|
|
2777
2735
|
---
|
|
2778
2736
|
|
|
2779
|
-
|
|
2737
|
+
Create your todo list first, then execute Phase 1 (resolve platform/stack, call getDependencies, scan, build lists). Then Phase 2 (report lists and ask). Do not perform Phase 3 until the user replies.`;
|
|
2780
2738
|
return {
|
|
2781
|
-
description: "Setup design system in project (atomix
|
|
2739
|
+
description: "Setup design system in project (atomix-setup). Create todo list; Phase 1 scan, Phase 2 report and ask, Phase 3 create only after user approval.",
|
|
2782
2740
|
messages: [
|
|
2783
2741
|
{
|
|
2784
2742
|
role: "user",
|
|
@@ -2848,25 +2806,13 @@ ${tokenSummary}
|
|
|
2848
2806
|
|
|
2849
2807
|
| Command | What to expect |
|
|
2850
2808
|
|---------|----------------|
|
|
2851
|
-
| **
|
|
2852
|
-
| **
|
|
2853
|
-
| **
|
|
2854
|
-
|
|
2855
|
-
|
|
2809
|
+
| **/--hello** | Get started - overview, tokens, and tools. Run this first! |
|
|
2810
|
+
| **/--setup** | Setup design system in project. Three phases; creates files only after you approve. |
|
|
2811
|
+
| **/--rules** | Governance rules for your AI tool (Cursor, Copilot, Windsurf, etc.). |
|
|
2812
|
+
| **/--sync** | Sync tokens to a local file. Safe: adds new, updates existing, marks deprecated. |
|
|
2813
|
+
| **/--refactor** | Migrate deprecated tokens in codebase. Run after /--sync. |
|
|
2856
2814
|
|
|
2857
|
-
|
|
2858
|
-
|---------|----------------|
|
|
2859
|
-
| **design-system-rules** | Returns governance rules for your AI tools. |
|
|
2860
|
-
| **spacing** | Table of all spacing tokens and values. |
|
|
2861
|
-
| **color** | Table of color tokens with light/dark values. |
|
|
2862
|
-
| **typography** | Table of typography tokens and values. |
|
|
2863
|
-
| **radius** | Table of border radius tokens. |
|
|
2864
|
-
| **shadow** | Table of shadow/elevation tokens. |
|
|
2865
|
-
| **border** | Table of border width tokens. |
|
|
2866
|
-
| **sizing** | Table of height and icon size tokens. |
|
|
2867
|
-
| **motion** | Table of duration and easing tokens. |
|
|
2868
|
-
|
|
2869
|
-
**Suggested next step:** Run **setup** to set up global styles, icons, fonts, and token files; the AI will list options and ask before adding anything.
|
|
2815
|
+
**Suggested next step:** Run **/--setup** to set up global styles, icons, fonts, and token files; the AI will list options and ask before adding anything.
|
|
2870
2816
|
|
|
2871
2817
|
---
|
|
2872
2818
|
|