← スキル一覧に戻る

nextjs-patterns
by AbdulSamad94
Hackhaton prepration, using Claude Code & Specskit Plus
⭐ 2🍴 0📅 2025年12月18日
SKILL.md
name: Next.js Patterns description: Best practices and patterns for Next.js App Router, Server Actions, and Routing in this project.
Next.js Patterns
App Router
We use the Next.js 15 App Router located in app/.
Pages
- Location:
app/[route]/page.tsx - Component: Default export function.
- Client vs Server: Use
"use client"directive at the top for components requiring state (useState,useEffect) or browser APIs. otherwise default to Server Components.
Layouts
- Location:
app/layout.tsx(Root),app/[route]/layout.tsx(Nested). - Purpose: Wrappers for pages, holding navigation, fonts, and metadata.
Navigation
- Use
Linkfromnext/linkfor internal navigation. - Use
useRouterfromnext/navigationfor programmatic navigation (inside Client Components).
import Link from "next/link";
import { useRouter } from "next/navigation";
// Link
<Link href="/dashboard">Dashboard</Link>
// Router
const router = useRouter();
router.push('/login');
Data Fetching
- Server Components: Fetch directly using
await fetch()or DB calls. - Client Components: Use
useEffector SWR/TanStack Query (if added later). Currently using standardfetchinuseEffect.
Font Optimization
- We use
next/font/google(e.g., Poppins) inapp/layout.tsx. - Variable fonts are passed to
bodyclassName.
Metadata
- Define
export const metadata: Metadata = { ... }inpage.tsxorlayout.tsxfor SEO.
スコア
総合スコア
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
レビュー
💬
レビュー機能は近日公開予定です