optimize

Diagnoses and fixes UI performance issues across loading, rendering, animations, and bundle size.

Updated Apr 20, 2026
One-click install
npx skills add https://github.com/ShyamRavidath/oscc-detection-v2 --skill optimize-shyamravidath
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: optimize
Source: https://github.com/ShyamRavidath/oscc-detection-v2/tree/main/.agents/skills/optimize
Command: npx skills add https://github.com/ShyamRavidath/oscc-detection-v2 --skill optimize-shyamravidath

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Web interfaces often suffer from slow load times, janky animations, and bloated bundles that degrade user experience, and developers struggle to identify which bottleneck actually matters. This Skill provides a systematic methodology to measure, diagnose, and fix UI performance problems instead of guessing. ## Core Features & Use Cases - Measurement-First Diagnosis: Assesses Core Web Vitals (LCP, FID/INP, CLS), bundle size, runtime frame rates, and network waterfalls before changing any code. - Loading & Bundle Optimization: Covers image optimization (WebP/AVIF, srcset, lazy loading), code splitting, tree shaking, font subsetting, and critical CSS strategies. - Rendering & Animation Fixes: Addresses layout thrashing, GPU-accelerated animations with transform/opacity, virtual scrolling, and React-specific patterns like memo, useMemo, and useCallback. - Use Case: A Next.js product page feels sluggish on mobile. Use this Skill to measure LCP and INP, discover an oversized hero image and a heavy unmemoized component, then apply responsive images and code splitting to hit Core Web Vitals targets. ## Quick Start Use the optimize skill to analyze my landing page and fix whatever is making it load slowly and feel janky on mobile.

Frequently Asked Questions about optimize

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I improve Core Web Vitals scores on my website?

Improve Core Web Vitals by targeting each metric: optimize hero images and inline critical CSS for LCP under 2.5s, break up long JavaScript tasks for INP under 200ms, and set explicit dimensions on images and embeds to keep CLS under 0.1. Measure with Lighthouse before and after each change.

How to reduce JavaScript bundle size in a React app?

Reduce bundle size with route-based and component-based code splitting, dynamic imports for heavy components, tree shaking to remove unused code, and removing unused dependencies. Use a bundle analyzer to identify the largest contributors first.

Why are my CSS animations janky and how do I fix them?

Animations are janky when they animate layout properties like width, height, top, or left, forcing expensive reflows. Animate only transform and opacity, which are GPU-accelerated, and target 16ms per frame for smooth 60fps rendering.

What is layout thrashing and how do I avoid it?

Layout thrashing happens when JavaScript alternates between reading layout properties and writing styles, forcing repeated reflows. Fix it by batching all reads first, then performing all writes together in a separate pass.

Should I lazy load all images on my page?

No, never lazy load above-the-fold content like hero images, since that delays Largest Contentful Paint. Apply lazy loading only to below-fold images, and use responsive srcset with modern formats like WebP or AVIF for all images.

When should I use will-change in CSS?

Use will-change sparingly and only for known expensive animations, because each use creates a new compositor layer that consumes memory. Applying it broadly degrades performance instead of improving it.