[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7DDP0A2DJHAEKA92KJS47DZ":3,"skill-same:01M7DDP0A2DJHAEKA92KJS47DZ":66},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":16,"sourceHtmlUrl":17,"categories":18,"keywords":19,"publishedAt":20,"linkOnly":21,"markdownContent":22,"markdownBody":23,"frontMatter":24,"refName":25,"commitSha":26,"skillDirectory":27,"forksCount":28,"repositoryHtmlUrl":29,"repositoryHomepageUrl":6,"ownerHtmlUrl":30,"ownerBlogUrl":31,"ownerDescription":32,"updatedAt":33,"install":34,"resources":47},"01M7DDP0A2DJHAEKA92KJS47DZ","durable-objects",null,"Build, debug, or review Cloudflare Durable Objects code for persistent state and coordination.","grmkris\u002Fsidequest","grmkris","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F15545195?v=4","01M7DDKZB6V5N6B5VT6XD5SHTF","Kris","01M7DDKZC95VVEHE13NBQ21EQ6",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fgrmkris\u002Fsidequest\u002Fblob\u002Fdev\u002F.agents\u002Fskills\u002Fdurable-objects\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fgrmkris\u002Fsidequest\u002Fblob\u002Fdev\u002F.agents\u002Fskills\u002Fdurable-objects\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\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:\u002F\u002Fdevelopers.cloudflare.com\u002Fdurable-objects\u002Findex.md |\n| API Reference | https:\u002F\u002Fdevelopers.cloudflare.com\u002Fdurable-objects\u002Fapi\u002Findex.md |\n| Best Practices | https:\u002F\u002Fdevelopers.cloudflare.com\u002Fdurable-objects\u002Fbest-practices\u002Findex.md |\n| Examples | https:\u002F\u002Fdevelopers.cloudflare.com\u002Fdurable-objects\u002Fexamples\u002Findex.md |\n| Roles and permissions | https:\u002F\u002Fdevelopers.cloudflare.com\u002Fworkers\u002Fauthorization\u002Fdurable-objects\u002Findex.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\u002Ftoml 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- `.\u002Freferences\u002Frules.md` - Core rules, storage, concurrency, RPC, alarms\n- [Testing reference](.\u002Freferences\u002Ftesting.md) - Current Vitest documentation, migration choices, and test selection\n- `.\u002Freferences\u002Fworkers.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\u002F\u002F 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\u003CMyDurableObject>;\n}\n\nexport class MyDurableObject extends DurableObject\u003CEnv> {\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\u003Cnumber> {\n    const result = this.ctx.storage.sql.exec\u003C{ 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\u003CResponse> {\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\u002Fgame\u002Fuser, 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:\u002F\u002Fdevelopers.cloudflare.com\u002Fworkers\u002Fauthorization\u002Fdurable-objects\u002Findex.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\u002Fcrash)\n- Using `await` between related storage writes (breaks atomicity)\n- Holding `blockConcurrencyWhile()` across `fetch()` or external I\u002FO\n\n## Stub Creation\n\n```typescript\n\u002F\u002F Deterministic - preferred for most cases\nconst stub = env.MY_DO.getByName(\"room-123\");\n\n\u002F\u002F From existing ID string\nconst id = env.MY_DO.idFromString(storedIdString);\nconst stub = env.MY_DO.get(id);\n\n\u002F\u002F 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\u002F\u002F SQL (synchronous, recommended)\nthis.ctx.storage.sql.exec(\"INSERT INTO t (c) VALUES (?)\", value);\nconst rows = this.ctx.storage.sql.exec\u003CRow>(\"SELECT * FROM t\").toArray();\n\n\u002F\u002F KV (async)\nawait this.ctx.storage.put(\"key\", value);\nconst val = await this.ctx.storage.get\u003CType>(\"key\");\n```\n\n## Alarms\n\n```typescript\n\u002F\u002F Schedule (replaces existing)\nawait this.ctx.storage.setAlarm(Date.now() + 60_000);\n\n\u002F\u002F Handler\nasync alarm(): Promise\u003Cvoid> {\n  \u002F\u002F Process scheduled work\n  \u002F\u002F Optionally reschedule: await this.ctx.storage.setAlarm(...)\n}\n\n\u002F\u002F Cancel\nawait this.ctx.storage.deleteAlarm();\n```\n\n## Testing\n\nRead the [testing reference](.\u002Freferences\u002Ftesting.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","# 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:\u002F\u002Fdevelopers.cloudflare.com\u002Fdurable-objects\u002Findex.md |\n| API Reference | https:\u002F\u002Fdevelopers.cloudflare.com\u002Fdurable-objects\u002Fapi\u002Findex.md |\n| Best Practices | https:\u002F\u002Fdevelopers.cloudflare.com\u002Fdurable-objects\u002Fbest-practices\u002Findex.md |\n| Examples | https:\u002F\u002Fdevelopers.cloudflare.com\u002Fdurable-objects\u002Fexamples\u002Findex.md |\n| Roles and permissions | https:\u002F\u002Fdevelopers.cloudflare.com\u002Fworkers\u002Fauthorization\u002Fdurable-objects\u002Findex.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\u002Ftoml 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- `.\u002Freferences\u002Frules.md` - Core rules, storage, concurrency, RPC, alarms\n- [Testing reference](.\u002Freferences\u002Ftesting.md) - Current Vitest documentation, migration choices, and test selection\n- `.\u002Freferences\u002Fworkers.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\u002F\u002F 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\u003CMyDurableObject>;\n}\n\nexport class MyDurableObject extends DurableObject\u003CEnv> {\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\u003Cnumber> {\n    const result = this.ctx.storage.sql.exec\u003C{ 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\u003CResponse> {\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\u002Fgame\u002Fuser, 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:\u002F\u002Fdevelopers.cloudflare.com\u002Fworkers\u002Fauthorization\u002Fdurable-objects\u002Findex.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\u002Fcrash)\n- Using `await` between related storage writes (breaks atomicity)\n- Holding `blockConcurrencyWhile()` across `fetch()` or external I\u002FO\n\n## Stub Creation\n\n```typescript\n\u002F\u002F Deterministic - preferred for most cases\nconst stub = env.MY_DO.getByName(\"room-123\");\n\n\u002F\u002F From existing ID string\nconst id = env.MY_DO.idFromString(storedIdString);\nconst stub = env.MY_DO.get(id);\n\n\u002F\u002F 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\u002F\u002F SQL (synchronous, recommended)\nthis.ctx.storage.sql.exec(\"INSERT INTO t (c) VALUES (?)\", value);\nconst rows = this.ctx.storage.sql.exec\u003CRow>(\"SELECT * FROM t\").toArray();\n\n\u002F\u002F KV (async)\nawait this.ctx.storage.put(\"key\", value);\nconst val = await this.ctx.storage.get\u003CType>(\"key\");\n```\n\n## Alarms\n\n```typescript\n\u002F\u002F Schedule (replaces existing)\nawait this.ctx.storage.setAlarm(Date.now() + 60_000);\n\n\u002F\u002F Handler\nasync alarm(): Promise\u003Cvoid> {\n  \u002F\u002F Process scheduled work\n  \u002F\u002F Optionally reschedule: await this.ctx.storage.setAlarm(...)\n}\n\n\u002F\u002F Cancel\nawait this.ctx.storage.deleteAlarm();\n```\n\n## Testing\n\nRead the [testing reference](.\u002Freferences\u002Ftesting.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",{"name":5,"description":7},"dev","a004d0860ca4325bb3d3e925f501225c9181cc5a",".agents\u002Fskills\u002Fdurable-objects",2,"https:\u002F\u002Fgithub.com\u002Fgrmkris\u002Fsidequest","https:\u002F\u002Fgithub.com\u002Fgrmkris","kris.gg","Software engineer","2026-10-30 17:18:59",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add grmkris\u002Fsidequest --skill durable-objects",{"tool":40,"command":41},"bunx","bunx skills add grmkris\u002Fsidequest --skill durable-objects",{"tool":43,"command":44},"pnpm","pnpm dlx skills add grmkris\u002Fsidequest --skill durable-objects","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fgrmkris\u002Fsidequest\u002Fblob\u002Fdev\u002F.agents\u002Fskills\u002Fdurable-objects\u002FSKILL.md",true,[48,52,58,62],{"path":49,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":51,"sourceHtmlUrl":16},"LICENSE","许可证",11357,{"path":53,"resourceType":54,"resourceTypeDesc":55,"sizeBytes":56,"sourceHtmlUrl":57},"references\u002Frules.md","REFERENCE","参考文档",2851,"https:\u002F\u002Fgithub.com\u002Fgrmkris\u002Fsidequest\u002Fblob\u002Fdev\u002F.agents\u002Fskills\u002Fdurable-objects\u002Freferences\u002Frules.md",{"path":59,"resourceType":54,"resourceTypeDesc":55,"sizeBytes":60,"sourceHtmlUrl":61},"references\u002Ftesting.md",2521,"https:\u002F\u002Fgithub.com\u002Fgrmkris\u002Fsidequest\u002Fblob\u002Fdev\u002F.agents\u002Fskills\u002Fdurable-objects\u002Freferences\u002Ftesting.md",{"path":63,"resourceType":54,"resourceTypeDesc":55,"sizeBytes":64,"sourceHtmlUrl":65},"references\u002Fworkers.md",7543,"https:\u002F\u002Fgithub.com\u002Fgrmkris\u002Fsidequest\u002Fblob\u002Fdev\u002F.agents\u002Fskills\u002Fdurable-objects\u002Freferences\u002Fworkers.md",[67,75,82,89,96,103],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":71,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":20},"01M7DDXYENDQ276H5RRQMR2PXY","sidequest-worker","Find, activate and deliver paid Sidequest work through the hosted MCP connection for one registered agent.","MIT","https:\u002F\u002Fgithub.com\u002Fgrmkris\u002Fsidequest\u002Fblob\u002Fdev\u002Fskill\u002Fworker\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":71,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":20},"01M7DDXS0ABBE79S6WG3STCW1Q","sidequest-self-run","Use sidequest (Monad) from your own wallet over its REST API with SIWE, without MCP or a hosted agent. Use when an agent holds its own key and wants to hire or work on sidequest directly, sign its own transactions, or script the board.","https:\u002F\u002Fgithub.com\u002Fgrmkris\u002Fsidequest\u002Fblob\u002Fdev\u002Fskill\u002Fself-run\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":71,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":20},"01M7DDXN0XADEQ7PZ6021CTWAC","sidequest-publisher","Request quotes, publish allowance-funded hires, select workers and review paid work through hosted Sidequest MCP.","https:\u002F\u002Fgithub.com\u002Fgrmkris\u002Fsidequest\u002Fblob\u002Fdev\u002Fskill\u002Fpublisher\u002FSKILL.md",[],[],{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":71,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":20},"01M7DDXH04WF73S9E5ZRMFC838","sidequest-connector","Connect a coding agent before an agent exists, create or select one through hosted MCP, then work or hire within signed permissions.","https:\u002F\u002Fgithub.com\u002Fgrmkris\u002Fsidequest\u002Fblob\u002Fdev\u002Fskill\u002Fconnector\u002FSKILL.md",[],[],{"skillNo":97,"name":98,"nameZh":6,"description":99,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":71,"licenseFileUrl":6,"sourceHtmlUrl":100,"categories":101,"keywords":102,"publishedAt":20},"01M7DDXE7NFWNNDQ7WNFJNQS5J","sidequest-arbitrator","Rule on disputed sidequest (Monad) as the arbitrator, through the board's MCP server and the arbitrator key. Use when asked to arbitrate sidequest disputes, review a dispute bundle, or sign a ruling.","https:\u002F\u002Fgithub.com\u002Fgrmkris\u002Fsidequest\u002Fblob\u002Fdev\u002Fskill\u002Farbitrator\u002FSKILL.md",[],[],{"skillNo":104,"name":105,"nameZh":6,"description":106,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":107,"sourceHtmlUrl":108,"categories":109,"keywords":110,"publishedAt":20},"01M7DDXBFNEYQNC3CMWM8QMRAS","wrangler","Run or troubleshoot Wrangler CLI commands and configure Worker projects for local development, Previews, deployment, and Cloudflare resource management.","https:\u002F\u002Fgithub.com\u002Fgrmkris\u002Fsidequest\u002Fblob\u002Fdev\u002F.agents\u002Fskills\u002Fwrangler\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fgrmkris\u002Fsidequest\u002Fblob\u002Fdev\u002F.agents\u002Fskills\u002Fwrangler\u002FSKILL.md",[],[]]