High-fidelity UI restoration from Figma designs to production-ready React + TypeScript components.
This SKILL uses a robust helper script to minimize manual errors and ensure pixel-perfect results.
scripts/ folder (handled by Setup phase)Phase 0: SETUP → Create helper script and script environment
Phase 1: PROTOCOL → Generate design protocol (Structure & Props)
Phase 2: CODE → Generate components and assets
User Action: Run these commands to create the execution helper and isolate its dependencies.
mkdir -p scripts
# 1. Copy script files
# Note: Ensure you have the 'skills/design-to-code/scripts' directory available
cp skills/design-to-code/scripts/package.json scripts/package.json
cp skills/design-to-code/scripts/coderio-skill.mjs scripts/coderio-skill.mjs
# 2. Install coderio in scripts directory (adjust version if needed)
cd scripts && pnpm install && cd ..
If starting a new project:
node scripts/coderio-skill.mjs scaffold-prompt "MyApp"# Replace with your URL and Token
node scripts/coderio-skill.mjs fetch-figma "https://figma.com/file/..." "figd_..."
Verify: process/thumbnail.png should exist.
```bash
node scripts/coderio-skill.mjs structure-prompt > scripts/structure-prompt.md
```
process/thumbnail.png (MANDATORY)scripts/structure-prompt.mdscripts/structure-output.json.```bash
node scripts/coderio-skill.mjs save-structure
```
```bash
node scripts/coderio-skill.mjs list-components
```
a. Generate Prompt:
```bash
node scripts/coderio-skill.mjs props-prompt "ComponentName" > scripts/current-props-prompt.md
```
b. AI Task (Props):
process/thumbnail.png (MANDATORY)scripts/current-props-prompt.mdscripts/ComponentName-props.json.c. Save & Validate:
```bash
node scripts/coderio-skill.mjs save-props "ComponentName"
```
node scripts/coderio-skill.mjs list-gen-tasks
This outputs a list of tasks with indices (0, 1, 2...).
For EACH task index (starting from 0):
```bash
node scripts/coderio-skill.mjs code-prompt 0 > scripts/code-prompt.md
```
process/thumbnail.png (MANDATORY)scripts/code-prompt.mdscripts/code-output.txt.```bash
node scripts/coderio-skill.mjs save-code 0
```
Inject the root component into App.tsx. Use the path found in the last task of Phase 2.1.
process/thumbnail.png was attached and visible to the AI. Retry the props generation step.node scripts/coderio-skill.mjs save-code was run for the child component before the parent component. Phase 2 must be done in order (0, 1, 2...).