|
| 1 | +--- |
| 2 | +name: cloudflare |
| 3 | +description: Comprehensive Cloudflare platform skill covering Workers, Pages, storage (KV, D1, R2), AI (Workers AI, Vectorize, Agents SDK), feature flags (Flagship), networking (Tunnel, Spectrum), security (WAF, DDoS), and infrastructure-as-code (Terraform, Pulumi). Use for any Cloudflare development task. Biases towards retrieval from Cloudflare docs over pre-trained knowledge. |
| 4 | +references: |
| 5 | + - workers |
| 6 | + - pages |
| 7 | + - d1 |
| 8 | + - durable-objects |
| 9 | + - workers-ai |
| 10 | +--- |
| 11 | + |
| 12 | +# Cloudflare Platform Skill |
| 13 | + |
| 14 | +Consolidated skill for building on the Cloudflare platform. Use decision trees below to find the right product, then load detailed references. |
| 15 | + |
| 16 | +Your knowledge of Cloudflare APIs, types, limits, and pricing may be outdated. **Prefer retrieval over pre-training** — the references in this skill are starting points, not source of truth. |
| 17 | + |
| 18 | +## Retrieval Sources |
| 19 | + |
| 20 | +Fetch the **latest** information before citing specific numbers, API signatures, or configuration options. Do not rely on baked-in knowledge or these reference files alone. |
| 21 | + |
| 22 | +| Source | How to retrieve | Use for | |
| 23 | +|--------|----------------|---------| |
| 24 | +| Cloudflare docs | `cloudflare-docs` search tool or `https://developers.cloudflare.com/` | Limits, pricing, API reference, compatibility dates/flags | |
| 25 | +| Workers types | `npm pack @cloudflare/workers-types` or check `node_modules` | Type signatures, binding shapes, handler types | |
| 26 | +| Wrangler config schema | `node_modules/wrangler/config-schema.json` | Config fields, binding shapes, allowed values | |
| 27 | +| Product changelogs | `https://developers.cloudflare.com/changelog/` | Recent changes to limits, features, deprecations | |
| 28 | + |
| 29 | +When a reference file and the docs disagree, **trust the docs**. This is especially important for: numeric limits, pricing tiers, type signatures, and configuration options. |
| 30 | + |
| 31 | +## Quick Decision Trees |
| 32 | + |
| 33 | +### "I need feature flags" |
| 34 | + |
| 35 | +``` |
| 36 | +Need feature flags? |
| 37 | +└─ Feature toggles, targeting rules, percentage rollouts → flagship/ |
| 38 | + ├─ Evaluate in Workers → Flagship binding (env.FLAGS) |
| 39 | + ├─ Evaluate in Node.js / browser → OpenFeature SDK (@cloudflare/flagship) |
| 40 | + └─ Manage flags via API → Flagship REST API |
| 41 | +``` |
| 42 | + |
| 43 | +### "I need to run code" |
| 44 | + |
| 45 | +``` |
| 46 | +Need to run code? |
| 47 | +├─ Serverless functions at the edge → workers/ |
| 48 | +├─ Full-stack web app with Git deploys → pages/ |
| 49 | +├─ Stateful coordination/real-time → durable-objects/ |
| 50 | +├─ Long-running multi-step jobs → workflows/ |
| 51 | +├─ Run containers → containers/ |
| 52 | +├─ Multi-tenant (customers deploy code) → workers-for-platforms/ |
| 53 | +├─ Scheduled tasks (cron) → cron-triggers/ |
| 54 | +├─ Lightweight edge logic (modify HTTP) → snippets/ |
| 55 | +├─ Process Worker execution events (logs/observability) → tail-workers/ |
| 56 | +└─ Optimize latency to backend infrastructure → smart-placement/ |
| 57 | +``` |
| 58 | + |
| 59 | +### "I need to store data" |
| 60 | + |
| 61 | +``` |
| 62 | +Need storage? |
| 63 | +├─ Key-value (config, sessions, cache) → kv/ |
| 64 | +├─ Relational SQL → d1/ (SQLite) or hyperdrive/ (existing Postgres/MySQL) |
| 65 | +├─ Object/file storage (S3-compatible) → r2/ |
| 66 | +├─ Versioned file trees (repos, build outputs, checkpoints) → artifacts/ |
| 67 | +├─ Message queue (async processing) → queues/ |
| 68 | +├─ Vector embeddings (AI/semantic search) → vectorize/ |
| 69 | +├─ Strongly-consistent per-entity state → durable-objects/ (DO storage) |
| 70 | +├─ Secrets management → secrets-store/ |
| 71 | +├─ Streaming ETL to R2 → pipelines/ |
| 72 | +└─ Persistent cache (long-term retention) → cache-reserve/ |
| 73 | +``` |
| 74 | + |
| 75 | +### "I need AI/ML" |
| 76 | + |
| 77 | +``` |
| 78 | +Need AI? |
| 79 | +├─ Run inference (LLMs, embeddings, images) → workers-ai/ |
| 80 | +├─ Vector database for RAG/search → vectorize/ |
| 81 | +├─ Build stateful AI agents → agents-sdk/ |
| 82 | +├─ Gateway for any AI provider (caching, routing) → ai-gateway/ |
| 83 | +└─ AI-powered search widget → ai-search/ |
| 84 | +``` |
| 85 | + |
| 86 | +### "I need networking/connectivity" |
| 87 | + |
| 88 | +``` |
| 89 | +Need networking? |
| 90 | +├─ Expose local service to internet → tunnel/ |
| 91 | +├─ TCP/UDP proxy (non-HTTP) → spectrum/ |
| 92 | +├─ WebRTC TURN server → turn/ |
| 93 | +├─ Private network connectivity → network-interconnect/ |
| 94 | +├─ Optimize routing → argo-smart-routing/ |
| 95 | +├─ Optimize latency to backend (not user) → smart-placement/ |
| 96 | +└─ Real-time video/audio → realtimekit/ or realtime-sfu/ |
| 97 | +``` |
| 98 | + |
| 99 | +### "I need security" |
| 100 | + |
| 101 | +``` |
| 102 | +Need security? |
| 103 | +├─ Web Application Firewall → waf/ |
| 104 | +├─ DDoS protection → ddos/ |
| 105 | +├─ Bot detection/management → bot-management/ |
| 106 | +├─ API protection → api-shield/ |
| 107 | +├─ CAPTCHA alternative → turnstile/ |
| 108 | +└─ Credential leak detection → waf/ (managed ruleset) |
| 109 | +``` |
| 110 | + |
| 111 | +### "I need media/content" |
| 112 | + |
| 113 | +``` |
| 114 | +Need media? |
| 115 | +├─ Image optimization/transformation → images/ |
| 116 | +├─ Video streaming/encoding → stream/ |
| 117 | +├─ Browser automation/screenshots → browser-rendering/ |
| 118 | +└─ Third-party script management → zaraz/ |
| 119 | +``` |
| 120 | + |
| 121 | +### "I need analytics/metrics data" |
| 122 | + |
| 123 | +``` |
| 124 | +Need analytics? |
| 125 | +├─ Query across all Cloudflare products (HTTP, Workers, DNS, etc.) → graphql-api/ |
| 126 | +├─ Custom high-cardinality metrics from Workers → analytics-engine/ |
| 127 | +├─ Client-side (RUM) performance data → web-analytics/ |
| 128 | +├─ Workers Logs and real-time debugging → observability/ |
| 129 | +└─ Raw logs (Logpush to external tools) → Cloudflare docs |
| 130 | +``` |
| 131 | + |
| 132 | +### "I need infrastructure-as-code" |
| 133 | + |
| 134 | +``` |
| 135 | +Need IaC? → pulumi/ (Pulumi), terraform/ (Terraform), or api/ (REST API) |
| 136 | +``` |
| 137 | + |
| 138 | +## Product Index |
| 139 | + |
| 140 | +### Feature Flags |
| 141 | +| Product | Reference | |
| 142 | +|---------|-----------| |
| 143 | +| Flagship | `references/flagship/` | |
| 144 | + |
| 145 | +### Compute & Runtime |
| 146 | +| Product | Reference | |
| 147 | +|---------|-----------| |
| 148 | +| Workers | `references/workers/` | |
| 149 | +| Pages | `references/pages/` | |
| 150 | +| Pages Functions | `references/pages-functions/` | |
| 151 | +| Durable Objects | `references/durable-objects/` | |
| 152 | +| Workflows | `references/workflows/` | |
| 153 | +| Containers | `references/containers/` | |
| 154 | +| Workers for Platforms | `references/workers-for-platforms/` | |
| 155 | +| Cron Triggers | `references/cron-triggers/` | |
| 156 | +| Tail Workers | `references/tail-workers/` | |
| 157 | +| Snippets | `references/snippets/` | |
| 158 | +| Smart Placement | `references/smart-placement/` | |
| 159 | + |
| 160 | +### Storage & Data |
| 161 | +| Product | Reference | |
| 162 | +|---------|-----------| |
| 163 | +| KV | `references/kv/` | |
| 164 | +| D1 | `references/d1/` | |
| 165 | +| R2 | `references/r2/` | |
| 166 | +| Artifacts | `references/artifacts/` | |
| 167 | +| Queues | `references/queues/` | |
| 168 | +| Hyperdrive | `references/hyperdrive/` | |
| 169 | +| DO Storage | `references/do-storage/` | |
| 170 | +| Secrets Store | `references/secrets-store/` | |
| 171 | +| Pipelines | `references/pipelines/` | |
| 172 | +| R2 Data Catalog | `references/r2-data-catalog/` | |
| 173 | +| R2 SQL | `references/r2-sql/` | |
| 174 | + |
| 175 | +### AI & Machine Learning |
| 176 | +| Product | Reference | |
| 177 | +|---------|-----------| |
| 178 | +| Workers AI | `references/workers-ai/` | |
| 179 | +| Vectorize | `references/vectorize/` | |
| 180 | +| Agents SDK | `references/agents-sdk/` | |
| 181 | +| AI Gateway | `references/ai-gateway/` | |
| 182 | +| AI Search | `references/ai-search/` | |
| 183 | + |
| 184 | +### Networking & Connectivity |
| 185 | +| Product | Reference | |
| 186 | +|---------|-----------| |
| 187 | +| Tunnel | `references/tunnel/` | |
| 188 | +| Spectrum | `references/spectrum/` | |
| 189 | +| TURN | `references/turn/` | |
| 190 | +| Network Interconnect | `references/network-interconnect/` | |
| 191 | +| Argo Smart Routing | `references/argo-smart-routing/` | |
| 192 | +| Workers VPC | `references/workers-vpc/` | |
| 193 | + |
| 194 | +### Security |
| 195 | +| Product | Reference | |
| 196 | +|---------|-----------| |
| 197 | +| WAF | `references/waf/` | |
| 198 | +| DDoS Protection | `references/ddos/` | |
| 199 | +| Bot Management | `references/bot-management/` | |
| 200 | +| API Shield | `references/api-shield/` | |
| 201 | +| Turnstile | `references/turnstile/` | |
| 202 | + |
| 203 | +### Media & Content |
| 204 | +| Product | Reference | |
| 205 | +|---------|-----------| |
| 206 | +| Images | `references/images/` | |
| 207 | +| Stream | `references/stream/` | |
| 208 | +| Browser Rendering | `references/browser-rendering/` | |
| 209 | +| Zaraz | `references/zaraz/` | |
| 210 | + |
| 211 | +### Real-Time Communication |
| 212 | +| Product | Reference | |
| 213 | +|---------|-----------| |
| 214 | +| RealtimeKit | `references/realtimekit/` | |
| 215 | +| Realtime SFU | `references/realtime-sfu/` | |
| 216 | + |
| 217 | +### Developer Tools |
| 218 | +| Product | Reference | |
| 219 | +|---------|-----------| |
| 220 | +| Wrangler | `references/wrangler/` | |
| 221 | +| Miniflare | `references/miniflare/` | |
| 222 | +| C3 | `references/c3/` | |
| 223 | +| Observability | `references/observability/` | |
| 224 | +| GraphQL Analytics API | `references/graphql-api/` | |
| 225 | +| Analytics Engine | `references/analytics-engine/` | |
| 226 | +| Web Analytics | `references/web-analytics/` | |
| 227 | +| Sandbox | `references/sandbox/` | |
| 228 | +| Workerd | `references/workerd/` | |
| 229 | +| Workers Playground | `references/workers-playground/` | |
| 230 | + |
| 231 | +### Infrastructure as Code |
| 232 | +| Product | Reference | |
| 233 | +|---------|-----------| |
| 234 | +| Pulumi | `references/pulumi/` | |
| 235 | +| Terraform | `references/terraform/` | |
| 236 | +| API | `references/api/` | |
| 237 | + |
| 238 | +### Other Services |
| 239 | +| Product | Reference | |
| 240 | +|---------|-----------| |
| 241 | +| Email Routing | `references/email-routing/` | |
| 242 | +| Email Workers | `references/email-workers/` | |
| 243 | +| Static Assets | `references/static-assets/` | |
| 244 | +| Bindings | `references/bindings/` | |
| 245 | +| Cache Reserve | `references/cache-reserve/` | |
0 commit comments