cloudflare-nextjs

cloudflare-nextjs is a skill for Claude Code from secondsky/claude-skills. It costs 89 tokens per session (5,789 once invoked), scanned A, original, MIT.

A deployment setup for running Next.js applications on Cloudflare Workers, including server-rendered and statically generated sites.

In plain words
What is it for?
It helps deploy Next.js projects, connect Cloudflare services such as storage and databases, and configure caching and environment variables.
Why use it?
It addresses the configuration and runtime differences between a regular Next.js build and Cloudflare’s Workers platform.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the cloudflare-nextjs plugin — 1 skill shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/secondsky/claude-skills/cloudflare-nextjs
Any agent
npx skills add secondsky/claude-skills --skill cloudflare-nextjs
Clone the repo
git clone --depth 1 https://github.com/secondsky/claude-skills

Made for: Claude Code.

Or install cloudflare-nextjs, the plugin that ships this one along with the rest of its 1 skill.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for cloudflare-nextjs

README.md
[![agentmods](https://agentmods.dev/badge/skills/secondsky/claude-skills/cloudflare-nextjs.svg)](https://agentmods.dev/skills/secondsky/claude-skills/cloudflare-nextjs)
Your own site
<a href="https://agentmods.dev/skills/secondsky/claude-skills/cloudflare-nextjs"><img src="https://agentmods.dev/badge/skills/secondsky/claude-skills/cloudflare-nextjs.svg" alt="Measured on agentmods" height="20"></a>
Per session 89 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,789 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00089 $0.05789
Opus 5 $0.00044 $0.02894
Sonnet 5 $0.00018 $0.01158
Haiku 4.5 $0.00009 $0.00579

Measured 2d ago against content hash f7fe21ea00e6, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

cloudflare-nextjs scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

The scan reads SKILL.md. This mod also ships 5 executable files (references/database-client-example.ts, references/open-next.config.ts, scripts/analyze-bundle.sh, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/cloudflare-nextjs/skills/cloudflare-nextjs/SKILL.md · 322 lines

How it starts

The opening of the file, as written. The whole thing — 322 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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 (nodejs_compat) — 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 nodejs_compat.
compatibility_flags ["nodejs_compat", "global_fetch_strictly_public"] Node APIs + allow fetch() in app code.
compatibility_date 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 keep_names; 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.tsproxy.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.

Read the full file on GitHub · 322 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 322 lines · 89 tokens per session scan A f7fe21ea00e6

Subscribe to this mod's changes

cloudflare-nextjs is a skill published in the GitHub repository secondsky/claude-skills (214 stars, last pushed 3d ago), licensed MIT. It adds 89 tokens to every session and 5,789 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.