Engineering
durable-objects avatar

durable-objects

Create, debug, and optimize Cloudflare Durable Objects. Supports stateful coordination, RPC, SQLite storage, WebSocket handlers, and Vitest testing.

Introduction

The Durable Objects skill is a specialized assistant for building stateful, globally coordinated applications on the Cloudflare edge. It is designed for software engineers and systems architects who need to maintain strong consistency, handle persistent WebSocket connections, or manage per-entity storage for multiplayer games, collaborative tools, booking systems, and multi-tenant SaaS platforms. The skill prioritizes official documentation, architectural patterns, and performance best practices to ensure your stateful services are scalable, reliable, and performant.

  • Expert guidance on implementing Durable Object classes, including state management with SQLite, alarms for scheduled tasks, and transactional storage using blockConcurrencyWhile.

  • Support for RPC method definitions to allow seamless communication between Workers and your Durable Objects.

  • Configuration assistance for wrangler.jsonc or wrangler.toml, covering migrations, SQLite class initialization, and binding definitions.

  • Comprehensive testing strategies using @cloudflare/vitest-pool-workers to verify your logic, alarm triggers, and storage operations in simulated environments.

  • Architecture design advice, including sharding strategies, parent-child object relationships, and guidance on deterministic routing via getByName().

  • Use this skill when you need to transition from stateless Workers to stateful coordination, ensuring your implementation avoids common anti-patterns like global bottlenecks or improper storage concurrency.

  • Always prefer retrieval from the official Cloudflare Durable Objects API documentation over internal training data to ensure compatibility with the latest platform updates.

  • Inputs typically include your existing Worker or DO code, wrangler configuration files, or architecture requirements; outputs include optimized code blocks, refactoring suggestions, performance optimizations, and debugging steps.

  • Practical constraints include following the single-object-per-entity principle, avoiding long-running blockConcurrencyWhile calls that kill performance, and strictly managing alarm logic to prevent duplicate execution. Whether you are building real-time chat, collaborative documents, or game backends, this skill helps you build robust edge state.

Repository Stats

Stars
1,386
Forks
114
Open Issues
9
Language
Not provided
Default Branch
main
Sync Status
Idle
Last Synced
May 3, 2026, 09:20 AM
View on GitHub