---
title: "workers-best-practices skill: write and review Cloudflare Workers"
canonical_url: https://cookiesforai.app/skills/cloudflare/workers-best-practices
last_updated: 2026-10-02T03:01:13+02:00
type: skill
summary: "workers-best-practices is Cloudflare's agent skill for writing, reviewing and configuring production Cloudflare Workers, built around a table of anti-patterns to flag and current docs over memorized APIs."
install: "npx skills add cloudflare/skills --skill workers-best-practices"
related:
  - "https://cookiesforai.app/skills/microsoft/azure-deploy"
  - "https://cookiesforai.app/skills/microsoft/azure-diagnostics"
  - "https://cookiesforai.app/skills/vercel-labs/deploy-to-vercel"
  - "https://cookiesforai.app/skills/vercel-labs/vercel-cli-with-tokens"
  - "https://cookiesforai.app/skills/cloudflare/wrangler"
---

# Workers best practices

workers-best-practices is Cloudflare's agent skill for writing, reviewing and configuring production Cloudflare Workers, built around a table of anti-patterns to flag and current docs over memorized APIs.

| Fact | Value |
|---|---|
| Publisher | Cloudflare (official, own GitHub account) |
| Source | https://github.com/cloudflare/skills/tree/HEAD/skills/workers-best-practices |
| License | Apache-2.0 |
| Repository stars | 2,965 on 2026-10-02 |
| Skill name | workers-best-practices |
| Category | Cloud and deployment |
| Skill last changed | 2026-10-01 |
| Page updated | 2026-10-02 |
| Facts checked | 2026-10-02 |

## Install

Install this skill with the skills CLI:

```
npx skills add cloudflare/skills --skill workers-best-practices
```

Or, in Claude Code, add Cloudflare's plugin marketplace:

```
/plugin marketplace add cloudflare/skills
```

Then install the cloudflare plugin (all 16 skills plus Cloudflare's MCP server):

```
/plugin install cloudflare@cloudflare
```

Or, in Codex, add the same marketplace from your terminal:

```
codex plugin marketplace add cloudflare/skills
```

Then install the cloudflare plugin and start a new Codex session:

```
codex plugin add cloudflare@cloudflare
```

In VS Code with GitHub Copilot, Cloudflare's README says to enable chat.plugins.enabled, run Chat: Install Plugin From Source, and enter https://github.com/cloudflare/skills. In Cursor, install it from the Cursor Marketplace.

## Ask your coding agent

A skill can include scripts that run on your computer, so read its source first: https://github.com/cloudflare/skills/tree/HEAD/skills/workers-best-practices

```text
Install the agent skill workers-best-practices from github.com/cloudflare/skills.
```

## What it does

workers-best-practices is an agent skill from Cloudflare that loads when an agent writes, reviews or configures a Cloudflare Worker. Its first instruction is that the agent's built-in knowledge of Workers APIs may be out of date, so it should first look at what the project actually uses (package versions, the generated types and the compatibility settings in the Wrangler config) and fetch Cloudflare's documentation before stating facts about APIs, limits or runtime behavior.

The core of workers-best-practices is a list of 15 anti-patterns with the fix for each. Examples: buffering an unbounded response body instead of streaming it, Math.random for security tokens, background work not tied to ctx.waitUntil, request state kept in module-level variables, hand-written Env types instead of wrangler types, comparing secrets with plain string equality, and calling the REST API when a binding exists.

The skill also asks for a current compatibility date on new Workers and for Workers Logs and Traces to be switched on in production, noting that traces need their own setting. Three reference files cover configuration and observability, runtime patterns, and platform API checks. Durable Objects and Wrangler commands are handed to their own skills.

## When to use it

- You want a code review of a Worker before it goes to production.
- Your Worker runs out of memory or loses background work after the response.
- You are starting a new Worker and want bindings, types and observability set up right.
- An agent keeps writing Workers code from an outdated memory of the API.

## When to pick something else

- Running Wrangler commands, deploying or managing KV, R2 and D1: use the wrangler skill from the same repository.

## Which agents it works in

Cloudflare documents it for Claude Code, Codex, GitHub Copilot in VS Code, Cursor, OpenCode, Pi. The open skills CLI also installs it into 78 agents (listed with the CLI on 2026-10-01).

## License

Apache-2.0.

## Related

### Related skills for cloud and deployment

- [Azure deploy](https://cookiesforai.app/skills/microsoft/azure-deploy): azure-deploy is Microsoft's agent skill for deploying an already prepared and validated app to Azure with azd, Bicep or Terraform, with error recovery, role checks and verified https endpoints at the end.
- [Azure diagnostics](https://cookiesforai.app/skills/microsoft/azure-diagnostics): azure-diagnostics is Microsoft's agent skill for debugging Azure production problems with AppLens, Azure Monitor and resource health, with guides for App Service, Functions, Container Apps, AKS, VMs and messaging.
- [Deploy to Vercel](https://cookiesforai.app/skills/vercel-labs/deploy-to-vercel): Deploy to Vercel is Vercel's agent skill for getting a project live: the agent checks how your project is set up, picks a deploy method and returns a preview link unless you ask for production.
- [Vercel CLI with Tokens](https://cookiesforai.app/skills/vercel-labs/vercel-cli-with-tokens): Vercel CLI with Tokens is Vercel's agent skill for running the Vercel CLI with an access token instead of vercel login: deploys, environment variables, logs and domains.

### More from Cloudflare

- [Wrangler](https://cookiesforai.app/skills/cloudflare/wrangler): wrangler is Cloudflare's agent skill for running and troubleshooting the Wrangler CLI: configuring Worker projects, local development, Previews, secrets, deployments, rollbacks and Cloudflare resources such as KV, R2 and D1.

