Refactor prompts and improve error handling

Major prompt system refactor: system and user prompts are now structured as objects per provider, with improved migration and settings logic. Enhanced error handling in useMakeReal with more specific user feedback. PreviewShape default size set to 900x900. getMessages now uses provider-specific prompts and supports previous preview context. Updated screenshot script in link page to wait for fonts and add a delay for more reliable rendering. Added CLAUDE.md and prompts/scratchpad.md for documentation and prompt iteration.
pull/107/head
Steve Ruiz 1 year ago
parent d249b9be10
commit 7706dff83a

@ -0,0 +1,238 @@
# CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
## Project Overview
Make Real is a Next.js application that transforms hand-drawn wireframes into working HTML prototypes using AI. Built on the tldraw SDK, it allows users to draw UI mockups on a canvas and generate interactive HTML/CSS/JavaScript implementations via OpenAI, Anthropic, or Google AI models.
Live at: https://makereal.tldraw.com
## Development Commands
```bash
# Install dependencies
yarn install
# Run development server
yarn dev
# Build for production
yarn build
# Start production server
yarn start
# Lint code
yarn lint
```
The dev server runs on http://localhost:3000 by default.
## Architecture
### Core Flow
1. **Canvas Drawing** - User draws wireframes on tldraw canvas (app/makereal.tldraw.com/page.tsx)
2. **Shape Capture** - Selected shapes are captured as images (app/hooks/useMakeReal.ts)
3. **AI Processing** - Images + prompts sent to AI provider APIs (app/makereal.tldraw.com/api/)
4. **Preview Rendering** - Generated HTML rendered in PreviewShape iframe (app/PreviewShape/PreviewShape.tsx)
5. **Link Upload** - HTML uploaded to Vercel Blob for sharing (app/lib/uploadLink.tsx)
### Key Components
**useMakeReal Hook** (app/hooks/useMakeReal.ts)
- Main orchestration logic for the "Make Real" feature
- Validates API keys via settings
- Captures selected shapes as JPEG images (max 1000px)
- Creates PreviewShape components for each provider
- Streams HTML responses in real-time, updating preview as content arrives
- Handles errors and displays toasts to user
- Supports iterative refinement (passing previous HTML to AI)
**PreviewShape** (app/PreviewShape/PreviewShape.tsx)
- Custom tldraw shape that displays generated HTML in an iframe
- Shows loading spinner while streaming HTML
- Enables interaction mode (double-click to interact with preview)
- Provides dropdown menu for copying HTML/URL or opening in new window
- Supports SVG export by requesting screenshots from iframe content
**Settings System** (app/lib/settings.tsx)
- Manages API keys for all providers (OpenAI, Anthropic, Google)
- Stores model selection per provider (default: gpt-5, claude-sonnet-4-5, gemini-3-pro-preview)
- Handles settings migrations between versions (currently v12)
- Settings persisted in localStorage as `makereal_settings_2`
- Supports provider-specific custom prompts
**Prompt Engineering** (app/prompt.ts)
- Contains system and user prompts for AI models
- Current version: NOVEMBER_19_2025 (detailed instructions for transforming wireframes)
- Key instruction: hand-drawn elements should be "rectified" into clean UI components
- Prompts emphasize treating red annotations as instructions, not design elements
- Specifies technical constraints (single HTML file, Tailwind CSS, functional JavaScript)
- Legacy prompts preserved for reference (LEGACY_SYSTEM_PROMPT, IMPROVED_ORIGINAL)
### API Routes
Each AI provider has a dedicated API route under `app/makereal.tldraw.com/api/`:
**OpenAI** (api/openai/route.ts)
- Uses `@ai-sdk/openai` with `streamText`
- Special handling for gpt-5 via `openai.responses('gpt-5')`
- Fixed temperature: 0, seed: 42
**Anthropic** (api/anthropic/route.ts)
- Uses `@ai-sdk/anthropic` with streaming
- Supports standard Claude models and extended thinking models (suffixed with " (thinking)")
**Google** (api/google/route.ts)
- Uses `@ai-sdk/google` for Gemini models
- Supports latest Gemini 3 Pro and Gemini 2.5 Flash models
All routes:
- Accept `{ apiKey, messages, model, systemPrompt }` in POST body
- Stream responses as text (not JSON)
- Have `maxDuration: 60` seconds
- Use `force-dynamic` to prevent caching
### Message Construction
**getMessages** (app/lib/getMessages.ts)
- Builds the message array sent to AI providers
- Structure: user prompt → canvas image → text content → previous previews
- Includes theme preference (light/dark)
- For iterations, includes previous HTML + screenshot of previous result
- Uses multimodal format with text and image parts
### Environment Variables
The app expects API keys in environment variables, but users primarily configure them via the in-app Settings UI:
```bash
OPENAI_API_KEY=sk-...
ANTHROPIC_API_KEY=sk-ant-...
GOOGLE_API_KEY=AIza...
```
Additional:
- `NEXT_PUBLIC_GA4_MEASUREMENT_ID` - Google Analytics tracking
- Vercel Blob/KV/Postgres credentials for link sharing
### tldraw Integration
- Custom shape: PreviewShape (registered in shapeUtils array)
- Custom components:
- SharePanel → MakeRealButton
- MainMenu → Adds Settings/Links
- Persistence key: "tldraw" (saves canvas state to browser storage)
- License key stored in app/constants.ts
### Important Files
- **app/lib/settings.tsx** - Settings atom, providers config, migration logic
- **app/prompt.ts** - All AI prompt templates
- **app/hooks/useMakeReal.ts** - Main feature implementation
- **app/lib/getMessages.ts** - Constructs messages for AI APIs
- **app/PreviewShape/PreviewShape.tsx** - Preview rendering and interaction
- **app/lib/htmlify.ts** - Extracts HTML from AI responses
- **app/lib/uploadLink.tsx** - Uploads to Vercel Blob for sharing
## Code Patterns
### Adding a New AI Provider
1. Add provider config to `PROVIDERS` array in app/lib/settings.tsx:
```typescript
{
id: 'provider-id',
name: 'Provider Name',
models: ['model-1', 'model-2'],
prompt: NOVEMBER_19_2025,
help: 'https://help-url',
validate: (key: string) => key.startsWith('prefix-'),
}
```
2. Create API route at app/makereal.tldraw.com/api/provider-id/route.ts:
```typescript
import { createProvider } from '@ai-sdk/provider'
import { streamText } from 'ai'
export const maxDuration = 60
export const dynamic = 'force-dynamic'
export async function POST(req: Request) {
const { apiKey, messages, model, systemPrompt } = await req.json()
const provider = createProvider({ apiKey })
const result = streamText({
model: provider(model),
system: systemPrompt,
messages,
})
return result.toTextStreamResponse()
}
```
3. Add switch case in useMakeReal.ts (search for `switch (provider)`)
### Modifying Prompts
Edit the prompt constants in app/prompt.ts. The current production prompt is `NOVEMBER_19_2025`. To update:
1. Create new prompt constant with descriptive name
2. Update references in app/lib/settings.tsx (both default and migration)
3. Increment `MIGRATION_VERSION` to trigger prompt update for existing users
### Settings Migrations
When changing settings schema:
1. Increment `MIGRATION_VERSION` in app/lib/settings.tsx
2. Add migration logic in `applySettingsMigrations` function:
```typescript
if (version < NEW_VERSION) {
// Apply migration
settingsWithModelsProperty.someNewField = defaultValue
}
```
## Common Tasks
### Testing Locally
1. Add API keys to `.env.local` (or configure via Settings UI in app)
2. Run `yarn dev`
3. Draw shapes on canvas
4. Select shapes and click "Make Real" button
5. Preview appears to the right of selection
### Debugging Generated HTML
- Preview shapes have a dropdown menu (three dots icon when selected)
- Options: Copy HTML, Copy URL, Open in new window
- Check browser console for AI response logs
- HTML is extracted via `htmlify()` function (looks for `<!DOCTYPE html>` to `</html>`)
### Adding New Models
Update the `models` array for the relevant provider in app/lib/settings.tsx. Users can then select the model from Settings dropdown.
## Technology Stack
- **Framework**: Next.js 14 (App Router)
- **Canvas**: tldraw 4.x
- **AI SDKs**: Vercel AI SDK with provider adapters
- **Styling**: Tailwind CSS
- **State**: tldraw atoms for settings
- **Storage**: Vercel Blob (link uploads), localStorage (settings/canvas)
- **Analytics**: Vercel Analytics + custom tldraw analytics
## Notes
- The app operates entirely client-side except for API route proxying
- API keys are stored in browser localStorage (users must provide their own)
- Preview shapes use nested iframes for isolation and export
- Streaming is implemented via TextDecoder and manual HTML parsing (looks for `<!DOCTYPE html>` start tag)
- Settings use versioned localStorage keys (`makereal_settings_2`, `makereal_version`) for migrations

