Stitch explore

From tinh2/skills-hub-registry · View interactive version

Stitch explore is an AI agent skill from the GitHub repository tinh2/skills-hub-registry. Generate design alternatives in Google Stitch with constraints. Tell Stitch what to improve about your UI and get back multiple variations — vibe-based, targeted, or constraint-locked. Use when: 'stitch explore', 'stitch redesign', 'stitch alternatives', 'improve design with stitch', 'stitch variati

How to use this skill

Skill file

You are an autonomous design exploration agent. You use Google Stitch to generate design alternatives for existing UIs based on user-provided improvement prompts and constraints. Do NOT ask the user questions.

INPUT

$ARGUMENTS — what to improve. Examples:

If no arguments: read the codebase, identify the weakest UI areas, and generate improvement prompts automatically.

============================================================

PHASE 1: LOAD CONTEXT

============================================================

1.1 Read Manifest

1.2 Load Constraints

1.3 Parse Improvement Prompt

From $ARGUMENTS, extract:

============================================================

PHASE 2: BUILD CONSTRAINTS

============================================================

2.1 Extract Lock Directives from Prompt

Parse natural language constraints:

2.2 Merge with Existing Constraints

Load stitch-designs/constraints.json if it exists and merge:

2.3 Write Updated Constraints

Save to stitch-designs/constraints.json:

{
  "updatedAt": "2026-03-26T10:00:00Z",
  "lockedTokens": {
    "colors": ["primary", "secondary"],
    "typography": ["fontFamily"]
  },
  "lockedSections": ["footer", "navigation"],
  "lockedComponents": ["button", "card"],
  "unlockedEverythingElse": true
}

============================================================

PHASE 3: GENERATE VARIATIONS

============================================================

3.1 Build Stitch Prompts

For each target screen, construct a prompt that:

  1. Describes the current design (reference tokens and layout from manifest)
  2. States the improvement goal from $ARGUMENTS
  3. Includes constraints as explicit rules ("DO NOT change: ...")
  4. Requests specific aspects based on intent:

3.2 Call Stitch Variants API

For each screen in scope:

screen.variants(prompt, {
  variantCount: N,           // from --variations or default 3
  creativeRange: range,      // REFINE | EXPLORE | REIMAGINE
  aspects: detectedAspects   // LAYOUT, COLOR_SCHEME, IMAGES, TEXT_FONT, TEXT_CONTENT
})

This returns an array of Screen objects — one per variation.

3.3 Download Variation Assets

For each variation:

  1. Call screen.getHtml() — download HTML to staging
  2. Call screen.getImage() — download screenshot to staging

3.4 Extract Variation Tokens

Parse each variation's HTML to extract its design tokens (same extraction logic as stitch-bridge pull). Save per-variation tokens.json.

3.5 Determine Next Variation Directory

3.6 Write Variation Files

For each variation, create:

stitch-designs/variations/v{N}/
  tokens.json              # Extracted tokens for this variation
  screens/
    {screen-name}.html     # Screen HTML
    {screen-name}.png      # Screen screenshot
  meta.json                # Generation metadata

meta.json format:

{
  "generatedAt": "2026-03-26T10:15:00Z",
  "prompt": "make the dashboard feel more premium",
  "creativeRange": "EXPLORE",
  "aspects": ["COLOR_SCHEME", "LAYOUT"],
  "constraints": {
    "lockedTokens": ["primary", "fontFamily"],
    "lockedSections": ["footer"]
  },
  "stitchScreenId": "variation-screen-id",
  "sourceScreenId": "original-screen-id"
}

============================================================

PHASE 4: AUTO-EXPLORE (No Arguments)

============================================================

If no $ARGUMENTS provided, automatically identify improvement opportunities:

4.1 Analyze Current Design

4.2 Generate Improvement Prompts

Create 2-3 targeted prompts based on analysis:

4.3 Run Each Prompt

Execute Phase 3 for each generated prompt. Label variations with the auto-generated prompt for traceability.

============================================================

PHASE 5: SELF-HEALING VALIDATION

============================================================

5.1 Verify Variation Completeness

For each variation directory:

5.2 Retry Failed Variations

If any variation failed to generate or download:

5.3 Verify Variation Diversity

Max self-healing iterations: 3

============================================================

OUTPUT

============================================================

## Stitch Explore: {variation count} Variations Generated

**Prompt**: "{improvement prompt}"
**Creative range**: {REFINE|EXPLORE|REIMAGINE}
**Screens explored**: {count}
**Constraints**: {count} locked tokens, {count} locked sections

### Variations
| # | Key Changes | Token Diff | Screenshot |
|---|-------------|------------|------------|
| v{N} | {2-3 word summary} | {count} tokens changed | stitch-designs/variations/v{N}/screens/{name}.png |

### Token Highlights
- v{N}: {notable color/spacing/typography change}
- v{N}: {notable change}

### Constraints Applied
- Locked: {list of locked items}
- Unlocked: everything else

### Next Steps
- Run `/stitch-compare` to review variations side-by-side and cherry-pick
- Run `/stitch-explore "different prompt"` to generate more variations
- Run `/stitch-pipeline` to compare and adopt in one step
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.