Skip to main content
UXOfficialCertifiedAI reviewed Jul 21, 2026

Ui Craft

Polishes UI primitives one at a time using 2026 research-backed patterns — adds loading/icon states to buttons, replaces inline skeletons with primitives, adds secondary actions to errors, ensures 48px touch targets and visible focus indicators, applies a standard motion token ladder..

v1.0.14 installs

Install this skill

No account required. Pick your tool, or use the command that detects it for you.

Run in your terminal. It detects your AI tool.

npx @skills-hub-ai/cli install ui-craft
Or get the file:
Browse all CLI commands →
Manual setup by platform

Claude Code

~/.claude/skills/ui-craft/SKILL.md

Setup guide →

Signing

SignedSLSA L2
Signed by
skills-hub.ai distributor
Method
Distributor-signed by skills-hub.aiSigned with the skills-hub.ai Ed25519 distributor key over this exact slug, version and content. Check it with `npx @skills-hub-ai/cli verify`.
Key
skills-hub-ed25519-2026-11
Signed
0Save

Instructions

You are an autonomous UI craft agent. Polish a frontend codebase one primitive at a time using the patterns below. Do NOT ask the user questions. Do NOT bundle changes into a giant PR — each primitive gets its own focused commit.

TARGET:
$ARGUMENTS

If $ARGUMENTS is provided, focus on that component (e.g., Button, EmptyState).
If empty, run the full ordered pass below.


=== PRE-FLIGHT ===


  • Working directory is a frontend project (React/Next/Vue/Svelte detected via package.json).
  • Tests run (npm test, pnpm test, bun test, or framework equivalent) — establish a baseline pass rate.
  • Lint/typecheck command available (tsc --noEmit, eslint, etc.).
  • Git working tree is clean — refuse to start if dirty (offer to stash).

Recovery:

  • If no test command exists: warn loudly. Continue but mark each phase "unverified."
  • If tests already failing on main: stop and report the failing tests. Do not pile on.

=== PRINCIPLES (from research, 2026) ===


Apply these without re-deriving them:

The three UI states (empty / loading / error) are where polish lives.

  • Empty: explain why empty, clear CTA, preview of populated state.
  • Loading: skeleton screen matching final layout (not a generic spinner). Optimistic UI for likes/follows/CRUD.
  • Error: plain-language what-went-wrong, what user can do, path back. Specific responses per type (403→contact, 404→alternatives, 5xx→retry, validation→highlight field).

Motion ladder. Only animate transform and opacity — these are GPU-composited. Animating layout properties (width/height/top/left/margin/padding) drops below 60fps. Wrap all animations in prefers-reduced-motion. Use three curves and four durations:

Curvecubic-bezierUse
--ease-out-expo0.16, 1, 0.3, 1modals, large transitions
--ease-snappy0.4, 0, 0.2, 1loaders, toggles
--ease-spring0.34, 1.56, 0.64, 1hover, success bounces
DurationValueUse
--duration-fast150mshover, focus micro-interactions
--duration-base200msbutton press, toggles
--duration-medium280msmodals, drawers
--duration-slow600mscelebrations (rare)

Design token tiers — primitive (purple-500) → semantic (--surface-primary, --text-danger) → component (--button-radius, --card-shadow). Components should reference component-level tokens that fall back to semantic; never reference primitives directly.

WCAG 2.2 polish gates — every interactive element:

  • Touch target ≥ 48 CSS px (project rule — exceeds 24px WCAG min).
  • Visible focus indicator ≥ 2px perimeter, 3:1 contrast against unfocused state (2.4.13).
  • Focus not entirely hidden by sticky content (2.4.11).
  • Drag operations have single-pointer alternative (2.5.7).
  • Auth flows: no cognitive tests; allow password managers / biometric / magic links (3.3.8).

Reusable component checklist — for each primitive:

  • All states baked in: default / hover / focus-visible / active / disabled / loading / error / success.
  • Variant API: primary/secondary/ghost/destructive on actions; sm/md/lg sizes.
  • TypeScript-typed props enforcing valid variant combos at compile time.
  • Accessibility as a primary requirement, not a checklist.
  • Tests per state per variant.

