Cloudflare's official platform skill — Workers, Pages, storage, AI, networking, security, and IaC in one reference.
Workers Best Practices Skill
Production review rules for Cloudflare Workers — compatibility dates, observability wiring, and the runtime anti-patterns that only bite at the edge.
Install
Other ways to install
About
- Anti-pattern table pairing each mistake with its runtime consequence
- Catches the traces flag that the top-level observability setting misses
- Keeps compatibility_date current for new and existing Workers
- Retrieval-first: verifies APIs and limits against live docs, not memory
Workers code that looks correct in review can still fail in production, because the failure modes are runtime-specific: a buffered response body that exhausts an isolate's memory, async work started but never awaited, a compatibility date frozen years in the past. This official Cloudflare skill is the checklist for writing, reviewing and configuring Workers meant to carry real traffic.
It opens with a stance rather than a rule: prefer retrieval over pre-training. The project's installed package versions, generated types and Wrangler compatibility settings are the baseline for existing code, and claims about APIs, limits and runtime behaviour are verified against current Cloudflare documentation instead of recalled. Three reference files carry the detail — configuration and observability, runtime patterns, and platform API checks — and the skill directs the agent to read only the one the task needs.
Two operational defaults are called out. Compatibility dates should be current, set to today's date for new Workers and reviewed periodically for existing ones against the flags they already run under. Observability should be switched on before production: both observability.enabled and observability.traces.enabled, since the top-level setting alone does not turn on traces — a detail that silently costs teams their tracing.
The anti-pattern table is where the skill earns its place in a code review. Unbounded await response.text() buffering should be streaming. Hardcoded secrets belong in Wrangler secrets. Math.random() for security-sensitive tokens or IDs should be crypto.randomUUID() or crypto.getRandomValues(). Each entry pairs the mistake with its consequence and the preferred pattern, so the agent can flag it with a reason attached. Apache-2.0, and the longest-running skill in Cloudflare's collection.
SKILL.md
The instructions your agent loads, as published by Cloudflare.
Related Skills
See all Workers Best Practices alternativesSkill: Cloudflare Email Service
by Cloudflare
Wire up Cloudflare Email Sending and Email Routing — the send_email binding, the inbound email() handler, and the deliverability setup that keeps mail out of spam.
Skill: Turnstile Spin
by Cloudflare
Turns “set up Turnstile” into a working end-to-end bot check — widget, frontend snippets, canonical server-side siteverify, and a real validation pass before it reports success.
Skill: Cloudflare Agents SDK
by Cloudflare
Build stateful AI agents on Cloudflare Workers — durable state, scheduling, RPC, WebSockets, and MCP servers.