Code & Engineering

OpenNext on Cloudflare Deploy Review

Recommended

Reviews the deploy setup of a Next.js app that runs on Cloudflare Workers through OpenNext (@opennextjs/cloudflare): package.json versions and scripts, open-next.config.ts, the wrangler config and the CI deploy job, for what breaks the deploy or the live site while the build stays green. Finds ranges (^) on next and OpenNext instead of pinned versions, a pair that answers 500 on every page with Unexpected loadManifest(/.next/server/preview-props.json), version requirements between OpenNext, next and wrangler that are not met, a buildCommand that skips the checks in npm run build, variables set only in the dashboard, a CI job that runs wrangler deploy without a TTY and touches DNS, and a Durable Object migration that no upload applies. Gives the fix for each finding and ends a review with VERDICT: OK or VERDICT: CHANGE; a symptom question gets the cause first. Use when asked to review an OpenNext deploy setup before a release, or why a Cloudflare deploy was green and the site returns 500 or lost a setting.

OpenNext on Cloudflare Deploy Review is a SKILL.md that reviews the deploy setup of a Next.js app that runs on Cloudflare Workers through OpenNext (@opennextjs/cloudflare): package.json versions and scripts, open-next.config.ts, the wrangler config and the CI deploy job, for what breaks the deploy or the live site while the build stays green; an agent buys it once for $0.05 over x402.

Tested 2026-11-22No code, no hidden instructionsv1.0.1 · 13.5 KB · perpetual license

Not for

Next.js on Vercel or any host other than Cloudflare Workers, and anything about how the app itself is written. Edge runtime in a route, a secret set on one environment only and ISR cache mistakes belong to our neighbouring skills. It does not know versions released after its measurements and says so; it is not a security audit of your code; it never runs a deploy or a migration for you.

Tested, honestly

Tested 2026-11-22 with a strong and a weak model.

With and without the skill

Results with and without the skill, for Sonnet and Haiku
SonnetHaiku
withwithoutwithwithout
Inputs judged right (15 inputs)15/1510/1515/156/15

Same request on both sides, scored on the point in any words. Read by hand, Sonnet without the skill already knew the build-script bypass of a buildCommand, the loss of dashboard-only values (and keep_vars), lossy wrangler tail, the harmless DOQueueHandler lines, and that a version upload does not apply a Durable Object migration. It missed five measured facts: it approved caret ranges on next 16.4.0 with OpenNext 1.20.10, approved a CI deploy without a TTY on two custom domains and later moved a class deletion into that job, said yes to next upgrade --agent=security, and passed an OpenNext 1.20.16 bump with wrangler 4.140 and next 16.4.3. Haiku without the skill was right on six: the same misses, plus false alarms on four of the five sound setups. With the skill, run again after the wording fix, Haiku was right on all 15 and gave no false alarm on a sound setup.

Same cases and the same checks with and without the skill. The cases are ours, written around what the skill is for; with a handful of cases, a difference of one or two is within noise.

SonnetStrong model, claude-sonnet-5-5
Right on all 15 inputs on the 1.0.1 bytes, read by hand. It moved the caret ranges on next 16.4.0 with OpenNext 1.20.10 to the pair tried in November, pinned exactly; caught an OpenNext bump to 1.20.16 that left wrangler under 4.148 and next under 16.4.5; split a CI deploy on two custom domains into an upload and wrangler versions deploy; refused next upgrade --agent=security; read the 52 of 79 tail events as no proof of lost requests; called the DOQueueHandler build lines harmless; and answered OK on all five sound setups, including the one without a buildCommand. On the commit that deletes a Durable Object class it said the upload stops with an error naming the pending migration, so the job goes red and no version is made, and sent the commit to one full deploy from a terminal with a TTY. The version facts it used were measured on dates we give (11 October and 17 November 2026) and go stale, and it told the reader to check what is current.
HaikuWeak model, claude-haiku-5-5
Right on all 15 inputs on the 1.0.1 bytes, read by hand. It moved the caret ranges to the tried pair with exact pins, named both version requirements of OpenNext for the bump to 1.20.16, split the CI job on custom domains into an upload and a promote step, kept the dashboard-only flag out of the full deploy by putting it in vars, and refused the security-upgrade prompt. On the commit that deletes a Durable Object class it said the upload refuses the pending migration, the job goes red and no version is made, and asked for one full deploy from a terminal. It answered OK on the default OpenNext build (no buildCommand, so npm run build runs) and on the correct upload-and-promote CI step, without asking for a smoke test. Its version numbers carry the measurement dates of the skill and go stale like them.