=== ORDERED PASS (one component per phase, one commit per phase) ===


For each phase below: read the current primitive (if any), apply the diff sketch, add/update tests, run the test suite + typecheck, commit. Then move to the next phase.

Phase 1 — Button

Audit Button (or the most-used button primitive). Add if missing:

  • loading?: boolean + loadingText?: string — disables the button, sets aria-busy, renders an inline spinner.
  • leftIcon / rightIcon slots — kills inline <svg> + label duplication.
  • Narrow transition-all → explicit transform, opacity, background-color, border-color, box-shadow, color (perf rule).
  • focus-visible:ring-2 with ring-offset-2 against current bg.
  • Verify 48 px min-height on every size variant.

Migrate consumers that hand-roll a <span className="spinner" /> + label pattern inside a <button> to use the new loading prop. Stop after 5–10 high-impact migrations; bulk migration is its own task.

Phase 2 — EmptyState

Audit EmptyState. Add if missing:

  • icon?: ReactNode — make optional, ship a sensible default glyph (most consumers duplicate the same inline SVG).
  • Normalize icon container (fixed h × w) so consumer SVGs don't need to set width/height.
  • tone: "default" | "subtle" | "card" — default keeps dashed border; subtle drops it; card uses solid surface.
  • size: "default" | "compact" — compact reduces vertical padding.
  • secondaryAction?: ReactNode — for "Learn more" or "Watch demo" links beside the primary CTA.
  • data-empty-state attribute for analytics/testing.

Phase 3 — Skeleton

If no Skeleton primitive exists, create one. The codebase almost certainly has inline <div className="skeleton h-X w-Y" /> (or animate-pulse bg-gray-200) scattered across many files.

// skeleton.tsx
export function Skeleton({
  as: Tag = "div",
  className,
  "aria-hidden": ariaHidden = true,
  ...rest
}) {
  return (
    <Tag
      aria-hidden={ariaHidden}
      className={["skeleton", className].filter(Boolean).join(" ")}
      {...rest}
    />
  );
}

export function SkeletonStack({
  count,
  itemClassName = "h-4 w-full",
  gap = 3,
  label = "Loading",
}) {
  return (
    <div
      role="status"
      aria-live="polite"
      aria-busy="true"
      aria-label={label}
      className={`flex flex-col gap-${gap}`}
    >
      {Array.from({ length: count }).map((_, i) => (
        <Skeleton key={i} className={itemClassName} />
      ))}
    </div>
  );
}

Migrate 5–10 loading-list patterns from inline Array.from(...).map(<div className="skeleton ...">) to <SkeletonStack>. The win is consistency + the live-region announcement for screen readers.

Phase 4 — ErrorAlert (or equivalent)

Audit the error component. Add:

  • retryLabel?: string — default "Try again" is brittle when the action isn't a retry (e.g., "Reconnect", "Refresh data").
  • secondaryAction?: ReactNode — for "Contact support", "Go back", or "Get help" links.
  • Replace transition-colors on the retry button with the explicit transition-property list.

Phase 5 — Motion token ladder

Open the global stylesheet. Add the three easing curves and four durations from the table above as CSS custom properties (only the ones missing). Add a comment block pointing to this skill so future contributors reach for the same tokens.

Search the codebase for raw cubic-bezier(...) values and transition: ... 0.3s ease. For each, decide: replace with a token, or document why the one-off is intentional. Don't mass-migrate — leave a TODO comment with the recommended token.

Phase 6 — Focus indicators (WCAG 2.2 2.4.13)

Grep for components that use only the browser default outline:

grep -rL "focus-visible:" --include="*.tsx" src/components

For each, add focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--primary)] focus-visible:ring-offset-2 (or the framework equivalent). Run a quick contrast check on the resulting ring vs the component's resting background — if below 3:1, swap to a higher-contrast ring color.


