Agent skill · Content & Marketing

agents-sdk

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, AIChatAgent, state management, and Code Mode for reduced token usage.

majiayu000github.com/majiayu000GitHub ↗
claude-codeMIT
Install
npx skills add majiayu000/claude-skill-registry --skill agents-sdk --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 2
SKILL.md size: 5 KB
Bundled scripts: none
Path: skills/agent/agents-sdk/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 534
Language: HTML

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# Cloudflare Agents SDK Build persistent, stateful AI agents on Cloudflare Workers using the `agents` npm package. ## FIRST: Verify Installation ```bash npm install agents ``` Agents require a binding in `wrangler.jsonc`: ```jsonc { "durable_objects": { // "class_name" must match your Agent class name exactly "bindings": [{ "name": "Counter", "class_name": "Counter" }] }, "migrations": [ // Required: list all Agent classes for SQLite storage { "tag": "v1", "new_sqlite_classes": ["Counter"] } ] } ``` ## Choosing an Agent Type | Use Case | Base Class | Package | |----------|------------|---------| | Custom state + RPC, no chat | `Agent` | `agents` | | Chat with message persistence | `AIChatAgent` | `@cloudflare/ai-chat` | | Building an MCP server | `McpAgent` | `agents/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()** - schedu

What's inside
Steps it walks through
  1. FIRST: Verify Installation
  2. Choosing an Agent Type
  3. Key Concepts
  4. Quick Reference
  5. Minimal Agent
  6. Streaming Chat Agent
  7. Detailed References
  8. When to Use Code Mode
  9. Best Practices
Ships with 1 file
  • metadata.json
Commands it runs
npm install agents
npm install @cloudflare/ai-chat ai @ai-sdk/openai
More from claude-skill-registry
All skills →
About this skill
What does the agents-sdk skill do?

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, AIChatAgent, state management, and Code Mode for reduced token usage.

How do I install it?

Run `npx skills add majiayu000/claude-skill-registry --skill agents-sdk --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going