stitch-mcp-generate-screen-from-text
Skill45 starsChanged 8 months agoApache-2.0View on GitHub
Generates a high-fidelity UI screen or wireframe from a text prompt using Stitch. This is the core text-to-UI generation tool — the heart of the Stitch workflow.
In this repository36 other files it gives its agents.
- AGENTS.mdAGENTS.md
- stitch-a11ySkill
- stitch-animateSkill
- stitch-design-mdSkill
- stitch-design-systemSkill
- stitch-html-componentsSkill
- stitch-ideateSkill
- stitch-loopSkill
- stitch-mcp-apply-design-systemSkill
- stitch-mcp-create-design-system-from-design-mdSkill
- stitch-mcp-create-design-systemSkill
- stitch-mcp-create-projectSkill
- stitch-mcp-delete-projectSkill
- stitch-mcp-edit-screensSkill
- stitch-mcp-generate-variantsSkill
- stitch-mcp-get-projectSkill
- stitch-mcp-get-screenSkill
- stitch-mcp-list-design-systemsSkill
- stitch-mcp-list-projectsSkill
- stitch-mcp-list-screensSkill
- stitch-mcp-update-design-systemSkill
- stitch-mcp-upload-design-mdSkill
- stitch-nextjs-componentsSkill
- stitch-orchestratorSkill
- stitch-react-componentsSkill
- stitch-react-native-componentsSkill
- stitch-remotionSkill
- stitch-setupSkill
- stitch-shadcn-uiSkill
- stitch-skill-creatorSkill
- stitch-svelte-componentsSkill
- stitch-swiftui-componentsSkill
- stitch-ued-guideSkill
- stitch-ui-design-spec-generatorSkill
- stitch-ui-design-variantsSkill
- stitch-ui-prompt-architectSkill
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 5 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 17
Create a new project via stitch-mcp-create-project
- Very specific: line 90
Call stitch-mcp-list-screens with projects/[projectId] to find the new screen
- Very specific: line 91
Call stitch-mcp-get-screen with the projectId and screenId to get the screenshot and HTML
- Distinctive: line 95
Before calling this tool, verify the prompt:
- Distinctive: line 104
When the prompt is a complete PRD document (product overview, design system, multiple screen specifications, build guide), Stitch will …
- Very specific: line 114
Check output_components for continuation suggestions (e.g.
- Very specific: line 120
Wait 90-120 seconds, then call list_screens to discover what was generated
- Distinctive: line 121
If empty, wait another 60 seconds and retry the list call
- Distinctive: line 127
Do NOT retry during this window
- Distinctive: line 128
Do NOT assume failure if it takes > 60 seconds
- Very specific: line 130
If it fails: wait 90 seconds, check list_screens, retry ONCE max if nothing appeared
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Stitch 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" or when called from an upstream skill (e.g. stitch-ideate, stitch-orchestrator).
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_1_PRO",
"designSystem": "assets/15996705518239280238"
}
}Parameter reference
designSystem — optional, PREFIXED asset id
✅ "assets/15996705518239280238"
❌ "15996705518239280238"This is how you get design consistency across generated screens — pass the name of a design system from stitch-mcp-create-design-system, stitch-mcp-create-design-system-from-design-md, or stitch-mcp-list-design-systems (used as-is, with the assets/ prefix). This is the opposite format from apply_design_system's assetId, which wants the prefix stripped.
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_1_PRO | Recommended — complex layouts, high fidelity |
GEMINI_3_FLASH | Fast iteration, wireframes, simple changes |
GEMINI_3_PRO | Deprecated. Still works but will be removed. Use GEMINI_3_1_PRO instead. |
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
Batch generation from full PRDs
When the prompt is a complete PRD document (product overview, design system, multiple screen specifications, build guide), Stitch will generate multiple screens in a single call — not just one. Stitch generates up to 10 screens per call. A PRD with 8 screen specs typically produces 5-7 screens automatically.
This is the same mechanism Stitch's web Ideate uses for "generate all screens". The PRD format acts as a comprehensive prompt that Stitch decomposes internally.
How to use batch generation:
- Send the full PRD text as the
promptparameter - Stitch generates up to ~10 screens per call from a multi-screen PRD
Two possible outcomes depending on whether the MCP response times out:
If response returns with data:
- Check
output_componentsfor continuation suggestions (e.g. "Yes, make them all", "Generate remaining screens") - Automatically call
generate_screen_from_textagain with the suggestion text as theprompt— the user already initiated generation, no need to re-confirm - Repeat until no more
output_componentssuggestions appear (max 3 continuation calls to prevent infinite loops)
If response returns empty (HTTP timeout):
- Generation is still running server-side — do NOT retry
- Wait 90-120 seconds, then call
list_screensto discover what was generated - If empty, wait another 60 seconds and retry the list call
- Generate any missing screens individually with focused prompts referencing the PRD's design system
- Check
Timing
Stitch generation takes 60–180 seconds for single screens and up to 5 minutes for multi-screen PRD generation. This is normal behavior, not a timeout.
- Do NOT retry during this window
- Do NOT assume failure if it takes > 60 seconds
- The MCP tool may return empty for long generations — check
list_screensafterward - If it fails: wait 90 seconds, check
list_screens, retry ONCE max if nothing appeared - 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)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

