A Chrome extension that adds an Optimise button to Google Stitch, transforming rough prompts into structured, high-quality prompts that produce better UI designs.
Powered by Gemini 3 Flash Preview via the Google AI Studio API.
Stitch's output quality is highly sensitive to how prompts are written. The better you articulate your intention — with specific component names, hex colours, layout structure, and visual tone — the more accurate and complete the generated design.
A few things the community has discovered through heavy use:
- Prompts over ~5,000 characters cause Stitch to omit components. You need to be precise and concise.
- Stitch doesn't remember previous context unless you're extremely explicit and incremental. Every prompt should be self-contained.
- Vague adjectives produce generic output. "Modern" means nothing; "clean, minimal, with generous whitespace and a tight 8px grid" does.
- Google's own enhance-prompt skill (from the official stitch-skills repo, 5,000+ weekly installs) codifies a specific structure — Design System block + numbered Page Structure — that reliably produces better results.
This extension applies all of that automatically, so you can write naturally and get a production-quality prompt without thinking about format.
When you type a casual prompt like:
A clean dashboard for a SaaS analytics tool. Dark mode, modern feel. Show charts, user stats, and recent activity.
The extension rewrites it into a structured prompt following all official Stitch best practices:
A sophisticated SaaS analytics dashboard with a dark, data-dense layout. Clean, minimal design with strong visual hierarchy and purposeful use of colour to surface key metrics.
DESIGN SYSTEM:
- Platform: Web, Desktop-first
- Theme: Dark, professional, data-focused
- Background: Deep Navy (#0f172a)
- Primary Accent: Electric Blue (#3b82f6) for interactive elements and highlights
- Surface: Slate (#1e293b) for cards and panels
- Text Primary: White (#f8fafc)
- Text Secondary: Muted Grey (#94a3b8) for labels and captions
- Typography: Clean sans-serif, medium weight headings, tabular figures for numbers
- Buttons: Rounded corners (6px), solid primary and ghost variants
PAGE STRUCTURE:
- Top navigation bar: Logo left, global search centre, user avatar and notifications right
- KPI row: Four stat cards showing key metrics with trend indicators (up/down arrows, percentage change)
- Main chart area: Large line chart for traffic over time, toggle for daily/weekly/monthly
- Secondary row: Donut chart for traffic sources left, recent activity feed right ...
This structured format dramatically improves Stitch's output quality.
- Download or clone this repository
- Open Chrome and navigate to
chrome://extensions/ - Enable Developer mode (toggle in top-right)
- Click Load unpacked and select the
stitch-optimiserfolder - Click the extension icon in your toolbar and enter your Google AI Studio API key
- Go to stitch.withgoogle.com
- Type your prompt as normal in the input field
- Click the ✦ Optimise button (appears next to the App/Web toggle)
- Review the enhanced prompt — it preserves all your original details
- Click Generate designs as normal
The extension applies the following techniques from the official Stitch Prompt Guide:
- Structured sections — organises into Design System + Page Structure format
- UI/UX keywords — replaces vague terms with precise component names
- Vibe amplification — expands terse adjectives into richer visual descriptions
- Colour formatting — resolves brand colours to hex values with functional roles
- Platform inference — adds Web/Mobile and Desktop/Mobile-first context
- Imagery guidance — describes the style of images where relevant
- Length control — keeps output under 2500 characters to avoid Stitch omitting components
- Your API key is stored locally in Chrome's extension storage (
chrome.storage.local) - It is sent only to
generativelanguage.googleapis.com(Google's Gemini API) - No data is sent to any third-party server
- No analytics or tracking
Gemini 3 Flash Preview has a free tier on Google AI Studio. Each optimisation call uses roughly 500–1000 input tokens and 500–800 output tokens, so the cost at paid rates would be fractions of a penny per use.
stitch-optimiser/
├── manifest.json # Extension manifest (Manifest V3)
├── content.js # Injected script — button + Gemini API logic
├── content.css # Button and toast notification styles
├── popup.html # API key management popup
├── popup.js # Popup logic
├── assets/
│ └── screenshot.png
└── icons/
├── icon16.png
├── icon48.png
└── icon128.png
- Chrome 88+ (Manifest V3 support)
- A Google AI Studio API key (get one free)
