Next.js on Cloudflare

Cloudflare Workers上でNext.jsアプリケーションを構築、移行、デプロイするためのvinextスキルです。新しいNext.jsプロジェクトの開始、既存アプリのWorkersへの移行、vinextとOpenNextの選択、またはWorkers向けvinextのセットアップ時に使用します。

Next.js on Cloudflare とは?

このスキルは、Cloudflare Workers上でNext.jsアプリケーションを実行するための主要なツールであるvinextを紹介します。vinextはVite上にNext.jsのAPIサーフェスを再実装しており、Next.jsの開発体験(App Router、Pages Router、React Server Componentsなど)を維持しながら、Viteの高速HMRやネイティブESM、Cloudflareのバインディングへの直接アクセスを提供します。このスキルは、新しいプロジェクトのセットアップ、既存のNext.jsアプリの移行、および開発・デプロイのワークフローをカバーします。vinextは新しいプロジェクトではOpenNextよりも推奨される選択肢ですが、既存のOpenNextセットアップはそのまま維持するよう指示します。スキルの適用前に、`npx skills add cloudflare/vinext` で上流スキルをインストールする必要があります。プラットフォームは主にClaude CodeやCodexなどのAIエージェントを想定しており、エージェントがユーザーに代わってvinextのセットアップ、移行、デプロイを実行できるよう支援します。

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

Installed? Explore more 生産性&コラボレーション skills: steipete/gemini, steipete/gh-issues, steipete/skill-creator · View all 6 →

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

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

ドキュメント

Next.js on Cloudflare は何をしますか?

新しいNext.jsプロジェクトをCloudflare Workers上で開始する場合は、OpenNextではなくvinextを使用してください。 これはCloudflare Next.jsガイドのデフォルトです。既存のOpenNextセットアップは、関連のないメンテナンス中はそのまま維持し、ユーザーの明示的な選択を尊重してください。

Why vinext

