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 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
- ⚠️ CRITICAL: MANDATORY FLOW BEFORE CALLING
44
+ ⚠️ MANDATORY: CHECK FOR design-system.md FIRST
45
45
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
46
46
 
47
- STEP 1: CHECK PROJECT STATE
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
- B) PROJECT EXISTS but NO frontend files yet:
54
- Proceed to Step 2 (Vibe Selection) - MANDATORY
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
- C) PROJECT EXISTS with existing frontend code:
57
- Analyze existing files, pass as context
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
- STEP 2: VIBE SELECTION (Required for new designs)
62
- ──────────────────────────────────────────────────
63
- Call generate_vibes tool FIRST to get 5 creative vibes from Gemini.
64
- Present options to user, they select one, then pass it here via designSystem.vibe.
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
- ⚠️ CRITICAL: PASS DESIGN TOKENS IN CONTEXT
102
+ 📋 PARAMETERS
102
103
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
103
104
 
104
- Pass your styling files (CSS, SCSS, theme config) with design tokens in the 'context' parameter.
105
- Otherwise Gemini may introduce standalone styles that don't match your design system.
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
- ⚠️ CRITICAL: DESIGN SYSTEM INTEGRATION
194
+ 📋 PARAMETERS
196
195
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
197
196
 
198
- For EXISTING PROJECTS, you MUST pass the design tokens to avoid mismatched styles:
199
-
200
- 1. Pass the CSS/globals file in the 'context' parameter
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 a new project using Gemini AI.
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 BEFORE calling create_frontend on a NEW project that has no existing design.
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. User asks to create frontend for a NEW project
259
- 2. Call generate_vibes with project description
260
- 3. Present the 5 vibes to the user
261
- 4. User selects their preferred vibe
262
- 5. Call create_frontend with the selected vibe in designSystem.vibe
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 vibes, each with:
269
- - emoji: Visual identifier
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
- Example vibe:
275
- 🏛️ "Pristine Museum"
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
  }
@@ -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 CONTEXT IS PROVIDED)
264
-
265
- When existing project context is provided, you MUST:
266
- - NEVER add inline <style> tags - use ONLY the styling approach from the context
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 project's existing font definitions
269
- - NEVER hardcode colors - use the project's existing color tokens/variables/classes
270
- - Match the EXACT spacing scale, typography scale, and color palette
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 OBLIGATOIRE:
608
- Si un design system est fourni, tu DOIS :
609
- - Copier EXACTEMENT les styles, classes, et patterns spécifiés
610
- - NE JAMAIS inventer de nouvelles couleurs, paddings, ou border-radius
611
- - Utiliser les composants définis (Button Primary, Input, Card, etc.)
612
- - Respecter les tailles définies (sm/md/lg) sans les modifier
613
- - Si un élément n'existe pas dans le design system, le créer en utilisant UNIQUEMENT les tokens définis
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 INTEGRATION (CRITICAL - READ THIS FIRST)**
689
- - NEVER add inline <style> tags or CSS-in-JS style objects - use ONLY the styling approach from the context
690
- - NEVER hardcode pixel values (padding: 120px, font-size: 42px) - use the project's existing variables, tokens, or utility classes
691
- - NEVER introduce new fonts - use the project's existing font definitions
692
- - NEVER hardcode colors - use the project's existing color tokens/variables/classes
693
- - If context includes design tokens, variables, or classes, you MUST use them exclusively
694
- - The snippet must integrate SEAMLESSLY - it should look like it was always part of the codebase, not a "foreign block"
695
- - Match the exact spacing scale, typography scale, and color palette of the existing project
696
- - Adapt to whatever styling system the project uses (CSS modules, utility classes, SCSS, styled-components, etc.)
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gemini-design-mcp",
3
- "version": "3.12.7",
3
+ "version": "3.12.9",
4
4
  "description": "MCP server that uses Gemini 3 Pro for frontend/design code generation",
5
5
  "main": "build/index.js",
6
6
  "bin": {