@ia-ccun/code-agent-cli 0.0.47 → 0.0.49-beta.0

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 (77) hide show
  1. package/config/agent/skills/design-md/README.md +34 -0
  2. package/config/agent/skills/design-md/SKILL.md +172 -0
  3. package/config/agent/skills/design-md/examples/DESIGN.md +154 -0
  4. package/config/agent/skills/fireworks-tech-graph/LICENSE +21 -0
  5. package/config/agent/skills/fireworks-tech-graph/README.md +528 -0
  6. package/config/agent/skills/fireworks-tech-graph/README.zh.md +499 -0
  7. package/config/agent/skills/fireworks-tech-graph/SKILL.md +537 -0
  8. package/config/agent/skills/fireworks-tech-graph/agentloop-core.svg +101 -0
  9. package/config/agent/skills/fireworks-tech-graph/agents/openai.yaml +4 -0
  10. package/config/agent/skills/fireworks-tech-graph/assets/samples/sample-style1-flat.png +0 -0
  11. package/config/agent/skills/fireworks-tech-graph/assets/samples/sample-style2-dark.png +0 -0
  12. package/config/agent/skills/fireworks-tech-graph/assets/samples/sample-style3-blueprint.png +0 -0
  13. package/config/agent/skills/fireworks-tech-graph/assets/samples/sample-style4-notion.png +0 -0
  14. package/config/agent/skills/fireworks-tech-graph/assets/samples/sample-style5-glass.png +0 -0
  15. package/config/agent/skills/fireworks-tech-graph/assets/samples/sample-style6-claude.png +0 -0
  16. package/config/agent/skills/fireworks-tech-graph/assets/samples/sample-style7-openai.png +0 -0
  17. package/config/agent/skills/fireworks-tech-graph/fixtures/agent-memory-types-style4.json +181 -0
  18. package/config/agent/skills/fireworks-tech-graph/fixtures/api-flow-style7.json +40 -0
  19. package/config/agent/skills/fireworks-tech-graph/fixtures/mem0-style1.json +297 -0
  20. package/config/agent/skills/fireworks-tech-graph/fixtures/microservices-style3.json +64 -0
  21. package/config/agent/skills/fireworks-tech-graph/fixtures/multi-agent-style5.json +45 -0
  22. package/config/agent/skills/fireworks-tech-graph/fixtures/system-architecture-style6.json +48 -0
  23. package/config/agent/skills/fireworks-tech-graph/fixtures/tool-call-style2.json +182 -0
  24. package/config/agent/skills/fireworks-tech-graph/package.json +42 -0
  25. package/config/agent/skills/fireworks-tech-graph/references/icons.md +406 -0
  26. package/config/agent/skills/fireworks-tech-graph/references/style-1-flat-icon.md +108 -0
  27. package/config/agent/skills/fireworks-tech-graph/references/style-2-dark-terminal.md +107 -0
  28. package/config/agent/skills/fireworks-tech-graph/references/style-3-blueprint.md +113 -0
  29. package/config/agent/skills/fireworks-tech-graph/references/style-4-notion-clean.md +94 -0
  30. package/config/agent/skills/fireworks-tech-graph/references/style-5-glassmorphism.md +125 -0
  31. package/config/agent/skills/fireworks-tech-graph/references/style-6-claude-official.md +209 -0
  32. package/config/agent/skills/fireworks-tech-graph/references/style-7-openai.md +215 -0
  33. package/config/agent/skills/fireworks-tech-graph/references/style-diagram-matrix.md +135 -0
  34. package/config/agent/skills/fireworks-tech-graph/references/svg-layout-best-practices.md +100 -0
  35. package/config/agent/skills/fireworks-tech-graph/scripts/README.md +244 -0
  36. package/config/agent/skills/fireworks-tech-graph/scripts/generate-diagram.sh +157 -0
  37. package/config/agent/skills/fireworks-tech-graph/scripts/generate-from-template.py +1556 -0
  38. package/config/agent/skills/fireworks-tech-graph/scripts/test-all-styles.sh +135 -0
  39. package/config/agent/skills/fireworks-tech-graph/scripts/validate-svg.sh +292 -0
  40. package/config/agent/skills/fireworks-tech-graph/templates/agent-architecture.svg +28 -0
  41. package/config/agent/skills/fireworks-tech-graph/templates/architecture.svg +23 -0
  42. package/config/agent/skills/fireworks-tech-graph/templates/comparison-matrix.svg +14 -0
  43. package/config/agent/skills/fireworks-tech-graph/templates/data-flow.svg +28 -0
  44. package/config/agent/skills/fireworks-tech-graph/templates/er-diagram.svg +21 -0
  45. package/config/agent/skills/fireworks-tech-graph/templates/flowchart.svg +21 -0
  46. package/config/agent/skills/fireworks-tech-graph/templates/sequence.svg +20 -0
  47. package/config/agent/skills/fireworks-tech-graph/templates/state-machine.svg +20 -0
  48. package/config/agent/skills/fireworks-tech-graph/templates/timeline.svg +19 -0
  49. package/config/agent/skills/fireworks-tech-graph/templates/use-case.svg +21 -0
  50. package/config/agent/skills/impeccable/adapt/SKILL.md +205 -0
  51. package/config/agent/skills/impeccable/animate/SKILL.md +178 -0
  52. package/config/agent/skills/impeccable/arrange/SKILL.md +128 -0
  53. package/config/agent/skills/impeccable/audit/SKILL.md +129 -0
  54. package/config/agent/skills/impeccable/bolder/SKILL.md +120 -0
  55. package/config/agent/skills/impeccable/clarify/SKILL.md +186 -0
  56. package/config/agent/skills/impeccable/colorize/SKILL.md +146 -0
  57. package/config/agent/skills/impeccable/critique/SKILL.md +123 -0
  58. package/config/agent/skills/impeccable/delight/SKILL.md +307 -0
  59. package/config/agent/skills/impeccable/distill/SKILL.md +125 -0
  60. package/config/agent/skills/impeccable/extract/SKILL.md +95 -0
  61. package/config/agent/skills/impeccable/frontend-design/reference/color-and-contrast.md +132 -0
  62. package/config/agent/skills/impeccable/frontend-design/reference/interaction-design.md +123 -0
  63. package/config/agent/skills/impeccable/frontend-design/reference/motion-design.md +99 -0
  64. package/config/agent/skills/impeccable/frontend-design/reference/responsive-design.md +114 -0
  65. package/config/agent/skills/impeccable/frontend-design/reference/spatial-design.md +100 -0
  66. package/config/agent/skills/impeccable/frontend-design/reference/typography.md +133 -0
  67. package/config/agent/skills/impeccable/frontend-design/reference/ux-writing.md +107 -0
  68. package/config/agent/skills/impeccable/harden/SKILL.md +358 -0
  69. package/config/agent/skills/impeccable/normalize/SKILL.md +74 -0
  70. package/config/agent/skills/impeccable/onboard/SKILL.md +249 -0
  71. package/config/agent/skills/impeccable/optimize/SKILL.md +269 -0
  72. package/config/agent/skills/impeccable/overdrive/SKILL.md +145 -0
  73. package/config/agent/skills/impeccable/polish/SKILL.md +206 -0
  74. package/config/agent/skills/impeccable/quieter/SKILL.md +106 -0
  75. package/config/agent/skills/impeccable/teach-impeccable/SKILL.md +72 -0
  76. package/config/agent/skills/impeccable/typeset/SKILL.md +119 -0
  77. package/package.json +1 -1
