plugins/ai-resources/skills/investigate-web-perf/SKILL.md
Trace-based triage of web performance issues via chrome-devtools-mcp: LCP/INP regressions, slow page loads and interactions, ForcedReflow/layout thrashing, CLS, bundle bloat, memory leaks. Captures Chrome performance traces and analyzes them with performance insights. Requires setup-perf-stack. For installing react-scan, component-level React render attribution (unnecessary re-renders, unstable props), or automated render checks with Playwright, use react-scan instead.
npx skillsauth add amhuppert/my-ai-resources investigate-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.
Disciplined, evidence-driven investigation of web app performance problems using chrome-devtools-mcp. This skill is the canonical loop; references are loaded on demand based on the scenario and framework.
Prerequisite: chrome-devtools-mcp and the Chrome DevTools Skills plugin must be installed. If they aren't, stop and run the setup-perf-stack skill first.
performance_analyze_insight with a name from the fixed list of 18.evaluate_script, list_network_requests, list_console_messages, and React DevTools.Every trace in this skill uses these settings. Do not change them mid-investigation; you lose comparability.
cpuThrottlingRate: 4networkConditions: "Slow 4G"new_page + navigate_page, not warm reloadsTighten only if the user explicitly wants a desktop-class target (e.g., cpuThrottlingRate: 1, networkConditions: "Fast 4G"). Document the deviation in the report.
Pass one of these as insightName to performance_analyze_insight. Do not invent names.
Load / paint / rendering:
DocumentLatency, LCPBreakdown, LCPDiscovery, RenderBlockingCLSCulprits, ForcedReflow, SlowCSSSelectorInteraction:
INPBreakdown, LongCriticalNetworkTree, NetworkDependencyTreeJavaScript / delivery:
DuplicatedJavaScript, LegacyJavaScript, ModernHTTPResources / configuration:
ThirdParties, FontDisplay, ImageDelivery, Viewport, Cacheperformance_analyze_insight before writing any custom Perf-API JS. The 18 insights are the complete vocabulary for trace analysis. Custom performance.getEntries*() calls are a last resort, not a first move.filePath: "trace.json.gz" and reference the path. Let the MCP's PerformanceTraceFormatter do the compression (30 MB → ~4 kB, 48 lines).Load on demand — do not read these speculatively. The main SKILL.md (this file) already covers the universal discipline.
| Symptom | Load |
|---------|------|
| Slow first paint, high LCP, LCPBreakdown | references/lcp.md |
| Sluggish click/tap/type, high INP, INPBreakdown | references/inp.md |
| UI janky on scroll/update, React components rendering too often | references/rerenders.md + references/react.md |
| Initial JS payload too large, route-level bundle regression | references/bundle.md |
| Heap grows unboundedly, tab slows after N minutes, detached DOM | references/memory.md |
| Layout shift, CLS > 0.1 | Use CLSCulprits insight directly; escalate to references/lcp.md if layout and LCP are entangled |
| Forced synchronous layout / layout thrashing | Use ForcedReflow insight directly; load references/react.md if React is causing layout reads in render |
| Project | Load |
|---------|------|
| Any React project | references/react.md |
| Next.js 15 or 16+ | references/nextjs.md (plus react.md) |
Do not load framework references if the project doesn't use that framework.
Watch for these and correct immediately:
evaluate_script with a performance.* API, the agent is doing it wrong. Back up and pick an insight.package.json.references/lcp.md — LCP regression workflow: subpart model, insight sequence, prompt template.references/inp.md — INP / slow interaction workflow: Long Animation Frames, presentation split.references/rerenders.md — Unnecessary re-renders workflow: react-scan, classification, React DevTools integration.references/bundle.md — Bundle bloat workflow: DuplicatedJavaScript/LegacyJavaScript, network filtering, source mapping.references/memory.md — Memory leak workflow: heap snapshot comparison, memlab, common leak shapes.references/react.md — React-specific rules: memo discipline, useDeferredValue, <Profiler>, RSC streaming gotchas, tool recommendations.references/nextjs.md — Next.js-specific rules: Turbopack tracing, instrumentation.ts, RSC payload debugging, next build output parsing.development
Debug a running web app via the web-debugger SDK: app logs, application state, runtime snapshots, React state, query cache.
development
Thoroughly understand a software development objective before implementation: research, identify ambiguities, ask clarifying questions. Use before starting implementation of a non-trivial or ambiguously specified feature, or when requirements leave open design decisions.
development
Locate the on-disk Claude Code transcript file (.jsonl under ~/.claude/projects/) for the current or a specified conversation.
development
Reflect on codebase navigation effectiveness at end of conversation. Surfaces dead ends, inefficiencies, missing context. Does not write files — pair with /kiro:steering-custom to persist.