본문으로 건너뛰기
cccskills
무료GitHub에 공개

nextjs-app-router-expert

Expert guide for Next.js 15 App Router: RSC, Server Actions, Middleware, Parallel/Intercepting Routes, Streaming, and Caching strategies / Panduan ahli untuk Next.js 15 App Router.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(1)

  • SKILL.md6.0 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Next.js 15 App Router Expert

English | Bahasa Indonesia


<a name="english"></a>

English

Description

Execute advanced Next.js 15 App Router architectural patterns: React Server Components (RSC), React 19 Server Actions, Middleware routing, Parallel/Intercepting Routes, Streaming/Suspense, Partial Prerendering (PPR), and explicit cache invalidation.

Trigger Conditions

  • Architecting new Next.js 15 app/ directory applications.
  • Migrating pages/ directory to App Router.
  • Implementing complex UI patterns (modals via Intercepting Routes).
  • Debugging caching (force-cache, revalidatePath, tags).
  • Building interfaces requiring Partial Prerendering (PPR) or Streaming.

Core Architectural Patterns

1. React Server Components (RSC) vs Client Components

  • Default to Server: All app/ components are Server Components. No hooks (useState) or browser APIs.
  • Client Boundaries: Add "use client" only for interactivity/browser APIs. Push client boundaries down the component tree.
  • Interleaving: Pass Server Components as children to Client Components; do not import Server Components into Client Components directly.

2. React 19 Server Actions

Use Server Actions (useActionState) for all mutations. Avoid separate API routes.

'use server'

import { revalidateTag } from 'next/cache';
import { z } from 'zod';
import { db } from '@/lib/db';

const schema = z.object({ email: z.string().email() });

export async function subscribeUser(prevState: any, formData: FormData) {
  const parsed = schema.safeParse({ email: formData.get('email') });
  
  if (!parsed.success) return { error: 'Invalid email' };

  await db.subscribers.insert({ email: parsed.data.email });
  revalidateTag('subscribers');
  return { success: true };
}

3. Parallel & Intercepting Routes (Modals)

Render modals preserving background page context and URL shareability.

  • Intercepting ((.)[segment]): Matches route on client-side navigation.
  • Parallel (@modal): Renders simultaneously with layout.tsx children.
app/
 ├── @modal/
 │   ├── (.)photos/[id]/page.tsx
 │   └── default.tsx
 ├── photos/
 │   └── [id]/page.tsx
 ├── layout.tsx
 └── page.tsx

4. Caching & Data Fetching (Next.js 15)

Fetch requests are not cached by default. Opt-in explicitly:

// Indefinite cache
const res = await fetch('https://api.example.com/data', { cache: 'force-cache' });

// Time-Based Revalidation (ISR)
const res = await fetch('https://api.example.com/data', { next: { revalidate: 3600 } });

// On-Demand Revalidation
const res = await fetch('https://api.example.com/data', { next: { tags: ['collection'] } });
// In server action: revalidateTag('collection')

5. Streaming & Partial Prerendering (PPR)

Wrap slow fetches in <Suspense> to stream UI instantly:

import { Suspense } from 'react';
import { Skeleton } from '@/components/ui/skeleton';

export default function DashboardPage() {
  return (
    <main>
      <h1>Dashboard</h1>
      <Suspense fallback={<Skeleton className="h-64 w-full" />}>
        <SlowRevenueChart />
      </Suspense>
    </main>
  );
}

Orchestration & Integration

  • senior-frontend: Enhances UI/UX with Next.js App Router RSC and Next 15 caching.
  • js-backend-expert: Bridges frontend Server Actions with backend Node.js/Bun architectures.
  • tanstack-query-expert: Manages client-side state hydration from RSC.
  • performance-web-vitals: Optimizes Core Web Vitals using Streaming and PPR.

<a name="bahasa-indonesia"></a>

Bahasa Indonesia

Deskripsi

Terapkan pola arsitektur lanjutan Next.js 15 App Router: React Server Components (RSC), React 19 Server Actions, Middleware, Parallel/Intercepting Routes, Streaming/Suspense, Partial Prerendering (PPR), dan invalidasi cache eksplisit.

Kondisi Pemicu

  • Merancang aplikasi Next.js 15 app/ direktori baru.
  • Migrasi direktori pages/ ke App Router.
  • Implementasi pola UI kompleks (modal via Intercepting Routes).
  • Debugging cache (force-cache, revalidatePath, tags).
  • Membangun antarmuka dengan Partial Prerendering (PPR) atau Streaming.

