cloudflare-durable-objects

Generate Cloudflare Durable Objects templates with SQLite or KV storage.

961|99|Updated Oct 20, 2025
One-click install
npx skills add https://github.com/jezweb/claude-skills --skill cloudflare-durable-objects
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cloudflare-durable-objects
Source: https://github.com/jezweb/claude-skills/tree/main/skills/cloudflare-durable-objects
Command: npx skills add https://github.com/jezweb/claude-skills --skill cloudflare-durable-objects

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill eliminates the complexity of building and managing stateful, real-time applications by providing complete Cloudflare Durable Objects expertise, saving you thousands of tokens and preventing costly errors.

Core Features & Use Cases

  • Real-Time Coordination: Create chat rooms, multiplayer games, and collaborative apps with WebSocket hibernation.
  • Persistent State Management: Implement SQLite and key-value storage with atomic operations.
  • Use Case: Imagine you need to build a WebSocket server that can handle thousands of connections while maintaining consistent state across hibernation cycles.

Quick Start

Create a new Durable Object class for a counter that increments with each request, using the SQLite backend for reliable storage.

Frequently Asked Questions about cloudflare-durable-objects

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

FAQPage Schema
How do I build a real-time WebSocket server with persistent state?

Use Cloudflare Durable Objects to create stateful WebSocket servers that maintain consistent state across hibernation cycles. Durable Objects provide coordinated real-time communication with built-in storage (SQLite or KV) for session and message persistence, eliminating manual state synchronization.

Can I use Durable Objects for multiplayer games and collaborative apps?

Yes. Durable Objects excel at real-time coordination for multiplayer games, chat rooms, and collaborative applications. Each DO instance acts as a single source of truth, handling WebSocket connections, enforcing atomic operations, and managing game state or document mutations reliably.

What's the best way to handle state migrations and error recovery in Durable Objects?

Durable Objects support idempotent retry strategies, migrations, and error handling patterns built into the RPC and fetch execution model. Use SQLite transactions and KV atomic operations to ensure state consistency, and implement proper alarm and hibernation logic to recover from failures gracefully.

Do Durable Objects work with both SQLite and key-value storage?

Durable Objects support both SQLite for structured, relational state and KV storage for simple key-value persistence. Choose SQLite for complex state requiring transactions and queries, or KV for lightweight, fast state access depending on your application's storage needs.

How do I export and deploy a Durable Object class correctly?

Export your DO class with proper module syntax and configuration for Cloudflare Workers. The Skill provides ready-to-deploy templates that handle correct class definitions, RPC patterns, fetch handlers, and Worker bindings so your stateful application deploys without common export or binding errors.

When should I use Durable Objects instead of traditional databases?

Use Durable Objects for real-time, low-latency coordination requiring immediate state consistency and WebSocket integration. Traditional databases suit offline-first or high-volume analytics; Durable Objects optimize for live sessions, active users, and stateful request handling at edge scale.