Claude Skills
CollectionsCompareWorkflowsNominate
Sign inSign up
© 2026 Curated Agent Skills·Learn more about Agent Skills
Back to repository

cloudflare-knowledge

verified

Cloudflare edge platform patterns for Workers, Agents SDK, MCP servers, Vectorize, and Workflows. Use when building on Cloudflare infrastructure.

View on GitHub

Marketplace

sb-marketplace

superbenefit/sb-marketplace

Plugin

cloudflare-dev

development

Repository

superbenefit/sb-marketplace
5stars

cloudflare-dev/skills/cloudflare-knowledge/SKILL.md

Last Verified

February 4, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/superbenefit/sb-marketplace/blob/main/cloudflare-dev/skills/cloudflare-knowledge/SKILL.md -a claude-code --skill cloudflare-knowledge

Installation paths:

Claude
.claude/skills/cloudflare-knowledge/
Powered by add-skill CLI

Instructions

# Cloudflare Knowledge

## Quick Reference

| Task | Read File | Key Constraint |
|------|-----------|----------------|
| Building Agent class | `agents-sdk.md` | `new_sqlite_classes` in migrations |
| Agent design patterns | `agent-patterns.md` | Use AI SDK with Durable Objects |
| MCP server (stateless) | `agents-mcp.md` | Use `createMcpHandler` (recommended) |
| MCP server (stateful) | `agents-mcp.md` | Agent + WorkerTransport + createMcpHandler |
| OAuth / auth patterns | `auth-deployment.md` | `OAUTH_KV` binding required for workers-oauth-provider |
| Vector search | `vectorize.md` | topK ≤20 with metadata, ≤100 without |
| Durable execution | `workflows.md` | Always `await step.do()`, steps must be idempotent |
| R2, KV, D1 bindings | `workers-platform.md` | Use bindings (not REST APIs), D1 prepared statements |
| Logging & tracing | `observability.md` | `observability: { enabled: true }` in wrangler.jsonc |
| CI/CD & deployment | `auth-deployment.md` | Workers Builds, GitHub Actions, secrets management |

## Critical Standards (Always Apply)
```jsonc
// wrangler.jsonc - REQUIRED settings
{
  "compatibility_date": "2025-03-07",  // Minimum for Agents
  "compatibility_flags": ["nodejs_compat"],
  "observability": { "enabled": true }
}
```

### Reranker: MUST Use Batch API
```typescript
// ✅ CORRECT
await env.AI.run("@cf/baai/bge-reranker-base", {
  query: "search query",
  contexts: [{ text: "passage1" }, { text: "passage2" }],
  top_k: 10
});

// ❌ WRONG - deprecated per-document format
await env.AI.run("@cf/baai/bge-reranker-base", {
  text: ["query", "passage"]
});
```

### D1: MUST Use Prepared Statements
```typescript
// ✅ CORRECT
env.DB.prepare("SELECT * FROM users WHERE id = ?").bind(userId)

// ❌ WRONG - SQL injection risk
env.DB.prepare(`SELECT * FROM users WHERE id = '${userId}'`)
```

### KV: Eventually Consistent
```typescript
// ✅ CORRECT - return what you wrote
await env.MY_KV.put("key", newValue);
return Response.json({ value: newValue });

// ❌ 

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
3902 chars