Building AI Agent On Cloudflare
majiayu000/claude-skill-registry
Builds AI agents on Cloudflare using the Agents SDK with state management, real-time WebSockets, scheduled tasks, tool integration, and chat capabilities.
Build AI agents on Cloudflare Workers using the Agents SDK. An agent skill from hodgef/apiker.
$ npx skills add hodgef/apiker --skill agents-sdk -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install hodgef/apiker agents-sdk --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/hodgef/apiker.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/agents-sdk .claude/skills/agents-sdk && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "agents-sdk" agent skill from https://github.com/hodgef/apiker/tree/master/.agents/skills/agents-sdk into .claude/skills/agents-sdk/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "agents-sdk", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/hodgef/apiker/tree/master/.agents/skills/agents-sdkType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add hodgef/apiker --skill agents-sdk -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install hodgef/apiker agents-sdk --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/hodgef/apiker.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.agents/skills/agents-sdk .agents/skills/agents-sdk && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "agents-sdk" agent skill from https://github.com/hodgef/apiker/tree/master/.agents/skills/agents-sdk into .agents/skills/agents-sdk/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "agents-sdk", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add hodgef/apiker --skill agents-sdk -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install hodgef/apiker agents-sdk --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/hodgef/apiker.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.agents/skills/agents-sdk .cursor/skills/agents-sdk && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "agents-sdk" agent skill from https://github.com/hodgef/apiker/tree/master/.agents/skills/agents-sdk into .cursor/skills/agents-sdk/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "agents-sdk", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/hodgef/apiker.git --path .agents/skills/agents-sdk--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add hodgef/apiker --skill agents-sdk -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install hodgef/apiker agents-sdk --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/hodgef/apiker.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.agents/skills/agents-sdk .gemini/skills/agents-sdk && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "agents-sdk" agent skill from https://github.com/hodgef/apiker/tree/master/.agents/skills/agents-sdk into .gemini/skills/agents-sdk/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "agents-sdk", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install hodgef/apiker agents-sdkInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add hodgef/apiker --skill agents-sdk -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/hodgef/apiker.git skills-src && mkdir -p .github/skills && cp -r skills-src/.agents/skills/agents-sdk .github/skills/agents-sdk && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "agents-sdk" agent skill from https://github.com/hodgef/apiker/tree/master/.agents/skills/agents-sdk into .github/skills/agents-sdk/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "agents-sdk", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add hodgef/apiker --skill agents-sdk -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install hodgef/apiker agents-sdk --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/hodgef/apiker.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.agents/skills/agents-sdk .opencode/skills/agents-sdk && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "agents-sdk" agent skill from https://github.com/hodgef/apiker/tree/master/.agents/skills/agents-sdk into .opencode/skills/agents-sdk/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "agents-sdk", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
agents-sdkBuild AI agents on Cloudflare Workers using the Agents SDK. An agent skill from hodgef/apiker.
Agents SDK is an agent skill from hodgef/apiker. 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, chat applications, voice agents, or browser automation. Covers Agent class, state management, callable RPC, Workflows, durable execution, queues, retries, observability, and React hooks. Biases towards retrieval from Cloudflare docs over pre-trained knowledge.
Its SKILL.md is about 3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 20 other files, including reference files (for example `references/browse-the-web.md`, `references/callable.md` and `references/client-sdk.md`).
It sits in Backend & APIs, covering MCP servers, Realtime and WebSockets and React components. It works with Cloudflare Workers, Model Context Protocol, Cloudflare and React. The repository describes itself as: 🔼 Create Serverless APIs with Cloudflare Workers, Durable Objects & Wrangler. The licence is MIT.
Read from SKILL.md and the folder at commit 444ace2. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
npmFrom the folder's file list and the shell code blocks in SKILL.md.
Links to these hosts (documentation or services it may open):
developers.cloudflare.comFrom URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Agents SDK loads about 3k tokens when it runs, and up to ~15k if it reads all its reference files. Until then it costs about 111 tokens; SKILL.md has 666 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from hodgef/apiker at commit 444ace2, republished under its MIT licence (© hodgef). 666 words, ~3,030 tokens.
.claude/skills/agents-sdk/SKILL.md (or your agent's skills folder). This skill also uses 19 other files; get the full folder from GitHub.Your knowledge of the Agents SDK may be outdated. Prefer retrieval over pre-training for any Agents SDK task.
Cloudflare docs: https://developers.cloudflare.com/agents/
| Topic | Docs URL | Use for |
|---|---|---|
| Getting started | Quick start | First agent, project setup |
| Adding to existing project | Add to existing project | Install into existing Workers app |
| Configuration | Configuration | wrangler.jsonc, bindings, assets, deployment |
| Agent class | Agents API | Agent lifecycle, patterns, pitfalls |
| State | Store and sync state | setState, validateStateChange, persistence |
| Routing | Routing | URL patterns, routeAgentRequest |
| Callable methods | Callable methods | @callable, RPC, streaming, timeouts |
| Scheduling | Schedule tasks | schedule(), scheduleEvery(), cron |
| Workflows | Run workflows | AgentWorkflow, durable multi-step tasks |
| HTTP/WebSockets | WebSockets | Lifecycle hooks, hibernation |
| Chat agents | Chat agents | AIChatAgent, streaming, tools, persistence |
| Client SDK | Client SDK | useAgent, useAgentChat, React hooks |
| Client tools | Client tools | Client-side tools, autoContinueAfterToolResult |
| Server-driven messages | Trigger patterns | saveMessages, waitUntilStable, server-initiated turns |
| Resumable streaming | Resumable streaming | Stream recovery on disconnect |
| Email routing, secure reply resolver | ||
| MCP client | MCP client | Connecting to MCP servers |
| MCP server | MCP server | Building MCP servers with McpAgent |
| MCP transports | MCP transports | Streamable HTTP, SSE, RPC transport options |
| Securing MCP servers | Securing MCP | OAuth, proxy MCP, hardening |
| Human-in-the-loop | Human-in-the-loop | Approval flows, needsApproval, workflows |
| Durable execution | Durable execution | runFiber(), stash(), surviving DO eviction |
| Queue | Queue | Built-in FIFO queue, queue() |
| Retries | Retries | this.retry(), backoff/jitter |
| Observability | Observability | Diagnostics-channel events |
| Push notifications | Push notifications | Web Push + VAPID from agents |
| Webhooks | Webhooks | Receiving external webhooks |
| Cross-domain auth | Cross-domain auth | WebSocket auth, tokens, CORS |
| Readonly connections | Readonly | shouldConnectionBeReadonly |
| Voice | Voice | Experimental STT/TTS, withVoice |
| Browse the web | Browser tools | Experimental CDP browser automation |
| Think | Think | Experimental higher-level chat agent class |
| Migrations | AI SDK v5, AI SDK v6 | Upgrading @cloudflare/ai-chat |
The Agents SDK provides:
setState@callable() methods invoked over WebSocketscheduleEvery), and cron tasksAgentWorkflowrunFiber() / stash() for work that survives DO evictionqueue()this.retry() with exponential backoff and jitterMcpAgentAIChatAgent with resumable streams, message persistence, toolssaveMessages, waitUntilStable for proactive agent turnsuseAgent, useAgentChat for client appsdiagnostics_channel events for state, RPC, schedule, lifecycle@cloudflare/voiceagents/browser@cloudflare/thinknpm ls agents # Should show agents packageIf not installed:
npm install agentsFor chat agents:
npm install agents @cloudflare/ai-chat ai @ai-sdk/react{
"compatibility_flags": ["nodejs_compat"],
"durable_objects": {
"bindings": [{ "name": "MyAgent", "class_name": "MyAgent" }]
},
"migrations": [{ "tag": "v1", "new_sqlite_classes": ["MyAgent"] }]
}Gotchas:
experimentalDecorators in tsconfig (breaks @callable)"ai": { "binding": "AI" } for Workers AIimport { Agent, routeAgentRequest, callable } from "agents";
type State = { count: number };
export class Counter extends Agent<Env, State> {
initialState = { count: 0 };
validateStateChange(nextState: State, source: Connection | "server") {
if (nextState.count < 0) throw new Error("Count cannot be negative");
}
onStateUpdate(state: State, source: Connection | "server") {
console.log("State updated:", state);
}
@callable()
increment() {
this.setState({ count: this.state.count + 1 });
return this.state.count;
}
}
export default {
fetch: (req, env) => routeAgentRequest(req, env) ?? new Response("Not found", { status: 404 })
};Requests route to /agents/{agent-name}/{instance-name}:
| Class | URL |
|---|---|
Counter | /agents/counter/user-123 |
ChatRoom | /agents/chat-room/lobby |
Client: useAgent({ agent: "Counter", name: "user-123" })
Custom routing: use getAgentByName(env.MyAgent, "instance-id") then agent.fetch(request).
| Task | API |
|---|---|
| Read state | this.state.count |
| Write state | this.setState({ count: 1 }) |
| SQL query | this.sql`SELECT * FROM users WHERE id = ${id}` |
| Schedule (delay) | await this.schedule(60, "task", payload) |
| Schedule (cron) | await this.schedule("0 * * * *", "task", payload) |
| Schedule (interval) | await this.scheduleEvery(30, "poll") |
| RPC method | @callable() myMethod() { ... } |
| Streaming RPC | @callable({ streaming: true }) stream(res) { ... } |
| Start workflow | await this.runWorkflow("ProcessingWorkflow", params) |
| Durable fiber | await this.runFiber("name", async (ctx) => { ... }) |
| Enqueue work | this.queue("handler", payload) |
| Retry with backoff | await this.retry(fn, { maxAttempts: 5 }) |
| Broadcast to clients | this.broadcast(message) |
| Get connections | this.getConnections(tag?) |
import { useAgent } from "agents/react";
function App() {
const [state, setLocalState] = useState({ count: 0 });
const agent = useAgent({
agent: "Counter",
name: "my-instance",
onStateUpdate: (newState) => setLocalState(newState),
onIdentity: (name, agentType) => console.log(`Connected to ${name}`)
});
return (
<button onClick={() => agent.setState({ count: state.count + 1 })}>
Count: {state.count}
</button>
);
}getAgentByNameuseAgent, useAgentChat, AgentClientsaveMessagesneedsApprovalrunFiber, stash, surviving eviction@cloudflare/think higher-level chat agent@cloudflare/voice STT/TTS© hodgef, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 19 other files (references) in .agents/skills/agents-sdk of hodgef/apiker.
Open the folder on GitHubat commit 444ace2
We found 3 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 3 other GitHub owners. This page covers the copy in hodgef/apiker, which our catalogue first saw on October 7, 2026.
Agents SDK next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Agents SDK this skillhodgef/apiker | 127 | 3 repos | ~3k | Automated safety check: Pass | MIT | |
| Building AI Agent On Cloudflaremajiayu000/claude-skill-registry | 666 | 1 repos | ~2.3k | Automated safety check: Pass | MIT | |
| Cloudflare Browser Renderingeinverne/dotfiles | 121 | — | ~4.9k | Automated safety check: Pass | GPL-3.0 | |
| Cloudflare Agentssecondsky/claude-skills | 227 | 1 repos | ~691 | Automated safety check: Pass | MIT | |
| Solana Devaiskillstore/marketplace | 430 | — | ~2.4k | Automated safety check: Pass | MIT | |
| Cloudflare Browser Renderingcloudflare/moltworker | 9.9k | — | ~742 | Automated safety check: Pass | Apache-2.0 |
majiayu000/claude-skill-registry
Builds AI agents on Cloudflare using the Agents SDK with state management, real-time WebSockets, scheduled tasks, tool integration, and chat capabilities.
einverne/dotfiles
Guide for implementing Cloudflare Browser Rendering - a headless browser automation API for screenshots, PDFs, web scraping, and testing.
secondsky/claude-skills
Build AI agents on Cloudflare Workers with MCP integration, tool use, and LLM providers.
aiskillstore/marketplace
A skill your agent uses when user asks to "build a Solana dapp", "write an Anchor program", "create a token", "debug Solana errors", "set up wallet connection", "test my Solana program", "deploy to…
cloudflare/moltworker
Drives headless Chrome through Cloudflare Browser Rendering over a CDP WebSocket to take screenshots, navigate and scrape pages, and record multi-page videos.
cloudflare/skills
Build, debug, or review Cloudflare Agents SDK applications using the agents package.
hodgef/apiker
Comprehensive Cloudflare platform skill covering Workers, Pages, storage (KV, D1, R2), AI (Workers AI, Vectorize, Agents SDK), feature flags (Flagship), networking (Tunnel, Spectrum), security (WAF…
hodgef/apiker
Create and review Cloudflare Durable Objects. An agent skill from hodgef/apiker.
hodgef/apiker
Send and receive transactional emails with Cloudflare Email Service (Email Sending + Email Routing).
hodgef/apiker
Analyzes web performance using Chrome DevTools MCP. An agent skill from hodgef/apiker.
hodgef/apiker
Reviews and authors Cloudflare Workers code against production best practices.
hodgef/apiker
Develop, review, and extend the Apiker library — a framework for building serverless REST APIs on Cloudflare Workers + Durable Objects.
Build AI agents on Cloudflare Workers using the Agents SDK. An agent skill from hodgef/apiker. Agents SDK is an agent skill from hodgef/apiker. Build AI agents on Cloudflare Workers using the Agents SDK.
Agents SDK fits situations like: tasks that involve MCP servers; tasks that involve Realtime and WebSockets; tasks that involve React components.
Run `npx skills add hodgef/apiker --skill agents-sdk -a claude-code`. Or copy the skill folder (.agents/skills/agents-sdk in hodgef/apiker) into .claude/skills/agents-sdk in your project. Claude Code loads it when a task matches its description.
Run `npx skills add hodgef/apiker --skill agents-sdk -a codex`. Or copy the skill folder (.agents/skills/agents-sdk in hodgef/apiker) into .agents/skills/agents-sdk in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add hodgef/apiker --skill agents-sdk -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/agents-sdk, .gemini/skills/agents-sdk, .github/skills/agents-sdk and .opencode/skills/agents-sdk in your project.
Going by SKILL.md and its folder, Agents SDK needs the command-line tools its instructions call (npm). Our summary lists: Node.js.
SKILL.md names 1 domain. As links in the text: developers.cloudflare.com. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Agents SDK is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 3k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 12k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Agents SDK: Building AI Agent On Cloudflare (majiayu000/claude-skill-registry, 666 stars), Cloudflare Browser Rendering (einverne/dotfiles, 121 stars), Cloudflare Agents (secondsky/claude-skills, 227 stars) and Solana Dev (aiskillstore/marketplace, 430 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
hodgef (a GitHub user) maintains it in hodgef/apiker, which has 127 GitHub stars. The repository holds 11 skills in this directory. The repository was last updated on August 20, 2026.
Source: hodgef/apiker on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.