gemini-design-mcp 1.0.0 → 1.0.2
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/lib/gemini.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { GoogleGenAI } from "@google/genai";
|
|
2
2
|
export declare const ai: GoogleGenAI;
|
|
3
|
-
export declare const DEFAULT_MODEL = "gemini-3-pro";
|
|
3
|
+
export declare const DEFAULT_MODEL = "gemini-3-pro-preview";
|
|
4
4
|
export declare function generateWithGemini(systemPrompt: string, userPrompt: string, model?: string): Promise<string>;
|
package/build/lib/gemini.js
CHANGED
|
@@ -6,8 +6,8 @@ if (!apiKey) {
|
|
|
6
6
|
process.exit(1);
|
|
7
7
|
}
|
|
8
8
|
export const ai = new GoogleGenAI({ apiKey });
|
|
9
|
-
// Default model - Gemini 3 Pro (best for design)
|
|
10
|
-
export const DEFAULT_MODEL = "gemini-3-pro";
|
|
9
|
+
// Default model - Gemini 3 Pro Preview (best for design)
|
|
10
|
+
export const DEFAULT_MODEL = "gemini-3-pro-preview";
|
|
11
11
|
export async function generateWithGemini(systemPrompt, userPrompt, model = DEFAULT_MODEL) {
|
|
12
12
|
try {
|
|
13
13
|
const response = await ai.models.generateContent({
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const GENERATE_FRONTEND_PROMPT = "You are an expert UI/UX designer and frontend developer.\
|
|
1
|
+
export declare const GENERATE_FRONTEND_PROMPT = "You are an expert UI/UX designer and frontend developer.\n\nRULES:\n1. COMPLETE and functional code - never use placeholders like \"// TODO\" or \"...\"\n2. If CONTEXT is provided, match the existing style\n3. If no context, you have full creative freedom\n4. Respect the requested tech stack/framework\n5. Return ONLY the code, no explanations";
|
|
2
2
|
export declare const IMPROVE_FRONTEND_PROMPT = "You are an expert UI/UX designer and frontend developer.\nYou improve existing frontend code based on the feedback provided.\n\nRULES:\n1. Keep the general structure unless asked otherwise\n2. Only improve the aspects mentioned in the feedback\n3. Maintain consistency with the rest of the code\n4. Return the COMPLETE improved code, not just the changes\n5. No explanations, just the code";
|
|
3
3
|
export declare const SUGGEST_DESIGN_PROMPT = "You are an expert UI/UX designer.\nYou provide concise and actionable design suggestions.\n\nRULES:\n1. Short and precise suggestions\n2. Focus on visual impact and UX\n3. Propose 3-5 ideas maximum\n4. Format: bullet points\n5. No code, just ideas";
|
package/build/prompts/system.js
CHANGED
|
@@ -1,21 +1,11 @@
|
|
|
1
1
|
export const GENERATE_FRONTEND_PROMPT = `You are an expert UI/UX designer and frontend developer.
|
|
2
|
-
You generate production-quality frontend code.
|
|
3
2
|
|
|
4
|
-
|
|
3
|
+
RULES:
|
|
5
4
|
1. COMPLETE and functional code - never use placeholders like "// TODO" or "..."
|
|
6
|
-
2.
|
|
7
|
-
3.
|
|
8
|
-
4.
|
|
9
|
-
5.
|
|
10
|
-
6. If no context, create a coherent design system
|
|
11
|
-
7. Use best practices for the requested framework/tech stack
|
|
12
|
-
8. Return ONLY the code, no explanations
|
|
13
|
-
|
|
14
|
-
DEFAULT STYLE (if not specified):
|
|
15
|
-
- Colors: neutral tones with one accent color
|
|
16
|
-
- Typography: clean and readable
|
|
17
|
-
- Spacing: generous, airy
|
|
18
|
-
- Effects: subtle (soft shadows, light transitions)`;
|
|
5
|
+
2. If CONTEXT is provided, match the existing style
|
|
6
|
+
3. If no context, you have full creative freedom
|
|
7
|
+
4. Respect the requested tech stack/framework
|
|
8
|
+
5. Return ONLY the code, no explanations`;
|
|
19
9
|
export const IMPROVE_FRONTEND_PROMPT = `You are an expert UI/UX designer and frontend developer.
|
|
20
10
|
You improve existing frontend code based on the feedback provided.
|
|
21
11
|
|
|
@@ -3,13 +3,11 @@ export declare const generateFrontendSchema: {
|
|
|
3
3
|
request: z.ZodString;
|
|
4
4
|
context: z.ZodNullable<z.ZodString>;
|
|
5
5
|
techStack: z.ZodOptional<z.ZodString>;
|
|
6
|
-
preferences: z.ZodOptional<z.ZodString>;
|
|
7
6
|
};
|
|
8
7
|
export declare function generateFrontend(params: {
|
|
9
8
|
request: string;
|
|
10
9
|
context: string | null;
|
|
11
10
|
techStack?: string;
|
|
12
|
-
preferences?: string;
|
|
13
11
|
}): Promise<{
|
|
14
12
|
content: {
|
|
15
13
|
type: "text";
|
|
@@ -8,14 +8,12 @@ export const generateFrontendSchema = {
|
|
|
8
8
|
"Null if new project."),
|
|
9
9
|
techStack: z.string().optional().describe("Tech stack (e.g., 'React + Tailwind', 'Vue + CSS', 'HTML/CSS vanilla', 'Next.js + shadcn'). " +
|
|
10
10
|
"If not specified, Gemini will choose based on context."),
|
|
11
|
-
preferences: z.string().optional().describe("Style preferences (e.g., 'glassmorphism', 'dark mode', 'minimal', 'brutalist')"),
|
|
12
11
|
};
|
|
13
12
|
export async function generateFrontend(params) {
|
|
14
|
-
const { request, context, techStack
|
|
13
|
+
const { request, context, techStack } = params;
|
|
15
14
|
const systemPrompt = `${GENERATE_FRONTEND_PROMPT}
|
|
16
15
|
|
|
17
|
-
${techStack ? `TECH STACK: ${techStack}` : ""}
|
|
18
|
-
${preferences ? `STYLE PREFERENCES: ${preferences}` : ""}`.trim();
|
|
16
|
+
${techStack ? `TECH STACK: ${techStack}` : ""}`.trim();
|
|
19
17
|
const userPrompt = context
|
|
20
18
|
? `PROJECT CONTEXT (match this style):
|
|
21
19
|
${context}
|