cloudflare avatar

Durable Objects

A solid implementation guide for Cloudflare Durable Objects that actually gets the patterns right. Covers the full lifecycle from wrangler configuration and SQLite migrations to RPC methods, alarms, and WebSocket handling. The anti-patterns section alone will save you from common mistakes like single global DOs or blocking concurrency on every request. Includes proper Vitest testing setup and emphasizes retrieving from current Cloudflare docs over outdated knowledge. If you're building anything stateful on Workers like chat rooms, multiplayer games, or booking systems, this handles the coordination primitives and storage patterns you need.

skills.sh installs
123.3K
GitHub stars
3.3K
last updated
Aug 21, 2026

Install

$ npx -y skills add cloudflare/skills --skill durable-objects --agent claude-code

Installs into .claude/skills of the current project.

Files

Durable Objects

Build stateful, coordinated applications on Cloudflare's edge using Durable Objects.

Retrieval Sources

Your knowledge of Durable Objects APIs and configuration may be outdated. Prefer retrieval over pre-training for any Durable Objects task.

ResourceURL
Docshttps://developers.cloudflare.com/durable-objects/index.md
API Referencehttps://developers.cloudflare.com/durable-objects/api/index.md
Best Practiceshttps://developers.cloudflare.com/durable-objects/best-practices/index.md
Exampleshttps://developers.cloudflare.com/durable-objects/examples/index.md
Roles and permissionshttps://developers.cloudflare.com/workers/authorization/durable-objects/index.md

Fetch the relevant doc page when implementing features.

When to Use

  • Creating new Durable Object classes for stateful coordination
  • Implementing RPC methods, alarms, or WebSocket handlers
  • Reviewing existing DO code for best practices
  • Configuring wrangler.jsonc/toml for DO bindings and migrations
  • Writing tests with Cloudflare’s Vitest integration
  • Designing sharding strategies and parent-child relationships

Sponsors

Details

Repository
github.com/cloudflare/skills
Categories
Testing & QA, Git & Pull Requests, Documentation, Code Review & Quality, Cloud & Infrastructure, Databases

More from cloudflare/skills

All 17
1vyralcontent avatarviral-instagram-reelsvyralcontent/content-skillsPlan, write, and diagnose Instagram Reels that earn cold-audience reach. Use whenever someone wants a reels script or reels hook for a specific Reel, is debuggi123.3Kskills.sh installs
2solana-foundation avatarsolana-devsolana-foundation/solana-dev-skillUse when user asks to "build a Solana dapp", "write an Anchor program", "create a token", "debug Solana errors", "set up wallet connection", "test my Solana pro108.9Kskills.sh installs
3coreyhaines31 avataranalyticscoreyhaines31/marketingskillsWhen the user wants to set up, improve, or audit analytics tracking and measurement. Also use when the user mentions "set up tracking," "GA4," "Google Analytics92.8Kskills.sh installs
4convex avatarconvex-backupconvex/agent-skillsSet up Convex backups and run a restore DRILL that proves recovery — snapshot, restore into a throwaway preview, assert the data came back — plus a schedule mat41Kskills.sh installs
5convex avatarconvex-verifyconvex/agent-skillsProve a Convex feature works — seed, drive as multiple mocked users via convex-test, assert behavior including the negative authz cases (wrong user refused, dat41Kskills.sh installs
6samber avatargolang-stretchr-testifysamber/cc-skills-golangComprehensive guide to stretchr/testify for Golang testing. Covers assert, require, mock, and suite packages in depth. Use when writing tests with testify, crea40.9Kskills.sh installs