durable-objects

Coordinate stateful chat rooms and game sessions with Cloudflare Durable Objects.

5|1|Updated Feb 3, 2026
One-click install
npx skills add https://github.com/charl-kruger/cf-agents --skill durable-objects-charl-kruger
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: durable-objects
Source: https://github.com/charl-kruger/cf-agents/tree/main/.agents/skills/durable-objects
Command: npx skills add https://github.com/charl-kruger/cf-agents --skill durable-objects-charl-kruger

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Solves stateful coordination challenges with Cloudflare Durable Objects.

Core Features & Use Cases

  • One DO per coordination unit (chat rooms, game sessions, user scopes) to ensure strong consistency and isolation.
  • Supports RPC-style methods, alarms, WebSockets, and SQLite storage, with Wrangler configuration and Vitest-based testing.
  • Quick-start guidance for integrating Durable Objects with Wrangler and typical development workflows.

Quick Start

Use the Durable Objects feature to model a chat room or game session with a DO bound in Wrangler, initialize storage, and test with Vitest.

Frequently Asked Questions about durable-objects

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I manage stateful coordination in Cloudflare Workers for real-time applications?

Stateful coordination in Cloudflare Workers is managed by modeling each coordination unit as a Durable Object, ensuring strong consistency and isolation for chat rooms or game sessions using SQLite storage and WebSockets.

What is the best way to test Cloudflare Durable Objects locally with Vitest?

Testing Cloudflare Durable Objects locally involves configuring Wrangler bindings and running Vitest workflows to validate RPC methods, alarm triggers, and storage API interactions before deployment.

When do I need Cloudflare Durable Objects instead of standard Workers?

You need Cloudflare Durable Objects when your application requires strong consistency, isolated state per coordination unit like user scopes, or persistent storage via SQLite, which standard stateless Workers cannot provide.

Can I use WebSockets and RPC methods together within a single Durable Object?

Yes, a single Durable Object can handle both WebSockets and RPC methods simultaneously, allowing real-time multiplayer coordination and direct function calls within the same isolated instance.

How do I configure Wrangler migrations and bindings for Cloudflare Durable Objects?

Configuring Wrangler for Durable Objects requires defining DO bindings in your configuration file and setting up migration scripts to handle SQLite storage initialization and state updates correctly.

Do I need to understand SQLite storage APIs to use Cloudflare Durable Objects?

Yes, understanding SQLite storage APIs is required to persist and query state within Durable Objects, as they provide the underlying storage mechanism for maintaining data consistency across sessions.