Full test summary

Example

Our own test text, before and after the skill ran. Excerpts only.

English · claude-sonnet-5-5

Before

Before the deploy I ran `npm run build` and it stopped with `SecurityFatalError`; the message tells me to run `next upgrade --agent=security`. Versions in package.json: "next": "16.4.3", "eslint-config-next": "16.4.3", "@opennextjs/cloudflare": "1.20.13", "wrangler": "4.150.0". Should I run that command and then deploy?

After

No, don't run `next upgrade --agent=security`. Upgrade by hand and pin the exact versions. **Cause:** `next` 16.4.3 is below the 16.4.5 security line, and `next build` stopped on it with `SecurityFatalError`. That command picks the target version for you, which is why it shouldn't be run.…

What is in the file

  • Facts this review rests on
  • What to check, in this order
  • 1. Exact versions of next and OpenNext
  • 2. The pair and its requirements
  • 3. buildCommand
  • 4. Variables
  • 5. How CI deploys
  • 6. Files that never go into git
  • Symptom questions
  • Answer format
  • Not a finding
  • What not to do

Languages

Any language. Tried in: English.

License

Perpetual, non-exclusive; use and modify for yourself incl. paid work; no resale or republishing. Holder: Georgi Kalchev, aiskills402.com. Full terms.

Versions

Current version 1.0.1, updated 2026-11-22. Whoever bought an earlier version gets new ones free through the same re-download token.

  1. v1.0.1 · 2026-11-22

    Fact fixed from the peer requirements that @opennextjs/cloudflare declares on npm (read for 1.20.9 to 1.20.18): wrangler 4.148 or later is needed from OpenNext 1.20.10, not from 1.20.13 as the file said, and the floor of next 16.4.1 for OpenNext 1.20.12 onward was missing. Three other sentences reworded with the same meaning, so that no published post on our blog shares a run of five words with the file. One check widened for both sides. The side with the skill was run again in full, one run per model and input: Sonnet 15 of 15, Haiku 15 of 15. Without the skill, re-scored: 10 and 6 of 15, unchanged.

  2. v1.0.0 · 2026-11-22

    - First version. - Measured on 15 inputs of ours (11 deploy setups, 5 of them sound, and 4 symptom questions), one run per model and input, scored by code with the same checks on both sides and every failure read by hand: Claude Sonnet 15 of 15 with the skill and 10 of 15 without it; Claude Haiku 13 of 15 with it and 6 of 15 without it. - Two checks widened after the run, for both sides, because the answers said the same thing in other words: the migration check now takes "Neither applies Durable Object migrations" written in the sentence after the two upload commands, and the build-warning check takes "comes from the Next.js build step" as the source of the warning. No input changed and nothing was re-run. - Formatting of the skill file only, after the run: the two CI lines moved from a fenced block to an indented one, and three placeholders changed from angle brackets to braces, because the catalog refuses fences and tag-like text. The words are the same; the test ran on the earlier bytes. - Price $0.05: Sonnet gained five inputs, on five distinct facts we measured. - Wording fix in the skill, 22 November 2026: a pending Durable Object migration makes the upload stop with an error (CI goes red, no version is made), not a green job without the migration, as the first text said; plus two lines on what is not a finding (no buildCommand means OpenNext runs npm run build; a CI job without a smoke test). Skill side re-run in full on the 15 inputs: Claude Sonnet 15 of 15 and Claude Haiku 15 of 15 (the earlier run with the old wording: 15 and 13). Without the skill, unchanged: 10 and 6 of 15. Price stays $0.05.

FAQ

Green build, green deploy, and every page answers 500: how?

A green deploy means the bundle was built and uploaded, nothing more. We measured one pair of Next.js and OpenNext releases that did exactly this: build and upload passed, every page returned 500, and an older Next.js release served fine. The skill treats the two package versions as the main suspect, asks for exact versions instead of ranges, and wants a new release tried on a throwaway Worker first. It also gives the dates of its own measurements so you can see when they need to be repeated.

