@theproductguy/create-mission-control 1.0.3 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/bin/cli.js +11 -4
  2. package/package.json +2 -2
  3. package/src/template/agent-os/commands/export-product/export-product.md +24 -0
  4. package/src/template/agent-os/commands/initialize-design/initialize-design.md +10 -1
  5. package/src/template/control-center/backend/index.js +9 -3
  6. package/src/template/control-center/frontend/src/App.tsx +34 -1
  7. package/src/template/design-system/{.claude → .gemini}/commands/design-os/design-shell.md +95 -69
  8. package/src/template/design-system/.gemini/commands/design-os/design-tokens.md +211 -0
  9. package/src/template/design-system/.gemini/commands/impeccable/WORKFLOW.md +163 -0
  10. package/src/template/design-system/.gemini/commands/impeccable/adapt.md +189 -0
  11. package/src/template/design-system/.gemini/commands/impeccable/animate.md +184 -0
  12. package/src/template/design-system/.gemini/commands/impeccable/audit.md +123 -0
  13. package/src/template/design-system/.gemini/commands/impeccable/bolder.md +126 -0
  14. package/src/template/design-system/.gemini/commands/impeccable/clarify.md +173 -0
  15. package/src/template/design-system/.gemini/commands/impeccable/colorize.md +152 -0
  16. package/src/template/design-system/.gemini/commands/impeccable/critique.md +112 -0
  17. package/src/template/design-system/.gemini/commands/impeccable/delight.md +311 -0
  18. package/src/template/design-system/.gemini/commands/impeccable/extract.md +88 -0
  19. package/src/template/design-system/.gemini/commands/impeccable/harden.md +351 -0
  20. package/src/template/design-system/.gemini/commands/impeccable/normalize.md +61 -0
  21. package/src/template/design-system/.gemini/commands/impeccable/onboard.md +236 -0
  22. package/src/template/design-system/.gemini/commands/impeccable/optimize.md +262 -0
  23. package/src/template/design-system/.gemini/commands/impeccable/polish.md +196 -0
  24. package/src/template/design-system/.gemini/commands/impeccable/quieter.md +112 -0
  25. package/src/template/design-system/.gemini/commands/impeccable/simplify.md +131 -0
  26. package/src/template/design-system/.gemini/commands/impeccable/teach-impeccable.md +67 -0
  27. package/src/template/design-system/.gemini/skills/frontend-design/SKILL.md +126 -0
  28. package/src/template/design-system/.gemini/skills/frontend-design/reference/color-and-contrast.md +132 -0
  29. package/src/template/design-system/.gemini/skills/frontend-design/reference/interaction-design.md +123 -0
  30. package/src/template/design-system/.gemini/skills/frontend-design/reference/motion-design.md +99 -0
  31. package/src/template/design-system/.gemini/skills/frontend-design/reference/responsive-design.md +114 -0
  32. package/src/template/design-system/.gemini/skills/frontend-design/reference/spatial-design.md +100 -0
  33. package/src/template/design-system/.gemini/skills/frontend-design/reference/typography.md +131 -0
  34. package/src/template/design-system/.gemini/skills/frontend-design/reference/ux-writing.md +107 -0
  35. package/src/template/design-system/src/components/DesignPage.tsx +104 -0
  36. package/src/template/package-lock.json +10308 -0
  37. package/src/template/design-system/.claude/commands/design-os/design-tokens.md +0 -166
  38. package/src/template/design-system/.claude/skills/frontend-design/SKILL.md +0 -42
  39. /package/src/template/design-system/{.claude → .gemini}/commands/design-os/data-model.md +0 -0
  40. /package/src/template/design-system/{.claude → .gemini}/commands/design-os/design-screen.md +0 -0
  41. /package/src/template/design-system/{.claude → .gemini}/commands/design-os/export-product.md +0 -0
  42. /package/src/template/design-system/{.claude → .gemini}/commands/design-os/product-roadmap.md +0 -0
  43. /package/src/template/design-system/{.claude → .gemini}/commands/design-os/product-vision.md +0 -0
  44. /package/src/template/design-system/{.claude → .gemini}/commands/design-os/sample-data.md +0 -0
  45. /package/src/template/design-system/{.claude → .gemini}/commands/design-os/screenshot-design.md +0 -0
  46. /package/src/template/design-system/{.claude → .gemini}/commands/design-os/shape-section.md +0 -0
  47. /package/src/template/design-system/{claude.md → gemini.md} +0 -0
