| name | patterns |
| description | Apply Cloudflare reference architecture patterns for CRUD SaaS, collaboration, async exports, AI assistants, RAG, media, webhook ingestion, and migration. Use to turn requirements into an implementation pattern and primitive map.
|
| compatibility | Cloudflare Workers TypeScript projects using Wrangler; verify current Cloudflare APIs, limits, and pricing before production use. |
| metadata | {"source":"Architecting on Cloudflare plus official Cloudflare Developer Platform docs","generated":"2026-04-28"} |
Patterns
Use this skill when a user describes an application and needs a Cloudflare implementation shape.
Pattern: CRUD SaaS
Worker: API, auth, SSR/static assets
D1: tenants, users, records, permissions
R2: file uploads
KV: cached public/config reads
Queue: email/webhook/export jobs
Observability: request IDs and tenant IDs
Add Durable Objects only when a specific entity needs serialized coordination.
Pattern: collaborative document or chat
Worker: auth and WebSocket upgrade route
Durable Object per room/document: live state, message ordering, presence
D1: metadata, membership, audit/history summaries
R2: snapshots, exports, attachments
Queue: indexing, notifications, compaction
Key by tenant:{tenantId}:doc:{docId} or similar.
Pattern: async export/report
Worker: validate request, create job record, enqueue/start workflow
Workflow: durable ordered steps, retries, progress
D1: job status and metadata
R2: generated report
Queue: fan-out chunks when needed
Return HTTP 202 with jobId; expose a status endpoint.
Pattern: RAG assistant
Worker: upload/query APIs and auth
R2: original documents and parsed chunks
D1: document metadata, ACL, ingestion status
Workflow/Queue: parse, chunk, embed, index
Vectorize or AI Search: retrieval index
Workers AI / AI Gateway: embeddings and answer generation
Ensure retrieval filters enforce tenant/user authorization.
Pattern: media or large file app
Worker: auth, upload/download routing
R2: original and transformed media
D1: metadata, ownership, processing state
Queue/Workflow: transformations, notifications
Container: only if native/heavy processing is required
Realtime/WebRTC: only for live media sessions
Pattern: webhook ingestion
Worker: verify signature, store minimal event, enqueue
Queue: process retries/idempotency
D1: event ledger and domain records
Durable Object: only if events must serialize by account/entity
Pattern selection checklist
Anti-patterns
- Pattern chosen because it is familiar from another cloud rather than because it fits Cloudflare.
- No explicit latency budget.
- State split across primitives without source-of-truth rules.
- Realtime, background jobs, and relational writes all hidden in one Worker route.