cloudflare-workers-auto

A set of standards for Cloudflare Workers, Cloudflare’s serverless programs that run close to users around the world. It covers TypeScript, modules, configuration, secrets, logging, storage, security, and WebSockets.

In plain words
What is it for?
Use it when building or configuring Workers, handling requests, connecting storage, managing secrets, validating input, logging errors, and implementing WebSocket connections.
Why use it?
It keeps Worker projects aligned with current Cloudflare patterns and avoids common configuration, security, and performance mistakes.

Cursor rule for Cursor

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/usrrname/cursorrules/cloudflare-workers-auto
Clone the repo
git clone --depth 1 https://github.com/usrrname/cursorrules

Made for: Cursor.

Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 2,736 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.00000 $0.02736
Opus 5 $0.00000 $0.01368
Sonnet 5 $0.00000 $0.00547
Haiku 4.5 $0.00000 $0.00274

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

Security

Grade A, and why

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

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.

async fetch(request: Request, env: Env, ctx: ExecutionContext): Promise<Response> {
.cursor/rules/standards/cloudflare-workers-auto.mdc · 418 lines

How it starts

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

Cloudflare Workers Development Standards

Enforces best practices for developing Cloudflare Workers including proper configuration, modern patterns, security, and performance optimization based on official Cloudflare documentation.

Critical Rules

  • Workers MUST use TypeScript by default unless JavaScript is specifically requested
  • Workers MUST use ES modules format exclusively (NEVER use Service Worker format)
  • Workers MUST use the modern export default pattern instead of addEventListener
  • Configuration MUST use wrangler.jsonc (not wrangler.toml)
  • Workers MUST import all methods, classes and types used in the code
  • Workers MUST keep all code in a single file unless otherwise specified
  • Workers MUST use official SDKs when available for external services
  • Workers MUST never bake secrets into the code
  • Workers MUST implement proper error handling and logging
  • Workers MUST use appropriate Cloudflare integrations for data storage
  • Workers MUST follow security best practices and input validation
  • Workers MUST use WebSocket Hibernation API for Durable Objects WebSockets

Read the full file on GitHub · 418 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. yesterday First seen · 418 lines · 2,736 tokens per session scan A fce91260c6b0

Subscribe to this mod's changes

cloudflare-workers-auto is a cursor rule published in the GitHub repository usrrname/cursorrules (10 stars, last pushed 4mo ago), licensed ISC. It costs nothing until one of its globs matches a file; then it loads 2,736 tokens. 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.