templates/skills/design-patterns/SKILL.md
Visual design patterns for design tokens, component specifications, color systems, typography, spacing, and WCAG accessibility compliance. Use proactively when working on design systems, UI components, CSS/SCSS styles, or reviewing visual design decisions for accessibility and consistency.
npx skillsauth add everyone-needs-a-copilot/claude-copilot design-patternsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Visual design patterns for creating consistent, accessible interfaces with proper design tokens and component specifications.
Provides patterns for:
When to use: Defining color systems that work across themes.
Implementation:
/* Base palette (reference only) */
--blue-500: #3b82f6;
--blue-700: #1d4ed8;
/* Semantic tokens (use these) */
--color-primary: var(--blue-500);
--color-primary-hover: var(--blue-700);
--color-text: #111827;
--color-text-muted: #6b7280;
--color-background: #ffffff;
--color-error: #ef4444;
--color-success: #10b981;
Benefits:
When to use: All spacing decisions (padding, margins, gaps).
Implementation:
--space-1: 0.25rem; /* 4px - tight */
--space-2: 0.5rem; /* 8px - compact */
--space-3: 0.75rem; /* 12px */
--space-4: 1rem; /* 16px - default */
--space-6: 1.5rem; /* 24px - medium */
--space-8: 2rem; /* 32px - large */
--space-12: 3rem; /* 48px - section */
Benefits:
When to use: Defining all interactive component states.
Implementation:
| State | Background | Border | Text | Cursor |
|-------|------------|--------|------|--------|
| Default | --color-bg | --color-border | --color-text | default |
| Hover | --color-bg-hover | --color-border | --color-text | pointer |
| Focus | --color-bg | --color-focus-ring | --color-text | — |
| Active | --color-bg-active | --color-border | --color-text | pointer |
| Disabled | --color-bg | --color-border | --color-text-muted | not-allowed |
| Loading | --color-bg | --color-border | --color-text-muted | wait |
| Error | --color-bg | --color-error | --color-error | — |
| Aspect | Description | |--------|-------------| | WHY | Breaks design system consistency, makes theme switching impossible | | DETECTION | Raw hex colors, pixel values without tokens in CSS | | FIX | Always use design tokens for colors, spacing, typography |
Bad Example:
.button {
background: #3b82f6;
padding: 12px 16px;
color: white;
}
Good Example:
.button {
background: var(--color-primary);
padding: var(--space-3) var(--space-4);
color: var(--color-on-primary);
}
| Aspect | Description | |--------|-------------| | WHY | Creates incomplete interactions, accessibility failures | | DETECTION | Components only define default + hover, missing focus/disabled/error | | FIX | Define ALL states: default, hover, focus, active, disabled, loading, error |
| Aspect | Description | |--------|-------------| | WHY | WCAG 2.1 AA violation, excludes users with visual impairments | | DETECTION | Text contrast < 4.5:1, UI component contrast < 3:1 | | FIX | Use contrast checker, ensure text 4.5:1, UI elements 3:1 minimum |
| Requirement | Threshold | Applies To | |-------------|-----------|------------| | Text contrast | 4.5:1 | All text | | Large text contrast | 3:1 | 18px+ or 14px bold | | UI component contrast | 3:1 | Borders, icons, focus rings | | Touch target | 44x44px | Mobile interactive elements | | Focus visible | 2px outline | All focusable elements |
## Design Tokens: [System Name]
### Colors
| Token | Value | Usage |
|-------|-------|-------|
| --color-primary | #3b82f6 | Primary actions |
| --color-text | #111827 | Body text (4.54:1) |
### Typography
| Token | Value | Usage |
|-------|-------|-------|
| --text-base | 1rem | Body text |
| --font-sans | 'Inter', sans-serif | Primary font |
### Spacing
| Token | Value | Usage |
|-------|-------|-------|
| --space-4 | 1rem | Default padding |
## Component: [Name]
### Variants
| Variant | Use Case | Treatment |
|---------|----------|-----------|
| Primary | Main actions | Filled, brand |
| Secondary | Alternative | Outlined |
### States
| State | Background | Border | Text |
|-------|------------|--------|------|
| Default | --color-bg | --color-border | --color-text |
### Accessibility
- Contrast: X.X:1 (meets AA)
- Touch target: 44x44px
- Focus: 2px outline
testing
Pytest testing patterns, anti-patterns, and quality rules
testing
STRIDE threat modeling and DREAD severity scoring for security review
development
Python idiomatic patterns and best practices
tools
UX patterns for task flows, wireframes, accessibility, and user interactions