AgentSkillsCN

visual-design

创作视觉设计、设计系统与 UI 规范。 适用于字体比例、色彩系统、布局网格、组件设计, 以及无障碍合规性。涵盖 OKLCH 色彩空间、可变字体、 流体字体、设计令牌(W3C DTCG),以及原子设计方法。 关键词:UI 设计、色彩搭配、设计令牌、WCAG 对比度、组件库。

SKILL.md
--- frontmatter
name: visual-design
description: |
  Create visual designs, design systems, and UI specifications.
  Use for typography scales, color systems, layout grids, component design,
  and accessibility compliance. Covers OKLCH color spaces, variable fonts,
  fluid typography, design tokens (W3C DTCG), and Atomic Design methodology.
  Keywords: UI design, color palette, design tokens, WCAG contrast, component library.

Visual Design Skill

Create systematic, accessible visual designs using modern color spaces, typography, and design token standards.

When to Use

  • Designing typography scales with mathematical ratios
  • Creating OKLCH-based color palettes for accessibility
  • Building design token hierarchies (W3C DTCG format)
  • Specifying component libraries with Atomic Design
  • Auditing designs for WCAG AA/AAA compliance
  • Implementing variable fonts and fluid typography

When NOT to Use

  • User research and persona development
  • Information architecture and content strategy
  • Usability testing and heuristic evaluation
  • Backend API or database design
  • Pure frontend implementation (use code-focused skills)

Quick Start

Task: Create a basic design system foundation

  1. Define primitive tokens (colors, spacing, typography)
  2. Create semantic layer (primary, secondary, surface colors)
  3. Build component tokens (button, input, card specifications)
  4. Document with usage guidelines

Minimum deliverable: Token hierarchy + typography scale + color palette


Core Procedure

Phase 1: Discovery

yaml
inputs:
  - Brand guidelines (if available)
  - Target platforms (web, mobile, desktop)
  - Accessibility requirements (AA or AAA)
  - Existing design assets

Capture requirements in uncertainty ledger:

  • What color mode support is needed? (light/dark/both)
  • What is the primary typeface or brand font?
  • Are there platform-specific guidelines (iOS HIG, Material)?

Phase 2: Foundation Tokens

Typography Scale (Perfect Fourth 1.333 recommended):

TokenSizeUse
text-xs12pxCaptions, labels
text-sm14pxSecondary text
text-base16pxBody text
text-lg21pxLead paragraphs
text-xl28pxH4 headings
text-2xl38pxH3 headings
text-3xl50pxH2 headings
text-4xl67pxH1 headings

Spacing Scale (8pt grid):

TokenValueUse
space-14pxTight inline
space-28pxIcon-text gap
space-312pxSmall padding
space-416pxDefault padding
space-624pxSection padding
space-832pxLarge gaps
space-1248pxSection margins

Phase 3: Color System

Use OKLCH for perceptually uniform palettes:

css
/* Primary palette - consistent perceived lightness */
--primary-50:  oklch(97% 0.02 250);
--primary-100: oklch(94% 0.04 250);
--primary-200: oklch(88% 0.08 250);
--primary-300: oklch(78% 0.12 250);
--primary-400: oklch(68% 0.15 250);
--primary-500: oklch(58% 0.18 250);  /* Base */
--primary-600: oklch(48% 0.16 250);
--primary-700: oklch(38% 0.14 250);
--primary-800: oklch(28% 0.10 250);
--primary-900: oklch(18% 0.06 250);

Checkpoint: Verify contrast ratios meet WCAG requirements.

Phase 4: Component Specification

Apply Atomic Design hierarchy:

  1. Atoms - Button, Input, Icon, Badge, Avatar
  2. Molecules - Form Field, Search Bar, Menu Item
  3. Organisms - Header, Data Table, Card, Form
  4. Templates - Dashboard Layout, List Page, Detail Page

For each component, document:

  • Visual states (default, hover, active, disabled, focus)
  • Token mappings (which semantic tokens apply)
  • Accessibility requirements (focus indicators, ARIA)

Phase 5: Documentation

Create usage guidelines with:

  • Do's and don'ts examples
  • Code snippets for implementation
  • Accessibility notes per component

Definition of Done

  • Typography scale defined with at least 6 sizes
  • Color palette with primitives and semantic tokens
  • Spacing scale following 4px or 8px grid
  • Component specifications for core atoms
  • WCAG AA contrast verified for all text/background combinations
  • Design tokens exportable to CSS/SCSS/JSON

Design System Architecture

code
Foundation Layer
├── Primitives (raw values)
│   ├── Colors (blue-500, gray-100)
│   ├── Typography (font families, weights)
│   ├── Spacing (4, 8, 16, 24, 32px)
│   └── Breakpoints (sm, md, lg, xl)
│
├── Semantic Layer
│   ├── Colors (primary, secondary, error)
│   ├── Text Styles (heading-lg, body-md)
│   ├── Spacing Tokens (gap-sm, padding-lg)
│   └── Elevation (shadow-sm, shadow-lg)
│
├── Component Layer
│   ├── Atoms (Button, Input, Icon)
│   ├── Molecules (Search Bar, Form Field)
│   ├── Organisms (Header, Data Table)
│   └── Templates (Dashboard, List Page)
│
└── Documentation Layer
    ├── Usage Guidelines
    ├── UI Patterns
    ├── Accessibility Docs
    └── Changelog

Token flow: Primitives -> Semantic -> Component -> Output (CSS/SCSS/JS/Figma)


Guardrails

Accessibility Requirements

CriterionLevel AALevel AAA
Text Contrast4.5:17:1
Large Text3:14.5:1
UI Components3:1N/A
Focus Indicators3:1Enhanced
Target Size24x24px44x44px

Always verify: Use contrast checker tools before finalizing colors.

Trust Model

yaml
trusted:
  - Brand guidelines provided by user
  - Platform design system references (Material, HIG)
untrusted:
  - Generated color values (verify perceptually)
  - AI-suggested type pairings (verify readability)

Required Confirmations

  • Before overwriting existing design tokens
  • Before changing established brand colors
  • When accessibility compliance cannot be met

Key Principles

Gestalt Principles (Quick Reference)

PrincipleApplication
ProximityGroup related form fields
SimilarityConsistent button styles
ContinuityNavigation flows
ClosureIcon simplification
Figure-GroundModal overlays
Common RegionCards, panels

Visual Hierarchy

  1. Size - Larger = more important
  2. Weight - Bold draws attention
  3. Color - High contrast attracts eye
  4. Position - Top-left scanned first (LTR)
  5. Density - Isolated elements stand out
  6. Depth - Shadows create importance

Consistency Types

  • Internal - Same patterns within product
  • External - Align with platform conventions
  • Temporal - Consistent over versions
  • Semantic - Same visual = same meaning

Failure Modes & Recovery

FailureRecovery
Colors fail contrastAdjust lightness in OKLCH (L value)
Type scale feels offTry different ratio (1.25, 1.333, 1.414)
Components inconsistentAudit against token mapping
Dark mode brokenDesign dark mode tokens separately

Tools Reference

Color:

Typography:

Design Systems:


References

  • Design Systems - Tokens, components, documentation
  • Typography - Scales, variable fonts, fluid type
  • Color - OKLCH, accessibility, systems
  • Principles - Gestalt, hierarchy, consistency