agents-sdk — community agents-sdk, community, ide skills, Claude Code, Cursor, Windsurf

v1.0.0

About this Skill

Perfect for Cloudflare Agents needing persistent, stateful AI applications with durable object bindings and SQLite migrations. Build stateful AI agents using the Cloudflare Agents SDK. Load when creating agents with persistent state, scheduling, RPC, MCP servers, email handling, or streaming chat. Covers Agent class, AIChatAg

charl-kruger charl-kruger
[0]
[0]
Updated: 3/7/2026

Killer-Skills Review

Decision support comes first. Repository text comes second.

Reviewed Landing Page Review Score: 9/11

Killer-Skills keeps this page indexable because it adds recommendation, limitations, and review signals beyond the upstream repository text.

Original recommendation layer Concrete use-case guidance Explicit limitations and caution Quality floor passed for review Locale and body language aligned
Review Score
9/11
Quality Score
54
Canonical Locale
en
Detected Body Locale
en

Perfect for Cloudflare Agents needing persistent, stateful AI applications with durable object bindings and SQLite migrations. Build stateful AI agents using the Cloudflare Agents SDK. Load when creating agents with persistent state, scheduling, RPC, MCP servers, email handling, or streaming chat. Covers Agent class, AIChatAg

Core Value

Empowers agents to build long-lived AI applications on Cloudflare Workers using the `agents` npm package, leveraging durable object bindings and SQLite migrations for robust state management, and targeting developers with wrangler.jsonc configurations.

Ideal Agent Persona

Perfect for Cloudflare Agents needing persistent, stateful AI applications with durable object bindings and SQLite migrations.

Capabilities Granted for agents-sdk

Building persistent AI agents with Cloudflare Workers
Managing state with durable object bindings and SQLite migrations
Creating long-lived AI applications with the `agents` npm package

! Prerequisites & Limits

  • Requires durable object bindings
  • Needs SQLite migrations for state management
  • Cloudflare Workers only
  • Requires specific configuration in wrangler.jsonc

Source Boundary

The section below is supporting source material from the upstream repository. Use the Killer-Skills review above as the primary decision layer.

Labs Demo

Browser Sandbox Environment

⚡️ Ready to unleash?

Experience this Agent in a zero-setup browser environment powered by WebContainers. No installation required.

Boot Container Sandbox

FAQ & Installation Steps

These questions and steps mirror the structured data on this page for better search understanding.

? Frequently Asked Questions

What is agents-sdk?

Perfect for Cloudflare Agents needing persistent, stateful AI applications with durable object bindings and SQLite migrations. Build stateful AI agents using the Cloudflare Agents SDK. Load when creating agents with persistent state, scheduling, RPC, MCP servers, email handling, or streaming chat. Covers Agent class, AIChatAg

How do I install agents-sdk?

Run the command: npx killer-skills add charl-kruger/charl/agents-sdk. It works with Cursor, Windsurf, VS Code, Claude Code, and 19+ other IDEs.

What are the use cases for agents-sdk?

Key use cases include: Building persistent AI agents with Cloudflare Workers, Managing state with durable object bindings and SQLite migrations, Creating long-lived AI applications with the `agents` npm package.

Which IDEs are compatible with agents-sdk?

This skill is compatible with Cursor, Windsurf, VS Code, Trae, Claude Code, OpenClaw, Aider, Codex, OpenCode, Goose, Cline, Roo Code, Kiro, Augment Code, Continue, GitHub Copilot, Sourcegraph Cody, and Amazon Q Developer. Use the Killer-Skills CLI for universal one-command installation.

Are there any limitations for agents-sdk?

Requires durable object bindings. Needs SQLite migrations for state management. Cloudflare Workers only. Requires specific configuration in wrangler.jsonc.

How To Install

  1. 1. Open your terminal

    Open the terminal or command line in your project directory.

  2. 2. Run the install command

    Run: npx killer-skills add charl-kruger/charl/agents-sdk. The CLI will automatically detect your IDE or AI agent and configure the skill.

  3. 3. Start using the skill

    The skill is now active. Your AI agent can use agents-sdk immediately in the current project.

Imported Repository Instructions

The section below is supporting source material from the upstream repository. Use the Killer-Skills review above as the primary decision layer.

Supporting Evidence

agents-sdk

Install agents-sdk, an AI agent skill for AI agent workflows and automation. Works with Claude Code, Cursor, and Windsurf with one-command setup.

SKILL.md
Readonly
Imported Repository Instructions
The section below is supporting source material from the upstream repository. Use the Killer-Skills review above as the primary decision layer.
Supporting Evidence

Cloudflare Agents SDK

Build persistent, stateful AI agents on Cloudflare Workers using the agents npm package.

FIRST: Verify Installation

bash
1npm install agents

Agents require a binding in wrangler.jsonc:

