react:components

Converts Stitch design screens into modular React and TypeScript components with AST-based validation.

Updated Jul 9, 2025
One-click install
npx skills add https://github.com/renpereiradx/erp-webapp --skill react-components-renpereiradx
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: react:components
Source: https://github.com/renpereiradx/erp-webapp/tree/main/.opencode/skills/reactcomponents
Command: npx skills add https://github.com/renpereiradx/erp-webapp --skill react-components-renpereiradx

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @swc/core, and includes scripts (resource) and references (resource) components.

What problem does it solve? Turning visual designs from Stitch into production React code is slow and error-prone: fetching design assets from signed URLs fails, styles get hardcoded, and components end up as monolithic files without type safety. This Skill automates the full design-to-code pipeline with enforced architectural rules. ## Core Features & Use Cases - Stitch MCP integration: Discovers the Stitch tool namespace, fetches screen metadata via get_screen, and downloads HTML through a resilient curl-based script that handles redirects and security handshakes. - Enforced architecture: Generates modular components with logic extracted to custom hooks, static data moved to src/data/mockData.ts, and Readonly TypeScript props interfaces. - AST-based validation: Runs an SWC-powered validator that parses each component to confirm Props interfaces exist and no hardcoded hex colors remain in className attributes. - Use Case: A developer receives a Stitch design link for a dashboard card. The Skill fetches the HTML and screenshot, extracts the Tailwind config, generates typed components from the provided template, and validates them against the architecture checklist before wiring them into App.tsx. ## Quick Start Convert this Stitch screen into React components and validate the output with the included scripts.

Frequently Asked Questions about react:components

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I convert a Stitch design into React components?▼

Fetch the design metadata with the Stitch MCP get_screen tool, download the HTML using the fetch-stitch.sh script, then generate components from the provided template. Run npm run validate on each file to confirm type safety and styling rules.

How to fetch Stitch HTML when internal fetch tools fail?▼

Use the included fetch-stitch.sh bash script with the downloadUrl and an output path as arguments. It uses curl with redirect following and compressed transfer to handle Google Cloud Storage signed URLs and security handshakes.

Does the component validation check TypeScript interfaces?▼

Yes, the validate.js script parses each component with SWC and walks the AST to confirm a Props interface exists. It also scans className attributes for hardcoded hex color values and fails validation if either check fails.

Can I use hardcoded hex colors in generated Tailwind components?▼

No, the architecture rules require theme-mapped Tailwind classes instead of arbitrary hex codes. The Tailwind config extracted from the Stitch HTML head is synced with resources/style-guide.json so colors like primary render correctly.

Why does component validation fail with a parse error?▼

A parse error means the file is not syntactically valid TSX, often due to unreplaced template placeholders like StitchComponent or missing imports. Fix the syntax issues reported by SWC and rerun npm run validate on the file.