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.
95
93%
Does it follow best practices?
Impact
95%
1.26xAverage score across 3 eval scenarios
Advisory
Suggest reviewing before use
Agent class setup with state, validation, and wrangler config
durable_objects binding
100%
100%
new_sqlite_classes migration
100%
100%
agents package import
100%
100%
Agent generic typing
100%
100%
initialState defined
100%
100%
validateStateChange used
100%
100%
onStateUpdate used
50%
30%
setState for writes
100%
100%
this.state reads
100%
100%
routeAgentRequest handler
100%
100%
@callable on methods
100%
100%
notes on hooks rationale
80%
80%
Callable RPC methods with streaming and client patterns
callable import
100%
100%
StreamingResponse import
100%
100%
@callable() on sync method
100%
100%
@callable streaming decorator
100%
100%
StreamingResponse as first param
100%
100%
stream.send() used
100%
100%
stream.close() called
71%
28%
stream.error() on failure
100%
100%
client timeout option
100%
100%
client stream handlers
100%
100%
design doc distinguishes uses
100%
100%
External client pattern noted
100%
100%
Three scheduling patterns: delay, interval, and cron
this.schedule() delay form
0%
100%
Delay value is ~120s
50%
100%
this.scheduleEvery() for interval
0%
100%
Interval value is 30s
62%
100%
this.schedule() cron form
0%
100%
Midnight cron expression
87%
100%
Named method strings
30%
100%
State for health and count
100%
100%
setState in handlers
25%
100%
Notes distinguish three APIs
62%
100%
2e200ec
Table of Contents
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.