@ia-ccun/code-agent-cli 0.0.2 → 0.0.4-8.beta.1
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.
- package/README.md +92 -11
- package/bin/cli.js +212 -59
- package/config/agent/APPEND_SYSTEM.md +46 -5
- package/config/agent/bin/fd +0 -0
- package/config/agent/bin/rg +0 -0
- package/config/agent/dangerous-patterns.json +106 -0
- package/config/agent/extensions/aicode-tips.ts +191 -0
- package/config/agent/extensions/bash-check.ts +227 -0
- package/config/agent/extensions/context-monitor.ts +275 -0
- package/config/agent/extensions/context.ts +1 -0
- package/config/agent/extensions/custom-footer.ts +33 -2
- package/config/agent/extensions/custom.ts +24 -91
- package/config/agent/extensions/error-monitor.ts +142 -0
- package/config/agent/extensions/msg-debug.ts +185 -0
- package/config/agent/extensions/review.ts +4 -0
- package/config/agent/extensions/working-msg.ts +39 -20
- package/config/agent/mcp.json +4 -0
- package/config/agent/models.json +16 -43
- package/config/agent/prompts/code-simplifier.md +51 -0
- package/config/agent/prompts/feat.md +2 -2
- package/config/agent/prompts/git-commit.md +9 -15
- package/config/agent/prompts/init-project.md +2 -1
- package/config/agent/prompts/workflow.md +3 -2
- package/config/agent/settings.json +17 -5
- package/config/agent/skills/brainstorming/SKILL.md +167 -0
- package/config/agent/skills/brainstorming/scripts/frame-template.html +214 -0
- package/config/agent/skills/brainstorming/scripts/helper.js +88 -0
- package/config/agent/skills/brainstorming/scripts/server.cjs +338 -0
- package/config/agent/skills/brainstorming/scripts/start-server.sh +153 -0
- package/config/agent/skills/brainstorming/scripts/stop-server.sh +55 -0
- package/config/agent/skills/brainstorming/spec-document-reviewer-prompt.md +49 -0
- package/config/agent/skills/brainstorming/visual-companion.md +286 -0
- package/config/agent/skills/code-review/SKILL.md +4 -2
- package/config/agent/skills/commit/SKILL.md +10 -5
- package/config/agent/skills/csv-data-summarizer/SKILL.md +2 -1
- package/config/agent/skills/design-md/README.md +34 -0
- package/config/agent/skills/design-md/SKILL.md +172 -0
- package/config/agent/skills/design-md/examples/DESIGN.md +154 -0
- package/config/agent/skills/dispatching-parallel-agents/SKILL.md +185 -0
- package/config/agent/skills/executing-plans/SKILL.md +73 -0
- package/config/agent/skills/find-skills/SKILL.md +5 -1
- package/config/agent/skills/finishing-a-development-branch/SKILL.md +204 -0
- package/config/agent/skills/fireworks-tech-graph/LICENSE +21 -0
- package/config/agent/skills/fireworks-tech-graph/README.md +528 -0
- package/config/agent/skills/fireworks-tech-graph/README.zh.md +499 -0
- package/config/agent/skills/fireworks-tech-graph/SKILL.md +537 -0
- package/config/agent/skills/fireworks-tech-graph/agentloop-core.svg +101 -0
- package/config/agent/skills/fireworks-tech-graph/agents/openai.yaml +4 -0
- package/config/agent/skills/fireworks-tech-graph/assets/samples/sample-style1-flat.png +0 -0
- package/config/agent/skills/fireworks-tech-graph/assets/samples/sample-style2-dark.png +0 -0
- package/config/agent/skills/fireworks-tech-graph/assets/samples/sample-style3-blueprint.png +0 -0
- package/config/agent/skills/fireworks-tech-graph/assets/samples/sample-style4-notion.png +0 -0
- package/config/agent/skills/fireworks-tech-graph/assets/samples/sample-style5-glass.png +0 -0
- package/config/agent/skills/fireworks-tech-graph/assets/samples/sample-style6-claude.png +0 -0
- package/config/agent/skills/fireworks-tech-graph/assets/samples/sample-style7-openai.png +0 -0
- package/config/agent/skills/fireworks-tech-graph/fixtures/agent-memory-types-style4.json +181 -0
- package/config/agent/skills/fireworks-tech-graph/fixtures/api-flow-style7.json +40 -0
- package/config/agent/skills/fireworks-tech-graph/fixtures/mem0-style1.json +297 -0
- package/config/agent/skills/fireworks-tech-graph/fixtures/microservices-style3.json +64 -0
- package/config/agent/skills/fireworks-tech-graph/fixtures/multi-agent-style5.json +45 -0
- package/config/agent/skills/fireworks-tech-graph/fixtures/system-architecture-style6.json +48 -0
- package/config/agent/skills/fireworks-tech-graph/fixtures/tool-call-style2.json +182 -0
- package/config/agent/skills/fireworks-tech-graph/package.json +42 -0
- package/config/agent/skills/fireworks-tech-graph/references/icons.md +406 -0
- package/config/agent/skills/fireworks-tech-graph/references/style-1-flat-icon.md +108 -0
- package/config/agent/skills/fireworks-tech-graph/references/style-2-dark-terminal.md +107 -0
- package/config/agent/skills/fireworks-tech-graph/references/style-3-blueprint.md +113 -0
- package/config/agent/skills/fireworks-tech-graph/references/style-4-notion-clean.md +94 -0
- package/config/agent/skills/fireworks-tech-graph/references/style-5-glassmorphism.md +125 -0
- package/config/agent/skills/fireworks-tech-graph/references/style-6-claude-official.md +209 -0
- package/config/agent/skills/fireworks-tech-graph/references/style-7-openai.md +215 -0
- package/config/agent/skills/fireworks-tech-graph/references/style-diagram-matrix.md +135 -0
- package/config/agent/skills/fireworks-tech-graph/references/svg-layout-best-practices.md +100 -0
- package/config/agent/skills/fireworks-tech-graph/scripts/README.md +244 -0
- package/config/agent/skills/fireworks-tech-graph/scripts/generate-diagram.sh +157 -0
- package/config/agent/skills/fireworks-tech-graph/scripts/generate-from-template.py +1556 -0
- package/config/agent/skills/fireworks-tech-graph/scripts/test-all-styles.sh +135 -0
- package/config/agent/skills/fireworks-tech-graph/scripts/validate-svg.sh +292 -0
- package/config/agent/skills/fireworks-tech-graph/templates/agent-architecture.svg +28 -0
- package/config/agent/skills/fireworks-tech-graph/templates/architecture.svg +23 -0
- package/config/agent/skills/fireworks-tech-graph/templates/comparison-matrix.svg +14 -0
- package/config/agent/skills/fireworks-tech-graph/templates/data-flow.svg +28 -0
- package/config/agent/skills/fireworks-tech-graph/templates/er-diagram.svg +21 -0
- package/config/agent/skills/fireworks-tech-graph/templates/flowchart.svg +21 -0
- package/config/agent/skills/fireworks-tech-graph/templates/sequence.svg +20 -0
- package/config/agent/skills/fireworks-tech-graph/templates/state-machine.svg +20 -0
- package/config/agent/skills/fireworks-tech-graph/templates/timeline.svg +19 -0
- package/config/agent/skills/fireworks-tech-graph/templates/use-case.svg +21 -0
- package/config/agent/skills/frontend-design/SKILL.md +4 -1
- package/config/agent/skills/hello/SKILL.md +5 -2
- package/config/agent/skills/impeccable/adapt/SKILL.md +204 -0
- package/config/agent/skills/impeccable/animate/SKILL.md +177 -0
- package/config/agent/skills/impeccable/arrange/SKILL.md +127 -0
- package/config/agent/skills/impeccable/audit/SKILL.md +128 -0
- package/config/agent/skills/impeccable/bolder/SKILL.md +119 -0
- package/config/agent/skills/impeccable/clarify/SKILL.md +185 -0
- package/config/agent/skills/impeccable/colorize/SKILL.md +145 -0
- package/config/agent/skills/impeccable/critique/SKILL.md +122 -0
- package/config/agent/skills/impeccable/delight/SKILL.md +306 -0
- package/config/agent/skills/impeccable/distill/SKILL.md +124 -0
- package/config/agent/skills/impeccable/extract/SKILL.md +94 -0
- package/config/agent/skills/impeccable/frontend-design/reference/color-and-contrast.md +132 -0
- package/config/agent/skills/impeccable/frontend-design/reference/interaction-design.md +123 -0
- package/config/agent/skills/impeccable/frontend-design/reference/motion-design.md +99 -0
- package/config/agent/skills/impeccable/frontend-design/reference/responsive-design.md +114 -0
- package/config/agent/skills/impeccable/frontend-design/reference/spatial-design.md +100 -0
- package/config/agent/skills/impeccable/frontend-design/reference/typography.md +133 -0
- package/config/agent/skills/impeccable/frontend-design/reference/ux-writing.md +107 -0
- package/config/agent/skills/impeccable/harden/SKILL.md +357 -0
- package/config/agent/skills/impeccable/normalize/SKILL.md +73 -0
- package/config/agent/skills/impeccable/onboard/SKILL.md +248 -0
- package/config/agent/skills/impeccable/optimize/SKILL.md +268 -0
- package/config/agent/skills/impeccable/overdrive/SKILL.md +144 -0
- package/config/agent/skills/impeccable/polish/SKILL.md +205 -0
- package/config/agent/skills/impeccable/quieter/SKILL.md +105 -0
- package/config/agent/skills/impeccable/teach-impeccable/SKILL.md +71 -0
- package/config/agent/skills/impeccable/typeset/SKILL.md +118 -0
- package/config/agent/skills/librarian/SKILL.md +5 -1
- package/config/agent/skills/markdown-to-html/SKILL.md +5 -2
- package/config/agent/skills/owasp-security/SKILL.md +539 -0
- package/config/agent/skills/pr/SKILL.md +5 -2
- package/config/agent/skills/receiving-code-review/SKILL.md +216 -0
- package/config/agent/skills/refactor/SKILL.md +5 -2
- package/config/agent/skills/requesting-code-review/SKILL.md +108 -0
- package/config/agent/skills/requesting-code-review/code-reviewer.md +146 -0
- package/config/agent/skills/session-learning/SKILL.md +185 -0
- package/config/agent/skills/skill-creator/SKILL.md +339 -213
- package/config/agent/skills/skill-creator/agents/analyzer.md +274 -0
- package/config/agent/skills/skill-creator/agents/comparator.md +202 -0
- package/config/agent/skills/skill-creator/agents/grader.md +223 -0
- package/config/agent/skills/skill-creator/assets/eval_review.html +146 -0
- package/config/agent/skills/skill-creator/eval-viewer/generate_review.py +471 -0
- package/config/agent/skills/skill-creator/eval-viewer/viewer.html +1325 -0
- package/config/agent/skills/skill-creator/references/schemas.md +430 -0
- package/config/agent/skills/skill-creator/scripts/__init__.py +0 -0
- package/config/agent/skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
- package/config/agent/skills/skill-creator/scripts/generate_report.py +326 -0
- package/config/agent/skills/skill-creator/scripts/improve_description.py +248 -0
- package/config/agent/skills/skill-creator/scripts/package_skill.py +33 -7
- package/config/agent/skills/skill-creator/scripts/quick_validate.py +11 -3
- package/config/agent/skills/skill-creator/scripts/run_eval.py +310 -0
- package/config/agent/skills/skill-creator/scripts/run_loop.py +332 -0
- package/config/agent/skills/skill-creator/scripts/utils.py +47 -0
- package/config/agent/skills/subagent-driven-development/SKILL.md +280 -0
- package/config/agent/skills/subagent-driven-development/code-quality-reviewer-prompt.md +26 -0
- package/config/agent/skills/subagent-driven-development/implementer-prompt.md +113 -0
- package/config/agent/skills/subagent-driven-development/spec-reviewer-prompt.md +61 -0
- package/config/agent/skills/systematic-debugging/CREATION-LOG.md +119 -0
- package/config/agent/skills/systematic-debugging/SKILL.md +300 -0
- package/config/agent/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
- package/config/agent/skills/systematic-debugging/condition-based-waiting.md +115 -0
- package/config/agent/skills/systematic-debugging/defense-in-depth.md +122 -0
- package/config/agent/skills/systematic-debugging/find-polluter.sh +63 -0
- package/config/agent/skills/systematic-debugging/root-cause-tracing.md +169 -0
- package/config/agent/skills/systematic-debugging/test-academic.md +14 -0
- package/config/agent/skills/systematic-debugging/test-pressure-1.md +58 -0
- package/config/agent/skills/systematic-debugging/test-pressure-2.md +68 -0
- package/config/agent/skills/systematic-debugging/test-pressure-3.md +69 -0
- package/config/agent/skills/test-driven-development/SKILL.md +375 -0
- package/config/agent/skills/test-driven-development/testing-anti-patterns.md +299 -0
- package/config/agent/skills/ui-ux-pro-max/SKILL.md +4 -1
- package/config/agent/skills/unit-test/SKILL.md +4 -2
- package/config/agent/skills/using-git-worktrees/SKILL.md +222 -0
- package/config/agent/skills/using-superpowers/SKILL.md +118 -0
- package/config/agent/skills/using-superpowers/references/codex-tools.md +25 -0
- package/config/agent/skills/using-superpowers/references/gemini-tools.md +33 -0
- package/config/agent/skills/verification-before-completion/SKILL.md +142 -0
- package/config/agent/skills/writing-plans/SKILL.md +148 -0
- package/config/agent/skills/writing-plans/plan-document-reviewer-prompt.md +49 -0
- package/config/agent/skills/writing-skills/SKILL.md +669 -0
- package/config/agent/skills/writing-skills/anthropic-best-practices.md +1150 -0
- package/config/agent/skills/writing-skills/examples/CLAUDE_MD_TESTING.md +189 -0
- package/config/agent/skills/writing-skills/graphviz-conventions.dot +172 -0
- package/config/agent/skills/writing-skills/persuasion-principles.md +187 -0
- package/config/agent/skills/writing-skills/render-graphs.js +168 -0
- package/config/agent/skills/writing-skills/testing-skills-with-subagents.md +384 -0
- package/config.json +23 -2
- package/dist/banner.js +3 -3
- package/dist/banner.js.map +1 -1
- package/package.json +20 -15
- package/scripts/banner.txt +6 -0
- package/scripts/postinstall.js +203 -11
- package/config/agent/prompts/git-rollback.md +0 -91
- package/config/agent/prompts/git-worktree.md +0 -277
- package/config/agent/prompts/help.md +0 -10
- package/config/agent/skills/github/SKILL.md +0 -47
- package/config/agent/skills/skill-creator/references/output-patterns.md +0 -82
- package/config/agent/skills/skill-creator/references/workflows.md +0 -28
- package/config/agent/skills/skill-creator/scripts/init_skill.py +0 -303
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: delight
|
|
3
|
+
description: Add moments of joy, personality, and unexpected touches that make interfaces memorable and enjoyable to use. Elevates functional to delightful.
|
|
4
|
+
user-invocable: true
|
|
5
|
+
args:
|
|
6
|
+
- name: target
|
|
7
|
+
description: The feature or area to add delight to (optional)
|
|
8
|
+
required: false
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
Identify opportunities to add moments of joy, personality, and unexpected polish that transform functional interfaces into delightful experiences.
|
|
12
|
+
|
|
13
|
+
## MANDATORY PREPARATION
|
|
14
|
+
|
|
15
|
+
Use the frontend-design skill — it contains design principles, anti-patterns, and the **Context Gathering Protocol**. Follow the protocol before proceeding — if no design context exists yet, you MUST run teach-impeccable first. Additionally gather: what's appropriate for the domain (playful vs professional vs quirky vs elegant).
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Assess Delight Opportunities
|
|
20
|
+
|
|
21
|
+
Identify where delight would enhance (not distract from) the experience:
|
|
22
|
+
|
|
23
|
+
1. **Find natural delight moments**:
|
|
24
|
+
- **Success states**: Completed actions (save, send, publish)
|
|
25
|
+
- **Empty states**: First-time experiences, onboarding
|
|
26
|
+
- **Loading states**: Waiting periods that could be entertaining
|
|
27
|
+
- **Achievements**: Milestones, streaks, completions
|
|
28
|
+
- **Interactions**: Hover states, clicks, drags
|
|
29
|
+
- **Errors**: Softening frustrating moments
|
|
30
|
+
- **Easter eggs**: Hidden discoveries for curious users
|
|
31
|
+
|
|
32
|
+
2. **Understand the context**:
|
|
33
|
+
- What's the brand personality? (Playful? Professional? Quirky? Elegant?)
|
|
34
|
+
- Who's the audience? (Tech-savvy? Creative? Corporate?)
|
|
35
|
+
- What's the emotional context? (Accomplishment? Exploration? Frustration?)
|
|
36
|
+
- What's appropriate? (Banking app ≠ gaming app)
|
|
37
|
+
|
|
38
|
+
3. **Define delight strategy**:
|
|
39
|
+
- **Subtle sophistication**: Refined micro-interactions (luxury brands)
|
|
40
|
+
- **Playful personality**: Whimsical illustrations and copy (consumer apps)
|
|
41
|
+
- **Helpful surprises**: Anticipating needs before users ask (productivity tools)
|
|
42
|
+
- **Sensory richness**: Satisfying sounds, smooth animations (creative tools)
|
|
43
|
+
|
|
44
|
+
If any of these are unclear from the codebase, STOP and call the AskUserQuestion tool to clarify.
|
|
45
|
+
|
|
46
|
+
**CRITICAL**: Delight should enhance usability, never obscure it. If users notice the delight more than accomplishing their goal, you've gone too far.
|
|
47
|
+
|
|
48
|
+
## Delight Principles
|
|
49
|
+
|
|
50
|
+
Follow these guidelines:
|
|
51
|
+
|
|
52
|
+
### Delight Amplifies, Never Blocks
|
|
53
|
+
- Delight moments should be quick (< 1 second)
|
|
54
|
+
- Never delay core functionality for delight
|
|
55
|
+
- Make delight skippable or subtle
|
|
56
|
+
- Respect user's time and task focus
|
|
57
|
+
|
|
58
|
+
### Surprise and Discovery
|
|
59
|
+
- Hide delightful details for users to discover
|
|
60
|
+
- Reward exploration and curiosity
|
|
61
|
+
- Don't announce every delight moment
|
|
62
|
+
- Let users share discoveries with others
|
|
63
|
+
|
|
64
|
+
### Appropriate to Context
|
|
65
|
+
- Match delight to emotional moment (celebrate success, empathize with errors)
|
|
66
|
+
- Respect the user's state (don't be playful during critical errors)
|
|
67
|
+
- Match brand personality and audience expectations
|
|
68
|
+
- Cultural sensitivity (what's delightful varies by culture)
|
|
69
|
+
|
|
70
|
+
### Compound Over Time
|
|
71
|
+
- Delight should remain fresh with repeated use
|
|
72
|
+
- Vary responses (not same animation every time)
|
|
73
|
+
- Reveal deeper layers with continued use
|
|
74
|
+
- Build anticipation through patterns
|
|
75
|
+
|
|
76
|
+
## Delight Techniques
|
|
77
|
+
|
|
78
|
+
Add personality and joy through these methods:
|
|
79
|
+
|
|
80
|
+
### Micro-interactions & Animation
|
|
81
|
+
|
|
82
|
+
**Button delight**:
|
|
83
|
+
```css
|
|
84
|
+
/* Satisfying button press */
|
|
85
|
+
.button {
|
|
86
|
+
transition: transform 0.1s, box-shadow 0.1s;
|
|
87
|
+
}
|
|
88
|
+
.button:active {
|
|
89
|
+
transform: translateY(2px);
|
|
90
|
+
box-shadow: 0 2px 4px rgba(0,0,0,0.2);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/* Ripple effect on click */
|
|
94
|
+
/* Smooth lift on hover */
|
|
95
|
+
.button:hover {
|
|
96
|
+
transform: translateY(-2px);
|
|
97
|
+
transition: transform 0.2s cubic-bezier(0.25, 1, 0.5, 1); /* ease-out-quart */
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
**Loading delight**:
|
|
102
|
+
- Playful loading animations (not just spinners)
|
|
103
|
+
- Personality in loading messages (write product-specific ones, not generic AI filler)
|
|
104
|
+
- Progress indication with encouraging messages
|
|
105
|
+
- Skeleton screens with subtle animations
|
|
106
|
+
|
|
107
|
+
**Success animations**:
|
|
108
|
+
- Checkmark draw animation
|
|
109
|
+
- Confetti burst for major achievements
|
|
110
|
+
- Gentle scale + fade for confirmation
|
|
111
|
+
- Satisfying sound effects (subtle)
|
|
112
|
+
|
|
113
|
+
**Hover surprises**:
|
|
114
|
+
- Icons that animate on hover
|
|
115
|
+
- Color shifts or glow effects
|
|
116
|
+
- Tooltip reveals with personality
|
|
117
|
+
- Cursor changes (custom cursors for branded experiences)
|
|
118
|
+
|
|
119
|
+
### Personality in Copy
|
|
120
|
+
|
|
121
|
+
**Playful error messages**:
|
|
122
|
+
```
|
|
123
|
+
"Error 404"
|
|
124
|
+
"This page is playing hide and seek. (And winning)"
|
|
125
|
+
|
|
126
|
+
"Connection failed"
|
|
127
|
+
"Looks like the internet took a coffee break. Want to retry?"
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
**Encouraging empty states**:
|
|
131
|
+
```
|
|
132
|
+
"No projects"
|
|
133
|
+
"Your canvas awaits. Create something amazing."
|
|
134
|
+
|
|
135
|
+
"No messages"
|
|
136
|
+
"Inbox zero! You're crushing it today."
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
**Playful labels & tooltips**:
|
|
140
|
+
```
|
|
141
|
+
"Delete"
|
|
142
|
+
"Send to void" (for playful brand)
|
|
143
|
+
|
|
144
|
+
"Help"
|
|
145
|
+
"Rescue me" (tooltip)
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
**IMPORTANT**: Match copy personality to brand. Banks shouldn't be wacky, but they can be warm.
|
|
149
|
+
|
|
150
|
+
### Illustrations & Visual Personality
|
|
151
|
+
|
|
152
|
+
**Custom illustrations**:
|
|
153
|
+
- Empty state illustrations (not stock icons)
|
|
154
|
+
- Error state illustrations (friendly monsters, quirky characters)
|
|
155
|
+
- Loading state illustrations (animated characters)
|
|
156
|
+
- Success state illustrations (celebrations)
|
|
157
|
+
|
|
158
|
+
**Icon personality**:
|
|
159
|
+
- Custom icon set matching brand personality
|
|
160
|
+
- Animated icons (subtle motion on hover/click)
|
|
161
|
+
- Illustrative icons (more detailed than generic)
|
|
162
|
+
- Consistent style across all icons
|
|
163
|
+
|
|
164
|
+
**Background effects**:
|
|
165
|
+
- Subtle particle effects
|
|
166
|
+
- Gradient mesh backgrounds
|
|
167
|
+
- Geometric patterns
|
|
168
|
+
- Parallax depth
|
|
169
|
+
- Time-of-day themes (morning vs night)
|
|
170
|
+
|
|
171
|
+
### Satisfying Interactions
|
|
172
|
+
|
|
173
|
+
**Drag and drop delight**:
|
|
174
|
+
- Lift effect on drag (shadow, scale)
|
|
175
|
+
- Snap animation when dropped
|
|
176
|
+
- Satisfying placement sound
|
|
177
|
+
- Undo toast ("Dropped in wrong place? [Undo]")
|
|
178
|
+
|
|
179
|
+
**Toggle switches**:
|
|
180
|
+
- Smooth slide with spring physics
|
|
181
|
+
- Color transition
|
|
182
|
+
- Haptic feedback on mobile
|
|
183
|
+
- Optional sound effect
|
|
184
|
+
|
|
185
|
+
**Progress & achievements**:
|
|
186
|
+
- Streak counters with celebratory milestones
|
|
187
|
+
- Progress bars that "celebrate" at 100%
|
|
188
|
+
- Badge unlocks with animation
|
|
189
|
+
- Playful stats ("You're on fire! 5 days in a row")
|
|
190
|
+
|
|
191
|
+
**Form interactions**:
|
|
192
|
+
- Input fields that animate on focus
|
|
193
|
+
- Checkboxes with a satisfying scale pulse when checked
|
|
194
|
+
- Success state that celebrates valid input
|
|
195
|
+
- Auto-grow textareas
|
|
196
|
+
|
|
197
|
+
### Sound Design
|
|
198
|
+
|
|
199
|
+
**Subtle audio cues** (when appropriate):
|
|
200
|
+
- Notification sounds (distinctive but not annoying)
|
|
201
|
+
- Success sounds (satisfying "ding")
|
|
202
|
+
- Error sounds (empathetic, not harsh)
|
|
203
|
+
- Typing sounds for chat/messaging
|
|
204
|
+
- Ambient background audio (very subtle)
|
|
205
|
+
|
|
206
|
+
**IMPORTANT**:
|
|
207
|
+
- Respect system sound settings
|
|
208
|
+
- Provide mute option
|
|
209
|
+
- Keep volumes quiet (subtle cues, not alarms)
|
|
210
|
+
- Don't play on every interaction (sound fatigue is real)
|
|
211
|
+
|
|
212
|
+
### Easter Eggs & Hidden Delights
|
|
213
|
+
|
|
214
|
+
**Discovery rewards**:
|
|
215
|
+
- Konami code unlocks special theme
|
|
216
|
+
- Hidden keyboard shortcuts (Cmd+K for special features)
|
|
217
|
+
- Hover reveals on logos or illustrations
|
|
218
|
+
- Alt text jokes on images (for screen reader users too!)
|
|
219
|
+
- Console messages for developers ("Like what you see? We're hiring!")
|
|
220
|
+
|
|
221
|
+
**Seasonal touches**:
|
|
222
|
+
- Holiday themes (subtle, tasteful)
|
|
223
|
+
- Seasonal color shifts
|
|
224
|
+
- Weather-based variations
|
|
225
|
+
- Time-based changes (dark at night, light during day)
|
|
226
|
+
|
|
227
|
+
**Contextual personality**:
|
|
228
|
+
- Different messages based on time of day
|
|
229
|
+
- Responses to specific user actions
|
|
230
|
+
- Randomized variations (not same every time)
|
|
231
|
+
- Progressive reveals with continued use
|
|
232
|
+
|
|
233
|
+
### Loading & Waiting States
|
|
234
|
+
|
|
235
|
+
**Make waiting engaging**:
|
|
236
|
+
- Interesting loading messages that rotate
|
|
237
|
+
- Progress bars with personality
|
|
238
|
+
- Mini-games during long loads
|
|
239
|
+
- Fun facts or tips while waiting
|
|
240
|
+
- Countdown with encouraging messages
|
|
241
|
+
|
|
242
|
+
```
|
|
243
|
+
Loading messages — write ones specific to your product, not generic AI filler:
|
|
244
|
+
- "Crunching your latest numbers..."
|
|
245
|
+
- "Syncing with your team's changes..."
|
|
246
|
+
- "Preparing your dashboard..."
|
|
247
|
+
- "Checking for updates since yesterday..."
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
**WARNING**: Avoid cliched loading messages like "Herding pixels", "Teaching robots to dance", "Consulting the magic 8-ball", "Counting backwards from infinity". These are AI-slop copy — instantly recognizable as machine-generated. Write messages that are specific to what your product actually does.
|
|
251
|
+
|
|
252
|
+
### Celebration Moments
|
|
253
|
+
|
|
254
|
+
**Success celebrations**:
|
|
255
|
+
- Confetti for major milestones
|
|
256
|
+
- Animated checkmarks for completions
|
|
257
|
+
- Progress bar celebrations at 100%
|
|
258
|
+
- "Achievement unlocked" style notifications
|
|
259
|
+
- Personalized messages ("You published your 10th article!")
|
|
260
|
+
|
|
261
|
+
**Milestone recognition**:
|
|
262
|
+
- First-time actions get special treatment
|
|
263
|
+
- Streak tracking and celebration
|
|
264
|
+
- Progress toward goals
|
|
265
|
+
- Anniversary celebrations
|
|
266
|
+
|
|
267
|
+
## Implementation Patterns
|
|
268
|
+
|
|
269
|
+
**Animation libraries**:
|
|
270
|
+
- Framer Motion (React)
|
|
271
|
+
- GSAP (universal)
|
|
272
|
+
- Lottie (After Effects animations)
|
|
273
|
+
- Canvas confetti (party effects)
|
|
274
|
+
|
|
275
|
+
**Sound libraries**:
|
|
276
|
+
- Howler.js (audio management)
|
|
277
|
+
- Use-sound (React hook)
|
|
278
|
+
|
|
279
|
+
**Physics libraries**:
|
|
280
|
+
- React Spring (spring physics)
|
|
281
|
+
- Popmotion (animation primitives)
|
|
282
|
+
|
|
283
|
+
**IMPORTANT**: File size matters. Compress images, optimize animations, lazy load delight features.
|
|
284
|
+
|
|
285
|
+
**NEVER**:
|
|
286
|
+
- Delay core functionality for delight
|
|
287
|
+
- Force users through delightful moments (make skippable)
|
|
288
|
+
- Use delight to hide poor UX
|
|
289
|
+
- Overdo it (less is more)
|
|
290
|
+
- Ignore accessibility (animate responsibly, provide alternatives)
|
|
291
|
+
- Make every interaction delightful (special moments should be special)
|
|
292
|
+
- Sacrifice performance for delight
|
|
293
|
+
- Be inappropriate for context (read the room)
|
|
294
|
+
|
|
295
|
+
## Verify Delight Quality
|
|
296
|
+
|
|
297
|
+
Test that delight actually delights:
|
|
298
|
+
|
|
299
|
+
- **User reactions**: Do users smile? Share screenshots?
|
|
300
|
+
- **Doesn't annoy**: Still pleasant after 100th time?
|
|
301
|
+
- **Doesn't block**: Can users opt out or skip?
|
|
302
|
+
- **Performant**: No jank, no slowdown
|
|
303
|
+
- **Appropriate**: Matches brand and context
|
|
304
|
+
- **Accessible**: Works with reduced motion, screen readers
|
|
305
|
+
|
|
306
|
+
Remember: Delight is the difference between a tool and an experience. Add personality, surprise users positively, and create moments worth sharing. But always respect usability - delight should enhance, never obstruct.
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: distill
|
|
3
|
+
description: Strip designs to their essence by removing unnecessary complexity. Great design is simple, powerful, and clean.
|
|
4
|
+
user-invocable: true
|
|
5
|
+
args:
|
|
6
|
+
- name: target
|
|
7
|
+
description: The feature or component to distill (optional)
|
|
8
|
+
required: false
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
Remove unnecessary complexity from designs, revealing the essential elements and creating clarity through ruthless simplification.
|
|
12
|
+
|
|
13
|
+
## MANDATORY PREPARATION
|
|
14
|
+
|
|
15
|
+
Use the frontend-design skill — it contains design principles, anti-patterns, and the **Context Gathering Protocol**. Follow the protocol before proceeding — if no design context exists yet, you MUST run teach-impeccable first.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Assess Current State
|
|
20
|
+
|
|
21
|
+
Analyze what makes the design feel complex or cluttered:
|
|
22
|
+
|
|
23
|
+
1. **Identify complexity sources**:
|
|
24
|
+
- **Too many elements**: Competing buttons, redundant information, visual clutter
|
|
25
|
+
- **Excessive variation**: Too many colors, fonts, sizes, styles without purpose
|
|
26
|
+
- **Information overload**: Everything visible at once, no progressive disclosure
|
|
27
|
+
- **Visual noise**: Unnecessary borders, shadows, backgrounds, decorations
|
|
28
|
+
- **Confusing hierarchy**: Unclear what matters most
|
|
29
|
+
- **Feature creep**: Too many options, actions, or paths forward
|
|
30
|
+
|
|
31
|
+
2. **Find the essence**:
|
|
32
|
+
- What's the primary user goal? (There should be ONE)
|
|
33
|
+
- What's actually necessary vs nice-to-have?
|
|
34
|
+
- What can be removed, hidden, or combined?
|
|
35
|
+
- What's the 20% that delivers 80% of value?
|
|
36
|
+
|
|
37
|
+
If any of these are unclear from the codebase, STOP and call the AskUserQuestion tool to clarify.
|
|
38
|
+
|
|
39
|
+
**CRITICAL**: Simplicity is not about removing features - it's about removing obstacles between users and their goals. Every element should justify its existence.
|
|
40
|
+
|
|
41
|
+
## Plan Simplification
|
|
42
|
+
|
|
43
|
+
Create a ruthless editing strategy:
|
|
44
|
+
|
|
45
|
+
- **Core purpose**: What's the ONE thing this should accomplish?
|
|
46
|
+
- **Essential elements**: What's truly necessary to achieve that purpose?
|
|
47
|
+
- **Progressive disclosure**: What can be hidden until needed?
|
|
48
|
+
- **Consolidation opportunities**: What can be combined or integrated?
|
|
49
|
+
|
|
50
|
+
**IMPORTANT**: Simplification is hard. It requires saying no to good ideas to make room for great execution. Be ruthless.
|
|
51
|
+
|
|
52
|
+
## Simplify the Design
|
|
53
|
+
|
|
54
|
+
Systematically remove complexity across these dimensions:
|
|
55
|
+
|
|
56
|
+
### Information Architecture
|
|
57
|
+
- **Reduce scope**: Remove secondary actions, optional features, redundant information
|
|
58
|
+
- **Progressive disclosure**: Hide complexity behind clear entry points (accordions, modals, step-through flows)
|
|
59
|
+
- **Combine related actions**: Merge similar buttons, consolidate forms, group related content
|
|
60
|
+
- **Clear hierarchy**: ONE primary action, few secondary actions, everything else tertiary or hidden
|
|
61
|
+
- **Remove redundancy**: If it's said elsewhere, don't repeat it here
|
|
62
|
+
|
|
63
|
+
### Visual Simplification
|
|
64
|
+
- **Reduce color palette**: Use 1-2 colors plus neutrals, not 5-7 colors
|
|
65
|
+
- **Limit typography**: One font family, 3-4 sizes maximum, 2-3 weights
|
|
66
|
+
- **Remove decorations**: Eliminate borders, shadows, backgrounds that don't serve hierarchy or function
|
|
67
|
+
- **Flatten structure**: Reduce nesting, remove unnecessary containers—never nest cards inside cards
|
|
68
|
+
- **Remove unnecessary cards**: Cards aren't needed for basic layout; use spacing and alignment instead
|
|
69
|
+
- **Consistent spacing**: Use one spacing scale, remove arbitrary gaps
|
|
70
|
+
|
|
71
|
+
### Layout Simplification
|
|
72
|
+
- **Linear flow**: Replace complex grids with simple vertical flow where possible
|
|
73
|
+
- **Remove sidebars**: Move secondary content inline or hide it
|
|
74
|
+
- **Full-width**: Use available space generously instead of complex multi-column layouts
|
|
75
|
+
- **Consistent alignment**: Pick left or center, stick with it
|
|
76
|
+
- **Generous white space**: Let content breathe, don't pack everything tight
|
|
77
|
+
|
|
78
|
+
### Interaction Simplification
|
|
79
|
+
- **Reduce choices**: Fewer buttons, fewer options, clearer path forward (paradox of choice is real)
|
|
80
|
+
- **Smart defaults**: Make common choices automatic, only ask when necessary
|
|
81
|
+
- **Inline actions**: Replace modal flows with inline editing where possible
|
|
82
|
+
- **Remove steps**: Can signup be one step instead of three? Can checkout be simplified?
|
|
83
|
+
- **Clear CTAs**: ONE obvious next step, not five competing actions
|
|
84
|
+
|
|
85
|
+
### Content Simplification
|
|
86
|
+
- **Shorter copy**: Cut every sentence in half, then do it again
|
|
87
|
+
- **Active voice**: "Save changes" not "Changes will be saved"
|
|
88
|
+
- **Remove jargon**: Plain language always wins
|
|
89
|
+
- **Scannable structure**: Short paragraphs, bullet points, clear headings
|
|
90
|
+
- **Essential information only**: Remove marketing fluff, legalese, hedging
|
|
91
|
+
- **Remove redundant copy**: No headers restating intros, no repeated explanations, say it once
|
|
92
|
+
|
|
93
|
+
### Code Simplification
|
|
94
|
+
- **Remove unused code**: Dead CSS, unused components, orphaned files
|
|
95
|
+
- **Flatten component trees**: Reduce nesting depth
|
|
96
|
+
- **Consolidate styles**: Merge similar styles, use utilities consistently
|
|
97
|
+
- **Reduce variants**: Does that component need 12 variations, or can 3 cover 90% of cases?
|
|
98
|
+
|
|
99
|
+
**NEVER**:
|
|
100
|
+
- Remove necessary functionality (simplicity ≠ feature-less)
|
|
101
|
+
- Sacrifice accessibility for simplicity (clear labels and ARIA still required)
|
|
102
|
+
- Make things so simple they're unclear (mystery ≠ minimalism)
|
|
103
|
+
- Remove information users need to make decisions
|
|
104
|
+
- Eliminate hierarchy completely (some things should stand out)
|
|
105
|
+
- Oversimplify complex domains (match complexity to actual task complexity)
|
|
106
|
+
|
|
107
|
+
## Verify Simplification
|
|
108
|
+
|
|
109
|
+
Ensure simplification improves usability:
|
|
110
|
+
|
|
111
|
+
- **Faster task completion**: Can users accomplish goals more quickly?
|
|
112
|
+
- **Reduced cognitive load**: Is it easier to understand what to do?
|
|
113
|
+
- **Still complete**: Are all necessary features still accessible?
|
|
114
|
+
- **Clearer hierarchy**: Is it obvious what matters most?
|
|
115
|
+
- **Better performance**: Does simpler design load faster?
|
|
116
|
+
|
|
117
|
+
## Document Removed Complexity
|
|
118
|
+
|
|
119
|
+
If you removed features or options:
|
|
120
|
+
- Document why they were removed
|
|
121
|
+
- Consider if they need alternative access points
|
|
122
|
+
- Note any user feedback to monitor
|
|
123
|
+
|
|
124
|
+
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,94 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: extract
|
|
3
|
+
description: Extract and consolidate reusable components, design tokens, and patterns into your design system. Identifies opportunities for systematic reuse and enriches your component library.
|
|
4
|
+
user-invocable: true
|
|
5
|
+
args:
|
|
6
|
+
- name: target
|
|
7
|
+
description: The feature, component, or area to extract from (optional)
|
|
8
|
+
required: false
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
Identify reusable patterns, components, and design tokens, then extract and consolidate them into the design system for systematic reuse.
|
|
12
|
+
|
|
13
|
+
## Discover
|
|
14
|
+
|
|
15
|
+
Analyze the target area to identify extraction opportunities:
|
|
16
|
+
|
|
17
|
+
1. **Find the design system**: Locate your design system, component library, or shared UI directory (grep for "design system", "ui", "components", etc.). Understand its structure:
|
|
18
|
+
- Component organization and naming conventions
|
|
19
|
+
- Design token structure (if any)
|
|
20
|
+
- Documentation patterns
|
|
21
|
+
- Import/export conventions
|
|
22
|
+
|
|
23
|
+
**CRITICAL**: If no design system exists, ask before creating one. Understand the preferred location and structure first.
|
|
24
|
+
|
|
25
|
+
2. **Identify patterns**: Look for:
|
|
26
|
+
- **Repeated components**: Similar UI patterns used multiple times (buttons, cards, inputs, etc.)
|
|
27
|
+
- **Hard-coded values**: Colors, spacing, typography, shadows that should be tokens
|
|
28
|
+
- **Inconsistent variations**: Multiple implementations of the same concept (3 different button styles)
|
|
29
|
+
- **Reusable patterns**: Layout patterns, composition patterns, interaction patterns worth systematizing
|
|
30
|
+
|
|
31
|
+
3. **Assess value**: Not everything should be extracted. Consider:
|
|
32
|
+
- Is this used 3+ times, or likely to be reused?
|
|
33
|
+
- Would systematizing this improve consistency?
|
|
34
|
+
- Is this a general pattern or context-specific?
|
|
35
|
+
- What's the maintenance cost vs benefit?
|
|
36
|
+
|
|
37
|
+
## Plan Extraction
|
|
38
|
+
|
|
39
|
+
Create a systematic extraction plan:
|
|
40
|
+
|
|
41
|
+
- **Components to extract**: Which UI elements become reusable components?
|
|
42
|
+
- **Tokens to create**: Which hard-coded values become design tokens?
|
|
43
|
+
- **Variants to support**: What variations does each component need?
|
|
44
|
+
- **Naming conventions**: Component names, token names, prop names that match existing patterns
|
|
45
|
+
- **Migration path**: How to refactor existing uses to consume the new shared versions
|
|
46
|
+
|
|
47
|
+
**IMPORTANT**: Design systems grow incrementally. Extract what's clearly reusable now, not everything that might someday be reusable.
|
|
48
|
+
|
|
49
|
+
## Extract & Enrich
|
|
50
|
+
|
|
51
|
+
Build improved, reusable versions:
|
|
52
|
+
|
|
53
|
+
- **Components**: Create well-designed components with:
|
|
54
|
+
- Clear props API with sensible defaults
|
|
55
|
+
- Proper variants for different use cases
|
|
56
|
+
- Accessibility built in (ARIA, keyboard navigation, focus management)
|
|
57
|
+
- Documentation and usage examples
|
|
58
|
+
|
|
59
|
+
- **Design tokens**: Create tokens with:
|
|
60
|
+
- Clear naming (primitive vs semantic)
|
|
61
|
+
- Proper hierarchy and organization
|
|
62
|
+
- Documentation of when to use each token
|
|
63
|
+
|
|
64
|
+
- **Patterns**: Document patterns with:
|
|
65
|
+
- When to use this pattern
|
|
66
|
+
- Code examples
|
|
67
|
+
- Variations and combinations
|
|
68
|
+
|
|
69
|
+
**NEVER**:
|
|
70
|
+
- Extract one-off, context-specific implementations without generalization
|
|
71
|
+
- Create components so generic they're useless
|
|
72
|
+
- Extract without considering existing design system conventions
|
|
73
|
+
- Skip proper TypeScript types or prop documentation
|
|
74
|
+
- Create tokens for every single value (tokens should have semantic meaning)
|
|
75
|
+
|
|
76
|
+
## Migrate
|
|
77
|
+
|
|
78
|
+
Replace existing uses with the new shared versions:
|
|
79
|
+
|
|
80
|
+
- **Find all instances**: Search for the patterns you've extracted
|
|
81
|
+
- **Replace systematically**: Update each use to consume the shared version
|
|
82
|
+
- **Test thoroughly**: Ensure visual and functional parity
|
|
83
|
+
- **Delete dead code**: Remove the old implementations
|
|
84
|
+
|
|
85
|
+
## Document
|
|
86
|
+
|
|
87
|
+
Update design system documentation:
|
|
88
|
+
|
|
89
|
+
- Add new components to the component library
|
|
90
|
+
- Document token usage and values
|
|
91
|
+
- Add examples and guidelines
|
|
92
|
+
- Update any Storybook or component catalog
|
|
93
|
+
|
|
94
|
+
Remember: A good design system is a living system. Extract patterns as they emerge, enrich them thoughtfully, and maintain them consistently.
|
|
@@ -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).
|