sharkrebel/everything-everywhere-for-antigravity/durable-objects
Claude Code and agent skill by sharkrebel/everything-everywhere-for-antigravity
Trust tier 3
- community
Source check pending
Checking that the SKILL.md file is still in the repository.
Cloudflare Durable Objects: stateful coordination, RPC, SQLite storage, websockets. Triggers on: 'durable object', 'stateful worker', 'realtime sync'.
Install
npx vskill@latest install sharkrebel/everything-everywhere-for-antigravity/durable-objectsSKILL.md
Durable Objects
Build stateful, coordinated applications on Cloudflare's edge using Durable Objects.
Retrieval-First Development
Prefer retrieval from official docs over pre-training for Durable Objects tasks.
| Resource | URL | |
|---|---|---|
| Docs | https://developers.cloudflare.com/durable-objects/ | |
| API Reference | https://developers.cloudflare.com/durable-objects/api/ | |
| Best Practices | https://developers.cloudflare.com/durable-objects/best-practices/ | |
| Examples | https://developers.cloudflare.com/durable-objects/examples/ |
Fetch the relevant doc page when implementing features.
When to Use
- Creating new Durable Object classes for stateful coordination
- Implementing RPC methods, alarms, or WebSocket handlers
- Reviewing existing DO code for best practices
- Configuring wrangler.jsonc/toml for DO bindings and migrations
- Writing tests with
@cloudflare/vitest-pool-workers - Designing sharding strategies and parent-child relationships
Reference Documentation
./references/rules.md- Core rules, storage, concurrency, RPC, alarms./references/testing.md- Vitest setup, unit/integration tests, alarm testing./references/workers.md- Workers handlers, types, wrangler config, observability
Search: blockConcurrencyWhile, idFromName, getByName, setAlarm, sql.exec
Core Principles
Use Durable Objects For
| Need | Example | |
|---|---|---|
| Coordination | Chat rooms, multiplayer games, collaborative docs | |
| Strong consistency | Inventory, booking systems, turn-based games | |
| Per-entity storage | Multi-tenant SaaS, per-user data | |
| Persistent connections | WebSockets, real-time notifications | |
| Scheduled work per entity | Subscription renewals, game timeouts |
Do NOT Use For
- Stateless request handling (use plain Workers)
- Maximum global distribution needs
- High fan-out independent requests
Quick Reference
Wrangler Configuration
Basic Durable Object Pattern
Critical Rules
- Model around coordination atoms - One DO per chat room/game/user, not one global DO
- Use `getByName()` for deterministic routing - Same input = same DO instance
- Use SQLite storage - Configure
new_sqlite_classesin migrations - Initialize in constructor - Use
blockConcurrencyWhile()for schema setup only - Use RPC methods - Not fetch() handler (compatibility date >= 2024-04-03)
- Persist first, cache second - Always write to storage before updating in-memory state
- One alarm per DO -
setAlarm()replaces any existing alarm
Anti-Patterns (NEVER)
- Single global DO handling all requests (bottleneck)
- Using
blockConcurrencyWhile()on every request (kills throughput) - Storing critical state only in memory (lost on eviction/crash)
- Using
awaitbetween related storage writes (breaks atomicity) - Holding
blockConcurrencyWhile()acrossfetch()or external I/O
Stub Creation
Storage Operations
Alarms
Testing Quick Start
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/durable-objects/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/sharkrebel/everything-everywhere-for-antigravity/durable-objects)