ui-design
UI/UX and frontend design best practices guidelines (formerly frontend-design). This skill should be used when writing, reviewing, or designing frontend code to ensure accessibility, performance, and usability. Triggers on tasks involving HTML structure, CSS styling, responsive layouts, form design, animations, or accessibility improvements.
- License 许可
- MIT
- 最近更新
- 2026-08-02
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- ui-design
- description
- UI/UX and frontend design best practices guidelines (formerly frontend-design). This skill should be used when writing, reviewing, or designing frontend code to ensure accessibility, performance, and usability. Triggers on tasks involving HTML structure, CSS styling, responsive layouts, form design, animations, or accessibility improvements.
02 资源文件 45
- 参考文档AGENTS.md9.0 KB
- 资产文件assets/templates/_template.md736 B
- 参考文档references/_sections.md1.8 KB
- 参考文档references/access-alt-text.md1.7 KB
- 参考文档references/access-aria-labels.md1.6 KB
- 参考文档references/access-focus-indicators.md1.3 KB
- 参考文档references/access-heading-hierarchy.md1.4 KB
- 参考文档references/access-keyboard-navigation.md1.5 KB
- 参考文档references/access-semantic-html.md1.5 KB
- 参考文档references/access-target-size.md1.3 KB
- 参考文档references/anim-duration-easing.md1.9 KB
- 参考文档references/anim-gpu-properties.md1.8 KB
- 参考文档references/anim-reduced-motion.md2.0 KB
- 参考文档references/anim-will-change.md2.0 KB
- 参考文档references/color-contrast-ratio.md1.8 KB
- 参考文档references/color-dark-mode.md1.8 KB
- 参考文档references/color-not-only-indicator.md2.0 KB
- 参考文档references/color-semantic-palette.md2.0 KB
- 参考文档references/cwv-critical-css.md1.8 KB
- 参考文档references/cwv-improve-inp.md2.0 KB
- 参考文档references/cwv-lazy-load-offscreen.md1.8 KB
- 参考文档references/cwv-minimize-cls.md1.7 KB
- 参考文档references/cwv-optimize-lcp.md1.7 KB
- 参考文档references/cwv-responsive-images.md1.7 KB
- 参考文档references/form-autocomplete.md2.3 KB
- 参考文档references/form-error-messages.md1.7 KB
- 参考文档references/form-inline-validation.md2.0 KB
- 参考文档references/form-input-types.md2.1 KB
- 参考文档references/form-labels-above.md1.7 KB
- 参考文档references/layout-f-pattern.md2.0 KB
- 参考文档references/layout-grid-system.md1.6 KB
- 参考文档references/layout-proximity-grouping.md1.5 KB
- 参考文档references/layout-single-cta.md1.8 KB
- 参考文档references/layout-visual-hierarchy.md1.7 KB
- 参考文档references/layout-whitespace.md1.6 KB
- 参考文档references/resp-container-queries.md1.6 KB
- 参考文档references/resp-fluid-typography.md1.6 KB
- 参考文档references/resp-mobile-first.md1.8 KB
- 参考文档references/resp-touch-targets.md1.6 KB
- 参考文档references/resp-viewport-meta.md1.8 KB
- 参考文档references/typo-font-display.md1.8 KB
- 参考文档references/typo-line-height.md1.5 KB
- 参考文档references/typo-preload-fonts.md1.6 KB
- 参考文档references/typo-readable-line-length.md1.5 KB
- 参考文档references/typo-system-font-stack.md1.8 KB
03 SKILL.md 正文
UI/UX Best Practices Frontend Design
Comprehensive UI/UX and frontend design best practices guide. Contains 42 rules across 8 categories, prioritized by impact to guide accessible, performant, and user-friendly interface development.
When to Apply
Reference these guidelines when:
- Structuring HTML for accessibility and semantics
- Writing CSS for responsive layouts and visual hierarchy
- Optimizing images and fonts for Core Web Vitals
- Designing forms with proper validation and error handling
- Adding animations and interactive elements
Rule Categories by Priority
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Accessibility & WCAG Compliance | CRITICAL | access- |
| 2 | Core Web Vitals Optimization | CRITICAL | cwv- |
| 3 | Visual Hierarchy & Layout | HIGH | layout- |
| 4 | Responsive & Mobile-First Design | HIGH | resp- |
| 5 | Typography & Font Loading | MEDIUM-HIGH | typo- |
| 6 | Color & Contrast | MEDIUM | color- |
| 7 | Forms & Validation UX | MEDIUM | form- |
| 8 | Animation & Performance | LOW-MEDIUM | anim- |
Quick Reference
1. Accessibility & WCAG Compliance (CRITICAL)
access-semantic-html- Use semantic HTML elements for screen readersaccess-keyboard-navigation- Ensure full keyboard navigationaccess-focus-indicators- Provide visible focus indicatorsaccess-alt-text- Provide meaningful alt text for imagesaccess-aria-labels- Use ARIA labels for icon-only controlsaccess-target-size- Ensure minimum touch target size (24×24px)access-heading-hierarchy- Maintain logical heading hierarchy
2. Core Web Vitals Optimization (CRITICAL)
cwv-optimize-lcp- Optimize Largest Contentful Paint under 2.5scwv-minimize-cls- Minimize Cumulative Layout Shift under 0.1cwv-improve-inp- Improve Interaction to Next Paint under 200mscwv-responsive-images- Serve responsive images with srcsetcwv-lazy-load-offscreen- Lazy load offscreen images and iframescwv-critical-css- Inline critical CSS and defer the rest
3. Visual Hierarchy & Layout (HIGH)
layout-visual-hierarchy- Establish clear visual hierarchylayout-whitespace- Use whitespace to improve readabilitylayout-f-pattern- Design for F-pattern reading behaviorlayout-grid-system- Use a consistent grid systemlayout-single-cta- Limit to one primary CTA per screenlayout-proximity-grouping- Group related elements with proximity
4. Responsive & Mobile-First Design (HIGH)
resp-mobile-first- Design mobile-first with min-width queriesresp-fluid-typography- Use fluid typography with clamp()resp-container-queries- Use container queries for componentsresp-touch-targets- Size touch targets for mobile (44×44px)resp-viewport-meta- Configure viewport meta tag correctly
5. Typography & Font Loading (MEDIUM-HIGH)
typo-font-display- Use font-display to control loading behaviortypo-preload-fonts- Preload critical web fontstypo-readable-line-length- Constrain line length (45-75ch)typo-line-height- Set appropriate line height (1.5-1.7)typo-system-font-stack- Use system font stack for UI elements
6. Color & Contrast (MEDIUM)
color-contrast-ratio- Meet WCAG contrast ratio requirements (4.5:1)color-not-only-indicator- Never use color alone to convey informationcolor-dark-mode- Support dark mode with prefers-color-schemecolor-semantic-palette- Use semantic color names in design tokens
7. Forms & Validation UX (MEDIUM)
form-inline-validation- Use inline validation after field blurform-error-messages- Write actionable error messagesform-labels-above- Place labels above input fieldsform-input-types- Use correct HTML input types for mobileform-autocomplete- Enable browser autocomplete with correct attributes
8. Animation & Performance (LOW-MEDIUM)
anim-gpu-properties- Animate only GPU-accelerated propertiesanim-will-change- Use will-change sparingly for animation hintsanim-reduced-motion- Respect user motion preferencesanim-duration-easing- Use appropriate animation duration and easing
How to Use
Read individual reference files for detailed explanations and code examples:
- Section definitions - Category structure and impact levels
- Rule template - Template for adding new rules
- Example: access-semantic-html
Full Compiled Document
For the complete guide with all rules expanded: AGENTS.md
04 同仓库更多 Skills
zustand
Rules and standards for state management using Zustand in React and Next.js. Use when implementing client-side stores, persistence with localStorage, or preventing SSR hydration mismatch.
zod
Zod v4 schema validation best practices. Use when defining schemas, utilizing safeParse, or customizing error messages.
upstash-ratelimit
Rules, standards, and references for rate limiting in serverless environments using Upstash Ratelimit. Use when implementing rate limiting, configuring Upstash Redis, or handling request blocking.
typescript
TypeScript performance, tsconfig, type errors, async patterns — triggered when the user asks to "optimize TypeScript performance", "speed up tsc compilation", "configure tsconfig.json", "fix type errors", "improve async patterns", or encounters TS errors (TS2322, TS2339, "is not assignable to"). Also triggers on .ts, .tsx, .d.ts file work involving type definitions, module organization, or memory management. Does NOT cover TypeScript basics, framework-specific patterns, or testing.
typescript-refactor
TypeScript and TSX refactoring and modernization guidelines from a principal specialist perspective, current to TypeScript 6.0 and React 19. This skill should be used when refactoring, reviewing, or modernizing TypeScript or React/TSX code for type safety, compiler performance, and idiomatic patterns. Triggers on tasks involving type architecture, narrowing, generics, discriminated unions, error handling, React component and hook typing, or migration to modern TypeScript features (satisfies, using, const type parameters, inferred type predicates, isolatedDeclarations, erasable syntax, import attributes).
typescript-advanced-patterns
Advanced TypeScript — type-level programming, library/DSL APIs, declaration merging, modern language features at depth (decorators, using, const T, NoInfer, variance), and feature implementation patterns built on advanced types. Trigger on tasks involving recursive conditional types, infer patterns, mapped-type key remapping, variadic tuples, fluent builders with phantom state, schema-first inference (Zod/Valibot), end-to-end-typed API clients, finite state machines, module augmentation, and library-publishing concerns. Trigger even when the user does not say "advanced" — if the work involves type-level algorithms, library-author API design, or going beyond surface-level uses of TS 5.x features, this is the skill. Assumes the reader has absorbed the `typescript-refactor` skill — this one extends those patterns at depth, never restates them.