=== PER-PHASE WORKFLOW ===


  1. Read the existing component (if any) and its test file.
  2. Write the diff. Preserve test assertions that check specific className substrings — extend, don't replace.
  3. Add tests for new features (each new prop gets at least one test).
  4. Run the focused test file: pnpm vitest run <path> (or framework equivalent).
  5. Run the full suite + typecheck before committing.
  6. Commit with conventional commits format: feat(ui): polish Button — loading, leftIcon, rightIcon.
  7. Keep each commit to ≤ 20 files (matches project CLAUDE.md if present).

=== STRICT RULES ===


  • Never delete consumer code without checking it's actually unused.
  • Never introduce a new variant or prop without a test.
  • Never collapse transition-all to nothing — replace with the explicit property list.
  • Never animate layout properties to "fix" a transition.
  • Never assume the project has a Skeleton/EmptyState/ErrorAlert primitive — check first.
  • Never skip the focus indicator audit, even if "everything looks fine."
  • If a phase has no work (component already polished), record that and move on. Don't manufacture changes.

=== FINAL REPORT ===


After all phases (or after the requested phase finishes), print:

ui-craft pass complete

Phase 1 — Button:         <NEW PROPS> | <N migrations> | <test delta>
Phase 2 — EmptyState:     <NEW PROPS> | <N migrations> | <test delta>
Phase 3 — Skeleton:       <CREATED / EXISTED> | <N migrations> | <test delta>
Phase 4 — ErrorAlert:     <NEW PROPS> | <N migrations> | <test delta>
Phase 5 — Motion tokens:  <N tokens added> | <N migrations> | <N TODOs left>
Phase 6 — Focus audit:    <N components patched> | <N flagged for follow-up>

Total tests: <before> → <after>
Commits: <N>

If any phase failed verification, surface that — do not silently skip it.

This skill doesn’t include stateful context yet, instructions only. Learn about stateful skills.

Security

Loading security scan...

Reviews (0)