@@ -0,0 +1,269 @@
1
+ ---
2
+ name: optimize
3
+ description: 优化界面性能,覆盖加载速度、渲染、动画、图片和包体积等维度,打造更快更流畅的体验。
4
+ disable-model-invocation: true
5
+ user-invocable: true
6
+ args:
7
+ - name: target
8
+ description: The feature or area to optimize (optional)
9
+ required: false
10
+ ---
11
+
12
+ Identify and fix performance issues to create faster, smoother user experiences.
13
+
14
+ ## Assess Performance Issues
15
+
16
+ Understand current performance and identify problems:
17
+
18
+ 1. **Measure current state**:
19
+ - **Core Web Vitals**: LCP, FID/INP, CLS scores
20
+ - **Load time**: Time to interactive, first contentful paint
21
+ - **Bundle size**: JavaScript, CSS, image sizes
22
+ - **Runtime performance**: Frame rate, memory usage, CPU usage
23
+ - **Network**: Request count, payload sizes, waterfall
24
+
25
+ 2. **Identify bottlenecks**:
26
+ - What's slow? (Initial load? Interactions? Animations?)
27
+ - What's causing it? (Large images? Expensive JavaScript? Layout thrashing?)
28
+ - How bad is it? (Perceivable? Annoying? Blocking?)
29
+ - Who's affected? (All users? Mobile only? Slow connections?)
30
+
31
+ **CRITICAL**: Measure before and after. Premature optimization wastes time. Optimize what actually matters.
32
+
33
+ ## Optimization Strategy
34
+
35
+ Create systematic improvement plan:
36
+
37
+ ### Loading Performance
38
+
39
+ **Optimize Images**:
40
+ - Use modern formats (WebP, AVIF)
41
+ - Proper sizing (don't load 3000px image for 300px display)
42
+ - Lazy loading for below-fold images
43
+ - Responsive images (`srcset`, `picture` element)
44
+ - Compress images (80-85% quality is usually imperceptible)
45
+ - Use CDN for faster delivery
46
+
47
+ ```html
48
+ <img
49
+ src="hero.webp"
50
+ srcset="hero-400.webp 400w, hero-800.webp 800w, hero-1200.webp 1200w"
51
+ sizes="(max-width: 400px) 400px, (max-width: 800px) 800px, 1200px"
52
+ loading="lazy"
53
+ alt="Hero image"
54
+ />
55
+ ```
56
+
57
+ **Reduce JavaScript Bundle**:
58
+ - Code splitting (route-based, component-based)
59
+ - Tree shaking (remove unused code)
60
+ - Remove unused dependencies
61
+ - Lazy load non-critical code
62
+ - Use dynamic imports for large components
63
+
64
+ ```javascript
65
+ // Lazy load heavy component
66
+ const HeavyChart = lazy(() => import('./HeavyChart'));
67
+ ```
68
+
69
+ **Optimize CSS**:
70
+ - Remove unused CSS
71
+ - Critical CSS inline, rest async
72
+ - Minimize CSS files
73
+ - Use CSS containment for independent regions
74
+
75
+ **Optimize Fonts**:
76
+ - Use `font-display: swap` or `optional`
77
+ - Subset fonts (only characters you need)
78
+ - Preload critical fonts
79
+ - Use system fonts when appropriate
80
+ - Limit font weights loaded
81
+
82
+ ```css
83
+ @font-face {
84
+ font-family: 'CustomFont';
85
+ src: url('/fonts/custom.woff2') format('woff2');
86
+ font-display: swap; /* Show fallback immediately */
87
+ unicode-range: U+0020-007F; /* Basic Latin only */
88
+ }
89
+ ```
90
+
91
+ **Optimize Loading Strategy**:
92
+ - Critical resources first (async/defer non-critical)
93
+ - Preload critical assets
94
+ - Prefetch likely next pages
95
+ - Service worker for offline/caching
96
+ - HTTP/2 or HTTP/3 for multiplexing
97
+
98
+ ### Rendering Performance
99
+
100
+ **Avoid Layout Thrashing**:
101
+ ```javascript
102
+ // ❌ Bad: Alternating reads and writes (causes reflows)
103
+ elements.forEach(el => {
104
+ const height = el.offsetHeight; // Read (forces layout)
105
+ el.style.height = height * 2; // Write
106
+ });
107
+
108
+ // ✅ Good: Batch reads, then batch writes
109
+ const heights = elements.map(el => el.offsetHeight); // All reads
110
+ elements.forEach((el, i) => {
111
+ el.style.height = heights[i] * 2; // All writes
112
+ });
113
+ ```
114
+
115
+ **Optimize Rendering**:
116
+ - Use CSS `contain` property for independent regions
117
+ - Minimize DOM depth (flatter is faster)
118
+ - Reduce DOM size (fewer elements)
119
+ - Use `content-visibility: auto` for long lists
120
+ - Virtual scrolling for very long lists (react-window, react-virtualized)
121
+
122
+ **Reduce Paint & Composite**:
123
+ - Use `transform` and `opacity` for animations (GPU-accelerated)
124
+ - Avoid animating layout properties (width, height, top, left)
125
+ - Use `will-change` sparingly for known expensive operations
126
+ - Minimize paint areas (smaller is faster)
127
+
128
+ ### Animation Performance
129
+
130
+ **GPU Acceleration**:
131
+ ```css
132
+ /* ✅ GPU-accelerated (fast) */
133
+ .animated {
134
+ transform: translateX(100px);
135
+ opacity: 0.5;
136
+ }
137
+
138
+ /* ❌ CPU-bound (slow) */
139
+ .animated {
140
+ left: 100px;
141
+ width: 300px;
142
+ }
143
+ ```
144
+
145
+ **Smooth 60fps**:
146
+ - Target 16ms per frame (60fps)
147
+ - Use `requestAnimationFrame` for JS animations
148
+ - Debounce/throttle scroll handlers
149
+ - Use CSS animations when possible
150
+ - Avoid long-running JavaScript during animations
151
+
152
+ **Intersection Observer**:
153
+ ```javascript
154
+ // Efficiently detect when elements enter viewport
155
+ const observer = new IntersectionObserver((entries) => {
156
+ entries.forEach(entry => {
157
+ if (entry.isIntersecting) {
158
+ // Element is visible, lazy load or animate
159
+ }
160
+ });
161
+ });
162
+ ```
163
+
164
+ ### React/Framework Optimization
165
+
166
+ **React-specific**:
167
+ - Use `memo()` for expensive components
168
+ - `useMemo()` and `useCallback()` for expensive computations
169
+ - Virtualize long lists
170
+ - Code split routes
171
+ - Avoid inline function creation in render
172
+ - Use React DevTools Profiler
173
+
174
+ **Framework-agnostic**:
175
+ - Minimize re-renders
176
+ - Debounce expensive operations
177
+ - Memoize computed values
178
+ - Lazy load routes and components
179
+
180
+ ### Network Optimization
181
+
182
+ **Reduce Requests**:
183
+ - Combine small files
184
+ - Use SVG sprites for icons
185
+ - Inline small critical assets
186
+ - Remove unused third-party scripts
187
+
188
+ **Optimize APIs**:
189
+ - Use pagination (don't load everything)
190
+ - GraphQL to request only needed fields
191
+ - Response compression (gzip, brotli)
192
+ - HTTP caching headers
193
+ - CDN for static assets
194
+
195
+ **Optimize for Slow Connections**:
196
+ - Adaptive loading based on connection (navigator.connection)
197
+ - Optimistic UI updates
198
+ - Request prioritization
199
+ - Progressive enhancement
200
+
201
+ ## Core Web Vitals Optimization
202
+
203
+ ### Largest Contentful Paint (LCP < 2.5s)
204
+ - Optimize hero images
205
+ - Inline critical CSS
206
+ - Preload key resources
207
+ - Use CDN
208
+ - Server-side rendering
209
+
210
+ ### First Input Delay (FID < 100ms) / INP (< 200ms)
211
+ - Break up long tasks
212
+ - Defer non-critical JavaScript
213
+ - Use web workers for heavy computation
214
+ - Reduce JavaScript execution time
215
+
216
+ ### Cumulative Layout Shift (CLS < 0.1)
217
+ - Set dimensions on images and videos
218
+ - Don't inject content above existing content
219
+ - Use `aspect-ratio` CSS property
220
+ - Reserve space for ads/embeds
221
+ - Avoid animations that cause layout shifts
222
+
223
+ ```css
224
+ /* Reserve space for image */
225
+ .image-container {
226
+ aspect-ratio: 16 / 9;
227
+ }
228
+ ```
229
+
230
+ ## Performance Monitoring
231
+
232
+ **Tools to use**:
233
+ - Chrome DevTools (Lighthouse, Performance panel)
234
+ - WebPageTest
235
+ - Core Web Vitals (Chrome UX Report)
236
+ - Bundle analyzers (webpack-bundle-analyzer)
237
+ - Performance monitoring (Sentry, DataDog, New Relic)
238
+
239
+ **Key metrics**:
240
+ - LCP, FID/INP, CLS (Core Web Vitals)
241
+ - Time to Interactive (TTI)
242
+ - First Contentful Paint (FCP)
243
+ - Total Blocking Time (TBT)
244
+ - Bundle size
245
+ - Request count
246
+
247
+ **IMPORTANT**: Measure on real devices with real network conditions. Desktop Chrome with fast connection isn't representative.
248
+
249
+ **NEVER**:
250
+ - Optimize without measuring (premature optimization)
251
+ - Sacrifice accessibility for performance
252
+ - Break functionality while optimizing
253
+ - Use `will-change` everywhere (creates new layers, uses memory)
254
+ - Lazy load above-fold content
255
+ - Optimize micro-optimizations while ignoring major issues (optimize the biggest bottleneck first)
256
+ - Forget about mobile performance (often slower devices, slower connections)
257
+
258
+ ## Verify Improvements
259
+
260
+ Test that optimizations worked:
261
+
262
+ - **Before/after metrics**: Compare Lighthouse scores
263
+ - **Real user monitoring**: Track improvements for real users
264
+ - **Different devices**: Test on low-end Android, not just flagship iPhone
265
+ - **Slow connections**: Throttle to 3G, test experience
266
+ - **No regressions**: Ensure functionality still works
267
+ - **User perception**: Does it *feel* faster?
268
+
269
+ Remember: Performance is a feature. Fast experiences feel more responsive, more polished, more professional. Optimize systematically, measure ruthlessly, and prioritize user-perceived performance.
@@ -0,0 +1,145 @@
1
+ ---
2
+ name: overdrive
3
+ description: 将界面推向传统极限,实现技术上前瞻性的实现。无论是着色器、60fps 虚拟表格、对话框的弹簧物理效果,还是滚动驱动的揭示动效——让用户惊叹"这怎么做到的?"
4
+ disable-model-invocation: true
5
+ user-invocable: true
6
+ args:
7
+ - name: target
8
+ description: The feature or area to push into overdrive (optional)
9
+ required: false
10
+ ---
11
+
12
+ Start your response with:
13
+
14
+ ```
15
+ ──────────── ⚡ OVERDRIVE ─────────────
16
+ 》》》 Entering overdrive mode...
17
+ ```
18
+
19
+ Push an interface past conventional limits. This isn't just about visual effects — it's about using the full power of the browser to make any part of an interface feel extraordinary: a table that handles a million rows, a dialog that morphs from its trigger, a form that validates in real-time with streaming feedback, a page transition that feels cinematic.
20
+
21
+ ## MANDATORY PREPARATION
22
+
23
+ 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.
24
+
25
+ **EXTRA IMPORTANT FOR THIS SKILL**: Context determines what "extraordinary" means. A particle system on a creative portfolio is impressive. The same particle system on a settings page is embarrassing. But a settings page with instant optimistic saves and animated state transitions? That's extraordinary too. Understand the project's personality and goals before deciding what's appropriate.
26
+
27
+ ### Propose Before Building
28
+
29
+ This skill has the highest potential to misfire. Do NOT jump straight into implementation. You MUST:
30
+
31
+ 1. **Think through 2-3 different directions** — consider different techniques, levels of ambition, and aesthetic approaches. For each direction, briefly describe what the result would look and feel like.
32
+ 2. **STOP and call the AskUserQuestion tool to clarify.** to present these directions and get the user's pick before writing any code. Explain trade-offs (browser support, performance cost, complexity).
33
+ 3. Only proceed with the direction the user confirms.
34
+
35
+ Skipping this step risks building something embarrassing that needs to be thrown away.
36
+
37
+ ### Iterate with Browser Automation
38
+
39
+ Technically ambitious effects almost never work on the first try. You MUST actively use browser automation tools to preview your work, visually verify the result, and iterate. Do not assume the effect looks right — check it. Expect multiple rounds of refinement. The gap between "technically works" and "looks extraordinary" is closed through visual iteration, not code alone.
40
+
41
+ ---
42
+
43
+ ## Assess What "Extraordinary" Means Here
44
+
45
+ The right kind of technical ambition depends entirely on what you're working with. Before choosing a technique, ask: **what would make a user of THIS specific interface say "wow, that's nice"?**
46
+
47
+ ### For visual/marketing surfaces
48
+ Pages, hero sections, landing pages, portfolios — the "wow" is often sensory: a scroll-driven reveal, a shader background, a cinematic page transition, generative art that responds to the cursor.
49
+
50
+ ### For functional UI
51
+ Tables, forms, dialogs, navigation — the "wow" is in how it FEELS: a dialog that morphs from the button that triggered it via View Transitions, a data table that renders 100k rows at 60fps via virtual scrolling, a form with streaming validation that feels instant, drag-and-drop with spring physics.
52
+
53
+ ### For performance-critical UI
54
+ The "wow" is invisible but felt: a search that filters 50k items without a flicker, a complex form that never blocks the main thread, an image editor that processes in near-real-time. The interface just never hesitates.
55
+
56
+ ### For data-heavy interfaces
57
+ Charts and dashboards — the "wow" is in fluidity: GPU-accelerated rendering via Canvas/WebGL for massive datasets, animated transitions between data states, force-directed graph layouts that settle naturally.
58
+
59
+ **The common thread**: something about the implementation goes beyond what users expect from a web interface. The technique serves the experience, not the other way around.
60
+
61
+ ## The Toolkit
62
+
63
+ Organized by what you're trying to achieve, not by technology name.
64
+
65
+ ### Make transitions feel cinematic
66
+ - **View Transitions API** (same-document: all browsers; cross-document: no Firefox) — shared element morphing between states. A list item expanding into a detail page. A button morphing into a dialog. This is the closest thing to native FLIP animations.
67
+ - **`@starting-style`** (all browsers) — animate elements from `display: none` to visible with CSS only, including entry keyframes
68
+ - **Spring physics** — natural motion with mass, tension, and damping instead of cubic-bezier. Libraries: motion (formerly Framer Motion), GSAP, or roll your own spring solver.
69
+
70
+ ### Tie animation to scroll position
71
+ - **Scroll-driven animations** (`animation-timeline: scroll()`) — CSS-only, no JS. Parallax, progress bars, reveal sequences all driven by scroll position. (Chrome/Edge/Safari; Firefox: flag only — always provide a static fallback)
72
+
73
+ ### Render beyond CSS
74
+ - **WebGL** (all browsers) — shader effects, post-processing, particle systems. Libraries: Three.js, OGL (lightweight), regl. Use for effects CSS can't express.
75
+ - **WebGPU** (Chrome/Edge; Safari partial; Firefox: flag only) — next-gen GPU compute. More powerful than WebGL but limited browser support. Always fall back to WebGL2.
76
+ - **Canvas 2D / OffscreenCanvas** — custom rendering, pixel manipulation, or moving heavy rendering off the main thread entirely via Web Workers + OffscreenCanvas.
77
+ - **SVG filter chains** — displacement maps, turbulence, morphology for organic distortion effects. CSS-animatable.
78
+
79
+ ### Make data feel alive
80
+ - **Virtual scrolling** — render only visible rows for tables/lists with tens of thousands of items. No library required for simple cases; TanStack Virtual for complex ones.
81
+ - **GPU-accelerated charts** — Canvas or WebGL-rendered data visualization for datasets too large for SVG/DOM. Libraries: deck.gl, regl-based custom renderers.
82
+ - **Animated data transitions** — morph between chart states rather than replacing. D3's `transition()` or View Transitions for DOM-based charts.
83
+
84
+ ### Animate complex properties
85
+ - **`@property`** (all browsers) — register custom CSS properties with types, enabling animation of gradients, colors, and complex values that CSS can't normally interpolate.
86
+ - **Web Animations API** (all browsers) — JavaScript-driven animations with the performance of CSS. Composable, cancellable, reversible. The foundation for complex choreography.
87
+
88
+ ### Push performance boundaries
89
+ - **Web Workers** — move computation off the main thread. Heavy data processing, image manipulation, search indexing — anything that would cause jank.
90
+ - **OffscreenCanvas** — render in a Worker thread. The main thread stays free while complex visuals render in the background.
91
+ - **WASM** — near-native performance for computation-heavy features. Image processing, physics simulations, codecs.
92
+
93
+ ### Interact with the device
94
+ - **Web Audio API** — spatial audio, audio-reactive visualizations, sonic feedback. Requires user gesture to start.
95
+ - **Device APIs** — orientation, ambient light, geolocation. Use sparingly and always with user permission.
96
+
97
+ **NOTE**: This skill is about enhancing how an interface FEELS, not changing what a product DOES. Adding real-time collaboration, offline support, or new backend capabilities are product decisions, not UI enhancements. Focus on making existing features feel extraordinary.
98
+
99
+ ## Implement with Discipline
100
+
101
+ ### Progressive enhancement is non-negotiable
102
+
103
+ Every technique must degrade gracefully. The experience without the enhancement must still be good.
104
+
105
+ ```css
106
+ @supports (animation-timeline: scroll()) {
107
+ .hero { animation-timeline: scroll(); }
108
+ }
109
+ ```
110
+
111
+ ```javascript
112
+ if ('gpu' in navigator) { /* WebGPU */ }
113
+ else if (canvas.getContext('webgl2')) { /* WebGL2 fallback */ }
114
+ /* CSS-only fallback must still look good */
115
+ ```
116
+
117
+ ### Performance rules
118
+
119
+ - Target 60fps. If dropping below 50, simplify.
120
+ - Respect `prefers-reduced-motion` — always. Provide a beautiful static alternative.
121
+ - Lazy-initialize heavy resources (WebGL contexts, WASM modules) only when near viewport.
122
+ - Pause off-screen rendering. Kill what you can't see.
123
+ - Test on real mid-range devices, not just your development machine.
124
+
125
+ ### Polish is the difference
126
+
127
+ The gap between "cool" and "extraordinary" is in the last 20% of refinement: the easing curve on a spring animation, the timing offset in a staggered reveal, the subtle secondary motion that makes a transition feel physical. Don't ship the first version that works — ship the version that feels inevitable.
128
+
129
+ **NEVER**:
130
+ - Ignore `prefers-reduced-motion` — this is an accessibility requirement, not a suggestion
131
+ - Ship effects that cause jank on mid-range devices
132
+ - Use bleeding-edge APIs without a functional fallback
133
+ - Add sound without explicit user opt-in
134
+ - Use technical ambition to mask weak design fundamentals — fix those first with other skills
135
+ - Layer multiple competing extraordinary moments — focus creates impact, excess creates noise
136
+
137
+ ## Verify the Result
138
+
139
+ - **The wow test**: Show it to someone who hasn't seen it. Do they react?
140
+ - **The removal test**: Take it away. Does the experience feel diminished, or does nobody notice?
141
+ - **The device test**: Run it on a phone, a tablet, a Chromebook. Still smooth?
142
+ - **The accessibility test**: Enable reduced motion. Still beautiful?
143
+ - **The context test**: Does this make sense for THIS brand and audience?
144
+
145
+ Remember: "Technically extraordinary" isn't about using the newest API. It's about making an interface do something users didn't think a website could do.
@@ -0,0 +1,206 @@
1
+ ---
2
+ name: polish
3
+ description: 上线前的最终质量检查,修正对齐、间距、一致性和细节问题,让"好"与"优秀"拉开差距。
4
+ disable-model-invocation: true
5
+ user-invocable: true
6
+ args:
7
+ - name: target
8
+ description: The feature or area to polish (optional)
9
+ required: false
10
+ ---
11
+
12
+ ## MANDATORY PREPARATION
13
+
14
+ 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: quality bar (MVP vs flagship).
15
+
16
+ ---
17
+
18
+ Perform a meticulous final pass to catch all the small details that separate good work from great work. The difference between shipped and polished.
19
+
20
+ ## Pre-Polish Assessment
21
+
22
+ Understand the current state and goals:
23
+
24
+ 1. **Review completeness**:
25
+ - Is it functionally complete?
26
+ - Are there known issues to preserve (mark with TODOs)?
27
+ - What's the quality bar? (MVP vs flagship feature?)
28
+ - When does it ship? (How much time for polish?)
29
+
30
+ 2. **Identify polish areas**:
31
+ - Visual inconsistencies
32
+ - Spacing and alignment issues
33
+ - Interaction state gaps
34
+ - Copy inconsistencies
35
+ - Edge cases and error states
36
+ - Loading and transition smoothness
37
+
38
+ **CRITICAL**: Polish is the last step, not the first. Don't polish work that's not functionally complete.
39
+
40
+ ## Polish Systematically
41
+
42
+ Work through these dimensions methodically:
43
+
44
+ ### Visual Alignment & Spacing
45
+
46
+ - **Pixel-perfect alignment**: Everything lines up to grid
47
+ - **Consistent spacing**: All gaps use spacing scale (no random 13px gaps)
48
+ - **Optical alignment**: Adjust for visual weight (icons may need offset for optical centering)
49
+ - **Responsive consistency**: Spacing and alignment work at all breakpoints
50
+ - **Grid adherence**: Elements snap to baseline grid
51
+
52
+ **Check**:
53
+ - Enable grid overlay and verify alignment
54
+ - Check spacing with browser inspector
55
+ - Test at multiple viewport sizes
56
+ - Look for elements that "feel" off
57
+
58
+ ### Typography Refinement
59
+
60
+ - **Hierarchy consistency**: Same elements use same sizes/weights throughout
61
+ - **Line length**: 45-75 characters for body text
62
+ - **Line height**: Appropriate for font size and context
63
+ - **Widows & orphans**: No single words on last line
64
+ - **Hyphenation**: Appropriate for language and column width
65
+ - **Kerning**: Adjust letter spacing where needed (especially headlines)
66
+ - **Font loading**: No FOUT/FOIT flashes
67
+
68
+ ### Color & Contrast
69
+
70
+ - **Contrast ratios**: All text meets WCAG standards
71
+ - **Consistent token usage**: No hard-coded colors, all use design tokens
72
+ - **Theme consistency**: Works in all theme variants
73
+ - **Color meaning**: Same colors mean same things throughout
74
+ - **Accessible focus**: Focus indicators visible with sufficient contrast
75
+ - **Tinted neutrals**: No pure gray or pure black—add subtle color tint (0.01 chroma)
76
+ - **Gray on color**: Never put gray text on colored backgrounds—use a shade of that color or transparency
77
+
78
+ ### Interaction States
79
+
80
+ Every interactive element needs all states:
81
+
82
+ - **Default**: Resting state
83
+ - **Hover**: Subtle feedback (color, scale, shadow)
84
+ - **Focus**: Keyboard focus indicator (never remove without replacement)
85
+ - **Active**: Click/tap feedback
86
+ - **Disabled**: Clearly non-interactive
87
+ - **Loading**: Async action feedback
88
+ - **Error**: Validation or error state
89
+ - **Success**: Successful completion
90
+
91
+ **Missing states create confusion and broken experiences**.
92
+
93
+ ### Micro-interactions & Transitions
94
+
95
+ - **Smooth transitions**: All state changes animated appropriately (150-300ms)
96
+ - **Consistent easing**: Use ease-out-quart/quint/expo for natural deceleration. Never bounce or elastic—they feel dated.
97
+ - **No jank**: 60fps animations, only animate transform and opacity
98
+ - **Appropriate motion**: Motion serves purpose, not decoration
99
+ - **Reduced motion**: Respects `prefers-reduced-motion`
100
+
101
+ ### Content & Copy
102
+
103
+ - **Consistent terminology**: Same things called same names throughout
104
+ - **Consistent capitalization**: Title Case vs Sentence case applied consistently
105
+ - **Grammar & spelling**: No typos
106
+ - **Appropriate length**: Not too wordy, not too terse
107
+ - **Punctuation consistency**: Periods on sentences, not on labels (unless all labels have them)
108
+
109
+ ### Icons & Images
110
+
111
+ - **Consistent style**: All icons from same family or matching style
112
+ - **Appropriate sizing**: Icons sized consistently for context
113
+ - **Proper alignment**: Icons align with adjacent text optically
114
+ - **Alt text**: All images have descriptive alt text
115
+ - **Loading states**: Images don't cause layout shift, proper aspect ratios
116
+ - **Retina support**: 2x assets for high-DPI screens
117
+
118
+ ### Forms & Inputs
119
+
120
+ - **Label consistency**: All inputs properly labeled
121
+ - **Required indicators**: Clear and consistent
122
+ - **Error messages**: Helpful and consistent
123
+ - **Tab order**: Logical keyboard navigation
124
+ - **Auto-focus**: Appropriate (don't overuse)
125
+ - **Validation timing**: Consistent (on blur vs on submit)
126
+
127
+ ### Edge Cases & Error States
128
+
129
+ - **Loading states**: All async actions have loading feedback
130
+ - **Empty states**: Helpful empty states, not just blank space
131
+ - **Error states**: Clear error messages with recovery paths
132
+ - **Success states**: Confirmation of successful actions
133
+ - **Long content**: Handles very long names, descriptions, etc.
134
+ - **No content**: Handles missing data gracefully
135
+ - **Offline**: Appropriate offline handling (if applicable)
136
+
137
+ ### Responsiveness
138
+
139
+ - **All breakpoints**: Test mobile, tablet, desktop
140
+ - **Touch targets**: 44x44px minimum on touch devices
141
+ - **Readable text**: No text smaller than 14px on mobile
142
+ - **No horizontal scroll**: Content fits viewport
143
+ - **Appropriate reflow**: Content adapts logically
144
+
145
+ ### Performance
146
+
147
+ - **Fast initial load**: Optimize critical path
148
+ - **No layout shift**: Elements don't jump after load (CLS)
149
+ - **Smooth interactions**: No lag or jank
150
+ - **Optimized images**: Appropriate formats and sizes
151
+ - **Lazy loading**: Off-screen content loads lazily
152
+
153
+ ### Code Quality
154
+
155
+ - **Remove console logs**: No debug logging in production
156
+ - **Remove commented code**: Clean up dead code
157
+ - **Remove unused imports**: Clean up unused dependencies
158
+ - **Consistent naming**: Variables and functions follow conventions
159
+ - **Type safety**: No TypeScript `any` or ignored errors
160
+ - **Accessibility**: Proper ARIA labels and semantic HTML
161
+
162
+ ## Polish Checklist
163
+
164
+ Go through systematically:
165
+
166
+ - [ ] Visual alignment perfect at all breakpoints
167
+ - [ ] Spacing uses design tokens consistently
168
+ - [ ] Typography hierarchy consistent
169
+ - [ ] All interactive states implemented
170
+ - [ ] All transitions smooth (60fps)
171
+ - [ ] Copy is consistent and polished
172
+ - [ ] Icons are consistent and properly sized
173
+ - [ ] All forms properly labeled and validated
174
+ - [ ] Error states are helpful
175
+ - [ ] Loading states are clear
176
+ - [ ] Empty states are welcoming
177
+ - [ ] Touch targets are 44x44px minimum
178
+ - [ ] Contrast ratios meet WCAG AA
179
+ - [ ] Keyboard navigation works
180
+ - [ ] Focus indicators visible
181
+ - [ ] No console errors or warnings
182
+ - [ ] No layout shift on load
183
+ - [ ] Works in all supported browsers
184
+ - [ ] Respects reduced motion preference
185
+ - [ ] Code is clean (no TODOs, console.logs, commented code)
186
+
187
+ **IMPORTANT**: Polish is about details. Zoom in. Squint at it. Use it yourself. The little things add up.
188
+
189
+ **NEVER**:
190
+ - Polish before it's functionally complete
191
+ - Spend hours on polish if it ships in 30 minutes (triage)
192
+ - Introduce bugs while polishing (test thoroughly)
193
+ - Ignore systematic issues (if spacing is off everywhere, fix the system)
194
+ - Perfect one thing while leaving others rough (consistent quality level)
195
+
196
+ ## Final Verification
197
+
198
+ Before marking as done:
199
+
200
+ - **Use it yourself**: Actually interact with the feature
201
+ - **Test on real devices**: Not just browser DevTools
202
+ - **Ask someone else to review**: Fresh eyes catch things
203
+ - **Compare to design**: Match intended design
204
+ - **Check all states**: Don't just test happy path
205
+
206
+ Remember: You have impeccable attention to detail and exquisite taste. Polish until it feels effortless, looks intentional, and works flawlessly. Sweat the details - they matter.