Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
acedergren avatar

Stitch To React

  • 10 installs
  • 22 repo stars
  • Updated May 28, 2026
  • acedergren/agentic-tools

stitch-to-react is a Claude Code skill that converts Google Stitch designs into modular, typed production React components with theme-mapped Tailwind styling.

About

This skill converts Google Stitch designs into production React components. It enforces a modular architecture: event logic in hooks, static data in mockData.ts, Readonly TypeScript interfaces, and theme-mapped Tailwind classes instead of hardcoded hex values. A developer uses it after exporting a Stitch screen to generate clean React code. It caches downloaded designs and validates architecture before marking work done.

  • Converts Google Stitch designs into modular production React components
  • Enforces logic-in-hooks, data-in-mockData.ts, Readonly TypeScript props
  • Maps hex codes to a Tailwind theme with semantic classes, no arbitrary values

Stitch To React by the numbers

  • 10 all-time installs (skills.sh)
  • Ranked #1,689 of 2,245 Frontend Development skills by installs in the Skillselion catalog
  • Data as of Jul 28, 2026 (Skillselion catalog sync)
At a glance

stitch-to-react capabilities & compatibility

Requires access to a Google Stitch project and the Stitch tools to fetch screen HTML and screenshots.

Capabilities
design to code · react components · tailwind theming
Use cases
frontend · ui design · web design
IDEs
vscode · cursor ide
Pricing
Free
From the docs

What stitch-to-react says it does

**NEVER hardcode hex codes as Tailwind arbitrary values** (`bg-[#2563eb]`) — extract to theme, use semantic classes
SKILL.md
**NEVER put logic in component bodies** — event handlers and state logic go in `src/hooks/`
SKILL.md
npx skills add https://github.com/acedergren/agentic-tools --skill stitch-to-react

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs10
repo stars22
Last updatedMay 28, 2026
Repositoryacedergren/agentic-tools

What it does

Convert exported Stitch designs into modular, typed production React components.

Who is it for?

Generating modular React components from Stitch screens with hooks, mockData, and semantic Tailwind classes.

Skip if: Non-React targets or design-system extraction, which stitch-design-system covers.

When should I use this skill?

When converting Stitch designs into production React components.

What you get

Stitch screens become modular React components with logic in hooks, data in mockData.ts, and themed Tailwind classes.

  • Modular React components
  • src/hooks logic
  • src/data/mockData.ts

By the numbers

  • 8 NEVER rules
  • 5-rule architecture table

Files

SKILL.mdMarkdownGitHub ↗

Stitch to React Components

NEVER

  • NEVER fetch without checking `.stitch/designs/` first — always ask user about refresh intent before re-downloading
  • NEVER hardcode hex codes as Tailwind arbitrary values (bg-[#2563eb]) — extract to theme, use semantic classes
  • NEVER skip AST validation — architecture checklist is non-optional before marking done
  • NEVER put logic in component bodies — event handlers and state logic go in src/hooks/
  • NEVER omit TypeScript interfaces — every component needs a Readonly Props type
  • NEVER bundle data in component files — all static text, images, lists go in src/data/mockData.ts
  • NEVER include Google license headers in generated React components
  • NEVER use internal AI fetch tools for Google Cloud Storage URLs — they fail on GCS domains; use the bash script

Namespace Discovery

Run list_tools to find the Stitch MCP prefix (usually stitch: or mcp_stitch:). Use that prefix for all calls.

Call [prefix]:get_screen — captures:

  • screenshot.downloadUrl + htmlCode.downloadUrl
  • width, height, deviceType
  • designTheme (colors, fonts, roundness)

Design Caching Decision

.stitch/designs/{page}.html + .stitch/designs/{page}.png exist?
│
├─ YES → Ask user: "Use cached designs or refresh from Stitch?"
│         Re-download ONLY if user confirms
│
└─ NO → Proceed to download

High-Reliability Download

Internal AI fetch fails on GCS. Use the bash script:

# HTML
bash scripts/fetch-stitch.sh "[htmlCode.downloadUrl]" ".stitch/designs/{page}.html"

# Screenshot — append =w{width} to URL
bash scripts/fetch-stitch.sh "[screenshot.downloadUrl]=w{width}" ".stitch/designs/{page}.png"

Architecture Rules (Non-Negotiable)

RuleEnforcement
Modular filesNever output single-file component dumps
Logic isolationEvent handlers → src/hooks/
Data decouplingStatic content → src/data/mockData.ts
Type safetyReadonly interface named [Component]Props on every component
Style mappingExtract tailwind.config from HTML <head>, sync to resources/style-guide.json

File Structure

src/
├── components/     # One file per component + index.ts barrel
├── hooks/          # useNavigation.ts, useFormState.ts, etc.
├── data/
│   └── mockData.ts # All static text, images, config
├── styles/
│   └── theme.ts    # Extracted Tailwind tokens
└── App.tsx

Validation Sequence

After generating each component: 1. npm run validate <file_path> — AST compliance 2. Check against resources/architecture-checklist.md 3. npm run dev — zero console errors required

A component is not done until it passes the checklist AND the dev server shows no errors.

Troubleshooting

IssueFix
Fetch fails (403)Check script quotes; verify =w{width} appended to screenshot URL
AST shows hardcoded stylesExtract hex → style-guide.json → replace with Tailwind class
TypeScript prop errorsAdd Readonly interface following template in resources/component-template.tsx
Theme class not recognizedVerify tailwind.config extracted and synced to style-guide.json
Cached screenshot staleCheck file timestamps; ask user to confirm refresh

Related skills

FAQ

Where does component logic go?

Event handlers and state logic go in src/hooks/, never in component bodies.

How are colors handled?

Hex codes are extracted to the Tailwind theme and used via semantic classes, never as arbitrary values like bg-[#2563eb].

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.