ai-tooling/skills/web-perf/SKILL.md
Audits web performance using Chrome DevTools MCP. Measures Core Web Vitals, finds render-blocking resources, dependency chains, layout shifts, caching issues, and accessibility gaps. Use for audits, profiling, debugging, or optimising page load performance and Lighthouse scores.
npx skillsauth add nicholasgriffintn/machine-setup web-perfInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill relies on Chrome DevTools MCP. If the MCP server is missing, stop and ask the user to configure it.
Run a quick check before starting. If navigate_page or performance_start_trace is unavailable, stop and ask the user to add the MCP config.
"chrome-devtools": {
"type": "local",
"command": ["npx", "-y", "chrome-devtools-mcp@latest"]
}
Copy this checklist and use it to track progress through the audit:
Audit Progress
- [ ] Phase 1: Performance trace (navigate + record)
- [ ] Phase 2: Core Web Vitals analysis (includes CLS culprits)
- [ ] Phase 3: Network analysis
- [ ] Phase 4: Accessibility snapshot
- [ ] Phase 5: Codebase analysis (skip if third-party site)
The problem is unknown page performance; capture a cold-load trace so you can diagnose it.
Navigate to the target URL:
navigate_page(url: "<target-url>")
Start a performance trace with reload:
performance_start_trace(autoStop: true, reload: true)
Wait for trace completion and capture the results.
Troubleshooting:
navigate_page.Use performance_analyze_insight to extract key metrics. If an insight name fails, use the insightSetId from the trace response to discover available insights.
Common insight names:
| Metric | Insight Name | What to Look For |
| -------------------- | ------------------------- | ------------------------------------------------------- |
| LCP | LCPBreakdown | TTFB, resource load, render delay |
| CLS | CLSCulprits | Images without dimensions, injected content, font swaps |
| Render Blocking | RenderBlocking | CSS/JS blocking first paint |
| Document Latency | DocumentLatency | Server response time issues |
| Network Dependencies | NetworkRequestsDepGraph | Chains delaying critical resources |
Example:
performance_analyze_insight(insightSetId: "<id-from-trace>", insightName: "LCPBreakdown")
Key thresholds (good/needs-improvement/poor):
List requests to identify optimisation opportunities:
list_network_requests(resourceTypes: ["Script", "Stylesheet", "Document", "Font", "Image"])
Look for:
<head> without async/defer/media.Cache-Control, missing ETag/Last-Modified.For details:
get_network_request(reqid: <id>)
Take an accessibility tree snapshot:
take_snapshot(verbose: true)
Flag high-level gaps:
Skip if auditing a third-party site without codebase access.
Detect the stack by searching for config files:
| Tool | Config Files |
| --------- | ------------------------------------------------- |
| Webpack | webpack.config.js, webpack.*.js |
| Vite | vite.config.js, vite.config.ts |
| Rollup | rollup.config.js, rollup.config.mjs |
| esbuild | esbuild.config.js, build scripts with esbuild |
| Parcel | .parcelrc, package.json (parcel field) |
| Next.js | next.config.js, next.config.mjs |
| Nuxt | nuxt.config.js, nuxt.config.ts |
| SvelteKit | svelte.config.js |
| Astro | astro.config.mjs |
Also check package.json for framework dependencies and build scripts.
Tree-shaking and dead code:
mode: "production", sideEffects, and usedExports.treeshake options.Unused JS/CSS:
content config.Polyfills:
@babel/preset-env targets and useBuiltIns.core-js imports.browserslist is not overly broad.Compression and minification:
terser, esbuild, or swc minification.Present findings in this order:
tools
Cloudflare Workers CLI for deploying, developing, and managing Workers, KV, R2, D1, Vectorize, Hyperdrive, Workers AI, Containers, Queues, Workflows, Pipelines, and Secrets Store. Load before running wrangler commands to ensure correct syntax and best practices.
development
Drives changes through a strict red-green-refactor loop using behaviour tests at the public interface. Use when the user asks for TDD, test-first development, integration tests, regression coverage, or a feature built one vertical slice at a time.
testing
A specialist skill for security reviews, threat modeling, and remediation guidance. Use for auth/permissions changes, secrets or PII handling, public endpoints, or dependency upgrades.
development
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.