What does it tell me about deploying from CI?

That a deploy command run without a terminal can rewrite the DNS record of a custom domain, so a pipeline should upload a version and then promote it with wrangler versions deploy. It also names the one exception: a change that brings along a Durable Object migration cannot go out by that route, because the version upload will not carry it, and it needs a full deploy from a real terminal after a person has checked what the migration deletes.

Does it help Claude Sonnet?

By five inputs, all on version and CI facts. Claude Sonnet saw fifteen inputs of ours twice, bare and with the file: package.json with npm ls, a CI job on two custom domains, build configs, wrangler vars, a Durable Object deletion and four broken-release questions. Bare it got ten. It knew the build-script bypass, dashboard-only flags and lossy tail. It waved through caret ranges on the pair that answers 500, a CI job that rewrites DNS and an OpenNext bump below its wrangler and next floors, and said to run next upgrade --agent=security. With the file: fifteen. Haiku went from six to fifteen.

Read more

Share

Read this page as Markdown: /skills/opennext-cloudflare-deploy-review.md.

  • Cloudflare Workers Review: D1, OpenNext, Fetch

    Code & Engineering

    SKILL.md · v1.2.0 · 9.8 KB

    Reviews pasted Cloudflare Workers code and configuration (a Worker, a Next.js app on OpenNext, D1 queries, wrangler config) for platform pitfalls that pass every local test and then fail in production or quietly cost money. It flags the edge runtime under OpenNext, a fetch to your own Worker's workers.dev address (error 1042), D1 queries that bind more than 100 parameters as data grows, LIKE patterns over D1's 50-byte limit, reading rowsAffected where D1 returns meta.changes, interactive transactions D1 does not have, secrets kept in plain vars, outbound fetch code that treats only a thrown error as failure, a browser User-Agent that bot protection challenges, client hop-by-hop headers forwarded to fetch, cron triggers whose day of the week is written as numbers, and unbounded queries on the request path. Each finding has a fixed code, the place, the reason and a fix, then one verdict. Use to review a Cloudflare Worker before deploy, check D1 or wrangler code, or audit a Next.js app running on Cloudflare.

    $0.05once

    • x402
    • USDC
    • Base
    Get skill

    Tested with Sonnet and Haiku, 8 Oct 2026

  • Next.js Cache Review: ISR, Tags, Redirects

    Code & Engineering

    SKILL.md · v1.0.0 · 10.9 KB

    Reviews pasted Next.js App Router code and config that runs on Cloudflare through OpenNext, for caching and ISR mistakes that serve a wrong or stale answer, or make every visit read the database. It flags an unstable_cache key whose cached shape changed while the key stayed, force-dynamic pages that disable the browser back-forward cache, a wildcard Cache-Control override that makes the whole site dynamic, a dynamic route that never starts ISR because generateStaticParams is missing, a static page reading D1 at build time, a writer that evicts a tag on every event, s-maxage trusted to cap database reads, whole pages cached instead of the data, a redirect added over a path that was cached as 404, a middleware matcher that skips robots.txt and sitemap files, and a clock stored inside cached data. Each finding has a fixed code, the place, the reason and a fix, then one verdict. Use to review Next.js caching, ISR and revalidation code, a next.config headers or redirects block, or middleware before deploying to Cloudflare.

    $0.03once

    • x402
    • USDC
    • Base
    Get skill

    Tested with Sonnet and Haiku, 8 Oct 2026

  • Recommended

    Cloudflare Evidence Check

    Code & Engineering

    SKILL.md · v1.0.2 · 8.1 KB

    Judges whether a check someone ran on a Cloudflare-hosted site really proves what they claim, and answers as JSON with a verdict, the reason and the one check that would decide. Knows the instruments that answer for the wrong thing - the command-line object read that serves a cached copy after a delete, a delivery log that records neither test mail, a zero-row log search that looks the same as code that never ran, a local migration run, a staging secret, the free preview subdomain of a Worker that is not a zone, a size counter that prints zero on Windows, a character count that counts bytes, a robots file served from the edge cache - and the checks that do prove it. Use when an agent says deleted, delivered, applied, enabled, set on production or never ran on Cloudflare work, and you need to know whether its evidence supports that.

    $0.07once

    • x402
    • USDC
    • Base
    Get skill

    Tested with Sonnet and Haiku, 8 Oct 2026

