AgentSkillsCN

ui-ux-designer

为 Rimitive 视图模块创建自定义适配器。当您为 Canvas、WebGL、终端、原生平台,或任何基于树形结构的目标构建渲染器时,可使用此技能。

SKILL.md
--- frontmatter
name: ui-ux-designer
description: This skill should be used when creating visual designs, animations, and interaction patterns. Use for design systems, Material 3, and accessibility.

When to Use

Use this skill when creating visual designs, animations, and interaction patterns:

  • Designing new screens and components from scratch
  • Creating animation specifications (timing, easing, transitions)
  • Defining design tokens and spacing systems
  • Implementing Material 3 expressive patterns
  • Ensuring WCAG 2.1 accessibility compliance
  • Designing responsive layouts (mobile, tablet, desktop)
  • Creating color schemes and typography hierarchies
  • Defining micro-interactions and feedback patterns

Do NOT use this skill for:

  • Implementing Compose UI code → switch to Compose Screen Implementation Mode
  • Implementing SwiftUI UI code → switch to SwiftUI Screen Implementation Mode
  • Product/PRD decisions → switch to Product Design Mode
  • Shared ViewModel logic → switch to KMP Mobile Expert Mode
  • Navigation flow definitions → switch to User Flow Planning Mode

Essential Workflows

Workflow 1: Design System Creation

Create consistent design tokens following Material 3 guidelines:

  1. Define spacing scale using 8dp grid system (xs: 4dp → xxxl: 64dp)
  2. Establish elevation hierarchy (level0: 0dp → level5: 12dp)
  3. Create color roles with semantic naming (primary, secondary, tertiary, surface, error)
  4. Define shape system with corner radii (small: 8dp → extraLarge: 28dp)
  5. Specify motion durations (short: 200ms, medium: 300ms, long: 400ms)
  6. Set typography scale with line heights and weights
  7. Implement component-specific tokens (card, badge, progress bar)
  8. Validate WCAG 2.1 contrast ratios (4.5:1 for normal text, 3:1 for large text)

Workflow 2: Animation Specification

Define clear animation behaviors using Material 3 motion principles:

  1. Choose appropriate duration for interaction type (micro: 150-200ms, standard: 300ms, major: 400-600ms)
  2. Select easing curve based on emotional goal (EmphasizedDecelerate for enter, EmphasizedAccelerate for exit, Linear for functional)
  3. Specify transition pattern (circular reveal, shared axis, fade through, scale)
  4. Define stagger pattern for multiple elements (50-100ms delay per element, cap at 10 items)
  5. Document spring physics values (stiffness, damping ratio, for bounce effects)
  6. Specify animation triggers (tap, hover, scroll, load)
  7. Define accessibility considerations (respect reduced motion preference)
  8. Provide code examples for implementation

Workflow 3: Responsive Layout Design

Create adaptive layouts that work across all screen sizes:

  1. Define breakpoints (compact: <600dp, medium: 600-840dp, expanded: >840dp)
  2. Specify layout changes per breakpoint (grid columns, navigation style, component spacing)
  3. Design component variations per breakpoint (card density, image sizes, typography scale)
  4. Define adaptive navigation pattern (bottom bar for compact, rail for medium, drawer for expanded)
  5. Specify touch target sizes (minimum 48x48dp for all interactive elements)
  6. Design safe area handling for notched devices
  7. Consider foldable device layouts if applicable
  8. Test across all breakpoints during implementation

Critical Guardrails

RuleDescriptionExample
Always use tokensNever hardcode dp values or colorsUse MaterialTheme.tokens.spacing.medium not 16.dp
WCAG 2.1 complianceEnsure minimum contrast ratios and touch targets4.5:1 contrast, 48x48dp touch targets
Respect reduced motionAlways honor user's reduced motion preferenceDisable spring animations, keep fade transitions
Token-based themingUse CompositionLocal for theme-provided valuesMaterialTheme.tokens for design, MaterialTheme.componentTokens for components
Material 3 expressiveFollow Material 3 guidelines for patterns, colors, typographyUse EmphasizedDecelerate/EmphasizedAccelerate easing

Quick Reference

Design Tokens

CategoryTokenValueUsage
Spacingxs4dpTight spacing between related elements
sm8dpDefault padding for compact layouts
md16dpStandard padding and margins
lg24dpSection spacing
xl32dpMajor section breaks
Elevationlevel00dpBackground elements
level11dpSubtle cards
level23dpStandard cards
level36dpElevated cards
level48dpDialogs, sheets
level512dpFABs, navigation drawers
Shapessmall8dpButtons, chips
medium16dpCards, dialogs
large24dpBottom sheets
extraLarge28dpHero cards (Material 3 expressive)
MotiondurationShort200msMicro-interactions (tap feedback)
durationMedium300msStandard transitions
durationLong400msMajor transitions, hero animations
TypographydisplayLarge57sp / RegularHero headings
headlineLarge32sp / MediumSection titles
titleLarge22sp / BoldCard titles
bodyLarge16sp / RegularBody text

Animation Easing Curves

CurveControl PointsUse Case
EmphasizedDecelerate(0.05, 0.7, 0.1, 1.0)Enter animations, scale up
EmphasizedAccelerate(0.3, 0.0, 0.8, 0.15)Exit animations, scale down
StandardDecelerate(0.0, 0.0, 0.0, 1.0)Fading in, sliding in
Linear(0.0, 0.0, 1.0, 1.0)Functional animations, reduced motion
Springstiffness=200, dampingRatio=0.7Bouncy interactions, overshoot

WCAG 2.1 Accessibility

RequirementMinimum StandardExample
Contrast ratio (normal text)4.5:1Body text on background
Contrast ratio (large text)3:1Headings, buttons
Touch targets48x48dp minimumAll interactive elements
Touch target spacing8dp between targetsPrevent accidental taps
Text scalingSupport up to 200%System font size settings
Color aloneNever use color alone to convey infoAdd icons, patterns, or text labels

Material 3 Color Roles

RoleLight ModeDark ModePurpose
primaryCoral (#FF5E57)Adjusted coralPrimary buttons, active states
onPrimaryWhite (#FFFFFF)Adjusted whiteText/icon on primary
secondaryYellow (#FFCA3A)Adjusted yellowSecondary actions, badges
surfaceWarm white (#FFFBF0)Near-black (#1A1A1A)Cards, dialogs
onSurfaceNear-black (#1A1A1A)Off-white (#F5F5F5)Text/icon on surface
errorRed (#B00020)Light red (#CF6679)Error states, destructive actions

Cross-References

DocumentPurposeLink
Design token architectureCompositionLocal pattern for design + component tokensdesign_tokens.md
UI/UX guidelinesBrand essence, dual design system, animation stylesui_ux.md
Component libraryComponent implementations with token abstractioncomponent_library.md
Material 3 guidelinesOfficial Material Design 3 documentationmaterial.io
Critical patternsViewModel, Either, Impl+Factory, Navigation 3, Testingcritical_patterns_quick_ref.md
AccessibilityWCAG 2.1 guidelines and implementation patternsMaterial 3 accessibility
Product requirementsFeature acceptance criteria and user flowsprd.md

Reference Implementations

Material 3 Design System:

Animated Components:

Design Token Customization: