diff --git a/AGENTS.md b/AGENTS.md index 1722feddb..4a8388711 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,6 +1,6 @@ -# vibe-design-plugins Repository +# Impeccable (vibe-design-plugins) -This repository provides cross-provider design skills and commands for LLM-powered development tools (Cursor, Claude Code, Gemini CLI, Codex CLI). +The vocabulary you didn't know you needed. 1 skill, 15 commands, and curated anti-patterns for impeccable style. Works with Cursor, Claude Code, Gemini CLI, and Codex CLI. ## Repository Purpose @@ -31,10 +31,10 @@ vibe-design-plugins/ │ └── skills/ # Skill definitions with frontmatter │ └── frontend-design.md ├── dist/ # Generated outputs (committed for users) -│ ├── cursor/ # Downgraded (no frontmatter) +│ ├── cursor/ # Commands + Agent Skills │ │ └── .cursor/ │ │ ├── commands/*.md -│ │ └── rules/*.md +│ │ └── skills/*/SKILL.md │ ├── claude-code/ # Full featured │ │ └── .claude/ │ │ ├── commands/*.md @@ -44,11 +44,10 @@ vibe-design-plugins/ │ │ │ └── commands/*.toml │ │ ├── GEMINI.md │ │ └── GEMINI.*.md -│ └── codex/ # Custom prompts + modular skills -│ ├── .codex/ -│ │ └── prompts/*.md -│ ├── AGENTS.md -│ └── AGENTS.*.md +│ └── codex/ # Custom prompts + Agent Skills +│ └── .codex/ +│ ├── prompts/*.md +│ └── skills/*/SKILL.md ├── api/ # Vercel Functions (production) │ ├── skills.js # GET /api/skills │ ├── commands.js # GET /api/commands @@ -152,12 +151,13 @@ Run: `bun run build` ## Provider Transformations -### 1. Cursor (Downgraded) -- **Commands**: Body only → `dist/cursor/.cursor/commands/*.md` -- **Skills**: Body only → `dist/cursor/.cursor/rules/*.md` -- **Strips**: All frontmatter, all metadata -- **Args**: Not supported, arguments get appended to end of prompt +### 1. Cursor (Agent Skills Standard) +- **Commands**: Body only → `dist/cursor/.cursor/commands/*.md` (no frontmatter support) +- **Skills**: Agent Skills standard → `dist/cursor/.cursor/skills/{name}/SKILL.md` + - Full YAML frontmatter with name/description + - Reference files in skill subdirectories - **Installation**: Extract ZIP into your project root, creates `.cursor/` folder +- **Note**: Agent Skills require Cursor nightly channel ### 2. Claude Code (Full Featured) - **Commands**: Full YAML frontmatter → `dist/claude-code/.claude/commands/*.md` @@ -180,10 +180,10 @@ Run: `bun run build` - Uses `description` and `argument-hint` in frontmatter - Transforms `{{argname}}` → `$ARGNAME` (uppercase variables) - Invoked as `/prompts:` -- **Skills**: Modular with routing → `dist/codex/AGENTS.{name}.md` (root level) - - Main `AGENTS.md` provides routing instructions - - Tells Codex when to read which skill file -- **Installation**: Extract ZIP into your project root, creates `.codex/` folder + skill files +- **Skills**: Agent Skills standard → `dist/codex/.codex/skills/{name}/SKILL.md` + - Same SKILL.md format as Claude Code with YAML frontmatter + - Reference files in skill subdirectories +- **Installation**: Extract ZIP into your project root, creates `.codex/` folder ## Key Design Decisions @@ -237,12 +237,14 @@ End users can copy files directly without needing build tools. ## Provider Documentation Links +- [Agent Skills Specification](https://agentskills.io/specification) - Open standard - [Cursor Commands](https://cursor.com/docs/agent/chat/commands) - [Cursor Rules](https://cursor.com/docs/context/rules) +- [Cursor Skills](https://cursor.com/docs/context/skills) - [Claude Code Slash Commands](https://code.claude.com/docs/en/slash-commands) - [Anthropic Skills](https://github.com/anthropics/skills) - [Gemini CLI Custom Commands](https://cloud.google.com/blog/topics/developers-practitioners/gemini-cli-custom-slash-commands) - [Gemini CLI GEMINI.md](https://github.com/google-gemini/gemini-cli/blob/main/docs/cli/gemini-md.md) - [Codex CLI Slash Commands](https://developers.openai.com/codex/guides/slash-commands) -- [Codex CLI AGENTS.md](https://developers.openai.com/codex/guides/agents-md) +- [Codex CLI Skills](https://developers.openai.com/codex/skills/) diff --git a/DEVELOP.md b/DEVELOP.md index ea25ea4a7..9dd4e9ace 100644 --- a/DEVELOP.md +++ b/DEVELOP.md @@ -48,15 +48,19 @@ Your command prompt here with {{argname}} placeholders... name: skill-name description: What this skill provides license: License info (optional) +compatibility: Environment requirements (optional) --- Your skill instructions here... ``` -**Frontmatter fields**: -- `name` (required): Skill identifier -- `description` (required): What the skill provides +**Frontmatter fields** (based on [Agent Skills spec](https://agentskills.io/specification)): +- `name` (required): Skill identifier (1-64 chars, lowercase/numbers/hyphens) +- `description` (required): What the skill provides (1-1024 chars) - `license` (optional): License/attribution info +- `compatibility` (optional): Environment requirements (1-500 chars) +- `metadata` (optional): Arbitrary key-value pairs +- `allowed-tools` (optional, experimental): Pre-approved tools list **Body**: The skill instructions for the LLM. @@ -84,24 +88,26 @@ bun run rebuild ``` source/ → dist/ commands/*.md cursor/commands/*.md (body only) - skills/*.md cursor/rules/*.md (body only) - + skills/*.md cursor/skills/*/SKILL.md (Agent Skills standard) + claude-code/commands/*.md (full frontmatter) claude-code/skills/*/SKILL.md - + gemini/commands/*.toml (TOML format) gemini/GEMINI*.md (modular) - + codex/prompts/*.md (custom prompt format) - codex/AGENTS*.md (modular) + codex/skills/*/SKILL.md (Agent Skills standard) ``` ## Provider Transformations -### Cursor (Downgraded) -- Strips ALL frontmatter -- Body only → `dist/cursor/commands/*.md` and `dist/cursor/rules/*.md` -- Argument placeholders remain as descriptive text (no substitution) +### Cursor (Agent Skills Standard) +- Commands → Body only → `dist/cursor/.cursor/commands/*.md` (no frontmatter support) +- Skills → Agent Skills standard → `dist/cursor/.cursor/skills/{name}/SKILL.md` + - Full YAML frontmatter support + - Reference files in skill subdirectories +- **Note**: Agent Skills require Cursor nightly channel ### Claude Code (Full Featured) - Keeps full YAML frontmatter + body @@ -117,13 +123,13 @@ source/ → dist/ - Uses Gemini's native import feature for modular context files ### Codex CLI (Full Featured) -- Commands → Custom prompts with `argument-hint` → `dist/codex/prompts/*.md` +- Commands → Custom prompts with `argument-hint` → `dist/codex/.codex/prompts/*.md` - Frontmatter uses `description` and `argument-hint` (not `args` array) - Placeholders transformed from `{{argname}}` to `$ARGNAME` (uppercase) - Invoked as `/prompts:` -- Skills → Modular `AGENTS.{name}.md` files -- Main `AGENTS.md` guides Codex on when to read each skill file - - Includes skill descriptions to help Codex decide which file to read +- Skills → Agent Skills standard → `dist/codex/.codex/skills/{name}/SKILL.md` + - Uses same SKILL.md format as Claude Code + - Reference files in subdirectories ## Adding New Content @@ -202,14 +208,16 @@ The build system (`scripts/build.js`) is a single 410-line Node.js script with: ## Reference Documentation +- [Agent Skills Specification](https://agentskills.io/specification) - Open standard - [Cursor Commands](https://cursor.com/docs/agent/chat/commands) - [Cursor Rules](https://cursor.com/docs/context/rules) +- [Cursor Skills](https://cursor.com/docs/context/skills) - [Claude Code Slash Commands](https://code.claude.com/docs/en/slash-commands) - [Anthropic Skills (Claude Code)](https://github.com/anthropics/skills) - [Gemini CLI Custom Commands](https://cloud.google.com/blog/topics/developers-practitioners/gemini-cli-custom-slash-commands) - [Gemini CLI Skills](https://github.com/google-gemini/gemini-cli/blob/main/docs/cli/gemini-md.md) - [Codex CLI Slash Commands](https://developers.openai.com/codex/guides/slash-commands#create-your-own-slash-commands-with-custom-prompts) -- [Codex CLI Agents](https://developers.openai.com/codex/guides/agents-md) +- [Codex CLI Skills](https://developers.openai.com/codex/skills/) ## Repository Structure diff --git a/README.md b/README.md index 34010f2b0..71a32ff7e 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ -# impeccable.style +# Impeccable -The anti-slop framework for AI design. One skill and 15 commands that fight model bias and produce intentional, distinctive frontends. +The vocabulary you didn't know you needed. 1 skill, 15 commands, and curated anti-patterns for impeccable style. > **Visit [impeccable.style](https://impeccable.style)** to download bundles for Cursor, Claude Code, Gemini CLI, or Codex CLI. -## The Problem +## The Missing Upgrade -Every LLM learned from the same generic templates. Without guidance, you get the same predictable mistakes: Inter font, purple gradients, cards nested in cards, gray text on colored backgrounds. This framework fights that bias. +This is the missing upgrade to Anthropic's `frontend-design` skill. Every LLM learned from the same generic templates. Without guidance, you get the same predictable mistakes: Inter font, purple gradients, cards nested in cards, gray text on colored backgrounds. Design Language fights that bias with an expanded skill, 15 steering commands, and curated anti-patterns. ## What's Included @@ -83,7 +83,6 @@ cp dist/gemini/GEMINI*.md ~/your-project-root/ ```bash cp -r dist/codex/.codex/* ~/.codex/ -cp dist/codex/AGENTS*.md ~/your-project-root/ ``` ## Usage diff --git a/bun.lock b/bun.lock index 00a41834c..8928fd60b 100644 --- a/bun.lock +++ b/bun.lock @@ -5,6 +5,7 @@ "": { "name": "vibe-design-plugins", "dependencies": { + "@paper-design/shaders": "^0.0.68", "lenis": "^1.3.16", "motion": "^12.23.26", "tailwindcss": "^4.1.18", @@ -49,6 +50,8 @@ "@oven/bun-windows-x64-baseline": ["@oven/bun-windows-x64-baseline@1.3.4", "", { "os": "win32", "cpu": "x64" }, "sha512-ZQiSDFfSUdOrPTiL2GvkxlC/kMED4fsJwdZnwJK6S9ylXnk9xY/9ZXfe1615SFLQl2LsVRzJAtjQLeM0BifIKQ=="], + "@paper-design/shaders": ["@paper-design/shaders@0.0.68", "", {}, "sha512-HWDb/mYfIDcwRGYjwTFEoupw4PgdmuoNONJ6TIXBaXWj3zdhS38iNehbAWQxWa1NHtOanOeQkbdG0wvaNKhvEw=="], + "@parcel/watcher": ["@parcel/watcher@2.5.1", "", { "dependencies": { "detect-libc": "^1.0.3", "is-glob": "^4.0.3", "micromatch": "^4.0.5", "node-addon-api": "^7.0.0" }, "optionalDependencies": { "@parcel/watcher-android-arm64": "2.5.1", "@parcel/watcher-darwin-arm64": "2.5.1", "@parcel/watcher-darwin-x64": "2.5.1", "@parcel/watcher-freebsd-x64": "2.5.1", "@parcel/watcher-linux-arm-glibc": "2.5.1", "@parcel/watcher-linux-arm-musl": "2.5.1", "@parcel/watcher-linux-arm64-glibc": "2.5.1", "@parcel/watcher-linux-arm64-musl": "2.5.1", "@parcel/watcher-linux-x64-glibc": "2.5.1", "@parcel/watcher-linux-x64-musl": "2.5.1", "@parcel/watcher-win32-arm64": "2.5.1", "@parcel/watcher-win32-ia32": "2.5.1", "@parcel/watcher-win32-x64": "2.5.1" } }, "sha512-dfUnCxiN9H4ap84DvD2ubjw+3vUNpstxa0TneY/Paat8a3R4uQZDLSvWjmznAY/DoahqTHl9V46HF/Zs3F29pg=="], "@parcel/watcher-android-arm64": ["@parcel/watcher-android-arm64@2.5.1", "", { "os": "android", "cpu": "arm64" }, "sha512-KF8+j9nNbUN8vzOFDpRMsaKBHZ/mcjEjMToVMJOhTozkDonQFFrRcfdLWn6yWKCmJKmdVxSgHiYvTCef4/qcBA=="], diff --git a/dist/codex/.codex/skills/frontend-design/SKILL.md b/dist/codex/.codex/skills/frontend-design/SKILL.md new file mode 100644 index 000000000..e415ed5f7 --- /dev/null +++ b/dist/codex/.codex/skills/frontend-design/SKILL.md @@ -0,0 +1,107 @@ +--- +name: frontend-design +description: Create distinctive, production-grade frontend interfaces with comprehensive expertise in typography, color systems, spatial design, responsive layouts, interaction patterns, motion, and UX writing. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics. +license: Complete terms in LICENSE.txt +--- + +This skill guides creation of distinctive, production-grade frontend interfaces that avoid generic "AI slop" aesthetics. Implement real working code with exceptional attention to aesthetic details and creative choices. + +The user provides frontend requirements: a component, page, application, or interface to build. They may include context about the purpose, audience, or technical constraints. + +## Design Thinking + +Before coding, understand the context and commit to a BOLD aesthetic direction: +- **Purpose**: What problem does this interface solve? Who uses it? +- **Tone**: Pick an extreme: brutally minimal, maximalist chaos, retro-futuristic, organic/natural, luxury/refined, playful/toy-like, editorial/magazine, brutalist/raw, art deco/geometric, soft/pastel, industrial/utilitarian, etc. There are so many flavors to choose from. Use these for inspiration but design one that is true to the aesthetic direction. +- **Constraints**: Technical requirements (framework, performance, accessibility). +- **Differentiation**: What makes this UNFORGETTABLE? What's the one thing someone will remember? + +**CRITICAL**: Choose a clear conceptual direction and execute it with precision. Bold maximalism and refined minimalism both work - the key is intentionality, not intensity. + +Then implement working code (HTML/CSS/JS, React, Vue, etc.) that is: +- Production-grade and functional +- Visually striking and memorable +- Cohesive with a clear aesthetic point-of-view +- Meticulously refined in every detail + +## Frontend Aesthetics Guidelines + +Focus on: +- **Typography**: Choose fonts that are beautiful, unique, and interesting. Avoid generic fonts like Arial and Inter; opt instead for distinctive choices that elevate the frontend's aesthetics; unexpected, characterful font choices. Pair a distinctive display font with a refined body font. +- **Color & Theme**: Commit to a cohesive aesthetic. Use CSS variables for consistency. Dominant colors with sharp accents outperform timid, evenly-distributed palettes. +- **Motion**: Use animations for effects and micro-interactions. Prioritize CSS-only solutions for HTML. Use Motion library for React when available. Focus on high-impact moments: one well-orchestrated page load with staggered reveals (animation-delay) creates more delight than scattered micro-interactions. Use scroll-triggering and hover states that surprise. +- **Spatial Composition**: Unexpected layouts. Asymmetry. Overlap. Diagonal flow. Grid-breaking elements. Generous negative space OR controlled density. +- **Backgrounds & Visual Details**: Create atmosphere and depth rather than defaulting to solid colors. Add contextual effects and textures that match the overall aesthetic. Apply creative forms like gradient meshes, noise textures, geometric patterns, layered transparencies, dramatic shadows, decorative borders, custom cursors, and grain overlays. + +NEVER use generic AI-generated aesthetics like overused font families (Inter, Roboto, Arial, system fonts), cliched color schemes (particularly purple gradients on white backgrounds), predictable layouts and component patterns, and cookie-cutter design that lacks context-specific character. + +Interpret creatively and make unexpected choices that feel genuinely designed for the context. No design should be the same. Vary between light and dark themes, different fonts, different aesthetics. NEVER converge on common choices (Space Grotesk, for example) across generations. + +**IMPORTANT**: Match implementation complexity to the aesthetic vision. Maximalist designs need elaborate code with extensive animations and effects. Minimalist or refined designs need restraint, precision, and careful attention to spacing, typography, and subtle details. Elegance comes from executing the vision well. + +Remember: Claude is capable of extraordinary creative work. Don't hold back, show what can truly be created when thinking outside the box and committing fully to a distinctive vision. + +--- + +## Reference Files + +For deeper expertise, consult: [typography](reference/typography.md), [color](reference/color-and-contrast.md), [spatial](reference/spatial-design.md), [responsive](reference/responsive-design.md), [interaction](reference/interaction-design.md), [motion](reference/motion-design.md), [ux-writing](reference/ux-writing.md). + +## Design Patterns Reference + +This reference defines what TO do and what NOT to do when creating frontend interfaces. These patterns fight against model bias—the tendency of LLMs to converge on the same predictable choices. + +### What TO Do (Patterns) + +Focus on intentional, distinctive design choices: + +**Typography**: +- Use a modular type scale +- Pair a distinctive display font with a refined body font + +**Color & Contrast**: +- Use off-whites and near-blacks for softer, sophisticated feel +- Use the latest CSS has to offer for color and gradients + +**Layout & Space**: +- Create visual rhythm through varied spacing +- Use asymmetry and unexpected compositions +- Break the grid intentionally for emphasis + +**Motion**: +- Use motion to convey state changes effectively +- Design motion inspired by the real world (easing, staggering, etc) + +**Interaction**: +- Make interactions *feel* fast by using patterns like optimistic UI +- Use progressive disclosure of sophistication +- Make every surface intentional, actionable and delightful + +### What NOT to Do (Anti-Patterns) + +These patterns create generic "AI slop" aesthetics: + +**Typography**: +- Don't use overused fonts like Arial or Inter +- You love to put big icons with rounded corners above titles. Resist. They rarely add value and make sites look cheap. + +**Color & Contrast**: +- Don't use gray text on colored backgrounds +- Don't use pure gray or black. Always tint - pure black/gray never appears in nature. + +**Layout & Space**: +- Don't wrap everything in cards +- Don't nest cards inside cards +- Modals are lazy. Only use modals if there's truly no better alternative + +**Motion**: +- Don't animate layout properties (width, height, padding, margin) - use transform instead +- Don't use bounce or elastic easing - they feel dated and tacky; use ease-out-quart/quint/expo + +**Interaction**: +- Don't repeat the same information (redundant headers, intro restating heading, etc.) + +**Responsive**: +- Don't hide critical functionality on mobile + +These anti-patterns are baked into training data from countless generic templates. Without explicit guidance, AI reproduces them. This skill ensures your AI knows both what to do AND what to avoid. diff --git a/dist/codex/.codex/skills/frontend-design/reference/color-and-contrast.md b/dist/codex/.codex/skills/frontend-design/reference/color-and-contrast.md new file mode 100644 index 000000000..77aaf0329 --- /dev/null +++ b/dist/codex/.codex/skills/frontend-design/reference/color-and-contrast.md @@ -0,0 +1,132 @@ +# Color & Contrast + +## Color Spaces: Use OKLCH + +**Stop using HSL.** Use OKLCH (or LCH) instead. It's perceptually uniform, meaning equal steps in lightness *look* equal—unlike HSL where 50% lightness in yellow looks bright while 50% in blue looks dark. + +```css +/* OKLCH: lightness (0-100%), chroma (0-0.4+), hue (0-360) */ +--color-primary: oklch(60% 0.15 250); /* Blue */ +--color-primary-light: oklch(85% 0.08 250); /* Same hue, lighter */ +--color-primary-dark: oklch(35% 0.12 250); /* Same hue, darker */ +``` + +**Key insight**: As you move toward white or black, reduce chroma (saturation). High chroma at extreme lightness looks garish. A light blue at 85% lightness needs ~0.08 chroma, not the 0.15 of your base color. + +## Building Functional Palettes + +### The Tinted Neutral Trap + +**Pure gray is dead.** Add a subtle hint of your brand hue to all neutrals: + +```css +/* Dead grays */ +--gray-100: oklch(95% 0 0); /* No personality */ +--gray-900: oklch(15% 0 0); + +/* Warm-tinted grays (add brand warmth) */ +--gray-100: oklch(95% 0.01 60); /* Hint of warmth */ +--gray-900: oklch(15% 0.01 60); + +/* Cool-tinted grays (tech, professional) */ +--gray-100: oklch(95% 0.01 250); /* Hint of blue */ +--gray-900: oklch(15% 0.01 250); +``` + +The chroma is tiny (0.01) but perceptible. It creates subconscious cohesion between your brand color and your UI. + +### Palette Structure + +A complete system needs: + +| Role | Purpose | Example | +|------|---------|---------| +| **Primary** | Brand, CTAs, key actions | 1 color, 3-5 shades | +| **Neutral** | Text, backgrounds, borders | 9-11 shade scale | +| **Semantic** | Success, error, warning, info | 4 colors, 2-3 shades each | +| **Surface** | Cards, modals, overlays | 2-3 elevation levels | + +**Skip secondary/tertiary unless you need them.** Most apps work fine with one accent color. Adding more creates decision fatigue and visual noise. + +### The 60-30-10 Rule (Applied Correctly) + +This rule is about **visual weight**, not pixel count: + +- **60%**: Neutral backgrounds, white space, base surfaces +- **30%**: Secondary colors—text, borders, inactive states +- **10%**: Accent—CTAs, highlights, focus states + +The common mistake: using the accent color everywhere because it's "the brand color." Accent colors work *because* they're rare. Overuse kills their power. + +## Contrast & Accessibility + +### WCAG Requirements + +| Content Type | AA Minimum | AAA Target | +|--------------|------------|------------| +| Body text | 4.5:1 | 7:1 | +| Large text (18px+ or 14px bold) | 3:1 | 4.5:1 | +| UI components, icons | 3:1 | 4.5:1 | +| Non-essential decorations | None | None | + +**The gotcha**: Placeholder text still needs 4.5:1. That light gray placeholder you see everywhere? Usually fails WCAG. + +### Dangerous Color Combinations + +These commonly fail contrast or cause readability issues: + +- Light gray text on white (the #1 accessibility fail) +- **Gray text on any colored background**—gray looks washed out and dead on color. Use a darker shade of the background color, or transparency +- Red text on green background (or vice versa)—8% of men can't distinguish these +- Blue text on red background (vibrates visually) +- Yellow text on white (almost always fails) +- Thin light text on images (unpredictable contrast) + +### Never Use Pure Gray or Pure Black + +Pure gray (`oklch(50% 0 0)`) and pure black (`#000`) don't exist in nature—real shadows and surfaces always have a color cast. Even a chroma of 0.005-0.01 is enough to feel natural without being obviously tinted. (See tinted neutrals example above.) + +### Testing + +Don't trust your eyes. Use tools: + +- [WebAIM Contrast Checker](https://webaim.org/resources/contrastchecker/) +- Browser DevTools → Rendering → Emulate vision deficiencies +- [Polypane](https://polypane.app/) for real-time testing + +## Theming: Light & Dark Mode + +### Dark Mode Is Not Inverted Light Mode + +You can't just swap colors. Dark mode requires different design decisions: + +| Light Mode | Dark Mode | +|------------|-----------| +| Shadows for depth | Lighter surfaces for depth (no shadows) | +| Dark text on light | Light text on dark (reduce font weight) | +| Vibrant accents | Desaturate accents slightly | +| White backgrounds | Never pure black—use dark gray (oklch 12-18%) | + +```css +/* Dark mode depth via surface color, not shadow */ +:root[data-theme="dark"] { + --surface-1: oklch(15% 0.01 250); + --surface-2: oklch(20% 0.01 250); /* "Higher" = lighter */ + --surface-3: oklch(25% 0.01 250); + + /* Reduce text weight slightly */ + --body-weight: 350; /* Instead of 400 */ +} +``` + +### Token Hierarchy + +Use two layers: primitive tokens (`--blue-500`) and semantic tokens (`--color-primary: var(--blue-500)`). For dark mode, only redefine the semantic layer—primitives stay the same. + +## Alpha Is A Design Smell + +Heavy use of transparency (rgba, hsla) usually means an incomplete palette. Alpha creates unpredictable contrast, performance overhead, and inconsistency. Define explicit overlay colors for each context instead. Exception: focus rings and interactive states where see-through is needed. + +--- + +**Avoid**: Relying on color alone to convey information. Creating palettes without clear roles for each color. Using pure black (#000) for large areas. Skipping color blindness testing (8% of men affected). diff --git a/dist/codex/.codex/skills/frontend-design/reference/interaction-design.md b/dist/codex/.codex/skills/frontend-design/reference/interaction-design.md new file mode 100644 index 000000000..10a77564b --- /dev/null +++ b/dist/codex/.codex/skills/frontend-design/reference/interaction-design.md @@ -0,0 +1,123 @@ +# Interaction Design + +## The Eight Interactive States + +Every interactive element needs these states designed: + +| State | When | Visual Treatment | +|-------|------|------------------| +| **Default** | At rest | Base styling | +| **Hover** | Pointer over (not touch) | Subtle lift, color shift | +| **Focus** | Keyboard/programmatic focus | Visible ring (see below) | +| **Active** | Being pressed | Pressed in, darker | +| **Disabled** | Not interactive | Reduced opacity, no pointer | +| **Loading** | Processing | Spinner, skeleton | +| **Error** | Invalid state | Red border, icon, message | +| **Success** | Completed | Green check, confirmation | + +**The common miss**: Designing hover without focus, or vice versa. They're different. Keyboard users never see hover states. + +## Focus Rings: Do Them Right + +**Never `outline: none` without replacement.** It's an accessibility violation. Instead, use `:focus-visible` to show focus only for keyboard users: + +```css +/* Hide focus ring for mouse/touch */ +button:focus { + outline: none; +} + +/* Show focus ring for keyboard */ +button:focus-visible { + outline: 2px solid var(--color-accent); + outline-offset: 2px; +} +``` + +**Focus ring design**: +- High contrast (3:1 minimum against adjacent colors) +- 2-3px thick +- Offset from element (not inside it) +- Consistent across all interactive elements + +## Form Design: The Non-Obvious + +**Placeholders aren't labels**—they disappear on input. Always use visible `