Token导航 LogoToken导航TokenDH.com
前端设计只读github未标认证来源可访问许可证需确认审计通过

ui-craft用户界面工艺

Agent Skill

用于辅助界面设计、视觉规范、排版、配色、布局和交互体验优化。它适合让 Agent 根据产品场景整理页面结构、生成 UI 方案、检查视觉一致性或改进组件层级。使用时需要结合现有品牌、设计系统和用户任务,不应只堆装饰元素;涉及真实页面改动时,应通过截图或浏览器预览检查文本溢出、对齐和响应式表现。

总安装

353

周安装

15

GitHub Stars

798

下载量

124
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:ui-craft(用户界面工艺)
来源仓库:https://github.com/juliusbrussee/cavekit
仓库路径:skills/ui-craft
安装命令:
npx skills add https://github.com/juliusbrussee/cavekit --skill ui-craft
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/juliusbrussee/cavekit --skill ui-craft

简介

ui-craft 辅助界面设计、视觉规范和交互体验优化,适合生成 UI 方案和检查一致性。

  • 适用于页面结构整理、配色布局和组件层级改进等前端设计任务。
  • 结合品牌规范和设计系统使用,避免堆砌装饰元素。
  • 涉及真实页面改动时需通过截图或浏览器预览验证表现。
  • ui-craft 属于前端设计类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

UI Craft: Implementation Guide for Exceptional Interfaces

If a DESIGN.md exists at the project root, its tokens and specifications override all defaults in this skill. This skill provides sensible defaults for when no design system exists, and implementation guidance that applies regardless.
For deep dives on any section, see the reference files in this skill's references/ directory.

1. Core Philosophy

Taste is trained, not innate. Study why great interfaces feel right. Deconstruct apps you admire — the spacing, the timing, the weight of a shadow. The gap between "fine" and "exceptional" is built from hundreds of micro-decisions that users feel but never consciously notice.

Unseen details compound. A single rounded corner, a single eased transition, a single well-chosen shadow — none of these matter alone. Together they become "a thousand barely audible voices singing in tune." The cumulative effect is what separates craft from output.

Beauty is leverage. Polish is not vanity. Good defaults, considered typography, and intentional motion are real differentiators. Users trust interfaces that feel cared for. Investors notice. Competitors can't easily replicate taste.

Intentionality over intensity. Both bold maximalism and refined minimalism work — what fails is the absence of a clear point of view. Every visual decision should trace back to a deliberate conceptual direction. If you can't articulate WHY a choice was made, reconsider it.

Choose a direction and execute with precision. Don't hedge between styles. A brutalist page committed fully will always outperform a page that's "a little bit of everything." Commit, then refine.

NEVER produce generic "AI slop" aesthetics. No gratuitous gradients on white backgrounds. No cookie-cutter hero sections with stock illustrations. No safe, forgettable layouts that could belong to any product. Every interface should have a point of view that makes it recognizable.


2. The Priority Stack

When implementing UI, work through these priorities in order. Higher priorities are non-negotiable; lower priorities are polish that compounds quality.

PriorityLevelWhat It Means
AccessibilityCRITICALContrast 4.5:1, keyboard nav, ARIA semantics, visible focus rings. Ship nothing that excludes users.
PerformanceHIGHWebP/AVIF images, lazy loading below fold, CLS < 0.1, transform-only animations on the compositor thread.
TypographyHIGHFont smoothing, text-wrap balance/pretty, tabular-nums for data, 65ch max line length.
Layout & SpatialHIGH4/8px grid, concentric border radius, optical alignment over geometric.
Color & ThemeMEDIUMHSL custom properties, semantic tokens, dark mode pairs tested separately.
Motion & InteractionMEDIUMFrequency-based animation decisions, 150-300ms durations, ease-out default.
Polish & DetailsLOWLayered shadows over borders, press feedback on buttons, staggered enter animations.

Never skip a CRITICAL/HIGH item to chase a LOW item. A beautifully animated button that fails keyboard navigation is a net negative.


