Cookbook

Stitch → Registry Pipeline

Generate UI screens in Gemini Stitch, export HTML, and publish to the @vandoko component registry

Generate a complete UI mockup in Gemini Stitch, export the HTML, feed it through HTML → Registry Ingestion, and publish the result to the @vandoko component registry — all in one pipeline.

Prerequisites

Gemini CLI

Verify with: gemini --version

Stitch extension

~/.gemini/extensions/Stitch/gemini-extension.json configured

Stitch API key

API key set in the Stitch extension config

html-to-registry skill

Skill loaded for the 5-phase conversion pipeline

vandoko-registry repo

Checked out locally with pnpm dependencies installed

Command Sequence

Step 1: Generate a screen in Stitch

Run the Stitch generate command with a detailed prompt describing the UI:

Capture the project_id and screen_id from the output:

Terminal
PROJECT_ID=$(echo "$SCREEN_OUTPUT" | grep -oP '(?<=project_id: )\S+')
SCREEN_ID=$(echo "$SCREEN_OUTPUT" | grep -oP '(?<=screen_id: )\S+')

Step 2: Review the generated screen

Inspect the screen before downloading to confirm it matches the prompt intent:

Terminal
gemini -p "/stitch get screens $PROJECT_ID" --output-format text -y

Verify the layout looks correct. If not, regenerate with a refined prompt before proceeding.

Step 3: Download HTML export

Create the output directory and download the HTML:

Terminal
mkdir -p ./stitch-exports
gemini -p "/stitch download html $PROJECT_ID $SCREEN_ID --output ./stitch-exports/pricing-saas.html" --output-format text -y

Step 4: Feed through html-to-registry

Load the html-to-registry skill and provide the exported file path:

Prompt
Convert ./stitch-exports/pricing-saas.html to a registry component

The 5-phase pipeline runs automatically:

  1. Extract — parse HTML, identify sections (pricing cards, toggle, trust badges)
  2. Analyze — map inline styles to Tailwind classes, colors to oklch tokens
  3. Convert — generate TSX with Props interface, cn() utility, shadcn primitives
  4. Validate — run 10-check validation
  5. Registry output — generate all 7 artifacts

Step 5: Publish to registry

From the vandoko-registry repo root:

Terminal
pnpm registry:build
pnpm build
git add -A && git commit -m "feat: add pricing-saas component from Stitch"
git push vandoko main

Step 6: Verify publication

Confirm the component is live and installable:

Terminal
# Registry JSON
curl https://registry.vandoko.com/r/pricing-saas.json

# Install test
npx shadcn@latest add @vandoko/pricing-saas --dry-run

Full Pipeline Diagram

End-to-end flow
Stitch generate screen (text prompt)
  → /stitch download html → ./stitch-exports/pricing-saas.html
  → html-to-registry Phase 1-5
  → registry/new-york/blocks/pricing-saas/pricing-saas.tsx
  → registry.json manifest entry
  → preview wrapper + component registry + MDX docs + sidebar
  → pnpm registry:build + pnpm build
  → git push vandoko main → Vercel deploy
  → Live at registry.vandoko.com/r/pricing-saas.json
  → Installable: npx shadcn@latest add @vandoko/pricing-saas

Verification Checklist

  • Stitch screen generated successfully (project_id + screen_id captured)
  • HTML file exists at ./stitch-exports/pricing-saas.html
  • Converted TSX passes all 10 validation checks
  • All 7 registry artifacts generated
  • Component live at registry.vandoko.com
  • npx shadcn@latest add @vandoko/pricing-saas --dry-run resolves

Troubleshooting

SymptomLikely CauseFix
"Extension not found"Stitch not installedConfirm ~/.gemini/extensions/Stitch/ exists and gemini CLI >= 1.0
Generation takes >30 secondsFull-page screens are slowNormal; -y flag skips confirmation; wait for completion
HTML export has inline styles onlyExpected behaviorhtml-to-registry handles normalization; inline styles are the input format
screen_id parsing failsOutput format variesInspect raw output before scripting; adjust grep pattern
oklch conversion inaccurateInline hex values ambiguousManual review of token mapping; use the oklch Token Map table as reference

On this page