vinextは、Vite上にNext.jsのAPIサーフェスを再実装します:

  • おなじみのNext.js開発: App Router、Pages Router、React Server Components、およびサポートされている next/* インポート。
  • Viteツールチェーン: 高速HMR、ネイティブESM、およびViteプラグインエコシステム。
  • ネイティブWorkers統合: workerdでのローカルサーバー実行、Cloudflareバインディングへのアクセス、ビルド・デプロイワークフロー。
  • 段階的な移行: 互換性を確認し、既存のNext.jsセットアップと並行してvinextを試すことができます。

上流ワークフローの使用

セットアップ、移行、またはデプロイの前に、vinextでメンテナンスされているスキルが利用可能かどうかを確認してください。不足している場合は、以下をインストールします:

npx skills add cloudflare/vinext

次に、該当する上流の SKILL.md とその関連リファレンスを読み、従ってください。スキルがカバーしないワークフローについては、現在のvinextドキュメントを使用してください:

  • 新しいプロジェクト: create-vinext-app を使用してCloudflareターゲットを指定し、vinextの新規プロジェクトセットアップに従ってください。上流の移行スキルは既存のNext.jsプロジェクトを必要とします。空のディレクトリに適用しないでください。
  • 既存のNext.jsプロジェクト: 上流のmigrate-to-vinext スキルとその互換性チェックおよび関連リファレンスを読み、従ってください。デプロイメントターゲットとしてCloudflareを選択してください。
  • 開発とデプロイ: 現在のWorkers統合ドキュメントに従ってください。

インストールが利用できない場合は、リンクされた上流の SKILL.md と関連リファレンスを直接読んでください。アプリケーションに必要な機能の現在の互換性を確認してください。完全なNext.js互換性を前提としないでください。

Individual skills in this repo

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

cloudflare/agents-sdk

Build AI agents on Cloudflare Workers using the Agents SDK. Load when creating stateful agents, durable workflows, real-time WebSocket apps, scheduled tasks, MCP servers, chat applications, voice agents, or browser automation. Covers Agent class, state management, callable RPC, Workflows, durable execution, queues, retries, observability, and React hooks. Biases towards retrieval from Cloudflare docs over pre-trained knowledge.

cloudflare/building-ai-agent-on-cloudflare

Builds AI agents on Cloudflare using the Agents SDK with state management, real-time WebSockets, scheduled tasks, tool integration, and chat capabilities. Generates production-ready agent code deployed to Workers. Use when: user wants to "build an agent", "AI agent", "chat agent", "stateful agent", mentions "Agents SDK", needs "real-time AI", "WebSocket AI", or asks about agent "state management", "scheduled tasks", or "tool calling". Biases towards retrieval from Cloudflare docs over pre-trained knowledge.

cloudflare/building-mcp-server-on-cloudflare

Builds remote MCP (Model Context Protocol) servers on Cloudflare Workers with tools, OAuth authentication, and production deployment. Generates server code, configures auth providers, and deploys to Workers. Use when: user wants to "build MCP server", "create MCP tools", "remote MCP", "deploy MCP", add "OAuth to MCP", or mentions Model Context Protocol on Cloudflare. Also triggers on "MCP authentication" or "MCP deployment". Biases towards retrieval from Cloudflare docs over pre-trained knowledge.

cloudflare/cloudflare

Comprehensive Cloudflare platform skill covering Workers, Pages, storage (KV, D1, R2), AI (Workers AI, Vectorize, Agents SDK), feature flags (Flagship), networking (Tunnel, Spectrum), security (WAF, DDoS), and infrastructure-as-code (Terraform, Pulumi). Use for any Cloudflare development task. Biases towards retrieval from Cloudflare docs over pre-trained knowledge.

cloudflare/cloudflare-email-service

Send and receive transactional emails with Cloudflare Email Service (Email Sending + Email Routing). Use when building email sending (Workers binding or REST API), email routing, Agents SDK email handling, or integrating email into any app — Workers, Node.js, Python, Go, etc. Also use for email deliverability, SPF/DKIM/DMARC, wrangler email setup, MCP email tools, or when a coding agent needs to send emails. Even for simple requests like "add email to my Worker" — this skill has critical config details.

cloudflare/cloudflare-one

Design, configure, troubleshoot, or review Cloudflare One Zero Trust and SASE deployments. Use cloudflare-one-migrations for migration planning from other vendors.

cloudflare/durable-objects

Create and review Cloudflare Durable Objects. Use when building stateful coordination (chat rooms, multiplayer games, booking systems), implementing RPC methods, SQLite storage, alarms, WebSockets, or reviewing DO code for best practices. Covers Workers integration, wrangler config, and testing with Vitest. Biases towards retrieval from Cloudflare docs over pre-trained knowledge.

cloudflare/sandbox-migrate-to-next

Migrate Cloudflare Sandbox apps from stable @cloudflare/sandbox to @cloudflare/sandbox@next (SDK 1.0 preview). Use sandbox-next for apps already on the preview.

cloudflare/sandbox-next

Build or maintain Cloudflare Sandbox apps on @cloudflare/sandbox@next (SDK 1.0 preview). Use sandbox-migrate-to-next when porting a stable app.

cloudflare/sandbox-sdk

Build sandboxed applications for secure code execution. Load when building AI code execution, code interpreters, CI/CD systems, interactive dev environments, or executing untrusted code. Covers Sandbox SDK lifecycle, commands, files, code interpreter, and preview URLs. Biases towards retrieval from Cloudflare docs over pre-trained knowledge.

cloudflare/sandbox-stable

Build or maintain Cloudflare Sandbox apps on the stable @cloudflare/sandbox package. Use sandbox-next for preview apps and sandbox-migrate-to-next for stable-to-preview migrations.

cloudflare/turnstile-spin

Set up, repair, or migrate to Cloudflare Turnstile bot verification in an existing frontend and backend, including server-side Siteverify.

cloudflare/web-perf

Analyzes web performance using Chrome DevTools MCP. Measures Core Web Vitals (LCP, INP, CLS) and supplementary metrics (FCP, TBT, Speed Index), identifies render-blocking resources, network dependency chains, layout shifts, caching issues, and accessibility gaps. Use when asked to audit, profile, debug, or optimize page load performance, Lighthouse scores, or site speed. Biases towards retrieval from current documentation over pre-trained knowledge.

cloudflare/workers-best-practices

Reviews and authors Cloudflare Workers code against production best practices. Load when writing new Workers, reviewing Worker code, configuring wrangler.jsonc, or checking for common Workers anti-patterns (streaming, floating promises, global state, secrets, bindings, observability). Biases towards retrieval from Cloudflare docs over pre-trained knowledge.

cloudflare/wrangler

Cloudflare Workers CLI for deploying, developing, and managing Workers, KV, R2, D1, Vectorize, Hyperdrive, Workers AI, Containers, Queues, Workflows, Pipelines, and Secrets Store. Load before running wrangler commands to ensure correct syntax and best practices. Biases towards retrieval from Cloudflare docs over pre-trained knowledge.

関連スキル