cloudflare-agents_skill

This skill helps you build and manage Cloudflare AI agents with durable objects, WebSockets, and RAG, boosting scalable automation.
  • Python

8

GitHub Stars

4

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill jackspace/claudeskillz --skill cloudflare-agents

  • README.md10.0 KB
  • SKILL.json58.7 KB
  • SKILL.md54.1 KB
  • SKILL.md.backup54.1 KB

Overview

This skill is a concise, practical guide for the Cloudflare Agents SDK that helps you build AI-powered, stateful agents on Cloudflare Workers + Durable Objects. It covers setup, configuration rules, common pitfalls, APIs for HTTP, WebSockets, scheduling, RAG, Browser Rendering, MCP servers, and workflows. Use it to avoid known configuration errors and to implement reliable, scalable agents quickly.

How this skill works

The guide explains how to scaffold or add Agents to existing Workers, configure Durable Objects and migrations (including SQLite enablement), and implement Agent lifecycle hooks like onRequest, onConnect, onMessage, schedule, and custom methods. It documents bindings for AI, Vectorize, Browser, Workflows, D1, and R2, and shows how to persist state, stream events, manage WebSockets, and run asynchronous workflows and cron tasks. The content enumerates 15+ documented failure modes with concrete prevention steps.

When to use it

  • Building AI-driven autonomous agents on Cloudflare Workers and Durable Objects
  • Creating stateful agents with persisted SQLite state and SQL access
  • Implementing real-time clients with WebSockets or SSE and streaming chat
  • Scheduling tasks with cron, delays, or cloud workflows
  • Building RAG systems with Vectorize and embeddings or running Browser Rendering
  • Setting up MCP servers, human-in-the-loop flows, multi-agent orchestration

Best practices

  • Always export the Agent class and ensure durable binding name and class_name match exactly
  • Put new_sqlite_classes in the first migration; migrations are atomic and cannot be added later
  • Use unique migration tags and avoid reusing or editing past tags
  • Prefer WebSockets for interactive, long-lived sessions; use SSE for server→client streaming
  • Limit agent state size and use D1/R2 for large or structured data; monitor state size limits
  • Validate workflow and browser bindings at deploy time; fail early for missing bindings

Example use cases

  • Chat agent with streaming responses and stateful conversation history
  • Worker that spawns scheduled tasks for reminders, retries, or batch jobs
  • RAG assistant using Vectorize index + Workers AI embeddings for retrieval-augmented answers
  • MCP server implementation that exposes model context to clients and other agents
  • Web-browsing agent using Browser Rendering + Puppeteer to fetch and summarize pages

FAQ

If SQLite is not enabled in the initial migration, you cannot enable it later for that class. Always include new_sqlite_classes in your first migration tag.

Why does my Durable Objects binding fail at deploy?

Most common causes: class not exported, mismatch between binding name and class_name, or reused migration tags. Verify exact string matches and export the class.

How do I avoid state size errors?

Keep in-memory state small, store large objects in D1 or R2, and paginate or compress logs. Monitor agent state growth and enforce limits within your code.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational