workers-config

workers-config is a cursor rule for Cursor from louisbrulenaudet/monorepo-template. It costs 2,712 tokens per session, scanned A, original, Apache-2.0.

A rule set for Cloudflare Workers, which are small programs that run on Cloudflare’s network. It defines how configuration, secrets, generated type files, and service-to-service calls must be handled.

In plain words
What is it for?
It helps configure Worker bindings and variables, regenerate type definitions, check configuration in CI, and enforce fail-closed behavior.
Why use it?
It keeps deployment settings consistent and prevents configuration errors, stale generated types, and unsafe handling of secrets.

Cursor rule for Cursor

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

Good fit It helps configure Worker bindings and variables, regenerate type definitions, check configuration in CI, and enforce fail-closed behavior.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/louisbrulenaudet/monorepo-template/workers-config
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.

Clone the repo
git clone --depth 1 https://github.com/louisbrulenaudet/monorepo-template

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

README.md
[![agentmods](https://agentmods.dev/badge/rules/louisbrulenaudet/monorepo-template/workers-config/github.svg)](https://agentmods.dev/rules/louisbrulenaudet/monorepo-template/workers-config)
Your own site
<a href="https://agentmods.dev/rules/louisbrulenaudet/monorepo-template/workers-config"><img src="https://agentmods.dev/badge/rules/louisbrulenaudet/monorepo-template/workers-config/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for workers-config

Your own site · 80×15
<a href="https://agentmods.dev/rules/louisbrulenaudet/monorepo-template/workers-config"><img src="https://agentmods.dev/badge/rules/louisbrulenaudet/monorepo-template/workers-config.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2,712 This file is loaded in full into every session.
When invoked 2,712 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.02712 $0.02712
Opus 5.5 $0.01085 $0.01085
Sonnet 5.5 $0.00542 $0.00542
Haiku 4.5 $0.00271 $0.00271

Measured 1mo ago against content hash 471fa1f19c28, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

workers-config 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 1mo 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.

.cursor/rules/backend/workers-config.mdc · 67 lines

How it starts

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

Worker Config (cloudflare.config.ts)

cloudflare.config.ts is the source of truth for each app's Worker name, bindings, vars, and exports in every mode; cf, the Cloudflare Vite plugin, and @cloudflare/vitest-plugin all evaluate it. Build and dev settings (minify, source maps, dev port, inspector port) live in the app's vite.config.ts, never here. RPC bindings: service-bindings.mdc; cache: workers-cache.mdc.

Shape

  • export default defineConfig({ worker: (ctx) => … }) from cf/config: the factory picks one entry from a DEPLOYMENTS table keyed development / staging / production and returns a single object built from it. Scaffold a new app by copying an existing app's cloudflare.config.ts + vite.config.ts and editing them by hand.
  • Modes fail closed: an unknown ctx.mode throws instead of falling back to development values, and ctx.isPreview throws unless the mode is production. Never add a default branch. Missing required config fails predictably, never degrades - the application-level 503 guards (CORS_ORIGINS) stay too.
  • One env shape, one return. Env is inferred (InferEnv over the default export) and the generated types declare interface Env extends __Env; an interface cannot extend a union, so branches returning differently shaped objects break type generation. Keep every mode on the same env keys, per-mode values in the Deployment table (a field may be a union such as SecretBinding | TextBinding<"">), and one return.
  • Every @repo/* import is type-only (import type { AppEnvironment } from "@repo/enums-common"); modes use string literals typed by the enum (environment: "dev"), which tsc checks. The Vite plugin adds every module the config loads to server.fs.deny, so a value import denies that package to the Worker and SPA that also import it (cf dev: Failed to load url /@fs/…/packages/enums-common/src/index.ts … Does the file exist?), and Node loads the config natively without adding extensions, so a value import from an extensionless @repo/* package fails at load.
  • Names: development keeps the bare package name (worker-api, front-app); deployed Workers are <app>-staging and <app>-production, and Previews live under <app>-production. CD, the Preview scripts, wrangler tail, and Worker-name bindings address these names - never rename them in passing.
  • compatibilityDate 2026-08-04 or later, so Node.js compatibility is on by default; never add nodejs_compat / nodejs_compat_v2 to compatibilityFlags.
  • A Worker with code sets entrypoint from import * as entrypoint from "./src/index.ts" with { type: "cf-worker" } (the shared presets set allowImportingTsExtensions). The assets-only front-app has no entrypoint and sets assets: { notFoundHandling: "single-page-application" }.
  • previewUrls: true in production only - Previews need it. It is applied by cf workers triggers deploy (or a full cf deploy), never by cf workers versions create / cf workers deployments create, which is all CD runs; it also exposes production Version URLs, and Preview URLs stay public until Cloudflare Access guards the front-app ones (never the gateway's) (../ops/previews.mdc). workersDev defaults to true; set false only once custom domains serve the Worker.
  • Observability per deployment: development samples logs and traces at 1; staging and production trace at headSamplingRate: 0.01; the worker-api Preview persists logs and traces at 1, the front-app Preview keeps production's. Keep redactQueryString: true on every deployed mode: query strings can carry tokens. The Sentry sampler mirrors these (hono-gateway.mdc).
  • Porting a Wrangler config: env blocks → modes, previews block → the ctx.isPreview branch, vars → bindings.text(), secrets.required → bindings.secret(), version_metadata → bindings.versionMetadata(), observability / assets / limits keys → camelCase under worker; minify, upload_source_maps, dev.port, inspector_port → vite.config.ts.

Read the full file on GitHub · 67 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. 1mo ago Changed · +92 tokens per session 471fa1f19c28
  2. 1mo ago Changed · +30 tokens per session ba5f1ba6ca51
  3. 1mo ago Changed · +28 tokens per session fc38b814e7e7
  4. 2mo ago Changed · +1 lines · +113 tokens per session eca1adaf45a9
  5. 2mo ago Changed · -26 lines · +413 tokens per session 95c574e452bb
  6. 2mo ago Changed · +1 lines · +190 tokens per session 330b2519679a
  7. 2mo ago Changed · +2 lines · +152 tokens per session 026623c1e0ad
  8. 3mo ago First seen · 89 lines · 1,694 tokens per session scan A f70eeb805f01

Subscribe to this mod's changes

workers-config is a cursor rule published in the GitHub repository louisbrulenaudet/monorepo-template (19 stars, last pushed 8d ago), licensed Apache-2.0. It adds 2,712 tokens to every session, about $0.0108 per session on Opus 5.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-08-30.

Related

workers-config compared with cursor rules from other repositories

workers-config next to 6 cursor rules from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
workers-configlouisbrulenaudet/monorepo-templateCursor rule198d agoApache-2.0A2,712Cursor
cloudflare-workers-autousrrname/cursorrulesCursor rule117mo agoISCA0Cursor
cloudflare-workers-hono-autousrrname/cursorrulesCursor rule117mo agoISCA0Cursor
ankra-cliPatrickJS/awesome-cursorrulesCursor rule41k6mo agoCC0-1.0A1,574Cursor
paperfitOpenRaiser/PaperFitCursor rule33726d agoMITA0Cursor
swift-argument-parsersteipete/agent-rulesCursor rule5.7k7mo agoMITA0Cursor
release-version-bump-autousrrname/cursorrulesCursor rule117mo agoISCA67Cursor