agents-sdk
Build AI agents on Cloudflare Workers using the Agents SDK.
Skill by s0ld13rr
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/s0ld13rr-agents-sdk
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: frontend, testing, cloud, agent-building
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/agents-sdk
What's inside
- Skill 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, or chat applications. Covers Agent class, state management, callable RPC, Workflows integration, and React hooks.
- License
- MIT
- Instructions
- 149 lines in SKILL.md · view on GitHub
Agent Skills spec issues
- files: referenced but missing: references/workflows.md, references/state-scheduling.md, references/streaming-chat.md, references/mcp.md, references/email.md
Files (2)
- SKILL.md
- callable.md · references/
SKILL.md (first lines)
# Cloudflare Agents SDK
**STOP.** Your knowledge of the Agents SDK may be outdated. Prefer retrieval over pre-training for any Agents SDK task.
## Documentation
Fetch current docs from `https://github.com/cloudflare/agents/tree/main/docs` before implementing.
| Topic | Doc | Use for |
| ------------------- | ----------------------------- | ---------------------------------------------- |
| Getting started | `docs/getting-started.md` | First agent, project setup |
| State | `docs/state.md` | `setState`, `validateStateChange`, persistence |
| Routing | `docs/routing.md` | URL patterns, `routeAgentRequest`, `basePath` |
| Callable methods | `docs/callable-methods.md` | `@callable`, RPC, streaming, timeouts |
| Scheduling | `docs/scheduling.md` | `schedule()`, `scheduleEvery()`, cron |
| Workflows | `docs/workflows.md` | `AgentWorkflow`, durable multi-step tasks |
| HTTP/WebSockets | `docs/http-websockets.md` | Lifecycle hooks, hibernation |
| Email | `docs/email.md` | Email routing, secure reply resolver |
| MCP client | `docs/mcp-client.md` | Connecting to MCP servers |
| MCP server | `docs/mcp-servers.md` | Building MCP servers with `McpAgent` |
| Client SDK | `docs/client-sdk.md` | `useAgent`, `useAgentChat`, React hooks |
| Human-in-the-loop | `docs/human-in-the-loop.md` | Approval flows, pausing workflows |
| Resumable streaming | `docs/resumable-streaming.md` | Stream recovery on disconnect |
Cloudflare docs: https://developers.cloudflare.com/agents/
## Capabilities
The Agents SDK provides:
- **Persistent state** - SQLite-backed, auto-synced to clients
- **Callable RPC** - `@callable()` methods invoked over WebSocket
- **Scheduling** - One-time, recurring (`scheduleEvery`), and cron tasks
- **Workflows** - Durable multi-step background processing via `AgentWorkflow`
- **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
- **React hooks** - `useAgent`, `useAgentChat` for client apps
## FIRST: Verify Installation
```bash
npm ls agents # Should show agents package
```
If not installed:
```bash
npm install agents
```
## Wrangler Configuration
```jsonc
{
"durable_objects": {
"bindings": [{ "name": "MyAgent", "class_name": "MyAgent" }],
},
"migrations": [{ "tag": "v1", "new_sqlite_classes": ["MyAgent"] }],
}
```
## Agent Class
```typescript
import { Agent, routeAgentRequest, callable } from "agents"
type State = { count: number }
export class Counter extends Agent<Env, State> {
initialState = { count: 0 }
// Validation hook - runs before state persists (sync, throwing rejects the update)
validateStateChange(nextState: State, source: Connection | "server") {
if (nextState.count < 0) throw new Error("Count cannot be negative")
}
// Notification hook - runs after state persists (async, non-blocking)
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}`:
| Class | URL |
| ---------- | -------------------------- |
| `Counter` | `/agents/counter/user-123` |
| `ChatRoom` | `/agents/chat-room/lobby` |
Client: `useAgent({ agent: "Counter", name: "user-123" })`
## Core APIs
| 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)` |From s0ld13rr/pentestcode, MIT.
More from s0ld13rr/pentestcode
- 0.814score
cloudflare
s0ld13rr
Comprehensive Cloudflare platform skill covering Workers, Pages, storage (KV, D1, R2), AI (Workers AI, Vectorize, Agents SDK), networking (Tunnel, Spectrum)…
SkillAFreshness: A★ 883Claude Code +9 - 0.812score
svc-web-server
s0ld13rr
Web SERVER software (not app-layer) attack techniques — server misconfigs, known server CVEs, path traversal, exposed status/config.
SkillAFreshness: A★ 883Claude Code +9 - 0.812score
web-xxe
s0ld13rr
XML External Entity injection detection→file-read/SSRF→proof for web apps.
SkillAFreshness: A★ 883Claude Code +9 - 0.812score
vuln-assess-phase
s0ld13rr
Vulnerability analysis — triage scanner output, verify manually, score with CVSS, mark false positives.
SkillAFreshness: A★ 883Claude Code +9 - 0.812score
web-deserialization
s0ld13rr
Insecure deserialization to RCE for web apps.
SkillAFreshness: A★ 883Claude Code +9 - 0.812score
web-lfi-traversal
s0ld13rr
Path traversal / Local File Inclusion detection→file-read→RCE for web apps.
SkillAFreshness: A★ 883Claude Code +9 - 0.812score
web-auth-bypass-idor
s0ld13rr
Broken access control - IDOR, privilege escalation, JWT abuse, mass assignment, forced browsing - for web apps and APIs.
SkillAFreshness: A★ 883Claude Code +9 - 0.812score
web-upload-rce
s0ld13rr
File-upload abuse to code execution for web apps.
SkillAFreshness: A★ 883Claude Code +9 - 0.812score
web-ssti
s0ld13rr
Server-Side Template Injection detection→engine-fingerprint→RCE for web apps.
SkillAFreshness: A★ 883Claude Code +9 - 0.812score
web-ssrf
s0ld13rr
Server-Side Request Forgery detection→internal-access→proof for web apps.
SkillAFreshness: A★ 883Claude Code +9 - 0.812score
web-sqli
s0ld13rr
SQL injection detection→exploitation→proof for web apps and APIs.
SkillAFreshness: A★ 883Claude Code +9 - 0.812score
svc-ssh
s0ld13rr
SSH version CVEs and post-auth tricks — regreSSHion, user enum, agent hijack.
SkillAFreshness: A★ 883Claude Code +9
Compare and alternatives
Featured in
Signals
- Stars
- 883
- Forks
- 139
- Open issues
- 3
- Last commit (this folder)
- Jul 8, 2026 (3 months ago)
- Last release
- Oct 23, 2026 (4 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/s0ld13rr/pentestcode
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
Same skill elsewhere
Copies of this SKILL.md published by others; search shows only one of them.
- 0.340score
agents-sdk
itsdarktoday
Build AI agents on Cloudflare Workers using the Agents SDK.
SkillBFreshness: B★ 12Claude Code +9 - 0.323score
agents-sdk
stylesxzz
Build AI agents on Cloudflare Workers using the Agents SDK.
SkillAFreshness: AClaude Code +9 - 0.301score
agents-sdk
Vidoxlabs
Build AI agents on Cloudflare Workers using the Agents SDK.
SkillBFreshness: BClaude Code +9 - 0.245score
agents-sdk
involvex
Build AI agents on Cloudflare Workers using the Agents SDK.
SkillDFreshness: D★ 1Claude Code +9 - 0.229score
agents-sdk
involvex
Build AI agents on Cloudflare Workers using the Agents SDK.
SkillDFreshness: DClaude Code +9
More from s0ld13rr
- 0.814score
cloudflare
s0ld13rr
Comprehensive Cloudflare platform skill covering Workers, Pages, storage (KV, D1, R2), AI (Workers AI, Vectorize, Agents SDK), networking (Tunnel, Spectrum)…
SkillAFreshness: A★ 883Claude Code +9 - 0.812score
web-ssti
s0ld13rr
Server-Side Template Injection detection→engine-fingerprint→RCE for web apps.
SkillAFreshness: A★ 883Claude Code +9 - 0.812score
web-upload-rce
s0ld13rr
File-upload abuse to code execution for web apps.
SkillAFreshness: A★ 883Claude Code +9 - 0.812score
vuln-assess-phase
s0ld13rr
Vulnerability analysis — triage scanner output, verify manually, score with CVSS, mark false positives.
SkillAFreshness: A★ 883Claude Code +9 - 0.812score
web-xxe
s0ld13rr
XML External Entity injection detection→file-read/SSRF→proof for web apps.
SkillAFreshness: A★ 883Claude Code +9 - 0.812score
web-ssrf
s0ld13rr
Server-Side Request Forgery detection→internal-access→proof for web apps.
SkillAFreshness: A★ 883Claude Code +9
Cite this page
agents-sdk skill. Agent Mart. https://agentmart.dev/skills/s0ld13rr-agents-sdk (last updated 2026-10-24)