durable-objects

Develop stateful coordination logic with Cloudflare Durable Objects and SQLite.

Updated Mar 12, 2026
One-click install
npx skills add https://github.com/mpsuesser/workspace --skill durable-objects-mpsuesser
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: durable-objects
Source: https://github.com/mpsuesser/workspace/tree/main/dotconfig/pi/agent/skills/.deprecated/cloudflare/durable-objects
Command: npx skills add https://github.com/mpsuesser/workspace --skill durable-objects-mpsuesser

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It helps you design, implement, and review stateful, coordinated Cloudflare edge services that need reliable per-entity persistence and concurrency control.

Core Features & Use Cases

  • Durable Objects architecture guidance: Model coordination atoms (one DO per chat room/game/user/tenant) to avoid bottlenecks and ensure consistent state.
  • Implementation rules for storage, RPC, and alarms: Use SQLite storage, prefer RPC methods over fetch handlers, schedule idempotent alarms, and follow concurrency-safe patterns.
  • Wrangler configuration and testing workflow: Configure DO bindings and SQLite migrations, and test with @cloudflare/vitest-pool-workers, including unit, integration, and alarm verification.

Quick Start

Ask the AI to review your existing Durable Object design and produce a corrected plan for routing, SQLite migrations, RPC method structure, and how to test alarms and WebSocket behavior for your specific use case.

Frequently Asked Questions about durable-objects

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

FAQPage Schema
How do I build stateful coordination logic using Cloudflare Durable Objects?

Stateful coordination logic using Cloudflare Durable Objects is built by modeling coordination atoms like one DO per chat room or tenant, configuring wrangler bindings, implementing typed RPC methods, and validating behavior with Vitest worker pools.

What's the best way to structure SQLite storage and migrations for Cloudflare Durable Objects?

The best way to structure SQLite storage for Durable Objects is to write critical state to SQLite first before responding, configure migrations through wrangler, and follow concurrency-safe patterns to ensure reliable per-entity persistence.

How do I test Cloudflare Durable Objects alarms and WebSocket behavior?

You test Durable Objects alarms and WebSocket behavior using the @cloudflare/vitest-pool-workers package, which supports unit tests, integration tests, and alarm verification to validate stateful edge workflows.

When should I use blockConcurrencyWhile in a Durable Object?

You should use blockConcurrencyWhile only for initialization tasks in a Durable Object to prevent concurrent requests from interfering, ensuring deterministic routing and consistent state setup.

How do I schedule alarms idempotently for a Cloudflare Durable Object?

You schedule alarms idempotently for a Durable Object by limiting it to one alarm per DO instance and using the storage and alarms patterns to manage scheduled stateful workflows reliably.

Can I use RPC methods instead of fetch handlers for Cloudflare Durable Objects?

Yes, you can and should prefer typed RPC methods over fetch handlers for Durable Objects to cleanly expose stateful coordination logic for applications like multiplayer sessions and bookings.