@ -39,8 +39,8 @@ export class PreviewShapeUtil extends BaseBoxShapeUtil<PreviewShape> {
html: '',
source: '',
parts: [],
w: (960 * 2) / 3,
h: (540 * 2) / 3,
w: 900,
h: 900,
dateCreated: Date.now(),
}
}

@ -97,12 +97,12 @@ export function SettingsDialog({ onClose }: TLUiDialogProps) {
<button
style={{ all: 'unset', cursor: 'pointer' }}
onClick={() => {
const provider = PROVIDERS.find((p) => p.id === settings.provider)!
makeRealSettings.update((s) => ({
...s,
prompts: {
...s.prompts,
[settings.provider]: PROVIDERS.find((p) => p.id === settings.provider)!
.prompt,
[settings.provider]: provider.prompt,
},
}))
}}
@ -113,12 +113,15 @@ export function SettingsDialog({ onClose }: TLUiDialogProps) {
</div>
<TldrawUiInput
className="apikey_input prompt_input"
value={settings.prompts[settings.provider]}
value={settings.prompts[settings.provider].system}
autoSelect
onValueChange={(value) => {
makeRealSettings.update((s) => ({
...s,
prompts: { ...s.prompts, [settings.provider]: value },
prompts: {
...s.prompts,
[settings.provider]: { ...s.prompts[settings.provider], system: value },
},
}))
}}
/>

@ -19,6 +19,65 @@ import { makeRealSettings, PROVIDERS } from '../lib/settings'
import { uploadLink } from '../lib/uploadLink'
import { PreviewShape } from '../PreviewShape/PreviewShape'
function getErrorMessage(error: Error, provider: string): { title: string; description: string } {
const message = error.message.toLowerCase()
// Rate limiting
if (message.includes('rate limit') || message.includes('429')) {
return {
title: `${provider} rate limit`,
description: `You've exceeded the rate limit. Please wait a moment and try again.`,
}
}
// Authentication errors
if (
message.includes('invalid api key') ||
message.includes('unauthorized') ||
message.includes('401') ||
message.includes('authentication')
) {
return {
title: `${provider} authentication failed`,
description: `Your API key appears to be invalid. Please check your settings.`,
}
}
// Model access errors
if (message.includes('you do not have access') || message.includes('model not found')) {
return {
title: `${provider} model access denied`,
description: `You don't have access to this model. Try a different model or check your account.`,
}
}
// Token/context limit errors
if (
message.includes('context length') ||
message.includes('too large') ||
message.includes('maximum')
) {
return {
title: `${provider} content too large`,
description: `The wireframe is too complex. Try selecting fewer shapes or simplifying the design.`,
}
}
// Network errors
if (message.includes('fetch') || message.includes('network')) {
return {
title: `${provider} connection failed`,
description: `Could not connect to ${provider}. Check your internet connection.`,
}
}
// Generic fallback
return {
title: `${provider} error`,
description: error.message.slice(0, 150),
}
}
export function useMakeReal() {
const editor = useEditor()
const { addToast } = useToasts()
@ -70,8 +129,8 @@ export function useMakeReal() {
const providers = isAllProviders ? ['openai', 'anthropic', 'google'] : [provider]
let previewHeight = (540 * 2) / 3
let previewWidth = (960 * 2) / 3
let previewHeight = 900
let previewWidth = 900
const highestPreview = selectedShapes
.filter((s) => s.type === 'preview')
@ -146,9 +205,10 @@ export function useMakeReal() {
const messages = getMessages({
image: dataUrl,
text: getTextFromSelectedShapes(editor),
// text: getTextFromSelectedShapes(editor),
previousPreviews,
theme: editor.user.getUserPreferences().isDarkMode ? 'dark' : 'light',
prompts: prompts[provider],
})
const parts: string[] = []
@ -169,7 +229,7 @@ export function useMakeReal() {
body: JSON.stringify({
apiKey,
messages,
systemPrompt: prompts.openai,
systemPrompt: prompts.openai.system,
model: settings.models['openai'],
}),
headers: { 'Content-Type': 'application/json' },
@ -254,7 +314,7 @@ export function useMakeReal() {
body: JSON.stringify({
apiKey,
messages,
systemPrompt: prompts.anthropic,
systemPrompt: prompts.anthropic.system,
model: settings.models['anthropic'],
}),
headers: { 'Content-Type': 'application/json' },
@ -283,7 +343,6 @@ export function useMakeReal() {
const delta = decoder(value) as string
text += delta
// console.log(text)
if (didEnd) {
continue
} else if (!didStart && text.includes('<!DOCTYPE html>')) {
@ -320,7 +379,6 @@ export function useMakeReal() {
}
}
console.log(text)
r(text)
})
@ -333,7 +391,6 @@ export function useMakeReal() {
let didStart = false
let didEnd = false
try {
console.log('trying...')
const apiKey = keys[provider]
const abortController = new AbortController()
@ -343,23 +400,20 @@ export function useMakeReal() {
body: JSON.stringify({
apiKey,
messages,
systemPrompt: prompts.google,
systemPrompt: prompts.google.system,
model: settings.models['google'],
}),
headers: { 'Content-Type': 'application/json' },
signal: abortController.signal,
}).catch((err) => {
console.log('nope')
throw err
})
if (!res.ok) {
console.log('nope')
throw new Error((await res.text()) || 'Failed to fetch the chat response.')
}
if (!res.body) {
console.log('nope')
throw new Error('The response body is empty.')
}
const reader = res.body.getReader()
@ -375,7 +429,6 @@ export function useMakeReal() {
const delta = decoder(value) as string
text += delta
// console.log(text)
if (didEnd) {
continue
} else if (!didStart && text.includes('<!DOCTYPE html>')) {
@ -402,7 +455,6 @@ export function useMakeReal() {
}
}
} catch (err) {
console.log('nope')
// Ignore abort errors as they are expected.
if ((err as any).name === 'AbortError') {
return null
@ -413,12 +465,9 @@ export function useMakeReal() {
}
}
console.log(text)
r(text)
})
console.log('done!', text)
result = { text, finishReason: 'complete' }
break
}
@ -429,8 +478,7 @@ export function useMakeReal() {
}
if (result?.finishReason === 'error') {
console.error(result.finishReason)
throw Error(`${result.finishReason?.slice(0, 128)}...`)
throw Error(`AI generation failed: ${result.finishReason?.slice(0, 128)}`)
}
// Extract the HTML from the response
@ -438,8 +486,9 @@ export function useMakeReal() {
// No HTML? Something went wrong
if (html.length < 100) {
console.warn(result.text)
throw Error('Could not generate a design from those wireframes.')
throw Error(
'Could not generate valid HTML. The AI response was incomplete or invalid.'
)
}
// Upload the HTML / link for the shape
@ -455,15 +504,13 @@ export function useMakeReal() {
uploadedShapeId: newShapeId,
},
})
console.log(`Response: ${result.text}`)
} catch (e) {
const errorInfo = getErrorMessage(e as Error, provider)
addToast({
icon: 'info-circle',
title: 'Something went wrong',
description: (e as Error).message.slice(0, 100),
title: errorInfo.title,
description: errorInfo.description,
})
console.error(e.message)
// If anything went wrong, delete the shape.
editor.deleteShape(newShapeId)
throw e
@ -473,18 +520,16 @@ export function useMakeReal() {
} catch (e: any) {
track('no_luck', { timestamp: Date.now() })
console.error(e)
// Only show additional help toast for specific errors
if (e.message.includes('you do not have access to it')) {
addToast({
title: 'OpenAI says no access',
description: `Sorry, you don't have access to this model on OpenAI.`,
title: 'Model access denied',
description: `You don't have access to this model. Try a different model or check your account.`,
actions: [
{
type: 'primary',
label: 'OpenAI docs',
onClick: () => {
// open a new tab with the url...
window.open(
'https://help.openai.com/en/articles/7102672-how-can-i-access-gpt-4-gpt-4-turbo-gpt-4o-and-gpt-4o-mini',
'_blank'
@ -493,9 +538,8 @@ export function useMakeReal() {
},
{
type: 'primary',
label: 'Learn more',
label: 'Make Real FAQs',
onClick: () => {
// open a new tab with the url...
window.open(
'https://tldraw.notion.site/Make-Real-FAQs-93be8b5273d14f7386e14eb142575e6e',
'_blank'
@ -505,24 +549,6 @@ export function useMakeReal() {
],
})
}
addToast({
title: 'Something went wrong',
description: `${e.message.slice(0, 200)}`,
actions: [
{
type: 'primary',
label: 'Read the guide',
onClick: () => {
// open a new tab with the url...
window.open(
'https://tldraw.notion.site/Make-Real-FAQs-93be8b5273d14f7386e14eb142575e6e',
'_blank'
)
},
},
],
})
}
}, [editor, addDialog, addToast])
}

@ -1,6 +1,5 @@
import { CoreUserMessage, UserContent } from 'ai'
import { PreviewShape } from '../PreviewShape/PreviewShape'
import { USER_PROMPT, USER_PROMPT_WITH_PREVIOUS_DESIGN } from '../prompt'
export function getMessages({
image,
@ -8,15 +7,20 @@ export function getMessages({
grid,
theme = 'light',
previousPreviews,
prompts,
}: {
image: string
text: string
text?: string
theme?: string
grid?: {
color: string
size: number
labels: boolean
}
prompts: {
system: string
user: (sourceCode: string) => string
}
previousPreviews?: PreviewShape[]
}) {
const messages: CoreUserMessage[] = [
@ -28,12 +32,6 @@ export function getMessages({
const userContent = messages[0].content as Exclude<UserContent, string>
// Add the prompt into
userContent.push({
type: 'text',
text: `${previousPreviews.length > 0 ? USER_PROMPT_WITH_PREVIOUS_DESIGN : USER_PROMPT} Please make your result use the ${theme} theme.`,
})
// Add the image
userContent.push({
type: 'image',
@ -54,24 +52,26 @@ export function getMessages({
text: `The designs have a ${grid.color} grid overlaid on top. Each cell of the grid is ${grid.size}x${grid.size}px.`,
})
}
// Add the previous previews as HTML
for (let i = 0; i < previousPreviews.length; i++) {
const preview = previousPreviews[i]
userContent.push(
{
type: 'text',
text: `The designs also included one of your previous result. Here's the image that you used as its source:`,
},
{
type: 'image',
image: preview.props.source,
},
{
type: 'text',
text: `And here's the HTML you came up with for it: ${preview.props.html}`,
}
)
if (previousPreviews.length > 0) {
// Add the previous previews as HTML
for (let i = 0; i < previousPreviews.length; i++) {
const preview = previousPreviews[i]
userContent.push(
{
type: 'text',
text: prompts.user(preview.props.html),
}
// {
// type: 'image',
// image: preview.props.source,
// }
)
}
} else {
userContent.push({
type: 'text',
text: prompts.user(''),
})
}
return messages

@ -1,5 +1,5 @@
import { atom } from 'tldraw'
import { ORIGINAL_SYSTEM_PROMPT } from '../prompt'
import { NOVEMBER_19_2025 } from '../prompt'
export const PROVIDERS = [
{
@ -14,7 +14,7 @@ export const PROVIDERS = [
'o3-pro-2025-06-10',
'o4-mini-2025-04-16',
], // 'o1-preview', 'o1-mini'],
prompt: ORIGINAL_SYSTEM_PROMPT,
prompt: NOVEMBER_19_2025,
help: 'https://tldraw.notion.site/Make-Real-Help-93be8b5273d14f7386e14eb142575e6e#a9b75e58b1824962a1a69a2f29ace9be',
validate: (key: string) => key.startsWith('sk-'),
},
@ -32,7 +32,7 @@ export const PROVIDERS = [
'claude-3-sonnet-20240229',
'claude-3-haiku-20240307',
],
prompt: ORIGINAL_SYSTEM_PROMPT,
prompt: NOVEMBER_19_2025,
help: 'https://tldraw.notion.site/Make-Real-Help-93be8b5273d14f7386e14eb142575e6e#3444b55a2ede405286929956d0be6e77',
validate: (key: string) => key.startsWith('sk-'),
},
@ -47,7 +47,7 @@ export const PROVIDERS = [
'gemini-2.0-flash',
'gemini-1.5-pro',
],
prompt: ORIGINAL_SYSTEM_PROMPT,
prompt: NOVEMBER_19_2025,
help: '',
validate: (key: string) => key.startsWith('AIza'),
},
@ -58,16 +58,16 @@ export const makeRealSettings = atom('make real settings', {
models: Object.fromEntries(PROVIDERS.map((provider) => [provider.id, provider.models[0]])),
keys: { openai: '', anthropic: '', google: '' },
prompts: {
system: ORIGINAL_SYSTEM_PROMPT,
openai: ORIGINAL_SYSTEM_PROMPT,
anthropic: ORIGINAL_SYSTEM_PROMPT,
google: ORIGINAL_SYSTEM_PROMPT,
system: NOVEMBER_19_2025,
openai: NOVEMBER_19_2025,
anthropic: NOVEMBER_19_2025,
google: NOVEMBER_19_2025,
},
})
type Settings = ReturnType<typeof makeRealSettings.get>
export const MIGRATION_VERSION = 11
export const MIGRATION_VERSION = 12
export function applySettingsMigrations(settings: Settings, version: number | undefined) {
const { keys, ...rest } = settings
@ -78,10 +78,10 @@ export function applySettingsMigrations(settings: Settings, version: number | un
keys: { openai: '', anthropic: '', google: '', ...keys },
...rest,
prompts: {
system: ORIGINAL_SYSTEM_PROMPT,
openai: ORIGINAL_SYSTEM_PROMPT,
anthropic: ORIGINAL_SYSTEM_PROMPT,
google: ORIGINAL_SYSTEM_PROMPT,
system: NOVEMBER_19_2025,
openai: NOVEMBER_19_2025,
anthropic: NOVEMBER_19_2025,
google: NOVEMBER_19_2025,
},
}
@ -126,5 +126,12 @@ export function applySettingsMigrations(settings: Settings, version: number | un
settingsWithModelsProperty.models.openai = 'gpt-5'
}
if (version < 12) {
settingsWithModelsProperty.prompts.system = NOVEMBER_19_2025
settingsWithModelsProperty.prompts.openai = NOVEMBER_19_2025
settingsWithModelsProperty.prompts.anthropic = NOVEMBER_19_2025
settingsWithModelsProperty.prompts.google = NOVEMBER_19_2025
}
return settingsWithModelsProperty
}

@ -20,20 +20,30 @@ export default async function LinkPage({
let html: string = result.rows[0].html
const SCRIPT_TO_INJECT_FOR_PREVIEW = `
// send the screenshot to the parent window
window.addEventListener('message', function(event) {
if (event.data.action === 'take-screenshot' && event.data.shapeid === "shape:${linkId}") {
html2canvas(document.body, {useCors : true, foreignObjectRendering: true, allowTaint: true }).then(function(canvas) {
const data = canvas.toDataURL('image/png');
window.parent.parent.postMessage({screenshot: data, shapeid: "shape:${linkId}"}, "*");
});
}
}, false);
// and prevent the user from pinch-zooming into the iframe
document.body.addEventListener('wheel', e => {
if (!e.ctrlKey) return;
e.preventDefault();
}, { passive: false })
// Wait for fonts to load before handling screenshot requests
document.fonts.ready.then(function() {
window.addEventListener('message', async function(event) {
if (event.data.action === 'take-screenshot' && event.data.shapeid === "shape:${linkId}") {
// Small delay to ensure everything is fully rendered
await new Promise(resolve => setTimeout(resolve, 300));
html2canvas(document.body, {
useCORS: true,
foreignObjectRendering: true,
allowTaint: true
}).then(function(canvas) {
const data = canvas.toDataURL('image/png');
window.parent.parent.postMessage({screenshot: data, shapeid: "shape:${linkId}"}, "*");
});
}
}, false);
});
// Prevent pinch-zooming into the iframe
document.body.addEventListener('wheel', e => {
if (!e.ctrlKey) return;
e.preventDefault();
}, { passive: false })
`
if (isPreview) {

@ -1,16 +1,28 @@
// not used at the moment
export const ANTHROPIC_SYSTEM_PROMPT =
'# Make Real System Prompt\n\nYou are an expert web developer who specializes in transforming wireframes and sketches into polished, interactive single-page websites. Your mission is to create impressive, functional prototypes that exceed expectations.\n\n## Core Responsibilities\n\n- Convert low-fidelity designs into high-fidelity, responsive HTML prototypes\n- Create a single, complete HTML file with embedded CSS and JavaScript\n- Build interactive, working features rather than static mockups\n- Make intelligent assumptions to fill gaps in specifications\n\n## Technical Stack\n\n- **Styling**: Tailwind CSS utility classes only (no custom CSS unless absolutely critical)\n- **JavaScript**: Vanilla JS in `<script>` tags. Import from https://cdnjs.cloudflare.com only\n- **Fonts**: Google Fonts via CDN\n- **Images**: placehold.co URLs or solid CSS rectangles\n- **State**: Use JavaScript variables/objects (never localStorage/sessionStorage)\n- **Responsiveness**: Mobile-first design with Tailwind breakpoints\n\n## Interpretation Rules\n\n1. **Red = Annotation**: Exclude all red-colored elements from final design\n2. **Context Clues**: Wireframes may contain flowcharts, sticky notes, screenshots—use as design inspiration only\n3. **Enhancement Target**: Transform basic wireframes into modern, polished interfaces\n4. **Functional Priority**: Build working interactions, not static displays\n5. **Gap Filling**: Make informed UX decisions for underspecified features\n\n## Execution Approach\n\n- **Be Decisive**: Implement features based on common patterns rather than leaving incomplete\n- **Modern Aesthetics**: Apply contemporary design trends, proper spacing, visual hierarchy\n- **Complete Interactions**: Buttons should work, forms should validate, animations should enhance UX\n- **Professional Polish**: Create prototypes that feel like production applications\n\n## Previous Context Integration\n\nWhen provided with iframe source code from previous iterations:\n\n- Build upon existing functionality\n- Maintain design consistency\n- Enhance rather than rebuild from scratch\n- Preserve working features while implementing requested changes\n'
// not used at the moment
export const GOOGLE_SYSTEM_PROMPT =
'You are a Principal Front-End Engineer operating within the "make real" application. You are not just a code generator; you are an architect of user interfaces. Your primary strength is interpreting a combination of visual drawings, user notes, and existing codebases to produce a single, immaculate, and interactive HTML file. You are working with Gemini 1.5 Pro, so you can handle and synthesize vast amounts of context with ease.\n\n## 1. Input Modalities\n\nYou will receive a combination of the following inputs. Your first step is always to analyze and understand everything you have been given.\n\n- **Primary Input: The Wireframe Drawing.** This is the core visual instruction from the designer.\n- **Secondary Input (Optional): User Text Prompt.** Additional text instructions, clarifications, or requests from the user.\n- **Tertiary Input (Optional): Existing HTML Source Code.** The complete code of a previous generation. Your large context window allows you to treat this not as a reference, but as a live document to be refactored.\n\n## 2. Core Execution Logic: Your Chain of Thought\n\nTo ensure the highest quality output, you must follow this internal development process step-by-step:\n\n1. **Synthesize Inputs:** Review all provided materials (drawing, text, existing code) to form a holistic understanding of the user\'s goal.\n2. **Deconstruct the Drawing:** Mentally break down the visual wireframe into its core components (e.g., navigation bar, hero section, card grid, footer). Identify the layout, typography, and intended content.\n3. **Establish the Base:**\n - **If no existing code is provided:** Begin from a clean slate.\n - **If existing code is provided:** Treat it as your starting point. The new drawing is a set of patch notes or a refactoring guide. Your task is to apply these visual changes directly to the codebase, adding, removing, or modifying components as required. Do not start over.\n4. **Plan the Architecture:** Before writing code, visualize the semantic HTML structure (`<header>`, `<nav>`, `<main>`, `<section>`, `<footer>`). Think in components. Even in a single file, your code should be logically sectioned and commented (e.g., `, `).\n5. **Develop the High-Fidelity Prototype:** Write the single HTML file, adhering strictly to the technical specifications below.\n6. **Review and Refine:** Before finalizing, review your code for responsiveness, interactivity (all buttons/links should have hover states), and accessibility (use ARIA attributes where appropriate). Ensure the final output perfectly matches the synthesized goal.\n\n## 3. Technical Specifications & Constraints\n\n- **Output Format:** Your entire response must be a single HTML file enclosed in a markdown code block: ` ```html ... ``` `. Do not include any explanatory text outside of this block.\n- **Styling:** Use **Tailwind CSS exclusively**. Import it via the official CDN script in the `<head>`. For any edge cases not covered by Tailwind, use a `<style>` tag.\n- **JavaScript:** All JavaScript must be placed in a single `<script>` tag before the closing `</body>` tag. Use modern JS (ES6+). For external libraries (e.g., Chart.js, GSAP), import them as ES Modules from a CDN like `skypack` or `unpkg`.\n- **Fonts & Icons:** Import fonts from **Google Fonts**. For icons, use a reliable SVG-based library like **Heroicons** or **Feather Icons**, embedding the SVGs directly into the HTML.\n- **Images:** Use `https://placehold.co` for all image placeholders.\n- **Semantic & Accessible:** Write clean, semantic HTML5. Use appropriate tags and add ARIA roles to enhance accessibility for interactive elements.\n\n## 4. Design Philosophy & Interpretation\n\n- **Elevate and Enhance:** You are not a literal transcriber. You must elevate the low-fidelity drawing into a polished, "real" application. This means inferring spacing, selecting a harmonious color palette (unless specified), choosing appropriate font weights, and adding subtle animations or transitions.\n- **Annotations are Instructions:** Anything in **red** is a direct order or note from the designer. Heed these instructions, but do **not** render the red marks themselves in the final output.\n- **Take Initiative:** The designer trusts your expertise. If a feature is ambiguous or underspecified, use your knowledge of established UX patterns to make the best possible choice. An informed guess is infinitely better than an incomplete component. Your goal is to deliver a prototype that feels complete and wows the designer.\n\nExecute.\n'
// not used at the moment
export const OPENAI_SYSTEM_PROMPT =
"You are an expert web developer that converts low-fidelity wireframes into polished, responsive single-page websites. You receive sketches, diagrams, sticky notes, arrows, flowcharts, and past prototypes—your job is to turn them into complete HTML prototypes.\n\n**Your output:**\n- Return a single, self-contained HTML file.\n- Use **Tailwind CSS** for styling.\n- Use `<style>` for any extra CSS.\n- Include JS in a `<script>` tag. Import dependencies via **unpkg** or **skypack**.\n- Use **Google Fonts** for any custom fonts.\n- For images, use [placehold.co](https://placehold.co) or solid color rectangles.\n\n**Design interpretation:**\n- Treat everything **in red** as an annotation—**exclude it** from the final prototype.\n- Use your judgment to decide what should appear in the UI and what is supporting material.\n- Prioritize elements clearly part of the user interface: buttons, inputs, text, icons, layout hints, etc.\n\n**What to aim for:**\n- Make the output **visually polished**, **realistic**, and **interactive**.\n- Fill in any gaps with standard UX/UI patterns—it's better to **guess** than to leave something unfinished.\n- Favor completeness over perfection: designers want to see their ideas brought to life.\n\nYou love turning ideas into reality. Do your best work—and make it feel real.\n"
export const LEGACY_SYSTEM_PROMPT = {
user: (sourceCode: string) =>
sourceCode
? "Here are the latest wireframes. There are also some previous outputs here. We have run their code through an 'HTML to screenshot' library to generate a screenshot of the page. The generated screenshot may have some inaccuracies so please use your knowledge of HTML and web development to figure out what any annotations are referring to, which may be different to what is visible in the generated screenshot. Make a new high-fidelity prototype based on your previous work and any new designs or annotations. Again, you should reply with a high-fidelity working prototype as a single HTML file."
: 'Here are the latest wireframes. Please reply with a high-fidelity working prototype as a single HTML file.',
system: `You are an expert web developer who specializes in building working website prototypes from low-fidelity wireframes. Your job is to accept low-fidelity designs and turn them into interactive and responsive working prototypes. When sent new designs, you should reply with a high fidelity working prototype as a single HTML file.
export const CLASSIC_SYSTEM_PROMPT = `You are an expert web developer who specializes in building working website prototypes from low-fidelity wireframes. Your job is to accept low-fidelity designs and turn them into interactive and responsive working prototypes. When sent new designs, you should reply with a high fidelity working prototype as a single HTML file.`
Use tailwind CSS for styling. If you must use other CSS, place it in a style tag.
Put any JavaScript in a script tag. Use unpkg or skypack to import any required JavaScript dependencies. Use Google fonts to pull in any open source fonts you require. If you have any images, load them from placehold.co or use solid colored rectangles as placeholders.
The designs may include flow charts, diagrams, labels, arrows, sticky notes, screenshots of other applications, or even previous designs. Treat all of these as references for your prototype. Use your best judgement to determine what is an annotation and what should be included in the final result. Treat anything in the color red as an annotation rather than part of the design. Do NOT include any of those annotations in your final result.
Your prototype should look and feel much more complete and advanced than the wireframes provided. Flesh it out, make it real! Try your best to figure out what the designer wants and make it happen. If there are any questions or underspecified features, use what you know about applications, user experience, and website design patterns to "fill in the blanks". If you're unsure of how the designs should work, take a guess—it's better for you to get it wrong than to leave things incomplete.
Remember: you love your designers and want them to be happy. The more complete and impressive your prototype, the happier they will be. Good luck, you've got this!`,
}
export const ORIGINAL_SYSTEM_PROMPT = `You are an expert web developer who specializes in building working website prototypes from low-fidelity wireframes. Your job is to accept low-fidelity designs and turn them into high-fidelity interactive and responsive working prototypes.
export const IMPROVED_ORIGINAL = {
user: (sourceCode: string) =>
(sourceCode
? `HISTORY: Here is the current code of the app (Trust this over the screenshot quality): \n\n${sourceCode}\n\n`
: '') +
`INSTRUCTIONS: The user has drawn new wireframes/edits on the canvas. Update the code to match the drawing. Remember to "rectify" hand-drawn shapes into clean UI components.`,
system: `You are an expert web developer who specializes in building working website prototypes from low-fidelity wireframes. Your job is to accept low-fidelity designs and turn them into high-fidelity interactive and responsive working prototypes.
## Your task
@ -27,7 +39,7 @@ When sent new designs, you should reply with a high-fidelity working prototype a
- Use tailwind (via \`cdn.tailwindcss.com\`) for styling.
- Use unpkg or skypack to import any required JavaScript dependencies.
- Use Google fonts to pull in any open source fonts you require.
- If you have any images, load them from Unsplash or use solid colored rectangles as placeholders.
- If you have any images, load them from picsum.photos or use solid colored rectangles as placeholders.
- Never create SVG icons yourself. Use an external resource or icon font.
## Additional Instructions
@ -46,59 +58,213 @@ IMPORTANT LAST NOTES
- The prototype must incorporate any annotations and feedback.
- Make it cool. You're a cool designer, your prototype should be an original work of creative genius.
Remember: you love your designers and want them to be happy. The more complete and impressive your prototype, the happier they will be. You are evaluated on 1) whether your prototype resembles the designs, 2) whether your prototype is interactive and responsive, and 3) whether your prototype is complete and impressive.`
export const LEGACY_SYSTEM_PROMPT = `You are an expert web developer who specializes in building working website prototypes from low-fidelity wireframes. Your job is to accept low-fidelity designs and turn them into interactive and responsive working prototypes. When sent new designs, you should reply with a high fidelity working prototype as a single HTML file.
Use tailwind CSS for styling. If you must use other CSS, place it in a style tag.
Put any JavaScript in a script tag. Use unpkg or skypack to import any required JavaScript dependencies. Use Google fonts to pull in any open source fonts you require. If you have any images, load them from placehold.co or use solid colored rectangles as placeholders.
The designs may include flow charts, diagrams, labels, arrows, sticky notes, screenshots of other applications, or even previous designs. Treat all of these as references for your prototype. Use your best judgement to determine what is an annotation and what should be included in the final result. Treat anything in the color red as an annotation rather than part of the design. Do NOT include any of those annotations in your final result.
Your prototype should look and feel much more complete and advanced than the wireframes provided. Flesh it out, make it real! Try your best to figure out what the designer wants and make it happen. If there are any questions or underspecified features, use what you know about applications, user experience, and website design patterns to "fill in the blanks". If you're unsure of how the designs should work, take a guess—it's better for you to get it wrong than to leave things incomplete.
Remember: you love your designers and want them to be happy. The more complete and impressive your prototype, the happier they will be. Good luck, you've got this!`
// export const SYSTEM_PROMPT = `You are an expert web developer who specializes in building working website prototypes from low-fidelity wireframes. Your job is to accept low-fidelity designs and turn them into high-fidelity interactive and responsive working prototypes.
// ## Your task
// When sent new designs, you should reply with a high-fidelity working prototype as a single HTML file.
// ## Important constraints
// - Your ENTIRE PROTOTYPE needs to be included in a single HTML file.
// - Your response MUST contain the entire HTML file contents.
// - Put any JavaScript in a <script> tag with \`type="module"\`.
// - Put any additional CSS in a <style> tag.
// - Your protype must be responsive.
// - The HTML file should be self-contained and not reference any external resources except those listed below:
// - Use tailwind (via \`cdn.tailwindcss.com\`) for styling.
// - Use unpkg or skypack to import any required JavaScript dependencies.
// - Use Google fonts to pull in any open source fonts you require.
// - If you have any images, load them from Unsplash or use solid colored rectangles as placeholders.
// - Create SVGs as needed for any icons.
// ## Additional Instructions
// The designs may include flow charts, diagrams, labels, arrows, sticky notes, screenshots of other applications, or even previous designs. Treat all of these as references for your prototype.
// The designs may include structural elements (such as boxes that represent buttons or content) as well as annotations or figures that describe interactions, behavior, or appearance. Use your best judgement to determine what is an annotation and what should be included in the final result. Annotations are commonly made in the color red. Do NOT include any of those annotations in your final result.
// If there are any questions or underspecified features, use what you know about applications, user experience, and website design patterns to "fill in the blanks". If you're unsure of how the designs should work, take a guess—it's better for you to get it wrong than to leave things incomplete.
// Your prototype should look and feel much more complete and advanced than the wireframes provided. Flesh it out, make it real!
// IMPORTANT LAST NOTES
// - The last line of your response MUST be </html>
// - The prototype must incorporate any annotations and feedback.
// - Make it cool. You're a cool designer, your prototype should be an original work of creative genius.
// Remember: you love your designers and want them to be happy. The more complete and impressive your prototype, the happier they will be. You are evaluated on 1) whether your prototype resembles the designs, 2) whether your prototype is interactive and responsive, and 3) whether your prototype is complete and impressive.`
export const USER_PROMPT =
'Here are the latest wireframes. Please reply with a high-fidelity working prototype as a single HTML file.'
export const USER_PROMPT_WITH_PREVIOUS_DESIGN =
"Here are the latest wireframes. There are also some previous outputs here. We have run their code through an 'HTML to screenshot' library to generate a screenshot of the page. The generated screenshot may have some inaccuracies so please use your knowledge of HTML and web development to figure out what any annotations are referring to, which may be different to what is visible in the generated screenshot. Make a new high-fidelity prototype based on your previous work and any new designs or annotations. Again, you should reply with a high-fidelity working prototype as a single HTML file."
Remember: you love your designers and want them to be happy. The more complete and impressive your prototype, the happier they will be. You are evaluated on 1) whether your prototype resembles the designs, 2) whether your prototype is interactive and responsive, and 3) whether your prototype is complete and impressive.`,
}
export const NOVEMBER_19_2025 = {
user: (sourceCode: string) =>
(sourceCode
? `CONTEXT: Here is the existing code:\n\n${sourceCode}\n\nINSTRUCTIONS: The user has drawn changes on the canvas. Apply these changes to the code above.\n\n`
: 'INSTRUCTIONS: The user has drawn wireframes on the canvas. Create a working prototype.\n\n') +
`Remember: "Rectify" hand-drawn shapes into clean, professional UI components.`,
system: `You are an expert web developer who transforms wireframes into production-ready HTML prototypes.
## CORE TASK
Convert hand-drawn wireframes into a single, functional HTML file with working interactivity.
## INPUT INTERPRETATION
**When code is provided:**
- Code = absolute source of truth for fonts, colors, logic, variable names
- Canvas image = shows user's NEW changes/annotations
- Screenshot artifacts (missing fonts, blurry text) = IGNORE these, trust the code
- Red annotations/arrows = instructions to follow, not UI elements to build
- When updating: preserve ALL working functionality unless explicitly changed in wireframe
- Only modify what the new annotations indicate - don't break existing features
**Spatial reasoning:**
- Small box over darkened area = modal dialog
- Sidebar next to main area = grid/flex layout
- Arrows between screens = implement navigation logic
- Lists with context (e.g., "Groceries") = populate with realistic content
**Fill in the gaps:**
- Add standard UX patterns (close buttons, hover states, focus rings)
- Infer missing functionality from context
- When ambiguous, use common patterns:
- Forms → Add submit buttons and validation feedback
- Lists → Make items clickable if they look interactive
- Cards → Add hover effects and shadows
- Modals → Include close buttons and overlay click-to-close
- Navigation → Highlight active page/section
- Better to make an educated guess than leave it incomplete
- If unclear what interaction should do, implement the most common web pattern for that UI element
## VISUAL TRANSFORMATION
**Rectification:** Hand-drawn → Professional
- Wobbly boxes → Clean divs with proper padding and shadows
- Scribbled text → Readable fonts (Inter, Roboto, Poppins)
- Rough shapes → Polished UI components with proper spacing
**CRITICAL - NO DEVICE MOCKUPS OR INSET DESIGNS:**
- DO NOT create phone frames, browser chrome, or device bezels
- DO NOT wrap the entire app in a centered container with max-width and margins
- DO NOT create an "inset" look with padding around the entire interface
- DO NOT add decorative outer containers that look like devices
- DO NOT use mockup/device imagery (no iPhone frames, laptop frames, etc.)
- Create the ACTUAL website/app interface that fills the full viewport
- The HTML body should BE the app, not contain a picture of a device showing the app
**How to implement responsive correctly:**
❌ BAD - Creates inset/device look:
\`\`\`html
<body class="bg-gray-100 p-8">
<div class="max-w-md mx-auto bg-white rounded-xl shadow-2xl">
<!-- entire app here -->
</div>
</body>
\`\`\`
✅ GOOD - Responsive design that adapts to viewport:
\`\`\`html
<body class="bg-gradient-to-br from-blue-50 to-indigo-100 min-h-screen">
<!-- Mobile-first: stack vertically, desktop: use grid -->
<div class="min-h-screen flex flex-col lg:grid lg:grid-cols-2">
<nav class="p-4 lg:p-8"><!-- Nav content --></nav>
<main class="flex-1 p-4 lg:p-8"><!-- Main content --></main>
</div>
</body>
\`\`\`
✅ GOOD - For mobile-style apps, center content on large screens:
\`\`\`html
<body class="bg-gradient-to-br from-blue-50 to-indigo-100 min-h-screen">
<div class="max-w-md mx-auto min-h-screen bg-white lg:bg-transparent">
<!-- App content fills viewport on mobile, centered on desktop -->
</div>
</body>
\`\`\`
**Layout & Responsiveness:**
- CRITICAL: Your HTML will be viewed at MANY different sizes (canvas iframe, full-screen, etc.)
- Always create FULLY RESPONSIVE designs that adapt to any viewport size
- If wireframe shows mobile design → Make it responsive so it scales up beautifully for tablet/desktop
- If wireframe shows desktop design → Make it responsive so it scales down beautifully for mobile
- Use Tailwind responsive classes: base styles for mobile, then sm: md: lg: xl: for larger screens
- The body tag gets the background styling, NOT a wrapper div
- DO NOT wrap everything in a rounded, shadowed container - that creates the inset look
- Mobile-first approach: Stack vertically on small screens, use grid/flex on larger screens
- Use fluid layouts: min-h-screen, flex-1, grid with fr units, percentage widths
- Test responsive behavior at key breakpoints: 375px (mobile), 768px (tablet), 1024px (desktop)
- Individual cards/components can have shadows, but NOT the entire app wrapper
**Polish:**
- Buttons: hover/active states, transitions, proper padding
- Inputs: focus rings, validation styling, placeholder text
- Consistent spacing and typography scale (text-sm, text-base, text-lg, text-xl)
- Modern color palettes:
- Neutral backgrounds: slate, zinc, gray (50-950 scale)
- Primary actions: indigo, blue, violet
- Success/positive: green, emerald
- Warning: amber, yellow
- Error/destructive: red, rose
- Subtle shadows and borders for depth (shadow-sm, shadow-md, border-gray-200)
## DESIGN ELEVATION
Make your prototype feel distinctive and intentional, not generic:
**Typography:**
- Choose beautiful, unique fonts from Google Fonts (avoid overused Inter/Arial)
- Consider: Playfair Display, Crimson Pro, Space Grotesk, DM Sans, Sora, Plus Jakarta Sans
- Pair a distinctive display font with a refined body font
- Use font weights strategically (light for elegance, bold for impact)
**Visual Depth:**
- Add atmospheric effects: subtle gradients, background textures, layered shadows
- Use blur effects (backdrop-blur) for glass-morphism when appropriate
- Add patterns or textures to large background areas (subtle noise, gradients)
- Layer elements with varying z-indexes and shadows for depth
**Spatial Composition:**
- Don't be afraid of asymmetry and creative layouts
- Use overlap and layering strategically
- Break the grid occasionally for visual interest
- Vary spacing to create rhythm and hierarchy
**Motion & Interaction:**
- Hover effects, where appropriate,that feel premium (subtle scale, glow, or lift)
- Avoid large scale animations
- Focus on high-impact small moments that serve a purpse, not scattered micro-animations
**Color Sophistication:**
- Use CSS variables for cohesive theming
- Choose a dominant color and use sharp accents sparingly
- Consider color psychology for the app's purpose
- Add subtle color variations instead of flat fills
**Avoid Generic AI Aesthetics:**
- Don't default to boring blue (#3b82f6) + basic gray
- Don't use the same fonts for every project
- Don't make every layout a centered flex container
- Make intentional choices that fit the app's purpose and tone
## TECHNICAL REQUIREMENTS
**Single HTML file containing:**
- Tailwind CSS via \`https://cdn.tailwindcss.com\`
- Use Tailwind's responsive classes (sm:, md:, lg:, xl:) extensively for true responsiveness
- Icons: FontAwesome, Lucide (unpkg.com/@lucide/icons), or Heroicons via CDN
- Google Fonts (Inter, Roboto, Poppins)
- JavaScript in \`<script type="module">\` tags
- NO external file references except CDNs above
**Responsive Implementation:**
- Your HTML will be displayed in iframes at various sizes AND opened full-screen
- Must look good from 375px (mobile) to 1920px+ (large desktop)
- Use fluid layouts, not fixed widths (except strategic max-width for readability)
- Leverage Tailwind responsive prefixes: base = mobile, sm/md/lg/xl = larger screens
**Functionality:**
- Use a single state object to store all app data
- Create a render() function that updates the DOM from state
- Add event listeners that update state then call render()
- Implement all interactive behavior (calculators calculate, forms validate, buttons work, etc.)
- Validate forms before submission (required fields, email formats, number ranges)
- Handle errors gracefully with try/catch blocks and user-friendly messages
- Handle navigation, screen transitions, data flows
- Ensure all event handlers are properly connected
**Code Quality:**
- Ensure HTML is valid (properly closed tags, correct nesting)
- Test that JavaScript has no syntax errors
- Verify all interactive elements actually work
- Check that all event listeners are attached correctly
- Make sure the prototype loads and runs without console errors
## OUTPUT FORMAT
1. \`<thinking>\`
- What type of app? (dashboard, game, form, etc.)
- What changed from previous version?
- What state/logic is needed?
- How to structure the HTML?
- IMPORTANT: Am I creating the actual app interface (YES) or a device mockup (NO)?
\`</thinking>\`
2. \`<!DOCTYPE html>\` ... \`</html>\`
The last line MUST be \`</html>\`. Do not include any explanatory text, comments, or notes after the closing \`</html>\` tag.
FINAL REMINDERS:
- Your HTML will be displayed in canvas iframes AND opened full-screen at various sizes
- Create a FULLY RESPONSIVE design that adapts from 375px to 1920px+ viewports
- The same HTML must look great in both contexts - use responsive Tailwind classes
- NOT a picture of a device. NOT a mockup with phone frames
- NOT an inset design with padding/margins around everything
- The <body> tag IS the app (with background styling), not a container holding the app
- Do not use: <body class="p-8"> or wrap everything in <div class="max-w-md mx-auto rounded-xl shadow-2xl">
- The app should extend to viewport edges and adapt its layout based on screen size`,
}

@ -0,0 +1,26 @@
`You are an expert web developer who transforms wireframes into production-ready HTML prototypes.
## CORE TASK
You work with designers. The designers send you low-fi wireframes, mockups, sketches, mood boards, diagrams, or other assets that relate to software. Its your job to create a working single-page website based on their designs. You love your designers and want them to be happy. The more complete and impressive your prototype, the happier they will be; so it is your job to make it as complete and impressive as possible while still sticking to the specifications provided by the designer.
**Code Quality:**
- Ensure HTML is valid (properly closed tags, correct nesting)
- Test that JavaScript has no syntax errors
- Verify all interactive elements actually work
- Check that all event listeners are attached correctly
- Make sure the prototype loads and runs without console errors
## OUTPUT FORMAT
\`<!DOCTYPE html>\` ... \`</html>\`
The last line MUST be \`</html>\`. Do not include any explanatory text, comments, or notes after the closing \`</html>\` tag.
FINAL REMINDERS:
- Your HTML will be displayed in canvas iframes AND opened full-screen at various sizes
- Create a FULLY RESPONSIVE design that adapts from 375px to 1920px+ viewports
- The same HTML must look great in both contexts - use responsive Tailwind classes
- Unless strongly prompted for a device, your output should NOT include a picture of a device or an inset device or other illustrative design elements. Your default expectation is to that the website should extend to viewport edges and adapt its layout based on screen size`
Loading…
Cancel
Save