cloudflare-workers

cloudflare-workers is a cursor rule for Cursor from YuDefine/nuxt-supabase-starter. It costs 0 tokens per session (8,945 once invoked), scanned A, original, MIT.

A deployment and configuration guide for Cloudflare Workers, a platform for running server-side code at Cloudflare's edge. It covers NuxtHub, database choices, Wrangler settings, and two deployment paths.

In plain words
What is it for?
It helps configure Nuxt applications for Cloudflare Workers, choose between D1 or external databases, and deploy with Wrangler Actions or VoidCloud.
Why use it?
It prevents mismatched database dependencies, invalid configuration formats, and deployment settings that can break Cloudflare releases.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/. Also seen: reads .claude/ paths; mentions AGENTS.md.

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 rules/yudefine/nuxt-supabase-starter/cloudflare-workers
Clone the repo
git clone --depth 1 https://github.com/YuDefine/nuxt-supabase-starter

Made for: Cursor.

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-workers

README.md
[![agentmods](https://agentmods.dev/badge/rules/yudefine/nuxt-supabase-starter/cloudflare-workers.svg)](https://agentmods.dev/rules/yudefine/nuxt-supabase-starter/cloudflare-workers)
Your own site
<a href="https://agentmods.dev/rules/yudefine/nuxt-supabase-starter/cloudflare-workers"><img src="https://agentmods.dev/badge/rules/yudefine/nuxt-supabase-starter/cloudflare-workers.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 8,945 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.00000 $0.08945
Opus 5 $0.00000 $0.04473
Sonnet 5 $0.00000 $0.01789
Haiku 4.5 $0.00000 $0.00894

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

Security

Grade A, and why

cloudflare-workers 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.

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.

template/.cursor/rules/cloudflare-workers.mdc · 427 lines

How it starts

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

Cloudflare Workers / NuxtHub Configuration

Fleet 內絕大多數 consumer 走 「Nuxt + Nitro cloudflare_module preset + GitHub Actions cloudflare/wrangler-action@v3 deploy」 共通骨幹(Track A — wrangler-action)。少數 consumer 改走 void.cloud(Track B — VoidZero 部署平台,建在 Cloudflare Workers 上;current SDK 以 official Nuxt integration 與 OIDC workflow 為準)。

差異維度:(1) NuxtHub 是否該帶 (2) wrangler 檔該長什麼樣 (3) deploy 派別(wrangler-action vs void.cloud)。

Cookbook 範本:~/offline/clade/vendor/snippets/cloudflare-workers/

與 [[data-layer-d1]] 互補:本 rule 規 架構選擇 + 設定格式 + deploy track;data-layer-d1 規 D1 + Drizzle runtime sharp edges(subquery alias、dev binding fallback、schema patch 等)。 與 /yudefine-deploy skill 互補:本 rule 規 跨 fleet 通用 hard rule;skill 規 YuDefine fleet 部署 SOP(含 void.cloud Step 3A 決策樹詳述)。

§ 1 — DB × deploy track NuxtHub gating(hard rule)

NuxtHub (@nuxthub/core) 的唯一實質作用是 wrangler-action deploy track 上的 Cloudflare 原生 binding (D1 / KV / R2 / AI / Vectorize / Durable Objects) 的 runtime 抽象。它提供 deploy 簡化(fleet 內目前無 consumer 用 nuxthub deploy,以 registry 為準),而且:

  • 不用 D1/KV/R2/AI 的 consumer(Supabase / Postgres / 純外部 DB)帶 @nuxthub/core 是純冗餘 dep
  • void.cloud track(即使用 D1)帶 @nuxthub/core 也是冗餘 — void 提供自家 void/db + void/schema-d1 abstraction,與 NuxtHub helper 同層但獨立

MUST(採二維 matrix 判定)

Deploy track DB 規約
Track A (wrangler-action) Cloudflare D1 / KV / R2 / AI MUSTpackage.json@nuxthub/core + 在 nuxt.config.ts modules 登記 + 設 hub: { db: 'sqlite', ... } + server code 用 hubDatabase() / hubKV() / hubBlob()
Track A (wrangler-action) Supabase / Postgres / 純外部 DB MUST NOT@nuxthub/core
Track B (void.cloud) D1(void 自家 provision) MUST NOT@nuxthub/core;自己寫 server/utils/db.tscreateDb(env.DB) + server/utils/blob.ts 包 R2 raw binding(範本見 /yudefine-deploy Phase 5)
Track B (void.cloud) 純外部 DB(罕見) MUST NOT@nuxthub/core(同上)

Read the full file on GitHub · 427 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 · 427 lines · 0 tokens per session scan A 3768139bec33

Subscribe to this mod's changes

cloudflare-workers is a cursor rule published in the GitHub repository YuDefine/nuxt-supabase-starter (45 stars, last pushed today), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 8,945 tokens. 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.