Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add commands/cloudflare/skills/build-agentgit clone --depth 1 https://github.com/cloudflare/skillsWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00011 | $0.00581 |
| Opus 5 | $0.00005 | $0.00291 |
| Sonnet 5 | $0.00002 | $0.00116 |
| Haiku 4.5 | $0.00001 | $0.00058 |
Grade A, and why
build-agent scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 58 lines — stays where its author put it; the contents beside it link to each section on GitHub.
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
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 3d ago First seen · 58 lines · 11 tokens per session scan A 4d2f9777e0bf
build-agent is a command published in the GitHub repository cloudflare/skills (2,759 stars, last pushed 26d ago), licensed Apache-2.0. It adds 11 tokens to every session and 581 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other commands, from other repositories
remoto-status
Show the remote agent fleet: host health and all jobs with their states.
configure-blob
Create and configure an Azure Blob Storage account with security best practices.
demo-command
Example slash command that wraps the demo-skill. Showcases the command kind.
claude-cmd-status
A Claude Code slash command. OpenCode does not read Claude commands.
constatar-audit
Audit a constatar run — conformance, health trends, cost.
environment-switching-local-cloud-ssh
The environment selector at the bottom of Claude Code switches where work executes: local for fast interactive iteration, cloud (Anthropic servers) for routines that must run with your machine off, SSH for driving a remote box like a VPS.