# Workers Best Practices

Cloudflare Workers best practices for production applications.

- Repository: https://github.com/cloudflare/skills (3246 stars)
- Category: DevOps
- License: Apache-2.0
- Last updated: 2026-10-31
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add cloudflare/skills --skill workers-best-practices -g -a claude-code -y`
Codex: `npx skills add cloudflare/skills --skill workers-best-practices -g -a codex -y`
Cursor: `npx skills add cloudflare/skills --skill workers-best-practices -g -a cursor -y`
Gemini CLI: `npx skills add cloudflare/skills --skill workers-best-practices -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add cloudflare/skills`

## Description

Cloudflare Workers best practices for production applications. Use when writing, reviewing, or configuring Workers.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

Your knowledge of Cloudflare Workers APIs, types, and configuration may be outdated. **Prefer retrieval over pre-training** when writing or reviewing Workers code.

Use the project's installed versions, generated types, and Wrangler compatibility settings as the baseline for existing code. Retrieve relevant Cloudflare documentation to verify API, configuration, runtime behavior, and limit claims.

## References

Read the sections relevant to the task:

| Reference | When to use it |
|-----------|----------------|
| [Configuration and observability](references/configuration.md) | Compatibility dates, bindings, generated types, secrets, logs, and traces |
| [Runtime patterns](references/runtime-patterns.md) | Streaming, promise lifetime, request state, service calls, security, and runtime tests |
| [Platform API checks](references/platform-apis.md) | Handler signatures, platform classes, binding access, and serialization |

For missing evidence, consult [Workers best practices](https://developers.cloudflare.com/workers/best-practices/workers-best-practices/index.md) or find the affected product in the [Cloudflare docs directory](https://developers.cloudflare.com/directory/index.md). Use the installed Wrangler schema for config fields. A newer type package does not supersede the project's configured target.

## Keep Compatibility Dates Current

Use today's date for new Workers. Encourage periodic updates for existing Workers, reviewing compatibility changes and running relevant tests. Assess existing behavior against its configured date and flags; see [compatibility guidance](references/configuration.md#keep-compatibility_date-current).

## Enable Observability

The rest: https://github.com/cloudflare/skills/blob/HEAD/skills/workers-best-practices/SKILL.md
