mirror of
https://github.com/cloudflare/skills.git
synced 2026-09-14 16:49:26 +08:00
e96fbc77bc
Replace legacy building-* guides with a consolidated agents-sdk skill: update SKILL.md to expand capabilities and retrieval links, add multiple new reference pages (client-sdk, configuration, durable-execution, browse-the-web, human-in-the-loop, observability, queue-retries, routing, server-driven-messages, and others), and update command docs (build-agent.md, build-mcp.md) to point to the agents-sdk pages and include scaffold examples. Remove deprecated building-ai-agent-on-cloudflare and building-mcp-server-on-cloudflare content. These changes centralize documentation around the Agents SDK, add scaffold/snippet guidance, and refresh links to the live Cloudflare developer docs.
2.2 KiB
2.2 KiB
description, argument-hint, allowed-tools
| description | argument-hint | allowed-tools | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Build an AI agent on Cloudflare using the Agents SDK |
|
|
Build AI Agent on Cloudflare
Arguments
The user invoked this command with: $ARGUMENTS
Instructions
When this command is invoked:
- Read the skill file at
agents-sdk/SKILL.mdfor core SDK guidance, APIs, and wrangler config - Based on what the user wants to build, read the relevant references from
agents-sdk/references/:- For chat/AI agents:
streaming-chat.md,client-sdk.md - For state management:
state-scheduling.md - For RPC methods:
callable.md - For background work:
workflows.md,durable-execution.md,queue-retries.md - For MCP integration:
mcp.md - For email handling:
email.md - For webhooks/push:
webhooks-push.md - For approval flows:
human-in-the-loop.md - For voice:
voice.md - For browser tools:
browse-the-web.md - For higher-level chat:
think.md
- For chat/AI agents:
- Fetch the relevant pages from https://developers.cloudflare.com/agents/ for the latest API details
- Always start with
configuration.mdandrouting.mdfor project setup
Scaffold Steps
- Create project:
npx create-cloudflare@latest --template cloudflare/agents-starter - Configure wrangler.jsonc: DO bindings, migrations, AI binding, assets
- Implement agent class: extend
AgentorAIChatAgentdepending on use case - Wire routing:
routeAgentRequestin the default export - Build client:
useAgent+useAgentChatReact hooks - Deploy:
npx wrangler deploy
Key Decision: Agent vs AIChatAgent vs Think
| Need | Use | Package |
|---|---|---|
| Custom stateful logic, RPC, scheduling | Agent |
agents |
| AI chat with streaming, tools, persistence | AIChatAgent |
@cloudflare/ai-chat |
| AI chat with automatic tool loop, built-in workspace | Think |
@cloudflare/think (experimental) |
Example Usage
/build-agent a customer support chatbot with tool calling
/build-agent a real-time collaborative editor with state sync
/build-agent a background processing agent with scheduled tasks
/build-agent a voice assistant that can browse the web