Agent skill

Agents SDK

by hodgef in hodgef/apiker

Build AI agents on Cloudflare Workers using the Agents SDK. An agent skill from hodgef/apiker.

MITAuto-check passedBackend & APIs

Install Agents SDK

skills CLI
$ npx skills add hodgef/apiker --skill agents-sdk -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install hodgef/apiker agents-sdk --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ 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-src

Use ~/.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/

Facts

Skill name
agents-sdk
GitHub stars
127
Used in
3 other repos
Token cost
~3k tokens
SKILL.md length
666 words
Files
20 (incl. references)
Skills in repo
11
Repo updated
First seen
Licence
MIT

At a glance

Build AI agents on Cloudflare Workers using the Agents SDK. An agent skill from hodgef/apiker.

  • Tasks that involve MCP servers
  • SKILL.md covers Retrieval Sources, Capabilities, FIRST: Verify Installation and Wrangler Configuration, plus 5 more sections
  • Calls npm
  • Tasks that involve Realtime and WebSockets

What it does

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.

When your agent uses it

  • Tasks that involve MCP servers
  • Tasks that involve Realtime and WebSockets
  • Tasks that involve React components

Example prompts

  • “/agents-sdk”

Requirements

  • Node.js

What it can do on your machine

Read from SKILL.md and the folder at commit 444ace2. It shows what the files ask for, not the result of running them.

  • Tool permissions

    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.

  • Runs code

    Shell commands in SKILL.md call:

    • npm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • developers.cloudflare.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

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.

Always · name and description, kept in context so the agent knows when to use it
~111
When it runs · the whole SKILL.md, loaded when a task matches
~3k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~15k

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.

Safety

Auto-check passed

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.

SKILL.md

The full file from hodgef/apiker at commit 444ace2, republished under its MIT licence (© hodgef). 666 words, ~3,030 tokens.

Download SKILL.mdSave it as .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.
name
agents-sdk
description
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.

Cloudflare Agents SDK

Your knowledge of the Agents SDK may be outdated. Prefer retrieval over pre-training for any Agents SDK task.

Retrieval Sources

Cloudflare docs: https://developers.cloudflare.com/agents/

TopicDocs URLUse for
Getting startedQuick startFirst agent, project setup
Adding to existing projectAdd to existing projectInstall into existing Workers app
ConfigurationConfigurationwrangler.jsonc, bindings, assets, deployment
Agent classAgents APIAgent lifecycle, patterns, pitfalls
StateStore and sync statesetState, validateStateChange, persistence
RoutingRoutingURL patterns, routeAgentRequest
Callable methodsCallable methods@callable, RPC, streaming, timeouts
SchedulingSchedule tasksschedule(), scheduleEvery(), cron
WorkflowsRun workflowsAgentWorkflow, durable multi-step tasks
HTTP/WebSocketsWebSocketsLifecycle hooks, hibernation
Chat agentsChat agentsAIChatAgent, streaming, tools, persistence
Client SDKClient SDKuseAgent, useAgentChat, React hooks
Client toolsClient toolsClient-side tools, autoContinueAfterToolResult
Server-driven messagesTrigger patternssaveMessages, waitUntilStable, server-initiated turns
Resumable streamingResumable streamingStream recovery on disconnect
EmailEmailEmail routing, secure reply resolver
MCP clientMCP clientConnecting to MCP servers
MCP serverMCP serverBuilding MCP servers with McpAgent
MCP transportsMCP transportsStreamable HTTP, SSE, RPC transport options
Securing MCP serversSecuring MCPOAuth, proxy MCP, hardening
Human-in-the-loopHuman-in-the-loopApproval flows, needsApproval, workflows
Durable executionDurable executionrunFiber(), stash(), surviving DO eviction
QueueQueueBuilt-in FIFO queue, queue()
RetriesRetriesthis.retry(), backoff/jitter
ObservabilityObservabilityDiagnostics-channel events
Push notificationsPush notificationsWeb Push + VAPID from agents
WebhooksWebhooksReceiving external webhooks
Cross-domain authCross-domain authWebSocket auth, tokens, CORS
Readonly connectionsReadonlyshouldConnectionBeReadonly
VoiceVoiceExperimental STT/TTS, withVoice
Browse the webBrowser toolsExperimental CDP browser automation
ThinkThinkExperimental higher-level chat agent class
MigrationsAI SDK v5, AI SDK v6Upgrading @cloudflare/ai-chat

