@ia-ccun/code-agent-cli 0.0.3 → 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.
Files changed (189) hide show
  1. package/README.md +92 -11
  2. package/bin/cli.js +212 -59
  3. package/config/agent/APPEND_SYSTEM.md +46 -5
  4. package/config/agent/bin/fd +0 -0
  5. package/config/agent/bin/rg +0 -0
  6. package/config/agent/dangerous-patterns.json +106 -0
  7. package/config/agent/extensions/aicode-tips.ts +191 -0
  8. package/config/agent/extensions/bash-check.ts +227 -0
  9. package/config/agent/extensions/context-monitor.ts +275 -0
  10. package/config/agent/extensions/context.ts +1 -0
  11. package/config/agent/extensions/custom-footer.ts +33 -2
  12. package/config/agent/extensions/custom.ts +24 -91
  13. package/config/agent/extensions/error-monitor.ts +142 -0
  14. package/config/agent/extensions/msg-debug.ts +185 -0
  15. package/config/agent/extensions/review.ts +4 -0
  16. package/config/agent/extensions/working-msg.ts +39 -20
  17. package/config/agent/mcp.json +4 -0
  18. package/config/agent/models.json +16 -43
  19. package/config/agent/prompts/code-simplifier.md +51 -0
  20. package/config/agent/prompts/feat.md +2 -2
  21. package/config/agent/prompts/git-commit.md +9 -15
  22. package/config/agent/prompts/init-project.md +2 -1
  23. package/config/agent/prompts/workflow.md +3 -2
  24. package/config/agent/settings.json +17 -5
  25. package/config/agent/skills/brainstorming/SKILL.md +167 -0
  26. package/config/agent/skills/brainstorming/scripts/frame-template.html +214 -0
  27. package/config/agent/skills/brainstorming/scripts/helper.js +88 -0
  28. package/config/agent/skills/brainstorming/scripts/server.cjs +338 -0
  29. package/config/agent/skills/brainstorming/scripts/start-server.sh +153 -0
  30. package/config/agent/skills/brainstorming/scripts/stop-server.sh +55 -0
  31. package/config/agent/skills/brainstorming/spec-document-reviewer-prompt.md +49 -0
  32. package/config/agent/skills/brainstorming/visual-companion.md +286 -0
  33. package/config/agent/skills/code-review/SKILL.md +4 -2
  34. package/config/agent/skills/commit/SKILL.md +10 -5
  35. package/config/agent/skills/csv-data-summarizer/SKILL.md +2 -1
  36. package/config/agent/skills/design-md/README.md +34 -0
  37. package/config/agent/skills/design-md/SKILL.md +172 -0
  38. package/config/agent/skills/design-md/examples/DESIGN.md +154 -0
  39. package/config/agent/skills/dispatching-parallel-agents/SKILL.md +185 -0
  40. package/config/agent/skills/executing-plans/SKILL.md +73 -0
  41. package/config/agent/skills/find-skills/SKILL.md +5 -1
  42. package/config/agent/skills/finishing-a-development-branch/SKILL.md +204 -0
  43. package/config/agent/skills/fireworks-tech-graph/LICENSE +21 -0
  44. package/config/agent/skills/fireworks-tech-graph/README.md +528 -0
  45. package/config/agent/skills/fireworks-tech-graph/README.zh.md +499 -0
  46. package/config/agent/skills/fireworks-tech-graph/SKILL.md +537 -0
  47. package/config/agent/skills/fireworks-tech-graph/agentloop-core.svg +101 -0
  48. package/config/agent/skills/fireworks-tech-graph/agents/openai.yaml +4 -0
  49. package/config/agent/skills/fireworks-tech-graph/assets/samples/sample-style1-flat.png +0 -0
  50. package/config/agent/skills/fireworks-tech-graph/assets/samples/sample-style2-dark.png +0 -0
  51. package/config/agent/skills/fireworks-tech-graph/assets/samples/sample-style3-blueprint.png +0 -0
  52. package/config/agent/skills/fireworks-tech-graph/assets/samples/sample-style4-notion.png +0 -0
  53. package/config/agent/skills/fireworks-tech-graph/assets/samples/sample-style5-glass.png +0 -0
  54. package/config/agent/skills/fireworks-tech-graph/assets/samples/sample-style6-claude.png +0 -0
  55. package/config/agent/skills/fireworks-tech-graph/assets/samples/sample-style7-openai.png +0 -0
  56. package/config/agent/skills/fireworks-tech-graph/fixtures/agent-memory-types-style4.json +181 -0
  57. package/config/agent/skills/fireworks-tech-graph/fixtures/api-flow-style7.json +40 -0
  58. package/config/agent/skills/fireworks-tech-graph/fixtures/mem0-style1.json +297 -0
  59. package/config/agent/skills/fireworks-tech-graph/fixtures/microservices-style3.json +64 -0
  60. package/config/agent/skills/fireworks-tech-graph/fixtures/multi-agent-style5.json +45 -0
  61. package/config/agent/skills/fireworks-tech-graph/fixtures/system-architecture-style6.json +48 -0
  62. package/config/agent/skills/fireworks-tech-graph/fixtures/tool-call-style2.json +182 -0
  63. package/config/agent/skills/fireworks-tech-graph/package.json +42 -0
  64. package/config/agent/skills/fireworks-tech-graph/references/icons.md +406 -0
  65. package/config/agent/skills/fireworks-tech-graph/references/style-1-flat-icon.md +108 -0
  66. package/config/agent/skills/fireworks-tech-graph/references/style-2-dark-terminal.md +107 -0
  67. package/config/agent/skills/fireworks-tech-graph/references/style-3-blueprint.md +113 -0
  68. package/config/agent/skills/fireworks-tech-graph/references/style-4-notion-clean.md +94 -0
  69. package/config/agent/skills/fireworks-tech-graph/references/style-5-glassmorphism.md +125 -0
  70. package/config/agent/skills/fireworks-tech-graph/references/style-6-claude-official.md +209 -0
  71. package/config/agent/skills/fireworks-tech-graph/references/style-7-openai.md +215 -0
  72. package/config/agent/skills/fireworks-tech-graph/references/style-diagram-matrix.md +135 -0
  73. package/config/agent/skills/fireworks-tech-graph/references/svg-layout-best-practices.md +100 -0
  74. package/config/agent/skills/fireworks-tech-graph/scripts/README.md +244 -0
  75. package/config/agent/skills/fireworks-tech-graph/scripts/generate-diagram.sh +157 -0
  76. package/config/agent/skills/fireworks-tech-graph/scripts/generate-from-template.py +1556 -0
  77. package/config/agent/skills/fireworks-tech-graph/scripts/test-all-styles.sh +135 -0
  78. package/config/agent/skills/fireworks-tech-graph/scripts/validate-svg.sh +292 -0
  79. package/config/agent/skills/fireworks-tech-graph/templates/agent-architecture.svg +28 -0
  80. package/config/agent/skills/fireworks-tech-graph/templates/architecture.svg +23 -0
  81. package/config/agent/skills/fireworks-tech-graph/templates/comparison-matrix.svg +14 -0
  82. package/config/agent/skills/fireworks-tech-graph/templates/data-flow.svg +28 -0
  83. package/config/agent/skills/fireworks-tech-graph/templates/er-diagram.svg +21 -0
  84. package/config/agent/skills/fireworks-tech-graph/templates/flowchart.svg +21 -0
  85. package/config/agent/skills/fireworks-tech-graph/templates/sequence.svg +20 -0
  86. package/config/agent/skills/fireworks-tech-graph/templates/state-machine.svg +20 -0
  87. package/config/agent/skills/fireworks-tech-graph/templates/timeline.svg +19 -0
  88. package/config/agent/skills/fireworks-tech-graph/templates/use-case.svg +21 -0
  89. package/config/agent/skills/frontend-design/SKILL.md +4 -1
  90. package/config/agent/skills/hello/SKILL.md +5 -2
  91. package/config/agent/skills/impeccable/adapt/SKILL.md +204 -0
  92. package/config/agent/skills/impeccable/animate/SKILL.md +177 -0
  93. package/config/agent/skills/impeccable/arrange/SKILL.md +127 -0
  94. package/config/agent/skills/impeccable/audit/SKILL.md +128 -0
  95. package/config/agent/skills/impeccable/bolder/SKILL.md +119 -0
  96. package/config/agent/skills/impeccable/clarify/SKILL.md +185 -0
  97. package/config/agent/skills/impeccable/colorize/SKILL.md +145 -0
  98. package/config/agent/skills/impeccable/critique/SKILL.md +122 -0
  99. package/config/agent/skills/impeccable/delight/SKILL.md +306 -0
  100. package/config/agent/skills/impeccable/distill/SKILL.md +124 -0
  101. package/config/agent/skills/impeccable/extract/SKILL.md +94 -0
  102. package/config/agent/skills/impeccable/frontend-design/reference/color-and-contrast.md +132 -0
  103. package/config/agent/skills/impeccable/frontend-design/reference/interaction-design.md +123 -0
  104. package/config/agent/skills/impeccable/frontend-design/reference/motion-design.md +99 -0
  105. package/config/agent/skills/impeccable/frontend-design/reference/responsive-design.md +114 -0
  106. package/config/agent/skills/impeccable/frontend-design/reference/spatial-design.md +100 -0
  107. package/config/agent/skills/impeccable/frontend-design/reference/typography.md +133 -0
  108. package/config/agent/skills/impeccable/frontend-design/reference/ux-writing.md +107 -0
  109. package/config/agent/skills/impeccable/harden/SKILL.md +357 -0
  110. package/config/agent/skills/impeccable/normalize/SKILL.md +73 -0
  111. package/config/agent/skills/impeccable/onboard/SKILL.md +248 -0
  112. package/config/agent/skills/impeccable/optimize/SKILL.md +268 -0
  113. package/config/agent/skills/impeccable/overdrive/SKILL.md +144 -0
  114. package/config/agent/skills/impeccable/polish/SKILL.md +205 -0
  115. package/config/agent/skills/impeccable/quieter/SKILL.md +105 -0
  116. package/config/agent/skills/impeccable/teach-impeccable/SKILL.md +71 -0
  117. package/config/agent/skills/impeccable/typeset/SKILL.md +118 -0
  118. package/config/agent/skills/librarian/SKILL.md +5 -1
  119. package/config/agent/skills/markdown-to-html/SKILL.md +5 -2
  120. package/config/agent/skills/owasp-security/SKILL.md +539 -0
  121. package/config/agent/skills/pr/SKILL.md +5 -2
  122. package/config/agent/skills/receiving-code-review/SKILL.md +216 -0
  123. package/config/agent/skills/refactor/SKILL.md +5 -2
  124. package/config/agent/skills/requesting-code-review/SKILL.md +108 -0
  125. package/config/agent/skills/requesting-code-review/code-reviewer.md +146 -0
  126. package/config/agent/skills/session-learning/SKILL.md +185 -0
  127. package/config/agent/skills/skill-creator/SKILL.md +339 -213
  128. package/config/agent/skills/skill-creator/agents/analyzer.md +274 -0
  129. package/config/agent/skills/skill-creator/agents/comparator.md +202 -0
  130. package/config/agent/skills/skill-creator/agents/grader.md +223 -0
  131. package/config/agent/skills/skill-creator/assets/eval_review.html +146 -0
  132. package/config/agent/skills/skill-creator/eval-viewer/generate_review.py +471 -0
  133. package/config/agent/skills/skill-creator/eval-viewer/viewer.html +1325 -0
  134. package/config/agent/skills/skill-creator/references/schemas.md +430 -0
  135. package/config/agent/skills/skill-creator/scripts/__init__.py +0 -0
  136. package/config/agent/skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
  137. package/config/agent/skills/skill-creator/scripts/generate_report.py +326 -0
  138. package/config/agent/skills/skill-creator/scripts/improve_description.py +248 -0
  139. package/config/agent/skills/skill-creator/scripts/package_skill.py +33 -7
  140. package/config/agent/skills/skill-creator/scripts/quick_validate.py +11 -3
  141. package/config/agent/skills/skill-creator/scripts/run_eval.py +310 -0
  142. package/config/agent/skills/skill-creator/scripts/run_loop.py +332 -0
  143. package/config/agent/skills/skill-creator/scripts/utils.py +47 -0
  144. package/config/agent/skills/subagent-driven-development/SKILL.md +280 -0
  145. package/config/agent/skills/subagent-driven-development/code-quality-reviewer-prompt.md +26 -0
  146. package/config/agent/skills/subagent-driven-development/implementer-prompt.md +113 -0
  147. package/config/agent/skills/subagent-driven-development/spec-reviewer-prompt.md +61 -0
  148. package/config/agent/skills/systematic-debugging/CREATION-LOG.md +119 -0
  149. package/config/agent/skills/systematic-debugging/SKILL.md +300 -0
  150. package/config/agent/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
  151. package/config/agent/skills/systematic-debugging/condition-based-waiting.md +115 -0
  152. package/config/agent/skills/systematic-debugging/defense-in-depth.md +122 -0
  153. package/config/agent/skills/systematic-debugging/find-polluter.sh +63 -0
  154. package/config/agent/skills/systematic-debugging/root-cause-tracing.md +169 -0
  155. package/config/agent/skills/systematic-debugging/test-academic.md +14 -0
  156. package/config/agent/skills/systematic-debugging/test-pressure-1.md +58 -0
  157. package/config/agent/skills/systematic-debugging/test-pressure-2.md +68 -0
  158. package/config/agent/skills/systematic-debugging/test-pressure-3.md +69 -0
  159. package/config/agent/skills/test-driven-development/SKILL.md +375 -0
  160. package/config/agent/skills/test-driven-development/testing-anti-patterns.md +299 -0
  161. package/config/agent/skills/ui-ux-pro-max/SKILL.md +4 -1
  162. package/config/agent/skills/unit-test/SKILL.md +4 -2
  163. package/config/agent/skills/using-git-worktrees/SKILL.md +222 -0
  164. package/config/agent/skills/using-superpowers/SKILL.md +118 -0
  165. package/config/agent/skills/using-superpowers/references/codex-tools.md +25 -0
  166. package/config/agent/skills/using-superpowers/references/gemini-tools.md +33 -0
  167. package/config/agent/skills/verification-before-completion/SKILL.md +142 -0
  168. package/config/agent/skills/writing-plans/SKILL.md +148 -0
  169. package/config/agent/skills/writing-plans/plan-document-reviewer-prompt.md +49 -0
  170. package/config/agent/skills/writing-skills/SKILL.md +669 -0
  171. package/config/agent/skills/writing-skills/anthropic-best-practices.md +1150 -0
  172. package/config/agent/skills/writing-skills/examples/CLAUDE_MD_TESTING.md +189 -0
  173. package/config/agent/skills/writing-skills/graphviz-conventions.dot +172 -0
  174. package/config/agent/skills/writing-skills/persuasion-principles.md +187 -0
  175. package/config/agent/skills/writing-skills/render-graphs.js +168 -0
  176. package/config/agent/skills/writing-skills/testing-skills-with-subagents.md +384 -0
  177. package/config.json +23 -2
  178. package/dist/banner.js +3 -3
  179. package/dist/banner.js.map +1 -1
  180. package/package.json +21 -16
  181. package/scripts/banner.txt +4 -3
  182. package/scripts/postinstall.js +203 -11
  183. package/config/agent/prompts/git-rollback.md +0 -91
  184. package/config/agent/prompts/git-worktree.md +0 -277
  185. package/config/agent/prompts/help.md +0 -10
  186. package/config/agent/skills/github/SKILL.md +0 -47
  187. package/config/agent/skills/skill-creator/references/output-patterns.md +0 -82
  188. package/config/agent/skills/skill-creator/references/workflows.md +0 -28
  189. package/config/agent/skills/skill-creator/scripts/init_skill.py +0 -303
