workers-config

workers-config is a cursor rule for Cursor from louisbrulenaudet/monorepo-template. It costs 1,694 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/.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is "types": "wrangler types -c ./wrangler.jsonc -c ../worker-foo/wrangler.jsonc".

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

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/louisbrulenaudet/monorepo-template
agentmods
npx agentmods add rules/louisbrulenaudet/monorepo-template/workers-config

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 1,694 This file is loaded in full into every session.
When invoked 1,694 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.01694 $0.01694
Opus 5 $0.00847 $0.00847
Sonnet 5 $0.00339 $0.00339
Haiku 4.5 $0.00169 $0.00169

Measured 9d ago against content hash f70eeb805f01, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, 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 9d 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 · 89 lines

How it starts

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

Wrangler / Config Rules

wrangler.jsonc is the source of truth for a Worker's bindings, vars, and routes. Generated outputs must never be hand-edited (see guardrails.mdc):

  • worker-configuration.d.ts - generated by wrangler types and committed to git (Cloudflare: "We recommend you commit your generated types file for use in CI"). After changing bindings/vars in wrangler.jsonc, run pnpm types and commit the regenerated file in the same change. Never edit it by hand. pnpm run ci runs pnpm types:check (wrangler types --check), which fails when the committed file has drifted from wrangler.jsonc. Because it is tracked it is a normal Turborepo input, so check-types invalidates on it directly - no types task edge needed. It is excluded from OXC by ignorePatterns in .oxlintrc.json / .oxfmtrc.json, since .gitignore no longer covers it.

Required config

Every app wrangler.jsonc should include: $schema (../../node_modules/wrangler/config-schema.json from apps/*), a current compatibility_date (2026-08-04 or later so Node.js compatibility is on by default; do not add redundant nodejs_compat / nodejs_compat_v2 flags), send_metrics: false, root observability, and env.staging + env.production with traces enabled. Copy patterns from an existing app (worker-api, front-app) when scaffolding.

Secrets vs vars

  • Secrets never go in wrangler.jsonc vars, code, or logs. Local dev: .dev.vars (git-ignored; keep .dev.vars.example in sync). Deploy: wrangler secret put.
  • Non-secret config (API_ORIGIN, *_BASE_URL, ENVIRONMENT, CORS_ORIGINS) may be plain vars. VITE_* for the SPA is build-time and public (not a secret).
  • Declare required secret names with secrets.required in wrangler.jsonc when a Worker needs them - wrangler types emits typed env.* bindings without .dev.vars (CI-safe), wrangler dev allowlists .dev.vars keys, and deploy fails if remote secrets are missing.
  • Hand-declared bindings live in src/types/*.d.ts; generated ones come from pnpm types.

Read the full file on GitHub · 89 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. 9d 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 1,694 tokens to every session, about $0.0085 per session on Opus 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.