Capabilities

The Agents SDK provides:

  • Persistent state — SQLite-backed, auto-synced to clients via setState
  • Callable RPC — @callable() methods invoked over WebSocket
  • Scheduling — One-time, recurring (scheduleEvery), and cron tasks
  • Workflows — Durable multi-step background processing via AgentWorkflow
  • Durable execution — runFiber() / stash() for work that survives DO eviction
  • Queue — Built-in FIFO queue with retries via queue()
  • Retries — this.retry() with exponential backoff and jitter
  • MCP integration — Connect to MCP servers or build your own with McpAgent
  • Email handling — Receive and reply to emails with secure routing
  • Streaming chat — AIChatAgent with resumable streams, message persistence, tools
  • Server-driven messages — saveMessages, waitUntilStable for proactive agent turns
  • React hooks — useAgent, useAgentChat for client apps
  • Observability — diagnostics_channel events for state, RPC, schedule, lifecycle
  • Push notifications — Web Push + VAPID delivery from agents
  • Webhooks — Receive and verify external webhooks
  • Voice (experimental) — STT/TTS via @cloudflare/voice
  • Browser tools (experimental) — CDP-powered browsing via agents/browser
  • Think (experimental) — Higher-level chat agent via @cloudflare/think
Show full SKILL.md (248 more words)Show less

FIRST: Verify Installation

bash
npm ls agents  # Should show agents package

If not installed:

bash
npm install agents

For chat agents:

bash
npm install agents @cloudflare/ai-chat ai @ai-sdk/react

Wrangler Configuration

jsonc
{
  "compatibility_flags": ["nodejs_compat"],
  "durable_objects": {
    "bindings": [{ "name": "MyAgent", "class_name": "MyAgent" }]
  },
  "migrations": [{ "tag": "v1", "new_sqlite_classes": ["MyAgent"] }]
}

Gotchas:

  • Do NOT enable experimentalDecorators in tsconfig (breaks @callable)
  • Never edit old migrations — always add new tags
  • Each agent class needs its own DO binding + migration entry
  • Add "ai": { "binding": "AI" } for Workers AI

Agent Class

typescript
import { 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 })
};

Routing

Requests route to /agents/{agent-name}/{instance-name}:

ClassURL
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).

Core APIs

TaskAPI
Read statethis.state.count
Write statethis.setState({ count: 1 })
SQL querythis.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 workflowawait this.runWorkflow("ProcessingWorkflow", params)
Durable fiberawait this.runFiber("name", async (ctx) => { ... })
Enqueue workthis.queue("handler", payload)
Retry with backoffawait this.retry(fn, { maxAttempts: 5 })
Broadcast to clientsthis.broadcast(message)
Get connectionsthis.getConnections(tag?)

React Client

tsx
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>
  );
}

References

Core
Chat & Streaming
Background Processing
Integrations
Experimental

© hodgef, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 19 other files (references) in .agents/skills/agents-sdk of hodgef/apiker.

  • SKILL.md
  • references/browse-the-web.md
  • references/callable.md
  • references/client-sdk.md
  • references/codemode.md
  • references/configuration.md
  • references/durable-execution.md
  • references/email.md
  • references/human-in-the-loop.md
  • references/mcp.md
  • references/observability.md
  • references/queue-retries.md
  • references/routing.md
  • references/server-driven-messages.md
  • references/state-scheduling.md
  • references/streaming-chat.md
  • references/think.md
  • references/voice.md
  • references/webhooks-push.md
  • references/workflows.md

Open the folder on GitHubat commit 444ace2

Used in 3 other repositories

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.

Compare with similar skills

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.