@@ -0,0 +1,268 @@
1
+ ---
2
+ name: optimize
3
+ description: Improve interface performance across loading speed, rendering, animations, images, and bundle size. Makes experiences faster and smoother.
4
+ user-invocable: true
5
+ args:
6
+ - name: target
7
+ description: The feature or area to optimize (optional)
8
+ required: false
9
+ ---
10
+
11
+ Identify and fix performance issues to create faster, smoother user experiences.
12
+
13
+ ## Assess Performance Issues
14
+
15
+ Understand current performance and identify problems:
16
+
17
+ 1. **Measure current state**:
18
+ - **Core Web Vitals**: LCP, FID/INP, CLS scores
19
+ - **Load time**: Time to interactive, first contentful paint
20
+ - **Bundle size**: JavaScript, CSS, image sizes
21
+ - **Runtime performance**: Frame rate, memory usage, CPU usage
22
+ - **Network**: Request count, payload sizes, waterfall
23
+
24
+ 2. **Identify bottlenecks**:
25
+ - What's slow? (Initial load? Interactions? Animations?)
26
+ - What's causing it? (Large images? Expensive JavaScript? Layout thrashing?)
27
+ - How bad is it? (Perceivable? Annoying? Blocking?)
28
+ - Who's affected? (All users? Mobile only? Slow connections?)
29
+
30
+ **CRITICAL**: Measure before and after. Premature optimization wastes time. Optimize what actually matters.
31
+
32
+ ## Optimization Strategy
33
+
34
+ Create systematic improvement plan:
35
+
36
+ ### Loading Performance
37
+
38
+ **Optimize Images**:
39
+ - Use modern formats (WebP, AVIF)
40
+ - Proper sizing (don't load 3000px image for 300px display)
41
+ - Lazy loading for below-fold images
42
+ - Responsive images (`srcset`, `picture` element)
43
+ - Compress images (80-85% quality is usually imperceptible)
44
+ - Use CDN for faster delivery
45
+
46
+ ```html
47
+ <img
48
+ src="hero.webp"
49
+ srcset="hero-400.webp 400w, hero-800.webp 800w, hero-1200.webp 1200w"
50
+ sizes="(max-width: 400px) 400px, (max-width: 800px) 800px, 1200px"
51
+ loading="lazy"
52
+ alt="Hero image"
53
+ />
54
+ ```
55
+
56
+ **Reduce JavaScript Bundle**:
57
+ - Code splitting (route-based, component-based)
58
+ - Tree shaking (remove unused code)
59
+ - Remove unused dependencies
60
+ - Lazy load non-critical code
61
+ - Use dynamic imports for large components
62
+
63
+ ```javascript
64
+ // Lazy load heavy component
65
+ const HeavyChart = lazy(() => import('./HeavyChart'));
66
+ ```
67
+
68
+ **Optimize CSS**:
69
+ - Remove unused CSS
70
+ - Critical CSS inline, rest async
71
+ - Minimize CSS files
72
+ - Use CSS containment for independent regions
73
+
74
+ **Optimize Fonts**:
75
+ - Use `font-display: swap` or `optional`
76
+ - Subset fonts (only characters you need)
77
+ - Preload critical fonts
78
+ - Use system fonts when appropriate
79
+ - Limit font weights loaded
80
+
81
+ ```css
82
+ @font-face {
83
+ font-family: 'CustomFont';
84
+ src: url('/fonts/custom.woff2') format('woff2');
85
+ font-display: swap; /* Show fallback immediately */
86
+ unicode-range: U+0020-007F; /* Basic Latin only */
87
+ }
88
+ ```
89
+
90
+ **Optimize Loading Strategy**:
91
+ - Critical resources first (async/defer non-critical)
92
+ - Preload critical assets
93
+ - Prefetch likely next pages
94
+ - Service worker for offline/caching
95
+ - HTTP/2 or HTTP/3 for multiplexing
96
+
97
+ ### Rendering Performance
98
+
99
+ **Avoid Layout Thrashing**:
100
+ ```javascript
101
+ // ❌ Bad: Alternating reads and writes (causes reflows)
102
+ elements.forEach(el => {
103
+ const height = el.offsetHeight; // Read (forces layout)
104
+ el.style.height = height * 2; // Write
105
+ });
106
+
107
+ // ✅ Good: Batch reads, then batch writes
108
+ const heights = elements.map(el => el.offsetHeight); // All reads
109
+ elements.forEach((el, i) => {
110
+ el.style.height = heights[i] * 2; // All writes
111
+ });
112
+ ```
113
+
114
+ **Optimize Rendering**:
115
+ - Use CSS `contain` property for independent regions
116
+ - Minimize DOM depth (flatter is faster)
117
+ - Reduce DOM size (fewer elements)
118
+ - Use `content-visibility: auto` for long lists
119
+ - Virtual scrolling for very long lists (react-window, react-virtualized)
120
+
121
+ **Reduce Paint & Composite**:
122
+ - Use `transform` and `opacity` for animations (GPU-accelerated)
123
+ - Avoid animating layout properties (width, height, top, left)
124
+ - Use `will-change` sparingly for known expensive operations
125
+ - Minimize paint areas (smaller is faster)
126
+
127
+ ### Animation Performance
128
+
129
+ **GPU Acceleration**:
130
+ ```css
131
+ /* ✅ GPU-accelerated (fast) */
132
+ .animated {
133
+ transform: translateX(100px);
134
+ opacity: 0.5;
135
+ }
136
+
137
+ /* ❌ CPU-bound (slow) */
138
+ .animated {
139
+ left: 100px;
140
+ width: 300px;
141
+ }
142
+ ```
143
+
144
+ **Smooth 60fps**:
145
+ - Target 16ms per frame (60fps)
146
+ - Use `requestAnimationFrame` for JS animations
147
+ - Debounce/throttle scroll handlers
148
+ - Use CSS animations when possible
149
+ - Avoid long-running JavaScript during animations
150
+
151
+ **Intersection Observer**:
152
+ ```javascript
153
+ // Efficiently detect when elements enter viewport
154
+ const observer = new IntersectionObserver((entries) => {
155
+ entries.forEach(entry => {
156
+ if (entry.isIntersecting) {
157
+ // Element is visible, lazy load or animate
158
+ }
159
+ });
160
+ });
161
+ ```
162
+
163
+ ### React/Framework Optimization
164
+
165
+ **React-specific**:
166
+ - Use `memo()` for expensive components
167
+ - `useMemo()` and `useCallback()` for expensive computations
168
+ - Virtualize long lists
169
+ - Code split routes
170
+ - Avoid inline function creation in render
171
+ - Use React DevTools Profiler
172
+
173
+ **Framework-agnostic**:
174
+ - Minimize re-renders
175
+ - Debounce expensive operations
176
+ - Memoize computed values
177
+ - Lazy load routes and components
178
+
179
+ ### Network Optimization
180
+
181
+ **Reduce Requests**:
182
+ - Combine small files
183
+ - Use SVG sprites for icons
184
+ - Inline small critical assets
185
+ - Remove unused third-party scripts
186
+
187
+ **Optimize APIs**:
188
+ - Use pagination (don't load everything)
189
+ - GraphQL to request only needed fields
190
+ - Response compression (gzip, brotli)
191
+ - HTTP caching headers
192
+ - CDN for static assets
193
+
194
+ **Optimize for Slow Connections**:
195
+ - Adaptive loading based on connection (navigator.connection)
196
+ - Optimistic UI updates
197
+ - Request prioritization
198
+ - Progressive enhancement
199
+
200
+ ## Core Web Vitals Optimization
201
+
202
+ ### Largest Contentful Paint (LCP < 2.5s)
203
+ - Optimize hero images
204
+ - Inline critical CSS
205
+ - Preload key resources
206
+ - Use CDN
207
+ - Server-side rendering
208
+
209
+ ### First Input Delay (FID < 100ms) / INP (< 200ms)
210
+ - Break up long tasks
211
+ - Defer non-critical JavaScript
212
+ - Use web workers for heavy computation
213
+ - Reduce JavaScript execution time
214
+
215
+ ### Cumulative Layout Shift (CLS < 0.1)
216
+ - Set dimensions on images and videos
217
+ - Don't inject content above existing content
218
+ - Use `aspect-ratio` CSS property
219
+ - Reserve space for ads/embeds
220
+ - Avoid animations that cause layout shifts
221
+
222
+ ```css
223
+ /* Reserve space for image */
224
+ .image-container {
225
+ aspect-ratio: 16 / 9;
226
+ }
227
+ ```
228
+
229
+ ## Performance Monitoring
230
+
231
+ **Tools to use**:
232
+ - Chrome DevTools (Lighthouse, Performance panel)
233
+ - WebPageTest
234
+ - Core Web Vitals (Chrome UX Report)
235
+ - Bundle analyzers (webpack-bundle-analyzer)
236
+ - Performance monitoring (Sentry, DataDog, New Relic)
237
+
238
+ **Key metrics**:
239
+ - LCP, FID/INP, CLS (Core Web Vitals)
240
+ - Time to Interactive (TTI)
241
+ - First Contentful Paint (FCP)
242
+ - Total Blocking Time (TBT)
243
+ - Bundle size
244
+ - Request count
245
+
246
+ **IMPORTANT**: Measure on real devices with real network conditions. Desktop Chrome with fast connection isn't representative.
247
+
248
+ **NEVER**:
249
+ - Optimize without measuring (premature optimization)
250
+ - Sacrifice accessibility for performance
251
+ - Break functionality while optimizing
252
+ - Use `will-change` everywhere (creates new layers, uses memory)
253
+ - Lazy load above-fold content
254
+ - Optimize micro-optimizations while ignoring major issues (optimize the biggest bottleneck first)
255
+ - Forget about mobile performance (often slower devices, slower connections)
256
+
257
+ ## Verify Improvements
258
+
259
+ Test that optimizations worked:
260
+
261
+ - **Before/after metrics**: Compare Lighthouse scores
262
+ - **Real user monitoring**: Track improvements for real users
263
+ - **Different devices**: Test on low-end Android, not just flagship iPhone
264
+ - **Slow connections**: Throttle to 3G, test experience
265
+ - **No regressions**: Ensure functionality still works
266
+ - **User perception**: Does it *feel* faster?
267
+
268
+ 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,144 @@
1
+ ---
2
+ name: overdrive
3
+ description: Push interfaces past conventional limits with technically ambitious implementations. Whether that's a shader, a 60fps virtual table, spring physics on a dialog, or scroll-driven reveals — make users ask "how did they do that?"
4
+ user-invocable: true
5
+ args:
6
+ - name: target
7
+ description: The feature or area to push into overdrive (optional)
8
+ required: false
9
+ ---
10
+
11
+ Start your response with:
12
+
13
+ ```
14
+ ──────────── ⚡ OVERDRIVE ─────────────
15
+ 》》》 Entering overdrive mode...
16
+ ```
17
+
18
+ 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.
19
+
20
+ ## MANDATORY PREPARATION
21
+
22
+ 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.
23
+
24
+ **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.
25
+
26
+ ### Propose Before Building
27
+
28
+ This skill has the highest potential to misfire. Do NOT jump straight into implementation. You MUST:
29
+
30
+ 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.
31
+ 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).
32
+ 3. Only proceed with the direction the user confirms.
33
+
34
+ Skipping this step risks building something embarrassing that needs to be thrown away.
35
+
36
+ ### Iterate with Browser Automation
37
+
38
+ 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.
39
+
40
+ ---
41
+
42
+ ## Assess What "Extraordinary" Means Here
43
+
44
+ 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"?**
45
+
46
+ ### For visual/marketing surfaces
47
+ 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.
48
+
49
+ ### For functional UI
50
+ 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.
51
+
52
+ ### For performance-critical UI
53
+ 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.
54
+
55
+ ### For data-heavy interfaces
56
+ 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.
57
+
58
+ **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.
59
+
60
+ ## The Toolkit
61
+
62
+ Organized by what you're trying to achieve, not by technology name.
63
+
64
+ ### Make transitions feel cinematic
65
+ - **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.
66
+ - **`@starting-style`** (all browsers) — animate elements from `display: none` to visible with CSS only, including entry keyframes
67
+ - **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.
68
+
69
+ ### Tie animation to scroll position
70
+ - **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)
71
+
72
+ ### Render beyond CSS
73
+ - **WebGL** (all browsers) — shader effects, post-processing, particle systems. Libraries: Three.js, OGL (lightweight), regl. Use for effects CSS can't express.
74
+ - **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.
75
+ - **Canvas 2D / OffscreenCanvas** — custom rendering, pixel manipulation, or moving heavy rendering off the main thread entirely via Web Workers + OffscreenCanvas.
76
+ - **SVG filter chains** — displacement maps, turbulence, morphology for organic distortion effects. CSS-animatable.
77
+
78
+ ### Make data feel alive
79
+ - **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.
80
+ - **GPU-accelerated charts** — Canvas or WebGL-rendered data visualization for datasets too large for SVG/DOM. Libraries: deck.gl, regl-based custom renderers.
81
+ - **Animated data transitions** — morph between chart states rather than replacing. D3's `transition()` or View Transitions for DOM-based charts.
82
+
83
+ ### Animate complex properties
84
+ - **`@property`** (all browsers) — register custom CSS properties with types, enabling animation of gradients, colors, and complex values that CSS can't normally interpolate.
85
+ - **Web Animations API** (all browsers) — JavaScript-driven animations with the performance of CSS. Composable, cancellable, reversible. The foundation for complex choreography.
86
+
87
+ ### Push performance boundaries
88
+ - **Web Workers** — move computation off the main thread. Heavy data processing, image manipulation, search indexing — anything that would cause jank.
89
+ - **OffscreenCanvas** — render in a Worker thread. The main thread stays free while complex visuals render in the background.
90
+ - **WASM** — near-native performance for computation-heavy features. Image processing, physics simulations, codecs.
91
+
92
+ ### Interact with the device
93
+ - **Web Audio API** — spatial audio, audio-reactive visualizations, sonic feedback. Requires user gesture to start.
94
+ - **Device APIs** — orientation, ambient light, geolocation. Use sparingly and always with user permission.
95
+
96
+ **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.
97
+
98
+ ## Implement with Discipline
99
+
100
+ ### Progressive enhancement is non-negotiable
101
+
102
+ Every technique must degrade gracefully. The experience without the enhancement must still be good.
103
+
104
+ ```css
105
+ @supports (animation-timeline: scroll()) {
106
+ .hero { animation-timeline: scroll(); }
107
+ }
108
+ ```
109
+
110
+ ```javascript
111
+ if ('gpu' in navigator) { /* WebGPU */ }
112
+ else if (canvas.getContext('webgl2')) { /* WebGL2 fallback */ }
113
+ /* CSS-only fallback must still look good */
114
+ ```
115
+
116
+ ### Performance rules
117
+
118
+ - Target 60fps. If dropping below 50, simplify.
119
+ - Respect `prefers-reduced-motion` — always. Provide a beautiful static alternative.
120
+ - Lazy-initialize heavy resources (WebGL contexts, WASM modules) only when near viewport.
121
+ - Pause off-screen rendering. Kill what you can't see.
122
+ - Test on real mid-range devices, not just your development machine.
123
+
124
+ ### Polish is the difference
125
+
126
+ 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.
127
+
128
+ **NEVER**:
129
+ - Ignore `prefers-reduced-motion` — this is an accessibility requirement, not a suggestion
130
+ - Ship effects that cause jank on mid-range devices
131
+ - Use bleeding-edge APIs without a functional fallback
132
+ - Add sound without explicit user opt-in
133
+ - Use technical ambition to mask weak design fundamentals — fix those first with other skills
134
+ - Layer multiple competing extraordinary moments — focus creates impact, excess creates noise
135
+
136
+ ## Verify the Result
137
+
138
+ - **The wow test**: Show it to someone who hasn't seen it. Do they react?
139
+ - **The removal test**: Take it away. Does the experience feel diminished, or does nobody notice?
140
+ - **The device test**: Run it on a phone, a tablet, a Chromebook. Still smooth?
141
+ - **The accessibility test**: Enable reduced motion. Still beautiful?
142
+ - **The context test**: Does this make sense for THIS brand and audience?
143
+
144
+ 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,205 @@
1
+ ---
2
+ name: polish
3
+ description: Final quality pass before shipping. Fixes alignment, spacing, consistency, and detail issues that separate good from great.
4
+ user-invocable: true
5
+ args:
6
+ - name: target
7
+ description: The feature or area to polish (optional)
8
+ required: false
9
+ ---
10
+
11
+ ## MANDATORY PREPARATION
12
+
13
+ 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).
14
+
15
+ ---
16
+
17
+ Perform a meticulous final pass to catch all the small details that separate good work from great work. The difference between shipped and polished.
18
+
19
+ ## Pre-Polish Assessment
20
+
21
+ Understand the current state and goals:
22
+
23
+ 1. **Review completeness**:
24
+ - Is it functionally complete?
25
+ - Are there known issues to preserve (mark with TODOs)?
26
+ - What's the quality bar? (MVP vs flagship feature?)
27
+ - When does it ship? (How much time for polish?)
28
+
29
+ 2. **Identify polish areas**:
30
+ - Visual inconsistencies
31
+ - Spacing and alignment issues
32
+ - Interaction state gaps
33
+ - Copy inconsistencies
34
+ - Edge cases and error states
35
+ - Loading and transition smoothness
36
+
37
+ **CRITICAL**: Polish is the last step, not the first. Don't polish work that's not functionally complete.
38
+
39
+ ## Polish Systematically
40
+
41
+ Work through these dimensions methodically:
42
+
43
+ ### Visual Alignment & Spacing
44
+
45
+ - **Pixel-perfect alignment**: Everything lines up to grid
46
+ - **Consistent spacing**: All gaps use spacing scale (no random 13px gaps)
47
+ - **Optical alignment**: Adjust for visual weight (icons may need offset for optical centering)
48
+ - **Responsive consistency**: Spacing and alignment work at all breakpoints
49
+ - **Grid adherence**: Elements snap to baseline grid
50
+
51
+ **Check**:
52
+ - Enable grid overlay and verify alignment
53
+ - Check spacing with browser inspector
54
+ - Test at multiple viewport sizes
55
+ - Look for elements that "feel" off
56
+
57
+ ### Typography Refinement
58
+
59
+ - **Hierarchy consistency**: Same elements use same sizes/weights throughout
60
+ - **Line length**: 45-75 characters for body text
61
+ - **Line height**: Appropriate for font size and context
62
+ - **Widows & orphans**: No single words on last line
63
+ - **Hyphenation**: Appropriate for language and column width
64
+ - **Kerning**: Adjust letter spacing where needed (especially headlines)
65
+ - **Font loading**: No FOUT/FOIT flashes
66
+
67
+ ### Color & Contrast
68
+
69
+ - **Contrast ratios**: All text meets WCAG standards
70
+ - **Consistent token usage**: No hard-coded colors, all use design tokens
71
+ - **Theme consistency**: Works in all theme variants
72
+ - **Color meaning**: Same colors mean same things throughout
73
+ - **Accessible focus**: Focus indicators visible with sufficient contrast
74
+ - **Tinted neutrals**: No pure gray or pure black—add subtle color tint (0.01 chroma)
75
+ - **Gray on color**: Never put gray text on colored backgrounds—use a shade of that color or transparency
76
+
77
+ ### Interaction States
78
+
79
+ Every interactive element needs all states:
80
+
81
+ - **Default**: Resting state
82
+ - **Hover**: Subtle feedback (color, scale, shadow)
83
+ - **Focus**: Keyboard focus indicator (never remove without replacement)
84
+ - **Active**: Click/tap feedback
85
+ - **Disabled**: Clearly non-interactive
86
+ - **Loading**: Async action feedback
87
+ - **Error**: Validation or error state
88
+ - **Success**: Successful completion
89
+
90
+ **Missing states create confusion and broken experiences**.
91
+
92
+ ### Micro-interactions & Transitions
93
+
94
+ - **Smooth transitions**: All state changes animated appropriately (150-300ms)
95
+ - **Consistent easing**: Use ease-out-quart/quint/expo for natural deceleration. Never bounce or elastic—they feel dated.
96
+ - **No jank**: 60fps animations, only animate transform and opacity
97
+ - **Appropriate motion**: Motion serves purpose, not decoration
98
+ - **Reduced motion**: Respects `prefers-reduced-motion`
99
+
100
+ ### Content & Copy
101
+
102
+ - **Consistent terminology**: Same things called same names throughout
103
+ - **Consistent capitalization**: Title Case vs Sentence case applied consistently
104
+ - **Grammar & spelling**: No typos
105
+ - **Appropriate length**: Not too wordy, not too terse
106
+ - **Punctuation consistency**: Periods on sentences, not on labels (unless all labels have them)
107
+
108
+ ### Icons & Images
109
+
110
+ - **Consistent style**: All icons from same family or matching style
111
+ - **Appropriate sizing**: Icons sized consistently for context
112
+ - **Proper alignment**: Icons align with adjacent text optically
113
+ - **Alt text**: All images have descriptive alt text
114
+ - **Loading states**: Images don't cause layout shift, proper aspect ratios
115
+ - **Retina support**: 2x assets for high-DPI screens
116
+
117
+ ### Forms & Inputs
118
+
119
+ - **Label consistency**: All inputs properly labeled
120
+ - **Required indicators**: Clear and consistent
121
+ - **Error messages**: Helpful and consistent
122
+ - **Tab order**: Logical keyboard navigation
123
+ - **Auto-focus**: Appropriate (don't overuse)
124
+ - **Validation timing**: Consistent (on blur vs on submit)
125
+
126
+ ### Edge Cases & Error States
127
+
128
+ - **Loading states**: All async actions have loading feedback
129
+ - **Empty states**: Helpful empty states, not just blank space
130
+ - **Error states**: Clear error messages with recovery paths
131
+ - **Success states**: Confirmation of successful actions
132
+ - **Long content**: Handles very long names, descriptions, etc.
133
+ - **No content**: Handles missing data gracefully
134
+ - **Offline**: Appropriate offline handling (if applicable)
135
+
136
+ ### Responsiveness
137
+
138
+ - **All breakpoints**: Test mobile, tablet, desktop
139
+ - **Touch targets**: 44x44px minimum on touch devices
140
+ - **Readable text**: No text smaller than 14px on mobile
141
+ - **No horizontal scroll**: Content fits viewport
142
+ - **Appropriate reflow**: Content adapts logically
143
+
144
+ ### Performance
145
+
146
+ - **Fast initial load**: Optimize critical path
147
+ - **No layout shift**: Elements don't jump after load (CLS)
148
+ - **Smooth interactions**: No lag or jank
149
+ - **Optimized images**: Appropriate formats and sizes
150
+ - **Lazy loading**: Off-screen content loads lazily
151
+
152
+ ### Code Quality
153
+
154
+ - **Remove console logs**: No debug logging in production
155
+ - **Remove commented code**: Clean up dead code
156
+ - **Remove unused imports**: Clean up unused dependencies
157
+ - **Consistent naming**: Variables and functions follow conventions
158
+ - **Type safety**: No TypeScript `any` or ignored errors
159
+ - **Accessibility**: Proper ARIA labels and semantic HTML
160
+
161
+ ## Polish Checklist
162
+
163
+ Go through systematically:
164
+
165
+ - [ ] Visual alignment perfect at all breakpoints
166
+ - [ ] Spacing uses design tokens consistently
167
+ - [ ] Typography hierarchy consistent
168
+ - [ ] All interactive states implemented
169
+ - [ ] All transitions smooth (60fps)
170
+ - [ ] Copy is consistent and polished
171
+ - [ ] Icons are consistent and properly sized
172
+ - [ ] All forms properly labeled and validated
173
+ - [ ] Error states are helpful
174
+ - [ ] Loading states are clear
175
+ - [ ] Empty states are welcoming
176
+ - [ ] Touch targets are 44x44px minimum
177
+ - [ ] Contrast ratios meet WCAG AA
178
+ - [ ] Keyboard navigation works
179
+ - [ ] Focus indicators visible
180
+ - [ ] No console errors or warnings
181
+ - [ ] No layout shift on load
182
+ - [ ] Works in all supported browsers
183
+ - [ ] Respects reduced motion preference
184
+ - [ ] Code is clean (no TODOs, console.logs, commented code)
185
+
186
+ **IMPORTANT**: Polish is about details. Zoom in. Squint at it. Use it yourself. The little things add up.
187
+
188
+ **NEVER**:
189
+ - Polish before it's functionally complete
190
+ - Spend hours on polish if it ships in 30 minutes (triage)
191
+ - Introduce bugs while polishing (test thoroughly)
192
+ - Ignore systematic issues (if spacing is off everywhere, fix the system)
193
+ - Perfect one thing while leaving others rough (consistent quality level)
194
+
195
+ ## Final Verification
196
+
197
+ Before marking as done:
198
+
199
+ - **Use it yourself**: Actually interact with the feature
200
+ - **Test on real devices**: Not just browser DevTools
201
+ - **Ask someone else to review**: Fresh eyes catch things
202
+ - **Compare to design**: Match intended design
203
+ - **Check all states**: Don't just test happy path
204
+
205
+ 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.