claude/ai-resources-plugin/skills/investigate-web-perf/SKILL.md
--- name: investigate-web-perf description: Investigate web perf issues: LCP/INP regressions, slow interactions, unnecessary React re-renders, bundle bloat, memory leaks, ForcedReflow. Uses chrome-devtools-mcp traces. Requires setup-perf-stack. --- # Investigate Web Performance Issues 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. **Pr
npx skillsauth add amhuppert/my-ai-resources claude/ai-resources-plugin/skills/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.
The agent MUST pass one of these as insightName to performance_analyze_insight. Do not invent names. Do not hand-roll performance.getEntriesByType(...) calls before exhausting insights.
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.tools
Use when picking or vetting a keyboard shortcut on macOS. Triggers include "what hotkey should I use for X", "is `<combo>` available", "does this shortcut conflict", "recommend a keybinding for…", "check `<combo>` against my setup", "pick a hotkey for…", or any mention of choosing/binding/changing a shortcut in WezTerm, tmux, Zed, Chrome, Claude Code, or macOS. Determines whether a proposed combo collides with OS-reserved bindings, app defaults, or the user's customizations, and recommends ergonomic alternatives when needed.
development
Detect and remove dead code with knip. Use when the user asks to "run knip", "find unused files", "find unused exports", "find unused dependencies", "clean up dead code", "remove dead code", "set up knip", "configure knip", "knip.json", "knip false positive", "knip CI", or mentions a `knip` config, dependency bloat, bundle bloat from unused imports, or tree-shaking unused exports. Covers the configuration-first workflow, confidence-gated deletion, framework-specific gotchas (Next.js 15+, Tailwind, Storybook, Jest, Bun's test runner and `bun build --compile`), monorepos, CI integration, and performance tuning.
tools
This skill should be used when the user asks to "set up react-scan", "install react-scan", "diagnose React re-renders", "find unnecessary renders", "find unstable props", "automate React render checks with Playwright", "react-scan + playwright", "measure component renders programmatically", "check why a React component is slow", or mentions React rendering issues, slow React interactions, render counts, or component-level perf attribution. Covers install across Next.js/Vite/Remix/script-tag/browser-extension, the lite headless API for CI, and the canonical render-attribution → fix → validate loop driven through Playwright.
documentation
This skill should be used when integrating source material into a knowledge base, including when the user asks to "integrate this document into the knowledge base", "add this transcript to the memory bank", "ingest this document", "update the knowledge base", "analyze a new source document", or "sync current-state docs with this source".