[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7882BKAMZ23N24JCPVK3F41":3,"skill-same:01M7882BKAMZ23N24JCPVK3F41":53},{"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},"01M7882BKAMZ23N24JCPVK3F41","agents-sdk",null,"Build AI agents on Cloudflare Workers using the Agents SDK. Load when creating stateful agents, durable workflows, real-time WebSocket apps, scheduled tasks, MCP servers, or chat applications. Covers Agent class, state management, callable RPC, Workflows integration, and React hooks.","preetbiswas12\u002FBlitz","preetbiswas12","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F183638463?v=4","01M75JMVJJFGZ24MXTDF029W3A","Preet Biswas","01M7881E46B88TNBSCYERXSPVR",0,"MIT","https:\u002F\u002Fgithub.com\u002Fpreetbiswas12\u002FBlitz\u002Fblob\u002Fmain\u002Fpackages\u002Fopencode\u002Ftest\u002Ffixture\u002Fskills\u002Fagents-sdk\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: agents-sdk\ndescription: Build AI agents on Cloudflare Workers using the Agents SDK. Load when creating stateful agents, durable workflows, real-time WebSocket apps, scheduled tasks, MCP servers, or chat applications. Covers Agent class, state management, callable RPC, Workflows integration, and React hooks.\n---\n\n# Cloudflare Agents SDK\n\n**STOP.** Your knowledge of the Agents SDK may be outdated. Prefer retrieval over pre-training for any Agents SDK task.\n\n## Documentation\n\nFetch current docs from `https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Ftree\u002Fmain\u002Fdocs` before implementing.\n\n| Topic               | Doc                           | Use for                                        |\n| ------------------- | ----------------------------- | ---------------------------------------------- |\n| Getting started     | `docs\u002Fgetting-started.md`     | First agent, project setup                     |\n| State               | `docs\u002Fstate.md`               | `setState`, `validateStateChange`, persistence |\n| Routing             | `docs\u002Frouting.md`             | URL patterns, `routeAgentRequest`, `basePath`  |\n| Callable methods    | `docs\u002Fcallable-methods.md`    | `@callable`, RPC, streaming, timeouts          |\n| Scheduling          | `docs\u002Fscheduling.md`          | `schedule()`, `scheduleEvery()`, cron          |\n| Workflows           | `docs\u002Fworkflows.md`           | `AgentWorkflow`, durable multi-step tasks      |\n| HTTP\u002FWebSockets     | `docs\u002Fhttp-websockets.md`     | Lifecycle hooks, hibernation                   |\n| Email               | `docs\u002Femail.md`               | Email routing, secure reply resolver           |\n| MCP client          | `docs\u002Fmcp-client.md`          | Connecting to MCP servers                      |\n| MCP server          | `docs\u002Fmcp-servers.md`         | Building MCP servers with `McpAgent`           |\n| Client SDK          | `docs\u002Fclient-sdk.md`          | `useAgent`, `useAgentChat`, React hooks        |\n| Human-in-the-loop   | `docs\u002Fhuman-in-the-loop.md`   | Approval flows, pausing workflows              |\n| Resumable streaming | `docs\u002Fresumable-streaming.md` | Stream recovery on disconnect                  |\n\nCloudflare docs: https:\u002F\u002Fdevelopers.cloudflare.com\u002Fagents\u002F\n\n## Capabilities\n\nThe Agents SDK provides:\n\n- **Persistent state** - SQLite-backed, auto-synced to clients\n- **Callable RPC** - `@callable()` methods invoked over WebSocket\n- **Scheduling** - One-time, recurring (`scheduleEvery`), and cron tasks\n- **Workflows** - Durable multi-step background processing via `AgentWorkflow`\n- **MCP integration** - Connect to MCP servers or build your own with `McpAgent`\n- **Email handling** - Receive and reply to emails with secure routing\n- **Streaming chat** - `AIChatAgent` with resumable streams\n- **React hooks** - `useAgent`, `useAgentChat` for client apps\n\n## FIRST: Verify Installation\n\n```bash\nnpm ls agents  # Should show agents package\n```\n\nIf not installed:\n\n```bash\nnpm install agents\n```\n\n## Wrangler Configuration\n\n```jsonc\n{\n  \"durable_objects\": {\n    \"bindings\": [{ \"name\": \"MyAgent\", \"class_name\": \"MyAgent\" }],\n  },\n  \"migrations\": [{ \"tag\": \"v1\", \"new_sqlite_classes\": [\"MyAgent\"] }],\n}\n```\n\n## Agent Class\n\n```typescript\nimport { Agent, routeAgentRequest, callable } from \"agents\"\n\ntype State = { count: number }\n\nexport class Counter extends Agent\u003CEnv, State> {\n  initialState = { count: 0 }\n\n  \u002F\u002F Validation hook - runs before state persists (sync, throwing rejects the update)\n  validateStateChange(nextState: State, source: Connection | \"server\") {\n    if (nextState.count \u003C 0) throw new Error(\"Count cannot be negative\")\n  }\n\n  \u002F\u002F Notification hook - runs after state persists (async, non-blocking)\n  onStateUpdate(state: State, source: Connection | \"server\") {\n    console.log(\"State updated:\", state)\n  }\n\n  @callable()\n  increment() {\n    this.setState({ count: this.state.count + 1 })\n    return this.state.count\n  }\n}\n\nexport default {\n  fetch: (req, env) => routeAgentRequest(req, env) ?? new Response(\"Not found\", { status: 404 }),\n}\n```\n\n## Routing\n\nRequests route to `\u002Fagents\u002F{agent-name}\u002F{instance-name}`:\n\n| Class      | URL                        |\n| ---------- | -------------------------- |\n| `Counter`  | `\u002Fagents\u002Fcounter\u002Fuser-123` |\n| `ChatRoom` | `\u002Fagents\u002Fchat-room\u002Flobby`  |\n\nClient: `useAgent({ agent: \"Counter\", name: \"user-123\" })`\n\n## Core APIs\n\n| Task                | API                                                    |\n| ------------------- | ------------------------------------------------------ |\n| Read state          | `this.state.count`                                     |\n| Write state         | `this.setState({ count: 1 })`                          |\n| SQL query           | `` this.sql`SELECT * FROM users WHERE id = ${id}` ``   |\n| Schedule (delay)    | `await this.schedule(60, \"task\", payload)`             |\n| Schedule (cron)     | `await this.schedule(\"0 * * * *\", \"task\", payload)`    |\n| Schedule (interval) | `await this.scheduleEvery(30, \"poll\")`                 |\n| RPC method          | `@callable() myMethod() { ... }`                       |\n| Streaming RPC       | `@callable({ streaming: true }) stream(res) { ... }`   |\n| Start workflow      | `await this.runWorkflow(\"ProcessingWorkflow\", params)` |\n\n## React Client\n\n```tsx\nimport { useAgent } from \"agents\u002Freact\"\n\nfunction App() {\n  const [state, setLocalState] = useState({ count: 0 })\n\n  const agent = useAgent({\n    agent: \"Counter\",\n    name: \"my-instance\",\n    onStateUpdate: (newState) => setLocalState(newState),\n    onIdentity: (name, agentType) => console.log(`Connected to ${name}`),\n  })\n\n  return \u003Cbutton onClick={() => agent.setState({ count: state.count + 1 })}>Count: {state.count}\u003C\u002Fbutton>\n}\n```\n\n## References\n\n- **[references\u002Fworkflows.md](references\u002Fworkflows.md)** - Durable Workflows integration\n- **[references\u002Fcallable.md](references\u002Fcallable.md)** - RPC methods, streaming, timeouts\n- **[references\u002Fstate-scheduling.md](references\u002Fstate-scheduling.md)** - State persistence, scheduling\n- **[references\u002Fstreaming-chat.md](references\u002Fstreaming-chat.md)** - AIChatAgent, resumable streams\n- **[references\u002Fmcp.md](references\u002Fmcp.md)** - MCP server integration\n- **[references\u002Femail.md](references\u002Femail.md)** - Email routing and handling\n- **[references\u002Fcodemode.md](references\u002Fcodemode.md)** - Code Mode (experimental)\n","# Cloudflare Agents SDK\n\n**STOP.** Your knowledge of the Agents SDK may be outdated. Prefer retrieval over pre-training for any Agents SDK task.\n\n## Documentation\n\nFetch current docs from `https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Ftree\u002Fmain\u002Fdocs` before implementing.\n\n| Topic               | Doc                           | Use for                                        |\n| ------------------- | ----------------------------- | ---------------------------------------------- |\n| Getting started     | `docs\u002Fgetting-started.md`     | First agent, project setup                     |\n| State               | `docs\u002Fstate.md`               | `setState`, `validateStateChange`, persistence |\n| Routing             | `docs\u002Frouting.md`             | URL patterns, `routeAgentRequest`, `basePath`  |\n| Callable methods    | `docs\u002Fcallable-methods.md`    | `@callable`, RPC, streaming, timeouts          |\n| Scheduling          | `docs\u002Fscheduling.md`          | `schedule()`, `scheduleEvery()`, cron          |\n| Workflows           | `docs\u002Fworkflows.md`           | `AgentWorkflow`, durable multi-step tasks      |\n| HTTP\u002FWebSockets     | `docs\u002Fhttp-websockets.md`     | Lifecycle hooks, hibernation                   |\n| Email               | `docs\u002Femail.md`               | Email routing, secure reply resolver           |\n| MCP client          | `docs\u002Fmcp-client.md`          | Connecting to MCP servers                      |\n| MCP server          | `docs\u002Fmcp-servers.md`         | Building MCP servers with `McpAgent`           |\n| Client SDK          | `docs\u002Fclient-sdk.md`          | `useAgent`, `useAgentChat`, React hooks        |\n| Human-in-the-loop   | `docs\u002Fhuman-in-the-loop.md`   | Approval flows, pausing workflows              |\n| Resumable streaming | `docs\u002Fresumable-streaming.md` | Stream recovery on disconnect                  |\n\nCloudflare docs: https:\u002F\u002Fdevelopers.cloudflare.com\u002Fagents\u002F\n\n## Capabilities\n\nThe Agents SDK provides:\n\n- **Persistent state** - SQLite-backed, auto-synced to clients\n- **Callable RPC** - `@callable()` methods invoked over WebSocket\n- **Scheduling** - One-time, recurring (`scheduleEvery`), and cron tasks\n- **Workflows** - Durable multi-step background processing via `AgentWorkflow`\n- **MCP integration** - Connect to MCP servers or build your own with `McpAgent`\n- **Email handling** - Receive and reply to emails with secure routing\n- **Streaming chat** - `AIChatAgent` with resumable streams\n- **React hooks** - `useAgent`, `useAgentChat` for client apps\n\n## FIRST: Verify Installation\n\n```bash\nnpm ls agents  # Should show agents package\n```\n\nIf not installed:\n\n```bash\nnpm install agents\n```\n\n## Wrangler Configuration\n\n```jsonc\n{\n  \"durable_objects\": {\n    \"bindings\": [{ \"name\": \"MyAgent\", \"class_name\": \"MyAgent\" }],\n  },\n  \"migrations\": [{ \"tag\": \"v1\", \"new_sqlite_classes\": [\"MyAgent\"] }],\n}\n```\n\n## Agent Class\n\n```typescript\nimport { Agent, routeAgentRequest, callable } from \"agents\"\n\ntype State = { count: number }\n\nexport class Counter extends Agent\u003CEnv, State> {\n  initialState = { count: 0 }\n\n  \u002F\u002F Validation hook - runs before state persists (sync, throwing rejects the update)\n  validateStateChange(nextState: State, source: Connection | \"server\") {\n    if (nextState.count \u003C 0) throw new Error(\"Count cannot be negative\")\n  }\n\n  \u002F\u002F Notification hook - runs after state persists (async, non-blocking)\n  onStateUpdate(state: State, source: Connection | \"server\") {\n    console.log(\"State updated:\", state)\n  }\n\n  @callable()\n  increment() {\n    this.setState({ count: this.state.count + 1 })\n    return this.state.count\n  }\n}\n\nexport default {\n  fetch: (req, env) => routeAgentRequest(req, env) ?? new Response(\"Not found\", { status: 404 }),\n}\n```\n\n## Routing\n\nRequests route to `\u002Fagents\u002F{agent-name}\u002F{instance-name}`:\n\n| Class      | URL                        |\n| ---------- | -------------------------- |\n| `Counter`  | `\u002Fagents\u002Fcounter\u002Fuser-123` |\n| `ChatRoom` | `\u002Fagents\u002Fchat-room\u002Flobby`  |\n\nClient: `useAgent({ agent: \"Counter\", name: \"user-123\" })`\n\n## Core APIs\n\n| Task                | API                                                    |\n| ------------------- | ------------------------------------------------------ |\n| Read state          | `this.state.count`                                     |\n| Write state         | `this.setState({ count: 1 })`                          |\n| SQL query           | `` this.sql`SELECT * FROM users WHERE id = ${id}` ``   |\n| Schedule (delay)    | `await this.schedule(60, \"task\", payload)`             |\n| Schedule (cron)     | `await this.schedule(\"0 * * * *\", \"task\", payload)`    |\n| Schedule (interval) | `await this.scheduleEvery(30, \"poll\")`                 |\n| RPC method          | `@callable() myMethod() { ... }`                       |\n| Streaming RPC       | `@callable({ streaming: true }) stream(res) { ... }`   |\n| Start workflow      | `await this.runWorkflow(\"ProcessingWorkflow\", params)` |\n\n## React Client\n\n```tsx\nimport { useAgent } from \"agents\u002Freact\"\n\nfunction App() {\n  const [state, setLocalState] = useState({ count: 0 })\n\n  const agent = useAgent({\n    agent: \"Counter\",\n    name: \"my-instance\",\n    onStateUpdate: (newState) => setLocalState(newState),\n    onIdentity: (name, agentType) => console.log(`Connected to ${name}`),\n  })\n\n  return \u003Cbutton onClick={() => agent.setState({ count: state.count + 1 })}>Count: {state.count}\u003C\u002Fbutton>\n}\n```\n\n## References\n\n- **[references\u002Fworkflows.md](references\u002Fworkflows.md)** - Durable Workflows integration\n- **[references\u002Fcallable.md](references\u002Fcallable.md)** - RPC methods, streaming, timeouts\n- **[references\u002Fstate-scheduling.md](references\u002Fstate-scheduling.md)** - State persistence, scheduling\n- **[references\u002Fstreaming-chat.md](references\u002Fstreaming-chat.md)** - AIChatAgent, resumable streams\n- **[references\u002Fmcp.md](references\u002Fmcp.md)** - MCP server integration\n- **[references\u002Femail.md](references\u002Femail.md)** - Email routing and handling\n- **[references\u002Fcodemode.md](references\u002Fcodemode.md)** - Code Mode (experimental)\n",{"name":5,"description":7},"main","342e9dd5d9b9f0e74269a7628faebb54d7ef2900","packages\u002Fopencode\u002Ftest\u002Ffixture\u002Fskills\u002Fagents-sdk","https:\u002F\u002Fgithub.com\u002Fpreetbiswas12\u002FBlitz","https:\u002F\u002Fpreetbiswas12.github.io\u002FBlitz\u002F","https:\u002F\u002Fgithub.com\u002Fpreetbiswas12","https:\u002F\u002Fpreet-biswas.vercel.app","Building code blocks","2026-11-11 13:49:49",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add preetbiswas12\u002FBlitz --skill agents-sdk",{"tool":39,"command":40},"bunx","bunx skills add preetbiswas12\u002FBlitz --skill agents-sdk",{"tool":42,"command":43},"pnpm","pnpm dlx skills add preetbiswas12\u002FBlitz --skill agents-sdk","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fpreetbiswas12\u002FBlitz\u002Fblob\u002Fmain\u002Fpackages\u002Fopencode\u002Ftest\u002Ffixture\u002Fskills\u002Fagents-sdk\u002FSKILL.md",true,[47],{"path":48,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":51,"sourceHtmlUrl":52},"references\u002Fcallable.md","REFERENCE","参考文档",2283,"https:\u002F\u002Fgithub.com\u002Fpreetbiswas12\u002FBlitz\u002Fblob\u002Fmain\u002Fpackages\u002Fopencode\u002Ftest\u002Ffixture\u002Fskills\u002Fagents-sdk\u002Freferences\u002Fcallable.md",[54,61,69,76,83,90],{"skillNo":55,"name":56,"nameZh":6,"description":57,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":58,"categories":59,"keywords":60,"publishedAt":19},"01M7882EZ55JE258GCKN0N41XG","cloudflare","Comprehensive Cloudflare platform skill covering Workers, Pages, storage (KV, D1, R2), AI (Workers AI, Vectorize, Agents SDK), networking (Tunnel, Spectrum), security (WAF, DDoS), and infrastructure-as-code (Terraform, Pulumi). Use for any Cloudflare development task.","https:\u002F\u002Fgithub.com\u002Fpreetbiswas12\u002FBlitz\u002Fblob\u002Fmain\u002Fpackages\u002Fopencode\u002Ftest\u002Ffixture\u002Fskills\u002Fcloudflare\u002FSKILL.md",[],[],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":65,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":19},"01M78824V4TE9CJ31HBV3HTZ0V","humanizer","Rewrite AI-sounding text so it reads naturally without changing what it says.\nUse when editing or reviewing prose for inflated claims,\nsales language, vague sources, repetitive structure, stock AI words, passive\nvoice, filler, or chatbot artifacts. Based on Wikipedia's \"Signs of AI writing.\"","https:\u002F\u002Fgithub.com\u002Fpreetbiswas12\u002FBlitz\u002Fblob\u002Fmain\u002Fhumanizer-main\u002Fhumanizer-main\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fpreetbiswas12\u002FBlitz\u002Fblob\u002Fmain\u002Fhumanizer-main\u002Fhumanizer-main\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":19},"01M78822DXTMFBKTJCET1B4WHZ","effect","Work with Effect v4 \u002F effect-smol TypeScript code in this repo","https:\u002F\u002Fgithub.com\u002Fpreetbiswas12\u002FBlitz\u002Fblob\u002Fmain\u002F.opencode\u002Fskills\u002Feffect\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":19},"01M7881XC5MXE9BQYF3DEDSDT4","vscode-visual-regression","Write Storybook stories and visual regression tests for the Kilo VS Code extension webview UI","https:\u002F\u002Fgithub.com\u002Fpreetbiswas12\u002FBlitz\u002Fblob\u002Fmain\u002F.kilocode\u002Fskills\u002Fvscode-visual-regression\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":19},"01M7881RWCG22482CWGN226RMM","release-jetbrains","Use when releasing the Kilo JetBrains plugin -- resolve a version (\"next rc\" or explicit), run the prepare workflow, edit and commit a filtered human-readable changelog on the release PR, then watch publish to completion.","https:\u002F\u002Fgithub.com\u002Fpreetbiswas12\u002FBlitz\u002Fblob\u002Fmain\u002F.kilo\u002Fskills\u002Frelease-jetbrains\u002FSKILL.md",[],[],{"skillNo":91,"name":92,"nameZh":6,"description":93,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":19},"01M7881NBDBBMXG6ZSZ6A4N8WN","kilocode-merge-minimizer","Use when changing shared upstream-owned files to add Kilo-specific behavior, editing `kilocode_change` markers in shared code, or moving additive behavior out of shared code to reduce upstream merge conflicts. Do not use for changes confined to Kilo-owned paths such as `packages\u002Fkilo-vscode\u002F` or `packages\u002Fkilo-ui\u002F`.","https:\u002F\u002Fgithub.com\u002Fpreetbiswas12\u002FBlitz\u002Fblob\u002Fmain\u002F.kilo\u002Fskills\u002Fkilocode-merge-minimizer\u002FSKILL.md",[],[]]