cloudflare-durable-objects
Skill0 starsChanged 7 months agoApache-2.0View on GitHub
Guardrail for planning and reviewing Cloudflare Durable Object solutions with a thin Worker ingress, SQLite-backed state, alarms, WebSocket hibernation, and docs-first verification.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- davidanthonyn/claude-skillstheir own version, first seen Oct 20, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- davidanthonyn/claude-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository57 other files it gives its agents.
- ai-app-integrationSkill
- anti-llm-frontend-designSkill
- aspnet-core-web-developmentSkill
- async-python-patternsSkill
- browser-game-foundationsSkill
- browser-local-qaSkill
- build-mcp-server-sdk-v2Skill
- canva-design-opsSkill
- check-completionSkill
- cli-tool-creatorSkill
- cloudflare-agents-mcpSkill
- cloudflare-workers-platformSkill
- deployment-preview-workflowsSkill
- docx-document-artifactsSkill
- durable-workflow-orchestrationSkill
- dynamic-og-imagesSkill
- eval-auditSkill
- evaluate-ragSkill
- figma-design-to-code-rulesSkill
- fine-tuningSkill
- frontend-product-builderSkill
- game-asset-pipeline-expansionSkill
- game-ui-playtestSkill
- generate-synthetic-dataSkill
- github-pr-ci-opsSkill
- gmail-inbox-opsSkill
- golden-datasetSkill
- huggingface-llm-trainerSkill
- javascript-monorepo-buildsSkill
- linear-issue-managementSkill
- media-generation-transcriptionSkill
- millrace-rs-contract-paritySkill
- minecraft-mod-qa-automationSkill
- notion-workspace-flowsSkill
- openai-docsSkill
- optimize-agentic-cliSkill
- pdf-artifact-workflowSkill
- phaser-2d-game-developmentSkill
- postgres-query-performanceSkill
- product-ui-polish-reviewSkill
- pydantic-v2-patternsSkill
- python-repo-refactoring-hygieneSkill
- rag-corpus-hygieneSkill
- react-next-performance-reviewSkill
- rust-best-practicesSkill
- shadcn-ui-compositionSkill
- skill-evaluation-harnessSkill
- tauri-desktopSkill
- tauri-mcp-cliSkill
- tauri-ptySkill
- tile-pixel-art-transitionsSkill
- train-sentence-transformersSkill
- typer-cli-patternsSkill
- using-dbt-for-analytics-engineeringSkill
- validate-evaluatorSkill
- visual-asset-pipelineSkill
- watchdog-file-watcher-patternsSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
17 rules. About 0 are common, 11 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈11
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 45
Keep the Worker ingress thin.
- Distinctive: line 46
Before code or config changes, check the current Cloudflare docs for the exact API, lifecycle, and Wrangler details in scope.
- Very specific: line 47
Use getByName for deterministic routing from meaningful names.
- Very specific: line 48
Use SQLite-backed storage for new structured state.
- Very specific: line 49
Use sql.exec for schema-backed, transactional state.
- Very specific: line 50
Use blockConcurrencyWhile only for constructor setup or a narrowly bounded async bootstrap that must not interleave.
- Very specific: line 51
If sockets are required, start from the hibernation WebSocket model.
- Distinctive: line 59
Keep HTTP ingress as a thin adapter that routes to the stub and returns the response.
- Very specific: line 60
Prefer class methods and RPC-style calls for ordinary operations.
- Distinctive: line 61
Treat alarms as per-object future work, and assume alarm handling is at least once.
- Distinctive: line 62
If sockets are required, prefer the Hibernation WebSocket API and keep per-connection metadata in attachments or storage.
- Distinctive: line 63
Before code or config changes, check the current Cloudflare docs whenever APIs, limits, compatibility dates, or Wrangler fields matter.
- Distinctive: line 88
Check the current docs before code or config changes when APIs, limits, or Wrangler fields matter.
- Distinctive: line 89
Verify the seam with the smallest proof step that matches the work, such as a named-object call, a SQL round trip, an alarm trigger, or a …
- Distinctive: line 109
Start with the smallest useful decision: coordination atom, ownership boundary, and docs check.
- Distinctive: line 111
Keep the skill short so it steers implementation instead of becoming a Cloudflare manual.
- Distinctive: line 112
Use the same guardrail for build and review prompts so the seam stays consistent across tasks.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Cloudflare Durable Objects
Purpose
Make the Durable Object seam explicit before code or review prose. Start from the smallest honest surface: a thin Worker ingress that routes to one Durable Object core. Then decide the coordination atom, state ownership, storage model, RPC surface, alarm lifecycle, WebSocket lifecycle, config, and verification. This is a guardrail, not a Cloudflare manual.
Use When
- the task is about chat rooms, multiplayer sessions, booking slots, per-user state, queues, or other per-entity coordination
- the prompt asks for Durable Object RPC methods, storage, alarms, WebSockets, migrations, or testing
- the task is reviewing a Durable Object for lifecycle, eviction, hibernation, storage ordering, or concurrency bugs
- the answer depends on current Cloudflare Durable Objects or Wrangler docs
Do Not Use When
- the problem is generic stateless Worker plumbing
- the real decision is whether to use a plain Worker, Durable Object, Agents SDK, or remote MCP
- the work is broad Workers or Wrangler configuration with no Durable Object boundary question
- another more specific skill already owns the seam
Quick Start
- Name the coordination atom first: room, booking, document, user, match, or similar natural shard.
- Keep the Worker ingress thin. Validate input, derive the object name, and hand off to a single Durable Object stub.
- Before code or config changes, check the current Cloudflare docs for the exact API, lifecycle, and Wrangler details in scope.
- Use
getByNamefor deterministic routing from meaningful names. Reach foridFromNameonly when you already need the raw ID or are interoperating with a lower-level API. - Use SQLite-backed storage for new structured state. Put the class in
new_sqlite_classesin the first migration if the class is new. - Use
sql.execfor schema-backed, transactional state. Treat in-memory values as caches or derived data only. - Use
blockConcurrencyWhileonly for constructor setup or a narrowly bounded async bootstrap that must not interleave. - If sockets are required, start from the hibernation WebSocket model. If timers are required, prefer alarms over
setTimeoutorsetInterval. - End the answer with one concrete verification step that matches the chosen seam.
Operating Constraints
- One Durable Object instance should represent one natural unit of coordination.
- The Durable Object owns the truth. Module globals may cache derived data, but they should not hold critical state.
- Persist before you cache or publish side effects.
- Keep HTTP ingress as a thin adapter that routes to the stub and returns the response.
- Prefer class methods and RPC-style calls for ordinary operations; use
fetch()only when HTTP semantics are truly part of the contract. - Treat alarms as per-object future work, and assume alarm handling is at least once.
- If sockets are required, prefer the Hibernation WebSocket API and keep per-connection metadata in attachments or storage.
- Before code or config changes, check the current Cloudflare docs whenever APIs, limits, compatibility dates, or Wrangler fields matter.
Inputs This Skill Expects
- the request goal and the intended coordination atom
- current Durable Object, Worker, or Wrangler files when they exist
- current Cloudflare docs for the APIs in scope
- any test or verification constraints already known
- whether the prompt is asking for planning, review, or a code change
Output Contract
- Name the coordination atom explicitly.
- State the ownership boundary, storage model, RPC surface, alarm lifecycle, WebSocket lifecycle, config, and verification separately.
- Name the smallest honest starting point, usually a thin Worker ingress plus one Durable Object core.
- For review prompts, call out lifecycle, eviction, hibernation, storage ordering, alarm, and socket cleanup risks before suggesting code.
- Include one concrete proof step instead of vague confidence.
Procedure
- Identify the natural coordination atom and refuse a global object unless the whole system truly serializes around one queue.
- Draw the ownership boundary: the Worker should stay thin, and the Durable Object should own the state and lifecycle.
- Choose the storage model. Default new structured state to SQLite-backed storage and use
sql.execfor transactional reads and writes. - Decide the RPC surface. Prefer class methods for ordinary operations and keep
fetch()only when the contract needs HTTP semantics. - Decide the lifecycle path. Use alarms for durable future work and the Hibernation WebSocket model when live sockets are required.
- Check the current docs before code or config changes when APIs, limits, or Wrangler fields matter.
- Verify the seam with the smallest proof step that matches the work, such as a named-object call, a SQL round trip, an alarm trigger, or a WebSocket cleanup path.
Pitfalls And Gotchas
- single global DO
- request-scoped module vars
- critical state only in memory
setTimeoutorsetIntervalfor durable workblockConcurrencyWhilearound external I/O or every request- hidden migration assumptions
- ignoring hibernation cleanup
- alarms or sockets that rely on memory surviving eviction
Rejected Trope
- Rejected trope: keep everything in the Worker and add a Durable Object later.
- Better alternative: decide the coordination atom first, route through a thin Worker, and let one Durable Object own state and lifecycle from the start.
Progressive Disclosure
- Start with the smallest useful decision: coordination atom, ownership boundary, and docs check.
- Expand only enough to choose cleanly between storage, RPC, alarm, WebSocket, and migration details.
- Keep the skill short so it steers implementation instead of becoming a Cloudflare manual.
- Use the same guardrail for build and review prompts so the seam stays consistent across tasks.
Verification Pattern
- Confirm the coordination atom is explicit.
- Confirm state ownership, storage model, RPC surface, alarm lifecycle, WebSocket lifecycle, config, and verification are named separately.
- Confirm the answer includes one concrete proof step instead of vague confidence.
- Next verifier: implementation reviewer or checker; capture the docs consulted, the chosen coordination atom, the migration tag, the lifecycle strategy, and one proof step.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