Browse all →
design-animateAdd purposeful motion to interfaces using modern CSS — scroll-driven animations, view transitions, @starting-style, and GPU-accelerated transforms. Triggers: 'add animation', 'animate', 'add motion', 'transitions', 'scroll animation'.79 installsdesign-auditComprehensive autonomous design quality audit across accessibility (WCAG 2.2), performance, theming, responsive/adaptive design, and anti-pattern detection. Triggers: 'audit design', 'check accessibility', 'a11y audit', 'design review', 'UI quality check'.62 installssecureFull-stack security posture assessment with 0-100 risk scoring. Scans dependency vulnerabilities (npm audit, pip-audit, cargo audit, govulncheck), dangerous code patterns (SQL injection, eval, command injection, ReDoS, innerHTML, XSS vectors), authentication gaps (missing auth middleware.57 installsdiagramGenerate Mermaid architecture diagrams from your codebase. Produces C4 context and container diagrams, sequence diagrams for key flows, ER diagrams from database schemas, and module dependency graphs. Use when you need architecture diagrams, system diagrams, database ERD, sequence diagrams, dependency visualization, or C4 model diagrams.57 installsdesign-polishFinal autonomous quality pass before shipping. Fixes alignment, spacing, consistency, typography hierarchy, color harmony, motion timing, and every micro-detail that separates good from great..56 installsresponsiveAudit and fix responsive design issues across all breakpoints. Scans for fixed widths that cause mobile overflow, missing media query variants, non-responsive images, undersized touch targets below 48px, unreadable typography, and horizontal scroll violations..50 installs

More from Skills Hub

View source →
security-reviewSecurity audit and vulnerability assessment for any codebase. Scans for authentication bypasses, missing auth middleware, broken JWT validation (algorithm confusion, weak secrets, missing expiry), OAuth state and PKCE flaws, IDOR and horizontal privilege escalation.198 installsunit-testGenerate comprehensive unit tests with edge cases, error paths, and boundary values. Triggers: you need to add unit tests, increase code coverage, test edge cases, or verify error handling paths.167 installsweb-gameScaffolds a browser-based game with Phaser 3, PixiJS, or Three.js including game loop, asset pipeline, responsive canvas, input handling, audio, save/load, and deployment to itch.io or web. Triggers: on: "web game", "browser game", "html5 game", "phaser game", "pixi game".134 installshumanizerMulti-pass editor that removes AI-writing tells from drafted content — eliminates filler phrases, balances sentence length, restores opinion and voice, and strips em-dash overuse so posts sound human and opinionated rather than ChatGPT-generic..133 installsflutterBuilds Flutter applications from videos, screenshots, descriptions, or app clone requests. Triggers on: flutter app, build a mobile app, replicate this app in Flutter, build from video, build from screenshots, clone this app, build an app, make an app like, recreate this UI.129 installsdesign-to-codeTurn a design into production-quality frontend code: extract a design system with tokens and components, make layouts responsive across breakpoints, add dark mode with WCAG-compliant theming, then run a UX audit to validate everything..126 installs

More UX skills

Browse category →
dark-modeImplement complete dark mode for any frontend project. Auto-detects theme system (Flutter ThemeData, Tailwind dark class, CSS variables, MUI, Chakra UI, styled-components), generates a dark color palette with proper surface elevation hierarchy and desaturated brand colors.45 installsdesign-claudeHTML-first hi-fi design skill: interactive prototypes, slide decks, animation demos, design variant exploration, visual direction advising, and expert critique. Triggers: make a prototype, design demo, interactive prototype, HTML presentation, animation demo.33 installsdesign-tokensExtract, consolidate, and modernize design tokens — oklch color scales, fluid spacing with clamp(), typography scales, motion timing, and shadow depths. Triggers: 'extract design tokens', 'create design system tokens', 'consolidate styles', 'modernize CSS variables'.21 installsdesign-systemExtract and formalize a design system from existing UI code. Scans for every hardcoded color, font size, spacing value, border radius, and shadow across the codebase, deduplicates near-identical values, generates framework-appropriate tokens (CSS custom properties, Tailwind config.20 installsuxDual-mode UX quality skill — runs a heuristic/accessibility/motion audit on the current codebase, or validates implementation against design mockups. Fixes all issues found and commits.19 installsdesign-syncOrchestrates the Claude Design ↔ Claude Code /design-sync handoff loop — imports your design system into the active project, validates generated UI components against design tokens, and round-trips edits back to Claude Design so prototypes always start from real components rather than approximations.17 installs

Frequently asked questions about ui-craft

What does the ui-craft skill do?

Polishes UI primitives one at a time using 2026 research-backed patterns — adds loading/icon states to buttons, replaces inline skeletons with primitives, adds secondary actions to errors, ensures 48px touch targets and visible focus indicators, applies a standard motion token ladder.. It's a reusable SKILL.md instruction set that loads into your AI coding assistant on demand, no prompt engineering, no copy-pasting every session.

How do I install the ui-craft skill?

Run `npx @skills-hub-ai/cli install ui-craft` from your terminal. The CLI writes the SKILL.md to the correct location for your AI tool (e.g. ~/.claude/skills/ui-craft/ for Claude Code or ~/.cursor/skills/ for Cursor with --target cursor) and adds it to your project's .skills.json lockfile.

Which AI tools does ui-craft work with?

ui-craft runs in Claude Code. It follows the open Agent Skills standard (SKILL.md), so the same skill works in every supported tool without modification.

Is the ui-craft skill free?

Yes. Every skill on skills-hub.ai is free and open-source. There are no premium tiers, paywalls, or usage limits. You only pay for whatever AI assistant you're already using.

How do I use ui-craft after installing it?

In Claude Code, type `/ui-craft` (or whatever slash command the skill registers) and the AI follows the skill's instructions immediately. You can also reference it by name in natural language, your AI loads the skill into context when relevant.

Can I share the ui-craft skill with my team?

Yes. Commit your project's .skills.json lockfile and teammates run `npx @skills-hub-ai/cli install` (no args) to install every skill at the exact version you pinned. Organization-scoped installs work via skills-hub.ai organizations.