mcpField
N
nextjs-nestjs-integration

nextjs-nestjs-integration

github.com/xirothedev開発290 回インストール24 週間前に更新
リポジトリ

nextjs-nestjs-integration について

Next.js アプリと NestJS API の連携を整理するスキルです。バックエンドの責務、API 契約、両アプリのデプロイ境界を明確にします。

主な機能

  1. 01OpenAPI クライアントの生成と利用
  2. 02Next.js と NestJS の責務分担
  3. 03セッションと認証情報の伝達
  4. 04CORS、プロキシ、API オリジンの設定
  5. 05Server Component のデータ取得指針
  6. 06デプロイと環境変数の調整

活用シーン

  1. 01処理を Next.js と NestJS のどちらに置くか判断
  2. 02NestJS API への認証情報の伝達
  3. 03Server Component からの API データ取得
  4. 04Docker とデプロイ設定の調整

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/xirothedev/skills --skill nextjs-nestjs-integration

インストール後、Claude Code で/nextjs-nestjs-integrationを入力して読み込まれたか確認します。

同梱ファイル

SKILL.md と一緒にインストールされる参考資料やスクリプト。

AGENTS.md
metadata.json
test-cases.json
dataset/integration/cors-proxy-contract/
correct.ts
incorrect.ts
notes.md
dataset/integration/deployment-split/
correct.ts
incorrect.ts
notes.md
dataset/integration/openapi-client-boundary/
correct.ts
incorrect.ts
notes.md
dataset/integration/server-component-fetching/
correct.tsx
incorrect.tsx
notes.md
dataset/integration/session-propagation/
correct.ts
incorrect.ts
notes.md
dataset/integration/shared-env-contract/
correct.ts
incorrect.ts
notes.md
references/
_sections.md
integration-cors-proxy-contract.md
integration-deployment-split.md
integration-openapi-client-boundary.md
integration-server-component-fetching.md
integration-session-propagation.md
integration-shared-env-contract.md
sources/
inventory.json

詳細

Next.js NestJS 統合

Next.js アプリと NestJS API の両方が含まれるプロジェクトで、このスキルを使用します。主な目的は、Web アプリがバックエンドのポリシーを誤って重複させたり、API コントラクトを迂回したり、ビルド時に自身へフェッチしたりしないよう、責任範囲を明確に保つことです。

適用するタイミング

次の場合にこのスキルを使用します。

  • NestJS の OpenAPI ドキュメントから型付きクライアントを生成または利用する場合
  • ロジックを Next.js の Route Handlers/Server Actions と NestJS のコントローラー/サービスのどちらに配置するか決める場合
  • Next.js から NestJS へ認証/セッションのコンテキストを伝播する場合
  • CORS、Cookie、Proxy、リライト、内部 API オリジンを設定する場合
  • Next.js アプリ独自の Route Handlers を呼び出さずに、Server Components から NestJS のデータを取得する場合
  • アプリ間で Docker、環境変数、ヘルスチェック、デプロイのトポロジーを統一する場合

必要に応じて読み込む

このファイルから開始します。タスクに必要な場合に限り、詳細ファイルを読み込んでください。

references/_sections.md
references/integration-openapi-client-boundary.md
references/integration-session-propagation.md
references/integration-cors-proxy-contract.md
references/integration-server-component-fetching.md
references/integration-shared-env-contract.md
references/integration-deployment-split.md
dataset/integration/openapi-client-boundary/correct.ts
sources/inventory.json

各ルールファイルには、次の内容が含まれます。

  • このパターンが重要な理由
  • 誤った例と正しい例
  • より大きな TypeScript の例を含むデータセットのパス
  • 公式ソースへの参照

優先度別のルールカテゴリー

優先度カテゴリー影響度接頭辞
1統合の境界CRITICALintegration-
2API コントラクトCRITICALapi-
3デプロイと運用HIGHdeploy-

ソースポリシー

両方のアプリにまたがる作業では、このスキルを nextjs-secure-bff、nextjs-production-platform、nestjs-production-api-contracts と併用してください。公式の Next.js および NestJS のドキュメントは、フレームワークに依存しないモノレポの例より優先されます。

コメント