Agents SDK compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Agents SDK this skillhodgef/apiker1273 repos~3kAutomated safety check: PassMIT
Building AI Agent On Cloudflaremajiayu000/claude-skill-registry6661 repos~2.3kAutomated safety check: PassMIT
Cloudflare Browser Renderingeinverne/dotfiles121—~4.9kAutomated safety check: PassGPL-3.0
Cloudflare Agentssecondsky/claude-skills2271 repos~691Automated safety check: PassMIT
Solana Devaiskillstore/marketplace430—~2.4kAutomated safety check: PassMIT
Cloudflare Browser Renderingcloudflare/moltworker9.9k—~742Automated safety check: PassApache-2.0

Similar skills

  • 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.

    666 GitHub starsUsed in 1 repo~2.3k tokens
    Backend & APIsAuto-check passed
  • Guide for implementing Cloudflare Browser Rendering - a headless browser automation API for screenshots, PDFs, web scraping, and testing.

    121 GitHub stars~4.9k tokensUpdated 29 days ago
    Productivity & AutomationAuto-check passed
  • Cloudflare Agents

    secondsky/claude-skills

    Build AI agents on Cloudflare Workers with MCP integration, tool use, and LLM providers.

    227 GitHub starsUsed in 1 repo~691 tokens
    Agent WorkflowsAuto-check passed
  • Solana Dev

    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…

    430 GitHub stars~2.4k tokensUpdated today
    Backend & APIsAuto-check passed
  • Cloudflare Browser Rendering

    cloudflare/moltworker

    Official

    Drives headless Chrome through Cloudflare Browser Rendering over a CDP WebSocket to take screenshots, navigate and scrape pages, and record multi-page videos.

    9.9k GitHub stars~742 tokensUpdated 5 mo ago
    Productivity & AutomationAuto-check passed
  • Agents SDK

    cloudflare/skills

    Official

    Build, debug, or review Cloudflare Agents SDK applications using the agents package.

    3k GitHub starsUsed in 2 repos~3k tokens
    Agent WorkflowsAuto-check passed

More from hodgef/apiker

All 11 skills in this repo
  • Cloudflare

    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…

    127 GitHub starsUsed in 7 repos~2.2k tokens
    Auto-check passed
  • Durable Objects

    hodgef/apiker

    Create and review Cloudflare Durable Objects. An agent skill from hodgef/apiker.

    127 GitHub starsUsed in 4 repos~1.5k tokens
    Auto-check passed
  • Send and receive transactional emails with Cloudflare Email Service (Email Sending + Email Routing).

    127 GitHub starsUsed in 3 repos~2k tokens
    Auto-check passed
  • Web Perf

    hodgef/apiker

    Analyzes web performance using Chrome DevTools MCP. An agent skill from hodgef/apiker.

    127 GitHub starsUsed in 5 repos~2k tokens
    Auto-check passed
  • Reviews and authors Cloudflare Workers code against production best practices.

    127 GitHub starsUsed in 6 repos~1.8k tokens
    Auto-check passed
  • Apiker

    hodgef/apiker

    Develop, review, and extend the Apiker library — a framework for building serverless REST APIs on Cloudflare Workers + Durable Objects.

    127 GitHub stars~1.4k tokensUpdated 1 mo ago
    Auto-check passed

Questions about Agents SDK

What does Agents SDK do?

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.

When should I use Agents SDK?

Agents SDK fits situations like: tasks that involve MCP servers; tasks that involve Realtime and WebSockets; tasks that involve React components.

How do I install Agents SDK in Claude Code?

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.

How do I install Agents SDK in Codex?

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.

Can I use Agents SDK in Cursor, Gemini CLI or GitHub Copilot?

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.

What does Agents SDK need to run?

Going by SKILL.md and its folder, Agents SDK needs the command-line tools its instructions call (npm). Our summary lists: Node.js.

Does Agents SDK access the network?

SKILL.md names 1 domain. As links in the text: developers.cloudflare.com. This is read from the text; nothing was executed.

Is Agents SDK safe to install?

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.

What licence does Agents SDK use?

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.

How many tokens does Agents SDK use?

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.

What are the alternatives to Agents SDK?

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.

Who maintains Agents SDK?

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.