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.
npx agentmods add rules/d-padmanabhan/agent-engineering-handbook/401-cloudflare-workersgit clone --depth 1 https://github.com/d-padmanabhan/agent-engineering-handbookWrote 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.
[](https://agentmods.dev/rules/d-padmanabhan/agent-engineering-handbook/401-cloudflare-workers)<a href="https://agentmods.dev/rules/d-padmanabhan/agent-engineering-handbook/401-cloudflare-workers"><img src="https://agentmods.dev/badge/rules/d-padmanabhan/agent-engineering-handbook/401-cloudflare-workers.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00091 | $0.04185 |
| Opus 5 | $0.00046 | $0.02093 |
| Sonnet 5 | $0.00018 | $0.00837 |
| Haiku 4.5 | $0.00009 | $0.00419 |
Grade A, and why
401-cloudflare-workers 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 5d 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.
- **Module Workers** (`export default { fetch(req, env, ctx) { ... } }`) - the modern model. Bindings come through `env`; lifecycle through `ctx`; supports TypeScript natively; supports RPC via `WorkerEntrypoint`; suppor How it starts
The opening of the file, as written. The whole thing — 354 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Cloudflare Workers (TypeScript, Module Workers, typed bindings)
Audience: anyone authoring or reviewing a Cloudflare Worker - default-export Worker, named entrypoint, Durable Object, Workflow, Queue consumer, Cron Trigger, Email Worker, or Pages Function.
Relationship to other rules:
400-cloudflare.mdc- broad Cloudflare platform playbook (Workers + Access + AOP + WAF + Workflows + etc.). This file is the file-scoped Worker-authoring tightening.405-cloudflare-waf-rules.mdc- file-scoped WAF rule playbook. Same pattern (file-scoped tactical rule).225-javascript-typescript.mdc- general JavaScript and TypeScript gates. This file layers Workers-specific TypeScript rules on top.320-api-design.mdc- REST API design. Applies when the Worker exposes HTTP endpoints.325-networking.mdc- HTTP / gRPC client reuse, idle timeouts. Workers have specific subrequest semantics covered here.
Companion skill: cloudflare-workers-author walks through the bootstrap, bindings choice, routing, testing, and deployment workflow. This rule is the gate; the skill is the workflow through the gate.
[!IMPORTANT] The non-negotiables below are file-scoped. They auto-load when editing
wrangler.jsonc(or common Worker entry-point names). If you're authoring a Worker in an unusual location, invoke this rule explicitly or trigger topic discovery by mentioning Cloudflare Workers in the conversation.
Non-negotiables
NN-1: Module Workers syntax only (Service Worker syntax is forbidden in new code)
Cloudflare Workers has two execution models:
- Module Workers (
export default { fetch(req, env, ctx) { ... } }) - the modern model. Bindings come throughenv; lifecycle throughctx; supports TypeScript natively; supports RPC viaWorkerEntrypoint; supports Durable Objects, Workflows, RPC, Queues, Cron, Email, etc. - Service Worker (
addEventListener("fetch", event => { ... })) - the original model. Deprecated for new development. Bindings come through global scope; no RPC; no named entrypoints; nocloudflare:workersmodule imports.
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.
- 5d ago First seen · 354 lines · 91 tokens per session scan A de27cac88f7c
401-cloudflare-workers is a cursor rule published in the GitHub repository d-padmanabhan/agent-engineering-handbook (16 stars, last pushed 5d ago), licensed MIT. It adds 91 tokens to every session and 4,185 once invoked, about $0.0005 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-30.
Other cursor rules, from other repositories
vue-typescript-patterns
Cursor rule "vue-typescript-patterns" from soaring-xiongkulu/easyaiot, covering vue3 + typescript 开发规范, vue 组件规范, vue sfc 组件规范, typescript 规范 and 状态管理.
angular-typescript-cursorrules-prompt-file
Cursor rules for Angular development with TypeScript integration.
nextjs-typescript-app-cursorrules-prompt-file
Cursor rules for Next.js development with TypeScript integration.
ts
Cursor rule "ts" from un-pany/v3-admin-vite, covering ts 开发规范, 类型, 命名, 代码组织 and 错误处理.
platform-pattern-2-filesystem-operations
Cursor rule "platform-pattern-2-filesystem-operations" from PaulJPhilp/EffectPatterns, covering platform pattern 2: filesystem operations and example.
define-a-type-safe-configuration-schema
Cursor rule "define-a-type-safe-configuration-schema" from PaulJPhilp/EffectPatterns, covering define a type-safe configuration schema and example.