performance-seo-optimization
Installation
SKILL.md
Performance & SEO Optimization Skill
Core Web Vitals checklist
- LCP (Largest Contentful Paint): identify the LCP element (usually hero image/heading) — use
next/imagewithpriorityon it, preload critical fonts, avoid render-blocking client-side data fetching for above-the-fold content (prefer Server Components). - CLS (Cumulative Layout Shift): always set explicit width/height (or
next/image's automatic sizing) on images/embeds; reserve space for ads/dynamic content with a fixed-size skeleton; avoid injecting content above existing content after load. - INP (Interaction to Next Paint): keep the main thread free — avoid large synchronous JS execution on interaction, code-split heavy client components (charts, 3D, rich editors) with
next/dynamic, debounce expensive handlers (search-as-you-type).
Practical optimization order (highest impact first)
- Image optimization (
next/image, correctsizes, modern formats) — usually the single biggest win. - Font loading (
next/fontfor automatic self-hosting +font-display: swapbehavior, subset if using a large font). - Code splitting heavy client-only libraries (3D, charting, rich text editors) via
next/dynamicso they don't block initial load on pages that don't need them. - Server-render/stream content instead of client-fetching on mount.
- Third-party scripts (analytics, chat widgets) loaded with
next/script'sstrategy="lazyOnload"/afterInteractive— neverbeforeInteractiveunless truly required.