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