Communityコーディング&開発github.com

craft-web-ui

Execute, audit, and refactor production Web UIs to 2026 unicorn-grade craft across Vue/Nuxt (Nuxt UI v4, Reka UI) and React/Next.js (shadcn/ui, Radix UI, Base UI, HeroUI/NextUI, React Aria) with Tailwind CSS v4 and Motion. Enforces 100% headless componentization (zero raw native form leaks), accessible focus-visible rings, shared-layout spring indicators, SSR-safe micro-motion, recessed workspace shells, cohesive data panels, and single-skeleton multi-theme governance. Activate when building dashboards, SaaS workbenches, admin consoles, or fixing "almost implemented" AI frontend slop.

craft-web-ui とは?

craft-web-ui is a Claude Code agent skill that execute, audit, and refactor production Web UIs to 2026 unicorn-grade craft across Vue/Nuxt (Nuxt UI v4, Reka UI) and React/Next.js (shadcn/ui, Radix UI, Base UI, HeroUI/NextUI, React Aria) with Tailwind CSS v4 and Motion. Enforces 100% headless componentization (zero raw native form leaks), accessible focus-visible rings, shared-layout spring indicators, SSR-safe micro-motion, recessed workspace shells, cohesive data panels, and single-skeleton multi-theme governance. Activate when building dashboards, SaaS workbenches, admin consoles, or fixing "almost implemented" AI frontend slop.

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Nebutra/craft-web-ui/tree/HEAD

Installed? Explore more コーディング&開発 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

Craft Web UI

Core Principle

Specs in. Craft out.

Even when given thorough Design System prompts naming tokens, component libraries, accessibility, and modern references (Linear, Vercel/Geist, Raycast, Nuxt UI, shadcn/ui), AI coding agents routinely fall into Visual Mimicry: writing hand-rolled CSS classes around raw <select>, <input type="checkbox">, and <table> elements to approximate a screenshot instead of wiring the real headless component runtime, portal tree, variant engine, and spatial physics.

This skill closes the gap between design intent and shipped frontend code. It does not impose a fixed brand palette or product domain; instead, it enforces non-negotiable engineering craft across public unicorn component ecosystems.


Composition with Upstream Design Skills

craft-web-ui is the production frontend execution & governance layer. Support three explicit upstream modes without duplicating upstream responsibilities:

ModeConditionBehavior
ConsumeRepository or sibling generate-design-system / generate-brand-vi deliverables already existConsume approved DTCG tokens, DESIGN.md, and brand assets directly; map them into semantic CSS variables / Tailwind v4 @theme and headless component variants.
ComposeUser requests full brand identity creation or formal cross-platform Design System specification firstResolve and run installed generate-brand-vi / generate-design-system first, then execute production Web UI via craft-web-ui.
StandaloneBuilding or refactoring a web app directly without formal upstream specsEstablish clean 3-tier CSS tokens (Primitive -> Semantic -> Component) on a 4px spacing grid and 4/6/8/12px radius scale, then execute all 7 gates below.

The 7-Gate Closed-Loop Workflow

