AgentSkillsCN

uxui-design

在现有设计体系框架内开展务实高效的UI/UX设计工作。可用于样式调整、布局优化、状态管理、无障碍适配,以及确保设计符合既定体系规范。尤其适用于已上线成熟产品的迭代与优化。

SKILL.md
--- frontmatter
name: uxui-design
description: Practical UI/UX work within existing design systems. Use for styling, layout, states, accessibility, and design system compliance. Use when working on established products.

UX/UI Design

Practical UI/UX work within an existing design system.

When to use: Working on established products with existing patterns. For new products or landing pages that need to stand out, use uxui-creative instead.

CRITICAL: Think deeply about spacing and layout before writing code. Analyze spatial relationships and whitespace rhythm. Rushed spacing = amateur UI.


Rules

  1. Analyze the design system first — spacing scale, type scale, colors, radii, existing patterns
  2. Follow it strictly — no invented values. Break only with explicit justification
  3. Structure before style — layout and hierarchy first, then color/shadow/borders
  4. Every value is intentional — if you can't justify 16px vs 14px, you're guessing
  5. Accessibility is not optional — semantic HTML, sufficient contrast, keyboard navigable
  6. Mobile-first — touch targets min 44px, responsive breakpoints, test narrow viewports

Handle All States

Don't just build the happy path:

  • Empty — no data, first-time user
  • Loading — skeleton or spinner, preserve layout
  • Error — clear message, recovery action
  • Edge cases — long text (truncate), missing images (fallback), overflow

Common Mistakes

MistakeFix
Inconsistent spacingUse the scale
Too many font sizesMax 3 per view
Borders AND shadowsPick one
No hover/focus statesClickable = feedback
Too tightAdd whitespace
InaccessibleCheck contrast, use semantic elements
Happy path onlyHandle empty, loading, error

Checklist

  • All spacing/sizing from design system
  • Clear visual hierarchy
  • Hover + focus + disabled states
  • Matches existing patterns
  • Accessible (contrast, keyboard, semantic HTML)
  • All states handled (empty, loading, error)
  • Works on mobile

ULTRATHINK

Trigger: "ULTRATHINK: [question]"

For: component API, layout architecture, new patterns, accessibility deep-dive


Common Code Mistakes

Missing Loading State

tsx
// BAD - no feedback
<button onClick={submit}>Submit</button>

// GOOD - loading feedback
<button onClick={submit} disabled={loading}>
  {loading ? <Spinner /> : 'Submit'}
</button>

Missing Focus State

css
/* BAD - removes focus */
button:focus { outline: none; }

/* GOOD - custom focus */
button:focus-visible {
  outline: 2px solid var(--focus-color);
  outline-offset: 2px;
}

Hardcoded Dimensions

css
/* BAD - fixed width */
.card { width: 300px; }

/* GOOD - responsive */
.card { 
  width: 100%;
  max-width: 300px;
}