Official agent skill

Workers Best Practices

by cloudflare in cloudflare/skills

Cloudflare Workers best practices for production applications.

OfficialApache-2.0Auto-check passedDevOps & Cloud

Install Workers Best Practices

skills CLI
$ npx skills add cloudflare/skills --skill workers-best-practices -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install cloudflare/skills workers-best-practices --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/cloudflare/skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/workers-best-practices .claude/skills/workers-best-practices && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
workers-best-practices
GitHub stars
3k
Used in
2 other repos
Token cost
~1.4k tokens
SKILL.md length
572 words
Files
4 (incl. references)
Skills in repo
16
Repo updated
First seen
Licence
Apache-2.0

At a glance

Cloudflare Workers best practices for production applications.

  • Configuring Workers
  • SKILL.md covers References, Keep Compatibility Dates Current, Enable Observability and Anti-Patterns to Flag, plus 2 more sections
  • Calls wrangler

What it does

Workers Best Practices is an agent skill from cloudflare/skills, published by the product's own GitHub organization. Cloudflare Workers best practices for production applications. Use when writing, reviewing, or configuring Workers.

Its SKILL.md is about 1.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including reference files (for example `references/configuration.md`, `references/platform-apis.md` and `references/runtime-patterns.md`).

It sits in DevOps & Cloud. It works with Cloudflare Workers and Cloudflare. The repository describes itself as: Skills for teaching agents how to build on Cloudflare. The licence is Apache-2.0.

When your agent uses it

  • Configuring Workers

Example prompts

  • “/workers-best-practices”

What it can do on your machine

Read from SKILL.md and the folder at commit 41e0d19. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • wrangler

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • developers.cloudflare.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Workers Best Practices loads about 1.4k tokens when it runs, and up to ~7.2k if it reads all its reference files. Until then it costs about 35 tokens; SKILL.md has 572 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~35
When it runs · the whole SKILL.md, loaded when a task matches
~1.4k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~7.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from cloudflare/skills at commit 41e0d19, republished under its Apache-2.0 licence (© cloudflare). 572 words, ~1,387 tokens.

Download SKILL.mdSave it as .claude/skills/workers-best-practices/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
workers-best-practices
description
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

Enable Workers Logs and Traces when creating or preparing a Worker for production. Set observability.enabled and observability.traces.enabled to true; the top-level setting alone does not enable traces. Use structured JSON logging and configure sampling for the workload. During reviews, flag missing logs or traces. See the configuration example.

Anti-Patterns to Flag

Anti-patternConsequence and preferred pattern
await response.text() or similar buffering on unbounded dataCan exhaust Worker memory; stream large or unbounded bodies.
Hardcoded secrets in source or configLeaks credentials through version control; use Wrangler secrets.
Math.random() for security-sensitive tokens or IDsPredictable values; use crypto.randomUUID() or crypto.getRandomValues().
Async work started without awaiting, returning, or attaching it to ctx.waitUntil()Work can be dropped and errors missed; tie it to the request or background-work lifetime.
Module-level mutable request stateLeaks data across requests and can cause I/O ownership errors; pass request state explicitly.
Cloudflare REST API calls for operations available through Worker bindingsAdds network and authentication overhead; use the available binding.
ctx.passThroughOnException() used as general error handlingCan conceal Worker failures by forwarding to the origin; use explicit error handling and structured error responses.
Hand-written Env that duplicates Wrangler bindingsCan drift from configuration; generate binding types with wrangler types.
Direct string comparison of secret valuesCan expose timing differences; use the Web Crypto comparison pattern.
Destructuring ctx methods, such as const { waitUntil } = ctxLoses the receiver; call ctx.waitUntil(...).
any on Env or handler parametersHides binding and handler contract errors; use the project's generated and platform types.
as unknown as T to force a platform type matchHides incompatibilities; fix the underlying contract.
implements used in place of extending a platform base classDoes not inherit runtime behavior, this.ctx, or this.env; use the appropriate base class.
Unbound env.X in a platform class methodBindings are available through this.env.X; see binding access patterns.
Applying one serialization rule across Queues, Workflow steps, storage, and WebSocketsCan reject valid payloads or accept unsupported ones; check the specific API and encoding.
Show full SKILL.md (69 more words)Show less

