← スキル一覧に戻る
4. No

nextjs-16
by window-ook
클로드 코드로 생산성을 실험한 결과와 실제 프랙티스를 기록하는 공간입니다
⭐ 0🍴 0📅 2026年1月25日
SKILL.md
name: nextjs-16 description: Next.js 16 App Router development guide with latest patterns (params Promise, PageProps helpers, useActionState, Server Components, Cache Components, Proxy). Use when creating pages, layouts, routes, Server Actions, or working with Next.js 16 projects. allowed-tools: Read, Write, Edit, Bash, Grep, Glob
Next. js 16 Quick Reference
Version: 16.1.2 (Jan 2026) Doc Source: Official Next.js documentation
🚨 CRITICAL RULES (Always Enforce)
1. params are Promise
// ❌ WRONG
export default function Page({ params }: { params: { slug: string } }) {
return <h1>{params.slug}</h1>;
}
// ✅ CORRECT
export default async function Page(props: PageProps<'/blog/[slug]'>) {
const { slug } = await props.params;
return <h1>{slug}</h1>;
}
2. Use useActionsState (NOT useFormState)
// ❌ DEPRECATED
import { useFormState } from 'react-dom';
// ✅ CORRECT
import { useActionState } from 'react-dom';
3. Form Actions Return Void
// ❌ WRONG - Form actions can't return data
export async function submitForm(formData: FormData) {
'use server';
return { success: true }; // Type error!
}
// ✅ CORRECT
export async function submitForm(formData: FormData) {
'use server';
await saveData(formData);
revalidatePath('/posts');
}
4. No any Types
// ❌ WRONG
const data:any = await fetch(...);
// ✅ CORRECT
const data:Post[] = await fetch(...).then(r => r.json());
5. Use PageProps/LayoutProps Helpers
// ✅ Type-safe with auto-completion
export default async function Page(props: PageProps<'/blog/[slug]'>) {
const { slug } = await props.params;
}
6. Use 'use cache' for Cached Dynamic content
// ❌ WRONG - Dynamic data without caching
export default async function Page() {
const posts = await db.posts.findMany() // Fetched on every request
return <PostList posts={posts}>;
}
// ✅ CORRECT - Cache with 'use cache'
'use cache'
import {cacheLife} from 'next/cache'
export default async function Page() {
cacheLife('hours') // Cache for 1 hour
const posts = await db.posts.findMany()
return <PostList posts={posts}>;
}
Essential Patterns
Static Page
// app/about/page.tsx
export const metaData = {
title: 'About',
description: 'About Page',
};
export default function Page() {
return <h1>About</h1>;
}
スコア
総合スコア
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
レビュー
💬
レビュー機能は近日公開予定です