[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M75D9AK2ZCDHSH1M2R88K8WB":3,"skill-same:01M75D9AK2ZCDHSH1M2R88K8WB":60},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":23,"commitSha":24,"skillDirectory":25,"forksCount":26,"repositoryHtmlUrl":27,"repositoryHomepageUrl":28,"ownerHtmlUrl":29,"ownerBlogUrl":30,"ownerDescription":6,"updatedAt":31,"install":32,"resources":45},"01M75D9AK2ZCDHSH1M2R88K8WB","durable-objects",null,"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.","agisota\u002Fold-one","agisota","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F121413592?v=4","01M75B4BRNT67EC1NDRT8QZEP2","01M75B4BS7QR9VP580MSCPTS3X",3,"MIT","https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fdurable-objects\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\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.\n---\n\n# Durable Objects\n\nBuild stateful, coordinated applications on Cloudflare's edge using Durable Objects.\n\n## Retrieval-First Development\n\n**Prefer retrieval from official docs over pre-training for Durable Objects tasks.**\n\n| Resource | URL |\n|----------|-----|\n| Docs | https:\u002F\u002Fdevelopers.cloudflare.com\u002Fdurable-objects\u002F |\n| API Reference | https:\u002F\u002Fdevelopers.cloudflare.com\u002Fdurable-objects\u002Fapi\u002F |\n| Best Practices | https:\u002F\u002Fdevelopers.cloudflare.com\u002Fdurable-objects\u002Fbest-practices\u002F |\n| Examples | https:\u002F\u002Fdevelopers.cloudflare.com\u002Fdurable-objects\u002Fexamples\u002F |\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\u002Fvitest-pool-workers`\n- Designing sharding strategies and parent-child relationships\n\n## Reference Documentation\n\n- `.\u002Freferences\u002Frules.md` - Core rules, storage, concurrency, RPC, alarms\n- `.\u002Freferences\u002Ftesting.md` - Vitest setup, unit\u002Fintegration tests, alarm testing\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## 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 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","# Durable Objects\n\nBuild stateful, coordinated applications on Cloudflare's edge using Durable Objects.\n\n## Retrieval-First Development\n\n**Prefer retrieval from official docs over pre-training for Durable Objects tasks.**\n\n| Resource | URL |\n|----------|-----|\n| Docs | https:\u002F\u002Fdevelopers.cloudflare.com\u002Fdurable-objects\u002F |\n| API Reference | https:\u002F\u002Fdevelopers.cloudflare.com\u002Fdurable-objects\u002Fapi\u002F |\n| Best Practices | https:\u002F\u002Fdevelopers.cloudflare.com\u002Fdurable-objects\u002Fbest-practices\u002F |\n| Examples | https:\u002F\u002Fdevelopers.cloudflare.com\u002Fdurable-objects\u002Fexamples\u002F |\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\u002Fvitest-pool-workers`\n- Designing sharding strategies and parent-child relationships\n\n## Reference Documentation\n\n- `.\u002Freferences\u002Frules.md` - Core rules, storage, concurrency, RPC, alarms\n- `.\u002Freferences\u002Ftesting.md` - Vitest setup, unit\u002Fintegration tests, alarm testing\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## 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 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",{"name":5,"description":7},"main","f37de8f681f0c0ca0e0ebab6e5fddf764ca7553d","skills\u002Fdurable-objects",1,"https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one","https:\u002F\u002Fagisota.github.io\u002Fold-one\u002F","https:\u002F\u002Fgithub.com\u002Fagisota","pzd.world","2026-07-04 22:32:06",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add agisota\u002Fold-one --skill durable-objects",{"tool":38,"command":39},"bunx","bunx skills add agisota\u002Fold-one --skill durable-objects",{"tool":41,"command":42},"pnpm","pnpm dlx skills add agisota\u002Fold-one --skill durable-objects","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fdurable-objects\u002FSKILL.md",true,[46,52,56],{"path":47,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":51},"references\u002Frules.md","REFERENCE","参考文档",7642,"https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fdurable-objects\u002Freferences\u002Frules.md",{"path":53,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":54,"sourceHtmlUrl":55},"references\u002Ftesting.md",6541,"https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fdurable-objects\u002Freferences\u002Ftesting.md",{"path":57,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":58,"sourceHtmlUrl":59},"references\u002Fworkers.md",7543,"https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fdurable-objects\u002Freferences\u002Fworkers.md",[61,68,75,84,91,98],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":18},"01M75KRGZWQWE9JDBS6RX42NWV","zoom-out","Tell the agent to zoom out and give broader context or a higher-level perspective. Use when you're unfamiliar with a section of code or need to understand how it fits into the bigger picture.","https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fzoom-out\u002FSKILL.md",[],[],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":18},"01M75KRCZHKE0ZYAQFFYHS0YNP","zeroize-audit","Detects missing zeroization of sensitive data in source code and identifies zeroization removed by compiler optimizations, with assembly-level analysis, and control-flow verification. Use for auditing C\u002FC++\u002FRust code handling secrets, keys, passwords, or other sensitive data.","https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fzeroize-audit\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":79,"licenseFileUrl":80,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":18},"01M75KR94KYQ30DTE1P9WNDAE0","yeet","Use only when the user explicitly asks to stage, commit, push, and open a GitHub pull request in one flow using the GitHub CLI (`gh`).","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fyeet\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fyeet\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":18},"01M75KR3H13YJ9QHMD49818FA1","yara-rule-authoring","Guides authoring of high-quality YARA-X detection rules for malware identification. Use when writing, reviewing, or optimizing YARA rules. Covers naming conventions, string selection, performance optimization, migration from legacy YARA, and false positive reduction. Triggers on: YARA, YARA-X, malware detection, threat hunting, IOC, signature, crx module, dex module.","https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fyara-rule-authoring\u002FSKILL.md",[],[],{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":18},"01M75KQMPY8A4Y8XTDD2DT0M9T","x-twitter-growth","X\u002FTwitter growth engine for building audience, crafting viral content, and analyzing engagement. Use when the user wants to grow on X\u002FTwitter, write tweets or threads, analyze their X profile, research competitors on X, plan a posting strategy, or optimize engagement. Complements social-content (generic multi-platform) with X-specific depth: algorithm mechanics, thread engineering, reply strategy, profile optimization, and competitive intelligence via web search.","https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fx-twitter-growth\u002FSKILL.md",[],[],{"skillNo":99,"name":100,"nameZh":6,"description":101,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":102,"categories":103,"keywords":104,"publishedAt":18},"01M75KQHNZ0ANZNJGZY6M8MDAK","x-api","X\u002FTwitter API integration for posting tweets, threads, reading timelines, search, and analytics. Covers OAuth auth patterns, rate limits, and platform-native content posting. Use when the user wants to interact with X programmatically.","https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fx-api\u002FSKILL.md",[],[]]