Back to list
jovermier

nextjs-performance

by jovermier

Claude Code agents for Go, GraphQL, Next.js, and Playwright. 4 agents, 12 skills for code review and test generation.

0🍴 0📅 Jan 3, 2026

SKILL.md


name: nextjs-performance description: Next.js performance optimizations including next/image, next/font, dynamic imports, caching strategies, and bundle optimization. Use when optimizing Next.js apps for speed or Core Web Vitals.

Next.js Performance

Expert guidance for optimizing Next.js applications.

Quick Reference

ConcernSolutionImpact
Imagesnext/image with sizingCLS prevention, auto-optimization
Fontsnext/fontNo layout shift, self-hosted
Heavy componentsnext/dynamicReduced initial bundle
Data cachingfetch options (revalidate)Reduced server load
Client navigationLink componentInstant transitions
Bundle sizeTree shaking, no unused depsFaster JS loading

What Do You Need?

  1. Image optimization - next/image usage, sizing, formats
  2. Font loading - next/font, preloading
  3. Code splitting - Dynamic imports, route splitting
  4. Caching - ISR, revalidation, cache strategies
  5. Navigation - Link usage, prefetching

Specify a number or describe your performance concern.

Routing

ResponseReference to Read
1, "image", "img", "optimization", "cls"images.md
2, "font", "layout shift", "typography"fonts.md
3, "dynamic", "import", "lazy", "split"code-splitting.md
4, "cache", "revalidate", "isr", "fetch"caching.md
5, "navigation", "link", "prefetch"navigation.md

Essential Principles

Optimize images: Use next/image with width/height for all images. Prevents CLS and enables automatic optimization.

Self-host fonts: Use next/font to eliminate requests to external font services and prevent layout shift.

Dynamic import heavy code: Use next/dynamic for components that are heavy or not immediately visible.

Client-side navigation: Use Link component for all internal links. Enables instant page transitions.

Cache strategically: Use appropriate fetch caching (force-cache, no-store, revalidate) based on data freshness needs.

Common Performance Issues

IssueSeverityImpactFix
Using <img> instead of next/imageHighCLS, no optimizationUse next/image
External fontsMediumLayout shift, extra requestUse next/font
Large initial bundleHighSlow initial loadDynamic imports
No caching on static dataMediumUnnecessary server loadAdd revalidate
Using <a> instead of LinkHighFull page reloadUse Link
No priority hintsLowDelayed LCPUse priority prop

Code Patterns

Images

// Good: next/image with sizing
import Image from 'next/image'

<Image
  src="/avatar.jpg"
  width={100}
  height={100}
  alt="Avatar"
  priority // For above-fold images
/>

Fonts

// Good: next/font
import { Inter } from 'next/font/google'

const inter = Inter({ subsets: ['latin'] })

export default function RootLayout({ children }: { children: ReactNode }) {
  return <html className={inter.className}>{children}</html>
}

Dynamic Imports

// Good: Dynamic import for heavy component
import dynamic from 'next/dynamic'

const HeavyChart = dynamic(() => import('./HeavyChart'), {
  loading: () => <div>Loading...</div>,
  ssr: false, // If client-only
})

Caching

// Good: Appropriate caching
export const revalidate = 3600 // Revalidate every hour

async function getData() {
  const res = await fetch('https://api.example.com/data', {
    next: { revalidate: 3600 } // or { revalidate: 0 } for no cache
  })
  return res.json()
}

Reference Index

FileTopics
images.mdnext/image, sizing, priority, formats
fonts.mdnext/font, Google fonts, local fonts
code-splitting.mdDynamic imports, route splitting
caching.mdfetch options, ISR, revalidatePath
navigation.mdLink component, prefetching, scroll

Success Criteria

Performance is good when:

  • All images use next/image with proper sizing
  • Fonts loaded with next/font (no layout shift)
  • Heavy components dynamically imported
  • Static data cached appropriately (revalidate set)
  • All internal links use Link component
  • LCP < 2.5s, FID < 100ms, CLS < 0.1

Score

Total Score

65/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

+10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

0/5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon