stitch-mcp-generate-screen-from-text
npx machina-cli add skill gabelul/stitch-kit/stitch-mcp-generate-screen-from-text --openclawStitch MCP — Generate Screen from Text
Generates a UI design screen from a structured text prompt. This is the central action in any Stitch workflow — everything before it (spec generation, prompt assembly) is preparation, and everything after it (screen retrieval, code conversion) is follow-through.
Critical prerequisite
Only use this skill when the user explicitly mentions "Stitch".
You must have a projectId before calling this. If you don't have one:
- Create a new project via
stitch-mcp-create-project - Or find an existing project via
stitch-mcp-list-projects
When to use
- User asks to "design", "generate", "create", or "make" a screen using Stitch
- The orchestrator has assembled a prompt via
stitch-ui-prompt-architect - User provides specific visual requirements and wants a Stitch-generated result
Call the MCP tool
{
"name": "generate_screen_from_text",
"arguments": {
"projectId": "3780309359108792857",
"prompt": "[Full structured prompt — see below]",
"deviceType": "MOBILE",
"modelId": "GEMINI_3_PRO"
}
}
Parameter reference
projectId — numeric ID only, no projects/ prefix
✅ "3780309359108792857"
❌ "projects/3780309359108792857"
prompt — use the [Context] [Layout] [Components] structure
[Context & Style]
[Device] [Mode] [screen type] for [product]. [aesthetic]. [theme]. [colors]. [font].
[Layout]
[Describe the structural arrangement]
[Components]
[Specific named UI components with details]
For best results, use the stitch-ui-prompt-architect skill to assemble the prompt before calling this tool.
deviceType
| Value | Use when |
|---|---|
MOBILE | Mobile app, phone-sized UI (default if uncertain) |
DESKTOP | Web dashboard, landing page, SaaS UI |
TABLET | Tablet-specific layout |
AGNOSTIC | Not tied to a specific device — responsive/fluid layout |
modelId
| Value | Use when |
|---|---|
GEMINI_3_PRO | Recommended — high-fidelity, complex layouts, production quality |
GEMINI_3_FLASH | Wireframes, rapid iteration, when speed matters more than quality |
After generating
This tool returns session info but not the actual screenshot/HTML. To retrieve the design:
- Call
stitch-mcp-list-screenswithprojects/[projectId]to find the new screen - Call
stitch-mcp-get-screenwith theprojectIdandscreenIdto get the screenshot and HTML
Prompt quality checklist
Before calling this tool, verify the prompt:
- Specifies device type consistently with
deviceTypeparameter - Names specific components (not "some buttons" — "primary 'Sign In' button")
- Includes colors (hex codes or clear color names)
- Uses realistic content (not Lorem Ipsum)
- Specifies light or dark mode explicitly
Timing
Stitch generation takes 60–180 seconds. This is normal behavior, not a timeout.
- Do NOT retry during this window
- Do NOT assume failure if it takes > 60 seconds
- If it fails: wait 60 seconds, retry ONCE max
- Each call creates a new generation — retries mean duplicate screens
References
examples/desktop.md— Desktop dashboard prompts (SaaS analytics, admin panel)examples/mobile.md— Mobile app prompts (login, social feed, e-commerce)
Source
git clone https://github.com/gabelul/stitch-kit/blob/main/skills/stitch-mcp-generate-screen-from-text/SKILL.mdView on GitHub Overview
Generates a high-fidelity UI screen or wireframe from a structured text prompt using Stitch. This is the central action in the Stitch workflow, bridging prompt preparation and screen retrieval. A valid projectId is required to run this tool.
How This Skill Works
The tool consumes a structured prompt in the prompt field, aligned with the [Context] [Layout] [Components] structure. After generation, it returns session info; use stitch-mcp-list-screens and stitch-mcp-get-screen to retrieve the actual design. Device type and modelId influence fidelity and layout details.
When to Use It
- When the user asks to design, generate, create, or make a screen with Stitch
- When the orchestrator has assembled a prompt via stitch-ui-prompt-architect
- When the user provides explicit visual requirements and wants a Stitch-generated result
- When you need production-quality, high-fidelity UI screens from text prompts
- As the central step after prompt assembly and before retrieving the final screen
Quick Start
- Step 1: Use stitch-ui-prompt-architect to assemble a structured prompt with [Context] [Layout] [Components]
- Step 2: Call generate_screen_from_text with your projectId, the assembled prompt, and desired deviceType and modelId
- Step 3: Retrieve the design by listing screens with stitch-mcp-list-screens and getting the screen with stitch-mcp-get-screen
Best Practices
- Ensure deviceType matches the target device in the prompt
- Name specific components (for example, primary Sign In button) rather than generic terms
- Include colors with hex codes or clear color names in the prompt
- Use realistic content instead of placeholders like Lorem Ipsum
- Explicitly specify light or dark mode in the prompt and align with device settings
Example Use Cases
- Mobile login screen with a prominent Sign In button, email field, and forgot password link
- Mobile onboarding flow showing 3 progress cards and an intuitive next-step CTA
- Desktop SaaS dashboard with left navigation, analytics cards, and a top bar
- Tablet product detail page featuring image gallery, price, and Add to Cart
- Mobile social feed with header, posts, and bottom navigation bar