jsonc
1{ 2 "durable_objects": { 3 // "class_name" must match your Agent class name exactly 4 "bindings": [{ "name": "Counter", "class_name": "Counter" }] 5 }, 6 "migrations": [ 7 // Required: list all Agent classes for SQLite storage 8 { "tag": "v1", "new_sqlite_classes": ["Counter"] } 9 ] 10}

Choosing an Agent Type

Use CaseBase ClassPackage
Custom state + RPC, no chatAgentagents
Chat with message persistenceAIChatAgent@cloudflare/ai-chat
Building an MCP serverMcpAgentagents/mcp

Key Concepts

  • Agent base class provides state, scheduling, RPC, MCP, and email capabilities
  • AIChatAgent adds streaming chat with automatic message persistence and resumable streams
  • Code Mode generates executable code instead of tool calls—reduces token usage significantly
  • this.state / this.setState() - automatic persistence to SQLite, broadcasts to clients
  • this.schedule() - schedule tasks at Date, delay (seconds), or cron expression
  • @callable decorator - expose methods to clients via WebSocket RPC

Quick Reference

TaskAPI
Persist statethis.setState({ count: 1 })
Read statethis.state.count
Schedule taskthis.schedule(60, "taskMethod", payload)
Schedule cronthis.schedule("0 * * * *", "hourlyTask")
Cancel schedulethis.cancelSchedule(id)
Queue taskthis.queue("processItem", payload)
SQL querythis.sql`SELECT * FROM users WHERE id = ${id}`
RPC method@callable() async myMethod() { ... }
Streaming RPC@callable({ streaming: true }) async stream(res) { ... }

Minimal Agent

typescript
1import { Agent, routeAgentRequest, callable } from "agents"; 2 3type State = { count: number }; 4 5export class Counter extends Agent<Env, State> { 6 initialState = { count: 0 }; 7 8 @callable() 9 increment() { 10 this.setState({ count: this.state.count + 1 }); 11 return this.state.count; 12 } 13} 14 15export default { 16 fetch: (req, env) => 17 routeAgentRequest(req, env) ?? new Response("Not found", { status: 404 }) 18};

Streaming Chat Agent

Use AIChatAgent for chat with automatic message persistence and resumable streaming.

Install additional dependencies first:

bash
1npm install @cloudflare/ai-chat ai @ai-sdk/openai

Add wrangler.jsonc config (same pattern as base Agent):

jsonc
1{ 2 "durable_objects": { 3 "bindings": [{ "name": "Chat", "class_name": "Chat" }] 4 }, 5 "migrations": [{ "tag": "v1", "new_sqlite_classes": ["Chat"] }] 6}
typescript
1import { AIChatAgent } from "@cloudflare/ai-chat"; 2import { routeAgentRequest } from "agents"; 3import { streamText, convertToModelMessages } from "ai"; 4import { openai } from "@ai-sdk/openai"; 5 6export class Chat extends AIChatAgent<Env> { 7 async onChatMessage(onFinish) { 8 const result = streamText({ 9 model: openai("gpt-4o"), 10 messages: await convertToModelMessages(this.messages), 11 onFinish 12 }); 13 return result.toUIMessageStreamResponse(); 14 } 15} 16 17export default { 18 fetch: (req, env) => 19 routeAgentRequest(req, env) ?? new Response("Not found", { status: 404 }) 20};

Client (React):

tsx
1import { useAgent } from "agents/react"; 2import { useAgentChat } from "@cloudflare/ai-chat/react"; 3 4const agent = useAgent({ agent: "Chat", name: "my-chat" }); 5const { messages, input, handleSubmit } = useAgentChat({ agent });

Detailed References

When to Use Code Mode

Code Mode generates executable JavaScript instead of making individual tool calls. Use it when:

  • Chaining multiple tool calls in sequence
  • Complex conditional logic across tools
  • MCP server orchestration (multiple servers)
  • Token budget is constrained

See references/codemode.md for setup and examples.

Best Practices

  1. Prefer streaming: Use streamText and toUIMessageStreamResponse() for chat
  2. Use AIChatAgent for chat: Handles message persistence and resumable streams automatically
  3. Type your state: Agent<Env, State> ensures type safety for this.state
  4. Use @callable for RPC: Cleaner than manual WebSocket message handling
  5. Code Mode for complex workflows: Reduces round-trips and token usage
  6. Schedule vs Queue: Use schedule() for time-based, queue() for sequential processing

Related Skills

Looking for an alternative to agents-sdk or another community skill for your workflow? Explore these related open-source skills.

View All

openclaw-release-maintainer

Logo of openclaw
openclaw

Your own personal AI assistant. Any OS. Any Platform. The lobster way. 🦞

333.8k
0
AI

widget-generator

Logo of f
f

Generate customizable widget plugins for the prompts.chat feed system

149.6k
0
AI

flags

Logo of vercel
vercel

The React Framework

138.4k
0
Browser

pr-review

Logo of pytorch
pytorch

Tensors and Dynamic neural networks in Python with strong GPU acceleration

98.6k
0
Developer