[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7C76VJQP5F93XPFETQXCNPF":3,"skill-same:01M7C76VJQP5F93XPFETQXCNPF":61},{"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":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":28,"ownerHtmlUrl":29,"ownerBlogUrl":30,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M7C76VJQP5F93XPFETQXCNPF","durable-objects",null,"Build, debug, or review Cloudflare Durable Objects code for persistent state and coordination.","stepankuzmin\u002Fsvenska-app","stepankuzmin","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F533564?v=4","01M7ADH01MGRSMC0YNW589Q6CE","Stepan Kuzmin","01M7C74QGFNTQ4J5AA0QJVZ102",0,"MIT","https:\u002F\u002Fgithub.com\u002Fstepankuzmin\u002Fsvenska-app\u002Fblob\u002Fmain\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},"main","982185840176c21a4953df3e87e85c484a6369d0",".agents\u002Fskills\u002Fdurable-objects","https:\u002F\u002Fgithub.com\u002Fstepankuzmin\u002Fsvenska-app","https:\u002F\u002Fsvenska-app.stepan-kuzmin.workers.dev\u002F","https:\u002F\u002Fgithub.com\u002Fstepankuzmin","https:\u002F\u002Fstepankuzmin.com\u002F","Software Engineer at @Mapbox","2026-11-14 23:14:58",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add stepankuzmin\u002Fsvenska-app --skill durable-objects",{"tool":39,"command":40},"bunx","bunx skills add stepankuzmin\u002Fsvenska-app --skill durable-objects",{"tool":42,"command":43},"pnpm","pnpm dlx skills add stepankuzmin\u002Fsvenska-app --skill durable-objects","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fstepankuzmin\u002Fsvenska-app\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fdurable-objects\u002FSKILL.md",true,[47,53,57],{"path":48,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":51,"sourceHtmlUrl":52},"references\u002Frules.md","REFERENCE","参考文档",2851,"https:\u002F\u002Fgithub.com\u002Fstepankuzmin\u002Fsvenska-app\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fdurable-objects\u002Freferences\u002Frules.md",{"path":54,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":55,"sourceHtmlUrl":56},"references\u002Ftesting.md",2521,"https:\u002F\u002Fgithub.com\u002Fstepankuzmin\u002Fsvenska-app\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fdurable-objects\u002Freferences\u002Ftesting.md",{"path":58,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":59,"sourceHtmlUrl":60},"references\u002Fworkers.md",7543,"https:\u002F\u002Fgithub.com\u002Fstepankuzmin\u002Fsvenska-app\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fdurable-objects\u002Freferences\u002Fworkers.md",[62,68,75,82,89,96],{"skillNo":63,"name":64,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":19},"01M7C7CWDP33VRCNNQ2X0Z2WVY","code-review","https:\u002F\u002Fgithub.com\u002Fstepankuzmin\u002Fsvenska-app\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fcode-review\u002FSKILL.md",[],[],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":19},"01M7C7CSQ125KWMD152RVMEVR2","wrangler","Run or troubleshoot Wrangler CLI commands in projects that have a wrangler.jsonc, wrangler.json, or wrangler.toml file, including local development, Previews, deployment, and resource management. For new projects and projects without a Wrangler configuration file, use the cf CLI instead.","https:\u002F\u002Fgithub.com\u002Fstepankuzmin\u002Fsvenska-app\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fwrangler\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":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":19},"01M7C7CQHGNS5KATKXFWBX1QVM","workers-best-practices","Cloudflare Workers best practices for production applications. Use when writing, reviewing, or configuring Workers.","https:\u002F\u002Fgithub.com\u002Fstepankuzmin\u002Fsvenska-app\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fworkers-best-practices\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":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":19},"01M7C7CG0Q35G35NFECMVW0YSX","why","Use when the user asks to investigate why code is built the way it is: 'why does X work this way', 'why we picked Y', design rationale, regressions, or postmortems. Not for explaining a single error or a quick question. Queries each available evidence source (git and PRs, issues, docs, team chat) in parallel, then returns a cited read on decisions and tradeoffs. Use how for runtime behavior.","https:\u002F\u002Fgithub.com\u002Fstepankuzmin\u002Fsvenska-app\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fwhy\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":15,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":19},"01M7C7CAXBW5SPGDN6VB0VF03P","vercel-react-best-practices","React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React\u002FNext.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.","https:\u002F\u002Fgithub.com\u002Fstepankuzmin\u002Fsvenska-app\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fvercel-react-best-practices\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":15,"licenseFileUrl":6,"sourceHtmlUrl":100,"categories":101,"keywords":102,"publishedAt":19},"01M7C7C7SBTJEA71CZ2ZTG62C1","vendor-skill","Adapt an external skill into this marketplace, or review upstream changes to one already adapted. Use when asked to vendor, import, adapt, mirror, or update a skill from skills.sh, `npx skills add`, or any external GitHub skills repo, especially to work around Claude Code Web only allowing one marketplace per GitHub repo name.","https:\u002F\u002Fgithub.com\u002Fstepankuzmin\u002Fsvenska-app\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fvendor-skill\u002FSKILL.md",[],[]]