Debug Optimize Lcp logo

Debug Optimize Lcp

OrganizationPopular
ChromeDevTools
debug-optimize-lcp

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.

Overview

PublisherChromeDevTools
Repositorychrome-devtools-mcp
Skill namedebug-optimize-lcp
Stars
52.3K
Forks
4.2K
Bundled files
4
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 4 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by ChromeDevTools on GitHub. Read the source before you install it.

Installation

Install the Debug Optimize Lcp AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/ChromeDevTools/chrome-devtools-mcp.git /tmp/chrome-devtools-mcp
mkdir -p .claude/skills
cp -r /tmp/chrome-devtools-mcp/skills/debug-optimize-lcp .claude/skills/debug-optimize-lcp
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Debug Optimize Lcp in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Debug Optimize Lcp on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Debug Optimize Lcp is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

What is LCP and why it matters

Largest Contentful Paint (LCP) measures how quickly a page's main content becomes visible. It's the time from navigation start until the largest image or text block renders in the viewport.

  • Good: 2.5 seconds or less
  • Needs improvement: 2.5–4.0 seconds
  • Poor: greater than 4.0 seconds

LCP is a Core Web Vital that directly affects user experience and search ranking. On 73% of mobile pages, the LCP element is an image.

LCP Subparts Breakdown

Every page's LCP breaks down into four sequential subparts with no gaps or overlaps. Understanding which subpart is the bottleneck is the key to effective optimization.

SubpartIdeal % of LCPWhat it measures
Time to First Byte (TTFB)~40%Navigation start → first byte of HTML received
Resource load delay<10%TTFB → browser starts loading the LCP resource
Resource load duration~40%Time to download the LCP resource
Element render delay<10%LCP resource downloaded → LCP element rendered

The "delay" subparts should be as close to zero as possible. If either delay subpart is large relative to the total LCP, that's the first place to optimize.

Common Pitfall: Optimizing one subpart (like compressing an image to reduce load duration) without checking others. If render delay is the real bottleneck, a smaller image won't help — the saved time just shifts to render delay.

Debugging Workflow

Follow these steps in order. Each step builds on the previous one.

Step 1: Record a Performance Trace

Navigate to the page, then record a trace with reload to capture the full page load including LCP:

  1. navigate_page with pageId to the target URL.
  2. performance_start_trace with pageId, reload: true and autoStop: true.

The trace results will include LCP timing and available insight sets. Note the insight set IDs from the output — you'll need them in the next step.

Step 2: Analyze LCP Insights

Use performance_analyze_insight to drill into LCP-specific insights. Look for these insight names in the trace results:

  • LCPBreakdown — Shows the four LCP subparts with timing for each.
  • DocumentLatency — Server response time issues affecting TTFB.
  • RenderBlocking — Resources blocking the LCP element from rendering.
  • LCPDiscovery — Whether the LCP resource was discoverable early.

Call performance_analyze_insight with pageId, the insight set ID, and the insight name from the trace results.

Step 3: Identify the LCP Element

Use evaluate_script (with pageId) and the "Identify LCP Element" snippet found in references/lcp-snippets.md to reveal the LCP element's tag, resource URL, and raw timing data.

The url field tells you what resource to look for in the network waterfall. If url is empty, the LCP element is text-based (no resource to load).

Step 4: Check the Network Waterfall

Use list_network_requests to see when the LCP resource loaded relative to other resources:

  • Call list_network_requests with pageId filtered by resourceTypes: ["Image", "Font"] (adjust based on Step 3).
  • Then use get_network_request with pageId and the LCP resource's request ID for full details.

Key Checks:

  • Start Time: Compare against the HTML document and the first resource. If the LCP resource starts much later than the first resource, there's resource load delay to eliminate.
  • Duration: A large resource load duration suggests the file is too big or the server is slow.

Step 5: Inspect HTML for Common Issues

Use evaluate_script (with pageId) and the "Audit Common Issues" snippet found in references/lcp-snippets.md to check for lazy-loaded images in the viewport, missing fetchpriority, and render-blocking scripts.

Optimization Strategies

After identifying the bottleneck subpart, apply these prioritized fixes.

1. Eliminate Resource Load Delay (target: <10%)

The most common bottleneck. The LCP resource should start loading immediately.

  • Root Cause: LCP image loaded via JS/CSS, data-src usage, or loading="lazy".
  • Fix: Use standard <img> with src. Never lazy-load the LCP image.
  • Fix: Add <link rel="preload" fetchpriority="high"> if the image isn't discoverable in HTML.
  • Fix: Add fetchpriority="high" to the LCP <img> tag.

2. Eliminate Element Render Delay (target: <10%)

The element should render immediately after loading.

  • Root Cause: Large stylesheets, synchronous scripts in <head>, or main thread blocking.
  • Fix: Inline critical CSS, defer non-critical CSS/JS.
  • Fix: Break up long tasks blocking the main thread.
  • Fix: Use Server-Side Rendering (SSR) so the element exists in initial HTML.

3. Reduce Resource Load Duration (target: ~40%)

Make the resource smaller or faster to deliver.

  • Fix: Use modern formats (WebP, AVIF) and responsive images (srcset).
  • Fix: Serve from a CDN.
  • Fix: Set Cache-Control headers.
  • Fix: Use font-display: swap if LCP is text blocked by a web font.

4. Reduce TTFB (target: ~40%)

The HTML document itself takes too long to arrive.

  • Fix: Minimize redirects and optimize server response time.
  • Fix: Cache HTML at the edge (CDN).
  • Fix: Ensure pages are eligible for back/forward cache (bfcache).

Verifying Fixes & Emulation

  • Verification: Re-run the trace (performance_start_trace with pageId and reload: true) and compare the new subpart breakdown. The bottleneck should shrink.
  • Emulation: Lab measurements differ from real-world experience. Use emulate to test under constraints:
    • emulate with pageId, networkConditions: "Fast 3G" and cpuThrottlingRate: 4.
    • This surfaces issues visible only on slower connections/devices.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Debug Optimize Lcp AI skill do?

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.

Why use Debug Optimize Lcp on TypingMind?

Because you install it once and use it with any model. Debug Optimize Lcp is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Debug Optimize Lcp in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/ChromeDevTools/chrome-devtools-mcp/tree/main/skills/debug-optimize-lcp. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Debug Optimize Lcp?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Debug Optimize Lcp?

As many as you like. As long as a model supports skills, you can use Debug Optimize Lcp with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Debug Optimize Lcp AI skill free?

Yes. It is published on GitHub by ChromeDevTools under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