Build screens in Stitch for: $ARGUMENTS
$ARGUMENTS should include:
- What to build (e.g., "the onboarding flow", "a course detail page", "dashboard screens")
- Optionally: a reference to an existing stitch-export file (e.g., "_docs/stitch-exports/onboarding.md")
- Optionally: an existing Stitch project ID to add screens to
- Optionally: device target ("mobile", "desktop", "tablet")
- Optionally: a sketch, wireframe, or screenshot to use as a visual reference
- Empty — ask the user what they want to build
Purpose
This skill takes a feature description or a /stitch-export specification and builds it in Stitch by calling the MCP tools directly. It creates a project (if needed), then generates screens one at a time using prompts that follow Stitch best practices.
Google Stitch is an experimental AI UI generator powered by Gemini that transforms text prompts and visual references into functional UI designs. It supports text-to-UI generation, image-to-UI conversion, multi-screen app flows, and export to HTML/CSS, Figma, and code.
Before Starting
- Check for an existing export — If the user references a stitch-export file, read it. The Stitch Prompt sections are ready to use.
- Check for an existing project — If the user provides a project ID, use it. Otherwise, create a new project.
- Determine device target — Default to DESKTOP if not specified. Ask if the feature clearly needs a specific target.
- Determine build order — If building multiple screens, build them in the order a user would encounter them (entry screen first).
- Check for visual references — If the user provides a sketch, wireframe, or screenshot, incorporate it as context alongside the text prompt.
Stitch Prompting Best Practices
When generating prompts for generate_screen_from_text, follow these rules:
DO:
- Lead with purpose — Start every prompt with what the screen IS and what it ACCOMPLISHES
- Name the user — "for a student enrolling in a course" not just "an enrollment screen"
- List content by priority — Most important information first, supporting details after
- Include realistic data — Use domain-appropriate example values, names, prices, dates
- State actions clearly — "The user can [verb] [object] which [outcome]"
- Mention all states — Tell Stitch about empty, loading, error, and success states (see State Coverage below)
- One screen per prompt — Keep each generation focused on a single view
- Be specific about data — "Shows 6 course cards with title, instructor name, duration, and price" not "shows some courses"
- Include functional requirements — Describe interactive elements, form fields and validation, navigation patterns, and user flows
- Specify platform context — Indicate whether this is mobile, tablet, desktop, or responsive web so Stitch can make appropriate layout decisions
- Mention accessibility needs — Include requirements like minimum touch target sizes, color contrast needs, keyboard navigation support, and screen reader considerations as functional constraints (not visual prescriptions)
DON'T:
- Don't prescribe design — No colors, fonts, layouts, components, spacing, CSS, Tailwind, or visual style. Even subtle hints like "clean and modern" constrain Stitch unnecessarily.
- Don't name components — No "card", "modal", "sidebar", "hero", "navbar". Describe what the user sees.
- Don't specify arrangement — No "left side", "top-right corner", "in a grid", "below the fold". Let Stitch decide layout.
- Don't include code — No HTML, JSX, TypeScript, or any code snippets
- Don't over-constrain — Give Stitch freedom to make design decisions. More constraints = worse output.
- Don't use vague language — "A nice dashboard" tells Stitch nothing. Be specific about content and function.
Prompt Structure Template:
Build a [screen type] for [user persona in context].
This screen [purpose — the job it does for the user].
The screen shows:
- [Most important content with example value]
- [Second most important content with example value]
- [Supporting content]
The user can:
- [Primary action — what happens when they do it]
- [Secondary action — what happens]
[Key business rule that affects display]
When there's nothing to show yet, [empty state — what message and what action].
If something fails, [error state — what the user sees and can do about it].
Use realistic [domain] content — [specific guidance].
State Coverage
Every screen prompt should consider these states. Include whichever are relevant:
- Default — The screen with typical data loaded
- Empty — Nothing to show yet. What message does the user see? What action can they take?
- Loading — Data is being fetched. What does the user see while waiting?
- Error — Something failed. What does the user see? How do they recover?
- Success — An action completed. How is the user confirmed and guided to the next step?
- Partial — Only some data is available (e.g., new user with one item instead of many)
- Edge cases — Overflow text, missing images, expired content, permission restrictions
Image-to-UI Workflows
When the user provides a sketch, wireframe, or screenshot as a reference:
- Describe what the image shows — Translate the visual into the content-and-function language Stitch works best with
- Specify what to keep vs. change — "Follow the information hierarchy from this wireframe, but this is for [user persona] who needs to [goal]"
- Add missing context — Sketches rarely include states, data specifics, or interaction details. Fill those gaps in the prompt.
- Don't ask Stitch to copy visual style — Use the reference for structure and content priority, not colors or fonts
Execution Steps
Step 1 — Gather Input
If the user referenced a stitch-export file, read it. Extract the screen specs and Stitch prompts. If no export exists, gather requirements conversationally (ask up to 4 questions max).
Step 2 — Create or Select Project
If no project ID provided:
→ Call mcp__stitch__create_project with a descriptive title
→ Record the project ID
If project ID provided:
→ Call mcp__stitch__get_project to verify it exists
→ Call mcp__stitch__list_screens to see what's already built
Step 3 — Generate Screens
For each screen in the specification:
Compose the prompt using the template above. If a stitch-export exists, use its Stitch Prompt sections. If not, write the prompt from scratch following the best practices.
Call generate_screen_from_text with:
projectId: the project ID
prompt: the composed prompt
deviceType: the target device (DESKTOP, MOBILE, TABLET, or AGNOSTIC)
modelId: GEMINI_3_1_PRO (default to the most capable model)
Check output_components — If the response contains suggestions, present them to the user before proceeding.
Wait for confirmation before generating the next screen. Generation takes time — never retry a call that hasn't returned yet.
Report what was built after each screen generation.
Step 4 — Review and Report
After all screens are generated:
## Stitch Build Complete: [Feature Name]
### Project
- **Title:** [project title]
- **Project ID:** [project ID]
### Screens Generated
1. [Screen name] — [device type] — [status]
2. ...
### Next Steps
- Open Stitch to review the generated screens visually
- Use `/stitch-iterate` to refine individual screens
- Use `/stitch-variants` to explore design alternatives for key screens
- Use `edit_screens` for targeted adjustments (e.g., "make the call-to-action more prominent")
Handling Multiple Screens
When building a multi-screen flow:
- Build in user-journey order — Start with the entry screen, end with the completion screen
- One at a time — Generate, review, then proceed. Don't batch.
- Reference previous screens — When generating screen 2+, mention continuity: "This is the next step after [previous screen]. The user has already [what they did]. Now they need to [current purpose]."
- Maintain consistency — Mention the same terminology, data shapes, and user persona across all prompts so Stitch maintains visual and content consistency.
Responsive Multi-Screen Strategy
When a feature needs to work across device sizes:
- Pick a primary device — Build all screens for one device first (usually whichever the user will use most)
- Complete the flow — Get the full user journey working on the primary device before adapting
- Adapt screen by screen — When generating for additional devices, reference what the primary version shows and describe how content priority or available actions might shift (e.g., "On mobile, the user still needs to see [critical data] and [primary action], but [secondary content] can be deferred")
- Don't prescribe responsive layout — Describe what content matters at each size. Let Stitch decide how to arrange it.
Iteration After Generation
Once screens exist in a project, use these strategies to refine:
Annotate to Edit
Use Stitch's annotation feature for targeted changes without regenerating the whole screen. Describe modifications in content/function terms:
- "The primary action needs to be more prominent"
- "Add a way for the user to see their progress"
- "This section needs to show the instructor's credentials"
Generate Variants
Request multiple variations to explore different approaches to the same content:
- "Generate 3 variants: one emphasizing the data, one emphasizing the primary action, one emphasizing social proof"
- Variants help when you're unsure which information hierarchy works best
Progressive Refinement
Start broad, then add specificity in follow-up prompts:
- Generate the screen with core content and actions
- Refine by adding states ("Now add the empty state for when the user has no courses yet")
- Refine by adding secondary content ("Add a way for the user to see related content")
Model Selection
- GEMINI_3_1_PRO — Default. Best quality. Use for important screens, complex layouts, or when quality matters most.
- GEMINI_3_FLASH — Faster, good quality. Use for rapid iteration, simple screens, or when exploring ideas quickly.
Choose based on the screen complexity and user's preference for speed vs. quality.
Anti-Patterns
- Don't retry failed generations — Stitch generation takes time. If a call times out, check with
get_screen later rather than retrying immediately.
- Don't batch all screens at once — Generate one at a time so the user can review and course-correct.
- Don't include design direction in prompts — Even subtle hints like "clean and modern" constrain Stitch unnecessarily. Focus on content and function.
- Don't generate without context — A prompt like "build a dashboard" produces generic results. Always include who uses it, what data it shows, and what actions are available.
- Don't skip the export step for complex features — If the feature has more than 3 screens, run
/stitch-export first to plan the screen flow before building.
- Don't forget states — A screen with only the happy path is incomplete. Always consider empty, error, and loading states.
- Don't copy visual style from references — When using sketches or screenshots as input, extract the content structure and user intent, not the colors, fonts, or layout decisions.
Workflow
Part of the Stitch workflow: stitch-build → stitch-iterate → stitch-variants → stitch-export
1---2name: stitch-build3description: Create a Stitch project and generate screens from a feature specification or user description. Calls Stitch MCP tools directly to build screens one at a time, following best practices for Stitch prompting.4user-invocable: true5allowed-tools: Read, Write, Edit, Bash, Grep, Glob, mcp__stitch__create_project, mcp__stitch__generate_screen_from_text, mcp__stitch__list_projects, mcp__stitch__list_screens, mcp__stitch__get_screen, mcp__stitch__get_project6metadata:7 source: https://skillmd.com/skills/joshuashepherd/stitch-build8---910Build screens in Stitch for: $ARGUMENTS1112$ARGUMENTS should include:13- What to build (e.g., "the onboarding flow", "a course detail page", "dashboard screens")14- Optionally: a reference to an existing stitch-export file (e.g., "_docs/stitch-exports/onboarding.md")15- Optionally: an existing Stitch project ID to add screens to16- Optionally: device target ("mobile", "desktop", "tablet")17- Optionally: a sketch, wireframe, or screenshot to use as a visual reference18- Empty — ask the user what they want to build1920## Purpose2122This skill takes a feature description or a `/stitch-export` specification and builds it in Stitch by calling the MCP tools directly. It creates a project (if needed), then generates screens one at a time using prompts that follow Stitch best practices.2324Google Stitch is an experimental AI UI generator powered by Gemini that transforms text prompts and visual references into functional UI designs. It supports text-to-UI generation, image-to-UI conversion, multi-screen app flows, and export to HTML/CSS, Figma, and code.2526## Before Starting27281. **Check for an existing export** — If the user references a stitch-export file, read it. The Stitch Prompt sections are ready to use.292. **Check for an existing project** — If the user provides a project ID, use it. Otherwise, create a new project.303. **Determine device target** — Default to DESKTOP if not specified. Ask if the feature clearly needs a specific target.314. **Determine build order** — If building multiple screens, build them in the order a user would encounter them (entry screen first).325. **Check for visual references** — If the user provides a sketch, wireframe, or screenshot, incorporate it as context alongside the text prompt.3334## Stitch Prompting Best Practices3536When generating prompts for `generate_screen_from_text`, follow these rules:3738### DO:39- **Lead with purpose** — Start every prompt with what the screen IS and what it ACCOMPLISHES40- **Name the user** — "for a student enrolling in a course" not just "an enrollment screen"41- **List content by priority** — Most important information first, supporting details after42- **Include realistic data** — Use domain-appropriate example values, names, prices, dates43- **State actions clearly** — "The user can [verb] [object] which [outcome]"44- **Mention all states** — Tell Stitch about empty, loading, error, and success states (see State Coverage below)45- **One screen per prompt** — Keep each generation focused on a single view46- **Be specific about data** — "Shows 6 course cards with title, instructor name, duration, and price" not "shows some courses"47- **Include functional requirements** — Describe interactive elements, form fields and validation, navigation patterns, and user flows48- **Specify platform context** — Indicate whether this is mobile, tablet, desktop, or responsive web so Stitch can make appropriate layout decisions49- **Mention accessibility needs** — Include requirements like minimum touch target sizes, color contrast needs, keyboard navigation support, and screen reader considerations as functional constraints (not visual prescriptions)5051### DON'T:52- **Don't prescribe design** — No colors, fonts, layouts, components, spacing, CSS, Tailwind, or visual style. Even subtle hints like "clean and modern" constrain Stitch unnecessarily.53- **Don't name components** — No "card", "modal", "sidebar", "hero", "navbar". Describe what the user sees.54- **Don't specify arrangement** — No "left side", "top-right corner", "in a grid", "below the fold". Let Stitch decide layout.55- **Don't include code** — No HTML, JSX, TypeScript, or any code snippets56- **Don't over-constrain** — Give Stitch freedom to make design decisions. More constraints = worse output.57- **Don't use vague language** — "A nice dashboard" tells Stitch nothing. Be specific about content and function.5859### Prompt Structure Template:60```61Build a [screen type] for [user persona in context].6263This screen [purpose — the job it does for the user].6465The screen shows:66- [Most important content with example value]67- [Second most important content with example value]68- [Supporting content]6970The user can:71- [Primary action — what happens when they do it]72- [Secondary action — what happens]7374[Key business rule that affects display]7576When there's nothing to show yet, [empty state — what message and what action].77If something fails, [error state — what the user sees and can do about it].7879Use realistic [domain] content — [specific guidance].80```8182### State Coverage8384Every screen prompt should consider these states. Include whichever are relevant:8586- **Default** — The screen with typical data loaded87- **Empty** — Nothing to show yet. What message does the user see? What action can they take?88- **Loading** — Data is being fetched. What does the user see while waiting?89- **Error** — Something failed. What does the user see? How do they recover?90- **Success** — An action completed. How is the user confirmed and guided to the next step?91- **Partial** — Only some data is available (e.g., new user with one item instead of many)92- **Edge cases** — Overflow text, missing images, expired content, permission restrictions9394### Image-to-UI Workflows9596When the user provides a sketch, wireframe, or screenshot as a reference:97981. **Describe what the image shows** — Translate the visual into the content-and-function language Stitch works best with992. **Specify what to keep vs. change** — "Follow the information hierarchy from this wireframe, but this is for [user persona] who needs to [goal]"1003. **Add missing context** — Sketches rarely include states, data specifics, or interaction details. Fill those gaps in the prompt.1014. **Don't ask Stitch to copy visual style** — Use the reference for structure and content priority, not colors or fonts102103## Execution Steps104105### Step 1 — Gather Input106If the user referenced a stitch-export file, read it. Extract the screen specs and Stitch prompts. If no export exists, gather requirements conversationally (ask up to 4 questions max).107108### Step 2 — Create or Select Project109```110If no project ID provided:111 → Call mcp__stitch__create_project with a descriptive title112 → Record the project ID113114If project ID provided:115 → Call mcp__stitch__get_project to verify it exists116 → Call mcp__stitch__list_screens to see what's already built117```118119### Step 3 — Generate Screens120For each screen in the specification:1211221. **Compose the prompt** using the template above. If a stitch-export exists, use its Stitch Prompt sections. If not, write the prompt from scratch following the best practices.1231242. **Call `generate_screen_from_text`** with:125 - `projectId`: the project ID126 - `prompt`: the composed prompt127 - `deviceType`: the target device (DESKTOP, MOBILE, TABLET, or AGNOSTIC)128 - `modelId`: GEMINI_3_1_PRO (default to the most capable model)1291303. **Check `output_components`** — If the response contains suggestions, present them to the user before proceeding.1311324. **Wait for confirmation** before generating the next screen. Generation takes time — never retry a call that hasn't returned yet.1331345. **Report what was built** after each screen generation.135136### Step 4 — Review and Report137138After all screens are generated:139140```markdown141## Stitch Build Complete: [Feature Name]142143### Project144- **Title:** [project title]145- **Project ID:** [project ID]146147### Screens Generated1481. [Screen name] — [device type] — [status]1492. ...150151### Next Steps152- Open Stitch to review the generated screens visually153- Use `/stitch-iterate` to refine individual screens154- Use `/stitch-variants` to explore design alternatives for key screens155- Use `edit_screens` for targeted adjustments (e.g., "make the call-to-action more prominent")156```157158## Handling Multiple Screens159160When building a multi-screen flow:1611621. **Build in user-journey order** — Start with the entry screen, end with the completion screen1632. **One at a time** — Generate, review, then proceed. Don't batch.1643. **Reference previous screens** — When generating screen 2+, mention continuity: "This is the next step after [previous screen]. The user has already [what they did]. Now they need to [current purpose]."1654. **Maintain consistency** — Mention the same terminology, data shapes, and user persona across all prompts so Stitch maintains visual and content consistency.166167### Responsive Multi-Screen Strategy168169When a feature needs to work across device sizes:1701711. **Pick a primary device** — Build all screens for one device first (usually whichever the user will use most)1722. **Complete the flow** — Get the full user journey working on the primary device before adapting1733. **Adapt screen by screen** — When generating for additional devices, reference what the primary version shows and describe how content priority or available actions might shift (e.g., "On mobile, the user still needs to see [critical data] and [primary action], but [secondary content] can be deferred")1744. **Don't prescribe responsive layout** — Describe what content matters at each size. Let Stitch decide how to arrange it.175176## Iteration After Generation177178Once screens exist in a project, use these strategies to refine:179180### Annotate to Edit181Use Stitch's annotation feature for targeted changes without regenerating the whole screen. Describe modifications in content/function terms:182- "The primary action needs to be more prominent"183- "Add a way for the user to see their progress"184- "This section needs to show the instructor's credentials"185186### Generate Variants187Request multiple variations to explore different approaches to the same content:188- "Generate 3 variants: one emphasizing the data, one emphasizing the primary action, one emphasizing social proof"189- Variants help when you're unsure which information hierarchy works best190191### Progressive Refinement192Start broad, then add specificity in follow-up prompts:1931. Generate the screen with core content and actions1942. Refine by adding states ("Now add the empty state for when the user has no courses yet")1953. Refine by adding secondary content ("Add a way for the user to see related content")196197## Model Selection198199- **GEMINI_3_1_PRO** — Default. Best quality. Use for important screens, complex layouts, or when quality matters most.200- **GEMINI_3_FLASH** — Faster, good quality. Use for rapid iteration, simple screens, or when exploring ideas quickly.201202Choose based on the screen complexity and user's preference for speed vs. quality.203204## Anti-Patterns205206- **Don't retry failed generations** — Stitch generation takes time. If a call times out, check with `get_screen` later rather than retrying immediately.207- **Don't batch all screens at once** — Generate one at a time so the user can review and course-correct.208- **Don't include design direction in prompts** — Even subtle hints like "clean and modern" constrain Stitch unnecessarily. Focus on content and function.209- **Don't generate without context** — A prompt like "build a dashboard" produces generic results. Always include who uses it, what data it shows, and what actions are available.210- **Don't skip the export step for complex features** — If the feature has more than 3 screens, run `/stitch-export` first to plan the screen flow before building.211- **Don't forget states** — A screen with only the happy path is incomplete. Always consider empty, error, and loading states.212- **Don't copy visual style from references** — When using sketches or screenshots as input, extract the content structure and user intent, not the colors, fonts, or layout decisions.213214## Workflow215216Part of the Stitch workflow: stitch-build → stitch-iterate → stitch-variants → stitch-export