All skills
chromedevtools avatar

/debug-optimize-lcp

@50a16fa

Guides debugging and optimizing Largest Contentful Paint (LCP) using Chrome DevTools MCP tools. Use this skill whenever the user asks about LCP performance, slow page loads, Core Web Vitals optimization, or wants to understand why their page's main content takes too long to appear. Also use when the user mentions "largest contentful paint", "page load speed", "CWV", or wants to improve how fast their hero image or main content renders.

Use this Skill: https://skilld.dev/gh/chromedevtools/chrome-devtools-mcp/debug-optimize-lcp

This session only. Nothing lands on disk.

referencesoptimization-strategies.md

≈539 tokens on demand. Your agent reads this file only when SKILL.md points to it.

LCP Optimization Strategies

1. Eliminate Resource Load Delay

Goal: Ensure the LCP resource starts loading as early as possible.

  • Early Discovery: Ensure the LCP resource is discoverable in the initial HTML document response (not dynamically added by JS or hidden in data-src).
  • Preload: Use <link rel="preload"> with fetchpriority="high" for critical images or fonts.
  • Avoid Lazy Loading: Never set loading="lazy" on the LCP image.
  • Fetch Priority: Use fetchpriority="high" on the <img> tag.
  • Same Origin: Host critical resources on the same origin or use <link rel="preconnect">.

2. Eliminate Element Render Delay

Goal: Ensure the LCP element can render immediately after its resource has finished loading.

  • Minimize Render-Blocking CSS: Inline critical CSS and defer non-critical CSS. Ensure the stylesheet is smaller than the LCP resource.
  • Minimize Render-Blocking JS: Avoid synchronous scripts in the <head>. Inline very small scripts.
  • Server-Side Rendering (SSR): Deliver the full HTML markup from the server so image resources are discoverable immediately.
  • Break Up Long Tasks: Prevent large JavaScript tasks from blocking the main thread during rendering.

3. Reduce Resource Load Duration

Goal: Reduce the time spent transferring the bytes of the resource.

  • Optimize Resource Size: Serve optimal image sizes, use modern formats (AVIF, WebP), and compress images/fonts.
  • Geographic Proximity (CDN): Use a Content Delivery Network to get servers closer to users.
  • Reduce Contention: Use fetchpriority="high" to prevent lower-priority resources from competing for bandwidth.
  • Caching: Use efficient Cache-Control policies.

4. Reduce Time to First Byte (TTFB)

Goal: Deliver the initial HTML as quickly as possible.

  • Minimize Redirects: Avoid multiple redirects from advertisements or shortened links.
  • CDN Caching: Cache static HTML documents at the edge.
  • Edge Computing: Move dynamic logic to the edge to avoid trips to the origin server.
  • Back/Forward Cache: Ensure pages are eligible for bfcache.

Source: SKILL.md on GitHub

2 warnings16d5 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    This skill is a legitimate tool for web developers to diagnose and optimize 'Largest Contentful Paint' (LCP) performance. It uses standard Chrome DevTools instrumentation and safe JavaScript snippets to analyze web pages.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: MEDIUM · 1 issue

  • Runlayer7mo

    4/5 files flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 50a16fa. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 1 hour ago.

Activeupdated last month

README badge

README badge for chromedevtools/chrome-devtools-mcp/debug-optimize-lcp