pagespeed-insights

Installation
SKILL.md

Run pagespeed.web.dev audits

Static HTTP tools (curl, fetch) fail on PageSpeed Insights while an audit runs. Full DOM snapshots (take_snapshot) also flood your token budget with thousands of UI nodes and hide byte-level data.

Instead, PageSpeed Insights writes the full Lighthouse Result (LHR) JSON trees for both Mobile and Desktop onto window:

  • window.__LIGHTHOUSE_MOBILE_JSON__
  • window.__LIGHTHOUSE_DESKTOP_JSON__

Drive a browser tab with chrome-devtools-mcp and read these two window objects via evaluate_script to get both Mobile and Desktop reports in one call. You get exact byte savings, four-phase LCP timings, network request chains, and source-mapped stack traces without clicking UI tabs or scraping DOM text.


Core concepts and rules

1. Dual report extraction from window

  • Rule: Read window.__LIGHTHOUSE_MOBILE_JSON__ and window.__LIGHTHOUSE_DESKTOP_JSON__ via evaluate_script. Do not take DOM snapshots or switch Mobile and Desktop tabs in the UI.
  • Why it holds: Server-side rendering (SSR) on pagespeed.web.dev writes both Mobile and Desktop Lighthouse runs into global JavaScript variables on page load, even though the DOM shows only one tab at a time.
  • What it forbids: Never call take_snapshot to read PageSpeed Insights scores or audit tables. Never waste round-trips clicking the Desktop or Mobile tab buttons to inspect the second form factor.
  • Scope limit: Applies to pagespeed.web.dev report permalinks; local Lighthouse runs use the lighthouse_audit tool directly.
Installs
1
Repository
danicat/skills
GitHub Stars
24
First Seen
8 days ago