3. Aesthetic Direction

Before writing a single line of CSS, commit to a bold aesthetic direction. The most common failure mode in AI-generated UI is convergence on the same safe, forgettable look.

Pick a Tone

Choose one and commit fully:

  • Brutally minimal — generous whitespace, monospace type, stark contrast, near-zero decoration
  • Maximalist chaos — layered textures, clashing type scales, dense information, intentional visual noise
  • Retro-futuristic — CRT glow effects, monospace terminals, scan lines, neon on dark
  • Organic / natural — earth tones, rounded shapes, paper textures, hand-drawn accents
  • Luxury / refined — serif headlines, muted palettes, ample negative space, subtle gold or cream accents
  • Editorial / magazine — dramatic type hierarchy, full-bleed imagery, grid-breaking layouts
  • Playful / bold — bright primaries, chunky borders, exaggerated shadows, bouncy motion

Match Complexity to Vision

Maximalist design demands elaborate code — layered backgrounds, complex grid structures, multiple font stacks. Minimalist design demands surgical precision — every pixel of spacing matters more when there's nothing to hide behind.

The Ban List (When No DESIGN.md Exists)

When building without an existing design system, avoid these overused defaults that signal "AI-generated":

  • Fonts: Inter, Roboto, Arial, system-ui as display fonts, Space Grotesk
  • Colors: Purple-to-blue gradients on white backgrounds
  • Patterns: Generic hero with centered text + CTA + stock illustration

Vary between light and dark themes, different font pairings, different aesthetic directions. Never converge on the same choices across projects.

Visual Texture

