Get the FREE Ultimate OpenClaw Setup Guide →

stitch-mcp-edit-screens

npx machina-cli add skill gabelul/stitch-kit/stitch-mcp-edit-screens --openclaw
Files (1)
SKILL.md
4.0 KB

Stitch MCP — Edit Screens

Edits one or more existing screens using a text prompt. This is the primary iteration tool — instead of regenerating a screen from scratch (60–180s), you can refine what you already have with targeted changes.

Critical prerequisite

Only use this skill when the user explicitly mentions "Stitch".

You must have both a projectId AND at least one screenId before calling this. If you don't:

  • List screens via stitch-mcp-list-screens to find screen IDs
  • Parse from context: projects/123/screens/456 → projectId: 123, screenId: 456

When to use

  • User wants to modify an existing Stitch screen (change colors, layout, content, style)
  • After generation, user says "make it darker", "change the font", "move the nav to the side"
  • The orchestrator's Step 5b offers "Edit this screen"
  • Any iterative refinement on a Stitch design

Call the MCP tool

{
  "name": "edit_screens",
  "arguments": {
    "projectId": "3780309359108792857",
    "selectedScreenIds": ["88805abc123def456"],
    "prompt": "Change the background to dark mode (#09090B). Make the primary color indigo (#818CF8). Increase the font size of the header to 32px bold.",
    "deviceType": "DESKTOP",
    "modelId": "GEMINI_3_PRO"
  }
}

Parameter reference

projectId — numeric ID only, no prefix

✅ "3780309359108792857"
❌ "projects/3780309359108792857"

selectedScreenIds — array of numeric screen IDs

✅ ["88805abc123def456"]
❌ ["projects/123/screens/88805abc123def456"]
❌ ["screens/88805abc123def456"]

Select one or more screens to edit. All selected screens receive the same edit instruction.

prompt — the edit instruction

Apply the same quality bar as generation prompts:

  • Be specific: "Change background to #09090B" not "make it darker"
  • Name exact components: "the header navigation" not "the top part"
  • Include values: hex colors, px sizes, specific content text
  • One focused change per call produces better results than many changes at once

deviceType — optional

Same enum as generate_screen_from_text: MOBILE, DESKTOP, TABLET, AGNOSTIC

modelId — optional

ValueUse when
GEMINI_3_PROComplex edits — layout changes, multi-component updates
GEMINI_3_FLASHSimple edits — color swaps, text changes, quick iterations

Handling output_components

The response may contain output_components with suggestions:

{
  "outputComponents": [
    { "text": "I've updated the background color and adjusted contrast ratios." },
    { "suggestion": "Would you also like me to update the sidebar to match the dark theme?" }
  ]
}

When you see suggestions:

  1. Present them to the user
  2. If the user accepts: call edit_screens again with the suggestion as the new prompt
  3. This creates a natural refinement loop — keep going until the user is satisfied

Timing

Same as generation: 60–180 seconds is normal.

  • Do NOT retry during this window
  • Do NOT assume failure if it takes > 60 seconds
  • Each call creates a new edit — retries mean duplicate edits

After editing

  1. Re-fetch the screen: stitch-mcp-get-screen with the same projectId and screenId
  2. Show the updated screenshot to the user
  3. Offer:
    • "Continue editing?" → another edit_screens call
    • "Generate variants of this version?" → stitch-mcp-generate-variants
    • "Convert to code?" → framework conversion workflow

Anti-patterns

  • Never send vague edit prompts — "make it better" will produce unpredictable results
  • Never use projects/ID format for projectId or screenId — both must be numeric
  • Never batch unrelated edits — "change the color AND completely redo the layout" works poorly

Source

git clone https://github.com/gabelul/stitch-kit/blob/main/skills/stitch-mcp-edit-screens/SKILL.mdView on GitHub

Overview

Stitch MCP Edit Screens lets you refine existing Stitch screens via text prompts instead of regenerating from scratch. It’s the primary iteration tool for tweaking colors, layout, content, or style, and supports refinement loops through output_components suggestions to reach the desired result.

How This Skill Works

Select one or more screens you want to modify, provide a specific prompt with exact values (colors, font sizes, text), and the MCP tool applies the edits. If output_components suggestions are returned, you can review and accept them to continue refining in a natural loop, repeating edits until satisfaction.

When to Use It

  • To modify an existing Stitch screen's colors, layout, content, or style without regenerating from scratch.
  • After an initial pass, when the user asks for precise changes like a darker background, a different font, or a relocated navigation.
  • When the orchestrator offers the 'Edit this screen' option (Step 5b) during review.
  • For iterative refinement on a Stitch design using targeted prompts and refinement loops.
  • When you want to apply the same edit across multiple screens in a project.

Quick Start

  1. Step 1: Ensure you have a numeric projectId and at least one numeric screenId.
  2. Step 2: Write a precise prompt with exact component names and values (colors, sizes, text).
  3. Step 3: Call stitch-mcp-edit-screens with projectId, selectedScreenIds, and your prompt; review output_components and repeat if needed.

Best Practices

  • Be explicit in your prompt: name exact components and include values (colors, sizes, text).
  • Always reference numeric IDs: ensure projectId and screenId are numeric and correct.
  • Edit one focused change per call for better results.
  • Use output_components feedback to refine instead of starting over.
  • Re-fetch the screen after editing to verify the changes.

Example Use Cases

  • Change the background to dark mode (#09090B) and set the primary color to indigo (#818CF8).
  • Increase the header font size to 32px and make it bold.
  • Move the navigation to the left and adjust spacing for a desktop layout.
  • Improve contrast by tweaking text color and background for accessibility.
  • Refine an existing screen's layout after generation using iterative prompts.

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers