frontend-performance

Diagnoses and improves frontend performance across Core Web Vitals, bundles, and React renders.

Updated Nov 20, 2025
One-click install
npx skills add https://github.com/apuya/react-basics-ui --skill frontend-performance-apuya
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: frontend-performance
Source: https://github.com/apuya/react-basics-ui/tree/main/.claude/skills/frontend-performance
Command: npx skills add https://github.com/apuya/react-basics-ui --skill frontend-performance-apuya

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Web frontends get slower over time through oversized bundles, render-blocking resources, layout shifts, and unmemoised React renders, and teams often optimize blindly without measuring. This Skill provides a measurement-first methodology to audit, debug, design, and tune frontend performance with concrete thresholds and fixes. ## Core Features & Use Cases - Core Web Vitals diagnosis: Decomposes LCP, INP, CLS, FCP, and TTFB into phases with targeted fixes for images, fonts, long tasks, and layout shift. - Bundle and delivery optimization: Covers code splitting, tree shaking, dependency replacement, caching headers, resource hints, and CI-enforced performance budgets. - React render profiling: Guides use of the React Profiler, memoization, list virtualization, and transitions to cut unnecessary re-renders. - Use Case: A team notices their dashboard's INP regressed to 600 ms. Use this Skill in Debug mode to trace the slow interaction to a synchronous filter on every keystroke, apply useDeferredValue, and verify the before/after numbers. ## Quick Start Ask the assistant to audit your page's Core Web Vitals and bundle size, then report tiered findings with the metric each one violates.

Frequently Asked Questions about frontend-performance

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I improve LCP on a slow web page?

LCP improvement starts by decomposing it into TTFB, resource load delay, resource load time, and render delay, then fixing the dominant phase. Common fixes include fetchpriority="high" on the hero image, inlining critical CSS, and removing render-blocking scripts.

How to reduce JavaScript bundle size in a React app?

Bundle reduction uses route-level code splitting with lazy(), named imports from ESM packages, and replacing heavy dependencies like moment or full lodash with lighter alternatives. Measure first with a bundle analyzer and enforce a gzipped byte budget in CI.

What causes poor INP scores and how do I fix them?

Poor INP comes from long main-thread tasks, synchronous handlers rendering large lists, and heavy work in onChange callbacks. Fixes include useTransition, useDeferredValue, yielding with scheduler.yield(), and moving transforms to web workers.

Should I use Lighthouse or CrUX data to prioritize performance work?

Field data from CrUX or RUM should rank what to fix because it reflects real devices and networks. Lab tools like Lighthouse and WebPageTest are better for diagnosing one specific regression reproducibly.

When should I use React memo, useMemo, and useCallback?

Memoization should be applied only where a React Profiler recording shows a real re-render cost, since these APIs add comparison and allocation overhead. Profile first, then memoize components that appear at the top of the flamegraph with an explainable change cause.

Why does my page have layout shift when fonts load?

Layout shift at font swap happens when fallback font metrics differ from the web font. Fix it by matching the fallback with size-adjust, ascent-override, descent-override, and line-gap-override, and always set width and height on images and embeds.