From design-extractor
Convert an already-extracted design system into a faithful shadcn/Tailwind HTML replica — map tokens to tailwind.config, wire CSS custom properties, rebuild nav/hero/buttons/cards/footer from components. Trigger on 'build a replica with shadcn'; 'convert these tokens to Tailwind config'; 'rebuild this site in shadcn'; 'map extracted tokens to tailwind'; 'replicate the hero in shadcn'; 'generate a shadcn replica of the extracted brand'; 'port these design tokens into tailwind config'; 'scaffold components from the extracted tokens'; 'produce an HTML replica using shadcn primitives'. Do NOT trigger for: 'build me a shadcn app', 'bootstrap a new Next.js shadcn project', greenfield app scaffolding, 'install shadcn', or generic shadcn component questions unrelated to a prior extraction.
How this skill is triggered — by the user, by Claude, or both
Slash command
/design-extractor:shadcn-replicationThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
- An extraction run has produced tokens + patterns and a visual replica is now required
tailwind.config.ts and CSS variablesThe replication process maps extracted DOM data to shadcn/Tailwind components. The output lives in ui/components/brands/<slug>/ as TSX files that import from @/components/ui/ (shadcn primitives).
| Site element | shadcn component | Key props overridden |
|---|---|---|
| Header / navigation bar | Custom TSX using Button, Separator | Brand colours, logo, nav links, sticky behaviour |
| Hero section | Card with CardContent + background image | Bg colour, heading font, CTA button |
| Footer | Custom TSX using Separator, Link | Multi-column layout, social icons, legal text |
| Cards / product tiles | Card, CardHeader, CardContent | Border radius, shadow, padding |
| Buttons / CTAs | Button variant overrides | bg-[brand-colour], rounded-[brand-radius], font-weight |
| Category grids | Grid layout + Link + Lucide icons | Icon background colour, text colours |
| Banners / promo sections | Full-width div with brand bg | Gradient or solid background |
CSS values from extraction become Tailwind classes:
| CSS property | Tailwind mapping | Example |
|---|---|---|
| font-size: 14px | text-sm | Standard Tailwind mapping |
| font-size: 16px | text-base | Standard Tailwind mapping |
| font-size: 18px | text-lg | Standard Tailwind mapping |
| font-size: 20px | text-xl | Standard Tailwind mapping |
| border-radius: 3px | rounded-[3px] | Arbitrary value |
| border-radius: 8px | rounded-lg | Standard Tailwind |
| border-radius: 12px | rounded-xl | Standard Tailwind |
| border-radius: 50% | rounded-full | Standard Tailwind |
| colour: #DA1710 | bg-[#DA1710] / text-[#DA1710] | Arbitrary value |
| padding: 60px | px-[60px] | Arbitrary value |
| max-width: 1280px | max-w-[1280px] | Arbitrary value |
| font-family custom | style={{ fontFamily: '...' }} | Inline style for non-Tailwind fonts |
Load from ~/.claude/design-library/cache/<slug>/:
tokens-output.json — all extracted tokenspatterns.json — the 9 pattern signalsscreenshot-desktop.png — visual referenceCreate a mapping of brand tokens to Tailwind arbitrary values. Every colour, radius, and spacing value should use the exact extracted number, not a "close" Tailwind default.
Brand primary: #DA1710 -> bg-[#DA1710], text-[#DA1710], border-[#DA1710]
Brand secondary: #1F1C4F -> bg-[#1F1C4F], text-[#1F1C4F]
Body text: #181B25 -> text-[#181B25]
Muted text: #575F65 -> text-[#575F65]
Border: #DEDEE1 -> border-[#DEDEE1]
Light bg: #F3F4F6 -> bg-[#F3F4F6]
Border radius: 3px -> rounded-[3px]
Container: 1280px -> max-w-[1280px]
File: ui/components/brands/<slug>/<slug>-header.tsx
Structure from Westpac pattern:
Button from @/components/ui/button for sign-in CTALink from next/link for all navigationStructure from Woolworths pattern:
File: ui/components/brands/<slug>/<slug>-hero.tsx
Layout patterns:
bg-overlay hero (Westpac style):
position: relative, brand bg colournext/image with fill and object-cover as backgroundposition: relative, max-width constraintsplit-column hero (common corporate pattern):
Map each visual section to a component:
grid grid-cols-2 lg:grid-cols-3 with icon containersCard with CardContent, brand-specific stylingdiv with gradient or solid bgFile: ui/components/brands/<slug>/<slug>-footer.tsx
Structure:
grid grid-cols-2 lg:grid-cols-5 with Link itemsUse Separator from @/components/ui/separator for divider lines.
For custom web fonts (e.g., Woolworths uses Roboto):
style={{ fontFamily: "var(--font-roboto), -apple-system, system-ui, sans-serif" }}For brand-specific display fonts:
layout.tsx via next/font/local or next/font/googleTest the replica at three viewport widths:
Use Tailwind responsive prefixes: sm:, md:, lg: for breakpoints.
<div className="relative w-full overflow-hidden bg-[brand-primary]" style={{ height: 424 }}>
<div className="absolute inset-0">
<Image src="/brands/slug/hero.png" alt="" fill className="object-cover object-right" priority />
</div>
<div className="relative mx-auto max-w-[1280px] px-[60px] pt-[90px]">
<div className="max-w-[765px]">
<h1 className="mb-4 text-white" style={{ fontFamily: "brand-display", fontSize: "72px" }}>
{heading}
</h1>
<p className="mb-6 max-w-[480px] text-base text-white/95">{subtitle}</p>
<a className="inline-flex items-center rounded-[3px] border border-[brand-primary] bg-white px-5 text-base text-[body-colour]">
{ctaText}
</a>
</div>
</div>
</div>
Not yet implemented in existing brands. Pattern: flex with fixed sidebar w-[240px] and flex-1 content area.
<div className="w-full bg-[brand-navy]">
<div className="mx-auto flex max-w-[1280px] items-center justify-between px-6 py-3">
<div className="flex items-center gap-3">
<Lock className="size-[18px] text-white" />
<span className="text-sm text-white">{message}</span>
</div>
<Link className="text-sm font-bold text-white hover:underline">{ctaText}</Link>
</div>
</div>
rounded-[3px])border-b-[3px] border-[#DA1710]<ChevronRight> icon with red colourbg-gradient-to-br from-[#1F1C4F] to-[#DA1710] for promo cards#178841 header with search bar and account actions#25251F and #171C1F for footer rowsrounded-lg, rounded-xl, rounded-full for various UI elementsrounded-full bg-[#3A3F42] for footer social linksreferences/component-mapping.md — Table mapping common site elements to shadcn components with code snippetsreferences/token-to-tailwind.md — Mapping rules from extracted tokens to Tailwind classes (planned)references/css-variables.md — CSS custom property wiring and dark-mode handling (planned)Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub imehr/design-extractor --plugin design-extractor