Analyzes web performance using Chrome DevTools MCP. Measures Core Web Vitals (FCP, LCP, TBT, CLS, Speed Index), identifies render-blocking resources, network dependency chains, layout shifts, caching issues, and accessibility gaps. Use when asked to audit, profile, debug, or optimize page load performance, Lighthouse scores, or site speed.
Add this skill
npx mdskills install cloudflare/web-perfComprehensive performance auditing workflow with Core Web Vitals, network analysis, and codebase optimization guidance
1---2name: web-perf3description: Analyzes web performance using Chrome DevTools MCP. Measures Core Web Vitals (FCP, LCP, TBT, CLS, Speed Index), identifies render-blocking resources, network dependency chains, layout shifts, caching issues, and accessibility gaps. Use when asked to audit, profile, debug, or optimize page load performance, Lighthouse scores, or site speed.4---56# Web Performance Audit78Audit web page performance using Chrome DevTools MCP tools. This skill focuses on Core Web Vitals, network optimization, and high-level accessibility gaps.910## FIRST: Verify MCP Tools Available1112**Run this before starting.** Try calling `navigate_page` or `performance_start_trace`. If unavailable, STOP—the chrome-devtools MCP server isn't configured.1314Ask the user to add this to their MCP config:1516```json17"chrome-devtools": {18 "type": "local",19 "command": ["npx", "-y", "chrome-devtools-mcp@latest"]20}21```2223## Key Guidelines2425- **Be assertive**: Verify claims by checking network requests, DOM, or codebase—then state findings definitively.26- **Verify before recommending**: Confirm something is unused before suggesting removal.27- **Quantify impact**: Use estimated savings from insights. Don't prioritize changes with 0ms impact.28- **Skip non-issues**: If render-blocking resources have 0ms estimated impact, note but don't recommend action.29- **Be specific**: Say "compress hero.png (450KB) to WebP" not "optimize images".30- **Prioritize ruthlessly**: A site with 200ms LCP and 0 CLS is already excellent—say so.3132## Quick Reference3334| Task | Tool Call |35|------|-----------|36| Load page | `navigate_page(url: "...")` |37| Start trace | `performance_start_trace(autoStop: true, reload: true)` |38| Analyze insight | `performance_analyze_insight(insightSetId: "...", insightName: "...")` |39| List requests | `list_network_requests(resourceTypes: ["Script", "Stylesheet", ...])` |40| Request details | `get_network_request(reqid: <id>)` |41| A11y snapshot | `take_snapshot(verbose: true)` |4243## Workflow4445Copy this checklist to track progress:4647```48Audit Progress:49- [ ] Phase 1: Performance trace (navigate + record)50- [ ] Phase 2: Core Web Vitals analysis (includes CLS culprits)51- [ ] Phase 3: Network analysis52- [ ] Phase 4: Accessibility snapshot53- [ ] Phase 5: Codebase analysis (skip if third-party site)54```5556### Phase 1: Performance Trace57581. Navigate to the target URL:59 ```60 navigate_page(url: "<target-url>")61 ```62632. Start a performance trace with reload to capture cold-load metrics:64 ```65 performance_start_trace(autoStop: true, reload: true)66 ```67683. Wait for trace completion, then retrieve results.6970**Troubleshooting:**71- If trace returns empty or fails, verify the page loaded correctly with `navigate_page` first72- If insight names don't match, inspect the trace response to list available insights7374### Phase 2: Core Web Vitals Analysis7576Use `performance_analyze_insight` to extract key metrics.7778**Note:** Insight names may vary across Chrome DevTools versions. If an insight name doesn't work, check the `insightSetId` from the trace response to discover available insights.7980Common insight names:8182| Metric | Insight Name | What to Look For |83|--------|--------------|------------------|84| LCP | `LCPBreakdown` | Time to largest contentful paint; breakdown of TTFB, resource load, render delay |85| CLS | `CLSCulprits` | Elements causing layout shifts (images without dimensions, injected content, font swaps) |86| Render Blocking | `RenderBlocking` | CSS/JS blocking first paint |87| Document Latency | `DocumentLatency` | Server response time issues |88| Network Dependencies | `NetworkRequestsDepGraph` | Request chains delaying critical resources |8990Example:91```92performance_analyze_insight(insightSetId: "<id-from-trace>", insightName: "LCPBreakdown")93```9495**Key thresholds (good/needs-improvement/poor):**96- TTFB: < 800ms / < 1.8s / > 1.8s97- FCP: < 1.8s / < 3s / > 3s98- LCP: < 2.5s / < 4s / > 4s99- INP: < 200ms / < 500ms / > 500ms100- TBT: < 200ms / < 600ms / > 600ms101- CLS: < 0.1 / < 0.25 / > 0.25102- Speed Index: < 3.4s / < 5.8s / > 5.8s103104### Phase 3: Network Analysis105106List all network requests to identify optimization opportunities:107```108list_network_requests(resourceTypes: ["Script", "Stylesheet", "Document", "Font", "Image"])109```110111**Look for:**1121131. **Render-blocking resources**: JS/CSS in `<head>` without `async`/`defer`/`media` attributes1142. **Network chains**: Resources discovered late because they depend on other resources loading first (e.g., CSS imports, JS-loaded fonts)1153. **Missing preloads**: Critical resources (fonts, hero images, key scripts) not preloaded1164. **Caching issues**: Missing or weak `Cache-Control`, `ETag`, or `Last-Modified` headers1175. **Large payloads**: Uncompressed or oversized JS/CSS bundles1186. **Unused preconnects**: If flagged, verify by checking if ANY requests went to that origin. If zero requests, it's definitively unused—recommend removal. If requests exist but loaded late, the preconnect may still be valuable.119120For detailed request info:121```122get_network_request(reqid: <id>)123```124125### Phase 4: Accessibility Snapshot126127Take an accessibility tree snapshot:128```129take_snapshot(verbose: true)130```131132**Flag high-level gaps:**133- Missing or duplicate ARIA IDs134- Elements with poor contrast ratios (check against WCAG AA: 4.5:1 for normal text, 3:1 for large text)135- Focus traps or missing focus indicators136- Interactive elements without accessible names137138## Phase 5: Codebase Analysis139140**Skip if auditing a third-party site without codebase access.**141142Analyze the codebase to understand where improvements can be made.143144### Detect Framework & Bundler145146Search for configuration files to identify the stack:147148| Tool | Config Files |149|------|--------------|150| Webpack | `webpack.config.js`, `webpack.*.js` |151| Vite | `vite.config.js`, `vite.config.ts` |152| Rollup | `rollup.config.js`, `rollup.config.mjs` |153| esbuild | `esbuild.config.js`, build scripts with `esbuild` |154| Parcel | `.parcelrc`, `package.json` (parcel field) |155| Next.js | `next.config.js`, `next.config.mjs` |156| Nuxt | `nuxt.config.js`, `nuxt.config.ts` |157| SvelteKit | `svelte.config.js` |158| Astro | `astro.config.mjs` |159160Also check `package.json` for framework dependencies and build scripts.161162### Tree-Shaking & Dead Code163164- **Webpack**: Check for `mode: 'production'`, `sideEffects` in package.json, `usedExports` optimization165- **Vite/Rollup**: Tree-shaking enabled by default; check for `treeshake` options166- **Look for**: Barrel files (`index.js` re-exports), large utility libraries imported wholesale (lodash, moment)167168### Unused JS/CSS169170- Check for CSS-in-JS vs. static CSS extraction171- Look for PurgeCSS/UnCSS configuration (Tailwind's `content` config)172- Identify dynamic imports vs. eager loading173174### Polyfills175176- Check for `@babel/preset-env` targets and `useBuiltIns` setting177- Look for `core-js` imports (often oversized)178- Check `browserslist` config for overly broad targeting179180### Compression & Minification181182- Check for `terser`, `esbuild`, or `swc` minification183- Look for gzip/brotli compression in build output or server config184- Check for source maps in production builds (should be external or disabled)185186## Output Format187188Present findings as:1891901. **Core Web Vitals Summary** - Table with metric, value, and rating (good/needs-improvement/poor)1912. **Top Issues** - Prioritized list of problems with estimated impact (high/medium/low)1923. **Recommendations** - Specific, actionable fixes with code snippets or config changes1934. **Codebase Findings** - Framework/bundler detected, optimization opportunities (omit if no codebase access)194
Full transparency — inspect the skill content before installing.