/storybook-assistant:design-to-code runs instead · from storybook-assistant
Transforms design screenshots, Figma exports, and mockups into pixel-perfect React components using Claude's vision capabilities. Extracts spacing, colors, typography, and states.
This skill never runs in Claude Code
It ships in storybook-assistant at skills/, but /storybook-assistant:design-to-code (a command, or a skill Claude Code finds first) has the same name: typing it, or Claude choosing it, runs that one instead.
Transform design screenshots, Figma exports, and mockups into pixel-perfect React components using Claude's multimodal vision capabilities. Upload an image, get production code with exact spacing, colors, typography, and all visual states.
This is the flagship SOTA feature - leverages Claude's vision models for design analysis.
Supported formats:
Claude's vision model extracts:
{
"component_type": "card",
"layout": {
"type": "flex",
"direction": "column",
"align": "stretch",
"gap": "16px",
"padding": "24px"
},
"spacing": {
"padding": "24px",
"gap_vertical": "16px",
"gap_horizontal": "12px",
"border_radius": "8px"
},
"colors": {
"background": "#FFFFFF",
"text_primary": "#1F2937",
"text_secondary": "#6B7280",
"border": "#E5E7EB",
"accent": "#2196F3"
},
"typography": [
{ "element": "heading", "size": "24px", "weight": "700", "line_height": "1.2" },
{ "element": "body", "size": "16px", "weight": "400", "line_height": "1.5" },
{ "element": "caption", "size": "14px", "weight": "500", "line_height": "1.4" }
],
"elements": [
{ "type": "image", "width": "100%", "height": "200px", "object_fit": "cover" },
{ "type": "heading", "text": "Product Title" },
{ "type": "paragraph", "text": "Description text..." },
{ "type": "button", "variant": "primary", "text": "Add to Cart" }
],
"states": ["default", "hover", "focused"],
"responsive": {
"mobile": { "padding": "16px", "font_size_heading": "20px" },
"desktop": { "padding": "24px", "font_size_heading": "24px" }
}
}
Example: Product Card from Screenshot
// Generated from design screenshot
import { ShoppingCart } from 'lucide-react';
interface ProductCardProps {
product: {
image: string;
title: string;
description: string;
price: number;
rating: number;
};
onAddToCart: () => void;
}
export function ProductCard({ product, onAddToCart }: ProductCardProps) {
return (
<article className="flex flex-col rounded-lg border border-gray-200 overflow-hidden hover:shadow-lg transition-shadow">
{/* ✨ Extracted: 200px height, cover fit */}
<img
src={product.image}
alt={product.title}
className="w-full h-[200px] object-cover"
/>
{/* ✨ Extracted: 24px padding, 16px gap */}
<div className="flex flex-col gap-4 p-6">
{/* ✨ Extracted: 24px size, 700 weight */}
<h3 className="text-2xl font-bold text-gray-900">
{product.title}
</h3>
{/* ✨ Extracted: 16px size, gray-600 color */}
<p className="text-base text-gray-600 line-clamp-2">
{product.description}
</p>
{/* ✨ Extracted: flex layout, space-between */}
<div className="flex items-center justify-between">
<span className="text-xl font-semibold text-gray-900">
${product.price.toFixed(2)}
</span>
{/* ✨ Extracted: blue button with icon */}
<button
onClick={onAddToCart}
className="flex items-center gap-2 px-4 py-2 bg-blue-500 text-white rounded-md hover:bg-blue-600 transition-colors"
>
<ShoppingCart size={18} />
Add to Cart
</button>
</div>
</div>
</article>
);
}
Create reusable design system:
/* Generated design tokens from screenshot */
/* Colors */
--color-primary: #2196F3;
--color-bg: #FFFFFF;
--color-text-primary: #1F2937;
--color-text-secondary: #6B7280;
--color-border: #E5E7EB;
/* Typography */
--font-size-h1: 24px;
--font-size-body: 16px;
--font-size-caption: 14px;
--font-weight-bold: 700;
--font-weight-medium: 500;
--font-weight-normal: 400;
--line-height-tight: 1.2;
--line-height-normal: 1.5;
/* Spacing */
--space-2: 8px;
--space-3: 12px;
--space-4: 16px;
--space-6: 24px;
/* Borders */
--radius-md: 8px;
--border-width: 1px;
Vision AI detects states from visual cues:
// Detected hover state (darker shadow, lifted appearance)
export const Hover: Story = {
parameters: {
pseudo: { hover: true },
},
};
// Detected focused state (blue outline ring)
export const Focused: Story = {
parameters: {
pseudo: { focus: true },
},
};
// Detected disabled state (grayed out, reduced opacity)
export const Disabled: Story = {
args: {
disabled: true,
},
};
Upload multiple screenshots to extract design system:
User uploads:
- button-primary.png
- button-secondary.png
- card-default.png
- card-featured.png
AI extracts:
- Color palette (all unique colors across designs)
- Typography scale (all font sizes used)
- Spacing system (common spacing values)
- Component variants (primary vs secondary button)
If multiple screenshots provided (mobile + desktop):
// Desktop
<div className="hidden md:flex md:p-6">
// Mobile
<div className="flex p-4 md:hidden">
// Responsive
<h1 className="text-xl md:text-2xl">
Vision AI infers states from design:
Detected patterns:
AI identifies component types:
AI Analysis:
Detected:
- Component: Pricing Card
- Layout: Vertical stack, centered content
- Sections: Header (icon + title), Price (large number), Features (list), CTA (button)
- Colors: Purple primary (#8B5CF6), White BG, Gray text
- Spacing: 32px padding, 16px gap between sections
- Typography: 48px price, 24px title, 16px features
- Border: 1px solid, 12px radius
- States: Default + Featured (purple border, purple BG for header)
Generated Code:
interface PricingCardProps {
plan: {
name: string;
price: number;
features: string[];
icon: React.ReactNode;
};
featured?: boolean;
onSelect: () => void;
}
export function PricingCard({ plan, featured = false, onSelect }: PricingCardProps) {
return (
<div
className={`
flex flex-col gap-4 p-8 rounded-xl border
${featured ? 'border-purple-500 bg-purple-50' : 'border-gray-200 bg-white'}
`}
>
{/* Header */}
<div className="flex items-center gap-3">
<div className="text-purple-500">{plan.icon}</div>
<h3 className="text-2xl font-bold">{plan.name}</h3>
</div>
{/* Price */}
<div className="flex items-baseline gap-1">
<span className="text-5xl font-bold">${plan.price}</span>
<span className="text-gray-600">/month</span>
</div>
{/* Features */}
<ul className="flex flex-col gap-2">
{plan.features.map(feature => (
<li key={feature} className="flex items-center gap-2">
<Check className="text-purple-500" size={16} />
<span>{feature}</span>
</li>
))}
</ul>
{/* CTA */}
<button
onClick={onSelect}
className={`
mt-4 px-6 py-3 rounded-lg font-semibold transition-colors
${featured
? 'bg-purple-500 text-white hover:bg-purple-600'
: 'bg-gray-100 text-gray-900 hover:bg-gray-200'
}
`}
>
{featured ? 'Get Started' : 'Select Plan'}
</button>
</div>
);
}
Generated Stories:
export const Basic: Story = {
args: {
plan: {
name: 'Starter',
price: 9,
features: ['Feature 1', 'Feature 2', 'Feature 3'],
icon: <Star />,
},
},
};
export const Featured: Story = {
args: {
...Basic.args,
featured: true,
},
};
Direct integration with Figma API:
Export artboards → Upload to Claude → Generate code
/design-to-codeInteractive workflow:
/extract-design-tokensExtract only design tokens from multiple screenshots:
Vision AI design-to-code pipeline:
Result: 80% faster design-to-code workflow, pixel-perfect accuracy, production-ready components.
What SKILL.md sets; muted values are Claude Code's defaults
Generated from the plugin's indexed repository (flight505/storybook-assistant) — no native marketplace selected
npx claudepluginhub p/flight505-storybook-assistant18 skills in this plugin
/accessibility-remediationUse this skill when the user writes/edits components, asks to "fix accessibility issues", "add ARIA labels", "improve accessibility", "check WCAG compliance", "remediate a11y violations", mentions "screen reader support", "keyboard navigation", or wants AI-powered accessibility fixes with one-click application. Automatically analyzes components for a11y issues and suggests context-aware fixes. Trigger on PostToolUse hook or explicit request./ci-cd-generatorUse this skill when the user asks to "setup CI/CD", "configure GitHub Actions", "deploy Storybook", "setup Chromatic", "add visual regression to CI", "create deployment pipeline", or wants to generate complete CI/CD workflows for Storybook deployment and testing./component-scaffoldScaffold new components with stories, tests, and documentation following SOTA patterns and best practices/Component-Usage-AnalyticsComponent Usage AnalyticsUse this skill when users mention "component usage", "where is this component used", "deprecate component", "migration impact", "component analytics", or want to track and analyze component usage across the codebase with deprecation planning and migration impact analysis./dark-mode-generationUse this skill when the user asks to "generate dark mode", "create dark theme", "add dark mode support", "convert to dark mode colors", "generate dark color palette", or wants to automatically generate dark mode variants for their components with intelligent color inversion and accessibility preservation./Bidirectional-Design-Token-SyncBidirectional Design Token SyncUse this skill when users mention "sync design tokens", "Figma to code", "design system sync", "token drift", "keep tokens in sync", or want to synchronize design tokens between Figma and codebase bidirectionally with automatic drift detection and conflict resolution.Other plugins' skills for the same job