nextjs-expert
Fungsinya
Skill ini memandu pembangunan aplikasi web dengan Next.js, termasuk App Router, komponen server, pengambilan data, caching, dan deployment. Skill ini untuk pengembang yang membangun situs dan aplikasi web yang cepat dan ramah mesin pencari.
Kapan dipakai
- ✓Saat Anda memulai aplikasi Next.js baru atau memindahkan aplikasi ke App Router.
- ✓Saat sebuah halaman dimuat lambat dan Anda ingin mengurangi JavaScript di sisi klien.
- ✓Saat Anda memerlukan API route atau middleware dalam proyek Next.js.
Link skill
https://github.com/RightNow-AI/openfang/blob/main/crates/openfang-skills/bundled/nextjs-expert/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
“Siapkan halaman App Router Next.js yang memuat data produk di server dan menampilkan status pemuatan selama data diambil.”
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Skill ini merekomendasikan komponen server secara default, rute berbasis folder, batas pemuatan dan galat, serta route handler, dengan pilihan render statis atau sesuai permintaan.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
Next.js Expert
A seasoned Next.js architect with deep expertise in the App Router paradigm, server-side rendering strategies, and production deployment patterns. This skill provides guidance on building performant, SEO-friendly web applications using Next.js 14+ conventions, including Server Components, Streaming, and the full spectrum of data fetching and caching mechanisms.
Key Principles
- Prefer Server Components by default; only add "use client" when the component requires browser APIs, event handlers, or React state
- Leverage the app/ directory structure where each folder segment maps to a URL route, using layout.tsx for shared UI and page.tsx for unique content
- Design data fetching at the server layer using async Server Components and fetch with Next.js caching semantics
- Use generateStaticParams for static pre-rendering of dynamic routes at build time, falling back to on-demand ISR for long-tail pages
- Keep client bundles small by pushing logic into Server Components and using dynamic imports for heavy client-only libraries
Techniques
- Structure routes with app/[segment]/page.tsx, using route groups (parentheses) to organize without affecting URL paths
- Implement loading.tsx and error.tsx boundaries at each route segment to provide instant loading states and graceful error recovery
- Use Route Handlers (app/api/.../route.ts) with exported GET, POST, PUT, DELETE functions for API endpoints
- Configure middleware in middleware.ts at the project root with a matcher config to intercept requests for auth, redirects, or header injection
- Optimize images with next/image (automatic srcSet, lazy loading, AVIF/WebP) and fonts with next/font (zero layout shift, self-hosted subsets)
- Enable ISR by returning revalidate values from fetch calls or using revalidatePath/revalidateTag for on-demand cache invalidation
- Set up next.config.js with redirects, rewrites, headers, and the experimental options appropriate to your deployment target
Common Patterns
- Parallel Routes: Use @named slots in layouts to render multiple page-level components simultaneously, enabling dashboards and split views
- Intercepting Routes: Place (..) convention routes to show modals on navigation while preserving the direct URL as a full page
- Server Actions: Define async functions with "use server" for form submissions and mutations without building separate API routes
- Streaming with Suspense: Wrap slow data-fetching components in Suspense boundaries to stream HTML progressively and improve TTFB
Pitfalls to Avoid
- Do not use useEffect for data fetching in Server Components; fetch directly in the component body or use server-side utilities
- Do not place "use client" at the layout level unless every child truly requires client interactivity, as this opts out the entire subtree from server rendering
- Do not confuse the Pages Router (pages/ directory) patterns with App Router conventions; they have different data fetching and routing models
- Do not skip setting proper cache headers and revalidation times, as stale data and unnecessary re-renders degrade both performance and user experience
Pertanyaan umum
Apa itu komponen server?
Itu adalah komponen yang berjalan di server, sehingga bisa mengambil data tanpa mengirim kode tambahan ke peramban.
Kapan saya perlu menambahkan use client?
Hanya saat komponen memerlukan fitur peramban, event handler, atau state React, sebagaimana disarankan skill ini.
Apa fungsi loading.tsx dan error.tsx?
Keduanya menampilkan status pemuatan saat rute dimuat dan pesan yang ramah jika terjadi kegagalan.
Detail
Deskripsi asli dari pembuat
Next.js expert for App Router, SSR/SSG, API routes, middleware, and deployment
repo: RightNow-AI/openfang
Popularitas
- Bintang GitHub
- 18k
- Peringkat
- #10692
- Lisensi
- Apache-2.0
- Diperbarui
- 2/7/2026
Komentar
- …
Skill lain dari repositori ini
browser-automation
18kMengajari agent Anda mengendalikan peramban web dengan Playwright, memakai selektor CSS untuk menemukan tombol, formulir, dan tautan.
clip-hand-skill
18kMembantu agent Anda membuat klip video: mengunduh video, mentranskripsi ucapannya, membuat berkas subtitle, dan memotong klip dengan ffmpeg.
collector-hand-skill
18kMembantu agent Anda mengumpulkan informasi publik tentang suatu topik atau perusahaan, mengambil entitas penting, melacak perubahan, dan menilai sentimen.
infisical-sync-skill
18kMembantu agent Anda membaca dan memperbarui rahasia di brankas Infisical lewat API-nya, dengan langkah login dan penanganan galat yang jelas.
Skill serupa
angular-developer
280kMembantu agent Anda membuat kode Angular dan memberi saran struktur proyek. Berguna saat memulai proyek baru, membuat komponen, atau meningkatkan performa.
frontend-a11y
280kMembantu agent Anda membuat antarmuka web dapat diakses semua orang. Memastikan website dan aplikasi berfungsi baik dengan screen reader dan navigasi keyboard.
frontend-patterns
280kMembuat agent Anda menerapkan pola modern dalam frontend. Mengoptimalkan performa, mengelola state, dan mengikuti praktik terbaik React dan Next.js.