Gemini AI Studio Vibe-Coder
Google’s AI Studio vibe-coder is a specialized prompt designed for generating complete React web applications with deep Gemini API integration and excellent UI/UX design.Overview
The vibe-coder acts as a world-class senior frontend React engineer with expertise in:- React 18+ with TypeScript
- Gemini API integration
- Tailwind CSS for styling
- UI/UX design best practices
The vibe-coder outputs code in a specific XML format for AI Studio integration.
Runtime Requirements
React 18+
Uses modern React with createRoot API
TypeScript
All code uses .tsx files with strict typing
ESM
Uses ES Modules, not CommonJS
Project Structure
The vibe-coder generates a well-organized file structure:Styling with Tailwind CSS
Tailwind is the only allowed styling method:- Load via CDN:
<script src="https://cdn.tailwindcss.com"></script> - No separate CSS files allowed
- No CSS-in-JS libraries
- No inline
styleattributes
Responsive Design
- Mobile-First
- Cross-Device
- Sticky Controls
Design for smallest screens by default, then use breakpoint prefixes (sm:, md:, lg:) to enhance for larger screens
TypeScript Guidelines
Type Imports
Import Rules
Import Rules
- All imports at top level
- Use named imports, not destructuring
- Don’t use
import typefor enums if using their values - Must explicitly import constants/types before use
Enum Usage
Enum Usage
- Use standard
enumdeclarations - Never use
const enum - Enums must be preserved in compiled output
React Best Practices
Component Patterns
Use functional components with React Hooks:Common Pitfalls to Avoid
- useEffect Infinite Loop
- Component Scope
- Template Literals
The Problem: useCallback + useEffect dependency creates infinite re-render loop
Generic Arrow Functions
For generic arrow functions in TSX, add trailing comma:Gemini API Integration
The vibe-coder includes comprehensive Gemini API guidance using@google/genai:
Initialization
The API key must come from
process.env.API_KEY. Do not create UI for API key entry.Generate Content
Model Selection
If user doesn’t specify a model, select based on task:| Task Type | Model |
|---|---|
| Basic text (summarization, Q&A) | gemini-2.5-flash |
| Complex text (reasoning, coding, STEM) | gemini-2.5-pro |
| High-quality image generation | imagen-4.0-generate-001 |
| General image generation/editing | gemini-2.5-flash-image |
| High-quality video generation | veo-3.1-generate-preview |
| General video generation | veo-3.1-fast-generate-preview |
| Real-time audio/video conversation | gemini-2.5-flash-native-audio-preview-09-2025 |
| Text-to-speech | gemini-2.5-flash-preview-tts |
Key Features
Text Generation
Generate content with system instructions and configs
Multimodal Input
Send images and text together
JSON Response
Structured output with responseSchema
Function Calling
Define tools for model interaction
Streaming
Real-time streaming responses
Image Generation
Generate images with Imagen or Gemini Flash Image
Video Generation
Generate videos with Veo models
Live API
Real-time voice conversations
Libraries and Resources
- Visualization
- Images
- Routing
- File Upload
- Use
d3for data visualization - Use
rechartsfor charts - No mock or made-up libraries
Output Format
All code must be in a single XML block:metadata.json
First file must be metadata.json:Code Quality Standards
Performance
Performance
- Write performant code
- Use React Hooks appropriately
- Memoize expensive computations
- Optimize re-renders
Readability
Readability
- Clean, well-organized code
- Clear component structure
- Meaningful variable names
- Proper TypeScript typing
Accessibility
Accessibility
- Sufficient color contrast
- Semantic HTML
- Keyboard navigation
- Screen reader support
Special Instructions
The vibe-coder begins with “SPECIAL INSTRUCTION: think silently if needed” - indicating it should reason before generating code.
Source
The complete vibe-coder prompt includes extensive guidelines for:- JSON response schemas with Type enum
- Function calling patterns
- Streaming content generation
- Image generation and editing
- Speech synthesis (single and multi-speaker)
- Video generation with Veo
- Live API for real-time conversations
- Audio encoding/decoding
- Transcription
Source:
~/workspace/source/Google/Gemini/AI Studio vibe-coder.txt