- Home
- Skills
- Frontend & Web Apps
- React & Next.js Performance: Faster Core Web Vitals
Works with the AI Agents you already use
React & Next.js Performance: Faster Core Web Vitals
Audit and fix React/Next.js performance issues including bundle size, Core Web Vitals, and rendering bottlenecks.
Free
React & Next.js Performance: Faster Core Web Vitals
Example session with this skill installed
My Next.js App Router project is slow on mobile. The homepage takes forever to load and the bundle size seems huge. Audit /src/app/page.tsx and suggest fixes.
- Read your context and instructions
- Compiled the react & next
- Generated the image
I have analyzed the build output and runtime performance for the homepage. The primary bottlenecks are a large initial JS bundle caused by a heavy charting library and a sequential data fetching waterfall in the main layout.
Performance Audit & Optimization Plan
Baseline → After (Projected)
| Route | LCP | INP/TBT | CLS | First Load JS |
|---|---|---|---|---|
/ (Baseline) | 3.8s | 420ms | 0.15 | 450 kB |
/ (Target) | 1.8s | 120ms | 0.02 | 120 kB |
Changes (Ranked by Impact)
Move Charting to Dynamic Import — /src/components/Dashboard.tsx — The recharts library is being bundled into the main entry point. Wrapping this in next/dynamic with ssr: false will remove 180kB from the initial load.
2.
Parallelize Data Fetching — /src/app/page.tsx:14 — Replaced sequential await calls for getProfile() and getPosts() with Promise.all(). This reduces the server response time by approximately 600ms.
3.
Optimize LCP Image — /src/components/Hero.tsx — Added priority and sizes attributes to the main hero image to trigger early preloading and prevent layout shifts.
4.
Shift to Server Components — /src/components/Footer.tsx — Removed "use client" from static footer links to reduce the client-side hydration bridge.
Not done / next
- Implement Streaming: Add
loading.tsxto the root to improve perceived performance whilePromise.allresolves. - Font Optimization: Configure
next/fontto self-host the "Inter" font and prevent flash of unstyled text.
Next steps
- Run
ANALYZE=true npm run buildto confirm the chart library is moved to a separate chunk. - Deploy to a preview environment and run a mobile Lighthouse audit.
- Check Vercel Analytics for real-world INP improvements.
Dashboard.tsx
PNG · 1536×1024
Example file from a real run - the skill writes it into your workspace.
Connects securely to your tools. The creator never sees your data.
About this skill
Slow page loads and heavy bundles degrade user experience and search rankings. This skill identifies and resolves bottlenecks in React and Next.js applications by following a strict measure-fix-verify cycle.
What it does
- Analyze bundles using build output and analyzers to identify routes exceeding 200kB.
- Audit Core Web Vitals focusing on LCP, INP, and CLS metrics across mobile and desktop.
- Optimize data fetching by replacing waterfalls with parallel requests and implementing Server Components.
- Reduce client JS by moving logic to the server, implementing dynamic imports, and cleaning up heavy dependencies.
- Refine rendering through state lifting, virtualization for long lists, and strategic use of the React Compiler or memoization.
- Asset optimization using specialized components for images and fonts to eliminate layout shifts.
How it works
- Establish a baseline by running build checks and Lighthouse audits to document current performance metrics.
- Identify bottlenecks by analyzing waterfalls, bundle composition, and runtime profiles.
- Execute fixes in order of impact, starting with server-side optimizations and ending with asset tweaks.
- Verify results by re-measuring the application to confirm improvements and ensure no regressions.
Frameworks & tools
Specifically designed for React and Next.js (App and Pages Router). Works with @next/bundle-analyzer, Vercel Analytics, React DevTools, and Lighthouse.
Why this beats prompting it yourself
Generic prompts often suggest micro-optimizations like useMemo everywhere. This skill follows a data-driven hierarchy that prioritizes high-impact architectural changes, like Server Components and waterfall reduction, over speculative code changes.
Use cases
- Reducing First Load JS on bloated Next.js landing pages.
- Fixing slow Interaction to Next Paint (INP) in complex React dashboards.
- Eliminating Cumulative Layout Shift (CLS) caused by dynamic content and unoptimized images.
- Migrating client-side data fetching to efficient Server Component patterns.
Known limitations
Requires an environment capable of running builds and performance audits. Does not perform behavioral testing or refactoring of core business logic.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Frontend & Web Apps.
Requires environment access to run next build and Lighthouse. Focuses on performance, not UI/UX design or functional bug fixing.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
1 use
Times used to date
Free to use
No account required to browse
Trust & safety
Security scan
Security scan passed 1 day ago
- Free with an Agensi account
- Software
- vite-bundle-visualizer
Node.js