Communitygithub.com

Next.js 15 スキル

App Router、Server Components、およびモダンなNext.js 15パターンを適用します。Pages Routerの誤った使用を防止します。

Next.js 15 スキル とは?

このスキルは、Next.js 15プロジェクトにおいて、最新のベストプラクティスに従ったコード生成と設計を支援します。具体的には、App Router(`app/`ディレクトリ)の使用を強制し、Pages Router(`pages/`)の誤用を防ぎます。デフォルトでServer Componentsを使用し、必要な場合にのみ`"use client"`を追加するルールを徹底します。また、動的メタデータには`generateMetadata()`、フォーム送信にはServer Actions、画像には`next/image`、内部リンクには`next/link`を使用するなど、Next.js 15に最適化されたパターンを推奨します。ルートハンドラ、レイアウト、ローディング、エラー境界の適切なファイル構成も自動的に適用します。このスキルは、Claude CodeやCursorなどのAIエージェントと連携し、開発者がNext.js 15のモダンな開発手法を一貫して守れるようにします。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/YepAPI/skills/tree/HEAD/skills/nextjs

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

Next.js 15

ルール

  • 常にApp Router(app/ディレクトリ)を使用し、Pages Router(pages/)は使用しないこと
  • デフォルトでServer Components — 必要な場合(state、エフェクト、ブラウザAPI)のみ"use client"を追加すること
  • 動的メタデータには<Head>ではなくgenerateMetadata()を使用すること
  • 変更処理にはAPIルートではなくServer Actionsを使用すること(単純なフォームの場合)
  • next/imageを適切なwidth/heightまたはfillとともに使用し、生の<img>は使用しないこと
  • next/linkを使用し、内部ナビゲーションに生の<a>は使用しないこと
  • ルートハンドラはapp/api/[route]/route.tsに配置し、名前付き関数(GET、POST)をエクスポートすること
  • レイアウトはlayout.tsx、ローディング状態はloading.tsx、エラー境界はerror.tsxに配置すること
  • ISRにはunstable_cacheまたはrevalidateTagを使用し、レガシーなgetStaticProps/getServerSidePropsは使用しないこと
  • 環境変数: クライアント側でのみ使用する場合はNEXT_PUBLIC_プレフィックスを付けること

避けるべきこと

  • getServerSideProps、getStaticProps、getStaticPaths — これらはPages Routerのものです
  • _app.tsx、_document.tsx — これらはPages Routerのものです
  • next/routerのuseRouter — 代わりにnext/navigationを使用すること
  • next/head — 代わりにgenerateMetadataエクスポートを使用すること
  • Server Componentsを不必要に"use client"でラップすること

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

YepAPI/skills

WCAG 2.1 AA — semantic HTML, keyboard navigation, screen readers.

YepAPI/skills

Experiment setup, variant splitting, statistical significance, and feature flag integration.

YepAPI/skills

CRUD generators, data tables, user management, role-based access, and bulk operations.

YepAPI/skills

Monitor what ChatGPT and Gemini say about your brand using YepAPI.

YepAPI/skills

Queue workers with BullMQ/Inngest/Trigger.dev, job retries, dead letter queues, concurrency.

YepAPI/skills

Commander.js, interactive prompts with Clack, spinners, colors, config files, exit codes, and npm publishing.

YepAPI/skills

cmdk integration, Cmd+K trigger, fuzzy search, grouped actions, keyboard navigation, and dynamic action registration.

YepAPI/skills

Content planning with trend and sentiment data from YepAPI.

YepAPI/skills

Content calendar, keyword-driven planning, and content briefs.

YepAPI/skills

Theme switching with CSS variables, system preference detection, next-themes, and persistence.

YepAPI/skills

Threaded comments, @mentions, reactions, moderation queue, optimistic UI, and cursor pagination.

YepAPI/skills

Competitive analysis between domains using YepAPI.

YepAPI/skills

Layout grids, KPI cards, data tables with sorting/filtering, sidebar navigation, and responsive breakpoints.

YepAPI/skills

Data encryption — TLS everywhere, AES-256-GCM for PII, bcrypt passwords, encrypted backups.

YepAPI/skills

Chart patterns with Recharts/Nivo/D3, responsive containers, color scales, and accessibility.

YepAPI/skills

Drizzle schema definition, push vs migrate, type-safe queries, relations, transactions, and prepared statements.

YepAPI/skills

Upload handling, resize/compress, CDN delivery, blur placeholders, and next/image patterns.

YepAPI/skills

Local business and Google Maps research using YepAPI.

YepAPI/skills

Cursor-based pagination, IntersectionObserver, virtualized lists with @tanstack/react-virtual, and scroll position restoration.

YepAPI/skills

Chat UI components, streaming responses with AI SDK, context window management, and RAG patterns.

関連スキル