Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

web-vitals-analyzer

БесплатноБез исполняемых скриптовНе проверен

Analyze and optimize Core Web Vitals (LCP, CLS, INP) and frontend performance. Use when a user asks to improve page speed, fix layout shifts, reduce loading…

TerminalSkillsот TerminalSkills★ 221 звезда на GitHub

Об этом скилле

Web Vitals Analyzer

Overview

Diagnoses Core Web Vitals failures and frontend performance issues by analyzing page structure, resource loading patterns, JavaScript bundle composition, and rendering behavior. Produces prioritized fixes with estimated metric improvements.

The three metrics are scored at the 75th percentile of real user visits. Google treats them as good when LCP is 2.5 s or less, CLS is 0.1 or less, and INP is 200 ms or less. INP replaced First Input Delay (FID) as a Core Web Vital in March 2024. Lighthouse runs a single lab load and cannot measure INP directly, so field data (Chrome UX Report, PageSpeed Insights "Discover what your real users experience") decides pass or fail.

Instructions

When asked to optimize frontend performance or Core Web Vitals:

  1. Gather the current state — ask for or analyze:

    • Field values from PageSpeed Insights or the Chrome UX Report for the URL, if the site has enough traffic. These are the numbers that count.
    • Lighthouse report (JSON or screenshot). A lab run from the CLI: npx lighthouse https://terminalskills.io --only-categories=performance --output=json --output-path=./lighthouse.json (Lighthouse 13.x needs a local Chrome)
    • The page URL or source code (HTML, CSS, JS entry points)
    • Framework used (React, Next.js, Vue, vanilla, etc.)
    • Current LCP, CLS, and INP values if available
  2. Analyze Largest Contentful Paint (LCP) — target < 2.5s:

    • Identify the LCP element (usually hero image, heading, or above-fold content)
    • Check: Is the LCP image lazy-loaded? (it shouldn't be)
    • Check: Is there a <link rel="preload"> for the LCP resource?
    • Check: Are render-blocking CSS/JS delaying first paint?
    • Check: Server response time (TTFB) — if > 800ms, it's a server issue
    • Check: Font loading strategy — is font-display: swap or optional used?
    • Check: Are critical CSS styles inlined or blocking?
  3. Analyze Cumulative Layout Shift (CLS) — target < 0.1:

    • Identify elements causing layout shifts (images without dimensions, dynamic content, ads, web fonts)
    • Check: Do all <img> and <video> tags have explicit width and height?
    • Check: Is content injected above existing content after load?
    • Check: Are web fonts causing FOUT/FOIT shifts?
    • Check: Are dynamic ads or embeds reserving space with aspect-ratio or fixed containers?
  4. Analyze Interaction to Next Paint (INP) — target < 200ms:

    • Identify heavy JavaScript on the main thread
    • Check: Are event handlers doing synchronous layout thrashing?
    • Check: Long tasks (> 50ms) blocking the main thread
    • Check: Is there unnecessary re-rendering (React: missing memoization, excessive state updates)?
    • Check: Are third-party scripts blocking interaction (analytics, chat widgets, A/B testing)?
    • Suggest: scheduler.yield() where available (Chromium only, so feature-detect it), setTimeout to move non-urgent work after the paint, web workers for heavy computation. requestIdleCallback is not available in Safari, so do not rely on it alone.
  5. Analyze bundle and resource loading:

    • Identify total JS bundle size and largest chunks
    • Check for unused JavaScript (coverage analysis)
    • Suggest code splitting opportunities (route-based, component-based)
    • Check image formats (suggest WebP/AVIF for photos, SVG for icons)
    • Identify duplicate dependencies in the bundle
  6. Output format:

    • Current scores vs targets for each metric
    • Prioritized list of fixes (highest impact first)
    • For each fix: what to change, where in the code, expected improvement
    • A "quick wins" section for changes that take < 15 minutes

Examples

Example 1: Poor LCP on a marketing site

Input:

Our landing page scores 38 on Lighthouse performance. LCP is 5.2s. Here's the page source.

Output:

Core Web Vitals Diagnosis
==========================
LCP: 5.2s (target: < 2.5s) ❌
CLS: 0.03 (target: < 0.1) ✓
INP: N/A (no interaction data)

Root Causes (ranked by impact):

1. CRITICAL: Hero image (2.4MB JPEG) is lazy-loaded
   File: src/components/Hero.tsx:12
   Fix: Remove loading="lazy" from the above-fold hero image.
        Add: <link rel="preload" as="image" href="/hero.jpg" fetchpriority="high">
        Convert to WebP: reduces 2.4MB → 340KB
   Expected LCP improvement: -2.1s

2. HIGH: 3 render-blocking CSS files (total 180KB uncompressed)
   Files: fonts.css (89KB), animations.css (52KB), above-fold.css (39KB)
   Fix: Inline critical CSS (above-fold.css) in <head>.
        Load fonts.css and animations.css with media="print" onload hack.
   Expected LCP improvement: -0.8s

3. MODERATE: Google Fonts loaded via @import in CSS (parser-blocking)
   Fix: Switch to <link rel="preconnect" href="https://fonts.gstatic.com">
        and <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap"> in HTML <head>
   Expected LCP improvement: -0.3s

Quick
Полный SKILL.md на GitHub

Установить web-vitals-analyzer в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

_scores.json

FAQ

Что делает скилл web-vitals-analyzer?

Analyze and optimize Core Web Vitals (LCP, CLS, INP) and frontend performance. Use when a user asks to improve page speed, fix layout shifts, reduce loading times, analyze Lighthouse reports, optimize bundle size, or improve Google PageSpeed scores. Covers image optimization, code splitting, font loading, render-blocking resources, and JavaScript execution costs.

Как установить скилл web-vitals-analyzer?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл web-vitals-analyzer запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить web-vitals-analyzer с