← スキル一覧に戻る

developing-nextjs-apps
by BenWork17
⭐ 0🍴 0📅 2026年1月21日
SKILL.md
name: developing-nextjs-apps description: Manages Next.js 14+ application development, including App Router, Server Components, rendering strategies (SSR, SSG, ISR), and performance optimization. Use when working on Next.js frontend tasks.
Developing Next.js Apps
This skill provides comprehensive guidance and standards for building production-grade Next.js 14+ applications using the App Router.
Core Architecture (App Router)
- React Server Components (RSC): Used by default for all components in
app/. Keep client-side JavaScript minimal. - Client Components: Use
'use client'only when interactivity (hooks likeuseState,useEffect) or browser APIs are required. - Layouts & Nesting: Use
layout.tsxfor shared UI across routes. Layouts do not re-render on navigation. - Streaming & Suspense: Implement
loading.tsxor<Suspense>to stream UI sections as they become ready.
Rendering Strategies
| Strategy | Implementation | Use Case |
|---|---|---|
| Static (SSG) | Default behavior | Marketing pages, blogs, docs. |
| Dynamic (SSR) | Use cookies(), headers(), or searchParams | User dashboards, search results. |
| Incremental (ISR) | fetch(url, { next: { revalidate: 60 } }) | E-commerce, news, content with periodic updates. |
Data Fetching & Mutations
- Server-side Fetching: Fetch data directly in
asyncServer Components. - Caching: Next.js extends
fetchto cache results. UserevalidatePathorrevalidateTagto purge cache. - Server Actions: Define
'use server'functions for mutations (form submissions). - Parallel Fetching: Initiate multiple requests at once to avoid waterfalls:
const [dataA, dataB] = await Promise.all([getDataA(), getDataB()]);
Optimization Standards
- Images: Use
next/imagefor automatic optimization, lazy loading, and preventing layout shifts. - Fonts: Use
next/fontfor zero layout shift and local hosting of Google Fonts. - Links: Use
next/linkfor prefetching and client-side navigation. - Middleware: Use
middleware.tsfor auth, redirects, and header manipulation at the edge.
File System Conventions
page.tsx: Unique UI of a route.layout.tsx: Shared UI for a segment and its children.loading.tsx: Loading UI for a segment.error.tsx: Error UI for a segment.not-found.tsx: UI for 404 pages within a segment.route.ts: Custom request handlers (API endpoints).
Best Practices
- Keep Server Components Pure: Move interactivity to small, leaf-level Client Components.
- SEO: Use the Metadata API (
export const metadata = {...}). - Environment Variables:
process.envfor server,NEXT_PUBLIC_for client. - Error Boundaries: Always wrap dynamic sections in
error.tsxto prevent full-page crashes.
スコア
総合スコア
50/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
○LICENSE
ライセンスが設定されている
0/10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
レビュー
💬
レビュー機能は近日公開予定です