What problem does it solve?
Building and operating stateful AI agents on Cloudflare Workers is complex, error-prone, and requires coordinating durable state, RPC, scheduling, workflows, and client integration across multiple moving parts; this Skill centralizes guidance and best practices so teams can implement robust agents reliably.
Core Features & Use Cases
- Persistent Stateful Agents: Patterns for SQLite-backed agent state, validation hooks, and client synchronization.
- Callable RPC & Streaming: Expose methods over WebSocket, support streaming responses and timeouts for long-running tasks.
- Scheduling, Workflows & MCP: How to schedule tasks, integrate durable Workflows for long-running jobs, and connect or host MCP servers and tools.
- Real-time Apps & Clients: Guidance for HTTP/WebSocket routing, resumable streaming chat agents, and React client hooks using useAgent and useAgentChat.
- Use Case Example: Implement a Counter agent with persistent state, a callable increment method, scheduled background jobs, and a React frontend that stays in sync.
Quick Start
Create a Cloudflare Workers agent that uses SQLite-backed state, exposes a callable increment method, routes requests with routeAgentRequest, and includes a React client using useAgent.