cf_online

A deployment workflow for publishing Next.js web projects on Cloudflare Pages, Cloudflare’s hosting service for web applications.

In plain words
What is it for?
Use it to prepare, build, deploy, and optionally connect a custom domain for a Next.js App Router project on Cloudflare Pages.
Why use it?
It checks and adjusts the project settings needed for Cloudflare’s edge environment, helping avoid deployment and runtime configuration errors.

Skill for Claude CodeCodex

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/weiyi88/cc-code/cf_online
Any agent
npx skills add weiyi88/cc-code --skill cf_online
Clone the repo
git clone --depth 1 https://github.com/weiyi88/cc-code

Made for: Claude Code, Codex.

Per session 45 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,244 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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 $0.00045 $0.03244
Opus 5 $0.00023 $0.01622
Sonnet 5 $0.00009 $0.00649
Haiku 4.5 $0.00005 $0.00324

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

Security

Grade A, and why

cf_online scanned grade A with 1 finding 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.

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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -s -o /dev/null -w "HTTP %{http_code}" "https://<project-name>.pages.dev"
skills/cf_online/SKILL.md · 395 lines

How it starts

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

Cloudflare Pages 上线技能

将 Next.js (App Router) 项目部署到 Cloudflare Pages Edge Runtime,包含完整的预检、构建、部署、域名配置流程。

适用场景

  • Next.js App Router 项目部署到 Cloudflare Pages
  • 已有 GitHub 仓库,需要上线到 Cloudflare
  • 需要为 Cloudflare Pages 配置自定义域名

完整流程

Phase 0: 预检(必做)

部署前必须检查以下项目配置,逐项修复:

0.1 wrangler.toml

确认项目根目录存在 wrangler.toml,内容必须包含:

#:schema node_modules/wrangler/config-schema.json

name = "<project-name>"
compatibility_date = "2024-12-01"
compatibility_flags = ["nodejs_compat"]
pages_build_output_dir = ".vercel/output/static"
  • name:项目名(小写,将作为 <name>.pages.dev 子域名)
  • compatibility_flags必须包含 nodejs_compat,否则运行时 503 错误
  • pages_build_output_dir必须设置,否则 wrangler 不会应用 compatibility_flags
0.2 next.config.mjs
/** @type {import('next').NextConfig} */
const nextConfig = {
  reactStrictMode: true,
  images: {
    unoptimized: true,  // Cloudflare Pages 不支持 Next.js 图片优化
  },
  // 注意:不要设置 output: 'export',@cloudflare/next-on-pages 会处理输出格式
};

export default nextConfig;
0.3 Edge Runtime 声明

所有动态页面和 API 路由必须添加 Edge Runtime 声明:

// app/page.tsx
export const runtime = 'edge';

// app/api/xxx/route.ts
export const runtime = 'edge';

// app/generator/[param]/page.tsx
export const runtime = 'edge';

⚠️ 关键限制(Next.js 15):

  • export const runtime = 'edge'generateStaticParams 不能共存
  • 选择 edge runtime 就必须是动态渲染,放弃静态生成
  • params 类型变为 Promise<{...}>,需要 await params
// Next.js 15 正确写法
export default async function Page({
  params,
}: {
  params: Promise<{ platform: string }>;
}) {
  const { platform } = await params;
  // ...
}
0.4 依赖版本兼容
依赖 要求 原因
next >= 14.3.0 @cloudflare/next-on-pages 最低要求
@cloudflare/next-on-pages 最新版 构建适配器
eslint + eslint-config-next 版本匹配 ESLint v9 与 eslint-config-next 不兼容,用 v8
# 安装必要依赖
npm install -D @cloudflare/next-on-pages
# 如有 ESLint 冲突
npm install -D eslint@8 eslint-config-next@14

Read the full file on GitHub · 395 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 · 395 lines · 45 tokens per session scan A b92b0ca40f11

Subscribe to this mod's changes

cf_online is a skill published in the GitHub repository weiyi88/cc-code (5 stars, last pushed 6d ago), licensed MIT. It adds 45 tokens to every session and 3,244 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.