optimize-skill
Skill1 starsChanged 11 days agoMITView on GitHub
Fix performance issues: bundle size, animations, reflows, lazy loading, image optimization, render blocking. Use after profiling reveals bottlenecks. Do NOT use for cosmetic changes.
We split this skill into the rules it gives an agent
1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 23
After profiling reveals a specific bottleneck
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Optimize Skill
Fix performance issues so applications load fast and animate smoothly.
Performance fixes are deterministic. Profile first, then apply the specific fix for the specific bottleneck.
When to Use
- After profiling reveals a specific bottleneck
- User says "this page is slow"
- Lighthouse / PageSpeed score is below target
- User says "animations jank" or "scrolling stutters"
- Bundle size exceeds budget (500KB critical path JS)
- Images are loading at full resolution on mobile
When NOT to Use
- Speculative optimization (measure first)
- Design changes that happen to improve performance
- Pre-optimization during initial build (build clean first, optimize later)
Output Contract
| Artifact | Format | Location | Quality Criteria |
| Performance fixes | HTML/CSS/JS code changes | Source files | Profile-validated, Lighthouse ≥90, critical JS <500KB |
Process
1. Profile
Identify the bottleneck before fixing:
| Symptom | Likely cause |
| Slow first load | Large bundle, render-blocking resources, unoptimized images |
| Slow after load | Missing lazy load, too many fonts, too much JS |
| Janky animation | Animating width/height/top/left, missing will-change |
| Janky scroll | Layout thrashing, expensive handlers on scroll/resize |
| Slow interaction | Long tasks, heavy computation on main thread |
2. Fix by Category
Bundle Size
| Issue | Fix |
| No code splitting | Add dynamic imports for route-level chunks |
| Large dependency | Replace with smaller alternative or tree-shake |
| Duplicate polyfills | Deduplicate, use core-js selectively |
| Unused CSS | Remove dead styles, use purge (Tailwind JIT) |
| Heavy library only used once | Inline the small part, remove the import |
Images
| Issue | Fix |
| Full-res images on mobile | Serve responsive sizes via srcset |
| No lazy loading | Add loading="lazy" to below-fold images |
| Giant hero image | Compress to WebP/AVIF, limit to viewport width |
| Missing dimensions | Add width and height to prevent CLS |
| Icon as image file | Inline SVG or icon sprite |
Animation
| Issue | Fix |
Animating width | Switch to transform: scaleX() |
Animating top/left | Switch to transform: translate() |
No will-change | Add will-change: transform, opacity on animated elements |
| Expensive filter | Prefer box-shadow or separate overlay element |
| JS animation | Switch to CSS animation or Web Animations API |
Rendering
| Issue | Fix |
| Layout thrashing | Batch DOM reads before writes, use requestAnimationFrame |
| Expensive scroll handler | Debounce or use IntersectionObserver |
| Long task > 50ms | Defer with requestIdleCallback or split into microtasks |
| Reflow on scroll | Avoid reading offsetTop, scrollTop in scroll handlers |
3. Output Format
/optimize the product listing page
Fix 1: Lazy load images
- Before: <img src="...">
- After: <img loading="lazy" src="...">
Fix 2: Code-split review form
- Before: import ReviewForm from './ReviewForm' (eager)
- After: const ReviewForm = lazy(() => import('./ReviewForm'))
Fix 3: Reduce hero image
- Before: 2400x1600 JPEG (1.2MB)
- After: 1200x800 WebP (180KB) via <picture> + srcset
Fix 4: Animation jank on hover card
- Before: transition: width 200ms, height 200ms
- After: transition: transform 200ms; transform: scale(1.05)4. Escalation Rules
| Finding | Escalate to |
| Need new component structure for performance | redesign or build |
| Image CDN or format not available | Infra decision |
| Third-party script blocking | Negotiate alternative with team |
→ See guides/BOTTLENECK-GUIDE.md for common bottlenecks and fixes.
→ See guides/METRICS-GUIDE.md for performance budgets and measurement.
Pitfalls
- Optimizing before profiling — Measuring is not optional. The bottleneck is never where you guess.
- Premature code splitting — Splitting every import adds network overhead. Split routes, not components.
- Image over-optimization — Aggressive compression creates artifacts. Balance size vs quality.
- Ignoring mobile network — 3G is real. Test on slow networks.
QA Gates
- Profiling data exists (not speculative fixes)
- Images are lazy-loaded below fold
- Images use responsive sizes (
srcset) - Animations use
transformandopacityonly - No layout thrashing in scroll/resize handlers
- Route-level code splitting in place
- Critical JS bundle < 500KB
- Lighthouse performance score ≥ 90 (or improvement confirmed)
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- ghbalf/freecad-ai★ 576same name
- gabimoncha/skills★ 11same name
- okdk7788/opencode-self-improving-skills★ 4same name
- liorhai5/ai-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository59 other files it gives its agents.
- AGENTS.mdAGENTS.md
- templates/CLAUDE.mdCLAUDE.md
- adapt-skillSkill
- api-and-interface-designSkill
- architecture-analysisSkill
- audit-skillSkill
- backend-api-masterySkill
- browser-testing-with-devtoolsSkill
- ci-cd-and-automationSkill
- clarify-skillSkill
- cli-toolsSkill
- code-review-and-qualitySkill
- code-simplificationSkill
- context-engineeringSkill
- critique-skillSkill
- customize-opencodeSkill
- debugging-and-error-recoverySkill
- debugging-three-strikesSkill
- delight-skillSkill
- deprecation-and-migrationSkill
- dev-environment-auditSkill
- documentation-and-adrsSkill
- doubt-driven-developmentSkill
- engineering-fundamentalsSkill
- frontend-desktopSkill
- frontend-mobileSkill
- frontend-pwaSkill
- frontend-ui-engineeringSkill
- frontend-webSkill
- fullstack-shippingSkill
- gateSkill
- git-init-and-versioningSkill
- git-workflow-and-versioningSkill
- hard-skillSkill
- idea-refineSkill
- incremental-implementationSkill
- industrial-brutalist-uiSkill
- interview-meSkill
- minimalist-uiSkill
- multi-agent-orchestrationSkill
- observability-and-instrumentationSkill
- output-skillSkill
- performance-optimizationSkill
- planning-and-task-breakdownSkill
- polish-skillSkill
- project-health-checkSkill
- project-metricsSkill
- redesign-skillSkill
- security-and-hardeningSkill
- self-improvementSkill
- shipping-and-launchSkill
- skill-creatorSkill
- skill-improverSkill
- soft-premium-uiSkill
- source-driven-developmentSkill
- spec-driven-developmentSkill
- test-driven-developmentSkill
- typeset-skillSkill
- user-onboardingSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