Gate 1 — Reconnoiter the Stack & Cascade Before Writing UI

  • Run node scripts/scan_ui_stack.mjs <project-root> first when an existing repository is present.
  • Identify the exact framework (Nuxt 4, Next.js App Router, Vite + Vue 3, Vite + React 19), installed headless UI kit (@nuxt/ui + reka-ui, shadcn/ui + @radix-ui/* or @base-ui-components/react, @heroui/react + react-aria), table engine (@tanstack/vue-table / @tanstack/react-table), motion library (motion-v / motion/react), CSS version (Tailwind v4 vs v3), and theme controller (@nuxtjs/color-mode / next-themes).
  • Quarantine Cascade & Theme Hazards Immediately:
    • In Tailwind CSS v4, native CSS Cascade Layers mean any unlayered legacy rule (.btn { display: inline-flex }, global body overrides) beats @layer utilities (hidden, md:hidden). Move custom rules into @layer components, scope them per component, or delete legacy stylesheets.
    • Never mix @media (prefers-color-scheme: dark) CSS variable blocks with class-driven dark mode (html.dark). Bind all dark tokens to a single root selector controlled by the theme provider.
    • Restart the dev server whenever adding framework UI modules (@nuxt/ui, @tailwindcss/vite) so virtual theme templates compile cleanly.

Gate 2 — Wire Root Providers & Global Variant Physics Once

  • Mount Root Providers:
    • Nuxt UI v4: Wrap app.vue in <UApp :toaster="{ position: 'bottom-right' }"> so Reka UI portals, tooltips, modals, and toasts share one context.
    • React / Next.js: Mount ThemeProvider (attribute="class"), TooltipProvider, and Toaster (sonner) in root layout.tsx.
  • Configure Variants Centrally, Not Per Page:
    • Define tactile press (active:scale-[0.98]), precision easing (cubic-bezier(0.23, 1, 0.32, 1)), table cell density, and popover/modal elevation once in app.config.ts (Tailwind Variants) or components/ui/* (CVA).
    • Read references/stack-recipes.md for exact Vue/Nuxt and React/Next.js configurations.

Gate 3 — Enforce 100% Headless Componentization & Sub-Control Hygiene

  • Hard Invariant (Outer Tags): Outside components/ui/* (or components/skin/* primitive wrappers), business pages, views, and modals MUST contain zero raw <select>, <textarea>, <input type="checkbox">, <input type="radio">, or hand-rolled fixed inset-0 modal backdrops.
  • Hard Invariant (Residual Inner Sub-Control Chrome): Switching to <UTextarea>, <UInput>, or shadcn/ui <Textarea> / <Input> is necessary but not sufficient—component wrappers still render underlying HTML elements whose browser-native pseudo-controls leak unless explicitly neutralized:
    • Textarea Corner Resize Gripper (//): Browsers default <textarea> to resize: both (and many wrappers omit resize-none unless autoresize is passed), painting a 1990s diagonal // grabber right across rounded bottom-right corners and letting users drag-break modal widths. Always enforce resize-none (resize: none + textarea::-webkit-resizer { display: none }) paired with autoresize (maxrows / field-sizing: content).
    • Number Spinbuttons & Search Cancel Icons: Use headless NumberField (UInputNumber / Reka UI / Base UI / React Aria) or strip input[type="number"]::-webkit-inner-spin-button (appearance: textfield + tabular-nums) and input[type="search"]::-webkit-search-cancel-button globally in @layer base.
    • Autofill & Scrollbar Color-Scheme: Neutralize :-webkit-autofill yellow/blue background flashes and declare color-scheme: light / color-scheme: dark on :root / .dark so native scrollbars and carets match the active surface.
  • Icon Discipline: Standardize on one vector icon set (Lucide at 16px / 20px, uniform stroke width). Never use Emoji as production UI icons, and never write a literal "+ " label prefix when a leading plus icon prop is already passed (which renders + + Add).

Gate 4 — Engineer Focus Rings & Shared-Layout Active Indicators

  • Pointer vs. Keyboard Separation (WCAG 2.2 AA):
    • Every interactive button, tab, and navigation row must use outline-none focus-visible:ring-2 focus-visible:ring-primary/50 (or focus-visible:ring-ring/50).
    • Never style :focus (focus:ring-*) directly—mouse clicks must never leave a lingering focus box.
  • Kill Static 2px Side-Border Boxes:
    • Never mark active sidebar, settings rail, or tree items with box-shadow: inset 2px 0 0 or border-l-2.
    • Render a shared-layout spring gliding pill (layoutId in motion/react or motion-v) behind the active item (rounded-md bg-elevated ring-1 ring-default shadow-2xs) paired with semantic icon tinting (text-primary).
    • Use headless TabsIndicator (UTabs pill / link or Radix/Base UI Tabs) for segmented controls and underline tabs.

Gate 5 — Choreograph Functional Micro-Motion (Without SSR Blank Flashes)

  • Read references/cognitive-traps-field-notes.md before adding page or row animations.
  • Three-Tier Motion Budget:
    1. Hover / Press: 100–150ms cubic-bezier(0.23, 1, 0.32, 1) + active:scale-[0.98].
    2. Shared-Layout Pill Glide (layoutId): Spring { type: "spring", stiffness: 520, damping: 38 }.
    3. Popover / Dialog / Sheet: 150–220ms scale (0.97 -> 1) + opacity driven by data-[state=open|closed].
  • Ban the SSR Hydration Opacity Trap:
    • Never wrap SSR page roots in <Motion :initial="{ opacity: 0 }"> or <motion.main initial={{ opacity: 0 }}>. SSR serializes style="opacity: 0" into HTML, causing a blank screen until client JS downloads and hydrates.
    • Use opacity: 1 transform-only CSS @keyframes (translateY(3px) -> 0) on page containers; reserve AnimatePresence opacity transitions for client-mounted dynamic bars, inline #expanded rows, and toasts.
  • Reactivity Initialization Order: Declare all ref / reactive / useState variables above any { immediate: true } watcher or effect that touches them to prevent Temporal Dead Zone crashes on route switch.
  • Accessibility: Always include a global @media (prefers-reduced-motion: reduce) reset.

Gate 6 — Apply 2026 Spatial Architecture & Single-Skeleton Governance

Read references/do-and-donot-matrix.md before structuring application shells and pages.

  1. Recessed Workspace Sheet (Application Shell):
    • Pair a matte outer frame (#08080a dark / zinc-100/80 light) and borderless 220–232px left rail with an inset rounded workspace sheet (md:my-2 md:mr-2 md:rounded-xl bg-default ring-1 ring-default shadow-sm overflow-hidden).
    • Aggregate scope/tenant switchers and the ⌘K search launcher at the top of the left rail; keep the topbar quiet (context badges, pending alerts, theme toggle).
  2. Two-Row Precision Page Header:
    • Row 1: Single H1 (18–20px, tight tracking) + optional inline SubTabs + at most one solid primary CTA on the right (demote secondary actions to outline / ghost).
    • Row 2: Full tabular-nums (font-variant-numeric: tabular-nums) KPI strip—never hide operational KPIs behind hidden xl:flex.
  3. Cohesive Data Panel (Toolbar + DataGrid + Inline Expand):
    • Attach FilterToolbar (Segmented Filter + Select + Search + contextual Batch Actions) directly as the #bar header of the same bordered Panel that renders the DataTable / EmptyState. Never float a detached filter bar above a separate table card.
    • Prefer inline #expanded row panels for editing existing records so operators keep surrounding table context; use centered Modal dialogs for creation and cross-scope batch confirmations.
    • Enforce a 4px spacing grid and 4 / 6 / 8 / 12px radius scale (kbd 4px · control 6px · panel 8px · modal/sheet 12px). Ban rounded-2xl shadow-lg nested card slop.
  4. Single Structural Skeleton Across Themes / Skins (L3–L5 Invariance):
    • When a product supports multiple themes, brand skins, or UI library adapters, maintain exactly one canonical view/shell tree (L3–L5). Route visual differences strictly through L0–L2 tokens and primitive adapters (components/ui/* or components/skin/*) so DOM hierarchy and element coordinates never jump when switching themes.

Gate 7 — Verify with Automated Hygiene Script & Live Browser Proof

  1. Run the static anti-slop auditor and resolve every error and warning:
    node scripts/audit_ui_hygiene.mjs <project-root>
    
  2. Follow references/qa-acceptance-checklist.md in a real browser:
    • Confirm 0 raw <select> / <input type="checkbox"> leaks in the live DOM.
    • Open Select popovers, Modal dialogs, and ⌘K Command Palette, and inspect real screenshots in both Dark and Light modes.
    • Confirm document.documentElement.scrollWidth <= document.documentElement.clientWidth at 390px and 320px viewports, and 0 console/page errors.

関連スキル