
Optimize
Diagnose and fix laggy UI—Core Web Vitals, bundles, images, animations, and runtime jank—with measure-before/after discipline.
Overview
Optimize is an agent skill most often used in Ship (also Build frontend, Operate iterate) that diagnoses and fixes UI performance across loading, rendering, animations, and bundle size.
Install
npx skills add https://github.com/pbakaus/impeccable --skill optimizeWhat is this skill?
- Structured assess loop: LCP, INP/FID, CLS, TTI, FCP, bundle and network waterfall
- Bottleneck triage: images, expensive JS, layout thrashing, animation frame drops
- Optimization plan across loading (WebP/AVIF, lazy load, srcset), runtime, and animations
- Explicit rule: measure before and after—no premature optimization
- User-invocable with optional [target] scope (v2.1.1)
- Version 2.1.1 user-invocable skill with assess-then-optimize workflow
Adoption & trust: 81.7k installs on skills.sh; 36k GitHub stars; 3/3 security scanners passed (skills.sh audits); trending (+100% hot-view momentum).
What problem does it solve?
Your app feels slow or scores poorly on Core Web Vitals and you do not know which bottleneck—images, JS, or layout—to fix first.
Who is it for?
Solo founders shipping React/Vue/static sites who can run Lighthouse or Web Vitals and want agent-guided remediation.
Skip if: Backend-only API latency tuning with no UI, or teams that will not measure baselines before changing code.
When should I use this skill?
User mentions slow, laggy, janky, performance, bundle size, load time, or wants a faster smoother experience.
What do I get? / Deliverables
You leave with a prioritized fix list and verified before/after metrics for the metrics that actually hurt UX.
- Bottleneck diagnosis tied to LCP/FID/INP/CLS and bundle/network stats
- Prioritized optimization checklist with post-change measurements
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Performance fixes are canonically gated at ship, but symptoms surface while building UI and after launch on real devices. Perf subphase covers loading, rendering, and interaction budgets audited before users feel slowness.
Where it fits
After adding a data-heavy dashboard chart, you measure INP regression and trim expensive re-renders.
Pre-launch Lighthouse run fails LCP on hero images; you apply WebP, sizing, and lazy-load fixes.
Real-user monitoring shows CLS spikes; you trace layout thrashing from dynamic ads or fonts.
How it compares
Structured performance workflow skill—not a one-click CDN toggle or generic “make it faster” chat.
Common Questions / FAQ
Who is optimize for?
Frontend-leaning indie builders who own the whole stack and need Core Web Vitals and runtime smoothness improved.
When should I use optimize?
At ship before launch when audits fail; during build when adding heavy UI; in operate when users report lag or CLS spikes on mobile.
Is optimize safe to install?
Review Security Audits on this Prism page; the skill may suggest code and config changes—validate in a branch and re-measure after each change.
SKILL.md
READMESKILL.md - Optimize
Identify and fix performance issues to create faster, smoother user experiences. ## Assess Performance Issues Understand current performance and identify problems: 1. **Measure current state**: - **Core Web Vitals**: LCP, FID/INP, CLS scores - **Load time**: Time to interactive, first contentful paint - **Bundle size**: JavaScript, CSS, image sizes - **Runtime performance**: Frame rate, memory usage, CPU usage - **Network**: Request count, payload sizes, waterfall 2. **Identify bottlenecks**: - What's slow? (Initial load? Interactions? Animations?) - What's causing it? (Large images? Expensive JavaScript? Layout thrashing?) - How bad is it? (Perceivable? Annoying? Blocking?) - Who's affected? (All users? Mobile only? Slow connections?) **CRITICAL**: Measure before and after. Premature optimization wastes time. Optimize what actually matters. ## Optimization Strategy Create systematic improvement plan: ### Loading Performance **Optimize Images**: - Use modern formats (WebP, AVIF) - Proper sizing (don't load 3000px image for 300px display) - Lazy loading for below-fold images - Responsive images (`srcset`, `picture` element) - Compress images (80-85% quality is usually imperceptible) - Use CDN for faster delivery ```html <img src="hero.webp" srcset="hero-400.webp 400w, hero-800.webp 800w, hero-1200.webp 1200w" sizes="(max-width: 400px) 400px, (max-width: 800px) 800px, 1200px" loading="lazy" alt="Hero image" /> ``` **Reduce JavaScript Bundle**: - Code splitting (route-based, component-based) - Tree shaking (remove unused code) - Remove unused dependencies - Lazy load non-critical code - Use dynamic imports for large components ```javascript // Lazy load heavy component const HeavyChart = lazy(() => import('./HeavyChart')); ``` **Optimize CSS**: - Remove unused CSS - Critical CSS inline, rest async - Minimize CSS files - Use CSS containment for independent regions **Optimize Fonts**: - Use `font-display: swap` or `optional` - Subset fonts (only characters you need) - Preload critical fonts - Use system fonts when appropriate - Limit font weights loaded ```css @font-face { font-family: 'CustomFont'; src: url('/fonts/custom.woff2') format('woff2'); font-display: swap; /* Show fallback immediately */ unicode-range: U+0020-007F; /* Basic Latin only */ } ``` **Optimize Loading Strategy**: - Critical resources first (async/defer non-critical) - Preload critical assets - Prefetch likely next pages - Service worker for offline/caching - HTTP/2 or HTTP/3 for multiplexing ### Rendering Performance **Avoid Layout Thrashing**: ```javascript // ❌ Bad: Alternating reads and writes (causes reflows) elements.forEach(el => { const height = el.offsetHeight; // Read (forces layout) el.style.height = height * 2; // Write }); // ✅ Good: Batch reads, then batch writes const heights = elements.map(el => el.offsetHeight); // All reads elements.forEach((el, i) => { el.style.height = heights[i] * 2; // All writes }); ``` **Optimize Rendering**: - Use CSS `contain` property for independent regions - Minimize DOM depth (flatter is faster) - Reduce DOM size (fewer elements) - Use `content-visibility: auto` for long lists - Virtual scrolling for very long lists (react-window, react-virtualized) **Reduce Paint & Composite**: - Use `transform` and `opacity` for animations (GPU-accelerated) - Avoid animating layout properties (width, height, top, left) - Use `will-change` sparingly for known expensive operations - Minimize paint areas (smaller is faster) ### Animation Performance **GPU Acceleration**: ```css /* ✅ GPU-accelerated (fast) */ .animated { transform: tran