Web Performance

Quick Navigation

ReferencePurposeRead When
core-web-vitals.mdLCP, INP, CLS benchmarks, root-cause diagnosis, measurement toolsDiagnosing slow Lighthouse scores or poor field data
resource-optimization.mdJS/CSS bundle size, tree-shaking, code splitting, compressionBundle > 300KB or page load feels slow
image-video.mdModern formats, responsive images, lazy loading, video deliveryOptimizing images or replacing GIFs
font-loading.mdfont-display strategies, preloading, fallback tuningFonts causing FOIT, CLS, or slow LCP

Reading Strategy

Start with the main SKILL.md Decision Tree to identify which metric or area is the problem, then jump to the relevant reference.

  • LCP > 2.5score-web-vitals.md (LCP section) + image-video.md or font-loading.md depending on LCP element
  • INP > 200mscore-web-vitals.md (INP section)
  • CLS > 0.1core-web-vitals.md (CLS section) + font-loading.md if font-related
  • Bundle too largeresource-optimization.md
  • Images not optimizedimage-video.md
  • Font causing layout shiftfont-loading.md

File Descriptions

core-web-vitals.md — Covers the three Core Web Vitals in depth: LCP root causes (slow TTFB, render-blocking resources, unoptimized images), INP diagnosis (long tasks, heavy handlers, Web Workers), and CLS fixes (explicit dimensions, font-display, layout-stable animations). Includes measurement with DevTools, web-vitals library, and Lighthouse CI setup.

resource-optimization.md — Covers JavaScript bundle analysis (Rollup visualizer, source-map-explorer), tree-shaking patterns (lodash-es, barrel file pitfalls), route-level and feature-level code splitting, CSS purging and critical CSS extraction, and compression + caching strategies (Brotli, immutable cache headers, resource hints).

image-video.md — Covers modern image formats (WebP, AVIF, format selection guide), responsive images (srcset + sizes, art direction with <picture>), lazy loading (loading="lazy", fetchpriority, decoding="async"), and video optimization (replacing GIFs with <video>, preload strategy, poster images, lazy loading video).

font-loading.md — Covers font-display values and when to use each (swap vs optional vs fallback), preloading self-hosted fonts (with required crossorigin), fallback font metric overrides (size-adjust, ascent-override) to minimize CLS, variable fonts, Google Fonts self-hosting, and Next.js next/font automatic optimization.


Cross-Reference Map

ProblemPrimary ReferenceRelated Reference
LCP > 2.5s (image)core-web-vitals.mdimage-video.md
LCP > 2.5s (font/text)core-web-vitals.mdfont-loading.md
INP > 200mscore-web-vitals.md
CLS > 0.1 (images)core-web-vitals.mdimage-video.md
CLS > 0.1 (fonts)core-web-vitals.mdfont-loading.md
JS bundle > 300KBresource-optimization.mdcore-web-vitals.md
Unoptimized imagesimage-video.mdcore-web-vitals.md
Font FOIT/CLSfont-loading.mdcore-web-vitals.md
Video replacing GIFimage-video.mdresource-optimization.md