Update to Cloudflare
Snapshot Nov 4, 2026 · 12:08 UTC · version 1.0.4
Collection source: downloaded plugin package. These snapshots do not have a confirmed matching collection source. Differences in file lists alone do not establish changes to the package.
Instructions updated for durable-objects
Full description — Now says: Build, debug, or review Cloudflare Durable Objects code for persistent state and coordination.
Observed in instructions or declared skills. Runtime behavior has not been tested.
Up to 3 plugins free · no card required.
All fields and original values.
Full description
Oct 1, 2026 · 00:02 UTC
Create and review Cloudflare Durable Objects. Use when building stateful coordination (chat rooms, multiplayer games, booking systems), implementing RPC methods, SQLite storage, alarms, WebSockets, or reviewing DO code for best practices...
Nov 4, 2026 · 12:08 UTC
Build, debug, or review Cloudflare Durable Objects code for persistent state and coordination.
Skill instructions
Oct 1, 2026 · 00:02 UTC
Create and review Cloudflare Durable Objects. Use when building stateful coordination (chat rooms, multiplayer games, booking systems), implementing RPC methods, SQLite storage, alarms, WebSockets, or reviewing DO code for best practices...
Nov 4, 2026 · 12:08 UTC
Build, debug, or review Cloudflare Durable Objects code for persistent state and coordination. | Docs | https://developers.cloudflare.com/durable-objects/index.md | | API Reference | https://developers.cloudflare.com/durable-objects/api/...
Supporting files
Oct 1, 2026 · 00:02 UTC
[{"relative_path":"references/rules.md","size_in_bytes":8483},{"relative_path":"references/testing.md","size_in_bytes":6541},{"relative_path":"references/workers.md","size_in_bytes":7543}]
Nov 4, 2026 · 12:08 UTC
[{"relative_path":"references/rules.md","size_in_bytes":2851},{"relative_path":"references/skill-feedback.md","size_in_bytes":2802},{"relative_path":"references/testing.md","size_in_bytes":2521},{"relative_path":"references/workers.md","...
Compare saved observations
Download comparison JSONSKILL.md text changes
− removed · + added
--- before +++ after @@ -1,6 +1,6 @@ --- name: durable-objects -description: Create and review Cloudflare Durable Objects. Use when building stateful coordination (chat rooms, multiplayer games, booking systems), implementing RPC methods, SQLite storage, alarms, WebSockets, or reviewing DO code for best practices. Covers Workers integration, wrangler config, and testing with Vitest. Biases towards retrieval from Cloudflare docs over pre-trained knowledge. +description: Build, debug, or review Cloudflare Durable Objects code for persistent state and coordination. --- # Durable Objects @@ -13,10 +13,11 @@ | 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/ | +| Docs | https://developers.cloudflare.com/durable-objects/index.md | +| API Reference | https://developers.cloudflare.com/durable-objects/api/index.md | +| Best Practices | https://developers.cloudflare.com/durable-objects/best-practices/index.md | +| Examples | https://developers.cloudflare.com/durable-objects/examples/index.md | +| Roles and permissions | https://developers.cloudflare.com/workers/authorization/durable-objects/index.md | Fetch the relevant doc page when implementing features. @@ -26,14 +27,14 @@ - 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` +- Writing tests with Cloudflare’s Vitest integration - 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 +- [Testing reference](./references/testing.md) - Current Vitest documentation, migration choices, and test selection +- [Workers reference](./references/workers.md) - Workers handlers, types, configuration, tracing, and local debugging Search: `blockConcurrencyWhile`, `idFromName`, `getByName`, `setAlarm`, `sql.exec` @@ -119,6 +120,10 @@ 6. **Persist first, cache second** - Always write to storage before updating in-memory state 7. **One alarm per DO** - `setAlarm()` replaces any existing alarm +## Authorization + +Durable Objects do not have separate roles or permissions; access follows the Worker that implements them. Retrieve the current [Durable Objects authorization guidance](https://developers.cloudflare.com/workers/authorization/durable-objects/index.md) before granting observability or Data Studio access, and scope the Workers role to the intended Worker or Workers product. + ## Anti-Patterns (NEVER) - Single global DO handling all requests (bottleneck) @@ -170,17 +175,10 @@ await this.ctx.storage.deleteAlarm(); ``` -## Testing Quick Start +## Testing -```typescript -import { env } from "cloudflare:test"; -import { describe, it, expect } from "vitest"; +Read the [testing reference](./references/testing.md) before configuring a suite or writing Durable Object tests. It routes to current setup, APIs, and examples and identifies the behavior to cover. -describe("MyDO", () => { - it("should work", async () => { - const stub = env.MY_DO.getByName("test"); - const result = await stub.addItem("test"); - expect(result).toBe(1); - }); -}); -``` +## Skill feedback + +If the user reports that this skill gave incorrect or outdated guidance, or is missing information, read [references/skill-feedback.md](references/skill-feedback.md).
Full technical diff · 3 changed fields
changed /description
"Create and review Cloudflare Durable Objects. Use when building stateful coordination (chat rooms, multiplayer games, booking systems), implementing RPC methods, SQLite storage, alarms, WebSockets, or reviewing DO code for best practices. Covers Workers integration, wrangler config, and testing with Vitest. Biases towards retrieval from Cloudflare docs over pre-trained knowledge."
"Build, debug, or review Cloudflare Durable Objects code for persistent state and coordination."
changed /included_files
[
{
"relative_path": "references/rules.md",
"size_in_bytes": 8483
},
{
"relative_path": "references/testing.md",
"size_in_bytes": 6541
},
{
"relative_path": "references/workers.md",
"size_in_bytes": 7543
}
][
{
"relative_path": "references/rules.md",
"size_in_bytes": 2851
},
{
"relative_path": "references/skill-feedback.md",
"size_in_bytes": 2802
},
{
"relative_path": "references/testing.md",
"size_in_bytes": 2521
},
{
"relative_path": "references/workers.md",
"size_in_bytes": 7991
}
]changed /skill_md_contents
"---\nname: durable-objects\ndescription: Create and review Cloudflare Durable Objects. Use when building stateful coordination (chat rooms, multiplayer games, booking systems), implementing RPC methods, SQLite storage, alarms, WebSockets, or reviewing DO code for best practices. Covers Workers integration, wrangler config, and testing with Vitest. Biases towards retrieval from Cloudflare docs over pre-trained knowledge.\n---\n\n# Durable Objects\n\nBuild stateful, coordinated applications on Cloudflare's edge using Durable Objects.\n\n## Retrieval Sources\n\nYour knowledge of Durable Objects APIs and configuration may be outdated. **Prefer retrieval over pre-training** for any Durable Objects task.\n\n| Resource | URL |\n|----------|-----|\n| Docs | https://developers.cloudflare.com/durable-objects/ |\n| API Reference | https://developers.cloudflare.com/durable-objects/api/ |\n| Best Practices | https://developers.cloudflare.com/durable-objects/best-practices/ |\n| Examples | https://developers.cloudflare.com/durable-objects/examples/ |\n\nFetch the relevant doc page when implementing features.\n\n## When to Use\n\n- Creating new Durable Object classes for stateful coordination\n- Implementing RPC methods, alarms, or WebSocket handlers\n- Reviewing existing DO code for best practices\n- Configuring wrangler.jsonc/toml for DO bindings and migrations\n- Writing tests with `@cloudflare/vitest-pool-workers`\n- Designing sharding strategies and parent-child relationships\n\n## Reference Documentation\n\n- `./references/rules.md` - Core rules, storage, concurrency, RPC, alarms\n- `./references/testing.md` - Vitest setup, unit/integration tests, alarm testing\n- `./references/workers.md` - Workers handlers, types, wrangler config, observability\n\nSearch: `blockConcurrencyWhile`, `idFromName`, `getByName`, `setAlarm`, `sql.exec`\n\n## Core Principles\n\n### Use Durable Objects For\n\n| Need | Example |\n|------|---------|\n| Coordination | Chat rooms, multiplayer games, collaborative docs |\n| Strong consistency | Inventory, booking systems, turn-based games |\n| Per-entity storage | Multi-tenant SaaS, per-user data |\n| Persistent connections | WebSockets, real-time notifications |\n| Scheduled work per entity | Subscription renewals, game timeouts |\n\n### Do NOT Use For\n\n- Stateless request handling (use plain Workers)\n- Maximum global distribution needs\n- High fan-out independent requests\n\n## Quick Reference\n\n### Wrangler Configuration\n\n```jsonc\n// wrangler.jsonc\n{\n \"durable_objects\": {\n \"bindings\": [{ \"name\": \"MY_DO\", \"class_name\": \"MyDurableObject\" }]\n },\n \"migrations\": [{ \"tag\": \"v1\", \"new_sqlite_classes\": [\"MyDurableObject\"] }]\n}\n```\n\n### Basic Durable Object Pattern\n\n```typescript\nimport { DurableObject } from \"cloudflare:workers\";\n\nexport interface Env {\n MY_DO: DurableObjectNamespace<MyDurableObject>;\n}\n\nexport class MyDurableObject extends DurableObject<Env> {\n constructor(ctx: DurableObjectState, env: Env) {\n super(ctx, env);\n ctx.blockConcurrencyWhile(async () => {\n this.ctx.storage.sql.exec(`\n CREATE TABLE IF NOT EXISTS items (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n data TEXT NOT NULL\n )\n `);\n });\n }\n\n async addItem(data: string): Promise<number> {\n const result = this.ctx.storage.sql.exec<{ id: number }>(\n \"INSERT INTO items (data) VALUES (?) RETURNING id\",\n data\n );\n return result.one().id;\n }\n}\n\nexport default {\n async fetch(request: Request, env: Env): Promise<Response> {\n const stub = env.MY_DO.getByName(\"my-instance\");\n const id = await stub.addItem(\"hello\");\n return Response.json({ id });\n },\n};\n```\n\n## Critical Rules\n\n1. **Model around coordination atoms** - One DO per chat room/game/user, not one global DO\n2. **Use `getByName()` for deterministic routing** - Same input = same DO instance\n3. **Use SQLite storage** - Configure `new_sqlite_classes` in migrations\n4. **Initialize in constructor** - Use `blockConcurrencyWhile()` for schema setup only\n5. **Use RPC methods** - Not fetch() handler (compatibility date >= 2024-04-03)\n6. **Persist first, cache second** - Always write to storage before updating in-memory state\n7. **One alarm per DO** - `setAlarm()` replaces any existing alarm\n\n## Anti-Patterns (NEVER)\n\n- Single global DO handling all requests (bottleneck)\n- Using `blockConcurrencyWhile()` on every request (kills throughput)\n- Storing critical state only in memory (lost on eviction/crash)\n- Using `await` between related storage writes (breaks atomicity)\n- Holding `blockConcurrencyWhile()` across `fetch()` or external I/O\n\n## Stub Creation\n\n```typescript\n// Deterministic - preferred for most cases\nconst stub = env.MY_DO.getByName(\"room-123\");\n\n// From existing ID string\nconst id = env.MY_DO.idFromString(storedIdString);\nconst stub = env.MY_DO.get(id);\n\n// New unique ID - store mapping externally\nconst id = env.MY_DO.newUniqueId();\nconst stub = env.MY_DO.get(id);\n```\n\n## Storage Operations\n\n```typescript\n// SQL (synchronous, recommended)\nthis.ctx.storage.sql.exec(\"INSERT INTO t (c) VALUES (?)\", value);\nconst rows = this.ctx.storage.sql.exec<Row>(\"SELECT * FROM t\").toArray();\n\n// KV (async)\nawait this.ctx.storage.put(\"key\", value);\nconst val = await this.ctx.storage.get<Type>(\"key\");\n```\n\n## Alarms\n\n```typescript\n// Schedule (replaces existing)\nawait this.ctx.storage.setAlarm(Date.now() + 60_000);\n\n// Handler\nasync alarm(): Promise<void> {\n // Process scheduled work\n // Optionally reschedule: await this.ctx.storage.setAlarm(...)\n}\n\n// Cancel\nawait this.ctx.storage.deleteAlarm();\n```\n\n## Testing Quick Start\n\n```typescript\nimport { env } from \"cloudflare:test\";\nimport { describe, it, expect } from \"vitest\";\n\ndescribe(\"MyDO\", () => {\n it(\"should work\", async () => {\n const stub = env.MY_DO.getByName(\"test\");\n const result = await stub.addItem(\"test\");\n expect(result).toBe(1);\n });\n});\n```\n""---\nname: durable-objects\ndescription: Build, debug, or review Cloudflare Durable Objects code for persistent state and coordination.\n---\n\n# Durable Objects\n\nBuild stateful, coordinated applications on Cloudflare's edge using Durable Objects.\n\n## Retrieval Sources\n\nYour knowledge of Durable Objects APIs and configuration may be outdated. **Prefer retrieval over pre-training** for any Durable Objects task.\n\n| Resource | URL |\n|----------|-----|\n| Docs | https://developers.cloudflare.com/durable-objects/index.md |\n| API Reference | https://developers.cloudflare.com/durable-objects/api/index.md |\n| Best Practices | https://developers.cloudflare.com/durable-objects/best-practices/index.md |\n| Examples | https://developers.cloudflare.com/durable-objects/examples/index.md |\n| Roles and permissions | https://developers.cloudflare.com/workers/authorization/durable-objects/index.md |\n\nFetch the relevant doc page when implementing features.\n\n## When to Use\n\n- Creating new Durable Object classes for stateful coordination\n- Implementing RPC methods, alarms, or WebSocket handlers\n- Reviewing existing DO code for best practices\n- Configuring wrangler.jsonc/toml for DO bindings and migrations\n- Writing tests with Cloudflare’s Vitest integration\n- Designing sharding strategies and parent-child relationships\n\n## Reference Documentation\n\n- `./references/rules.md` - Core rules, storage, concurrency, RPC, alarms\n- [Testing reference](./references/testing.md) - Current Vitest documentation, migration choices, and test selection\n- [Workers reference](./references/workers.md) - Workers handlers, types, configuration, tracing, and local debugging\n\nSearch: `blockConcurrencyWhile`, `idFromName`, `getByName`, `setAlarm`, `sql.exec`\n\n## Core Principles\n\n### Use Durable Objects For\n\n| Need | Example |\n|------|---------|\n| Coordination | Chat rooms, multiplayer games, collaborative docs |\n| Strong consistency | Inventory, booking systems, turn-based games |\n| Per-entity storage | Multi-tenant SaaS, per-user data |\n| Persistent connections | WebSockets, real-time notifications |\n| Scheduled work per entity | Subscription renewals, game timeouts |\n\n### Do NOT Use For\n\n- Stateless request handling (use plain Workers)\n- Maximum global distribution needs\n- High fan-out independent requests\n\n## Quick Reference\n\n### Wrangler Configuration\n\n```jsonc\n// wrangler.jsonc\n{\n \"durable_objects\": {\n \"bindings\": [{ \"name\": \"MY_DO\", \"class_name\": \"MyDurableObject\" }]\n },\n \"migrations\": [{ \"tag\": \"v1\", \"new_sqlite_classes\": [\"MyDurableObject\"] }]\n}\n```\n\n### Basic Durable Object Pattern\n\n```typescript\nimport { DurableObject } from \"cloudflare:workers\";\n\nexport interface Env {\n MY_DO: DurableObjectNamespace<MyDurableObject>;\n}\n\nexport class MyDurableObject extends DurableObject<Env> {\n constructor(ctx: DurableObjectState, env: Env) {\n super(ctx, env);\n ctx.blockConcurrencyWhile(async () => {\n this.ctx.storage.sql.exec(`\n CREATE TABLE IF NOT EXISTS items (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n data TEXT NOT NULL\n )\n `);\n });\n }\n\n async addItem(data: string): Promise<number> {\n const result = this.ctx.storage.sql.exec<{ id: number }>(\n \"INSERT INTO items (data) VALUES (?) RETURNING id\",\n data\n );\n return result.one().id;\n }\n}\n\nexport default {\n async fetch(request: Request, env: Env): Promise<Response> {\n const stub = env.MY_DO.getByName(\"my-instance\");\n const id = await stub.addItem(\"hello\");\n return Response.json({ id });\n },\n};\n```\n\n## Critical Rules\n\n1. **Model around coordination atoms** - One DO per chat room/game/user, not one global DO\n2. **Use `getByName()` for deterministic routing** - Same input = same DO instance\n3. **Use SQLite storage** - Configure `new_sqlite_classes` in migrations\n4. **Initialize in constructor** - Use `blockConcurrencyWhile()` for schema setup only\n5. **Use RPC methods** - Not fetch() handler (compatibility date >= 2024-04-03)\n6. **Persist first, cache second** - Always write to storage before updating in-memory state\n7. **One alarm per DO** - `setAlarm()` replaces any existing alarm\n\n## Authorization\n\nDurable Objects do not have separate roles or permissions; access follows the Worker that implements them. Retrieve the current [Durable Objects authorization guidance](https://developers.cloudflare.com/workers/authorization/durable-objects/index.md) before granting observability or Data Studio access, and scope the Workers role to the intended Worker or Workers product.\n\n## Anti-Patterns (NEVER)\n\n- Single global DO handling all requests (bottleneck)\n- Using `blockConcurrencyWhile()` on every request (kills throughput)\n- Storing critical state only in memory (lost on eviction/crash)\n- Using `await` between related storage writes (breaks atomicity)\n- Holding `blockConcurrencyWhile()` across `fetch()` or external I/O\n\n## Stub Creation\n\n```typescript\n// Deterministic - preferred for most cases\nconst stub = env.MY_DO.getByName(\"room-123\");\n\n// From existing ID string\nconst id = env.MY_DO.idFromString(storedIdString);\nconst stub = env.MY_DO.get(id);\n\n// New unique ID - store mapping externally\nconst id = env.MY_DO.newUniqueId();\nconst stub = env.MY_DO.get(id);\n```\n\n## Storage Operations\n\n```typescript\n// SQL (synchronous, recommended)\nthis.ctx.storage.sql.exec(\"INSERT INTO t (c) VALUES (?)\", value);\nconst rows = this.ctx.storage.sql.exec<Row>(\"SELECT * FROM t\").toArray();\n\n// KV (async)\nawait this.ctx.storage.put(\"key\", value);\nconst val = await this.ctx.storage.get<Type>(\"key\");\n```\n\n## Alarms\n\n```typescript\n// Schedule (replaces existing)\nawait this.ctx.storage.setAlarm(Date.now() + 60_000);\n\n// Handler\nasync alarm(): Promise<void> {\n // Process scheduled work\n // Optionally reschedule: await this.ctx.storage.setAlarm(...)\n}\n\n// Cancel\nawait this.ctx.storage.deleteAlarm();\n```\n\n## Testing\n\nRead the [testing reference](./references/testing.md) before configuring a suite or writing Durable Object tests. It routes to current setup, APIs, and examples and identifies the behavior to cover.\n\n## Skill feedback\n\nIf the user reports that this skill gave incorrect or outdated guidance, or is missing information, read [references/skill-feedback.md](references/skill-feedback.md).\n"Full snapshot data
{
"description": "Build, debug, or review Cloudflare Durable Objects code for persistent state and coordination.",
"included_files": [
{
"relative_path": "references/rules.md",
"size_in_bytes": 2851
},
{
"relative_path": "references/skill-feedback.md",
"size_in_bytes": 2802
},
{
"relative_path": "references/testing.md",
"size_in_bytes": 2521
},
{
"relative_path": "references/workers.md",
"size_in_bytes": 7991
}
],
"name": "durable-objects",
"skill_md_contents": "---\nname: durable-objects\ndescription: Build, debug, or review Cloudflare Durable Objects code for persistent state and coordination.\n---\n\n# Durable Objects\n\nBuild stateful, coordinated applications on Cloudflare's edge using Durable Objects.\n\n## Retrieval Sources\n\nYour knowledge of Durable Objects APIs and configuration may be outdated. **Prefer retrieval over pre-training** for any Durable Objects task.\n\n| Resource | URL |\n|----------|-----|\n| Docs | https://developers.cloudflare.com/durable-objects/index.md |\n| API Reference | https://developers.cloudflare.com/durable-objects/api/index.md |\n| Best Practices | https://developers.cloudflare.com/durable-objects/best-practices/index.md |\n| Examples | https://developers.cloudflare.com/durable-objects/examples/index.md |\n| Roles and permissions | https://developers.cloudflare.com/workers/authorization/durable-objects/index.md |\n\nFetch the relevant doc page when implementing features.\n\n## When to Use\n\n- Creating new Durable Object classes for stateful coordination\n- Implementing RPC methods, alarms, or WebSocket handlers\n- Reviewing existing DO code for best practices\n- Configuring wrangler.jsonc/toml for DO bindings and migrations\n- Writing tests with Cloudflare’s Vitest integration\n- Designing sharding strategies and parent-child relationships\n\n## Reference Documentation\n\n- `./references/rules.md` - Core rules, storage, concurrency, RPC, alarms\n- [Testing reference](./references/testing.md) - Current Vitest documentation, migration choices, and test selection\n- [Workers reference](./references/workers.md) - Workers handlers, types, configuration, tracing, and local debugging\n\nSearch: `blockConcurrencyWhile`, `idFromName`, `getByName`, `setAlarm`, `sql.exec`\n\n## Core Principles\n\n### Use Durable Objects For\n\n| Need | Example |\n|------|---------|\n| Coordination | Chat rooms, multiplayer games, collaborative docs |\n| Strong consistency | Inventory, booking systems, turn-based games |\n| Per-entity storage | Multi-tenant SaaS, per-user data |\n| Persistent connections | WebSockets, real-time notifications |\n| Scheduled work per entity | Subscription renewals, game timeouts |\n\n### Do NOT Use For\n\n- Stateless request handling (use plain Workers)\n- Maximum global distribution needs\n- High fan-out independent requests\n\n## Quick Reference\n\n### Wrangler Configuration\n\n```jsonc\n// wrangler.jsonc\n{\n \"durable_objects\": {\n \"bindings\": [{ \"name\": \"MY_DO\", \"class_name\": \"MyDurableObject\" }]\n },\n \"migrations\": [{ \"tag\": \"v1\", \"new_sqlite_classes\": [\"MyDurableObject\"] }]\n}\n```\n\n### Basic Durable Object Pattern\n\n```typescript\nimport { DurableObject } from \"cloudflare:workers\";\n\nexport interface Env {\n MY_DO: DurableObjectNamespace<MyDurableObject>;\n}\n\nexport class MyDurableObject extends DurableObject<Env> {\n constructor(ctx: DurableObjectState, env: Env) {\n super(ctx, env);\n ctx.blockConcurrencyWhile(async () => {\n this.ctx.storage.sql.exec(`\n CREATE TABLE IF NOT EXISTS items (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n data TEXT NOT NULL\n )\n `);\n });\n }\n\n async addItem(data: string): Promise<number> {\n const result = this.ctx.storage.sql.exec<{ id: number }>(\n \"INSERT INTO items (data) VALUES (?) RETURNING id\",\n data\n );\n return result.one().id;\n }\n}\n\nexport default {\n async fetch(request: Request, env: Env): Promise<Response> {\n const stub = env.MY_DO.getByName(\"my-instance\");\n const id = await stub.addItem(\"hello\");\n return Response.json({ id });\n },\n};\n```\n\n## Critical Rules\n\n1. **Model around coordination atoms** - One DO per chat room/game/user, not one global DO\n2. **Use `getByName()` for deterministic routing** - Same input = same DO instance\n3. **Use SQLite storage** - Configure `new_sqlite_classes` in migrations\n4. **Initialize in constructor** - Use `blockConcurrencyWhile()` for schema setup only\n5. **Use RPC methods** - Not fetch() handler (compatibility date >= 2024-04-03)\n6. **Persist first, cache second** - Always write to storage before updating in-memory state\n7. **One alarm per DO** - `setAlarm()` replaces any existing alarm\n\n## Authorization\n\nDurable Objects do not have separate roles or permissions; access follows the Worker that implements them. Retrieve the current [Durable Objects authorization guidance](https://developers.cloudflare.com/workers/authorization/durable-objects/index.md) before granting observability or Data Studio access, and scope the Workers role to the intended Worker or Workers product.\n\n## Anti-Patterns (NEVER)\n\n- Single global DO handling all requests (bottleneck)\n- Using `blockConcurrencyWhile()` on every request (kills throughput)\n- Storing critical state only in memory (lost on eviction/crash)\n- Using `await` between related storage writes (breaks atomicity)\n- Holding `blockConcurrencyWhile()` across `fetch()` or external I/O\n\n## Stub Creation\n\n```typescript\n// Deterministic - preferred for most cases\nconst stub = env.MY_DO.getByName(\"room-123\");\n\n// From existing ID string\nconst id = env.MY_DO.idFromString(storedIdString);\nconst stub = env.MY_DO.get(id);\n\n// New unique ID - store mapping externally\nconst id = env.MY_DO.newUniqueId();\nconst stub = env.MY_DO.get(id);\n```\n\n## Storage Operations\n\n```typescript\n// SQL (synchronous, recommended)\nthis.ctx.storage.sql.exec(\"INSERT INTO t (c) VALUES (?)\", value);\nconst rows = this.ctx.storage.sql.exec<Row>(\"SELECT * FROM t\").toArray();\n\n// KV (async)\nawait this.ctx.storage.put(\"key\", value);\nconst val = await this.ctx.storage.get<Type>(\"key\");\n```\n\n## Alarms\n\n```typescript\n// Schedule (replaces existing)\nawait this.ctx.storage.setAlarm(Date.now() + 60_000);\n\n// Handler\nasync alarm(): Promise<void> {\n // Process scheduled work\n // Optionally reschedule: await this.ctx.storage.setAlarm(...)\n}\n\n// Cancel\nawait this.ctx.storage.deleteAlarm();\n```\n\n## Testing\n\nRead the [testing reference](./references/testing.md) before configuring a suite or writing Durable Object tests. It routes to current setup, APIs, and examples and identifies the behavior to cover.\n\n## Skill feedback\n\nIf the user reports that this skill gave incorrect or outdated guidance, or is missing information, read [references/skill-feedback.md](references/skill-feedback.md).\n"
}SHA-256 of public snapshot: 30340199bbe71d4e6bc8f12771f1992ea6c31b9c67e33c444025bd78029b5e06