gemini-design-mcp 3.12.7 → 3.12.9
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/build/index.js +39 -64
- package/build/prompts/system.js +61 -27
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -41,27 +41,28 @@ This tool is for creating NEW files that need HIGH-QUALITY DESIGN.
|
|
|
41
41
|
• Creating config files → You can do this yourself
|
|
42
42
|
|
|
43
43
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
44
|
-
⚠️
|
|
44
|
+
⚠️ MANDATORY: CHECK FOR design-system.md FIRST
|
|
45
45
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
─────────────────────────────
|
|
49
|
-
A) EMPTY REPO (no package.json):
|
|
50
|
-
→ Ask user: "What tech stack do you want?"
|
|
51
|
-
→ Help them initialize first
|
|
47
|
+
BEFORE calling this tool, check if design-system.md exists at project root.
|
|
52
48
|
|
|
53
|
-
|
|
54
|
-
|
|
49
|
+
IF IT DOES NOT EXIST:
|
|
50
|
+
1. Call generate_vibes first
|
|
51
|
+
2. Write the returned code to vibes-selection.tsx
|
|
52
|
+
3. Ask user to open the page and pick their favorite vibe
|
|
53
|
+
4. Extract THE ENTIRE CODE between <!-- VIBE_X_START --> and <!-- VIBE_X_END -->
|
|
54
|
+
5. Save it to design-system.md
|
|
55
|
+
6. THEN call this tool
|
|
55
56
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
→ Skip vibe selection
|
|
59
|
-
→ ⚠️ MUST pass CSS/globals file with design tokens in 'context' parameter
|
|
57
|
+
IF IT EXISTS:
|
|
58
|
+
Read it and pass its ENTIRE content in the designSystem parameter.
|
|
60
59
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
60
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
61
|
+
📋 PARAMETERS
|
|
62
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
63
|
+
|
|
64
|
+
• designSystem: Copy-paste the ENTIRE content of design-system.md (all the code)
|
|
65
|
+
• context: Functional/business context only (what it does, features, requirements)
|
|
65
66
|
|
|
66
67
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
67
68
|
📤 OUTPUT
|
|
@@ -98,13 +99,11 @@ Use this to REDESIGN existing UI elements that need better design.
|
|
|
98
99
|
• "Center this div" → Just add flex classes yourself
|
|
99
100
|
|
|
100
101
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
101
|
-
|
|
102
|
+
📋 PARAMETERS
|
|
102
103
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
103
104
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
Example: "Project uses: var(--font-heading), var(--bg-primary), .section-padding class"
|
|
105
|
+
• designSystem: Copy-paste the ENTIRE content of design-system.md (all the code)
|
|
106
|
+
• context: Functional/business context only (what the modification achieves)
|
|
108
107
|
|
|
109
108
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
110
109
|
📤 OUTPUT FORMAT
|
|
@@ -192,31 +191,12 @@ Use this for ANY new UI component that needs visual design:
|
|
|
192
191
|
| Loading spinner | ❌ NO | Too simple |
|
|
193
192
|
|
|
194
193
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
195
|
-
|
|
194
|
+
📋 PARAMETERS
|
|
196
195
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
197
196
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
2. Include CSS variables, classes, and color tokens in 'insertionContext'
|
|
202
|
-
3. Gemini will then use YOUR design system instead of creating standalone styles
|
|
203
|
-
|
|
204
|
-
Without this, the snippet will have:
|
|
205
|
-
❌ Hardcoded px values instead of your spacing variables
|
|
206
|
-
❌ Hardcoded colors instead of your color tokens
|
|
207
|
-
❌ New fonts instead of your font definitions
|
|
208
|
-
❌ Standalone styles that don't match your project
|
|
209
|
-
|
|
210
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
211
|
-
⚠️ REQUIRED: INSERTION CONTEXT
|
|
212
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
213
|
-
|
|
214
|
-
Tell Gemini WHERE and WHICH design tokens to use:
|
|
215
|
-
|
|
216
|
-
Good: "After the header in Dashboard. Use project tokens:
|
|
217
|
-
var(--font-heading) for titles, var(--bg-primary), .section-padding class."
|
|
218
|
-
|
|
219
|
-
Bad: "In the dashboard"
|
|
197
|
+
• designSystem: Copy-paste the ENTIRE content of design-system.md (all the code)
|
|
198
|
+
• context: Functional/business context only (what it does, features, requirements)
|
|
199
|
+
• insertionContext: WHERE in the file this snippet will go (after header, inside main, etc.)
|
|
220
200
|
|
|
221
201
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
222
202
|
📤 OUTPUT FORMAT
|
|
@@ -240,41 +220,36 @@ YOU (the agent) are responsible for:
|
|
|
240
220
|
- Inserting the returned snippet into the correct location in the file`, snippetFrontendSchema, snippetFrontend);
|
|
241
221
|
|
|
242
222
|
// TOOL 4: GENERATE_VIBES
|
|
243
|
-
server.tool("generate_vibes", `Generate 5 unique design vibes for
|
|
223
|
+
server.tool("generate_vibes", `Generate a visual page with 5 unique design vibes for user selection.
|
|
244
224
|
|
|
245
225
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
246
226
|
🎯 WHEN TO USE THIS TOOL
|
|
247
227
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
248
228
|
|
|
249
|
-
Use this tool
|
|
250
|
-
|
|
251
|
-
This tool generates creative, unique design vibes tailored to the project context.
|
|
252
|
-
The user then selects one, and you pass it to create_frontend.
|
|
229
|
+
Use this tool when design-system.md DOES NOT EXIST at project root.
|
|
253
230
|
|
|
254
231
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
255
|
-
📋 FLOW
|
|
232
|
+
📋 COMPLETE FLOW
|
|
256
233
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
257
234
|
|
|
258
|
-
1.
|
|
259
|
-
2.
|
|
260
|
-
3.
|
|
261
|
-
4. User
|
|
262
|
-
5.
|
|
235
|
+
1. Call generate_vibes with projectDescription
|
|
236
|
+
2. Write the returned code to vibes-selection.tsx (or .jsx)
|
|
237
|
+
3. Ask user: "Can you open vibes-selection and pick your favorite vibe?"
|
|
238
|
+
4. User opens the page, sees 5 distinct visual sections, picks one: "vibe 3"
|
|
239
|
+
5. Extract THE ENTIRE CODE between <!-- VIBE_X_START --> and <!-- VIBE_X_END -->
|
|
240
|
+
6. Save it to design-system.md
|
|
241
|
+
7. Ask: "Delete vibes-selection.tsx?"
|
|
242
|
+
8. Now you can call create_frontend, modify_frontend, snippet_frontend
|
|
263
243
|
|
|
264
244
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
265
245
|
📤 OUTPUT
|
|
266
246
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
267
247
|
|
|
268
|
-
Returns 5
|
|
269
|
-
|
|
270
|
-
- name: Memorable vibe name
|
|
271
|
-
- description: 2-3 evocative sentences
|
|
272
|
-
- keywords: Style keywords for the designer
|
|
248
|
+
Returns FULL CODE for a page with 5 visual sections (vibes).
|
|
249
|
+
Each vibe is wrapped in <!-- VIBE_X_START --> and <!-- VIBE_X_END --> markers.
|
|
273
250
|
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
An ultra-clean, 'white-cube' aesthetic focused on vast negative space.
|
|
277
|
-
Keywords: minimal, whitespace, gallery, clean, sophisticated`, generateVibesSchema, generateVibes);
|
|
251
|
+
The user opens this page in browser to visually compare all 5 vibes.
|
|
252
|
+
They pick one, you extract that vibe's code and save it to design-system.md.`, generateVibesSchema, generateVibes);
|
|
278
253
|
|
|
279
254
|
return server;
|
|
280
255
|
}
|
package/build/prompts/system.js
CHANGED
|
@@ -260,18 +260,30 @@ Gut-check questions to ensure you're not shipping mediocrity:
|
|
|
260
260
|
|
|
261
261
|
---
|
|
262
262
|
|
|
263
|
-
## DESIGN SYSTEM INTEGRATION (CRITICAL WHEN
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
263
|
+
## DESIGN SYSTEM INTEGRATION (CRITICAL WHEN DESIGN SYSTEM IS PROVIDED)
|
|
264
|
+
|
|
265
|
+
The design system is a STYLE REFERENCE, not content to copy literally.
|
|
266
|
+
|
|
267
|
+
**EXTRACT THE STYLE (use these):**
|
|
268
|
+
- Colors (backgrounds, text colors, accents, gradients)
|
|
269
|
+
- Typography (fonts, sizes, weights)
|
|
270
|
+
- Spacing scale (padding, margin, gaps)
|
|
271
|
+
- Visual effects (shadows, borders, border-radius, glassmorphism, animations)
|
|
272
|
+
- CSS classes and patterns
|
|
273
|
+
- Component structure (layout, flex/grid patterns)
|
|
274
|
+
|
|
275
|
+
**DO NOT COPY THE CONTENT (adapt to context):**
|
|
276
|
+
- Specific icons (Cpu, ShieldCheck, etc.) → use icons APPROPRIATE to the functional context
|
|
277
|
+
- Placeholder text ("Sarah System", "Task completed") → use RELEVANT content
|
|
278
|
+
- Example data (numbers, stats, names) → adapt to the real context
|
|
279
|
+
- Specific images or illustrations
|
|
280
|
+
|
|
281
|
+
**TECHNICAL RULES:**
|
|
282
|
+
- NEVER add inline <style> tags - use ONLY the styling approach from the design system
|
|
267
283
|
- NEVER hardcode pixel values - use the project's existing variables, tokens, or classes
|
|
268
|
-
- NEVER introduce new fonts - use the
|
|
269
|
-
- NEVER hardcode colors - use the
|
|
270
|
-
-
|
|
271
|
-
- The new file must look like it belongs to the same project, not a "foreign" design
|
|
272
|
-
- Reuse existing component patterns, class naming conventions, and styling architecture
|
|
273
|
-
- Adapt to whatever styling system the project uses (analyze the context)
|
|
274
|
-
- DONT use fake "SYSTEM STATUS : OPERATIONAL" or something like that
|
|
284
|
+
- NEVER introduce new fonts - use the design system's font definitions
|
|
285
|
+
- NEVER hardcode colors - use the design system's color tokens/variables/classes
|
|
286
|
+
- The new file must LOOK like the design system but CONTAIN relevant content for the context
|
|
275
287
|
|
|
276
288
|
---
|
|
277
289
|
|
|
@@ -604,13 +616,26 @@ UTILISER EXACTEMENT :
|
|
|
604
616
|
// Added to modify/snippet prompts when design system is loaded
|
|
605
617
|
// =============================================================================
|
|
606
618
|
export const DESIGN_SYSTEM_USAGE_INSTRUCTIONS = `
|
|
607
|
-
RÈGLE CRITIQUE - DESIGN SYSTEM
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
-
|
|
613
|
-
-
|
|
619
|
+
RÈGLE CRITIQUE - DESIGN SYSTEM = RÉFÉRENCE DE STYLE (PAS DE CONTENU À COPIER)
|
|
620
|
+
|
|
621
|
+
Le design system fourni est un EXEMPLE DE STYLE. Tu dois extraire et utiliser :
|
|
622
|
+
|
|
623
|
+
✅ À UTILISER (le style) :
|
|
624
|
+
- Les couleurs (backgrounds, text colors, accents, gradients)
|
|
625
|
+
- La typographie (fonts, sizes, weights, line-heights)
|
|
626
|
+
- Les espacements (padding, margin, gaps)
|
|
627
|
+
- Les effets visuels (shadows, borders, border-radius, glassmorphism, animations)
|
|
628
|
+
- Les classes CSS et patterns de styling
|
|
629
|
+
- La structure des composants (layout, flex/grid patterns)
|
|
630
|
+
|
|
631
|
+
❌ À NE PAS COPIER (le contenu d'exemple) :
|
|
632
|
+
- Les icônes spécifiques (Cpu, ShieldCheck, etc.) → utilise des icônes APPROPRIÉES au contexte fonctionnel
|
|
633
|
+
- Les textes placeholder ("Sarah System", "Task completed", etc.) → utilise du contenu PERTINENT
|
|
634
|
+
- Les données d'exemple (nombres, stats, noms) → adapte au contexte réel
|
|
635
|
+
- Les images ou illustrations spécifiques
|
|
636
|
+
|
|
637
|
+
IMPORTANT : Le design system montre COMMENT styler, pas QUOI afficher.
|
|
638
|
+
Adapte le CONTENU au contexte fonctionnel fourni, en gardant le STYLE du design system.
|
|
614
639
|
`;
|
|
615
640
|
|
|
616
641
|
// =============================================================================
|
|
@@ -685,15 +710,24 @@ CRITICAL RULE - FUNCTIONAL CODE ONLY:
|
|
|
685
710
|
|
|
686
711
|
SNIPPET PRINCIPLES:
|
|
687
712
|
|
|
688
|
-
1. **DESIGN SYSTEM
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
-
|
|
713
|
+
1. **DESIGN SYSTEM = STYLE REFERENCE (NOT CONTENT TO COPY)**
|
|
714
|
+
|
|
715
|
+
The design system shows HOW to style, not WHAT to display.
|
|
716
|
+
|
|
717
|
+
**USE the style:**
|
|
718
|
+
- Colors, typography, spacing, effects, CSS classes, component structure
|
|
719
|
+
|
|
720
|
+
**DO NOT copy the content:**
|
|
721
|
+
- Specific icons (Cpu, ShieldCheck) → use icons APPROPRIATE to the functional context
|
|
722
|
+
- Placeholder text ("Sarah System") → use RELEVANT content from the context
|
|
723
|
+
- Example data → adapt to the real context
|
|
724
|
+
|
|
725
|
+
**TECHNICAL RULES:**
|
|
726
|
+
- NEVER add inline <style> tags - use ONLY the styling approach from the design system
|
|
727
|
+
- NEVER hardcode pixel values - use the project's existing variables, tokens, or utility classes
|
|
728
|
+
- NEVER introduce new fonts - use the design system's font definitions
|
|
729
|
+
- NEVER hardcode colors - use the design system's color tokens/variables/classes
|
|
730
|
+
- The snippet must integrate SEAMLESSLY with the design system's STYLE while having RELEVANT content
|
|
697
731
|
|
|
698
732
|
2. **CONTEXTUAL AWARENESS**
|
|
699
733
|
- The snippet will be inserted into an existing codebase
|