durable-objects

Create and review Cloudflare Durable Objects with SQLite storage and migrations.

Updated Apr 14, 2026
One-click install
npx skills add https://github.com/dallay/opencode-docker --skill durable-objects-dallay
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: durable-objects
Source: https://github.com/dallay/opencode-docker/tree/main/config/skills/durable-objects
Command: npx skills add https://github.com/dallay/opencode-docker --skill durable-objects-dallay

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Durable Object design and review is often error-prone and can lead to bottlenecks, data loss, or subtle concurrency bugs when deployed at the edge. This Skill guides developers to model coordination atoms correctly, configure Durable Object bindings and migrations, and apply safe storage and concurrency patterns so stateful edge services remain consistent and scalable.

Core Features & Use Cases

  • Design guidance for modeling one Durable Object per coordination atom (chat room, game session, tenant) and for parent-child relationships.
  • Storage & migrations recommendations for using SQLite storage, creating migration tables, and ensuring atomic schema upgrades.
  • Concurrency & reliability rules for blockConcurrencyWhile usage, write coalescing, RPC method design, alarm scheduling, and WebSocket handling.
  • Testing & integration patterns for Vitest, runInDurableObject utilities, and wrangler configuration for deployments.

Quick Start

Use the durable-objects skill to scaffold a Durable Object class, produce the corresponding wrangler bindings and migration entries, and generate a Vitest test that verifies storage and alarm behavior.

Frequently Asked Questions about durable-objects

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

FAQPage Schema
How do I create a stateful Cloudflare Worker using Durable Objects for user sessions?

To create stateful Cloudflare Workers, model one Durable Object per coordination atom like a chat room or game session, configure wrangler bindings, and use deterministic routing via getByName to manage stateful edge sessions reliably.

What is the best way to handle concurrency and data consistency in Cloudflare Durable Objects?

Concurrency in Cloudflare Durable Objects is handled safely by using blockConcurrencyWhile for initialization and applying write coalescing patterns, ensuring your edge services remain consistent and scalable without subtle race conditions.

How do I set up SQLite-backed storage and atomic migrations for Cloudflare Durable Objects?

Configure SQLite-backed storage for Cloudflare Durable Objects by creating migration tables and applying atomic schema upgrades, ensuring data integrity and safe stateful coordination at the edge during deployments.

Can I use Vitest to test Cloudflare Durable Objects alarms and WebSocket handling?

Yes, you can test Cloudflare Durable Objects using Vitest and runInDurableObject utilities to verify storage behavior, alarm scheduling, and WebSocket handling, ensuring your stateful edge services operate correctly before deployment.

Why does my Durable Object lose data or cause bottlenecks at the edge?

Durable Objects lose data or cause edge bottlenecks when coordination atoms are modeled incorrectly or storage patterns bypass atomic SQLite migrations, requiring strict blockConcurrencyWhile usage and proper RPC method design to prevent concurrency bugs.

Do I need wrangler to configure Durable Object bindings and migrations?

Yes, you need wrangler to configure Durable Object bindings and manage migration entries, which establishes the deterministic routing and SQLite storage required for deploying reliable stateful Cloudflare Workers.