agentleFS
jgamaraalvjgamaraalv/delivery-loop/.claude/skills/core-web-vitals/SKILL.md

core-web-vitals

Skill0 starsChanged 4 months agoMITView on GitHub

Core Web Vitals reference for measuring, diagnosing, and improving LCP, INP, and CLS page performance against Google's thresholds

  • Installs packages
  • Sends data out

33 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use javascript-seo, web-quality-audit and 9 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • MYehia565Skill

    javascript-seo

    Diagnoses JS rendering, lazy-loading, and indexing gaps for client-rendered pages. Use when content appears in the browser but not in fetched HTML or Search.

    Also in 4 projects that use this

  • RodrigoTomeESSkill

    web-quality-audit

    Comprehensive web quality audit covering performance, accessibility, SEO, and best practices. Use when asked to "audit my site", "review web quality", "run lighthouse audit", "check page quality", or "optimize my website".

    Also in 12 projects that use this

  • MYehia565Skill

    ecommerce-seo

    Applies Google ecommerce SEO guidance: IA/URLs, product data, and shopping-related structured data. Use when building or fixing product/category/store search presence.

    Also in 3 projects that use this

  • huiferSkill

    structured-data

    生成和验证 JSON-LD 结构化数据,支持 Article、BlogPosting、Organization、WebPage、Product、LocalBusiness 等 Schema.org 类型。自动检测页面类型,验证语法,检查必需字段,提供 Google Rich Results 测试工具链接和 Next.js 组件代码示例。

    Also in 3 projects that use this

  • kpbraySkill

    best-practices

    Applies Power BI best practices, BPA rules, and enterprise standards. Use for quality validation, naming conventions, and performance optimization.

    Also in 7 projects that use this

  • ElasticSkill

    accessibility

    Accessibility guidance for Kibana. Use this skill when working with or reviewing EUI components, resolving a11y-related (@elastic/eui) ESLint issues, and ensuring proper use of ARIA attributes, focus management, keyboard interactions, and accessible naming conventions.

    Also in 18 projects that use this

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 15 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    All three current Core Web Vitals (LCP, CLS, INP) are Stable.

    line 41
  2. Distinctive:

    When the user provides metric values or a Lighthouse JSON file, generate an interactive HTML report and open it in the browser:

    line 73
  3. Very specific:

    Use find or ls to discover the actual path, then run:

    line 81

“Common” is measured: kept by at least 6 in 10 of the 15 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Core Web Vitals

The three stable Core Web Vitals, each measured at the 75th percentile of real page loads (segmented by mobile and desktop):

MetricMeasuresGoodNeeds ImprovementPoor
LCP — Largest Contentful PaintLoading≤ 2.5 s2.5–4.0 s> 4.0 s
INP — Interaction to Next PaintInteractivity≤ 200 ms200–500 ms> 500 ms
CLS — Cumulative Layout ShiftVisual stability≤ 0.10.1–0.25> 0.25

A page passes Core Web Vitals only if all three metrics meet "Good" at the 75th percentile.

Supporting metrics (non-Core but diagnostic)

  • FCP (First Contentful Paint) — diagnoses render-blocking resources upstream of LCP
  • TTFB (Time to First Byte) — server response time; directly affects LCP
  • TBT (Total Blocking Time) — lab proxy for INP; identifies long tasks

Tools matrix

ToolTypeLCPINPCLSNotes
Chrome User Experience Report (CrUX)Field✓✓✓28-day rolling window of real users
PageSpeed InsightsField + Lab✓✓✓Field = CrUX data; Lab = Lighthouse
Search Console CWV reportField✓✓✓Groups URLs by template
Chrome DevTools Performance panelField + Lab✓✓✓Local profiling, interaction tracing
LighthouseLab✓TBT*✓CI integration; INP → use TBT as proxy

*Lighthouse uses Total Blocking Time (TBT) as a lab proxy for INP. TBT correlates with INP but does not replace field measurement.

Metric lifecycle

Metrics progress through: Experimental → Pending → Stable. All three current Core Web Vitals (LCP, CLS, INP) are Stable. INP replaced FID (First Input Delay) in March 2024. Changes to stable metrics follow an annual cadence with advance notice.

Quick setup: measure all three in the field

npm install web-vitals
import { onCLS, onINP, onLCP } from "web-vitals";

function sendToAnalytics(metric) {
  const body = JSON.stringify(metric);
  (navigator.sendBeacon && navigator.sendBeacon("/analytics", body)) ||
    fetch("/analytics", { body, method: "POST", keepalive: true });
}

onCLS(sendToAnalytics);
onINP(sendToAnalytics);
onLCP(sendToAnalytics);

Each callback receives { name, value, rating, delta, id, navigationType }. rating is "good", "needs-improvement", or "poor".

The web-vitals library handles bfcache restores, prerendered pages, iframe aggregation, and other edge cases that raw PerformanceObserver does not.

Generate a visual report

When the user provides metric values or a Lighthouse JSON file, generate an interactive HTML report and open it in the browser:

To locate the script, find scripts/visualize.py relative to this skill's directory. The path depends on how ts-dev-kit is installed:

  • Project scope: skills/core-web-vitals/scripts/visualize.py or .claude/skills/core-web-vitals/scripts/visualize.py
  • Personal scope: ~/.claude/skills/core-web-vitals/scripts/visualize.py
  • Plugin scope: resolve via node_modules/@jgamaraalv/ts-dev-kit/skills/core-web-vitals/scripts/visualize.py

Use find or ls to discover the actual path, then run:

# From manual values (replace SCRIPT_PATH with the discovered path)
python3 SCRIPT_PATH/visualize.py \
  --lcp 2.1 --inp 180 --cls 0.05 \
  --url https://example.com

# From a Lighthouse JSON output
python3 SCRIPT_PATH/visualize.py \
  --lighthouse lighthouse-report.json

# Custom output path, no auto-open
python3 SCRIPT_PATH/visualize.py \
  --lcp 3.8 --inp 420 --cls 0.12 \
  --output cwv-report.html --no-open

The script (scripts/visualize.py) requires only Python 3 stdlib — no packages to install. It outputs a self-contained HTML file with color-coded metric cards, a visual progress bar showing where each value falls on the Good/Needs Improvement/Poor scale, and an overall PASS/FAIL/NEEDS IMPROVEMENT verdict.

When to read reference files

ReferenceRead when…
references/lcp.mdLCP > 2.5 s, diagnosing slow image/text load, preload/CDN questions
references/inp.mdINP > 200 ms, slow click/key/tap response, long task investigations
references/cls.mdCLS > 0.1, elements jumping on scroll or load, font/image shift
references/tools.mdSetting up monitoring, using DevTools/Lighthouse/PSI, top-9 optimization checklist

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.