More in Code & Engineering

  • Recommended

    Cloudflare Cron Trigger Review: Twice, Late, Never

    Code & Engineering

    SKILL.md · v1.0.1 · 13.3 KB

    Reviews the scheduled() handler of a Cloudflare Worker that dispatches jobs every minute, and its watchdog, for runs that happen twice, at the wrong minute, late or not at all. Finds a Cron Trigger event that arrives twice with the same scheduledTime and no claim before the outward action, a claim keyed from Date.now() instead of scheduledTime, Math.floor on a scheduledTime that arrives about 2 seconds early so everything runs a minute late, a daily job that needs one exact minute to fire, a catch-up that is unbounded or has no claim, a watchdog threshold shorter than the real gaps, and a Durable Object alarm that re-arms after its work or holds it outside waitUntil. Gives the fix in code for each finding and ends a review with VERDICT: OK or VERDICT: CHANGE; a symptom question gets the cause first. Use when asked to review a Cloudflare cron scheduler, or why scheduled jobs ran twice, a minute late or were skipped.

    $0.05once

    • x402
    • USDC
    • Base
    Get skill

    Tested with Sonnet and Haiku, 22 Nov 2026

  • Durable Object Billing Review: Cloudflare Cost

    Code & Engineering

    SKILL.md · v1.0.2 · 11.2 KB

    Reviews Cloudflare Durable Object code, wrangler config and a Durable Objects bill for what costs money. Finds an object kept awake and billed for wall-clock time it does not need (a pending timer, AbortSignal.timeout that is never cleared, even inside a helper, setInterval instead of an alarm, WebSockets that cannot hibernate, work held by waitUntil), objects and SQL storage that pile up because nobody deletes them (an object per visitor or per MCP session, McpAgent probes), and bills that cross the included amount by a few percent and are charged a whole started unit. Explains how the bill is computed: GB-seconds at 128 MB, one allowance for the whole account, rounding up. Gives the fix in code for each finding and ends a review with VERDICT: OK or VERDICT: CHANGE. Use when asked to review Durable Object code or config for cost, or why a Durable Objects bill is higher than the work done.

    $0.05once

    • x402
    • USDC
    • Base
    Get skill

    Tested with Sonnet and Haiku, 22 Nov 2026

  • WCAG Color Contrast Check: AA and AAA Ratios

    Code & Engineering

    SKILL.md · v1.0.1 · 10.3 KB

    Computes the real contrast ratio of every text and background pair in pasted CSS, design tokens or a palette, says whether each pair passes WCAG AA and AAA, and gives every failing pair a replacement color that passes on its real background. It carries a table of 256 channel values so the ratio is added and divided instead of guessed, and it reads the cases a glance gets wrong: a rgba color or opacity is blended with its background first, a placeholder is text, 18px bold is not large text, a border or an icon is a 3:1 component, a disabled control and a logo are exempt, short hex and color names are expanded, and 4.48 is never rounded up to 4.5. One line per pair, then a Verdict line. Use when asked for a WCAG color contrast check of a stylesheet, theme or palette, whether colors pass AA or AAA, or to fix text colors that are too pale.

    $0.05once

    • x402
    • USDC
    • Base
    Get skill

    Tested with Sonnet and Haiku, 12 Nov 2026

  • Recommended

    Safe Refactoring: Refactor Without Changing Behavior

    Code & Engineering

    SKILL.md · v1.0.1 · 9.7 KB

    Refactors, cleans up and modernizes Python, JavaScript, TypeScript and React code without changing what it does. It guards the change that cleanups make most often without saying so - how the code treats missing and empty values - and ends each answer with a short Behavior section that names what was checked and anything that changed. Use when asked to refactor, clean up, tidy, simplify or modernize a function, class, component or file.

    $0.05once

    • x402
    • USDC
    • Base
    Get skill

    Tested with Sonnet and Haiku, 13 Nov 2026