| name | nextjs-app-router-conventions |
| description | Next.js App Router conventions covering file-based routing, caching strategies, Server Actions, Metadata API, and framework-specific patterns. Auto-triggers when working within Next.js App Router projects on files matching `src/**/*.tsx`, `src/**/*.ts`, `proxy.ts`, or `next.config.*`. Covers file-based routing, caching, Server Actions, Metadata API, and framework-specific patterns. |
Next.js App Router Conventions
Next.js App Router のフレームワーク固有規約集。ファイルベースルーティング、キャッシュ戦略、Server Actions、Metadata API に関するルールを定義する。
When to Apply
以下のいずれかに該当する作業時に自動で参照する:
- 次のパターンに一致するファイルの作成・修正
src/**/*.tsx
src/**/*.ts
proxy.ts
next.config.*
- ページ・レイアウトの作成
- Server Actions の実装
- Route Handler の作成
- キャッシュ戦略の設計
- Metadata / OGP の設定
- Proxy の実装
Compatibility
Next.js 16+
Rule Categories
| Category | Prefix |
|---|
| ファイル規約 | file- |
| Server Actions | actions- |
| キャッシュ戦略 | cache- |
| Metadata / SEO | metadata- |
| ルーティングパターン | routing- |
| Proxy | proxy- |
Quick Reference
ファイル規約
Server Actions
キャッシュ戦略
Metadata / SEO
データ取得
ルーティングパターン
Proxy
How to Use
個別ルールの詳細は rules/ ディレクトリ内のファイルを参照。上記 Quick Reference のリンクから各ルールにアクセスできる。
各ルールファイルには以下が含まれる:
- ルールの説明と根拠
- Bad: 間違ったコード例
- Good: 正しいコード例
- Next.js バージョン固有の注意点