diagnosing-cls

diagnosing-cls is a skill for Claude Code from corewebvitals/cwv-superpowers. It costs 86 tokens per session (2,644 once invoked), scanned A, original, MIT.

A workflow for investigating Cumulative Layout Shift (CLS), a measure of how much webpage content moves unexpectedly while a page loads.

In plain words
What is it for?
Use it to find shifting page elements, compare device and visitor groups, check network sensitivity, review recent trends, and match shifts to likely causes.
Why use it?
It helps identify which element causes the visual jumping and compare when the problem is worse, such as on mobile or slow connections.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the cwv-superpowers plugin — 6 skills, 1 hook shipped together

Good fit Use it to find shifting page elements, compare device and visitor groups, check network sensitivity, review recent trends, and match shifts to likely causes.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/corewebvitals/cwv-superpowers/diagnosing-cls
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add corewebvitals/cwv-superpowers --skill diagnosing-cls
Clone the repo
git clone --depth 1 https://github.com/corewebvitals/cwv-superpowers

Made for: Claude Code.

Or install cwv-superpowers, the plugin that ships this one along with the rest of its 6 skills, 1 hook.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for diagnosing-cls

README.md
[![agentmods](https://agentmods.dev/badge/skills/corewebvitals/cwv-superpowers/diagnosing-cls/github.svg)](https://agentmods.dev/skills/corewebvitals/cwv-superpowers/diagnosing-cls)
Your own site
<a href="https://agentmods.dev/skills/corewebvitals/cwv-superpowers/diagnosing-cls"><img src="https://agentmods.dev/badge/skills/corewebvitals/cwv-superpowers/diagnosing-cls/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for diagnosing-cls

Your own site · 80×15
<a href="https://agentmods.dev/skills/corewebvitals/cwv-superpowers/diagnosing-cls"><img src="https://agentmods.dev/badge/skills/corewebvitals/cwv-superpowers/diagnosing-cls.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 86 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,644 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00086 $0.02644
Opus 5 $0.00043 $0.01322
Sonnet 5 $0.00017 $0.00529
Haiku 4.5 $0.00009 $0.00264

Measured 8d ago against content hash a74587c1f0cd, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

diagnosing-cls scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/cwv-superpowers/skills/diagnosing-cls/SKILL.md · 215 lines

How it starts

The opening of the file, as written. The whole thing — 215 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Diagnosing CLS

CLS has no phase breakdown — BREAKDOWN.CLS is ["CLS"]. Diagnosis works by identifying the shifting element and matching it to a cause pattern through cross-dimensional analysis (device type, visitor type, network speed).

Invocation

Called by the cwv-superpower orchestrator at Step 2B, or invoked directly when the user names CLS as the target metric.

Inputs: a target filter (ff or u with value) and a device (default: mobile).

Progress: Print these sub-status lines as you execute each call:

   ↳ Identifying shifting element...
   ↳ Comparing mobile vs desktop...
   ↳ Comparing new vs repeat visitors...
   ↳ Checking network speed sensitivity...
   ↳ Checking 7-day trend...
   ↳ Analyzing distribution shape... (if warranted)

Attribution calls

All calls use the page filter [FILTER_KEY]: "[FILTER_VALUE]" established by the caller.

1. Shifting element identification

get_metrics metric: CLS, group: clsel, [FILTER_KEY]: "[FILTER_VALUE]"

Returns CLS contribution per CSS selector. The top result is the biggest CLS contributor — this is the shifting element to diagnose.

2. Mobile vs desktop split

get_metrics metric: CLS, [FILTER_KEY]: "[FILTER_VALUE]", d: "mobile"
get_metrics metric: CLS, [FILTER_KEY]: "[FILTER_VALUE]", d: "desktop"

Mobile-only CLS causes:

  • Images without responsive sizing (no width/height attributes or CSS aspect-ratio)
  • Ads without reserved space collapsing or expanding on small viewports
  • Font metric differences more pronounced on small screens

Desktop-only CLS (rare):

  • Sidebar widgets loading late and pushing main content
  • Sticky headers recalculating on wider viewports

3. New vs repeat visitor split

get_metrics metric: CLS, [FILTER_KEY]: "[FILTER_VALUE]", fv: "1"
get_metrics metric: CLS, [FILTER_KEY]: "[FILTER_VALUE]", fv: "0"

fv values: 0 = repeat visitor, 1 = new visitor, 2 = not measured (via settings).

A significant gap where new visitors have worse CLS points to uncached resources causing shifts (web fonts, third-party scripts loaded fresh).

Read the full file on GitHub · 215 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 215 lines · 86 tokens per session scan A a74587c1f0cd

Subscribe to this mod's changes

diagnosing-cls is a skill published in the GitHub repository corewebvitals/cwv-superpowers (12 stars, last pushed 2mo ago), licensed MIT. It adds 86 tokens to every session and 2,644 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

inspecting-hermes-desktop-dom

Read the live Hermes desktop DOM/CSS over CDP.

NousResearch/hermes-agent · 20 tokens

fixing-motion-performance

Audit and fix animation performance issues including layout thrashing, compositor properties, scroll-linked motion, and blur effects. Use when animations stutter, transitions jank, or reviewing CSS/JS animation performance.

ibelick/ui-skills · 45 tokens

optimize-web-animations

Profile, audit, and optimize frontend page performance with emphasis on animation work, memory-leak risks, long-session slowdowns, CSS animations, canvas/WebGL requestAnimationFrame loops, marquees, skeletons, GSAP/Three/Matter effects, timers, listeners, and observers. Use when the user asks to make animations…

MengTo/Skills · 126 tokens

weapp-tailwindcss-troubleshoot

A troubleshooting guide for weapp-tailwindcss and its CLI when generated styles, class conversion, builds, or hot reload do not work as expected.

sonofmagic/weapp-tailwindcss · 130 tokens

Dark Mode Bug Finder

Detect dark mode rendering issues including contrast failures, missing theme tokens, image inversions, and transition glitches across components.

PramodDutta/qaskills · 28 tokens

web-animation-perf

Prevent layout/transition/reflow thrash in JS-driven CSS animations. Use when building or debugging continuous motion (rotation, orbit, parallax, scroll-linked effects, marquee, carousels) and when symptoms appear like jank, stutter, lag, animation drift, ghosting, "elements collapsing toward center", "going slow"…

swyxio/skills · 94 tokens