Skills

Workers Best Practices

Cloudflare Workers best practices for production applications.

Install

npx skills add cloudflare/skills --skill workers-best-practices -g -a claude-code -y
Repository
cloudflare/skills3.2k
Category
DevOps
Updated
4d ago
License
Apache-2.0
Context cost
Mediumabout 1,518 tokens
Runs scripts
No, instructions only

What it does

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

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:

ReferenceWhen to use it
Configuration and observabilityCompatibility dates, bindings, generated types, secrets, logs, and traces
Runtime patternsStreaming, promise lifetime, request state, service calls, security, and runtime tests
Platform API checksHandler signatures, platform classes, binding access, and serialization

For missing evidence, consult Workers best practices or find the affected product in the Cloudflare docs directory. 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.

Enable Observability

Read the whole SKILL.md on GitHub

More in DevOps