nextjs-performance
Skill8 starsChanged 9 months agoMITView on GitHub
Audit and optimize Next.js application performance when the user asks about Next.js performance, caching, or rendering strategies
2 other projects use a version of this.
Adopted by
Most recently taken up by
- LeonxLJX/web-engineer-skillstheir own version, first seen Sep 3, 2026
- jgamaraalv/delivery-looptheir own version, first seen Jul 4, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- jgamaraalv/delivery-loop★ 0same name
- LeonxLJX/web-engineer-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository79 other files it gives its agents.
- AGENTS.mdAGENTS.md
- analyze-competitorsSkill
- analyze-dependenciesSkill
- analyze-metricsSkill
- audit-accessibilitySkill
- audit-api-consistencySkill
- audit-performanceSkill
- audit-securitySkill
- capture-pr-visualsSkill
- commitSkill
- create-adrSkill
- create-api-designSkill
- create-bug-reportSkill
- create-commit-messageSkill
- create-data-modelSkill
- create-decision-logSkill
- create-docSkill
- create-estimationSkill
- create-experiment-designSkill
- create-feature-flag-planSkill
- create-gtm-briefSkill
- create-handoffSkill
- create-incident-reportSkill
- create-interview-guideSkill
- create-jtbd-canvasSkill
- create-metrics-frameworkSkill
- create-onboarding-guideSkill
- create-ostSkill
- create-planSkill
- create-postmortemSkill
- create-pr-descriptionSkill
- create-prdSkill
- create-prSkill
- create-release-checklistSkill
- create-release-notesSkill
- create-retroSkill
- create-reviewSkill
- create-rfcSkill
- create-roadmapSkill
- create-rollback-planSkill
- create-runbookSkill
- create-shape-up-pitchSkill
- create-stakeholder-updateSkill
- create-test-planSkill
- create-threat-modelSkill
- create-user-storiesSkill
- debug-systematicSkill
- fastapi-endpoint-patternsSkill
- fix-findingsSkill
- fix-reviewSkill
- flutter-platform-patternsSkill
- flutter-state-managementSkill
- flutter-version-managementSkill
- flutter-widget-patternsSkill
- manage-tech-debtSkill
- nextjs-api-patternsSkill
- nextjs-app-router-patternsSkill
- product-context-docsSkill
- project-skill-creatorSkill
- project-standardsSkill
- The first 60 shown.
The file
Files
Next.js Performance
Overview
Audit and optimize Next.js applications for performance. Covers the SSR/SSG/ISR decision tree, image and font optimization, route segment caching, and bundle analysis. Stack-specific Tier 3 reference skill.
Workflow
- Read project setup — Check
.chalk/docs/engineering/for architecture docs. Determine the Next.js version (App Router vs. Pages Router changes the entire optimization approach), deployment target (Vercel, self-hosted, edge), and data fetching patterns in use. - Identify the scope — Parse
$ARGUMENTSfor specific pages or routes. If none specified, scanapp/orpages/for routes and identify the highest-traffic or most complex ones. - Audit rendering strategy — For each route, apply the decision tree:
- Static (SSG): Content does not change between deploys? Use
generateStaticParams/getStaticProps. Best performance. - Incremental Static (ISR): Content changes periodically but not per-request? Use
revalidatewith an appropriate interval. Good balance. - Server (SSR): Content is personalized or changes every request? Use dynamic rendering. Ensure streaming with
loading.tsxor Suspense. - Client: Content depends on client-only APIs (localStorage, geolocation)? Use
"use client"components, but keep the boundary as low in the tree as possible.
- Static (SSG): Content does not change between deploys? Use
- Audit caching configuration — Check for:
- Route segment config (
export const dynamic,export const revalidate) set appropriately per route fetchcalls with correct cache and revalidation options- Missing
cache()orunstable_cache()for expensive server-side computations - Over-fetching in layouts that could be cached independently of pages
- Route segment config (
- Audit image optimization — Check for:
- Images not using
next/image(missing automatic optimization, lazy loading, and responsive sizing) - Missing
width/heightorsizesprop causing layout shift - Large images served without format conversion (WebP/AVIF)
- Images above the fold missing the
priorityprop
- Images not using
- Audit font optimization — Check for:
- Fonts not using
next/font(causes Flash of Unstyled Text) - Multiple font files loaded when a variable font would suffice
- Font files loaded from external CDNs instead of self-hosted via
next/font
- Fonts not using
- Audit bundle size — Check for:
- Large client-side bundles (use
@next/bundle-analyzer) - Server-only code leaking into client bundles (missing
"server-only"imports) - Barrel file imports pulling in unused code
- Third-party scripts not loaded with
next/scriptand appropriatestrategy
- Large client-side bundles (use
- Report findings — Present audit results with file references, current state, recommended fix, and expected impact.
Output
- Format: Audit report delivered in the conversation
- Key sections: Rendering Strategy Assessment (route-by-route), Caching Configuration Review, Image/Font Optimization Findings, Bundle Analysis, Prioritized Recommendations
Anti-patterns
- Making everything dynamic — Defaulting to SSR when SSG or ISR would work wastes server resources and increases TTFB. Start static, add dynamism only where needed.
- Ignoring streaming — Long SSR pages without Suspense boundaries block the entire page. Use
loading.tsxand Suspense to stream content progressively. - Client components at the top — Placing
"use client"at the layout level opts the entire subtree out of server rendering. Push client boundaries as low as possible in the component tree. - Disabling cache without understanding why — Adding
export const dynamic = "force-dynamic"because caching caused a bug means the bug is not fixed, just hidden. Understand the caching behavior and fix the root cause. - Skipping next/image for "simplicity" — Using raw
<img>tags loses automatic optimization, lazy loading, and responsive sizing. The small learning curve ofnext/imagepays for itself immediately.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

