---
name: frontend-design
description: "Create distinctive, production-grade frontend interfaces with high design quality. Provides analysis tools for auditing existing designs and generation tools for creating color palettes, typography systems, design tokens, and component templates. Supports React, Vue, Svelte, and vanilla HTML/CSS. Use when building web components, pages, or applications. Keywords: design, UI, frontend, CSS, components, palette, typography, tokens, accessibility."
license: MIT
compatibility: Requires Deno with --allow-read, --allow-write permissions
metadata:
author: agent-skills
version: "1.0"
type: generator
mode: generative
domain: development
---
# Frontend Design
Create distinctive, production-grade frontend interfaces that avoid generic "AI slop" aesthetics. This skill combines design philosophy guidance with practical TypeScript tooling for analyzing existing designs and generating design system artifacts.
**Core Principle**: Choose a clear aesthetic direction and execute it with precision. Bold maximalism and refined minimalism both work - the key is intentionality, not intensity.
## When to Use This Skill
**Use when**:
- Building web components, pages, or applications
- Auditing existing CSS for design inconsistencies
- Extracting design tokens from legacy codebases
- Generating color palettes and typography systems
- Creating component templates across frameworks
- Checking accessibility compliance for design elements
**Don't use when**:
- Simple text content changes
- Backend-only work
- Non-visual functionality
## Prerequisites
- **Deno** runtime (for script execution)
- Optional: Existing CSS/design files for analysis
- Optional: Design tokens file for reference
## Quick Start
This skill operates in three modes:
### 1. Analyze Mode
Audit existing styles, extract tokens, check accessibility.
```bash
# Audit CSS for design patterns and inconsistencies
deno run --allow-read scripts/analyze-styles.ts styles.css
# Extract design tokens from existing CSS
deno run --allow-read scripts/extract-tokens.ts ./src --format css
# Check accessibility (contrast, focus states)
deno run --allow-read scripts/analyze-accessibility.ts component.tsx
```
### 2. Specify Mode
Create JSON specifications defining what to generate. See `assets/` for schema examples.
### 3. Generate Mode
Create palettes, typography systems, tokens, and components.
```bash
# Generate a color palette
deno run --allow-read --allow-write scripts/generate-palette.ts --seed "#2563eb" --theme warm
# Generate typography system
deno run --allow-read --allow-write scripts/generate-typography.ts --display "Playfair Display" --body "Source Sans Pro"
# Generate design tokens file
deno run --allow-read --allow-write scripts/generate-tokens.ts tokens-spec.json ./output/
# Generate a component
deno run --allow-read --allow-write scripts/generate-component.ts --name Button --framework react --styling tailwind
```
---
## Instructions
### Phase 1: Analysis (Optional but Recommended)
Before creating new designs, audit existing code to understand current patterns.
#### 1a. Style Analysis
Analyze CSS files to identify colors, typography, spacing, and inconsistencies:
```bash
deno run --allow-read scripts/analyze-styles.ts [options]
Options:
--tokens Compare against existing design tokens
--pretty Pretty-print JSON output
--format Output format: json (default), summary
```
**Output includes**:
- Color usage inventory with hex normalization
- Typography patterns (fonts, sizes, weights)
- Spacing value distribution
- Inconsistencies and recommendations
#### 1b. Token Extraction
Extract design tokens from CSS files into standardized formats:
```bash
deno run --allow-read scripts/extract-tokens.ts [options]
Options:
--format Output: css, scss, tailwind, style-dictionary, tokens-studio
--output-css Also output CSS variables file
```
#### 1c. Accessibility Audit
Check design-related accessibility issues:
```bash
deno run --allow-read scripts/analyze-accessibility.ts [options]
Options:
--format Output: json, summary
--level WCAG conformance level (default: AA)
```
**Checks include**:
- Color contrast ratios
- Focus indicator presence
- Touch target sizes
- Motion preference respect
---
### Phase 2: Generation
#### 2a. Color Palette Generation
Generate cohesive color palettes from seed colors or themes:
```bash
deno run --allow-read --allow-write scripts/generate-palette.ts [options]