Pola Arsitektur Inti

1. RSC vs Client Components

  • Default Server: Semua komponen app/ adalah Server Components. Tanpa hooks/API browser.
  • Batas Klien: Tambahkan "use client" hanya untuk interaktivitas. Dorong batas klien ke bawah struktur komponen.
  • Interleaving: Berikan Server Components sebagai children ke Client Components; jangan impor langsung.

2. React 19 Server Actions

Gunakan Server Actions (useActionState) untuk mutasi. Hindari pembuatan API routes terpisah. Validasi input di server dengan Zod dan gunakan revalidateTag untuk perbarui UI.

3. Parallel & Intercepting Routes

Gunakan untuk modal. Mencegat rute navigasi client-side (URL berubah, modal di atas halaman saat ini). Refresh langsung memuat halaman penuh.

4. Caching di Next.js 15

Fungsi fetch tidak di-cache default. Aktifkan eksplisit via { cache: 'force-cache' } atau { next: { revalidate: 3600 } }. Gunakan cache tags untuk invalidasi spesifik.

5. Streaming & Partial Prerendering (PPR)

Bungkus pengambilan data lambat dengan <Suspense> untuk menampilkan UI awal seketika sambil menunggu data (streaming).

Integrasi Orkestrasi

  • senior-frontend: Menguatkan UI/UX dengan pemahaman arsitektur RSC dan cache Next 15.
  • js-backend-expert: Menghubungkan Server Actions dengan arsitektur backend Node.js/Bun.
  • tanstack-query-expert: Mengelola hidrasi state client-side dari RSC.
  • performance-web-vitals: Optimalisasi Core Web Vitals menggunakan Streaming dan PPR.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Expert guide for automated and manual Web Accessibility (a11y) testing — axe-core, Pa11y, Playwright a11y, screen reader testing, and WCAG 2.2 Level AA/AAA compliance / Panduan ahli pengujian aksesibilitas web.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

roedyrustam/vibes-plug1052026년 10월 20일 업데이트

Expert guide for intelligent model cascading and routing — complexity-scored task routing from Flash/Haiku to Sonnet/Opus/Astra, dynamic escalation with quality gates, 40-60% token cost reduction while maintaining output quality / Panduan ahli untuk kaskade dan routing model cerdas — routing tugas berbasis skor kompleksitas dari Flash/Haiku ke Sonnet/Opus/Astra, eskalasi dinamis dengan gerbang kualitas, pengurangan biaya token 40-60% dengan kualitas output terjaga.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

roedyrustam/vibes-plug1052026년 10월 20일 업데이트

Expert guide for Affective Computing, emotional AI, and real-time sentiment analysis through native multimodal tokens (voice intonation and facial micro-expressions) / Panduan ahli komputasi afektif, AI emosional, dan analisis sentimen real-time melalui token multimodal native.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

roedyrustam/vibes-plug1052026년 10월 20일 업데이트

Expert guide for AI-assisted coding workflows — agentic code generation, multi-agent code swarms, self-healing CI/CD, automated PR review, spec-to-code pipelines, codebase knowledge graphs, and human-in-the-loop approval gates / Panduan ahli untuk workflow pengkodean berbasis AI — generasi kode agentic, code swarm multi-agen, CI/CD self-healing, review PR otomatis, pipeline spec-to-code, knowledge graph codebase, dan gate persetujuan human-in-the-loop.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

roedyrustam/vibes-plug1052026년 10월 20일 업데이트

Expert guide for autonomous Machine-to-Machine (M2M) agent settlement, dual-rail fiat & stablecoin micro-clearing, dynamic budget envelopes, and cryptographic agent invoicing / Panduan ahli settlement otonom antar-agen (M2M), kliring mikro dual-rail fiat & stablecoin, pagu anggaran dinamis, dan penagihan agen kriptografis.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

roedyrustam/vibes-plug1052026년 10월 20일 업데이트

Expert guide for long-term episodic memory integration (Mem0 v2, Letta/MemGPT, Zep v2), memory tier architecture, pgvector HNSW storage, and unified context management for autonomous AI agents / Panduan ahli untuk integrasi memori episodik jangka panjang (Mem0 v2, Letta/MemGPT, Zep v2), arsitektur tier memori, penyimpanan pgvector HNSW, dan manajemen konteks terpadu untuk agen AI otonom.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

roedyrustam/vibes-plug1052026년 10월 20일 업데이트

roedyrustam의 스킬 모두 보기

이 스킬의 문제 신고