Communitygithub.com

ComeOnOliver/skillshub

이미지, 폰트, 스크립트 및 메타데이터 최적화 전략. Next.js 이미지, 폰트, 스크립트 또는 페이지 메타데이터를 성능 최적화할 때 사용합니다. (트리거: **/layout.tsx, **/page.tsx, next/image, next/font, metadata, generateMetadata)

skillshub란 무엇인가요?

이 스킬은 Next.js 애플리케이션의 성능 최적화를 위한 핵심 원칙과 구현 가이드를 제공합니다. LCP, CLS, INP 등 핵심 웹 바이탈(Core Web Vitals) 지표를 모니터링한 후 최적화를 진행하는 ‘먼저 모니터링, 나중에 최적화’ 접근법을 강조합니다. 주요 최적화 대상으로는 next/image를 사용한 이미지 최적화(CLS 방지, priority 속성, sizes 설정), next/font를 통한 폰트 최적화(레이아웃 시프트 제거, 자체 호스팅), next/script를 활용한 서드파티 스크립트 로딩 전략(beforeInteractive, afterInteractive, lazyOnload), 그리고 정적/동적 메타데이터(metadata 객체, generateMetadata 함수) 정의를 통한 SEO 및 소셜 공유 개선을 포함합니다. 또한 @next/bundle-analyzer로 번들 크기를 분석하고, dynamic import와 Suspense로 컴포넌트를 지연 로딩하며, Next.js 15+의 Partial Prerendering(ppr: true)을 활용하는 고급 기법도 다룹니다. <img> 태그 사용 금지, Google Fonts CDN 링크 사용 금지, _document.tsx에 메타데이터 정의 금지 등 주요 안티패턴을 명시하여 올바른 구현을 유도합니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ComeOnOliver/skillshub/tree/HEAD/skills/HoangNguyen0403/agent-skills-standard/nextjs-optimization

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

최적화

우선순위: P1 (높음)

Next.js가 제공하는 핵심 최적화 기본 요소. 먼저 모니터링하고, 나중에 최적화하세요.

모니터링 (핵심 웹 바이탈)

최적화를 적용하기 전에 다음을 사용하여 병목 지점을 식별하세요:

  • LCP (최대 콘텐츠풀 페인트): 초기 로드 속도. 목표 < 2.5초.
  • CLS (누적 레이아웃 시프트): 시각적 안정성. 목표 < 0.1.
  • INP (다음 페인트까지의 상호작용): 응답성. 목표 < 200ms.
  • 도구: Chrome DevTools "성능" 탭, next/speed-insights, 또는 React Profiler.

구현 지침

  • 이미지: 항상 next/image 를 사용하여 CLS (누적 레이아웃 시프트) 를 방지하세요. 뷰포트 상단 이미지의 LCP (최대 콘텐츠풀 페인트) 개선을 위해 priority 를 설정하세요. 더 나은 UX를 위해 sizes (예: (max-width: 768px) 100vw, 33vw)와 placeholder="blur" 를 사용하세요.

  • 폰트: next/font (Google 또는 로컬)를 사용하여 제로 레이아웃 시프트로 최적화하세요. 이는 자동으로 폰트를 로컬에 호스팅하고 font-display: swap 을 추가합니다.

  • 스크립트: next/script 를 적절한 전략과 함께 사용하세요: beforeInteractive (중요), afterInteractive (기본값/분석), 또는 lazyOnload (낮은 우선순위/소셜 위젯/채팅).

  • 메타데이터: SEO 및 소셜 공유 개선을 위해 정적 metadata 를 정의하거나 동적 경로에 generateMetadata (비동기)를 사용하세요. 이는 레거시 Head 컴포넌트를 대체합니다.

  • 번들: @next/bundle-analyzer 로 번들 크기를 분석하세요. 무거운 라이브러리를 제거하고 ESM 트리-쉐이커블 종속성을 사용하세요.

  • 컴포넌트: 초기 렌더링에 필요하지 않은 큰 컴포넌트의 경우 Suspense 와 함께 dynamic 임포트(Next.js 버전의 React.lazy)를 사용하세요.

  • Next.js 15+ 통합: next.config.js에서 ppr: true (부분 사전 렌더링) 을 활성화하여 정적 셸과 동적 아일랜드를 결합하세요.

  • 전략: Google Fonts 또는 로컬 파일을 next/font를 통해 자체 호스팅하세요.

  • 최적화: 제로 레이아웃 시프트, 런타임에 폰트 파일에 대한 네트워크 요청 없음. <body> 또는 특정 요소에 클래스를 적용하세요.

메타데이터 (SEO)

  • 정적: layout.tsx 또는 page.tsx에서 metadata 객체를 내보내세요.

    export const metadata: Metadata = {
      title: '대시보드',
      description: '...',
    };
    
  • 동적: generateMetadata({ params }) 함수를 내보내세요.

    export async function generateMetadata({ params }) {
      const product = await getProduct(params.id);
      return { title: product.name };
    }
    
  • Open Graph: 소셜 카드를 위해 openGraph 키를 사용하세요.

스크립트 (next/script)

  • 로딩 전략: 서드파티 스크립트가 로드되는 시점을 제어하세요.
    • strategy="afterInteractive" (기본값): Google Analytics.
    • strategy="lazyOnload": 채팅 위젯, 낮은 우선순위.

