Agent skill · software engineering · secondsky

cloudflare-nextjs

Deploy Next.js to Cloudflare Workers via the OpenNext adapter (@opennextjs/cloudflare). Use for SSR/ISR/SSG/App or Pages Router, getCloudflareContext, bindings (D1/R2/KV/AI/Hyperdrive), caching tiers, skew protection, multi-worker, custom worker, env vars, or worker size/runtime/keep_names/FinalizationRegistry/connection-scoping errors.

Why this skill is useful

Provides specific commands and configurations for deploying Next.js on Cloudflare Workers that the AI wouldn't reliably generate on its own.

What it needs

Requires wrangler installed locally. About 9k tokens when loaded. Last updated 2026-08-06. 204 stars on the source repository.

What this skill does

OpenNext Cloudflare Adapter — Next.js on Workers Deploy Next.js applications to Cloudflare Workers using the OpenNext adapter (@opennextjs/cloudflare). The adapter takes a standard Next.js build, runs package.json build script, then transforms the output to run on the Workers runtime using the Node.js compatibility layer (nodejscompat) — not the Edge runtime. Critical Requirements (get these wrong and the build/runtime fails) Requirement Value Why --- --- --- Runtime Node.js (default). Remove every export const runtime = "edge"; Edge runtime is unsupported; OpenNext uses nodejscompat. compatibilityflags ["nodejscompat", "globalfetchstrictlypublic"] Node APIs + allow fetch() in app code. compatibilitydate ≥ 2024-09-23; ≥ 2025-05-05 recommended (FinalizationRegistry) Older dates break FinalizationRegistry, DOs, and more. Wrangler ≥ 3.99.0 to deploy; ≥ 4.13.0 for keepnames; ≥ 4.36.0 for stable remote bindings Feature gates in the docs. Next.js v16 all minors/patches supported; latest minors of v14 and v15; v14 dropped Q1 2026 Stated on the overview page. Worker size (gzip) 3 MiB Free / 10 MiB Paid (compressed only) Hard Cloudflare limits. Windows: not fully guaranteed (Next.js tooling issues). Use WSL, a Linux VM, or Linux/macOS CI. See known issue #1305. Disambiguation: this skill vs nextjs nextjs skill → framework/App Router/Server Components/Cache Components patterns, any platform (Vercel, self-hosted, ...). Use for async params, proxy.ts migration, "use cache". THIS skill (cloudflare-nextjs) → deploying Next.js to Workers via the OpenNext adapter: wrangler.jsonc, open-next.config.ts, getCloudflareContext, caching tiers, bindings, skew protection, multi-worker, the Workers-specific errors. proxy.ts caveat (Next 16): Next 16 renamed middleware.ts → proxy.ts, but @opennextjs/cloudflare does not recognize proxy.ts yet (issue #1277) — on Cloudflare, keep using middleware.ts. This is the one place the nextjs skill's guidance does NOT apply here. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills secondsky/cloudflare-nextjs

View the source on GitHub

Browse the @skills marketplace