Communitygithub.com

ComeOnOliver/skillshub

Optimierungsstrategien für Bilder, Schriftarten, Skripte und Metadaten. Verwenden Sie diesen Skill zur Optimierung von Next.js-Bildern, Schriftarten, Skripten oder Seitenmetadaten für bessere Performance.

Was ist skillshub?

Dieser Skill bietet eine umfassende Sammlung von Optimierungsstrategien für Next.js-Anwendungen, mit Fokus auf Bilder, Schriftarten, Skripte und Metadaten. Er basiert auf dem Prinzip „Überwachen zuerst, optimieren später“ und empfiehlt, vor jeglichen Optimierungen die Core Web Vitals (LCP, CLS, INP) zu messen. Der Skill unterstützt die neuesten Next.js-Features wie `next/image`, `next/font`, `next/script` sowie `static metadata` und `generateMetadata` für SEO. Er enthält klare Implementierungsrichtlinien zur Vermeidung von Layout-Shift, zur automatischen Optimierung von Schriftarten (Zero Layout Shift) und zur strategischen Einbindung von Drittanbieter-Skripten. Für Next.js 15+ wird die Partial Prerendering (`ppr: true`) empfohlen und Anti-Patterns wie die Verwendung des nativen `<img>`-Tags oder von Google Fonts CDN-Links werden aufgezeigt.

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

In Ihrer bevorzugten KI fragen

Öffnet einen neuen Chat, in dem dieser Agent-Skill bereits geladen ist.

Dokumentation

Optimierung

Priorität: P1 (HOCH)

Kern-Optimierungsprimitive von Next.js. Zuerst überwachen, später optimieren.

Überwachung (Core Web Vitals)

Identifizieren Sie Engpässe vor der Optimierung mithilfe von:

  • LCP (Largest Contentful Paint): Geschwindigkeit beim ersten Laden. Ziel < 2,5 s.
  • CLS (Cumulative Layout Shift): Visuelle Stabilität. Ziel < 0,1.
  • INP (Interaction to Next Paint): Reaktionsfähigkeit. Ziel < 200 ms.
  • Tools: Chrome DevTools Tab „Performance“, next/speed-insights oder React Profiler.

Implementierungsrichtlinien

  • Bilder: Verwenden Sie immer next/image, um CLS (Cumulative Layout Shift) zu verhindern. Setzen Sie priority für oberhalb der Falz liegende Bilder, um die LCP (Largest Contentful Paint) zu verbessern. Nutzen Sie sizes (z. B. (max-width: 768px) 100vw, 33vw) und placeholder="blur" für eine bessere Benutzererfahrung.

  • Schriftarten: Verwenden Sie next/font (Google oder Lokal) zur Optimierung für Zero Layout Shift. Dadurch werden Schriftarten automatisch lokal gehostet und font-display: swap hinzugefügt.

  • Skripte: Nutzen Sie next/script mit geeigneten Strategien: beforeInteractive (kritisch), afterInteractive (Standard/Analyse) oder lazyOnload (niedrigere Priorität/Social Widgets/Chat).

  • Metadaten: Definieren Sie static metadata oder verwenden Sie generateMetadata (async) für dynamische Routen, um SEO und Social Sharing zu verbessern. Dies ersetzt die veraltete Head-Komponente.

  • Bundle: Analysieren Sie die Bundlegröße mit @next/bundle-analyzer. Entfernen Sie schwere Bibliotheken; verwenden Sie ESM-tree-shakable Abhängigkeiten.

  • Komponenten: Verwenden Sie dynamic Imports (Next.js-Version von React.lazy) mit Suspense für große Komponenten, die beim initialen Rendern nicht benötigt werden.

  • Next.js 15+ Integration: Aktivieren Sie ppr: true (Partial Prerendering) in next.config.js, um ein statisches Gerüst mit dynamischen Inseln zu kombinieren.

  • Strategie: Hosten Sie Google-Schriftarten oder lokale Dateien über next/font selbst.

  • Optimierung: Kein Layout-Shift, keine Netzwerkanfragen für Schriftartdateien zur Laufzeit. Wenden Sie Klassen auf <body> oder bestimmte Elemente an.

Metadaten (SEO)

  • Statisch: Exportieren Sie das metadata-Objekt aus layout.tsx oder page.tsx.

    export const metadata: Metadata = {
      title: 'Dashboard',
      description: '...',
    };
    
  • Dynamisch: Exportieren Sie die generateMetadata({ params })-Funktion.

    export async function generateMetadata({ params }) {
      const product = await getProduct(params.id);
      return { title: product.name };
    }
    
  • Open Graph: Verwenden Sie den openGraph-Schlüssel für Social Cards.

Skripte (next/script)

  • Ladestrategie: Steuern Sie, wann Skripte von Drittanbietern geladen werden.
    • strategy="afterInteractive" (Standard): Google Analytics.
    • strategy="lazyOnload": Chat-Widgets, niedrige Priorität.

Anti-Patterns

  • Kein <img>-Tag: Verwenden Sie next/image, um CLS zu verhindern und automatische Optimierung zu ermöglichen.
  • Kein Google Fonts CDN-Link: Verwenden Sie next/font, um Schriftarten selbst zu hosten und Layout-Shift zu vermeiden.
  • Keine Metadaten in _document.tsx: Verwenden Sie export const metadata oder generateMetadata().
  • Keine Skripte von Drittanbietern im <head>: Verwenden Sie next/script mit geeigneter strategy.

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

Verwandte Skills