안티패턴

  • <img> 태그 사용 금지: CLS를 방지하고 자동 최적화를 위해 next/image를 사용하세요.
  • Google Fonts CDN 링크 사용 금지: next/font를 사용하여 자체 호스팅하고 레이아웃 시프트를 제거하세요.
  • _document.tsx에 메타데이터 사용 금지: export const metadata 또는 generateMetadata()를 사용하세요.
  • <head>에 서드파티 스크립트 사용 금지: 적절한 strategy와 함께 next/script를 사용하세요.

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

ComeOnOliver/skillshub

Create stunning, animation-rich HTML presentations from scratch or by converting PowerPoint files. Use when the user wants to build a presentation, convert a PPT/PPTX to web, or create slides for a talk/pitch. Helps non-designers discover their aesthetic through visual exploration rather than abstract choices.

ComeOnOliver/skillshub

Next.js 16+ 和 Turbopack — 增量打包、文件系统缓存、开发速度,以及何时使用 Turbopack 与 webpack。

ComeOnOliver/skillshub

SwiftUI architecture patterns, state management with @Observable, view composition, navigation, performance optimization, and modern iOS/macOS UI best practices.

ComeOnOliver/skillshub

See, Understand, Act on video and audio. See- ingest from local files, URLs, RTSP/live feeds, or live record desktop; return realtime context and playable stream links. Understand- extract frames, build visual/semantic/temporal indexes, and search moments with timestamps and auto-clips. Act- transcode and normalize (codec, fps, resolution, aspect ratio), perform timeline edits (subtitles, text/image overlays, branding, audio overlays, dubbing, translation), generate media assets (image, audio, video), and create real time alerts for events from live streams or desktop capture.

ComeOnOliver/skillshub

AI-assisted video editing workflows for cutting, structuring, and augmenting real footage. Covers the full pipeline from raw capture through FFmpeg, Remotion, ElevenLabs, fal.ai, and final polish in Descript or CapCut. Use when the user wants to edit video, cut footage, create vlogs, or build video content.

ComeOnOliver/skillshub

Next.js 15 애플리케이션을 위한 프론트엔드 개발 가이드라인. React 19, TypeScript, Shadcn/ui, Tailwind CSS를 사용한 모던 패턴. Server Components, Client Components, App Router, 파일 구조, Shadcn/ui 컴포넌트, 성능 최적화, TypeScript 모범 사례 포함. 컴포넌트, 페이지, 기능 생성, 데이터 페칭, 스타일링, 라우팅, 프론트엔드 코드 작업 시 사용.

ComeOnOliver/skillshub

Provides Tamagui patterns for config v4, compiler optimization, styled context, and cross-platform styling. Must use when working with Tamagui projects (tamagui.config.ts, @tamagui imports).

ComeOnOliver/skillshub

Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.

ComeOnOliver/skillshub

Create high-converting, visually distinctive landing pages. Use when building marketing pages, product launches, SaaS homepages, or any single-page conversion-focused website. Guides section-by-section composition with anti-AI-slop principles.

ComeOnOliver/skillshub

Auto-loaded context for Portfolio Buddy 2 development. Use for ANY task involving: React 19 development, TypeScript, portfolio analysis features, metrics calculations, trading strategy comparison, or working with the Portfolio Buddy 2 codebase. Contains tech stack, known issues, and architectural constraints.

ComeOnOliver/skillshub

Next.js development tooling via MCP. Inspect routes, components, build info, and debug Next.js apps. Use when working on Next.js applications, debugging routing, or inspecting app structure. NOT for general React or non-Next.js projects.

ComeOnOliver/skillshub

Implement UI using Shadcn MCP (atoms/theme) and 21st.dev MCP (complex sections). Use when adding buttons, layouts, or generating landing pages.

ComeOnOliver/skillshub

A conceptual skill for building an API client in Next.js that handles JWT tokens

ComeOnOliver/skillshub

Best practices and patterns for Next.js App Router, Server Actions, and Routing in this project.

ComeOnOliver/skillshub

The Design System, Theme, and UX rules for the Physical AI Hub.

ComeOnOliver/skillshub

Comprehensive frontend development skill for building modern, performant web applications using ReactJS, NextJS, TypeScript, Tailwind CSS. Includes component scaffolding, performance optimization, bundle analysis, and UI best practices. Use when developing frontend features, optimizing performance, implementing UI/UX designs, managing state, or reviewing frontend code.

ComeOnOliver/skillshub

This document captures learnings from fixing keyboard navigation issues when floating components (Select, DropdownMenu, Popover) have CSS open/close animations.

ComeOnOliver/skillshub

Build Next.js 16 applications with correct patterns and distinctive design. Use when creating pages, layouts, dynamic routes, upgrading from Next.js 15, or implementing proxy.ts. Covers breaking changes (async params/searchParams, Turbopack, cacheComponents) and frontend aesthetics. NOT when building non-React or backend-only applications.

ComeOnOliver/skillshub

Comprehensive Framer Motion animation library for React. Covers motion components, variants, gestures, page transitions, and scroll animations. Use when adding animations to React/Next.js applications.

ComeOnOliver/skillshub

Build interfaces that resonate, not just render. This skill enforces bold, intentional

관련 스킬