/dev-flow:design-md-to-appfrom dev-flow
Generates a themed React/Next.js 16 app from a DESIGN.md spec. Scaffolds shadcn/ui, Base UI, MUI, or Coss/UI with tokens, TanStack Form + Zod, and a /showcase page.
Ships in dev-flow. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
This skill participates in the dev-flow workflow. When invoked on a project that has a .workflow/ folder at its root:
<root>/.workflow/DESIGN.md (mandatory) and <root>/.workflow/meta.json#stack (preferred — if framework and ui are set, use them; if not, ask the user once and persist).<project-root>/, alongside the existing .workflow/ directory (NOT nested inside it). The framework's standard layout — package.json, app/, components/, lib/, etc. — sits at the top so cd <project-root> && pnpm dev works the way every developer expects.meta.json#phase = "scaffolded", refreshing updated_at, and appending an entry to meta.json#history describing the run (skill name, inputs, outputs, phase delta)..workflow/ present) is still supported — fall back to the original "ask the user where to scaffold" behavior. The contract is opt-in.The canonical contract spec is in references/contracts.md. Read it if any of the rules above are unclear.
Take a DESIGN.md (Google design.md spec — see references/spec.md) and produce a working React app where shadcn/ui or MUI components are already themed and ready to compose into the actual product. The user picks the library; this skill turns design tokens into theme code, customizes component variants according to the components block, and leaves the user with a runnable scaffold plus a /showcase page they can visually verify.
Trigger on any of:
DESIGN.md (or design.md) file path or content provided by the user.DESIGN.md form.If the user has a DESIGN.md but only mentions shadcn/MUI without referencing the file, still trigger — they likely want their tokens applied.
A scaffolded (or augmented) React + TypeScript project where:
colors → CSS variables (shadcn) or palette (MUI). Always two modes: dark + light, with the source DESIGN.md driving the canonical mode and the other auto-derived (see §Dark + light below).typography → typography scale, inside shadcn's own scale: each DESIGN.md level redefines
its nearest Tailwind slot (--text-xs, --text-sm, --text-base, --text-xl, --text-3xl…)
with its --line-height / --letter-spacing / --font-weight modifiers in @theme inline.
Never a parallel set of semantic names (text-body, text-headline-xl): the primitives are
written with text-sm / text-xs / text-base, and a scale they cannot see never reaches them.
See references/shadcn-mapping.md §Type scale. A scale that exists in DESIGN.md but not in the
theme is a scale every consumer retypes as text-[17px].rounded → radius scale (borderRadius extension or theme.shape).spacing → spacing scale (Tailwind extension or theme.spacing overrides).components block are reflected in:
button-primary → Button default variant in components/ui/button.tsx). All shadcn primitives are installed (shadcn add --all) so the app comes out of the box ready to compose.theme.components.MuiXxx.styleOverrides and/or defaultProps./showcase page renders every styled primitive so the user can verify the result.typography.fontFamily are loaded — via next/font/google when on Next, via direct <link> for Vite/Remix when the font is on Google Fonts, otherwise self-hosted from a local public/fonts/ (see §Font loading)._design-md-mapping.json is written at the project root showing exactly how each DESIGN.md token resolved to library values — useful for debugging and for the user to verify the mapping at a glance.@shadcn/lint is installed and registered with the design-system rules at error, so an agent
that writes bg-pink-500, text-[17px] or rounded-full on a <Button> gets an error naming the
token or variant to use instead. See references/design-system-lint.md.STYLE_NOTES.md so the user — and future agents — can apply them consistently.Never invent the spec. When in doubt about a token shape, valid units, references like {colors.primary}, or canonical section ordering, read references/spec.md first.
.workflow/meta.json exists at the project root, the DESIGN.md is at .workflow/DESIGN.md. Don't search further.DESIGN.md in the project root (case-insensitive). If multiple are found, ask which one.python scripts/parse_design_md.py <path> to get a normalized JSON dump of { frontmatter, body_sections, resolved_components } where token references like {colors.primary} are resolved to literal values.⚠️ If the file cannot be read at all, stop and ask for it. Never reconstruct it. A path that exists and still fails to open is the dangerous case, because the obvious recovery — inferring what the DESIGN.md "probably" says from the brand name, the project, or what a design system usually contains — produces something DESIGN.md-shaped and entirely invented. And then everything downstream looks correct: real tokens, a real theme, a real showcase,
phasebumped toscaffolded, and not one of them traceable to a decision the user made. Ask the user to copy the file into the working directory and wait. This is the same rule asresearch.py's exit codes — "I could not look" and "there is nothing" are different facts — applied to the one input the whole skill is downstream of.The common cause on macOS is TCC (the Files-and-Folders privacy layer), which blocks
~/Downloadsand~/Desktopfor a host that has not been granted access — shadcn's own skill warns about it. It is host-dependent, not universal: checked on this setup on 2026-10-09, both directories read fine (587 and 82 entries), so a failure here means something else and the message is worth reading rather than assumed. Either way the rule above does not change.
A third shape exists, and it is not an input. design.md now names two unrelated
artefacts. Ours is the Google spec below: token blocks in the frontmatter. The other is an
Agent Skill — frontmatter of exactly name + description, body in prose, zero tokens.
https://vercel.com/design.md is one: Vercel's brand guidance
for agents writing report pages, served as text/markdown so any agent can load it.
Fed one of those, the parser used to exit 0 with empty tokens — which shape 2 below reads as
"body-only, extract from prose", and every value in the app ends up invented. It now exits 2
and says so. If a user hands you a URL or a file that turns out to be a skill, the answer is not
to parse it: it carries no design system.
Two valid input shapes — handle both:
Frontmatter + body (the canonical Google design.md spec). The parser returns a populated frontmatter dict; resolved_components is non-empty. This is the easy path — token values are already structured for you.
Body-only / prose-only (no --- fences, the spec written entirely as markdown). The parser returns frontmatter: {} and everything goes into body_sections. This is now common in the wild — many DESIGN.md files written for AI agents are pure prose with section headings like ## 2. Color Palette, ## 3. Typography Rules, etc.
When frontmatter is empty, don't stop and ask for YAML. Extract tokens directly from the body sections. Map sections to token categories by their heading (case-insensitive partial match):
Read each section as the source of truth for its category — extract hex values from prose, copy typography tables, lift component prose specs verbatim. Document this extraction path explicitly in _design-md-mapping.json under a top-level extraction_method field so a reviewer can see what came from prose inference vs. from a structured field.
Ask the user once: shadcn/ui, Base UI, MUI, or Coss/UI? Offer a recommendation based on references/library-choice.md. Common heuristics:
pnpm update (no CLI / components.json overhead) → Base UI.If they pick shadcn, ask the follow-up: which primitive base — Base UI, Radix, or React Aria? (shadcn create --base base|radix|aria). shadcn CLI v4 builds on any of them, with the same component API and blocks across variants. Default Base UI (shadcn's default for new projects since 2026-07; full component + block coverage, MUI-team a11y). Pick Radix (the long-standing base, still fully supported) or React Aria (--base aria, Adobe's a11y-first primitives, first-class since 2026-07) explicitly. Record as stack.ui_base. This is distinct from picking standalone Base UI (stack.ui = "base-ui", no shadcn CLI) — see references/library-choice.md. Hybrid asking (per dev-flow): also ask icon_library (lucide default), and rtl only when the project is multilingual/RTL. Don't ask base color / theme — the DESIGN.md tokens own the visual layer; css_variables stays true.
stack.ui = "coss") — hand off to the coss-ui skill.Mapping skill choice → meta.json#stack.ui → references/<lib>-mapping.md:
references/shadcn-mapping.md (+ stack.ui_base = base|radix|aria)references/base-ui-mapping.md (standalone Base UI, no shadcn CLI)references/mui-mapping.mdreferences/ui-sdk-mapping.md — offered only on the two signals of references/library-choice.md (more than one framework, or an agent drives the interface). With stack.ui_registry set — the components come from the project's design-system registry (ui-agent on Agentic Factory) — follow references/ui-sdk-registry.md instead of writing components, in either shape: a single app (framework: "next", into components/ui/) or a monorepo (into packages/ui). It runs scripts/check_ui_registry.py items before the install and project after, and the failures of real installs in both shapes are its rules.coss-ui/SKILL.md (Coss/UI — Cal.com DS on Base UI via the shadcn @coss/* registry; ui_base = "base"; requires Tailwind v4; mixed MIT/AGPLv3 license). Coss's tokens are shadcn CSS vars, so DESIGN.md overrides apply as in the shadcn path.State the suggestion with a one-line rationale ("Suggerisco Base UI perché vuoi l'aesthetics flessibile di shadcn ma senza la source-maintenance del CLI"), then accept whatever the user picks. After picking, load the matching <lib>-mapping.md and follow it for installation, theming, and component wiring.
Ask the user two things in this step:
3a. Project target
.workflow/meta.json exists): scaffold the codebase at <project-root>/ alongside .workflow/ (e.g., pnpm create next-app . from the project root). Do NOT create a sub-directory like app/ or code/ to nest the codebase. The framework comes from meta.json#stack.framework if set, otherwise ask. The user does not pick the path — the contract pins it.package.json and the file layout:
next in deps + app/ or pages/.vite + @vitejs/plugin-react in deps.@remix-run/* in deps.The mapping references describe the framework-specific glue (font loading, root layout/provider wiring, where to put theme.ts / globals.css). Don't assume Next.js paths — branch on the detected framework.
3b. Scope: full scaffold vs. theme-only
Ask: "Vuoi lo scaffold completo (showcase + STYLE_NOTES + provider wiring) o solo le patch al tema?" Two modes:
Full scaffold (default for new projects): everything described in §What you produce — theme files + component overrides + /showcase route + STYLE_NOTES.md + _design-md-mapping.json + provider wiring. Golden rule 2 — wire i18n now (follow the doc-grounded how-to in references/i18n-next-intl.md, don't improvise the setup): install next-intl (stack.i18n), scaffold messages/en.json + messages/it.json (minimum stack.locales = ["en","it"], default en), the [locale] routing (routing.ts/navigation.ts/proxy.ts/request.ts) with setRequestLocale + generateStaticParams, and <NextIntlClientProvider> in the root layout. All scaffolded copy uses useTranslations keys — never hardcoded strings (the forms skill already assumes this). Adding i18n later touches every page, so it's part of the initial scaffold, not deferred.
Theme-only patch (recommended for mature existing projects): write only the design-token files as a reviewable diff:
globals.css (Tailwind v4 is CSS-first — tokens live in @theme inside globals.css; only touch tailwind.config.ts if the project still uses a v3 JS config), the cva blocks of components named in DESIGN.md.lib/theme.ts only (or wherever the theme already lives)._design-md-mapping.json and STYLE_NOTES.md because they're cheap to add and useful for the reviewer.In theme-only mode, don't create /showcase, don't install new dependencies, don't touch the root layout/provider unless the user explicitly asks. The goal is a diff a senior reviewer can read in five minutes.
Default the choice based on context: existing project with extensive code → suggest theme-only; new project or empty repo → full scaffold. State the suggestion in one line, accept whatever the user picks.
If overwriting any existing theme/config (globals.css, tailwind.config.*, theme.ts), show a diff of what will change and confirm before writing.
Confirmation gate (BLOCKING — do this before scaffolding). Before running any
shadcn create / install command, print a recap of the full resolved configuration and
wait for the user to confirm or adjust. Do not scaffold until they say go. Show every
value that will be passed to the CLI, including the ones derived from DESIGN.md (so the user
sees them even though they weren't prompted):
Sto per scaffoldare con shadcn create. Configurazione:
• framework : next (App Router) ← stack.framework
• base (primitivi): base (Base UI) ← stack.ui_base
• base color : neutral ← stack.base_color (poi sovrascritto dai token DESIGN.md)
• theme : (dai token DESIGN.md) ← stack.ui_theme
• icone : lucide ← stack.icon_library
• css variables : on ← stack.css_variables
• rtl : no ← stack.rtl
• monorepo : no ← stack.framework
Confermi, o vuoi cambiare qualcosa?
Resolve each value from meta.json#stack (with the documented defaults). On "cambia X",
update meta.json#stack and re-print the recap. Only after explicit confirmation, proceed.
For MUI / standalone Base UI, print the equivalent lighter recap (library, framework, base
color source) and confirm the same way. Never scaffold on assumed config. When
stack.shadcn_preset is set, run pnpm dlx shadcn@latest preset decode <code> and show the
decoded config in the recap (so the user confirms what the preset carries).
Read the relevant mapping reference and follow it:
references/chat-and-typeset.md (shadcn chat components + typeset + streamdown, the standard — never hand-roll chat or render model markdown as plain text).references/shadcn-mapping.md. Monorepo first: if meta.json#stack.framework == "monorepo" and the monorepo is web-centric (no NativeWind/mobile side — e.g. web-only or web + agent), follow that reference's "Monorepo (shared packages/ui)" section: scaffold with shadcn init --monorepo so primitives land in a shared packages/ui (@workspace/ui), NOT in apps/web/components/ui/. The single-app flow below (and --no-monorepo) is for non-monorepo projects (or the web+mobile case where components stay app-local). Two visual-config paths — they are mutually exclusive:
A) Preset path (when stack.shadcn_preset is set): the preset owns the visual layer. Scaffold with pnpm dlx shadcn@latest init --preset ${stack.shadcn_preset} --template ${framework} --base ${stack.ui_base ?? "base"} --yes, then pnpm dlx shadcn@latest add --all --yes. Skip build_registry.py / the registry.json token install — the preset already encodes colors/theme/fonts/icons/radius. (Helpers: preset decode to inspect, preset url/preset open to view in browser.)
Pick a style first, in both paths — it is the layer the tokens cannot reach. references/shadcn-styles.md has the eight (vega, nova, maia, lyra, mira, luma, rhea, sera) with what each one actually sets, read from the CLI's own bundle: the icon library, the body font and the heading font. CSS variables carry colour, radius, shadows and type; the style carries control padding, density, how rounded and how raised, baked into the component source — so the wrong one means fighting button.tsx for the rest of the project. Read the DESIGN.md's radius scale, control heights, shadow treatment and density, match the character column, and state the choice and the reason in one line before writing code. ⚠️ The style sets the icon library: maia and mira are hugeicons, lyra is phosphor — which icon_library's enum does not name — so record what info --json reports in stack.icon_library rather than assuming lucide.
B) DESIGN.md-first path (default, no preset): the recommended token-first install via registry.json (see the dedicated section in that reference). Three steps: scaffold framework → emit registry.json from DESIGN.md tokens (use scripts/build_registry.py) → run pnpm dlx shadcn@latest init ./registry.json --yes followed by pnpm dlx shadcn@latest add --all --yes. add --all stays — every primitive lands in components/ui/* and gets customized in the next step per the DESIGN.md components block (cva edits).
⚠️ add --all is not "all" — top it up. Verified 2026-10-17: the search index that --all works from carries 61 registry:ui items, and shadcn ships components that are installable by name but absent from it. Today that is trace, code-block and use-highlighted-code (released 2026-10-14; shadcn add trace resolves inside a project, --all never reaches it). So the scaffold finishes with one more line, and it is not optional — the agent-UI work later assumes they exist:
pnpm dlx shadcn@latest add trace code-block --yes
They only resolve under a new style namespace (base-*, radix-*, aria-*); on new-york/new-york-v4 the registry answers 404 and the command cannot work — see references/shadcn-styles.md. When a future release adds more unindexed items, this list grows: the check is curl -s -o /dev/null -w '%{http_code}' https://ui.shadcn.com/r/styles/<style>/<name>.json against the project's own style.
Pass the create parameters from meta.json#stack (shadcn CLI v4): --base ${stack.ui_base ?? "base"} (Base UI / Radix / React Aria primitives), --base-color ${stack.base_color ?? "neutral"}, ${stack.css_variables === false ? "--no-css-variables" : "--css-variables"}, and --rtl when stack.rtl. The DESIGN.md tokens (via registry.json) override base color / theme / fonts, so those flags are only the starting scaffold. --base is NOT overridden by DESIGN.md — it picks the primitive engine, so honor stack.ui_base exactly. If stack.ui_base is unset, ask before scaffolding (don't silently pick a base on a fresh project).
Every shadcn block/component exists in both Radix and Base UI variants; once --base is set, shadcn add pulls the matching variant automatically.
references/mui-mapping.mdEach reference describes:
add --all so the user has the full kit pre-themed; MUI: theme overrides cover all primitives by default),STYLE_NOTES.md for the rest (e.g. "Use radial gradients for hero backgrounds — see DESIGN.md §Layout").The asset templates in assets/shadcn/ and assets/mui/ are starting points — read them, fill the placeholders with resolved tokens, write to disk. Do not paste them verbatim if the DESIGN.md doesn't define a value; fall back to library defaults rather than invent.
After writing the theme files, also write _design-md-mapping.json at the project root. This is a debug artifact: a JSON dump of { token_path → resolved_value → library_target } for every color/typography/component that was mapped, plus the list of fallbacks that were used because the DESIGN.md didn't define a value. Add _design-md-mapping.json to .gitignore if the user wants to keep it local-only — by default leave it tracked since it's useful for reviewers.
Rule: when the chosen UI library (shadcn or MUI) ships a primitive for the pattern, use it. Don't roll custom.
Mandatory before writing ANY component — here and in every later skill: read
references/primitives-first.md(the pattern → primitive table, the complete list of allowed raw elements, «the primitive renders the design» — when the board differs, tune the primitive'scvavariants and DESIGN.md tokens until it matches, pixel by pixel — and the pixel-parity check for screens already built; «no primitive can render it → stop and ask the user»). A raw<button>,<label>,<a>,<hr>,<img>, a hand-written ARIA role, or adiv/spanwhose classes redraw a Card, Badge, Alert or Separator is a golden-rule-3 violation even though it imports nothing. It is reported bydesign/no-handmade-uiand refused at write time by the guard Step 4.10 installs.
This step is where golden rule 3 (
references/contracts.md§Golden rules) is applied first, and the rule does not end here: every skill that writes UI after the scaffold repeats the same "searchcomponents/ui/before writing" step, the design-system lint bans imports of undeclared component libraries and of the primitives' headless bases outsidecomponents/ui/, andspec-reviewchecks it on every diff. Theadd --allbelow is what makes the rule always applicable. A primitive that genuinely does not exist is a recorded exception (meta.json#stack_config.primitive_exceptions), not a quiet custom component.
This is the single most-violated rule in scaffolders. The skill installs shadcn add --all (or MUI's full theme), giving the project access to dozens of pre-built, accessible, mobile-aware, theme-integrated primitives — and then the skill writes a custom 100-line <Sidebar> from scratch using <aside> + flex + lucide icons. The custom version is worse on every axis: less accessible, no mobile drawer, no collapsed state, no tooltip support, no keyboard shortcuts, no persistent state.
Before authoring any component beyond the simplest (Eyebrow, simple text wrappers), scan components/ui/*.tsx for a primitive that matches the pattern. Common shadcn primitives projects miss:
| Pattern in DESIGN.md / Figma | shadcn primitive | What you get for free |
|---|---|---|
| Vertical app sidebar (icon-only or expanded) | Sidebar + SidebarProvider + SidebarMenu* | Collapsible state (icon ↔ expanded), mobile drawer via Sheet, tooltips on hover when collapsed, Cmd+B toggle, persistent state in cookies, active-route detection via context |
| Top navigation menu with hover dropdowns | NavigationMenu | Keyboard navigation, ARIA menu, hover delays |
| Dialog / modal | Dialog + AlertDialog | Focus trap, Escape close, scroll lock, portal |
| Hamburger drawer (mobile nav) | Sheet | Slide-in animation, focus management, swipe close |
| Autocomplete / type-ahead | Combobox (Command + Popover) | Async search, keyboard nav, fuzzy match |
| Command palette / cmd+k | Command (CMDK) | Categorized search, keyboard, animations |
| Chat / conversation / AI console / support inbox | MessageScroller + Message + Bubble + Marker (shadcn chat, Jun 2026) | Autoscroll that yields to the user, scroll-to-bottom button, edge scroll-fade, virtualization — see references/chat-and-typeset.md |
| Rendered markdown / AI output / rich description | .typeset (shadcn/typeset, Jul 2026) + streamdown | Consistent typography on rendered markdown; whitespace-pre-wrap on model output leaves **bold** literal — see references/chat-and-typeset.md |
| Map / location / route / store-locator | mapcn (MapLibre GL, shadcn registry) — Map + Markers/Popups/Routes/Clusters/Controls | Theme-aware, Tailwind-styled, declarative composition; ⚠️ default CARTO tiles need an Enterprise license for commercial use — swap the tile provider before shipping. See references/maps-mapcn.md; record stack.maps = "mapcn" |
| Node graph / pipeline editor / workflow builder / org chart the user acts on | React Flow (@xyflow/react) — custom nodes composed from shadcn primitives; node UI from React Flow UI through registry-intake | Pan/zoom, drag-to-connect, keyboard focus, ariaLabelConfig for i18n. A read-only graph that fits the screen is cards, not a canvas. Theme through the un-suffixed --xy-* variables, colorMode from resolvedTheme, a list below md:, attribution kept unless subscribed. See references/react-flow.md; record stack.graphs = "react-flow" |
| Audio UI the user reads or sets — level meter, fader, knob, waveform, spectrum, soundboard, mixer | audiocn (@audiocn, shadcn registry, MIT) — 23 components, 18 Web Audio hooks, 2 lib files, 6 blocks | Uses our own semantic tokens (bg-muted, text-card…) with no raw palette colours, installs into components/ui/ · lib/audio/ · hooks/ rather than a second namespace, and shares one requestAnimationFrame loop across every meter. ⚠️ registry-intake blocks it on C1: @audiocn/core adds twelve audio-domain tokens (`meter-ok |
| Gauge / dial — a bounded value whose zones mean something (disk filling, rate limit, temperature band, a thermostat the user turns) | gauge-ui (https://www.gauge-ui.dev/r/gauge.json, shadcn registry, MIT) — composable SVG: Gauge + Arcs/Ticks/Needle/Dot/Text/Inset, plus Control for a dial the user drags | registry-intake review: clean, zero findings — no npm dependencies, no cssVars, and no colour of its own (currentColor, no hex, no palette class), so DESIGN.md's tokens apply untouched. One cancelled rAF loop, prefers-reduced-motion honoured by snapping. ⚠️ Control has full slider ARIA; the read-only gauge has none — add role="img" + an aria-label naming the measure, or aria-hidden it and keep the value in text. Use www (the apex 308-redirects). A single unbounded number is a number with a sparkline, not a gauge. See references/gauge-gauge-ui.md |
| Date range picker | Calendar + Popover | Locale-aware, keyboard nav, range selection |
| Tabs (route-driven or panel) | Tabs | ARIA roles, keyboard nav, animations |
| Sheet / slide-out panel | Sheet | Right/left/top/bottom variants |
| Toast / notification | Toast (shadcn's first-party Toast, Base UI, 2026-07 — actions, status types, promises, stacking, swipe-dismiss; sonner still fine on Radix) | ARIA live region, stacking, swipe |
| Form with validation | Form + react-hook-form adapter | Zod-validated, inline errors, accessible labels |
| Table with sort/filter | Table (+ optional tanstack-table recipe) | ARIA grid, sortable columns, virtualizable |
| Combobox toggle group | ToggleGroup | Single/multi select, keyboard |
| Resizable panel layout | Resizable (react-resizable-panels) | Saved sizes, accessible, keyboard resize |
| Right-click menu | ContextMenu | Submenu, keyboard, ARIA |
| Tooltip | Tooltip + TooltipProvider | Delay, position, accessible |
| Slider | Slider | Range / single, keyboard, ARIA |
| Progress bar | Progress | ARIA progressbar, animations |
| Skeleton loading | Skeleton | Pulse animation, theme-aware |
| Avatar + fallback initials | Avatar + AvatarFallback | Image error fallback, accessible alt |
| Pagination controls | Pagination | Keyboard, ellipsis, ARIA |
The same logic applies to MUI: prefer Drawer, AppBar, Modal, Autocomplete, DatePicker, Tabs, Snackbar, Table, etc. over <div> constructions.
cva variants and the DESIGN.md tokens it reads — until it matches the board pixel by pixel; a new variant goes into DESIGN.md first, then into the cva. Never accept the drift, never rebuild the look with classes at the call site, never an element by hand. Only when no primitive can render it without a fork: stop and ask the user.In all other cases: default to the primitive. The custom version is technical debt the user has to maintain forever.
<aside class="flex flex-col w-64 ..."> when Sidebar exists.useState + <div className="fixed inset-0"> when Sheet exists.<input> + useEffect when Command exists.components/ui/ for a matching primitive (grep -l Sidebar components/ui/*.tsx).shadcn/no-restyle allows layout). Brand faithfulness comes from the DESIGN.md tokens in globals.css and the cva variants in components/ui/, not from classes on the call site or an element rebuilt by hand.When in doubt: open components/ui/<primitive>.tsx and read its API. If the API supports your pattern, use it.
Once add --all lands the shadcn primitives, the project has too many "where does this go?" decisions waiting to happen. Pin the convention now, before writing application code, so every subsequent skill (and human) knows where to put things.
The Next.js App Router 2026 convention this skill enforces (canonical spec: docs/superpowers/specs/2026-06-06-folder-structure-refactor.md):
| Path | What lives here |
|---|---|
app/<route>/_components/ | L0 page-private: sections unique to ONE page. _ prefix is Next.js privacy marker. Default for every new component. |
app/(group)/_components/ | L1 route-group shared: components used by 2+ pages within the same route group ((marketing), (auth), (app)). Includes layout shells like AppShell, AppSidebar, AppHeader. |
components/shared/<dominio>/<Component>.tsx | L2 globally shared: components used by pages of multiple route groups. Domain folder name reflects business (post/, user/, billing/), never generic ("shared"/"common"). |
components/ui/ | shadcn primitives. Untouched after add --all except for cva variant customization per DESIGN.md components block. |
components/theme/ | ThemeProvider, ModeToggle, useThemeColor — explicit theme system folder. |
lib/server/<domain>.ts | Server actions per domain (practices.ts, clients.ts). Always "use server";. |
lib/queries/<domain>.ts | Server-side data reads called from RSC. |
lib/db/ | Drizzle (or equivalent) schema + connection — owned by module-add db. |
lib/auth/ | better-auth client + helpers — owned by module-add auth. |
lib/utils.ts | Pure utilities (cn(), formatters). |
hooks/ | Custom React hooks shared cross-route (useDebounce, useMediaQuery). |
Rule of Three for promotion (canonical):
app/<route>/_components/ (L0).promote-component skill automates this.Key rules:
_components/. Do not pre-emptively put something in components/shared/.components/shared/ is L2 only: it holds components used across multiple route groups. Lower-level shared (within a single group) lives in app/(group)/_components/.components/shared/ "shared", "common", "global", "misc". Use the business domain (post/, user/, billing/, auth/).(app)/ MUST NOT import from (marketing)/_components/. If it needs to, promote the component to L2 (components/shared/)."use server" files belong in lib/server/<domain>.ts, not under app/.When screenshot-to-page builds a new route and notices it's reusing a component from another route, it suggests calling promote-component to move it up the hierarchy with automated import rewriting.
When this skill scaffolds the project, the folder skeleton mirrors the canonical structure:
app/
├── (route_groups from meta.json#stack.route_groups)/
│ ├── _components/ # L1 group-shared (created empty)
│ ├── layout.tsx
│ └── (pages with their own _components/ as added)
├── api/
├── layout.tsx # root: HTML + ThemeProvider wrap
└── globals.css # CSS variables + Tailwind directives
components/
├── ui/ # populated by `shadcn add --all`
├── theme/ # ThemeProvider, ModeToggle (scaffolded)
└── shared/ # empty initially; populated by promote-component
lib/
├── server/ # empty initially
├── queries/ # empty initially
└── utils.ts # populated by `shadcn init`
hooks/ # empty initially
If the DESIGN.md, the source Figma screenshots, or the PRD describes a primary navigation (sidebar / topbar / nav menu) with N items, every navigable item must resolve to a real route in the scaffold. A nav that points to <Link href="/clienti"> and that link goes to /_not-found is a worse first impression than no nav at all — it makes the user think the app is broken.
This step is mandatory in dev-flow mode when a navigation is detected. It is independent of screenshot-to-page: that skill builds one rich page from a single screenshot. This step builds stub pages for the remaining nav items so nothing 404s.
Look for navigation declarations in this order:
.workflow/screenshots/ (typically the dashboard / home) usually shows the primary nav. Identify the items visually.## Components section, if it documents nav items.For each nav item that is not the primary screen (which screenshot-to-page will build properly), generate a stub at the canonical framework path:
<project-root>/app/<slug>/page.tsxreferences/<framework>-<ui>.mdThe stub:
<AppShell> (or layout component) used by the home page, so the sidebar + topbar are consistent.active="/<slug>" so the sidebar item highlights correctly.tasks.md for that user story (e.g., for /clienti, list the 3 tasks tagged with the relevant user story). This makes the placeholder useful — the user sees what's coming.stack.icon_library), not an illustration. A hand-drawn illustration is a stylistic commitment — only if DESIGN.md's visual language admits it, only at emotional moments (first-run empty state, onboarding, 404), and only a handful per product. See references/illustrations.md (Koboyo, stack.illustrations — default null); when in doubt, type and spacing beat borrowed art.stack.icon_library is one library per project, chosen by the shadcn style, and it stays that
way: a second icon dependency is a second visual voice. But every set has holes, and the honest
answer so far has been "draw it" or "break the rule".
Icônes (antfu-collective, MIT, 7.5k★) is a browser over Iconify —
measured 2026-10-17: 243 sets, 413,781 icons, with our whole enum inside it (lucide 1,891 ·
ISC, tabler 6,238 · hugeicons 6,065 · ph 9,072 · radix-icons 332 · heroicons 1,288, all
MIT). Use it to find the one icon that is missing, then take it as source, not as a
dependency:
curl -s https://api.iconify.design/ph/calendar-blank.svg
That returns width="1em" height="1em" with fill="currentColor" — it inherits the project's size
and colour tokens with nothing to adjust. One file in components/icons/, the library untouched.
⚠️ Check the set's licence before the icon lands, every time. It is one command, and it is not optional:
curl -s "https://api.iconify.design/collections?prefix=solar" | python3 -m json.tool
Why it is not optional, measured the same day: 64 of the 243 sets — 93,891 icons, 23% of
everything Icônes shows — are CC BY or CC BY-SA. Attribution is a condition, and BY-SA adds
share-alike. The big ones are the tempting ones: arcticons 15,322 (BY-SA), solar 8,706 (BY),
selfhst 7,272 (BY), openmoji 4,544 (BY-SA), game-icons 4,133 (BY). Nothing in the browsing
experience warns you, and an icon copied from one of those puts an obligation on a product we
deliver — a launch-audit §third-party-marks question, raised at the moment of copying instead.
Prefer a set that is MIT, ISC or CC0. When only a CC BY set has the icon, that is a decision with an
attribution line attached, not a copy-paste. @iconify/json (MIT) carries the same index offline if
the check ever needs to run without a network.
⚠️ This does not answer the animated-icon gap the contract flags: animated-icons has registries
for heroicons and hugeicons only, and Iconify ships static SVG. A phosphor project wanting an
animated icon still has no answer here.
Generate a single <PlaceholderPage> component that all stubs use, so:
screenshot-to-page when a screenshot becomes available).screenshot-to-page. When the user has a screenshot for /clienti, screenshot-to-page replaces the stub with the real page./admin/users/new is too deep — it's a feature task, not a top-level nav stub.After writing stubs: rerun pnpm run build to confirm everything still compiles.
.workflow/screenshots/ before authoring the home page (mandatory)The single most common scaffolder failure mode: generating a generic home page when the source Figma file has a canonical product layout in screenshots/. The user expects the scaffold to mirror what's in the Figma, not invent a homepage from design tokens alone.
This step pins the discipline.
List .workflow/screenshots/. If empty, skip — generate the default home from design tokens (the Constellation marketplace pattern).
For each screenshot, classify it by file name + visual content (you can Read each PNG — the Read tool returns image content):
cover / welcome / intro → marketing/onboarding frames, not the canonical product layoutstyle-guide / design-system → reference for the /showcase page, not the homeinspiration / dashboard / home / app / product → CANONICAL product layout — this is what the home page must mirrorcomponents / cards / <component-name> → component-level references, can be borrowed for cards inside other pagesIf a canonical layout exists, READ it visually with the Read tool. Then identify:
Build the home page faithful to that screenshot. Use the exact metric names ("Total Orders Today" not "Revenue"), the exact chart types (radar + area + pie + bar + heatmap, not generic bars), the exact sidebar pattern (vertical 64-72px wide if that's what the screenshot shows). The design tokens are how you style it; the Figma frame is how you compose it.
State the source explicitly in the hand-off message: "Home page mirrors the inspiration-dark-dashboard.png frame from Figma — sidebar + 4 KPI cards (Orders/Conversion/Clients/Revenue Ratio) + 5 chart types (radar, area, pie, bar, heatmap)."
When the user provides a Figma URL, they expect the scaffold to look like the Figma. A generic dashboard "themed with the design tokens" misses the point — the design system isn't a paint job, it's a layout vocabulary too. The icons in KPI cards, the progress bars, the way the radar chart relates to the area chart — these aren't decoration. They're the design.
.workflow/screenshots/ is empty AND no PROJECT.md describes a specific product (rare).In these cases, default to the generic pattern but state it in the hand-off: "No canonical product layout found in screenshots/ — generated a generic home with the design tokens. Run screenshot-to-page later when you have a target frame."
Read step on the canonical PNG and writing the layout from imagination.A separate failure mode from Step 4.5b: the skill reads the canonical screenshot, identifies a layout pattern correctly, and then fills in the layout with invented copy — plausible-sounding placeholder text that sounds like what the project might say but didn't actually appear in the Figma. The result: a scaffold that visually looks right but ships marketing copy the user never wrote and didn't approve.
This step pins the rule.
When a screenshot shows visible copy, transcribe it verbatim. Never substitute "plausible-feeling" placeholder text. Specifically:
Display headlines, eyebrows, button labels, nav items — these are typically large enough to read directly from the rendered PNG. Copy them character-for-character. Don't reword. Don't add punctuation the source didn't have. Don't translate.
Body copy in cards / sections — often smaller and harder to read.
Crop the PNG at full source resolution (no downscale) for the
relevant region and re-read. If still illegible, mark as
<TBD — body copy in Figma too small to extract verbatim. Replace before launch.>
in the generated code, NOT plausible filler.
Numbered lists / step descriptions — same treatment as body copy. Headings are usually readable; step body often isn't. Copy what you can read; mark the rest TBD.
Footer columns / contact info / hours — these are the most often
verbatim-extractable details (large monospace, tabular). Always copy
verbatim, including formatting (e.g., MON – FRI vs Mon–Fri is a
verbatim concern; don't normalize).
Pages NOT in the Figma at all — the scaffold may need a sign-in,
contact, legal, or detail route the source design doesn't cover.
These are unavoidable for shipping but the content inside them is
100% invented. Add a <TbdBanner> component at the top of these
pages explaining "Placeholder content — not from Figma source."
The banner should be visually warning-styled (yellow / orange / brand
alert color) so the user can't miss that the content is invented.
If body copy is unreadable at the typical 1500-wide preview crop:
# Crop the same region from the SOURCE cover.png (no downscale)
img = Image.open('.workflow/screenshots/cover.png')
section = img.crop((x0, y0, x1, y1)) # Source-resolution coords
section.save('.workflow/screenshots/_<region>.png')
Then Read the new crop. Body text that's illegible at 1× becomes
legible at the source resolution; tracking + leading details that
matter typographically also become extractable.
The user trusts the scaffold. They open the running site, see a "FOR THE COMMITTED" card with a "Train like an athlete with top-tier equipment and expert programming. Whether you're building muscle or breaking PRs, we help you push past limits with structured cycles and a coach who actually knows your name." body — and they think that's what the brand says. They don't compare back to the Figma because they trust you did. So the invented copy ships, gets passed to their copywriter as "the existing copy", gets edited around, and never gets corrected. That's the harm.
<TbdBanner> on pages that exist in routing but
not in the source design.[email protected], (203) 555-5555) — preserve the placeholder
shape so the user knows it's TBD.In the final summary message, explicitly list invented content:
Pages NOT in the source Figma (content invented at scaffold time):
/coachesindex + 4 detail pages (lib/queries/coaches.ts)/community/[slug]4 articles (lib/queries/journal.ts)/sign-in,/contact,/book-session/checkout,/legal/*All marked with
<TbdBanner>in the rendered page.
That way the user knows exactly what they need to rewrite vs. what's faithful to the source.
Step 4.5c pins the verbatim-Figma rule for content the source actually shows. This step covers the inverse: surfaces where DESIGN.md is silent and Figma is absent (TBD pages, stub data, invented copy, body-only DESIGN.md without YAML tokens). Without explicit defaults, the LLM tilts to recognizable "AI generic" choices — pure black #000000, h-screen (broken on iOS), "John Doe" placeholders, "Acme" brand names, "Elevate / Seamless" filler words, three equal cards in a row.
references/anti-slop-fallbacks.md enumerates 13 portable rules (off-black, min-h-[100dvh]/svh, sample data yes and invented proof never, banned filler vocabulary, real pictures before a logged placeholder, no 3-equal-card default, hardware-accelerated motion, tactile :active feedback, skeleton loaders, CSS-cascade stagger, composition reflexes, numbers and charts in app screens, copy shape). references/mobile-web.md is the platform layer next to it — the tells that say "this is a website" on a phone (sticky hover, the tap-highlight flash, inputs that zoom, the 300 ms tap delay, the notch, touch-action), with a four-line baseline to ship before the first component.
Read it before writing any of these surfaces:
lib/queries/<domain>.ts for routes not in Figma.<TbdBanner> pages (sign-in, contact, /coaches, journal articles).The rules are explicitly subordinate to Steps 4.5b and 4.5c — when Figma shows a value, Figma wins. Anti-slop fallbacks fire only where the source is silent.
When you apply a fallback, log it to _design-md-mapping.json under fallbacks_applied so the reviewer can audit every opinionated default in one place.
registry.json already produces both cssVars.light and cssVars.dark blocks. Without a runtime toggle, the dark variant is dead code. Wire the toggle as part of the scaffold — every project gets dark mode for free, plus a keyboard shortcut.
pnpm add next-themes
Generate two components in components/<group>/:
components/<group>/theme-provider.tsx — a thin client wrapper around next-themes:
"use client";
import * as React from "react";
import { ThemeProvider as NextThemesProvider } from "next-themes";
export function ThemeProvider({
children,
...props
}: React.ComponentProps<typeof NextThemesProvider>) {
return <NextThemesProvider {...props}>{children}</NextThemesProvider>;
}
components/<group>/mode-toggle.tsx — a client button with global keyboard shortcut on D:
The component must:
<Button variant="ghost" size="icon"> showing <Sun> when the resolved theme is dark and <Moon> when light.useTheme() from next-themes.mounted state guard to avoid SSR/CSR mismatch (return an inert placeholder until mounted).keydown listener on window that toggles theme when D is pressed AND:
INPUT, TEXTAREA, SELECT, contentEditable. This rule is critical — without it, every time the user types a D in a form, the theme flips.aria-label mentioning the shortcut: aria-label={\Toggle theme (current: ${resolvedTheme}). Shortcut: D`}`.A reference implementation lives at references/mode-toggle.template.tsx — copy-and-rename instead of writing from scratch.
In app/layout.tsx:
import { ThemeProvider } from "@/components/theme/theme-provider";
<html lang="..." suppressHydrationWarning>
<body>
<ThemeProvider attribute="class" defaultTheme="light" enableSystem disableTransitionOnChange>
{children}
</ThemeProvider>
</body>
</html>
suppressHydrationWarning on <html> is required by next-themes to avoid React warnings on the first paint when the theme class is applied.
Mount <ModeToggle /> in both the public site shell (SiteTopNav next to the primary CTA) and the internal app shell (AppShell topbar next to notifications/help). Users hit it from either context.
Use defaultTheme="light" unless the source DESIGN.md explicitly declares dark as canonical (some editorial brands do — Aetherfield is light-only, Notarius is light-only, devops-graphite is dark-by-default). enableSystem lets the user's OS preference win on first visit.
🔴 One polite live region, mounted once in the root layout. Everything that happens without the user's focus moving — a form rejecting a field on blur, a filter returning nothing, a row removed — has no way to reach a screen reader otherwise, and each feature inventing its own region is how an app ends up with five that each announce unreliably.
lib/a11y/announcer.tsx:
"use client";
import { createContext, useCallback, useContext, useRef, useState } from "react";
// Module-level, so non-React code (a form hook, a service) can announce without a context.
let setMessage: ((text: string) => void) | null = null;
/** Say something to assistive technology. Safe to call from anywhere, no-op before mount. */
export function announce(text: string): void {
setMessage?.(text);
}
export function Announcer() {
const [message, set] = useState("");
setMessage = (text) => {
// Re-announce an identical message: a region is read when its text CHANGES, so setting
// the same string twice says nothing. The zero-width space makes it a change.
set((prev) => (prev === text ? `${text}` : text));
};
return (
<div
role="status"
aria-live="polite"
aria-atomic="true"
className="sr-only"
>
{message}
</div>
);
}
Mount it next to the <Toaster> in app/layout.tsx, inside <ThemeProvider>:
<ThemeProvider …>
{children}
<Announcer />
<Toaster />
</ThemeProvider>
sr-only, not hidden. display: none removes it from the accessibility tree and nothing is
read. Tailwind's sr-only keeps it rendered and off-screen.forms relies on this split
— see its §The Save button is not a validity light.aria-live="assertive" interrupts whatever is being read. Reserve it for something the user must
hear now, such as a session about to expire; everything else is polite.Scaffold at least one server-action file at lib/server/<domain>.ts so the next developer (or skill) has a referenceable pattern to copy. Pick the domain from the PRD's most-prominent user story (for Notarius: practices.ts; for an e-commerce: orders.ts; for a CRM: contacts.ts).
pnpm add zod
The scaffold must include:
"use server"; directive at the top.ActionResult<T> discriminated union returned by every action — never throw across the server boundary.flattenZod() helper that converts z.ZodError into { message, fieldErrors } for form-friendly responses.revalidatePath(<list-route>) → return { ok: true, data: { id } }.revalidatePath for both list and detail → return.getCurrentTenantId() helper stub that throws "not yet wired — implement after module-add auth runs" — leaves a clear TODO without lying about authorization.A reference implementation lives at references/server-action.template.ts — copy-and-rename. The template is wired to the Drizzle schema produced by module-add db.
Server actions are the load-bearing connection between forms and the database. Without a reference file, every developer invents their own return shape, error handling, and validation pattern. A single scaffolded file pins the convention for the whole project.
Five tiny files that make the difference between "demo-grade scaffold" and "senior fullstack scaffold". Every project gets them — they take ~3 minutes to write and prevent entire categories of production incidents.
Write each file from its template under references/:
| File | Template | Why it matters |
|---|---|---|
app/global-error.tsx | references/global-error.template.tsx | The boundary for an error thrown by the root layout itself, which error.tsx cannot catch: it renders its own <html>/<body>, plain and self-contained. module-add observability adds the report to the tracker. |
app/error.tsx (app/[locale]/error.tsx with i18n routing, inside the intl provider) | references/error.template.tsx | Root error boundary. Without it, a single uncaught render error blanks the whole app to a Next default page that leaks error.message to the user. The template scrubs the message, shows a clean fallback with reset(), and surfaces digest for log lookup. |
app/loading.tsx | references/loading.template.tsx | Streaming-RSC suspense fallback. Without it, navigating to a route that does any async work hangs on a blank page until the server finishes. The template uses shadcn <Skeleton> to render a content-shaped placeholder — a placeholder shape until the route has real data: then size it to the loaded UI with references/skeleton-audit.md (measure, rebuild, re-measure; CLS ≤ 0.05). |
lib/env.ts | references/env.template.ts | Zod-validated environment at boot. Without it, a missing DATABASE_URL only blows up the first time a request hits the DB layer — often in production, never in dev. The template fails fast with a clear message at module-eval time. Import env from this file instead of reading process.env ad hoc. |
lib/queries/<domain>.ts | references/queries.template.ts | Counterpart to lib/server/<domain>.ts. Reads live here (called from RSC), mutations live in lib/server/. Keeps the boundary clean — read-from-anywhere, mutate-only-from-actions. |
next.config.ts | references/next-config.template.ts | Security headers (CSP, X-Frame-Options DENY, X-Content-Type-Options nosniff, Referrer-Policy strict-origin-when-cross-origin, Permissions-Policy minimal, HSTS). Default Next config has none of these. The template ships sane defaults; the user tightens CSP later if they introduce inline scripts. |
These are not optional in dev-flow mode. A scaffold without app/error.tsx is a scaffold that crashes loudly the first time a server action throws. A scaffold without lib/env.ts is a scaffold where missing secrets are discovered in production.
lib/env.ts should be imported by lib/db/index.ts, lib/auth.ts, and any other module that reads env. The module-add db and module-add auth references already produce code that reads process.env.DATABASE_URL — when this skill runs before those, they pick up env.DATABASE_URL automatically; when they run after, do a quick pass on the existing files to swap process.env.X → env.X.next.config.ts may already exist (Next scaffolds it). Merge the security headers block into the existing config — don't overwrite settings the user/scaffold has already chosen.next@latest. Most of 16.3 is zero-config (dev memory, build cache, native Node streams, TS 7 type-checking) and needs no decision. Instant Navigations is opt-in: cacheComponents: true + partialPrefetching: true. For a new project it's a reasonable default to offer — ask once, and if the user says yes, remember that Cache Components turns on navigation validation in dev (validationLevel: 'warning'), which is a feature, not noise. Don't switch an existing app silently: route to the official migration guide. Details in data-fetching/SKILL.md §Instant Navigations.lib/queries/ folder is created empty alongside lib/server/ in Step 4.4. The queries template is dropped in for the same domain as the server action template (e.g., lib/queries/practices.ts next to lib/server/practices.ts).The DESIGN.md §Responsive Behavior (or equivalent prose section) is not optional reading. Every project ships with non-trivial mobile usage; a desktop-only scaffold is a half-shipped scaffold. Yet the failure mode is consistent: skills generate beautiful desktop layouts, then drop responsive concerns to "I'll add lg: modifiers later" — and "later" never happens.
This step pins mobile-first as the writing discipline, not as an afterthought.
For every component you author:
Write the mobile layout first. The base classes — no sm:, md:, lg:, xl: prefix — describe the mobile experience. THEN add desktop modifiers as overrides:
// Right: base = mobile, lg: = desktop override
<div className="grid grid-cols-1 gap-6 lg:grid-cols-3 lg:gap-12">
// Wrong: base = desktop, mobile is afterthought via override
<div className="grid grid-cols-3 gap-12 sm:grid-cols-1 sm:gap-6">
Read the DESIGN.md §Responsive Behavior table and match its breakpoints. Most DESIGN.md files declare 3-4 breakpoints:
Map them to Tailwind:
md: → 768+ (tablet)lg: → 1024+ (desktop)xl: → 1280+ (wide)Don't invent custom breakpoints — Tailwind's defaults align with the typical DESIGN.md scale.
Apply the DESIGN.md's collapsing strategy. A typical DESIGN.md will say things like:
Each of these is a concrete Tailwind class set:
hero h1: text-4xl lg:text-6xl — the theme's --text-* slots, redefined from DESIGN.md (§Typography tokens
below), so "64px" is whatever slot DESIGN.md's display level landed on. Never an arbitrary text-[…] value
or an inline fontSize: the project's design lint rejects both. Fit the headline to two lines at 390 px in the longest
locale (references/i18n-next-intl.md §Headlines in every locale).service grid: grid-cols-1 sm:grid-cols-2 lg:grid-cols-4section padding: py-12 lg:py-32footer columns: collapse to <details> accordion below md: OR stack vertically with grid-cols-1 md:grid-cols-4nav: hide primary links below md:, show hamburger button insteadTouch target minimums (WCAG 2.5.8): every interactive element ≥ 44×44px. Tailwind's h-11 (44px) is the minimum for buttons and tap-friendly icons. Avoid h-9 or h-10 for primary tap targets on mobile.
Hamburger nav for any nav with 4+ primary links. The DESIGN.md typically describes "Mobile Nav: full-screen overlay with primary links stacked vertically" — implement that, don't just hide the links. Use shadcn's Sheet primitive for the slide-in panel.
Mobile-only visual elements: orbital arcs / decorative SVGs / asymmetric layouts often work only at desktop widths. The DESIGN.md will say so explicitly ("Orbital arcs are removed on mobile — they only work with asymmetric placement"). Hide them at small viewports with hidden lg:block.
Before declaring the scaffold done, verify at 375px viewport (iPhone SE / 12 mini width, the conservative lower bound):
If a browser tool is available (Playwright MCP, Chrome MCP, Claude_Preview, etc.):
browser_resize(width: 375, height: 812)
browser_navigate(url: "http://localhost:3000")
browser_take_screenshot()
Then visit /, /showcase, and 1–2 placeholder routes. Measure before you look: run the render probe on
each, in both locales — it reports horizontal overflow with the culprit, headings over two lines, text hidden
under reduced motion, fonts that never loaded, broken images and a sidebar covering the phone:
node <skills>/app-verification/scripts/render_probe.mjs http://localhost:3000/en --widths 1440,390
node <skills>/app-verification/scripts/render_probe.mjs http://localhost:3000/it --widths 1440,390
Fix every FAIL, then spot-check what it cannot judge. A layout-shift finding means a skeleton or a late block
is not the size of what replaces it: references/skeleton-audit.md.
Then spot-check:
headline-lines)If no browser tool is available: state explicitly in the hand-off:
⚠ Mobile verification pending: I couldn't open a browser at 375px to verify the layout. Run
pnpm devand checkhttp://localhost:3000in DevTools mobile emulation (375×812) before considering the scaffold done.
And surface the same warning in the final summary.
Do not declare done from a desktop-only screenshot. "Mobile works" is not the same as "mobile compiles".
grid-cols-1 and add larger breakpoints as overridespy-12 lg:py-24text-4xl lg:text-6xl) and fit two lines at 390 px in every localeh-11 minimum on tappable elements)md: (Sheet primitive)lg: if the design intent is asymmetric placementSkipping any of these = scaffold is desktop-only and the user has to fix it before shipping.
stack.framework in {next, monorepo})Run the script — do not wire it by hand:
python3 scripts/setup_design_lint.py <project-root> # install, wire, measure, record
python3 scripts/setup_design_lint.py <project-root> --check # verify only
It detects the topology (single app at the root; a web+mobile app in apps/*; the shadcn monorepo
with packages/eslint-config + packages/ui), installs @shadcn/lint in the package that owns the
lint config, writes the preset, spreads it into the existing config without replacing it, sets the
lint cap, appends a block to AGENTS.md, and records stack.design_lint = "shadcn-lint". Re-running
changes nothing. On Oxlint (.oxlintrc.json + oxlint ≥ 1.80 at the root, no eslint.config.*) — the
way for a project on TypeScript 7, which @typescript-eslint/parser cannot read — the same rules load as
Oxlint JS plugins, components.json is optional and the cap goes on the oxlint command of a chained
lint script (references/design-system-lint.md §Oxlint).
Golden rule 3 is in the preset and at write time. The preset carries design/no-handmade-ui (always
error: raw elements, hand-written roles, classes that redraw a card/badge/alert/separator, each message
naming the primitive from the library's mapping) and design/no-card-in-card (on unless DESIGN.md lets
cards nest). Then the script calls scripts/setup_primitives_guard.py, which installs the write-time
guard: scripts/guard/primitives-guard.mjs + eslint.guard.mjs (copied from assets/guard/),
scripts/guard/guard.json, five hooks merged into .claude/settings.json (PreToolUse on
Write|Edit|MultiEdit; PreToolUse + PostToolUse on Bash, which check the files a shell command touched
right after it; Stop, SubagentStop), the «UI: only the primitives» section in AGENTS.md, and
stack.primitives_guard = "installed". A write that adds hand-made UI is refused with the primitive to use;
only added findings count, so converting a legacy file is never blocked. --check fails if the rule or the
guard is missing. Details and evidence: references/design-system-lint.md §Hand-made UI. Every rule it encodes was hit on a real project first
(references/design-system-lint.md): shadows allowed by exact name from @theme (never shadow-*),
the vendored component directory exempt except for raw colours and inline styles, chart.tsx and the
showcase specimen exempt, carousel.tsx / hooks/use-mobile.ts / sidebar.tsx overridden as shadcn
delivers them, and eslint-plugin-only-warn answered with a --max-warnings cap.
On a fresh scaffold the rules are error and the script fails — listing them — if the
scaffold itself produced design-lint findings or other lint errors. Fix those; never cap them. On an
existing app it uses warn and caps at today's count.
Then set up registry intake, in the same step, because it records the lint cap this step just set as the baseline that imported components may not raise:
python3 <skills>/registry-intake/scripts/registry_intake.py setup <project-root>
It writes registry-lock.json, the PreToolUse hook in .claude/settings.json and an AGENTS.md
block, and records stack.registry_intake = "enforced". From here on a component from any registry
other than shadcn's own (pdfcn, emailcn, ogimagecn, mcpcn…) goes through review → approve → install
— see registry-intake. With stack.ui = "coss", @coss is recorded as the live UI registry.
In a monorepo, monorepo-bootstrap runs this at its Step 8, after pnpm install --recursive —
here in Step 4 the workspace is not installed yet. Skip it when invoked from monorepo-bootstrap.
/showcase page (mandatory in dev-flow mode)It is not optional, not "nice to have", not skippable for time. The reason: without /showcase the user has no way to visually verify that the DESIGN.md tokens landed correctly in the running app. Every primitive that shadcn add --all installed is dark code unless /showcase proves it's themed. Skipping /showcase and declaring the scaffold "done" is a contract violation.
The only valid skip is theme-only mode, where the user explicitly opted out of any new pages — in that case the verification is a code review of the diff, not a visual check.
In full-scaffold mode (the default): generate /showcase (or /design-system).
The /showcase page is not a free-form gallery. It is a fixed sequence of 9 sections. Skipping a section, reordering them, or replacing them with shadcn primitives stripped of context is a contract violation.
The structural template is non-negotiable. Every showcase across every project must use the same skeleton — only the brand-specific contents inside change. See references/showcase-template.md for the full HTML pattern (vendored from airbnb-clone, aetherfield, devops-graphite, notarius-crm — four projects that converge on the same shape).
The /showcase page is wrapped in a site-shell, NOT in the app's internal AppShell:
export default function Showcase() {
return (
<>
<SiteTopNav />
<main className="bg-surface text-on-surface">
{ 9 sections here }
</main>
<WordmarkFooter />
</>
);
}
The site-shell has two components, both mandatory and both written by this skill alongside /showcase:
<SiteTopNav> at components/shared/site/site-top-nav.tsx:
mx-auto max-w-[1280px] px-6 lg:px-12 h-14 flex items-center gap-8.size-7 rounded-md bg-primary text-surface) with the project initial + project name in text-sm font-semibold./, /showcase, plus 2–4 product routes), text-sm text-on-surface-variant hover:text-on-surface.<Button> named for what it does.getTranslations("SiteNav"), en + it — golden rule 2) and Link comes from
@/i18n/navigation; the project's name is a brand constant, not a message. Start from
references/site-top-nav.template.tsx, which shows the keys for both locales.bg-surface with border-b border-outline.<SiteFooter> at components/shared/site/site-footer.tsx (or wordmark-footer.tsx if the wordmark variant is chosen — see below):
The footer must be DESIGN.md-faithful. Hardcoding the same wordmark template for every project is a contract violation — Mastercard-style design systems describe a 4-column link grid with a conversational H2; minimal portfolio designs may want a one-line footer; editorial brands use the giant wordmark. Read the DESIGN.md before writing the footer.
Look in DESIGN.md for an explicit footer specification. The likely sections are §4 Components → Footer, §Layout, §Footer (top-level), or a components.footer block in YAML frontmatter. If found, generate the footer described there — colors, padding, structure, copy patterns. The DESIGN.md is the spec.
If the DESIGN.md describes a footer with named columns + conversational H2 (Mastercard pattern, common in institutional brands): generate a SiteFooter matching the spec — typically:
If the DESIGN.md is silent on the footer, OR explicitly describes a wordmark/marquee footer, default to the WordmarkFooter pattern below. Editorial / portfolio / brand-focused projects (Aetherfield, Notarius, Wisely-style) live here — a giant lowercase project name is the footer's identity.
End with a legal row whatever the pattern: © {year} {name}, the legal links and any regional note
(hosting region, VAT number), as one translated message in text-xs text-on-surface-variant. No generator
signature. This is the client's page; that the scaffold came from DESIGN.md is recorded in
_design-md-mapping.json and visible on /showcase, which are ours. Corrected 2026-10-19: this step used to
demand a monospace "Generated by design-md-to-app" row on every footer — a watermark on a client's site, found
live on two projects.
When DESIGN.md is silent or asks for a wordmark, write wordmark-footer.tsx:
bg-background-primary or equivalent tinted surface.mx-auto max-w-[1280px] px-6 lg:px-12 pt-16 pb-10 space-y-10.text-7xl sm:text-8xl lg:text-9xl), color = primary, leading-none, tracking-tighter, aria-hidden (the name is already in the nav). It must span enough of the container width to BE the footer's identity, not garnish it.getTranslations("SiteFooter")); start from references/wordmark-footer.template.tsx.Visual reference: see Aetherfield's giant "aetherfield" lime wordmark and Notarius's purple "notarius" wordmark on lavender — both sized to fill the container, both unmistakably the project's signature.
Hardcoding wordmark for every project produces an identity mismatch on Mastercard-style designs (warm cream, 4-column institutional footer with "We're always here when you need us"). The wordmark is great for editorial brands; it's wrong for institutional / payments-network / corporate-brand designs. Always start from the DESIGN.md.
When in doubt: which specific brands does the DESIGN.md prose evoke? Aetherfield-style (warm/editorial/portfolio) → wordmark fits. Mastercard/IBM/Stripe/Apple-style (institutional/utility) → 4-column link grid fits. The skill's job is to read that signal and produce the right one.
Whatever footer pattern is chosen, the site-shell rule stands: every page wrapped in <SiteTopNav> + <SiteFooter> (or <WordmarkFooter>). A naked <main> is a contract violation regardless.
The site-shell is what makes the showcase a complete document about the design system. Without it the page reads as a free-floating gallery; with it the page reads as a real branded surface that proves the system works in shipping context.
<section className="border-b border-outline">
<div className="mx-auto max-w-[1280px] px-6 lg:px-12 py-20 space-y-10">
<div className="space-y-3">
<Eyebrow>{ section name uppercase }</Eyebrow>
<h2 className="text-3xl">
{ brand-voice tagline, ends with period }
</h2>
<p className="text-base text-on-surface-variant">
{ 1–2 sentence description with token references in <code> chips }
</p>
</div>
{ section content }
</div>
</section>
⚠️ The heading uses a token class, not style={{ fontSize }}, and this skeleton used to do the
opposite. That mattered: shadcn-mapping.md §Typography already said to emit each level as
the type scale as theme tokens in @theme inline, but two places in this skill taught opposite things and the one
with the copy-pasteable code won. A real project shipped zero --text-* tokens and 531
text-[…] literals — its type scale lived in DESIGN.md and in class strings, never in the theme,
so changing the display size means finding 531 literals. Emit the tokens, then consume them.
The type specimen rows are the one exception, and they stay inline: a specimen renders the literal spec because it is demonstrating the scale, not consuming it — the same reason a palette swatch renders a literal colour. Everything else on the page consumes tokens like any other screen.
Three rules that distinguish a real showcase from a generic one:
border-b. The whole page is a vertical stack of bordered bands. Not a single container with everything inside.1. Header — standalone, NOT wrapped in AppShell.
Same wrapper, but py-20 and the h1 is bigger (72px / 80px / -0.02em / 600). The Eyebrow says <PROJECT NAME> design system (e.g., Notarius design system, Aetherfield design system). The h1 is a brand-voice tagline ending with a period: "Quietly opinionated CRM for notary studios." / "Aetherfield design tokens." / "Production: Healthy". Below: 1-paragraph description with <code> chips on .workflow/DESIGN.md and design-md-to-app. Last: a back-link to /.
2. Colors — "color-as-card" with 3 lines of info.
grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-4.h-32 rounded-md p-4 flex flex-col justify-between. The swatch IS the background.font-mono text-[12px] opacity-80text-[14px] font-semiboldtext-[12px] opacity-80) — e.g., "Brand purple — primary CTAs, active sidebar item"3. Typography — ladder with spec-in-mono + DOMAIN-CONTEXTUAL samples.
[140px_240px_1fr] with divide-y divide-outline.text-[12px] tracking-wide uppercase font-mono text-on-surface-variant — e.g., "Inter · 32 / 40 · 600 · -0.01em"."Compravendita immobile via Roma 12", "P.IVA 01234567890 · 3 pratiche aperte""Hosted by Marco", "$280 / night · 4.81 · 124 reviews""Production: Healthy", "Last deployment 14 minutes ago — 240 tests passed"4. Buttons — flex-wrap with DOMAIN-SPECIFIC copy, NOT card-per-variant.
<div className="flex flex-wrap gap-4 items-center">.<Button> has copy that comes from the actual product, not "Default" / "Secondary" / "Click me":
"Nuova pratica", "Filtra pratiche", "Esporta CSV", "Annulla pratica", "Termini di servizio""Reserve", "Become a host", "View all wishlists", "Cancel reservation""Deploy to production", "Cancel", "Logs", "View commit", "Roll back"5. Cards & containers — product-level blocks that prove the system scales.
sm:grid-cols-2 lg:grid-cols-3 gap-6.bg-background-primary, for Aetherfield bg-aether-surface-soft) — used for callouts, pull-quotes, primary-emphasis information.bg-surface-bright, for designs with multiple surfaces) — used for nested content or high-importance summaries.6. Inputs & forms — labeled with uppercase mono, with one error state.
sm:grid-cols-2 gap-6 max-w-2xl.text-[12px] font-medium tracking-wide uppercase text-on-surface-variant.rounded-sm on most systems = 4px)."Bianchi srl", "VRDMRA80…", "api-gateway", "us-east-1").7. Badges — status pills that map 1:1 to product states.
<div className="flex flex-wrap gap-3 items-center">.bg-success-weak text-success for Firmata; bg-alert-weak text-alert for In scadenza; bg-error-weak text-error for Errore validazione; tinted-primary for In corso; outline for Bozza; on-surface for Archiviata.Guest Favorite, New, Superhost.healthy, building, degraded.8. Radius scale + Spacing scale (two sub-sections).
flex flex-wrap gap-6 of size-24 squares with each radius applied + label.<ul className="space-y-3"> with rows [name] [px] [horizontal bar]. The bar is h-3 bg-on-surface rounded-sm and width = the actual spacing token. Visualizes the rhythm.9. Do's and Don'ts — VERBATIM from the DESIGN.md.
grid sm:grid-cols-2 gap-6, both bg-surface-bright.DO in text-on-surface, list of 3–4 do-rules from ## Do's and Don'ts in DESIGN.md.DON'T in text-on-surface, list of 3–4 don't-rules.<strong className="text-on-surface"> to highlight key terms (color names, tokens) inside the prose.<footer className="border-t border-outline">
<div className="mx-auto max-w-[1280px] px-6 lg:px-12 py-10 text-center font-mono text-[12px] tracking-wide uppercase text-on-surface-variant">
Generated from .workflow/DESIGN.md · See registry.json + .workflow/screenshots
</div>
</footer>
/showcase in the same AppShell used by the rest of the app. The showcase is a document about the system, not a route inside the app./showcase WITHOUT a site-shell (no SiteTopNav, no SiteFooter of any kind). The page must be branded top-and-bottom. A naked <main> is a contract violation._design-md-mapping.json; check.py counts it as generator-watermark.border-b full-width wrapper. The whole page is a vertical stack of bordered bands.[icon-sized chip] [name + hex outside]. Use color-as-card with 3 lines of info.Then start the dev server (pnpm dev / npm run dev) and report the URL.
Token verification — two greps, before you look at anything. A screenshot cannot tell a token from a literal that happens to render the same pixel, which is exactly how a scale goes missing without anyone noticing:
grep -cE '^\s*--text-(xs|sm|base|lg|[0-9]?xl):' <ui>/globals.css # 0: the scale never reached the theme
grep -rn 'text-\[' app components | grep -v showcase # each one is a consumer retyping the scale
The first must be the number of levels in DESIGN.md. The second must be empty outside the type
specimen. A project that shipped without this check ended up with zero tokens and 531 literals;
both greps would have caught it on day one. If DESIGN.md defines a level the Tailwind scale already
sits on a slot, the slot carries it; every level lands on its nearest slot, never on a new name —
grep -E '^\s*--text-[a-z0-9-]+:' <ui>/globals.css | grep -vE -- '--text-(xs|sm|base|lg|[0-9]?xl)(--|:)' — a name that is not a slot — must print nothing.
Then run the design-system lint. The greps catch drift once; @shadcn/lint catches it every time
an agent writes a class, and names the fix: "rounded-full is not allowed on <Button>: <Button>
owns its shape. Use a variant: default, outline, secondary, ghost, destructive, link." It is installed
in Step 4.10; here pnpm lint must end with 0 errors. Read the first line of the output
before the rest — a flood of no-unknown-classes warnings means a theme @import did not resolve,
not that the primitives are wrong.
Visual verification — best-effort obbligatorio. The work is not done until you've either looked at it or explicitly told the user you couldn't:
Scan the available tools for a browser-control surface. The common names are mcp__plugin_playwright_playwright__*, browse, gstack, mcp__Claude_Preview__*, mcp__Claude_in_Chrome__*, connect-chrome. Any of these counts.
If at least one is available: navigate to /showcase (and the equivalent dark/light counterpart), take a screenshot, and compare against the DESIGN.md. Spot-check 3 colors, 2 typography levels, and 1 component hover state — on the typography, check the class in the DOM as well as the rendered size, because text-[17px] and text-base look identical in a screenshot and only one of them survives a change to the scale. If anything is off, fix it and re-shoot. Don't declare done from a single broken screenshot.
If none is available: do not silently claim done. State explicitly in your hand-off message:
⚠ Verifica manuale richiesta: nessun browser tool è disponibile in questa sessione, quindi non posso confermare visivamente che
/showcaserispecchi il DESIGN.md. Apri http://localhost:3000/showcase e verifica i colori e la tipografia prima di considerare il task chiuso.
…and surface the same warning in the final summary so the user can't miss it.
Do not mark the task complete based on "code compiles" or "TypeScript passes" — the design must visibly match (or be explicitly flagged as unverified).
Dev-flow mode: before reporting, update <root>/.workflow/meta.json:
python3 <dev-flow>/scripts/update_meta.py <root> set-phase scaffolded. That is where the
design-lint gate runs — it refuses scaffolded until setup_design_lint.py --check passes or an
opt-out is recorded (stack.design_lint = "none" plus stack_config.design_lint_reason) — and the
registry-intake gate, which wants registry_intake.py check to pass (or stack.registry_intake = "none" with stack_config.registry_intake_reason). Writing
phase by hand skips the gate, and show_state.py will flag the project on every read after.updated_at to ISO-8601 UTC nowhistory entry:
{
"skill": "design-md-to-app",
"ran_at": "<now>",
"inputs": {"design_md": ".workflow/DESIGN.md", "stack": {"framework": "...", "ui": "..."}},
"outputs": ["package.json", "app/", "components/ui/", "lib/utils.ts", "registry.json"],
"phase_before": "<prev>",
"phase_after": "scaffolded"
}
stack.framework / stack.ui were null and the user picked them now, persist them in stack.Do this after confirming the build succeeded — don't bump phase on a broken scaffold.
Then summarize for the user:
STYLE_NOTES.md and why those rules couldn't be fully encoded,screenshot-to-page if .workflow/screenshots/ has unmapped images; module-add to wire auth/db/etc.).If the user is going to keep building, point them at the showcase as their living reference.
A DESIGN.md typically describes a single visual mode (often dark, sometimes light, rarely both). By default the skill generates both modes so the resulting app supports prefers-color-scheme / a theme toggle out of the box — unless the spec explicitly opts out (see below).
Before generating both modes, scan the DESIGN.md for an explicit single-mode declaration. If any section (typically §Known Gaps, §Notes, §Themes, or a body paragraph) says any of:
…respect it. Generate only the declared mode:
:root only. Delete the .dark block the init command wrote, and remove the prefers-color-scheme media query if any. Don't write a <ThemeProvider> toggle.createTheme with a single palette.mode, not extendTheme with both schemes. Skip <CssVarsProvider> in favor of plain <ThemeProvider>._design-md-mapping.json under modes_skipped with the exact quote from the DESIGN.md as reason. Repeat in STYLE_NOTES.md so future agents don't try to "fix" the missing mode.Forcing a mode the spec rejects is worse than missing one the spec wants — derived dark modes from a spec written for light-only usually look broken (e.g. Airbnb's photography-first aesthetic doesn't translate to dark surfaces).
colors.background / colors.surface. If the L (lightness) channel is below ~25%, treat the source as dark; above ~75% as light; otherwise ask the user.:root for shadcn, the primary theme for MUI).surface*, background, card, popover, muted): invert L (e.g. 9% → 96%, 12% → 92%, 14% → 88%) while keeping H and S unchanged.on-surface, on-background, foreground, muted-foreground): invert L correspondingly so the contrast against the inverted surface is preserved.primary, secondary, tertiary, accent, error, destructive, ring): keep H, S, and L unchanged across both modes. A well-designed M3 brand value is already chosen to read on both light and dark surfaces; flipping its L destroys the visual identity (a vivid amber becomes navy). The contrast comes from the *-foreground partners, which do flip.primary-foreground, on-primary, secondary-foreground, etc.): typically these have light brand → dark on-color and dark brand → light on-color baked into M3. If the spec defines only one mode, derive the opposite by flipping the on-color's L and leaving brand H/S/L alone.border, input, outline, outline-variant): shift L towards the opposite mode's neutral (dark border at 22% L → light border at 88% L, same H/S).surface-tint, *-fixed, *-fixed-dim): treat as brand-ish — keep H/S/L unless the prose argues otherwise..dark / .light selector for shadcn, second createTheme call merged with the dark counterpart for MUI)._design-md-mapping.json and STYLE_NOTES.md: explicitly state which mode is canonical and that the other was auto-derived from it. The user may want to hand-tune the derived mode later.The canonical mode is the source of truth. If the user later edits DESIGN.md, the derived mode is regenerated.
typography.fontFamily values fall into three buckets — handle each:
Google Fonts (Inter, Space Grotesk, Public Sans, Manrope, etc.):
next/font/google in app/layout.tsx, expose as CSS variable.<link> in index.html / root.tsx <Links>. Don't fight next/font here — it's Next-only.System fallbacks (system-ui, ui-sans-serif, generic stacks): pass through as-is. No loading needed.
Custom / proprietary / non-Google fonts (Airbnb Cereal VF, Circular Std, Söhne, F37 Glare, brand-licensed fonts): the silent-substitute path (Söhne → Inter, Cereal → Manrope) is forbidden. The brand identity is downstream of typography — quietly swapping a paid foundry font for an open one corrupts the perception of the design system in ways the user can't easily undo later. Use the three-way branch below.
When the parser surfaces a custom/proprietary font name that's not a Google Font and not a system stack:
Branch A — License owned (files present)
<project-root>/public/fonts/<family>/ (any of .woff2, .woff, .ttf, .otf).next/font/local (Next) or @font-face (Vite/Remix). Done — no fallback needed._design-md-mapping.json under fonts as { name, source: "self-hosted", path: "public/fonts/<family>" }.Branch B — Pick alternative (with explicit user choice) If no files are present, stop and ask with this exact pattern (Italian or English, match the user's language):
Il DESIGN.md richiede
Söhne(Klim Type Foundry, font commerciale). Non ho i file di licenza. Ho due alternative open-source visivamente vicine — vuoi vederle?Opzione 1 — Manrope (Google Fonts): geometric sans, x-height un filo più alta di Söhne, terminali leggermente più morbidi. Più "tech" che "editorial".
Opzione 2 — Inter (Google Fonts): neo-grotesque, terminali più squadrati, ottimizzato per UI ad alta densità. Più "neutrale".
Se li vuoi confrontare, posso renderizzare entrambe le opzioni nel
/showcasee farti scegliere visualmente. Oppure vuoi cercare la licenza ora? L'opzione fallback è sempresystem-ui.
Critical: list two alternatives with concrete pros/cons grounded in the typographic difference (x-height, terminals, weight axis, optical sizing, mood). Don't list five — paralyzes the user. Don't list one — feels like a forced choice.
For each known proprietary family the skill has seen before, keep the recommendation pair stable:
| Original | Alt 1 (closer) | Alt 2 (different mood) |
|---|---|---|
| Söhne | Manrope | Inter |
| Circular Std | Public Sans | Manrope |
| Cereal VF (Airbnb) | Manrope | Plus Jakarta Sans |
| F37 Glare | Fraunces | Playfair Display |
| Söhne Mono | JetBrains Mono | IBM Plex Mono |
| Roobert | Geist | Inter |
If the family isn't in the table: ask the user to name two alternatives they trust, OR look up VFonts/Fontesk for "alternatives to " and propose the top two from there.
Branch C — Defer
If the user says "I'll think about it" or doesn't respond, scaffold with system-ui fallback chain and:
STYLE_NOTES.md:
⚠ Font decision pending: DESIGN.md specifies
<family>. The scaffold is currently rendering withsystem-uifallback. Choose a final font (license / alternative / different) before shipping — the design will look different from the source until then.
{ name, source: "deferred", fallback: "system-ui" } in _design-md-mapping.json.The font is the most visible piece of the design system. Silently swapping it ships a project that looks like it has the right brand but doesn't. The user only notices when they show it to a client, and at that point fixing it requires re-installing the alt font everywhere, possibly different weight axes, possibly different metrics — hours of rework that 30 seconds of asking would have prevented.
This is also where AI tools earn the most distrust: a tool that "did its best" and silently degraded the quality is harder to live with than a tool that paused and asked.
Load only the font weights the DESIGN.md declares. Read the typography table or prose: if the spec says "weights observed: 500, 600, 700. No 400-regular", load exactly those weights. Don't pre-load 400 "for safety" — the design system explicitly forbade it, and keeping the option around lets code accidentally render in the wrong weight. Smaller payloads are a free side effect.
In every case, declare a fallback chain in CSS so the layout doesn't break before fonts load:
font-family: var(--font-display), Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
{colors.primary}) must be resolved to literal values at write time. The theme files should hold concrete values — re-resolving at runtime is out of scope.components block (e.g. button-primary, button-primary-hover) are sibling keys in the spec, not nested. Group them per component when generating override code._design-md-mapping.json under fallbacks.STYLE_NOTES.md so nothing is lost.STYLE_NOTES.md and for inferring qualitative rules. Never try to parse it like YAML.npx create-next-app non-interactively without confirming the directory and package manager with the user.theme.ts / globals.css./showcase generation, next dev, dependency installs, or create-next-app in theme-only mode. The point of that mode is a small, reviewable diff.When scaffolding a Next.js project, the dev-flow set ships four sibling discipline skills that the orchestrator loads automatically alongside design-md-to-app:
forms — lib/forms/ shared toolkit (useEditForm, useCreateForm, FormProvider, FormField, FormActions, mapFormError) on top of either TanStack Form + Zod (default) or react-hook-form + Zod (opt-in via meta.json#stack.forms). Consumer code is identical; backend swap is invisible. Bans useState for field values, auto-save, inline toast, raw useForm.data-fetching — Read in async Server Components, mutate via Server Actions + revalidatePath/revalidateTag. Bans useEffect+fetch / useState+useEffect+getX in Client Components. Walks the migration ladder: Server Component → URL searchParams → Promise<T> + use() + <Suspense> → Route Handler + SWR (last resort).state-discipline — Eight-rung ladder for "should I useState here?". Derive, URL, lift, query lib, event handler, key to reset, useMountEffect for one-time external sync, then useState. Bans bare useEffect (lint-enforced).transitions — One tokenized motion system (lib/motion/): cheapest-tier-first (Tailwind + tw-animate-css → CSS keyframes → View Transitions → Motion), always with a prefers-reduced-motion fallback, tokens instead of magic-number durations/easings. Sits above module-add motion.The four are installed by ./install.sh together with design-md-to-app — no extra step. Their source lives in this repo at forms/, data-fetching/, state-discipline/, transitions/. The first three are adapted (with attribution) from lusentis/next-skills; transitions is our own (inspired by transitions.dev). All are tailored to the dev-flow contract (meta.json#stack reads + history append + refusal on framework/version mismatch).
Earlier drafts of this skill recommended installing the originals via npx skills add lusentis/next-skills … — that recommendation is superseded. Use the in-tree versions.
This skill scaffolds Next.js 16 with App Router as the canonical default. It refuses to:
pages/ directory) projects.If the user explicitly requests Pages Router or older Next, the skill stops and explains: "The dev-flow web skills target Next.js 16 App Router. For Pages Router, this skill does not apply — you'll need a different setup."
Write meta.json#stack.nextjs_version = "16" at scaffold time.
Read meta.json#stack.forms:
"tanstack-form" (default): scaffold lib/forms/ with the TanStack Form toolkit (useEditForm, useCreateForm, FormProvider, FormField, FormActions, mapFormError). Install deps: @tanstack/react-form, zod >= 4."react-hook-form" (opt-in): scaffold lib/forms/ with the RHF equivalent (same hook + component names; useForm + useFormContext + Controller from react-hook-form underneath, plus the same FormField / FormActions / mapFormError surface so consumers don't see a difference). Install deps: react-hook-form, @hookform/resolvers, zod >= 4.Both share: explicit Save button gated by canSave (isDirty && !isSubmitting) for edit, or !isSubmitting alone for create — never on isValid, because disabling Save on an invalid form deletes the failed submit, which is the event that announces the error to a screen reader (forms §The Save button is not a validity light). Zod schema as validator, error mapping via mapFormError, no auto-save, no save-on-blur. The forms sibling skill (in-tree) owns the full toolkit + audit recipe — design-md-to-app only scaffolds the initial wiring at project bootstrap; subsequent form work routes through forms.
When null, ask the user which to install — default to TanStack Form.
assets/STYLE_NOTES.skeleton.md (opens in a new tab)assets/guard/eslint.guard.mjs (opens in a new tab)assets/guard/oxlint.guard.mjs (opens in a new tab)assets/guard/primitives-guard.mjs (opens in a new tab)assets/lint/lint-changed.mjs (opens in a new tab)assets/lint/lint-debt.mjs (opens in a new tab)assets/mui/showcase.skeleton.tsx (opens in a new tab)assets/mui/theme.skeleton.ts (opens in a new tab)assets/shadcn/globals.css.skeleton (opens in a new tab)assets/shadcn/showcase.skeleton.tsx (opens in a new tab)assets/shadcn/tailwind.config.skeleton.ts (opens in a new tab)assets/showcase/README.md (opens in a new tab)assets/showcase/color-pair.tsx (opens in a new tab)assets/showcase/preview-states.css (opens in a new tab)assets/showcase/state-matrix.tsx (opens in a new tab)assets/ui-sdk-layers.svg (opens in a new tab)evals/evals.json (opens in a new tab)references/anti-slop-fallbacks.md (opens in a new tab)references/audio-audiocn.md (opens in a new tab)references/base-ui-mapping.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub lukedj78/dev-flow --plugin dev-flowOther plugins' skills for the same job
57 skills in this plugin
/animated-iconsAdd a Motion-animated icon to a Next.js app from a shadcn registry instead of hand-animating an SVG. Two registries, picked from the project's icon set: **heroicons-animated** (316 icons, `shadcn add @heroicons-animated/<name>`) and **hugeicons-animated** (165 icons, `shadcn add @hugeicons-animated/<name>`, which also installs a shared `lib/use-icon-animation.ts`). Both MIT, both on the `motion` runtime, both copied into your repo as source. This skill owns the install plus the two things the raw components lack: a `prefers-reduced-motion` guard and timing aligned to the project motion tokens (`lib/motion/`). Use when the user says "animated icon", "animate this icon", "make the bell/heart/menu icon animate on hover", "aggiungi un'icona animata", or wants an icon micro-interaction. Refuses outside Next.js web — for React Native use `rn-animations-gestures`. Not for: static icons, a whole motion system (`transitions`), or installing the runtime itself (`module-add motion`)./app-securityCheck whether an app's own code can be attacked before it ships — vulnerable dependencies, secrets in the code and in git history, Next.js authorization gaps (Server Actions and route handlers without a session check, queries by id with no owner filter — IDOR), data over-exposure, secrets in public env vars, raw SQL — then read the flagged code against an OWASP checklist, with an opt-in dynamic level (Strix) that proves exploits against the app running locally. The fifth pre-deploy gate, beside compliance-audit, vercel-doctor, shadscan and launch-audit; reports and routes, never blocks. Triggers: "security review", "è sicura l'app?", "controllo di sicurezza prima del deploy", "IDOR", "secrets in the repo", "pentest". Not for: GDPR and legal (compliance-audit), UI quality (shadscan), cost (vercel-doctor), launch readiness (launch-audit), a review of one branch diff (Claude Code's /security-review), third-party registry code (registry-intake).