Back to list
aiskillstore

next-js-patterns

by aiskillstore

Security-audited skills for Claude, Codex & Claude Code. One-click install, quality verified.

102🍴 3📅 Jan 23, 2026

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.
  • Use Link from next/link for internal navigation.
  • Use useRouter from next/navigation for 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 useEffect or SWR/TanStack Query (if added later). Currently using standard fetch in useEffect.

Font Optimization

  • We use next/font/google (e.g., Poppins) in app/layout.tsx.
  • Variable fonts are passed to body className.

Metadata

  • Define export const metadata: Metadata = { ... } in page.tsx or layout.tsx for SEO.

Score

Total Score

60/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

+5
最近の活動

1ヶ月以内に更新

+10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

+5

Reviews

💬

Reviews coming soon