Validation

Use the project's existing checks for affected Workers behavior: type-check binding or handler contract changes, and run relevant runtime tests for behavior changes. Preserve required repository checks; a narrow edit does not require a full Workers audit.

Scope

This skill covers Workers-specific best practices and code review. For related topics:

  • Durable Objects: load the durable-objects skill
  • Workflows: see Rules of Workflows
  • Wrangler CLI commands: load the wrangler skill

© cloudflare, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 3 other files (references) in skills/workers-best-practices of cloudflare/skills.

  • SKILL.md
  • references/configuration.md
  • references/platform-apis.md
  • references/runtime-patterns.md

Open the folder on GitHubat commit 41e0d19

Used in 2 other repositories

We found 2 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 2 other GitHub owners. This page covers the copy in cloudflare/skills, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Workers Best Practices next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Workers Best Practices compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Workers Best Practices this skillcloudflare/skills3k2 repos~1.4kAutomated safety check: PassApache-2.0
Cloudflarehodgef/apiker1277 repos~2.2kAutomated safety check: PassMIT
Cloudflaredmmulroy/cloudflare-skill728—~1.6kAutomated safety check: PassMIT
Prepare Cloudflare Production DeploymentLubomirGeorgiev/cloudflare-workers-nextjs-saas-template786—~5.9kAutomated safety check: NotesMIT
Observability Triageevery-app/open-seo23k—~1.7kAutomated safety check: PassMIT
Workers Best Practiceshodgef/apiker1276 repos~1.8kAutomated safety check: PassMIT