Add depth through: gradient meshes, noise/grain overlays (filter: url(#noise)), layered transparencies, subtle background patterns, duotone image treatments.

DESIGN.md overrides this entire section. If DESIGN.md specifies Inter, use Inter. If it specifies purple gradients, use them. The ban list only applies when no design system exists and you're making aesthetic choices from scratch.


4. Typography Essentials

Typography is the single highest-leverage design element. Get it right and mediocre layouts still feel good. Get it wrong and nothing else saves it.

Root Setup

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

Apply font smoothing to the root layout. On macOS, the default sub-pixel rendering makes text appear heavier than the designer intended.

Text Wrapping

h1, h2, h3, h4, h5, h6 {
  text-wrap: balance;
}

p, li, dd, blockquote {
  text-wrap: pretty;
}

balance distributes heading lines evenly. pretty avoids orphaned words in body text.

Numeric Display

.data-value, .price, .counter, [data-numeric] {
  font-variant-numeric: tabular-nums;
}

Use tabular-nums for any number that updates dynamically — prices, counters, table columns. Without it, layout shifts as digit widths change.

Scale and Rhythm

  • Base size: 16px minimum for body text. Never go below 14px for any readable content.
  • Line height: 1.5-1.75 for body text, 1.1-1.3 for large headings.
  • Max line length: max-width: 65ch for body text. Long lines destroy readability.
  • Type scale: Pick a consistent scale and stick to it: 12 / 14 / 16 / 18 / 24 / 32 / 48 / 64.

Font Pairing

Pair a distinctive display font with a refined body font. The display font carries personality; the body font carries readability. Use font-weight for hierarchy within a family:

  • Headings: 600-700 (semibold to bold)
  • Body: 400 (regular)
  • Labels / UI: 500 (medium)

Always include font stack fallbacks:

--font-display: "Instrument Serif", "Georgia", serif;
--font-body: "Söhne", "Helvetica Neue", sans-serif;
--font-mono: "JetBrains Mono", "Fira Code", monospace;

5. Color & Theme

HSL Custom Properties (shadcn Pattern)

:root {
  --background: 0 0% 100%;
  --foreground: 222.2 84% 4.9%;
  --primary: 222.2 47.4% 11.2%;
  --primary-foreground: 210 40% 98%;
  --secondary: 210 40% 96.1%;
  --secondary-foreground: 222.2 47.4% 11.2%;
  --muted: 210 40% 96.1%;
  --muted-foreground: 215.4 16.3% 46.9%;
  --accent: 210 40% 96.1%;
  --accent-foreground: 222.2 47.4% 11.2%;
  --destructive: 0 84.2% 60.2%;
  --destructive-foreground: 210 40% 98%;
  --border: 214.3 31.8% 91.4%;
  --ring: 222.2 84% 4.9%;
  --radius: 0.5rem;
}

Define semantic tokens: primary, secondary, destructive, muted, accent, background, foreground. Reference colors by semantic name — never hardcode hex values in components.

Dark Mode

.dark {
  --background: 222.2 84% 4.9%;
  --foreground: 210 40% 98%;
  /* ... desaturated, lighter tonal variants — NOT simply inverted */
}

Dark mode is not "invert colors." Use desaturated, lighter tonal variants. Backgrounds go dark but not pure black (#000). Text goes light but not pure white (#fff). Test contrast separately for dark mode — what passes in light may fail in dark.

Contrast Requirements

  • WCAG AA minimum: 4.5:1 for normal text, 3:1 for large text (18px+ bold or 24px+ regular)
  • Never convey information by color alone — always pair with an icon, label, or pattern
  • Test with browser devtools contrast checker or axe-core

Color Confidence

Dominant colors with sharp accents outperform timid, evenly-distributed palettes. Pick one or two hero colors and let the rest of the palette recede. A confident palette has clear hierarchy; an uncertain palette spreads color evenly and feels flat.


6. Spatial Design

Concentric Border Radius

This is the single most common thing that makes nested UI elements feel "off":

outer_radius = inner_radius + padding
/* Correct: concentric */
.card        { border-radius: 16px; padding: 8px; }
.card-inner  { border-radius: 8px; }  /* 16 - 8 = 8 */

/* Wrong: same radius on parent and child */
.card        { border-radius: 12px; }
.card-inner  { border-radius: 12px; }  /* Looks bloated */

When geometric centering looks off, align optically. Play/pause icons, dropdown carets, and asymmetric glyphs often need 1-2px manual nudges to look centered.

Shadows Over Borders

Layer multiple transparent box-shadow values for natural depth instead of using borders:

.elevated {
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 2px 4px rgba(0, 0, 0, 0.04),
    0 4px 8px rgba(0, 0, 0, 0.04);
}

Multiple shadows at different spreads mimic how light works. A single hard shadow looks artificial.

Image Outlines

Add a subtle inset outline to images and media for consistent depth against varied backgrounds:

img, video {
  outline: 1px solid rgba(0, 0, 0, 0.06);
  outline-offset: -1px;
}

Spacing Scale

Use a 4px / 8px base incremental system. Every spacing value should be a multiple of 4:

4 / 8 / 12 / 16 / 24 / 32 / 48 / 64 / 96 / 128

Hit Areas

Minimum 44x44px for all interactive elements. If the visual element is smaller, extend the hit area with a pseudo-element:

.small-button::before {
  content: "";
  position: absolute;
  inset: -8px;
}

Z-Index Scale

Define a layered scale and never use arbitrary values:

--z-base: 0;
--z-dropdown: 10;
--z-sticky: 20;
--z-overlay: 40;
--z-modal: 100;
--z-toast: 1000;

7. Motion & Interaction

The Frequency-Based Decision Framework

This is the most important mental model for animation decisions:

FrequencyExamplesAnimation
100+ times/dayKeyboard shortcuts, command palette actions, tab switchesNone. Zero animation. Instant.
Tens of times/dayHover effects, list item navigation, togglesRemove or drastically reduce. 50-100ms max.
OccasionalModals, drawers, toasts, page transitionsStandard animation. 150-300ms.
Rare / first-timeOnboarding, celebrations, empty statesCan add delight. 300-500ms, more elaborate.

High-frequency animations feel sluggish. Low-frequency animations without motion feel jarring. Match the animation budget to usage frequency.

Custom Easing Curves

Built-in CSS easings (ease, ease-in-out) are too weak. Define custom curves:

:root {
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

Duration Guide

ElementDuration
Buttons, toggles100-160ms
Tooltips125-200ms
Dropdowns, popovers150-250ms
Modals, drawers200-500ms
Page transitions250-400ms

UI animations should stay under 300ms. Never use ease-in for UI animations — it front-loads the pause and feels sluggish.

Enter/Exit Asymmetry

Exits should be softer and faster than enters. An enter animation at 250ms should have its exit at 150-200ms.

Split and Stagger Enter Animations

When multiple elements enter the viewport, stagger them by semantic chunks with ~50-100ms delay:

.stagger-item {
  animation: fadeSlideIn 300ms var(--ease-out) both;
}
.stagger-item:nth-child(1) { animation-delay: 0ms; }
.stagger-item:nth-child(2) { animation-delay: 60ms; }
.stagger-item:nth-child(3) { animation-delay: 120ms; }

Scale Animations

Never animate from scale(0). Start from scale(0.9) or higher, combined with opacity:

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

Press Feedback

Every pressable element should scale down slightly on :active:

button:active {
  transform: scale(0.97);
}

Interruptibility

Use CSS transitions (not keyframe animations) for interactive state changes. Transitions can be interrupted mid-way; keyframes cannot. This matters for hover states, toggles, and any element the user might interact with rapidly.

Popover Origin

Make popovers transform-origin aware — they should grow from their trigger element, not from center. Exception: modals always originate from center.

Tooltip Hover Delay

Skip the tooltip delay on subsequent hovers. If the user has already waited for one tooltip, show the next one immediately.

Reduced Motion

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

Respect prefers-reduced-motion. Reduce animations — don't eliminate opacity and color transitions entirely, as those provide important feedback.

Hover Gate

Gate hover animations behind a media query so touch devices don't trigger stuck hover states:

@media (hover: hover) and (pointer: fine) {
  .card:hover { transform: translateY(-2px); }
}
Reference references/animation-playbook.md for deep dives on spring physics, gesture-driven animation, and complex choreography.

8. Component Craft

Primitives

Use Radix UI primitives for accessible, unstyled foundations. Use CVA (class-variance-authority) for type-safe component variants:

import { cva } from "class-variance-authority";

const buttonVariants = cva(
  "inline-flex items-center justify-center rounded-md font-medium transition-colors focus-visible:outline-none focus-visible:ring-2",
  {
    variants: {
      variant: {
        default: "bg-primary text-primary-foreground hover:bg-primary/90",
        destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
        outline: "border border-input hover:bg-accent hover:text-accent-foreground",
        ghost: "hover:bg-accent hover:text-accent-foreground",
      },
      size: {
        sm: "h-9 px-3 text-sm",
        default: "h-10 px-4 py-2",
        lg: "h-11 px-8 text-lg",
      },
    },
    defaultVariants: { variant: "default", size: "default" },
  }
);

Button

  • Scale on press (transform: scale(0.97) on :active)
  • Visible focus ring (never outline: none without replacement)
  • Loading state with spinner replacing label, maintaining button dimensions
  • Disabled state at opacity: 0.5 with pointer-events: none

Card

  • Concentric border radius between card and inner elements
  • Layered shadows (not borders) for depth
  • Hover state: subtle elevation change (translateY(-1px) + shadow increase)

Dialog / Modal

  • Focus trap (keyboard cannot escape to elements behind)
  • ESC to close, click outside overlay to close
  • transform-origin: center, fade + scale enter animation
  • aria-modal="true", role="dialog", aria-labelledby

Form

  • Visible labels always — never placeholder-only inputs
  • Error messages near the field with aria-live="polite" for screen readers
  • Progressive disclosure: show advanced fields only when needed
  • Use React Hook Form + Zod for validation

Theming

Use shadcn CSS variable pattern (HSL format) for all component colors. Wrap client-interactive components in server components for Next.js App Router compatibility.

Reference references/component-patterns.md for the full component catalog with copy-paste implementations.

9. Accessibility Essentials

Semantic HTML First

Use <button>, <nav>, <main>, <header>, <footer>, <article>, <section> before reaching for ARIA. A <button> gives you keyboard handling, focus management, and screen reader semantics for free. A <div onClick> gives you none of that.

Keyboard Navigation

  • Tab / Shift+Tab: move between focusable elements
  • Enter / Space: activate buttons and links
  • Arrow keys: navigate within lists, menus, tabs, radio groups
  • Escape: close modals, popovers, dropdowns
  • Home / End: jump to first/last item in lists

Focus Management

  • Visible focus rings on all interactive elements — NEVER use outline: none without a replacement
  • Trap focus inside modals (Tab wraps within the modal, not behind it)
  • Restore focus to the trigger element when a modal/popover closes
  • Use focus-visible to show rings only for keyboard users, not mouse clicks:
:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

ARIA Attributes

  • aria-label for icon-only buttons: <button aria-label="Close menu">X</button>
  • aria-labelledby to associate headings with sections
  • aria-describedby to link help text or error messages to inputs
  • aria-live="polite" for dynamic content updates (toast messages, form errors)
  • aria-hidden="true" for decorative elements (icons next to text labels)
  • aria-expanded for toggleable elements (dropdowns, accordions)

Color and Contrast

  • WCAG AA: 4.5:1 for normal text, 3:1 for large text
  • Never use color as the sole indicator — pair with icons, text, or patterns
  • Test in both light and dark modes

Images and Media

  • Descriptive alt text for meaningful images: alt="Dashboard showing 23% revenue growth"
  • Empty alt="" for purely decorative images
  • Captions for video, transcripts for audio

Navigation Aids

  • Skip link: first focusable element, hidden until focused:
<a href="#main-content" class="sr-only focus:not-sr-only">
  Skip to main content
</a>
  • Heading hierarchy: sequential h1 through h6, no level skips. One <h1> per page.

Touch Targets

  • Minimum 44x44px interactive area
  • 8px minimum spacing between adjacent touch targets
  • Extend small visual elements with invisible padding or pseudo-elements

Testing

  • Automated: axe-core in CI, Lighthouse accessibility score 90+
  • Manual: full keyboard-only navigation test
  • Screen reader: test with VoiceOver (macOS) or NVDA (Windows)
  • Visual: zoom to 200%, check nothing breaks or overlaps
Reference references/accessibility-checklist.md for the full audit guide with pass/fail criteria.

10. Pre-Delivery Review

Run through this checklist before considering any UI implementation complete:

Typography

  • Font smoothing applied (-webkit-font-smoothing: antialiased)
  • Headings use text-wrap: balance
  • Dynamic numbers use font-variant-numeric: tabular-nums

Color

  • All colors referenced via semantic tokens, no hardcoded hex in components
  • Color contrast meets WCAG AA (4.5:1 normal text, 3:1 large text)
  • Dark mode tested separately for contrast

Spatial

  • Nested rounded elements use concentric border radius
  • Spacing follows 4px / 8px scale consistently
  • Interactive elements have 44x44px minimum hit area
  • Shadows used instead of borders where appropriate

Motion

  • Animation frequency matches usage frequency (no animation on high-frequency actions)
  • No transition: all anywhere — specific properties only
  • Enter animations split and staggered where multiple elements appear
  • prefers-reduced-motion respected

Accessibility

  • All interactive elements keyboard accessible
  • Focus rings visible on keyboard navigation (never outline: none without replacement)
  • Semantic HTML used before ARIA
  • aria-live on dynamic content updates
Reference references/review-checklist.md for the extended 30-item checklist with severity ratings and automated testing commands.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.66%
按下载量换算44

Claude

31.76%
按下载量换算39

Cursor

16.21%
按下载量换算20

Gemini CLI

9.75%
按下载量换算12

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills