/cwv-superpowers:diagnosing-lcpfrom cwv-superpowers
Diagnoses LCP (Largest Contentful Paint) issues by identifying the LCP element, bottleneck phase (TTFB/LOADDELAY/LOADTIME/RENDERDELAY), and cause pattern. Requires CoreDash MCP. Called by cwv-superpower orchestrator or directly when targeting LCP.
Ships in cwv-superpowers. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Called by the cwv-superpower orchestrator at Step 2B, or invoked directly when the user names LCP as the target metric.
Inputs: a target filter (ff or u with value) and a device (default: mobile).
Run the attribution, breakdown, and trend calls below, then interpret results.
Progress: Print these ↳ sub-status lines as you execute each call:
↳ Identifying LCP element...
↳ Checking element type...
↳ Checking priority state...
↳ Breaking down LCP phases...
↳ Analyzing distribution shape... (if warranted)
↳ Checking 7-day trend...
Use [FILTER_KEY] and [FILTER_VALUE] as placeholders — SKILL.md fills these based on the selected page filter.
get_metrics with:
metrics: "LCP"
group: "lcpel"
[FILTER_KEY]: "[FILTER_VALUE]"
d: "mobile"
Identifies the LCP element as a CSS selector. The top result by traffic volume is the most common LCP element on the page. Use this to know exactly which DOM element is the LCP.
get_metrics with:
metrics: "LCP"
group: "lcpet"
[FILTER_KEY]: "[FILTER_VALUE]"
d: "mobile"
Returns the type of the LCP element. Possible values: image, text, background-image, video. This determines which optimization strategies apply — image LCPs have different fixes than text LCPs.
get_metrics with:
metrics: "LCP"
group: "lcpprio"
[FILTER_KEY]: "[FILTER_VALUE]"
d: "mobile"
Returns the priority/loading state of the LCP resource. Values:
| Value | Meaning |
|---|---|
| 0 | Not an image |
| 1 | Preloaded |
| 2 | High fetchpriority |
| 3 | Not preloaded |
| 4 | Lazy loaded |
Key insight: Priority 3 (not preloaded) is the most common fixable LCP issue — the image exists but the browser discovers it late. Priority 4 (lazy loaded) is actively harmful for LCP because loading="lazy" defers the load until the element is near the viewport, which directly delays the largest paint.
get_metrics with:
metrics: "TTFB,LOADDELAY,LOADTIME,RENDERDELAY"
[FILTER_KEY]: "[FILTER_VALUE]"
d: "mobile"
Returns p75 values for each of the four LCP sub-phases.
CRITICAL: Interpret proportionally. Calculate each phase as a percentage of total LCP (sum of all four phases). The phase with the largest percentage share is the bottleneck. Do NOT judge phases by absolute thresholds — a 400ms LOADDELAY is fine when total LCP is 4000ms (10%) but terrible when total LCP is 800ms (50%).
Example:
If the breakdown findings raise a question — severity doesn't match the phases, the p75 is borderline (within 10% of the 2500ms threshold), or the attribution shows multiple LCP elements with different types — use get_histogram to check the distribution shape.
Print: ↳ Analyzing distribution shape...
get_histogram with:
metric: "LCP"
filters: { "[FILTER_KEY]": "[FILTER_VALUE]", "d": "mobile" }
date: "-7d"
Ask yourself: "Does this distribution change the story?" If the shape reveals something the p75 masked — a subpopulation getting hammered, a bimodal split between fast text-LCP users and slow image-LCP users, a heavy tail extending well past 4000ms — describe what you see and how it changes the diagnosis. If the shape confirms what you already know, move on without mentioning it.
If the shape suggests distinct user groups, you may call 1-2 filtered histograms to isolate what separates them (device, visitor type, network speed). Only do this if it would change the fix.
Caveat: Histograms can mislead. Mixed segments produce artificial shapes. Fixed 250ms bucket widths can split natural clusters. Cross-reference with the breakdown and attribution data.
If the diagnosis is already clear-cut from the breakdown, skip this section entirely.
get_timeseries with:
metrics: "LCP"
filters: { "[FILTER_KEY]": "[FILTER_VALUE]", "d": "mobile" }
date: "-7d"
granularity: "day"
Check the summary.trend field in the response to determine if LCP is improving, stable, or regressing over the past 7 days.
What it means: The server is slow to deliver the HTML document. Everything else is waiting on the first byte.
Common causes:
Chrome trace goals:
What it means: The LCP resource is discovered late by the browser. The HTML arrived, but the browser did not start fetching the LCP resource quickly enough.
Common causes:
background-image (invisible to the preload scanner)<link rel="preload"> hint for the LCP resource<head> delaying HTML parsing and resource discoveryloading="lazy" on the LCP image causing deferred fetchChrome trace goals:
<head> for the LCP resourcefetchpriority attribute and loading attribute on the LCP elementWhat it means: The LCP resource was discovered on time, but the download itself takes too long. The file is too large or the connection is too slow.
Common causes:
srcset — full desktop-size image delivered to mobile devicesChrome trace goals:
x-cache, cf-cache-status, age) to confirm edge deliveryContent-Length against what a properly optimized version would beWhat it means: The LCP resource finished loading, but the browser cannot paint it yet. Something is blocking the render.
Common causes:
<script> tags in <head> blocking the render pipelinedisplay: none or visibility: hidden toggled by JS after loadChrome trace goals:
display, visibility, opacity) on the LCP elementfont-display: swap or optional is used| Excuse | Reality |
|---|---|
| TTFB is only 700ms so it's not the bottleneck | Proportional share matters, not absolute. 700ms at 58% of 1200ms LCP IS the bottleneck. Report the dominant phase regardless of whether its absolute value is "good." |
lcpel selector didn't match — skip attribution | Fall back to lcpet (element type) and lcpprio (fetch priority). Don't give up. Selectors break on minified markup; type + priority still identify the element class. |
| Chrome-measured LCP doesn't match RUM LCP | Expected. Chrome shows structure, not user timing. Don't recalibrate RUM findings to Chrome — RUM is truth for the p75 you're fixing. |
| LCP p75 is 2400ms so it passes Core Web Vitals — move on | Check the tail. A passing p75 with 18% poor loads is failing for one user in six. Pull get_histogram and report the poor-bucket share. |
| Priority 3 (not preloaded) isn't a real issue | Priority 3 on the LCP image is the single most common fixable LCP issue. fetchpriority="high" or a <link rel="preload"> typically removes 200–600ms of LOADDELAY. |
| Largest phase is only 45% — not really a bottleneck | 45% of LCP is still the phase to fix first. Proportional share is the tiebreaker; do not require >50%. |
After running all calls, print ✅ LCP diagnosed: [BOTTLENECK PHASE] is [X]% of LCP — [one-sentence cause]
Then produce this structured summary for SKILL.md:
LCP diagnosis for [PAGE]:
- p75: [VALUE]ms ([RATING]) | Mobile: [VALUE]ms | Desktop: [VALUE]ms
- Distribution: [X]% good / [Y]% needs improvement / [Z]% poor
- LCP element: [CSS SELECTOR] ([TYPE])
- Priority state: [0-4] — [EXPLANATION]
- Bottleneck phase: [PHASE] ([X]% of total LCP)
- TTFB: [VALUE]ms ([X]%)
- LOADDELAY: [VALUE]ms ([X]%)
- LOADTIME: [VALUE]ms ([X]%)
- RENDERDELAY: [VALUE]ms ([X]%)
- Trend (7d): [improving/stable/regressing] ([X]% change)
- Distribution shape: [observation — what it means for this diagnosis] (only if histogram was used)
- Chrome should investigate: [SPECIFIC TRACE GOAL FROM BOTTLENECK SECTION]
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub corewebvitals/cwv-superpowers --plugin cwv-superpowers6 skills in this plugin
/cwv-superpowerOrchestrator for full Core Web Vitals diagnosis. Use when the user asks for a site audit, "find my biggest CWV issue", general page speed help, or multi-metric analysis. Dispatches to peer skills diagnosing-lcp, diagnosing-inp, diagnosing-cls, tracing-with-chrome, and setting-up-coredash. For a single named metric, the agent may invoke the matching diagnosing-* skill directly instead./diagnosing-clsUse when diagnosing CLS (Cumulative Layout Shift) issues — visual layout jumps, content shifting during load, poor CLS at p75, or when the cwv-superpower orchestrator dispatches at Step 2B. Matches the shifting element to one of 5 cause patterns (images without dimensions, FOUT, injected content, late-loading resources, non-composited animations). Requires CoreDash MCP./diagnosing-inpUse when diagnosing INP (Interaction to Next Paint) issues — slow/laggy clicks, delayed interactions, poor INP at p75, or when the cwv-superpower orchestrator dispatches at Step 2B. Identifies the slow interaction element, the bottleneck phase (INPUTDELAY/PROCESSING/PRESENTATION), and the responsible LOAF script. Requires CoreDash MCP./setting-up-coredashUse when setting up the CoreDash MCP server for Core Web Vitals diagnosis — "how do I connect CoreDash", "set up CoreDash", "connect CoreDash with OAuth / browser login", "get a CoreDash API key", "CoreDash isn't connected", or when the cwv-superpower orchestrator has no CoreDash connection and the user wants to connect. Walks through client detection, account setup, keyless OAuth (browser login) or API-key authentication, and per-client MCP configuration./tracing-with-chromeUse when running a Chrome lab trace for a specific CWV bottleneck — investigating LCP/INP/CLS with browser tools after RUM has identified the target phase, element, and cause. Typically called by the cwv-superpower orchestrator at Step 3. Requires either chrome-devtools-mcp (preferred) or claude-in-chrome (fallback).Other plugins' skills for the same job