Agent skill · software engineering · secondsky

cloudflare-durable-objects

Cloudflare Durable Objects for stateful coordination and real-time apps. Use for chat, multiplayer games, WebSocket hibernation, or encountering class export, migration, alarm errors.

Why this skill is useful

Provides specific patterns and commands for implementing Cloudflare Durable Objects that the AI wouldn't reliably generate on its own.

What it needs

Requires bun, npm installed locally. Requires cloudflare account access. About 10k tokens when loaded. Last updated 2026-08-06. 204 stars on the source repository.

What this skill does

Cloudflare Durable Objects Status: Production Ready ✅ Last Updated: 2025-11-25 Dependencies: cloudflare-worker-base (recommended) Latest Versions: wrangler@4.81.0+, @cloudflare/workers-types@4.20260408.0+ Official Docs: https://developers.cloudflare.com/durable-objects/ Table of Contents What are Durable Objects? • Quick Start • When to Load References • Class Structure • State API • WebSocket Hibernation • Alarms • RPC vs HTTP • Stubs & Routing • Migrations • Common Patterns • Critical Rules • Known Issues What are Durable Objects? Globally unique, stateful objects with single-point coordination, strong consistency (ACID), WebSocket Hibernation (thousands of connections), SQLite storage (1GB), and alarms API. Use for: Chat rooms, multiplayer games, rate limiting, session management, leader election, stateful workflows --- Quick Start (10 Minutes) Option 1: Scaffold New DO Project Option 2: Add to Existing Worker 1. Install types: 2. Create DO class (src/counter.ts): 3. Configure (wrangler.jsonc): 4. Call from Worker (src/index.ts): Deploy: --- Available Commands Use these interactive commands for guided workflows: /do-setup - Initialize new DO project with interactive setup wizard Choose storage backend (SQL, KV, both) Select use case pattern (WebSocket, Sessions, Rate Limiting, etc.) Optional Vitest testing setup Generates complete DO implementation /do-migrate - Interactive migration assistant New class creation (newsqliteclasses, newclasses) Rename existing classes (renamedclasses) Delete classes with safety confirmations (deletedclasses) Transfer classes between scripts (transferredclasses) Auto-increments migration tags (v1, v2, v3...) /do-debug - Step-by-step debugging workflow Detects error categories (deployment, runtime, performance, etc.) Runs diagnostic checks on configuration and code Provides specific fixes with code examples Guides local testing and production verification /do-patterns - Pattern selection wizard Recommends DO pattern based on use case …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills secondsky/cloudflare-durable-objects

View the source on GitHub

Browse the @skills marketplace