gemini-design-mcp 3.6.7 → 3.6.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
|
@@ -48,6 +48,7 @@ B) PROJECT EXISTS but NO frontend files yet:
|
|
|
48
48
|
C) PROJECT EXISTS with existing frontend code:
|
|
49
49
|
→ Analyze existing files, pass as context
|
|
50
50
|
→ Skip vibe selection
|
|
51
|
+
→ ⚠️ MUST pass CSS/globals file with design tokens in 'context' parameter
|
|
51
52
|
|
|
52
53
|
STEP 2: VIBE SELECTION (Required for new designs)
|
|
53
54
|
──────────────────────────────────────────────────
|
|
@@ -91,6 +92,15 @@ Use this to REDESIGN existing UI elements that need better design.
|
|
|
91
92
|
• "Add onClick handler" → Just code, do it yourself
|
|
92
93
|
• "Center this div" → Just add flex classes yourself
|
|
93
94
|
|
|
95
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
96
|
+
⚠️ CRITICAL: PASS DESIGN TOKENS IN CONTEXT
|
|
97
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
98
|
+
|
|
99
|
+
Pass your styling files (CSS, SCSS, theme config) with design tokens in the 'context' parameter.
|
|
100
|
+
Otherwise Gemini may introduce standalone styles that don't match your design system.
|
|
101
|
+
|
|
102
|
+
Example: "Project uses: var(--font-heading), var(--bg-primary), .section-padding class"
|
|
103
|
+
|
|
94
104
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
95
105
|
📤 OUTPUT FORMAT
|
|
96
106
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
@@ -177,15 +187,30 @@ Use this for ANY new UI component that needs visual design:
|
|
|
177
187
|
| Single input | ❌ NO | Too simple |
|
|
178
188
|
| Loading spinner | ❌ NO | Too simple |
|
|
179
189
|
|
|
190
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
191
|
+
⚠️ CRITICAL: DESIGN SYSTEM INTEGRATION
|
|
192
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
193
|
+
|
|
194
|
+
For EXISTING PROJECTS, you MUST pass the design tokens to avoid mismatched styles:
|
|
195
|
+
|
|
196
|
+
1. Pass the CSS/globals file in the 'context' parameter
|
|
197
|
+
2. Include CSS variables, classes, and color tokens in 'insertionContext'
|
|
198
|
+
3. Gemini will then use YOUR design system instead of creating standalone styles
|
|
199
|
+
|
|
200
|
+
Without this, the snippet will have:
|
|
201
|
+
❌ Hardcoded px values instead of your spacing variables
|
|
202
|
+
❌ Hardcoded colors instead of your color tokens
|
|
203
|
+
❌ New fonts instead of your font definitions
|
|
204
|
+
❌ Standalone styles that don't match your project
|
|
205
|
+
|
|
180
206
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
181
207
|
⚠️ REQUIRED: INSERTION CONTEXT
|
|
182
208
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
183
209
|
|
|
184
|
-
Tell Gemini WHERE and
|
|
210
|
+
Tell Gemini WHERE and WHICH design tokens to use:
|
|
185
211
|
|
|
186
|
-
Good: "After the header in Dashboard.
|
|
187
|
-
|
|
188
|
-
search results with icons and subtitles."
|
|
212
|
+
Good: "After the header in Dashboard. Use project tokens:
|
|
213
|
+
var(--font-heading) for titles, var(--bg-primary), .section-padding class."
|
|
189
214
|
|
|
190
215
|
Bad: "In the dashboard"
|
|
191
216
|
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const CREATE_FRONTEND_PROMPT = "You are an elite UI/UX Designer creating production-ready, visually stunning interfaces.\n\nYOUR TASK: Create a COMPLETE, NEW frontend file.\n\nDESIGN EXCELLENCE REQUIREMENTS:\n\n1. **MAXIMUM DETAIL AND DENSITY**\n - The interface MUST be densely populated and feature-rich\n - NEVER produce simple wireframes, empty containers, or placeholder content\n - Fill the space with intricate details, realistic content, background elements, and meaningful UI components\n - Every section should feel like a fully finished, polished product\n\n2. **PREMIUM VISUAL STYLING**\n - Apply high-end design principles throughout\n - Use sophisticated styling: nuanced shadows, subtle gradients, refined borders, micro-textures\n - Add depth and dimension with layered elements\n - The aesthetic MUST feel modern, premium, and visually captivating\n - Use professional color palettes with proper contrast and hierarchy\n\n3. **COMPREHENSIVE INTERACTIVITY**\n - Design every element to look tangible and interactive\n - Include visual states: hover effects, focus rings, active states, transitions\n - Buttons should look clickable, inputs should look fillable\n - The interface should feel alive, not static\n\n4. **LAYOUT EXCELLENCE**\n - Use proper visual hierarchy with clear focal points\n - Apply consistent spacing rhythm throughout\n - Ensure the layout breathes - balance density with whitespace\n - Full viewport height designs (min-height: 100vh on body)\n - No awkward gaps or orphaned elements\n\n5. **RESPONSIVE BY DEFAULT**\n - Designs MUST work flawlessly on mobile and desktop\n - Touch-friendly sizing for interactive elements on mobile\n - Stackable grids that adapt naturally to screen size\n\n6. **REALISTIC CONTENT**\n - Use believable placeholder content (real-looking names, dates, numbers)\n - Include appropriate icons, avatars, and imagery\n - Data visualizations should have realistic data points\n - Text should be contextually appropriate, not \"Lorem ipsum\"\n\nOUTPUT REQUIREMENTS:\n- Return a COMPLETE file with all necessary imports at the top\n- Include proper exports (default or named as appropriate)\n- The code must be ready to use as-is, no modifications needed\n- Follow the tech stack conventions exactly\n- Return ONLY the code, no explanations or markdown fences";
|
|
2
|
-
export declare const MODIFY_FRONTEND_PROMPT = "You are an elite UI/UX Designer making a SINGLE, focused design modification.\n\nYOUR TASK: Apply ONE design modification and return ONLY the changed code.\n\nCRITICAL RULES:\n\n1. **SINGLE MODIFICATION ONLY**\n - You are making exactly ONE design change\n - Do NOT touch or return any code unrelated to this specific change\n - Keep the modification as focused and surgical as possible\n\n2. **PRESERVE EXISTING DESIGN LANGUAGE**\n -
|
|
3
|
-
export declare const SNIPPET_FRONTEND_PROMPT = "You are an elite UI/UX Designer generating a code snippet to INSERT.\n\nYOUR TASK: Generate a focused code snippet that will be INSERTED into an existing file.\n\nSNIPPET PRINCIPLES:\n\n1. **CONTEXTUAL AWARENESS**\n - The snippet will be inserted into an existing codebase\n - Match the style and patterns described in the context\n - Use consistent naming conventions with the project\n\
|
|
1
|
+
export declare const CREATE_FRONTEND_PROMPT = "You are an elite UI/UX Designer creating production-ready, visually stunning interfaces.\n\nYOUR TASK: Create a COMPLETE, NEW frontend file.\n\nDESIGN EXCELLENCE REQUIREMENTS:\n\n1. **MAXIMUM DETAIL AND DENSITY**\n - The interface MUST be densely populated and feature-rich\n - NEVER produce simple wireframes, empty containers, or placeholder content\n - Fill the space with intricate details, realistic content, background elements, and meaningful UI components\n - Every section should feel like a fully finished, polished product\n\n2. **PREMIUM VISUAL STYLING**\n - Apply high-end design principles throughout\n - Use sophisticated styling: nuanced shadows, subtle gradients, refined borders, micro-textures\n - Add depth and dimension with layered elements\n - The aesthetic MUST feel modern, premium, and visually captivating\n - Use professional color palettes with proper contrast and hierarchy\n\n3. **COMPREHENSIVE INTERACTIVITY**\n - Design every element to look tangible and interactive\n - Include visual states: hover effects, focus rings, active states, transitions\n - Buttons should look clickable, inputs should look fillable\n - The interface should feel alive, not static\n\n4. **LAYOUT EXCELLENCE**\n - Use proper visual hierarchy with clear focal points\n - Apply consistent spacing rhythm throughout\n - Ensure the layout breathes - balance density with whitespace\n - Full viewport height designs (min-height: 100vh on body)\n - No awkward gaps or orphaned elements\n\n5. **RESPONSIVE BY DEFAULT**\n - Designs MUST work flawlessly on mobile and desktop\n - Touch-friendly sizing for interactive elements on mobile\n - Stackable grids that adapt naturally to screen size\n\n6. **REALISTIC CONTENT**\n - Use believable placeholder content (real-looking names, dates, numbers)\n - Include appropriate icons, avatars, and imagery\n - Data visualizations should have realistic data points\n - Text should be contextually appropriate, not \"Lorem ipsum\"\n\n7. **DESIGN SYSTEM INTEGRATION (CRITICAL WHEN CONTEXT IS PROVIDED)**\n When existing project context is provided, you MUST:\n - NEVER add inline <style> tags - use ONLY the styling approach from the context\n - NEVER hardcode pixel values - use the project's existing variables, tokens, or classes\n - NEVER introduce new fonts - use the project's existing font definitions\n - NEVER hardcode colors - use the project's existing color tokens/variables/classes\n - Match the EXACT spacing scale, typography scale, and color palette\n - The new file must look like it belongs to the same project, not a \"foreign\" design\n - Reuse existing component patterns, class naming conventions, and styling architecture\n - Adapt to whatever styling system the project uses (analyze the context)\n\nOUTPUT REQUIREMENTS:\n- Return a COMPLETE file with all necessary imports at the top\n- Include proper exports (default or named as appropriate)\n- The code must be ready to use as-is, no modifications needed\n- Follow the tech stack conventions exactly\n- Return ONLY the code, no explanations or markdown fences";
|
|
2
|
+
export declare const MODIFY_FRONTEND_PROMPT = "You are an elite UI/UX Designer making a SINGLE, focused design modification.\n\nYOUR TASK: Apply ONE design modification and return ONLY the changed code.\n\nCRITICAL RULES:\n\n1. **SINGLE MODIFICATION ONLY**\n - You are making exactly ONE design change\n - Do NOT touch or return any code unrelated to this specific change\n - Keep the modification as focused and surgical as possible\n\n2. **PRESERVE EXISTING DESIGN LANGUAGE (CRITICAL)**\n - NEVER add inline <style> tags - use ONLY the styling approach from the existing code\n - NEVER hardcode pixel values - use the project's existing variables, tokens, or classes\n - NEVER introduce new fonts or colors - use the project's existing definitions\n - Match the EXACT color palette, typography, and spacing from the existing code\n - Keep visual consistency with the rest of the file\n - Don't introduce jarring style changes unless explicitly asked\n - The modification must look native to the codebase, not like a \"patched\" element\n - Use whatever styling system the existing code uses\n\n3. **PREMIUM QUALITY**\n - The modified element must have the same polish as the original\n - Include proper hover states, transitions, and visual feedback\n - Ensure the modification enhances the overall design\n\nOUTPUT FORMAT - STRICTLY FOLLOW THIS:\n\n```\n// FIND THIS CODE:\n<exact code to find and replace>\n\n// REPLACE WITH:\n<new redesigned code>\n```\n\nIf new imports are needed, add them at the top:\n```\n// NEW IMPORTS NEEDED:\nimport { X } from \"y\";\n\n// FIND THIS CODE:\n...\n\n// REPLACE WITH:\n...\n```\n\nIMPORTANT:\n- The \"FIND THIS CODE\" must be an EXACT match of existing code (copy-paste precision)\n- Include enough context in \"FIND THIS CODE\" to make it unique in the file\n- Return ONLY what needs to change, nothing else\n- No explanations, no full file, just the find/replace block";
|
|
3
|
+
export declare const SNIPPET_FRONTEND_PROMPT = "You are an elite UI/UX Designer generating a code snippet to INSERT.\n\nYOUR TASK: Generate a focused code snippet that will be INSERTED into an existing file.\n\nSNIPPET PRINCIPLES:\n\n1. **DESIGN SYSTEM INTEGRATION (CRITICAL - READ THIS FIRST)**\n - NEVER add inline <style> tags or CSS-in-JS style objects - use ONLY the styling approach from the context\n - NEVER hardcode pixel values (padding: 120px, font-size: 42px) - use the project's existing variables, tokens, or utility classes\n - NEVER introduce new fonts - use the project's existing font definitions\n - NEVER hardcode colors - use the project's existing color tokens/variables/classes\n - If context includes design tokens, variables, or classes, you MUST use them exclusively\n - The snippet must integrate SEAMLESSLY - it should look like it was always part of the codebase, not a \"foreign block\"\n - Match the exact spacing scale, typography scale, and color palette of the existing project\n - Adapt to whatever styling system the project uses (CSS modules, utility classes, SCSS, styled-components, etc.)\n\n2. **CONTEXTUAL AWARENESS**\n - The snippet will be inserted into an existing codebase\n - Match the style and patterns described in the context EXACTLY\n - Use consistent naming conventions with the project\n - Use whatever styling system the project uses (analyze the context)\n\n3. **SELF-CONTAINED BUT INTEGRABLE**\n - The snippet should work when inserted\n - Include only the imports that are NEW (the agent will merge them)\n - Don't include file-level exports unless specifically asked\n\n4. **PREMIUM QUALITY**\n - Even snippets must have premium visual styling\n - Include hover states, transitions, proper spacing\n - Use realistic placeholder content, not Lorem ipsum\n\n5. **CLEAN BOUNDARIES**\n - Clear start and end of the snippet\n - Proper indentation (assume standard 2-space indent)\n - No trailing commas or syntax that would break insertion\n\n6. **FOCUSED SCOPE**\n - Generate exactly what was asked, nothing more\n - Don't add \"nice to have\" features unless requested\n - Keep the snippet as lean as possible while meeting requirements\n\nOUTPUT FORMAT:\n\nIf new imports are needed:\n```\n// NEW IMPORTS NEEDED:\nimport { X } from \"y\";\n\n// SNIPPET:\n<your code here>\n```\n\nIf no new imports needed:\n```\n// SNIPPET:\n<your code here>\n```\n\nReturn ONLY the code, no explanations.";
|
package/build/prompts/system.js
CHANGED
|
@@ -45,6 +45,17 @@ DESIGN EXCELLENCE REQUIREMENTS:
|
|
|
45
45
|
- Data visualizations should have realistic data points
|
|
46
46
|
- Text should be contextually appropriate, not "Lorem ipsum"
|
|
47
47
|
|
|
48
|
+
7. **DESIGN SYSTEM INTEGRATION (CRITICAL WHEN CONTEXT IS PROVIDED)**
|
|
49
|
+
When existing project context is provided, you MUST:
|
|
50
|
+
- NEVER add inline <style> tags - use ONLY the styling approach from the context
|
|
51
|
+
- NEVER hardcode pixel values - use the project's existing variables, tokens, or classes
|
|
52
|
+
- NEVER introduce new fonts - use the project's existing font definitions
|
|
53
|
+
- NEVER hardcode colors - use the project's existing color tokens/variables/classes
|
|
54
|
+
- Match the EXACT spacing scale, typography scale, and color palette
|
|
55
|
+
- The new file must look like it belongs to the same project, not a "foreign" design
|
|
56
|
+
- Reuse existing component patterns, class naming conventions, and styling architecture
|
|
57
|
+
- Adapt to whatever styling system the project uses (analyze the context)
|
|
58
|
+
|
|
48
59
|
OUTPUT REQUIREMENTS:
|
|
49
60
|
- Return a COMPLETE file with all necessary imports at the top
|
|
50
61
|
- Include proper exports (default or named as appropriate)
|
|
@@ -67,10 +78,15 @@ CRITICAL RULES:
|
|
|
67
78
|
- Do NOT touch or return any code unrelated to this specific change
|
|
68
79
|
- Keep the modification as focused and surgical as possible
|
|
69
80
|
|
|
70
|
-
2. **PRESERVE EXISTING DESIGN LANGUAGE**
|
|
71
|
-
-
|
|
81
|
+
2. **PRESERVE EXISTING DESIGN LANGUAGE (CRITICAL)**
|
|
82
|
+
- NEVER add inline <style> tags - use ONLY the styling approach from the existing code
|
|
83
|
+
- NEVER hardcode pixel values - use the project's existing variables, tokens, or classes
|
|
84
|
+
- NEVER introduce new fonts or colors - use the project's existing definitions
|
|
85
|
+
- Match the EXACT color palette, typography, and spacing from the existing code
|
|
72
86
|
- Keep visual consistency with the rest of the file
|
|
73
87
|
- Don't introduce jarring style changes unless explicitly asked
|
|
88
|
+
- The modification must look native to the codebase, not like a "patched" element
|
|
89
|
+
- Use whatever styling system the existing code uses
|
|
74
90
|
|
|
75
91
|
3. **PREMIUM QUALITY**
|
|
76
92
|
- The modified element must have the same polish as the original
|
|
@@ -114,27 +130,38 @@ YOUR TASK: Generate a focused code snippet that will be INSERTED into an existin
|
|
|
114
130
|
|
|
115
131
|
SNIPPET PRINCIPLES:
|
|
116
132
|
|
|
117
|
-
1. **
|
|
133
|
+
1. **DESIGN SYSTEM INTEGRATION (CRITICAL - READ THIS FIRST)**
|
|
134
|
+
- NEVER add inline <style> tags or CSS-in-JS style objects - use ONLY the styling approach from the context
|
|
135
|
+
- NEVER hardcode pixel values (padding: 120px, font-size: 42px) - use the project's existing variables, tokens, or utility classes
|
|
136
|
+
- NEVER introduce new fonts - use the project's existing font definitions
|
|
137
|
+
- NEVER hardcode colors - use the project's existing color tokens/variables/classes
|
|
138
|
+
- If context includes design tokens, variables, or classes, you MUST use them exclusively
|
|
139
|
+
- The snippet must integrate SEAMLESSLY - it should look like it was always part of the codebase, not a "foreign block"
|
|
140
|
+
- Match the exact spacing scale, typography scale, and color palette of the existing project
|
|
141
|
+
- Adapt to whatever styling system the project uses (CSS modules, utility classes, SCSS, styled-components, etc.)
|
|
142
|
+
|
|
143
|
+
2. **CONTEXTUAL AWARENESS**
|
|
118
144
|
- The snippet will be inserted into an existing codebase
|
|
119
|
-
- Match the style and patterns described in the context
|
|
145
|
+
- Match the style and patterns described in the context EXACTLY
|
|
120
146
|
- Use consistent naming conventions with the project
|
|
147
|
+
- Use whatever styling system the project uses (analyze the context)
|
|
121
148
|
|
|
122
|
-
|
|
149
|
+
3. **SELF-CONTAINED BUT INTEGRABLE**
|
|
123
150
|
- The snippet should work when inserted
|
|
124
151
|
- Include only the imports that are NEW (the agent will merge them)
|
|
125
152
|
- Don't include file-level exports unless specifically asked
|
|
126
153
|
|
|
127
|
-
|
|
154
|
+
4. **PREMIUM QUALITY**
|
|
128
155
|
- Even snippets must have premium visual styling
|
|
129
156
|
- Include hover states, transitions, proper spacing
|
|
130
157
|
- Use realistic placeholder content, not Lorem ipsum
|
|
131
158
|
|
|
132
|
-
|
|
159
|
+
5. **CLEAN BOUNDARIES**
|
|
133
160
|
- Clear start and end of the snippet
|
|
134
161
|
- Proper indentation (assume standard 2-space indent)
|
|
135
162
|
- No trailing commas or syntax that would break insertion
|
|
136
163
|
|
|
137
|
-
|
|
164
|
+
6. **FOCUSED SCOPE**
|
|
138
165
|
- Generate exactly what was asked, nothing more
|
|
139
166
|
- Don't add "nice to have" features unless requested
|
|
140
167
|
- Keep the snippet as lean as possible while meeting requirements
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { generateWithGemini } from "../lib/gemini.js";
|
|
3
3
|
import { CREATE_FRONTEND_PROMPT } from "../prompts/system.js";
|
|
4
|
-
import { writeFileWithDirs, getFileSize } from "../lib/filesystem.js";
|
|
4
|
+
import { writeFileWithDirs, getFileSize, stripCodeFences } from "../lib/filesystem.js";
|
|
5
5
|
import { scaleSchema, scaleDescriptions } from "../lib/scale.js";
|
|
6
6
|
export const createFrontendSchema = {
|
|
7
7
|
request: z.string().describe("What to create: describe the page, component, or section. " +
|
|
@@ -11,9 +11,10 @@ export const createFrontendSchema = {
|
|
|
11
11
|
"Example: 'src/components/PricingPage.tsx' or 'app/dashboard/page.tsx'"),
|
|
12
12
|
techStack: z.string().describe("The tech stack to use. Be specific. " +
|
|
13
13
|
"Examples: 'React + TypeScript + Tailwind CSS', 'Next.js 14 App Router + shadcn/ui', 'Vue 3 + Composition API + CSS Modules'"),
|
|
14
|
-
context: z.string().optional().describe("
|
|
15
|
-
"
|
|
16
|
-
"
|
|
14
|
+
context: z.string().optional().describe("CRITICAL FOR EXISTING PROJECTS: Pass the styling files (CSS, SCSS, theme config, etc.). " +
|
|
15
|
+
"Include: variables, tokens, classes, and component patterns from your project. " +
|
|
16
|
+
"Without this, Gemini will create standalone styles that won't match your design system. " +
|
|
17
|
+
"Omit ONLY if this is the FIRST file in a new project."),
|
|
17
18
|
designSystem: z.object({
|
|
18
19
|
vibe: z.object({
|
|
19
20
|
name: z.string().describe("Vibe name (e.g., 'Pristine Museum', 'Dark Luxe')"),
|
|
@@ -69,7 +70,9 @@ TECH STACK: ${techStack}
|
|
|
69
70
|
FILE PATH: ${filePath}
|
|
70
71
|
|
|
71
72
|
Remember: Return a COMPLETE file ready to save at ${filePath}`.trim();
|
|
72
|
-
const
|
|
73
|
+
const rawResult = await generateWithGemini(systemPrompt, request, undefined, "high");
|
|
74
|
+
// Strip markdown code fences from the result
|
|
75
|
+
const result = stripCodeFences(rawResult);
|
|
73
76
|
// Write file directly if requested
|
|
74
77
|
if (writeFile) {
|
|
75
78
|
writeFileWithDirs(filePath, result);
|
|
@@ -14,8 +14,10 @@ export const modifyFrontendSchema = {
|
|
|
14
14
|
"This helps Gemini focus on exactly what to change."),
|
|
15
15
|
filePath: z.string().describe("The path of the file being modified. " +
|
|
16
16
|
"Example: 'src/components/Sidebar.tsx'"),
|
|
17
|
-
context: z.string().optional().describe("
|
|
18
|
-
"
|
|
17
|
+
context: z.string().optional().describe("CRITICAL: Pass the styling files (CSS, SCSS, theme config, etc.) with design tokens. " +
|
|
18
|
+
"Include: variables, tokens, classes from your project. " +
|
|
19
|
+
"Without this, Gemini may introduce styles that don't match your design system. " +
|
|
20
|
+
"Example: 'Project uses: var(--font-heading), var(--bg-primary), .section-padding class'"),
|
|
19
21
|
scale: scaleSchema.optional().describe("Element sizing: 'refined' (small, elegant), 'balanced' (standard), 'zoomed' (large). " +
|
|
20
22
|
"Controls button sizes, typography, spacing, icons."),
|
|
21
23
|
writeFile: z.boolean().optional().describe("If true, apply the modification directly to the file on disk. " +
|
|
@@ -14,13 +14,13 @@ export const snippetFrontendSchema = {
|
|
|
14
14
|
"Example: 'src/components/Dashboard.tsx' - helps Gemini match the file's patterns"),
|
|
15
15
|
techStack: z.string().describe("The tech stack being used. " +
|
|
16
16
|
"Examples: 'React + TypeScript + Tailwind CSS', 'Vue 3 + Composition API'"),
|
|
17
|
-
insertionContext: z.string().describe("WHERE in the file this snippet will go
|
|
18
|
-
"
|
|
19
|
-
"Example: 'Inside the Dashboard component, after the header
|
|
20
|
-
"
|
|
21
|
-
context: z.string().optional().describe("
|
|
22
|
-
"
|
|
23
|
-
"
|
|
17
|
+
insertionContext: z.string().describe("WHERE in the file this snippet will go AND the design tokens to use. " +
|
|
18
|
+
"MUST include: styling conventions (variables, classes, tokens) from the project. " +
|
|
19
|
+
"Example: 'Inside the Dashboard component, after the header. " +
|
|
20
|
+
"Use project tokens: var(--font-heading), var(--bg-primary), .section-padding class.'"),
|
|
21
|
+
context: z.string().optional().describe("CRITICAL FOR EXISTING PROJECTS: Pass the styling files (CSS, SCSS, theme config, etc.). " +
|
|
22
|
+
"Include: variables, tokens, classes, and component patterns from your project. " +
|
|
23
|
+
"Without this, Gemini will create standalone styles that won't match your design system."),
|
|
24
24
|
scale: scaleSchema.optional().describe("Element sizing: 'refined' (small, elegant), 'balanced' (standard), 'zoomed' (large). " +
|
|
25
25
|
"Controls button sizes, typography, spacing, icons."),
|
|
26
26
|
writeFile: z.boolean().optional().describe("If true, insert the snippet directly into the file on disk. " +
|