reviewer-cloudflare
Skill0 starsChanged 58 days agoMITView on GitHub
Review Cloudflare Workers projects: wrangler.toml or wrangler.json, the Worker entry and the modules it imports, D1 schemas and queries (.sql), and Worker tests. Use when reviewing changes to any of these, or when the user types /reviewer-cloudflare. Catches secrets in config, SQL built from strings, unvalidated request input, abuse-prone public write endpoints, wrong headers for compressed and wasm assets, the 25 MiB asset limit, caching mistakes, and per-request state in globals. Part of the reviewer bundle.
In this repository15 other files it gives its agents.
- ai-scaffoldingSkill
- comment-hygieneSkill
- microfrontendsSkill
- reviewer-dataSkill
- reviewer-docsSkill
- reviewer-godotSkill
- reviewer-pythonSkill
- reviewer-readabilitySkill
- reviewer-shellSkill
- reviewer-toolingSkill
- reviewer-unitySkill
- reviewer-webSkill
- reviewerSkill
- startup-scriptSkill
- typed-blocksSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 1 is distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 13
Read the wrangler config: main, compatibility_date, compatibility flags, routes and custom domains, assets, bindings (D1, KV, R2), and …
- Very specific: line 14
Run the Worker tests (node --test, vitest, a Miniflare harness).
- Very specific: line 20
No secrets in [vars] or committed files.
- Distinctive: line 35
Check the method and route.
- Very specific: line 44
Every query uses prepare(…).bind(…).
- Very specific: line 48
Read rows from .results, and handle an empty result.
- Very specific: line 54
Use Web Crypto (crypto.randomUUID, crypto.subtle), not Math.random, for ids and tokens.
- Very specific: line 75
Use the reviewer format: [severity] path:line — problem, then failure: (the concrete input, state or platform → wrong result) and fix: (the …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Cloudflare reviewer
Scope: wrangler.toml / wrangler.json*, the Worker entry (main) and every module it imports, D1 *.sql, and Worker tests. Browser code goes to reviewer-web, the deploy workflow to reviewer-tooling.
Before reviewing
- Read the wrangler config:
main,compatibility_date, compatibility flags, routes and custom domains, assets, bindings (D1, KV, R2), and per-environment overrides. - Run the Worker tests (
node --test,vitest, a Miniflare harness). Runwrangler deploy --dry-runonly if it needs no credentials.
Checklist
Config
- No secrets in
[vars]or committed files. Secrets come fromwrangler secret putor.dev.vars, and.dev.varsis gitignored. - Binding names match what the code reads (
env.DB). Each environment has its owndatabase_id. compatibility_dateis set. Node APIs need thenodejs_compatflag.workers_dev = falsewhen only the custom domain should serve the site. Routes and custom domains point at the right zone.
Static assets
- A single asset is limited to 25 MiB, which large
.wasmfiles exceed. Store them compressed and serve them from the Worker. - Returning a pre-compressed body needs
Content-EncodingplusencodeBody: "manual". Without it the client gets a double-encoded body. .wasmmust be served asapplication/wasm, or streaming compilation fails.- Cache rules: hashed files can be cached for long;
index.html, the service worker and manifests must revalidate. Otherwise users keep running an old build. - COOP/COEP headers only when the page really needs cross-origin isolation (threads). They break cross-origin resources that lack CORP.
Request handling
- Check the method and route. Unknown routes return 404 and wrong methods 405, not 500.
await request.json()throws on bad input. Return 400.- Validate every field at the boundary: type, range, length and allowed characters. For names shown to other players, also filter profanity.
- Public write endpoints (scores, leaderboards) need abuse limits: plausible-value checks, a server-issued run or nonce token, and rate limits. Anyone can call the endpoint without the game.
- CORS: no
Access-Control-Allow-Origin: *together with credentials. Answer theOPTIONSpreflight when it is needed. - Errors return a short JSON message. Never return stack traces, SQL or secrets.
D1 / SQL
- Every query uses
prepare(…).bind(…). SQL built by string interpolation is an injection hole. - Statements that must succeed together go in
db.batch([...]). - Reads have a
LIMIT. Columns used inWHEREandORDER BYon large tables are indexed. - Schema changes are additive migrations that existing data survives.
schema.sqlmatches what is applied. - Read rows from
.results, and handle an empty result.
Runtime
- Module-level variables persist between requests in the same isolate. Never keep per-request or per-user data there.
- Work after the response goes in
ctx.waitUntil(), or it may be cut off. - Use Web Crypto (
crypto.randomUUID,crypto.subtle), notMath.random, for ids and tokens.
Tests
- New endpoints and branches have tests, including rejected input.
Readability
Apply reviewer-readability to the same files (names, structure, dead code, and whether comments are true, needed and well-shaped), plus:
- The request router reads as a table: method and path to handler, one line each.
- JSDoc on exported handlers and helpers the project documents. Status codes and header names come from named constants when they repeat.
- Each non-obvious header or encoding choice (
encodeBody: "manual", a cache rule) has a one-line why.
Not findings
- Missing rate limits on read-only, cacheable endpoints with bounded output.
- A Global API Key or token scope set in CI secrets. That belongs to reviewer-tooling, and only when the workflow shows it.
Report
Use the reviewer format: [severity] path:line — problem, then failure: (the concrete input, state or platform → wrong result) and fix: (the smallest change). Most severe first. Prove each finding before reporting it, and say No findings with what you checked when there are none.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