@@ -0,0 +1,131 @@
1
+ # COMMAND: Simplify
2
+ **Description**: Strip designs to their essence by removing unnecessary complexity. Great design is simple, powerful, and clean.
3
+
4
+
5
+ Remove unnecessary complexity from designs, revealing the essential elements and creating clarity through ruthless simplification.
6
+
7
+ ## MANDATORY PREPARATION
8
+
9
+ ### Context Gathering (Do This First)
10
+
11
+ You cannot do a great job without having necessary context, such as target audience (critical), desired use-cases (critical), and understanding what's truly essential vs nice-to-have for this product.
12
+
13
+ Attempt to gather these from the current thread or codebase.
14
+
15
+ 1. If you don't find *exact* information and have to infer from existing design and functionality, you MUST STOP and ask the user directly to clarify what you cannot infer. whether you got it right.
16
+ 2. Otherwise, if you can't fully infer or your level of confidence is medium or lower, you MUST ask the user directly to clarify what you cannot infer. clarifying questions first to complete your context.
17
+
18
+ Do NOT proceed until you have answers. Simplifying the wrong things destroys usability.
19
+
20
+ ### Use frontend-design skill
21
+
22
+ Use the frontend-design skill for design principles and anti-patterns. Do NOT proceed until it has executed and you know all DO's and DON'Ts.
23
+
24
+ ---
25
+
26
+ ## Assess Current State
27
+
28
+ Analyze what makes the design feel complex or cluttered:
29
+
30
+ 1. **Identify complexity sources**:
31
+ - **Too many elements**: Competing buttons, redundant information, visual clutter
32
+ - **Excessive variation**: Too many colors, fonts, sizes, styles without purpose
33
+ - **Information overload**: Everything visible at once, no progressive disclosure
34
+ - **Visual noise**: Unnecessary borders, shadows, backgrounds, decorations
35
+ - **Confusing hierarchy**: Unclear what matters most
36
+ - **Feature creep**: Too many options, actions, or paths forward
37
+
38
+ 2. **Find the essence**:
39
+ - What's the primary user goal? (There should be ONE)
40
+ - What's actually necessary vs nice-to-have?
41
+ - What can be removed, hidden, or combined?
42
+ - What's the 20% that delivers 80% of value?
43
+
44
+ If any of these are unclear from the codebase, ask the user directly to clarify what you cannot infer.
45
+
46
+ **CRITICAL**: Simplicity is not about removing features - it's about removing obstacles between users and their goals. Every element should justify its existence.
47
+
48
+ ## Plan Simplification
49
+
50
+ Create a ruthless editing strategy:
51
+
52
+ - **Core purpose**: What's the ONE thing this should accomplish?
53
+ - **Essential elements**: What's truly necessary to achieve that purpose?
54
+ - **Progressive disclosure**: What can be hidden until needed?
55
+ - **Consolidation opportunities**: What can be combined or integrated?
56
+
57
+ **IMPORTANT**: Simplification is hard. It requires saying no to good ideas to make room for great execution. Be ruthless.
58
+
59
+ ## Simplify the Design
60
+
61
+ Systematically remove complexity across these dimensions:
62
+
63
+ ### Information Architecture
64
+ - **Reduce scope**: Remove secondary actions, optional features, redundant information
65
+ - **Progressive disclosure**: Hide complexity behind clear entry points (accordions, modals, step-through flows)
66
+ - **Combine related actions**: Merge similar buttons, consolidate forms, group related content
67
+ - **Clear hierarchy**: ONE primary action, few secondary actions, everything else tertiary or hidden
68
+ - **Remove redundancy**: If it's said elsewhere, don't repeat it here
69
+
70
+ ### Visual Simplification
71
+ - **Reduce color palette**: Use 1-2 colors plus neutrals, not 5-7 colors
72
+ - **Limit typography**: One font family, 3-4 sizes maximum, 2-3 weights
73
+ - **Remove decorations**: Eliminate borders, shadows, backgrounds that don't serve hierarchy or function
74
+ - **Flatten structure**: Reduce nesting, remove unnecessary containers—never nest cards inside cards
75
+ - **Remove unnecessary cards**: Cards aren't needed for basic layout; use spacing and alignment instead
76
+ - **Consistent spacing**: Use one spacing scale, remove arbitrary gaps
77
+
78
+ ### Layout Simplification
79
+ - **Linear flow**: Replace complex grids with simple vertical flow where possible
80
+ - **Remove sidebars**: Move secondary content inline or hide it
81
+ - **Full-width**: Use available space generously instead of complex multi-column layouts
82
+ - **Consistent alignment**: Pick left or center, stick with it
83
+ - **Generous white space**: Let content breathe, don't pack everything tight
84
+
85
+ ### Interaction Simplification
86
+ - **Reduce choices**: Fewer buttons, fewer options, clearer path forward (paradox of choice is real)
87
+ - **Smart defaults**: Make common choices automatic, only ask when necessary
88
+ - **Inline actions**: Replace modal flows with inline editing where possible
89
+ - **Remove steps**: Can signup be one step instead of three? Can checkout be simplified?
90
+ - **Clear CTAs**: ONE obvious next step, not five competing actions
91
+
92
+ ### Content Simplification
93
+ - **Shorter copy**: Cut every sentence in half, then do it again
94
+ - **Active voice**: "Save changes" not "Changes will be saved"
95
+ - **Remove jargon**: Plain language always wins
96
+ - **Scannable structure**: Short paragraphs, bullet points, clear headings
97
+ - **Essential information only**: Remove marketing fluff, legalese, hedging
98
+ - **Remove redundant copy**: No headers restating intros, no repeated explanations, say it once
99
+
100
+ ### Code Simplification
101
+ - **Remove unused code**: Dead CSS, unused components, orphaned files
102
+ - **Flatten component trees**: Reduce nesting depth
103
+ - **Consolidate styles**: Merge similar styles, use utilities consistently
104
+ - **Reduce variants**: Does that component need 12 variations, or can 3 cover 90% of cases?
105
+
106
+ **NEVER**:
107
+ - Remove necessary functionality (simplicity ≠ feature-less)
108
+ - Sacrifice accessibility for simplicity (clear labels and ARIA still required)
109
+ - Make things so simple they're unclear (mystery ≠ minimalism)
110
+ - Remove information users need to make decisions
111
+ - Eliminate hierarchy completely (some things should stand out)
112
+ - Oversimplify complex domains (match complexity to actual task complexity)
113
+
114
+ ## Verify Simplification
115
+
116
+ Ensure simplification improves usability:
117
+
118
+ - **Faster task completion**: Can users accomplish goals more quickly?
119
+ - **Reduced cognitive load**: Is it easier to understand what to do?
120
+ - **Still complete**: Are all necessary features still accessible?
121
+ - **Clearer hierarchy**: Is it obvious what matters most?
122
+ - **Better performance**: Does simpler design load faster?
123
+
124
+ ## Document Removed Complexity
125
+
126
+ If you removed features or options:
127
+ - Document why they were removed
128
+ - Consider if they need alternative access points
129
+ - Note any user feedback to monitor
130
+
131
+ Remember: You have great taste and judgment. Simplification is an act of confidence - knowing what to keep and courage to remove the rest. As Antoine de Saint-Exupéry said: "Perfection is achieved not when there is nothing more to add, but when there is nothing left to take away."
@@ -0,0 +1,67 @@
1
+ # COMMAND: Teach-impeccable
2
+ **Description**: One-time setup that gathers design context for your project and saves it to your AI config file. Run once to establish persistent design guidelines.
3
+
4
+
5
+ Gather design context for this project, then persist it for all future sessions.
6
+
7
+ ## Step 1: Explore the Codebase
8
+
9
+ Before asking questions, thoroughly scan the project to discover what you can:
10
+
11
+ - **README and docs**: Project purpose, target audience, any stated goals
12
+ - **Package.json / config files**: Tech stack, dependencies, existing design libraries
13
+ - **Existing components**: Current design patterns, spacing, typography in use
14
+ - **Brand assets**: Logos, favicons, color values already defined
15
+ - **Design tokens / CSS variables**: Existing color palettes, font stacks, spacing scales
16
+ - **Any style guides or brand documentation**
17
+
18
+ Note what you've learned and what remains unclear.
19
+
20
+ ## Step 2: Ask UX-Focused Questions
21
+
22
+ ask the user directly to clarify what you cannot infer. Focus only on what you couldn't infer from the codebase:
23
+
24
+ ### Users & Purpose
25
+ - Who uses this? What's their context when using it?
26
+ - What job are they trying to get done?
27
+ - What emotions should the interface evoke? (confidence, delight, calm, urgency, etc.)
28
+
29
+ ### Brand & Personality
30
+ - How would you describe the brand personality in 3 words?
31
+ - Any reference sites or apps that capture the right feel? What specifically about them?
32
+ - What should this explicitly NOT look like? Any anti-references?
33
+
34
+ ### Aesthetic Preferences
35
+ - Any strong preferences for visual direction? (minimal, bold, elegant, playful, technical, organic, etc.)
36
+ - Light mode, dark mode, or both?
37
+ - Any colors that must be used or avoided?
38
+
39
+ ### Accessibility & Inclusion
40
+ - Specific accessibility requirements? (WCAG level, known user needs)
41
+ - Considerations for reduced motion, color blindness, or other accommodations?
42
+
43
+ Skip questions where the answer is already clear from the codebase exploration.
44
+
45
+ ## Step 3: Write Design Context
46
+
47
+ Synthesize your findings and the user's answers into a `## Design Context` section:
48
+
49
+ ```markdown
50
+ ## Design Context
51
+
52
+ ### Users
53
+ [Who they are, their context, the job to be done]
54
+
55
+ ### Brand Personality
56
+ [Voice, tone, 3-word personality, emotional goals]
57
+
58
+ ### Aesthetic Direction
59
+ [Visual tone, references, anti-references, theme]
60
+
61
+ ### Design Principles
62
+ [3-5 principles derived from the conversation that should guide all design decisions]
63
+ ```
64
+
65
+ Write this section to GEMINI.md in the project root. If the file exists, append or update the Design Context section.
66
+
67
+ Confirm completion and summarize the key design principles that will now guide all future work.
@@ -0,0 +1,126 @@
1
+ ---
2
+ name: frontend-design
3
+ description: Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, artifacts, posters, or applications. Generates creative, polished code that avoids generic AI aesthetics.
4
+ ---
5
+
6
+ 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.
7
+
8
+ ## Design Direction
9
+
10
+ Commit to a BOLD aesthetic direction:
11
+ - **Purpose**: What problem does this interface solve? Who uses it?
12
+ - **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.
13
+ - **Constraints**: Technical requirements (framework, performance, accessibility).
14
+ - **Differentiation**: What makes this UNFORGETTABLE? What's the one thing someone will remember?
15
+
16
+ **CRITICAL**: Choose a clear conceptual direction and execute it with precision. Bold maximalism and refined minimalism both work—the key is intentionality, not intensity.
17
+
18
+ Then implement working code that is:
19
+ - Production-grade and functional
20
+ - Visually striking and memorable
21
+ - Cohesive with a clear aesthetic point-of-view
22
+ - Meticulously refined in every detail
23
+
24
+ ## Frontend Aesthetics Guidelines
25
+
26
+ ### Typography
27
+ → *Consult [typography reference](reference/typography.md) for scales, pairing, and loading strategies.*
28
+
29
+ Choose fonts that are beautiful, unique, and interesting. Pair a distinctive display font with a refined body font.
30
+
31
+ **DO**: Use a modular type scale with fluid sizing (clamp)
32
+ **DO**: Vary font weights and sizes to create clear visual hierarchy
33
+ **DON'T**: Use overused fonts—Inter, Roboto, Arial, Open Sans, system defaults
34
+ **DON'T**: Use monospace typography as lazy shorthand for "technical/developer" vibes
35
+ **DON'T**: Put large icons with rounded corners above every heading—they rarely add value and make sites look templated
36
+
37
+ ### Color & Theme
38
+ → *Consult [color reference](reference/color-and-contrast.md) for OKLCH, palettes, and dark mode.*
39
+
40
+ Commit to a cohesive palette. Dominant colors with sharp accents outperform timid, evenly-distributed palettes.
41
+
42
+ **DO**: Use modern CSS color functions (oklch, color-mix, light-dark) for perceptually uniform, maintainable palettes
43
+ **DO**: Tint your neutrals toward your brand hue—even a subtle hint creates subconscious cohesion
44
+ **DON'T**: Use gray text on colored backgrounds—it looks washed out; use a shade of the background color instead
45
+ **DON'T**: Use pure black (#000) or pure white (#fff)—always tint; pure black/white never appears in nature
46
+ **DON'T**: Use the AI color palette: cyan-on-dark, purple-to-blue gradients, neon accents on dark backgrounds
47
+ **DON'T**: Use gradient text for "impact"—especially on metrics or headings; it's decorative rather than meaningful
48
+ **DON'T**: Default to dark mode with glowing accents—it looks "cool" without requiring actual design decisions
49
+
50
+ ### Layout & Space
51
+ → *Consult [spatial reference](reference/spatial-design.md) for grids, rhythm, and container queries.*
52
+
53
+ Create visual rhythm through varied spacing—not the same padding everywhere. Embrace asymmetry and unexpected compositions. Break the grid intentionally for emphasis.
54
+
55
+ **DO**: Create visual rhythm through varied spacing—tight groupings, generous separations
56
+ **DO**: Use fluid spacing with clamp() that breathes on larger screens
57
+ **DO**: Use asymmetry and unexpected compositions; break the grid intentionally for emphasis
58
+ **DON'T**: Wrap everything in cards—not everything needs a container
59
+ **DON'T**: Nest cards inside cards—visual noise, flatten the hierarchy
60
+ **DON'T**: Use identical card grids—same-sized cards with icon + heading + text, repeated endlessly
61
+ **DON'T**: Use the hero metric layout template—big number, small label, supporting stats, gradient accent
62
+ **DON'T**: Center everything—left-aligned text with asymmetric layouts feels more designed
63
+ **DON'T**: Use the same spacing everywhere—without rhythm, layouts feel monotonous
64
+
65
+ ### Visual Details
66
+ **DO**: Use intentional, purposeful decorative elements that reinforce brand
67
+ **DON'T**: Use glassmorphism everywhere—blur effects, glass cards, glow borders used decoratively rather than purposefully
68
+ **DON'T**: Use rounded elements with thick colored border on one side—a lazy accent that almost never looks intentional
69
+ **DON'T**: Use sparklines as decoration—tiny charts that look sophisticated but convey nothing meaningful
70
+ **DON'T**: Use rounded rectangles with generic drop shadows—safe, forgettable, could be any AI output
71
+ **DON'T**: Use modals unless there's truly no better alternative—modals are lazy
72
+
73
+ ### Motion
74
+ → *Consult [motion reference](reference/motion-design.md) for timing, easing, and reduced motion.*
75
+
76
+ Focus on high-impact moments: one well-orchestrated page load with staggered reveals creates more delight than scattered micro-interactions.
77
+
78
+ **DO**: Use motion to convey state changes—entrances, exits, feedback
79
+ **DO**: Use exponential easing (ease-out-quart/quint/expo) for natural deceleration
80
+ **DO**: For height animations, use grid-template-rows transitions instead of animating height directly
81
+ **DON'T**: Animate layout properties (width, height, padding, margin)—use transform and opacity only
82
+ **DON'T**: Use bounce or elastic easing—they feel dated and tacky; real objects decelerate smoothly
83
+
84
+ ### Interaction
85
+ → *Consult [interaction reference](reference/interaction-design.md) for forms, focus, and loading patterns.*
86
+
87
+ Make interactions feel fast. Use optimistic UI—update immediately, sync later.
88
+
89
+ **DO**: Use progressive disclosure—start simple, reveal sophistication through interaction (basic options first, advanced behind expandable sections; hover states that reveal secondary actions)
90
+ **DO**: Design empty states that teach the interface, not just say "nothing here"
91
+ **DO**: Make every interactive surface feel intentional and responsive
92
+ **DON'T**: Repeat the same information—redundant headers, intros that restate the heading
93
+ **DON'T**: Make every button primary—use ghost buttons, text links, secondary styles; hierarchy matters
94
+
95
+ ### Responsive
96
+ → *Consult [responsive reference](reference/responsive-design.md) for mobile-first, fluid design, and container queries.*
97
+
98
+ **DO**: Use container queries (@container) for component-level responsiveness
99
+ **DO**: Adapt the interface for different contexts—don't just shrink it
100
+ **DON'T**: Hide critical functionality on mobile—adapt the interface, don't amputate it
101
+
102
+ ### UX Writing
103
+ → *Consult [ux-writing reference](reference/ux-writing.md) for labels, errors, and empty states.*
104
+
105
+ **DO**: Make every word earn its place
106
+ **DON'T**: Repeat information users can already see
107
+
108
+ ---
109
+
110
+ ## The AI Slop Test
111
+
112
+ **Critical quality check**: If you showed this interface to someone and said "AI made this," would they believe you immediately? If yes, that's the problem.
113
+
114
+ A distinctive interface should make someone ask "how was this made?" not "which AI made this?"
115
+
116
+ Review the DON'T guidelines above—they are the fingerprints of AI-generated work from 2024-2025.
117
+
118
+ ---
119
+
120
+ ## Implementation Principles
121
+
122
+ 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.
123
+
124
+ 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 across generations.
125
+
126
+ Remember: Gemini 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.
@@ -0,0 +1,132 @@
1
+ # Color & Contrast
2
+
3
+ ## Color Spaces: Use OKLCH
4
+
5
+ **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.
6
+
7
+ ```css
8
+ /* OKLCH: lightness (0-100%), chroma (0-0.4+), hue (0-360) */
9
+ --color-primary: oklch(60% 0.15 250); /* Blue */
10
+ --color-primary-light: oklch(85% 0.08 250); /* Same hue, lighter */
11
+ --color-primary-dark: oklch(35% 0.12 250); /* Same hue, darker */
12
+ ```
13
+
14
+ **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.
15
+
16
+ ## Building Functional Palettes
17
+
18
+ ### The Tinted Neutral Trap
19
+
20
+ **Pure gray is dead.** Add a subtle hint of your brand hue to all neutrals:
21
+
22
+ ```css
23
+ /* Dead grays */
24
+ --gray-100: oklch(95% 0 0); /* No personality */
25
+ --gray-900: oklch(15% 0 0);
26
+
27
+ /* Warm-tinted grays (add brand warmth) */
28
+ --gray-100: oklch(95% 0.01 60); /* Hint of warmth */
29
+ --gray-900: oklch(15% 0.01 60);
30
+
31
+ /* Cool-tinted grays (tech, professional) */
32
+ --gray-100: oklch(95% 0.01 250); /* Hint of blue */
33
+ --gray-900: oklch(15% 0.01 250);
34
+ ```
35
+
36
+ The chroma is tiny (0.01) but perceptible. It creates subconscious cohesion between your brand color and your UI.
37
+
38
+ ### Palette Structure
39
+
40
+ A complete system needs:
41
+
42
+ | Role | Purpose | Example |
43
+ |------|---------|---------|
44
+ | **Primary** | Brand, CTAs, key actions | 1 color, 3-5 shades |
45
+ | **Neutral** | Text, backgrounds, borders | 9-11 shade scale |
46
+ | **Semantic** | Success, error, warning, info | 4 colors, 2-3 shades each |
47
+ | **Surface** | Cards, modals, overlays | 2-3 elevation levels |
48
+
49
+ **Skip secondary/tertiary unless you need them.** Most apps work fine with one accent color. Adding more creates decision fatigue and visual noise.
50
+
51
+ ### The 60-30-10 Rule (Applied Correctly)
52
+
53
+ This rule is about **visual weight**, not pixel count:
54
+
55
+ - **60%**: Neutral backgrounds, white space, base surfaces
56
+ - **30%**: Secondary colors—text, borders, inactive states
57
+ - **10%**: Accent—CTAs, highlights, focus states
58
+
59
+ 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.
60
+
61
+ ## Contrast & Accessibility
62
+
63
+ ### WCAG Requirements
64
+
65
+ | Content Type | AA Minimum | AAA Target |
66
+ |--------------|------------|------------|
67
+ | Body text | 4.5:1 | 7:1 |
68
+ | Large text (18px+ or 14px bold) | 3:1 | 4.5:1 |
69
+ | UI components, icons | 3:1 | 4.5:1 |
70
+ | Non-essential decorations | None | None |
71
+
72
+ **The gotcha**: Placeholder text still needs 4.5:1. That light gray placeholder you see everywhere? Usually fails WCAG.
73
+
74
+ ### Dangerous Color Combinations
75
+
76
+ These commonly fail contrast or cause readability issues:
77
+
78
+ - Light gray text on white (the #1 accessibility fail)
79
+ - **Gray text on any colored background**—gray looks washed out and dead on color. Use a darker shade of the background color, or transparency
80
+ - Red text on green background (or vice versa)—8% of men can't distinguish these
81
+ - Blue text on red background (vibrates visually)
82
+ - Yellow text on white (almost always fails)
83
+ - Thin light text on images (unpredictable contrast)
84
+
85
+ ### Never Use Pure Gray or Pure Black
86
+
87
+ 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.)
88
+
89
+ ### Testing
90
+
91
+ Don't trust your eyes. Use tools:
92
+
93
+ - [WebAIM Contrast Checker](https://webaim.org/resources/contrastchecker/)
94
+ - Browser DevTools → Rendering → Emulate vision deficiencies
95
+ - [Polypane](https://polypane.app/) for real-time testing
96
+
97
+ ## Theming: Light & Dark Mode
98
+
99
+ ### Dark Mode Is Not Inverted Light Mode
100
+
101
+ You can't just swap colors. Dark mode requires different design decisions:
102
+
103
+ | Light Mode | Dark Mode |
104
+ |------------|-----------|
105
+ | Shadows for depth | Lighter surfaces for depth (no shadows) |
106
+ | Dark text on light | Light text on dark (reduce font weight) |
107
+ | Vibrant accents | Desaturate accents slightly |
108
+ | White backgrounds | Never pure black—use dark gray (oklch 12-18%) |
109
+
110
+ ```css
111
+ /* Dark mode depth via surface color, not shadow */
112
+ :root[data-theme="dark"] {
113
+ --surface-1: oklch(15% 0.01 250);
114
+ --surface-2: oklch(20% 0.01 250); /* "Higher" = lighter */
115
+ --surface-3: oklch(25% 0.01 250);
116
+
117
+ /* Reduce text weight slightly */
118
+ --body-weight: 350; /* Instead of 400 */
119
+ }
120
+ ```
121
+
122
+ ### Token Hierarchy
123
+
124
+ 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.
125
+
126
+ ## Alpha Is A Design Smell
127
+
128
+ 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.
129
+
130
+ ---
131
+
132
+ **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).
@@ -0,0 +1,123 @@
1
+ # Interaction Design
2
+
3
+ ## The Eight Interactive States
4
+
5
+ Every interactive element needs these states designed:
6
+
7
+ | State | When | Visual Treatment |
8
+ |-------|------|------------------|
9
+ | **Default** | At rest | Base styling |
10
+ | **Hover** | Pointer over (not touch) | Subtle lift, color shift |
11
+ | **Focus** | Keyboard/programmatic focus | Visible ring (see below) |
12
+ | **Active** | Being pressed | Pressed in, darker |
13
+ | **Disabled** | Not interactive | Reduced opacity, no pointer |
14
+ | **Loading** | Processing | Spinner, skeleton |
15
+ | **Error** | Invalid state | Red border, icon, message |
16
+ | **Success** | Completed | Green check, confirmation |
17
+
18
+ **The common miss**: Designing hover without focus, or vice versa. They're different. Keyboard users never see hover states.
19
+
20
+ ## Focus Rings: Do Them Right
21
+
22
+ **Never `outline: none` without replacement.** It's an accessibility violation. Instead, use `:focus-visible` to show focus only for keyboard users:
23
+
24
+ ```css
25
+ /* Hide focus ring for mouse/touch */
26
+ button:focus {
27
+ outline: none;
28
+ }
29
+
30
+ /* Show focus ring for keyboard */
31
+ button:focus-visible {
32
+ outline: 2px solid var(--color-accent);
33
+ outline-offset: 2px;
34
+ }
35
+ ```
36
+
37
+ **Focus ring design**:
38
+ - High contrast (3:1 minimum against adjacent colors)
39
+ - 2-3px thick
40
+ - Offset from element (not inside it)
41
+ - Consistent across all interactive elements
42
+
43
+ ## Form Design: The Non-Obvious
44
+
45
+ **Placeholders aren't labels**—they disappear on input. Always use visible `<label>` elements. **Validate on blur**, not on every keystroke (exception: password strength). Place errors **below** fields with `aria-describedby` connecting them.
46
+
47
+ ## Loading States
48
+
49
+ **Optimistic updates**: Show success immediately, rollback on failure. Use for low-stakes actions (likes, follows), not payments or destructive actions. **Skeleton screens > spinners**—they preview content shape and feel faster than generic spinners.
50
+
51
+ ## Modals: The Inert Approach
52
+
53
+ Focus trapping in modals used to require complex JavaScript. Now use the `inert` attribute:
54
+
55
+ ```html
56
+ <!-- When modal is open -->
57
+ <main inert>
58
+ <!-- Content behind modal can't be focused or clicked -->
59
+ </main>
60
+ <dialog open>
61
+ <h2>Modal Title</h2>
62
+ <!-- Focus stays inside modal -->
63
+ </dialog>
64
+ ```
65
+
66
+ Or use the native `<dialog>` element:
67
+
68
+ ```javascript
69
+ const dialog = document.querySelector('dialog');
70
+ dialog.showModal(); // Opens with focus trap, closes on Escape
71
+ ```
72
+
73
+ ## The Popover API
74
+
75
+ For tooltips, dropdowns, and non-modal overlays, use native popovers:
76
+
77
+ ```html
78
+ <button popovertarget="menu">Open menu</button>
79
+ <div id="menu" popover>
80
+ <button>Option 1</button>
81
+ <button>Option 2</button>
82
+ </div>
83
+ ```
84
+
85
+ **Benefits**: Light-dismiss (click outside closes), proper stacking, no z-index wars, accessible by default.
86
+
87
+ ## Destructive Actions: Undo > Confirm
88
+
89
+ **Undo is better than confirmation dialogs**—users click through confirmations mindlessly. Remove from UI immediately, show undo toast, actually delete after toast expires. Use confirmation only for truly irreversible actions (account deletion), high-cost actions, or batch operations.
90
+
91
+ ## Keyboard Navigation Patterns
92
+
93
+ ### Roving Tabindex
94
+
95
+ For component groups (tabs, menu items, radio groups), one item is tabbable; arrow keys move within:
96
+
97
+ ```html
98
+ <div role="tablist">
99
+ <button role="tab" tabindex="0">Tab 1</button>
100
+ <button role="tab" tabindex="-1">Tab 2</button>
101
+ <button role="tab" tabindex="-1">Tab 3</button>
102
+ </div>
103
+ ```
104
+
105
+ Arrow keys move `tabindex="0"` between items. Tab moves to the next component entirely.
106
+
107
+ ### Skip Links
108
+
109
+ Provide skip links (`<a href="#main-content">Skip to main content</a>`) for keyboard users to jump past navigation. Hide off-screen, show on focus.
110
+
111
+ ## Gesture Discoverability
112
+
113
+ Swipe-to-delete and similar gestures are invisible. Hint at their existence:
114
+
115
+ - **Partially reveal**: Show delete button peeking from edge
116
+ - **Onboarding**: Coach marks on first use
117
+ - **Alternative**: Always provide a visible fallback (menu with "Delete")
118
+
119
+ Don't rely on gestures as the only way to perform actions.
120
+
121
+ ---
122
+
123
+ **Avoid**: Removing focus indicators without alternatives. Using placeholder text as labels. Touch targets <44x44px. Generic error messages. Custom controls without ARIA/keyboard support.