Similar skills

  • Cloudflare

    hodgef/apiker

    Comprehensive Cloudflare platform skill covering Workers, Pages, storage (KV, D1, R2), AI (Workers AI, Vectorize, Agents SDK), feature flags (Flagship), networking (Tunnel, Spectrum), security (WAF…

    127 GitHub starsUsed in 7 repos~2.2k tokens
    DevOps & CloudAuto-check passed
  • Cloudflare

    dmmulroy/cloudflare-skill

    Comprehensive Cloudflare platform skill covering Workers, Pages, storage (KV, D1, R2), AI (Workers AI, Vectorize, Agents SDK), networking (Tunnel, Spectrum), security (WAF, DDoS), and…

    728 GitHub stars~1.6k tokensUpdated 8 mo ago
    DevOps & CloudAuto-check passed
  • Prepare Cloudflare Production Deployment

    LubomirGeorgiev/cloudflare-workers-nextjs-saas-template

    Source-of-truth runbook for preparing this Vinext Cloudflare Workers SaaS template for production deployment.

    786 GitHub stars~5.9k tokensUpdated today
    DevOps & CloudAuto-check: notes
  • Observability Triage

    every-app/open-seo

    Triage OpenSEO production errors in Cloudflare Workers Observability — verified query recipes, counting gotchas, and a known-noise filter list applied automatically.

    23k GitHub stars~1.7k tokensUpdated today
    DevOps & CloudAuto-check passed
  • Reviews and authors Cloudflare Workers code against production best practices.

    127 GitHub starsUsed in 6 repos~1.8k tokens
    DevOps & CloudAuto-check passed
  • Cloudflare Deploy

    mizchi/skills

    Deploy applications and infrastructure to Cloudflare with the cf CLI and typed cloudflare.config.ts.

    356 GitHub stars~2.9k tokensUpdated 5 days ago
    DevOps & CloudAuto-check: notes

More from cloudflare/skills

All 16 skills in this repo
  • Turnstile Spin

    cloudflare/skills

    Official

    Set up, repair, or migrate to Cloudflare Turnstile bot verification in an existing frontend and backend, including server-side Siteverify.

    3k GitHub starsUsed in 4 repos~7.2k tokens
    Auto-check: notes
  • Nextjs On Cloudflare

    cloudflare/skills

    Official

    Build, migrate, and deploy Next.js apps on Cloudflare Workers with vinext.

    3k GitHub starsUsed in 2 repos~678 tokens
    Auto-check passed
  • Agents SDK

    cloudflare/skills

    Official

    Build, debug, or review Cloudflare Agents SDK applications using the agents package.

    3k GitHub starsUsed in 2 repos~3k tokens
    Auto-check passed
  • Durable Objects

    cloudflare/skills

    Official

    Build, debug, or review Cloudflare Durable Objects code for persistent state and coordination.

    3k GitHub starsUsed in 2 repos~1.5k tokens
    Auto-check passed
  • Sandbox Next

    cloudflare/skills

    Official

    Build or maintain Cloudflare Sandbox apps on @cloudflare/sandbox@next (SDK 1.0 preview).

    3k GitHub starsUsed in 2 repos~1.7k tokens
    Auto-check passed
  • Cloudflare One Migrations

    cloudflare/skills

    Official

    Assess and plan migrations from existing VPN, SWG, or SASE platforms to Cloudflare One, including policy mapping, parity gaps, and rollout.

    3k GitHub starsUsed in 6 repos~3.1k tokens
    Auto-check passed

Categories

Questions about Workers Best Practices

What does Workers Best Practices do?

Cloudflare Workers best practices for production applications. Workers Best Practices is an agent skill from cloudflare/skills, published by the product's own GitHub organization. Cloudflare Workers best practices for production applications.

When should I use Workers Best Practices?

Workers Best Practices fits situations like: configuring Workers.

How do I install Workers Best Practices in Claude Code?

Run `npx skills add cloudflare/skills --skill workers-best-practices -a claude-code`. Or copy the skill folder (skills/workers-best-practices in cloudflare/skills) into .claude/skills/workers-best-practices in your project. Claude Code loads it when a task matches its description.

How do I install Workers Best Practices in Codex?

Run `npx skills add cloudflare/skills --skill workers-best-practices -a codex`. Or copy the skill folder (skills/workers-best-practices in cloudflare/skills) into .agents/skills/workers-best-practices in your project. Codex loads it when a task matches its description.

Can I use Workers Best Practices in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add cloudflare/skills --skill workers-best-practices -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/workers-best-practices, .gemini/skills/workers-best-practices, .github/skills/workers-best-practices and .opencode/skills/workers-best-practices in your project.

What does Workers Best Practices need to run?

Going by SKILL.md and its folder, Workers Best Practices needs the command-line tools its instructions call (wrangler).

Does Workers Best Practices access the network?

SKILL.md names 1 domain. As links in the text: developers.cloudflare.com. This is read from the text; nothing was executed.

Is Workers Best Practices safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Workers Best Practices use?

Workers Best Practices is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Workers Best Practices use?

About 1.4k tokens (SKILL.md is roughly 5.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 5.8k tokens, read only when the agent opens those files.

What are the alternatives to Workers Best Practices?

Skills that share tags, products or a category with Workers Best Practices: Cloudflare (hodgef/apiker, 127 stars), Cloudflare (dmmulroy/cloudflare-skill, 728 stars), Prepare Cloudflare Production Deployment (LubomirGeorgiev/cloudflare-workers-nextjs-saas-template, 786 stars) and Observability Triage (every-app/open-seo, 23k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Workers Best Practices?

cloudflare (a GitHub organization, an official publisher) maintains it in cloudflare/skills, which has 2,999 GitHub stars. The repository holds 16 skills in this directory. The repository was last updated on October 1, 2026.

Source: cloudflare/skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.