stitch-mcp-get-screen
npx machina-cli add skill partme-ai/stitch-skills/stitch-mcp-get-screen --openclawGet Screen Details
CRITICAL PREREQUISITE: You must ONLY use this skill when the user EXPLICITLY mentions "Stitch".
Retrieves the full details of a specific screen, including its HTML code and high-res screenshot.
Use Case
Invoke this skill when the user wants to "export" the code, view the full design details, or when the Agent needs to analyze the generated HTML structure.
Input Parameters
The skill expects you to extract the following information from the user request:
projectId(required): The project ID. Format: Pure ID (e.g.,37803...), noprojects/prefix.screenId(required): The screen ID. Format: Pure ID (e.g.,88805...), noscreens/prefix.
CRITICAL: When projectId and screenId are both available, call stitch-mcp-get-screen directly. Do NOT call stitch-mcp-get-project.
Resource Path Parsing
If the user provides a resource path or URL, use the following rules to extract projectId and screenId:
-
Format:
web application/stitch/projects/{projectId}/screens/{screenId}- Logic: Extract
projectIdandscreenIddirectly from the path segments. - Example:
web application/stitch/projects/3492931393329678076/screens/2e22a9fb99ba49ddb6ce8907a1e74d60->projectId="3492931393329678076",screenId="2e22a9fb99ba49ddb6ce8907a1e74d60".
- Logic: Extract
-
Format:
projects/{projectId}/screens/{screenId}- Logic: Extract
projectIdandscreenIdfrom the path segments.
- Logic: Extract
Agent flow:
- Recognize the user input matches one of the above formats.
- Extract
projectIdandscreenId. - Call
get_screenwith{"projectId": "<extracted projectId>", "screenId": "<extracted screenId>"}. - Use the returned
htmlCode.downloadUrl,screenshot.downloadUrl, and metadata for design-to-code (e.g. stitch-design-md or a framework conversion skill).
Output Schema
Returns a Screen object:
htmlCode: The actual HTML/CSS code of the UI.screenshot: High-resolution image URL.figmaExport: Figma file asset.width,height,deviceType.
Intent Recognition & Framework Conversion
After retrieving the screen details (HTML code), check if the user's request implies converting the design to a specific frontend framework.
Logic:
- Identify Framework: Look for specific keywords in user input (e.g., "uView", "uViewPro", "Vue", "React", "Flutter").
- Locate Skill: Search for and read the corresponding skill definition file to understand the "Design Contract" or conversion rules.
-
uViewPro / uni-app: If user mentions "uView", "uViewPro" or "UniApp", you MUST load and reference the complete context from the
stitch-uviewpro-componentsskill to ensure accurate code generation.- References: Read
skills/stitch-uviewpro-components/references/(especiallycontract.mdandtailwind-to-uviewpro.md) for core mapping rules. - API: Read
skills/stitch-uviewpro-components/api/component-api.mdfor component props and event definitions. - Examples: Read
skills/stitch-uviewpro-components/examples/usage.mdfor correct implementation patterns. - Resources: Read
skills/stitch-uviewpro-components/resources/architecture-checklist.mdfor design compliance.
- References: Read
-
uView (Standard): If user mentions "uView" (without "Pro") or "uView 2.0", load
stitch-uview-components.- Context: Read
references/(contract, tailwind-to-uview),api/component-api.md,examples/usage.md,resources/architecture-checklist.mdfromstitch-uview-components.
- Context: Read
-
Element Plus: If user mentions "Element Plus", "Element", "Vue Desktop", load
stitch-vue-element-components.- Context: Read
references/(contract, tailwind-to-element-plus),api/component-api.md,examples/usage.md,resources/architecture-checklist.mdfromstitch-vue-element-components.
- Context: Read
-
Vant UI: If user mentions "Vant", "Vue Mobile", load
stitch-vue-vant-components.- Context: Read
references/(contract, tailwind-to-vant),api/component-api.md,examples/usage.md,resources/architecture-checklist.mdfromstitch-vue-vant-components.
- Context: Read
-
Layui Vue: If user mentions "Layui", load
stitch-vue-layui-components.- Context: Read
references/(contract, tailwind-to-layui),api/component-api.md,examples/usage.md,resources/architecture-checklist.mdfromstitch-vue-layui-components.
- Context: Read
-
Bootstrap Vue: If user mentions "Bootstrap", load
stitch-vue-bootstrap-components.- Context: Read
references/(contract, tailwind-to-bootstrap),api/component-api.md,examples/usage.md,resources/architecture-checklist.mdfromstitch-vue-bootstrap-components.
- Context: Read
-
React / Tailwind: If user mentions "React" (standard), load
stitch-react-components.- Context: Read
references/tailwind-to-react.md,examples/usage.md,resources/architecture-checklist.mdfromstitch-react-components.
- Context: Read
-
Shadcn UI: If user mentions "Shadcn", "Next.js", "Radix", load
stitch-shadcn-ui.- Context: Read
references/tailwind-to-shadcn.md,examples/usage.mdfromstitch-shadcn-ui.
- Context: Read
-
Other Frameworks: Search for matching
stitch-*-componentsskills and load their respectiveapi,examples, andreferencesdirectories.
-
- Apply Constraints: Use the rules defined in that framework's skill (e.g., component mappings, slot usage, unit conversion) to transform the raw HTML from Stitch into the target framework code.
Example Flow:
- User: "Get screen X and convert to uViewPro code."
- Agent:
- Call
get_screento get HTML. - Detect intent: "uViewPro".
- Load Context: Read
contract.md,component-api.md,usage.md, andarchitecture-checklist.mdfromstitch-uviewpro-components. - Generate code by applying uViewPro rules to the Stitch HTML.
- Call
Usage Example
User Input: "Give me the code for the login screen we just made."
Agent Action:
- Identify target screen.
- Call
get_screentool with arguments{"projectId": "37803...", "screenId": "88805..."}.
References
Source
git clone https://github.com/partme-ai/stitch-skills/blob/main/skills/stitch-mcp-get-screen/SKILL.mdView on GitHub Overview
stitch-mcp-get-screen retrieves the full details of a specific screen, including HTML/CSS code and a high‑res screenshot. It’s essential for exporting code, inspecting the exact HTML structure, and understanding design details for implementation. Use when you explicitly mention Stitch and you have the projectId and screenId.
How This Skill Works
The skill accepts a resource path or explicit projectId and screenId. When both IDs are available, it calls stitch-mcp-get-screen and returns a Screen object containing htmlCode (the UI HTML/CSS), a screenshot URL, optional figmaExport, and metadata like width, height, and deviceType for accurate rendering.
When to Use It
- Export the screen's HTML/CSS code and assets for handoff or archival
- Inspect the full HTML structure to analyze DOM layout and styling
- Validate or compare generated HTML against design specs
- Retrieve a high‑resolution screenshot for QA or documentation
- Prepare data for design-to-code conversion or framework mapping
Quick Start
- Step 1: Provide a Stitch target with projectId and screenId (or a URL/path that encodes them)
- Step 2: Call stitch-mcp-get-screen with {"projectId": "<id>", "screenId": "<id>"}
- Step 3: Use htmlCode for export or analysis and review screenshot for verification
Best Practices
- Always provide both projectId and screenId, or a parsable resource path
- If using a URL/path, rely on the resource path parsing rules to extract IDs
- Verify the returned htmlCode is the exact HTML/CSS for the target screen
- Check the screenshot.downloadUrl for the high‑res image
- Capture and store width, height, and deviceType for accurate rendering across devices
Example Use Cases
- A designer exports a screen's HTML to hand off to developers along with a screenshot for reference
- A QA engineer analyzes the HTML structure to verify DOM alignment with the design
- A frontend engineer uses the htmlCode to seed a framework-specific implementation
- Documentation teams embed the screen's HTML and screenshot into design docs
- A migration tool uses the returned HTML to convert a design to code for a new project