design-to-shadcn

An agent skill that skins your shadcn primitives from a reference design.

Setup

You need a shadcn project on Tailwind v4. A folder without components.json works too: the agent scaffolds one first, in the shadcn style closest to the reference.

Install the skill:

npx skills add AlexDemzz/skills --skill design-to-shadcn -g

It loads the shadcn skill before anything else, so install that one too if you haven’t:

npx skills add shadcn/ui --skill shadcn -g

Then make sure these tools are on your machine:

ToolWhat it’s for
magick

ImageMagick. Samples the pixel each color comes from.

node

Runs the two bundled scripts.

agent-browser

Drives a live site and reads its computed styles. Without it, headless Chrome takes the screenshots, with no style readout.

What it does

Give your agent a reference: a live website, a case study made of screenshots, or a folder of images. It skins your project’s shadcn primitives until they match: same colors, radii, type, spacing and states, in light and dark. Your app never restyles; it only lays out.

The work runs in four phases, in order, one commit each:

PhaseWhat you get
Capture

A DESIGN.md written from sampled pixels, with a shadcnMapping block every later phase reads.

Tokens

That mapping written to :root and .dark in your CSS file, in OKLCH. No component file changes.

Primitives

Missing primitives installed from a registry, then skinned in their base classes and variants, shown on a /dev/primitives page.

Iso page

One screen rebuilt from the primitives alone, compared region by region with the reference.

The iso page is the proof. If a stranger can tell it from the reference, a primitive still needs work.

When to reach for it

You have a reference design but no tokens for it yet: a live site, a case study or a set of screenshots. Your project runs shadcn on Tailwind v4, or doesn’t exist yet.

Your agent never picks this skill on its own. You call it with the reference and, optionally, the screen to rebuild:

/design-to-shadcn https://example.com/design-to-shadcn ./shots/home-light.png ./shots/home-dark.png settings

Without a screen, the agent picks the one that uses the most primitives: a settings page beats a hero. If your DESIGN.md already holds the reference, say so instead, and the capture phase shrinks to a check.

Common questions

It’s working if

Your iso page and the reference look the same in light and dark, and the ledger lists the primitives that had to change and the overrides your app needed.

Where it fits

design-to-shadcn lives in my skills repository on GitHub (opens in a new tab), next to shadcn-composition-patterns, the compound-component laws for shadcn projects, and grokbot-notify, which messages you in your Grok Bot chat when your agent finishes, gets blocked or needs your decision.