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__andwindow.__LIGHTHOUSE_DESKTOP_JSON__viaevaluate_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.devwrites 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_snapshotto 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.devreport permalinks; local Lighthouse runs use thelighthouse_audittool directly.