AgentSkillsCN

frontend-design

统一设计规范、模式与组件样式。当你要构建新组件、审查UI一致性,或从现有代码中提炼设计模式时,可运用这一方法。

SKILL.md
--- frontmatter
name: frontend-design
description: Creates distinctive, production-grade frontend interfaces with high design quality. Use when building UI components, pages, blog elements, or MDX content. Generates creative, polished code that avoids generic AI aesthetics.
invocation: auto

Frontend Design

Create visually striking, memorable interfaces that avoid "AI slop" aesthetics.

Contents

Design Thinking

Before coding, commit to a BOLD aesthetic direction:

  1. Purpose - What problem does this interface solve?
  2. Tone - Pick an extreme: brutally minimal, maximalist, retro-futuristic, editorial, organic
  3. Memorable element - What's the one unforgettable thing?

Bold maximalism and refined minimalism both work—the key is intentionality, not intensity.

Typography

DoDon't
Distinctive, characterful fontsGeneric fonts (Inter, Roboto, Arial)
Pair display + body fontsSingle system font
font-variant-numeric: tabular-nums for numbersMixed number alignments
text-wrap: balance on headingsWidows/orphans

klabo.world stack: Use @next/font for font optimization.

Color & Theme

PrincipleImplementation
Commit to cohesive aestheticCSS variables in :root
Dominant + sharp accentsAvoid evenly-distributed palettes
Dark mode intentionalcolor-scheme: dark on <html>
Explicit backgroundsNever rely on browser defaults
css
/* Pattern: High contrast accent */
--bg: hsl(0 0% 7%);
--fg: hsl(0 0% 93%);
--accent: hsl(38 92% 50%);  /* amber-500 */

Motion

PriorityTechnique
HighPage load reveals with animation-delay stagger
HighHover states that surprise
MediumScroll-triggered animations
LowContinuous ambient motion

Rules:

  • Animate only transform / opacity
  • Honor prefers-reduced-motion
  • Never use transition: all
  • CSS-only preferred; Motion library for React when needed

Layout

PatternUse For
AsymmetryBreaking visual monotony
OverlapCreating depth
Grid-breakingFocal elements
Generous negative spaceEditorial feel
Controlled densityData-rich interfaces

Tailwind patterns:

html
<!-- Overlap -->
<div class="relative -mt-12 z-10">

<!-- Grid break -->
<div class="col-span-full md:-mx-8">

<!-- Generous space -->
<section class="py-24 md:py-32">

Anti-Patterns

NEVER use:

  • ❌ Inter, Roboto, Arial, system fonts
  • ❌ Purple gradients on white backgrounds
  • ❌ Cookie-cutter card grids
  • ❌ Generic hero sections
  • ❌ Predictable layouts
  • ❌ Same aesthetic across generations

Signs of AI slop:

  • Every button is rounded-lg with shadow-sm
  • Blue-to-purple gradient everything
  • Excessive whitespace with no purpose
  • "Modern" meaning "looks like every Vercel template"

Quick Reference

ElementDistinctive Choice
ButtonsCustom shapes, borders, hover effects
CardsAsymmetric, overlapping, varied sizes
HeadingsLarge scale contrast, unusual weight
ImagesCreative crops, borders, shadows
BackgroundsGradients, noise, patterns, textures

Verification

After creating UI:

  1. Screenshot test - Would this be mistaken for AI-generated?
  2. Memorable test - What's the one thing someone would remember?
  3. Consistency test - Does it match the chosen aesthetic direction?
  4. Technical test - Console errors? Accessibility issues?

Use Playwright MCP to capture before/after:

code
browser_snapshot → make changes → browser_snapshot → compare