cloudflare-workers-hono-auto

Coding rules for Cloudflare Workers, which are small programs that run on Cloudflare's network, using Hono, a web framework for routing requests.

In plain words
What is it for?
Building and organising Hono-based Cloudflare Worker applications with typed routes and environment bindings.
Why use it?
It gives the agent consistent patterns for routes, middleware, TypeScript types, project structure, and Cloudflare settings.

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-hono-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 3,287 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 $0.00000 $0.03287
Opus 5 $0.00000 $0.01643
Sonnet 5 $0.00000 $0.00657
Haiku 4.5 $0.00000 $0.00329

Measured yesterday against content hash 82146ec01649, 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-hono-auto 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 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.

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/standards/cloudflare-workers-hono-auto.mdc · 498 lines

How it starts

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

Cloudflare Workers with Hono Best Practices

Enforces best practices for developing Cloudflare Workers using the Hono framework, including proper routing patterns, application structure, and TypeScript usage.

Critical Rules

  • Workers MUST use Hono framework for routing and middleware
  • Workers MUST avoid creating "Ruby on Rails-like Controllers" when possible
  • Workers MUST write handlers directly after path definitions for proper type inference
  • Workers MUST use app.route() for larger applications instead of controllers
  • Workers MUST use factory.createHandlers() if controller-like patterns are needed
  • Workers MUST use proper TypeScript types with Hono Context
  • Workers MUST separate route files for different endpoints in larger applications
  • Workers MUST use proper Hono middleware patterns
  • Workers MUST integrate properly with Cloudflare Workers environment bindings
  • Workers MUST use wrangler.jsonc configuration with Hono setup
      // 😃 Do this instead
      app.get('/books', (c) => {
        return c.json('list books')
      })
      ```

examples:

  • input: | const booksList = (c: Context) => { return c.json('list books') } app.get('/books', booksList) output: | app.get('/books', (c) => { return c.json('list books') }) metadata: priority: high version: 1.0

Read the full file on GitHub · 498 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 · 498 lines · 3,287 tokens per session scan A 82146ec01649

Subscribe to this mod's changes

cloudflare-workers-hono-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 3,287 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-08-31.