performance-optimization

Implements web performance optimizations including code splitting, caching, and Core Web Vitals monitoring.

Updated Sep 17, 2026
One-click install
npx skills add https://github.com/karenrebecag/spec-driven-standards --skill performance-optimization-karenrebecag
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: performance-optimization
Source: https://github.com/karenrebecag/spec-driven-standards/tree/main/plugins/reliability/skills/performance-optimization
Command: npx skills add https://github.com/karenrebecag/spec-driven-standards --skill performance-optimization-karenrebecag

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Slow page loads, bloated JavaScript bundles, unoptimized images, and poor Core Web Vitals scores degrade user experience and search rankings, and diagnosing them without a structured approach is time-consuming. ## Core Features & Use Cases - Bundle Analysis and Code Splitting: Route-level lazy loading with React.lazy and Suspense, manual vendor chunk configuration in Vite, and bundle visualization with vite-bundle-visualizer and source-map-explorer. - Image and Asset Optimization: Responsive images with Next.js Image, native lazy loading, WebP/AVIF formats, and LCP image preloading with fetchpriority. - Caching and Rendering Strategies: Cache-Control header patterns for immutable assets and stale-while-revalidate APIs, plus list virtualization with @tanstack/react-virtual for large datasets. - Use Case: A React application has a 3MB initial bundle and a 6-second LCP. Apply route-level code splitting, split vendor chunks, preload the hero image, and add web-vitals reporting to bring LCP under 2.5 seconds. ## Quick Start Analyze my React app's performance and apply code splitting, image optimization, and caching headers to improve Core Web Vitals.

Frequently Asked Questions about performance-optimization

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

FAQPage Schema
How do I code split a React application by route?

Use React.lazy with dynamic import() for each route component and wrap the router in Suspense with a fallback skeleton. This loads each page's JavaScript only when the route is visited instead of bundling everything upfront.

How to configure manual chunk splitting in Vite?

Set build.rollupOptions.output.manualChunks in vite.config.ts, mapping chunk names to module arrays such as vendor: ["react", "react-dom"]. Analyze the result with vite-bundle-visualizer or source-map-explorer to verify the split.

What Cache-Control headers should static assets use?

Static assets with content hashes in filenames should use Cache-Control: public, max-age=31536000, immutable. API responses benefit from stale-while-revalidate patterns, while sensitive responses use no-cache, no-store, must-revalidate.

Does Next.js Image component improve Core Web Vitals?

Yes, the Next.js Image component improves LCP and CLS by serving responsive sizes, lazy loading offscreen images, and reserving layout space with explicit width and height. Preload the LCP image with fetchpriority="high" for further gains.

When should I use list virtualization in React?

Use virtualization with libraries like @tanstack/react-virtual when rendering lists of 100 or more items. Rendering thousands of DOM nodes blocks the main thread; virtualization renders only visible rows plus a small overscan buffer.

Why is my INP score poor despite fast page loads?

Poor INP results from long tasks blocking the main thread during interactions, such as synchronous computation or rendering too many DOM nodes. Break up work with requestIdleCallback and virtualize large lists to keep interactions under 200ms.