Get the FREE Ultimate OpenClaw Setup Guide →

stitch-mcp-generate-variants

npx machina-cli add skill gabelul/stitch-kit/stitch-mcp-generate-variants --openclaw
Files (1)
SKILL.md
4.5 KB

Stitch MCP — Generate Variants

Generates alternative versions of existing screens using Stitch's native variant generation API. This is more efficient than the text-prompt approach (1 API call vs. 3) and offers fine-grained control over what aspects to vary.

Critical prerequisite

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

You must have both a projectId AND at least one screenId of an existing screen. Variants are always based on an existing design — you can't generate variants from scratch.

When to use

  • User wants to explore alternative versions of an existing screen
  • After generation, user says "show me some variations" or "try different styles"
  • The orchestrator's Step 5b offers "Generate variants"
  • A/B testing — creating multiple options for stakeholder review

Call the MCP tool

{
  "name": "generate_variants",
  "arguments": {
    "projectId": "3780309359108792857",
    "selectedScreenIds": ["88805abc123def456"],
    "prompt": "Explore different color schemes while keeping the layout structure",
    "variantOptions": {
      "variantCount": 3,
      "creativeRange": "EXPLORE",
      "aspects": ["COLOR_SCHEME", "IMAGES"]
    },
    "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"]

The source screen(s) to generate variants from.

prompt — optional guidance for variant direction

Provide context about what kind of variations the user wants. The variantOptions do the heavy lifting, but the prompt adds nuance.

variantOptions — controls what and how much to vary

FieldTypeValuesDescription
variantCountint1–5Number of variants to generate
creativeRangeenumREFINE, EXPLORE, REIMAGINEHow much to deviate from the original
aspectsarraySee belowWhich design aspects to vary

creativeRange mapping from user language

User says→ creativeRangeWhat it does
"subtle changes", "minor tweaks", "polish"REFINESmall refinements, stays close to original
"alternatives", "different options", "explore"EXPLOREMeaningful differences while keeping the concept
"radical", "completely different", "reimagine"REIMAGINEMajor departures from the original design

aspects — what to vary

ValueVariesKeeps stable
LAYOUTStructure, spacing, component arrangementColors, fonts, content
COLOR_SCHEMEColors, gradients, contrastLayout, fonts, content
IMAGESPhotography, illustrations, iconsLayout, colors, text
TEXT_FONTTypography, font choices, sizesLayout, colors, content
TEXT_CONTENTCopy, labels, placeholder textLayout, colors, fonts

You can combine aspects: ["LAYOUT", "COLOR_SCHEME"] varies both simultaneously.

deviceType — optional

Same enum: MOBILE, DESKTOP, TABLET, AGNOSTIC

modelId — optional

ValueUse when
GEMINI_3_PROHigher quality variants, complex designs
GEMINI_3_FLASHFaster iteration, simpler screens

Output

Returns new screens added to the project. Each variant appears as a separate screen in list_screens.

After generating variants

  1. Call stitch-mcp-list-screens to find all new variant screens
  2. Call stitch-mcp-get-screen for each to get screenshots
  3. Present side by side: "Here are your 3 variants: [screenshots]. Which one do you prefer?"
  4. Once the user picks a winner, offer:
    • "Edit the chosen variant further?" → stitch-mcp-edit-screens
    • "Convert to code?" → framework conversion workflow
    • "Generate more variants from the winner?" → another generate_variants call

Anti-patterns

  • Never generate variants without an existing screen — you need a source design
  • Never use projects/ID format for projectId or screenId — both must be numeric
  • Never set variantCount above 5 — the API caps at 5

Source

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

Overview

Generates alternative versions of existing Stitch screens using the native variant API. Variants are based on an existing design, enabling testing of different color schemes, layouts, fonts, or content while preserving core structure.

How This Skill Works

You must supply a Stitch projectId and at least one screenId. Optionally include a prompt for direction, then provide variantOptions to control how many variants to create, how far they deviate (REFINE/EXPLORE/REIMAGINE), and which aspects to vary (LAYOUT, COLOR_SCHEME, IMAGES, TEXT_FONT, TEXT_CONTENT). The MCP tool returns new variant screens added to the project; you can then list and fetch each variant for review.

When to Use It

  • When you want alternative versions of an existing screen.
  • After generation, when the user asks for variations or different styles.
  • For A/B testing, providing multiple options for stakeholder review.
  • When you need controlled deviations using variantOptions instead of text prompts.
  • When iterating on color schemes, imagery, or typography while preserving layout.

Quick Start

  1. Step 1: Gather projectId and the screenIds you want to variant; optionally add a guiding prompt.
  2. Step 2: Call stitch-mcp-generate-variants with variantCount, creativeRange, aspects, deviceType, and (optionally) modelId.
  3. Step 3: Run stitch-mcp-list-screens to see new variant IDs, then stitch-mcp-get-screen for screenshots.

Best Practices

  • Ensure you have a valid projectId and at least one screenId before generating variants.
  • Choose variantCount between 1 and 5 and select an appropriate creativeRange (REFINE, EXPLORE, REIMAGINE).
  • Target specific changes by listing relevant aspects (e.g., COLOR_SCHEME, LAYOUT, IMAGES).
  • Match deviceType to your target platform (e.g., DESKTOP) and use modelId for quality needs.
  • After generation, use stitch-mcp-list-screens and stitch-mcp-get-screen to review and compare variants.

Example Use Cases

  • Generate three COLOR_SCHEME and IMAGES variants of a checkout screen for desktop users.
  • Create EXPLORE-range layout variants of a dashboard, testing different component arrangements.
  • Reimagine typography on a profile screen by varying TEXT_FONT and COLOR_SCHEME.
  • Apply subtle TEXT_CONTENT tweaks to an onboarding screen while preserving layout.
  • Radically reimagine a landing page (REIMAGINE) to test new messaging and visuals.

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers