Source: cloudflare/skills · Maintainer: Cloudflare · License: Apache-2.0 · Checked: 24 October 2026
What is the Cloudflare Agents SDK skill?
The Cloudflare Agents SDK skill is agents-sdk, an official Agent Skill that teaches your coding agent how to build stateful AI agents on Cloudflare with the agents npm package. It gives the agent a map of the current docs, the core APIs, the Wrangler setup and the gotchas that break builds.
Its SKILL.md description reads: "Build, debug, or review Cloudflare Agents SDK applications using the agents package."
Like the rest of the repo, it starts by distrusting the model's memory: "Your knowledge of the Agents SDK may be outdated. Prefer retrieval over pre-training for any Agents SDK task." As of 24 October 2026, the skills.sh page listed 104.8K installs (snapshot, 24 October 2026).
What does it do?
The skill loads when you work on an Agents SDK app. Its SKILL.md is built around five parts:
- A retrieval table. Over 30 topics, almost all linked to a page in the Cloudflare Agents docs: quick start, configuration, state, routing, callable methods, scheduling, workflows, WebSockets, chat agents, the client SDK, email, MCP client and server, human-in-the-loop, durable execution, queues, retries, push notifications, webhooks, voice and more.
- An install check. "FIRST: Verify Installation" with
npm ls agents, thennpm install agentsif it's missing. - Wrangler configuration. A Durable Object binding and a
new_sqlite_classesmigration for each agent class, plus thenodejs_compatflag. - A sample
Agentclass with typed state,validateStateChange,onStateUpdateand a@callable()method, wired up withrouteAgentRequest. - A core API table covering state, SQL, scheduling, RPC, workflows, fibers, queues, retries and broadcasting.
The capabilities it lists include SQLite-backed state synced to clients, @callable() RPC over WebSocket, one-time, recurring and cron scheduling, durable workflows, MCP integration, email handling, streaming chat with AIChatAgent, and React hooks (useAgent, useAgentChat). Voice, browser tools and Think are marked experimental.
The references/ folder has 19 files grouped as core, chat and streaming, background processing, integrations and experimental. Most are short and point the agent to the matching Cloudflare docs page. A few carry decisions of their own: client-sdk.md says to choose useAgent for React state and RPC, AgentClient for other WebSocket clients, and agentFetch for one-off HTTP; mcp.md says "For new servers, prefer createMcpHandler over the deprecated McpAgent."
How do you install it?
Just this skill, with the skills CLI. The command from skills.sh:
npx skills add https://github.com/cloudflare/skills --skill agents-sdk
Add -g to install for every project. The folder goes to .claude/skills/agents-sdk/ in your project, or ~/.claude/skills/agents-sdk/ globally, the Claude Code skill locations.
Claude Code plugin. The repo README gives:
/plugin marketplace add cloudflare/skills
/plugin install cloudflare@cloudflare
This installs every Cloudflare skill and Cloudflare's main remote MCP server.
Codex plugin.
codex plugin marketplace add cloudflare/skills
codex plugin add cloudflare@cloudflare
Other agents. The README covers Cursor (marketplace or a remote rule for cloudflare/skills), VS Code with GitHub Copilot (install from source), and a manual copy into each agent's skills folder. Codex and Cursor read the same SKILL.md format; see Codex skills and Cursor skills.
How do you use it?
Describe the agent you want and where it runs. Example prompts (suggestions, not quotes from the repo):
Create a Cloudflare agent that keeps a per-user todo list in state and exposes add and complete as callable methods.Add a chat agent with AIChatAgent and a React page that uses useAgentChat.Schedule this agent to check an RSS feed every 30 minutes and store new items in SQL.Turn our existing Worker into a remote MCP server with createMcpHandler.Our agent loses state after a deploy. Check the Wrangler migrations.
Requirements: Node.js, a Workers project with Wrangler, and the packages the skill asks for. Chat agents need agents, @cloudflare/ai-chat, ai and @ai-sdk/react. For Workers AI, the skill says to add "ai": { "binding": "AI" } to the config.
Agents are reached at /agents/{agent-name}/{instance-name}, so a Counter class with instance user-123 lives at /agents/counter/user-123. On the client, useAgent({ agent: "Counter", name: "user-123" }) connects to it. For custom routing, the skill shows getAgentByName(env.MyAgent, "instance-id") followed by agent.fetch(request).
Which Agents SDK APIs does the skill cover?
The SKILL.md has a quick reference table so the agent reaches for the right call. A selection, copied from it:
| Task | API in the skill |
|---|---|
| Read and write state | this.state.count, this.setState({ count: 1 }) |
| SQL query | this.sql`SELECT * FROM users WHERE id = ${id}` |
| Run a task after a delay | await this.schedule(60, "task", payload) |
| Cron schedule | await this.schedule("0 * * * *", "task", payload) |
| Repeat on an interval | await this.scheduleEvery(30, "poll") |
| RPC method | @callable() myMethod() { ... } |
| Start a workflow | await this.runWorkflow("ProcessingWorkflow", params) |
| Work that survives eviction | await this.runFiber("name", async (ctx) => { ... }) |
| Enqueue work | this.queue("handler", payload) |
| Retry with backoff | await this.retry(fn, { maxAttempts: 5 }) |
| Send to all clients | this.broadcast(message) |
Because the skill tells the agent to confirm details against the current docs and your installed versions, treat the table as a starting point rather than a full API reference.
Tips and limits
The gotchas in the SKILL.md and its references are worth reading before you start:
- "Do NOT enable
experimentalDecoratorsin tsconfig (breaks@callable)." - Never edit old migrations; always add a new tag. Each agent class needs its own Durable Object binding and migration entry.
- Check installed versions of
agents,@cloudflare/ai-chatand the AI SDK before adapting docs examples. The skill links migration guides for AI SDK v5 and v6. - Think, voice, browser tools and Code Mode are grouped under Experimental; the Code Mode reference notes its "API may change."
Other notes:
- Commands it runs. No scripts ship in the folder, but the skill tells the agent to run
npm lsandnpm install. Approve them as you would any install. - Audits. On 24 October 2026, skills.sh showed Pass from Gen Agent Trust Hub and Socket, and Warn from Snyk (audited 2 October 2026) for "Third-party content exposure detected (indirect prompt injection risk)," because agents it helps build can ingest email and webhooks. Treat inbound messages as untrusted in what you build.
- License. Apache-2.0: you can copy and change it, keeping the license and notices.
Save it in your Kipt library
In Kipt, open Skills and paste the skill's GitHub folder link into the import box. Kipt brings in the SKILL.md and all 19 reference files; because cloudflare/skills holds many skills, it shows a list so you can add the Workers skill in the same step. Your library lives in a private GitHub repo you own and installs into Claude Code or Codex with one command:
npx skills add https://github.com/<you>/<repo>.git --all -g
Kipt is not affiliated with Cloudflare.
Similar skills
- Cloudflare Workers skill: the Workers rules and anti-patterns your agent's code still has to follow.
- MCP builder skill: Anthropic's guide to designing MCP servers, useful before you expose one from an agent.
- Claude API skill: for agents that call Claude models directly.
- Web performance skill: Cloudflare's Core Web Vitals audit, for the front end of a chat app.