agentleFS
keuperakeupera/seo-skills/skills/core-web-vitals/SKILL.md

core-web-vitals

Skill0 starsChanged 2 months agoMITView on GitHub

Diagnose and fix Largest Contentful Paint, Interaction to Next Paint and Cumulative Layout Shift on a real site. Use whenever the user mentions Core Web Vitals, LCP, INP, CLS, TTFB, PageSpeed Insights, Lighthouse, page speed, site performance, slow pages, layout shift, unresponsive interactions, CrUX, or a Search Console Core Web Vitals report. Also use when someone asks whether site speed affects rankings or wants a performance score improved.

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

  • 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

  • nilssonrSkill

    seo

    Full SEO workflow for auditing pages and creating SEO-optimized content. Provides checklists with educational explanations aligned with Google Search Central documentation.

    Also in 10 projects that use this

The file

We split this skill into the rules it gives an agent

7 rules. 0 are common, 4 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 15 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Search Console's Core Web Vitals report is better still, because it groups URLs by template and tells you which page types fail rather than …

    line 36
  2. Distinctive:

    Test mobile. Almost all failures are mobile failures, and desktop passing tells you nothing.

    line 38
  3. Very specific:

    Never lazy-load the LCP image.

    line 62
  4. Very specific:

    Never load it via CSS background-image, which the preload scanner can't see.

    line 63
  5. Distinctive:

    Never inject it with JavaScript.

    line 64
  6. Very specific:

    Add fetchpriority="high" to the hero, and only the hero.

    line 65
  7. Distinctive:

    Never insert content above existing content: after load. Cookie banners, promo bars and "you have unread messages" strips pushing the page …

    line 89

“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

Two things to get straight before doing any work.

Field data is the only data that counts. Google ranks on CrUX, which is real Chrome users on real devices and networks. Lighthouse is a simulated lab run on your machine. It's a debugging tool, not a scoreboard. A Lighthouse score of 100 and a failing field LCP happen together constantly.

The ranking effect is small. Page experience is a minor signal and Google has said as much. Fix these because a slow page loses users and conversions, which is a much bigger number than the ranking delta. If someone is choosing between fixing LCP and fixing content, fix the content.

The thresholds

MetricGoodNeeds workPoorWhat it measures
LCP≤ 2.5s≤ 4.0s> 4.0sWhen the main content appears
INP≤ 200ms≤ 500ms> 500msHow fast the page responds to interaction
CLS≤ 0.1≤ 0.25> 0.25How much the layout jumps

Scored at the 75th percentile of real users. Meaning a quarter of your visitors can be having a bad time while the metric passes. Look at the distribution, not just the pass or fail.

Step 1: Get the field data

curl -s "https://www.googleapis.com/pagespeedonline/v5/runPagespeed?url=https://example.com&strategy=mobile&key=$PSI_KEY" \
  | python -c "
import sys, json
d = json.load(sys.stdin).get('loadingExperience', {}).get('metrics', {})
for k, v in d.items():
    print(f\"{k:42} {v['percentile']:>7} {v['category']}\")
"

Search Console's Core Web Vitals report is better still, because it groups URLs by template and tells you which page types fail rather than which single URL you happened to test. Fix a template, fix a thousand pages.

Test mobile. Almost all failures are mobile failures, and desktop passing tells you nothing.

LCP

The LCP element is nearly always a hero image, a heading, or a block of text. Find out which before optimising anything:

new PerformanceObserver((list) => {
  const e = list.getEntries().at(-1)
  console.log('LCP', e.startTime.toFixed(0), e.element)
}).observe({ type: 'largest-contentful-paint', buffered: true })

Then work through the four phases in order. LCP is the sum of these, and it's usually dominated by one.

1. TTFB (target under 800ms). Server response. Fix with caching, a CDN, static generation, or a faster database query. If TTFB is 2 seconds, nothing else you do to the image matters.

2. Resource load delay. The gap between the HTML arriving and the browser starting to fetch the LCP resource. This is the phase people miss and it's often the largest.

<!-- Preload the LCP image so it isn't discovered late -->
<link rel="preload" as="image" href="/hero.avif" fetchpriority="high">
  • Never lazy-load the LCP image. loading="lazy" on a hero adds a full round trip.
  • Never load it via CSS background-image, which the preload scanner can't see.
  • Never inject it with JavaScript.
  • Add fetchpriority="high" to the hero, and only the hero.

3. Resource load time. Serve AVIF or WebP, size the image to its actual displayed dimensions, and use responsive srcset. A 3000px-wide hero on a 390px phone is the most common single cause of a failing mobile LCP.

4. Render delay. Render-blocking CSS and fonts. Inline the critical CSS, defer the rest, and set font-display: swap with a preloaded font file. Web fonts that block text rendering turn a text LCP into a failure.

INP

INP replaced FID and it's much harder to pass, because it measures the full interaction rather than just the delay before handling starts. Failures are almost entirely long JavaScript tasks on the main thread.

  • Find the slow interactions in the field, not the lab. Log them with the event performance entry type and record which element was involved.
  • Break up long tasks. Anything over 50ms blocks input. Yield with await scheduler.yield() where available, setTimeout(0) otherwise.
  • Stop doing expensive work on every keystroke. Debounce input handlers, and never run layout-thrashing reads and writes in a loop.
  • Cut hydration cost. On React sites this is usually the whole story. Server components, fewer client components, less JavaScript shipped.
  • Defer third-party scripts. Analytics, chat widgets, tag managers and consent tools are the most common INP offenders, and they're usually added by someone who never sees the metric.
  • Use CSS for animation, not JavaScript on the main thread.
  • content-visibility: auto on long off-screen sections cuts rendering work substantially.

CLS

The easiest of the three to fix and the most annoying to users.

  • Set width and height on every image and video. The browser reserves the space from the aspect ratio. This one change fixes most CLS.
  • Reserve space for ads, embeds and iframes with a fixed-height container. Ads that resize themselves after load are the top cause on media sites.
  • Never insert content above existing content after load. Cookie banners, promo bars and "you have unread messages" strips pushing the page down are the classic offender. Overlay them or reserve the space.
  • Preload fonts and match fallback metrics with size-adjust and ascent-override, so the swap doesn't reflow the text.
  • Use transform for animation, never top, left, width or height.

Debug with:

new PerformanceObserver((list) => {
  for (const e of list.getEntries()) {
    if (!e.hadRecentInput && e.value > 0.01) console.log(e.value.toFixed(3), e.sources?.map(s => s.node))
  }
}).observe({ type: 'layout-shift', buffered: true })

Order of work

  1. Get field data and identify which metric fails, on which template, on mobile.
  2. Fix that one. Don't fix all three at once.
  3. Ship, wait 28 days for CrUX to update, re-measure.

That 28-day window is the part that surprises people. Field data is a rolling 28-day average, so a fix shipped today shows up gradually over a month. Anyone reporting an improvement two days later is reading lab data.

Don't do these

  • Don't optimise for the Lighthouse score. It's a lab simulation with a known set of gameable inputs. Passing field metrics is the goal.
  • Don't install a performance plugin and consider it done. They mostly add JavaScript.
  • Don't lazy-load above-the-fold images. The most common self-inflicted LCP failure.
  • Don't defer CSS the page needs immediately. You'll trade LCP for a flash of unstyled content.
  • Don't chase 100/100. The thresholds are the thresholds. Effort past "good" returns nothing.
  • Don't promise a ranking improvement. Promise a faster site and better conversion, which is true and measurable.

Related skills

technical-seo-audit, nextjs-seo, image-seo, search-console-analysis

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.