Claude-code-templates cloudflare-deploy
Deploy applications and infrastructure to Cloudflare using Workers, Pages, and related platform services. Use when the user asks to deploy, host, publish, or set up a project on Cloudflare.
install
source · Clone the upstream repo
git clone https://github.com/davila7/claude-code-templates
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/davila7/claude-code-templates "$T" && mkdir -p ~/.claude/skills && cp -r "$T/cli-tool/components/skills/development/cloudflare-deploy" ~/.claude/skills/davila7-claude-code-templates-cloudflare-deploy && rm -rf "$T"
manifest:
cli-tool/components/skills/development/cloudflare-deploy/SKILL.mdsource content
Cloudflare Deploy
Consolidated skill for building on the Cloudflare platform. Use decision trees below to find the right product, then load detailed references.
Prerequisites
- When sandboxing blocks the deployment network calls, rerun with
.sandbox_permissions=require_escalated - The deployment might take a few minutes. Use appropriate timeout values.
Authentication (Required Before Deploy)
Verify auth before
wrangler deploy, wrangler pages deploy, or npm run deploy:
npx wrangler whoami # Shows account if authenticated
Not authenticated? →
references/wrangler/auth.md
- Interactive/local:
(one-time OAuth)wrangler login - CI/CD: Set
env varCLOUDFLARE_API_TOKEN
Quick Decision Trees
"I need to run code"
Need to run code? ├─ Serverless functions at the edge → workers/ ├─ Full-stack web app with Git deploys → pages/ ├─ Stateful coordination/real-time → durable-objects/ ├─ Long-running multi-step jobs → workflows/ ├─ Run containers → containers/ ├─ Multi-tenant (customers deploy code) → workers-for-platforms/ ├─ Scheduled tasks (cron) → cron-triggers/ ├─ Lightweight edge logic (modify HTTP) → snippets/ ├─ Process Worker execution events (logs/observability) → tail-workers/ └─ Optimize latency to backend infrastructure → smart-placement/
"I need to store data"
Need storage? ├─ Key-value (config, sessions, cache) → kv/ ├─ Relational SQL → d1/ (SQLite) or hyperdrive/ (existing Postgres/MySQL) ├─ Object/file storage (S3-compatible) → r2/ ├─ Message queue (async processing) → queues/ ├─ Vector embeddings (AI/semantic search) → vectorize/ ├─ Strongly-consistent per-entity state → durable-objects/ (DO storage) ├─ Secrets management → secrets-store/ ├─ Streaming ETL to R2 → pipelines/ └─ Persistent cache (long-term retention) → cache-reserve/
"I need AI/ML"
Need AI? ├─ Run inference (LLMs, embeddings, images) → workers-ai/ ├─ Vector database for RAG/search → vectorize/ ├─ Build stateful AI agents → agents-sdk/ ├─ Gateway for any AI provider (caching, routing) → ai-gateway/ └─ AI-powered search widget → ai-search/
"I need networking/connectivity"
Need networking? ├─ Expose local service to internet → tunnel/ ├─ TCP/UDP proxy (non-HTTP) → spectrum/ ├─ WebRTC TURN server → turn/ ├─ Private network connectivity → network-interconnect/ ├─ Optimize routing → argo-smart-routing/ ├─ Optimize latency to backend (not user) → smart-placement/ └─ Real-time video/audio → realtimekit/ or realtime-sfu/
"I need security"
Need security? ├─ Web Application Firewall → waf/ ├─ DDoS protection → ddos/ ├─ Bot detection/management → bot-management/ ├─ API protection → api-shield/ ├─ CAPTCHA alternative → turnstile/ └─ Credential leak detection → waf/ (managed ruleset)
"I need media/content"
Need media? ├─ Image optimization/transformation → images/ ├─ Video streaming/encoding → stream/ ├─ Browser automation/screenshots → browser-rendering/ └─ Third-party script management → zaraz/
"I need infrastructure-as-code"
Need IaC? → pulumi/ (Pulumi), terraform/ (Terraform), or api/ (REST API)
Product Index
Compute & Runtime
| Product | Reference |
|---|---|
| Workers | |
| Pages | |
| Pages Functions | |
| Durable Objects | |
| Workflows | |
| Containers | |
| Workers for Platforms | |
| Cron Triggers | |
| Tail Workers | |
| Snippets | |
| Smart Placement | |
Storage & Data
| Product | Reference |
|---|---|
| KV | |
| D1 | |
| R2 | |
| Queues | |
| Hyperdrive | |
| DO Storage | |
| Secrets Store | |
| Pipelines | |
| R2 Data Catalog | |
| R2 SQL | |
AI & Machine Learning
| Product | Reference |
|---|---|
| Workers AI | |
| Vectorize | |
| Agents SDK | |
| AI Gateway | |
| AI Search | |
Networking & Connectivity
| Product | Reference |
|---|---|
| Tunnel | |
| Spectrum | |
| TURN | |
| Network Interconnect | |
| Argo Smart Routing | |
| Workers VPC | |
Security
| Product | Reference |
|---|---|
| WAF | |
| DDoS Protection | |
| Bot Management | |
| API Shield | |
| Turnstile | |
Media & Content
| Product | Reference |
|---|---|
| Images | |
| Stream | |
| Browser Rendering | |
| Zaraz | |
Real-Time Communication
| Product | Reference |
|---|---|
| RealtimeKit | |
| Realtime SFU | |
Developer Tools
| Product | Reference |
|---|---|
| Wrangler | |
| Miniflare | |
| C3 | |
| Observability | |
| Analytics Engine | |
| Web Analytics | |
| Sandbox | |
| Workerd | |
| Workers Playground | |
Infrastructure as Code
| Product | Reference |
|---|---|
| Pulumi | |
| Terraform | |
| API | |
Other Services
| Product | Reference |
|---|---|
| Email Routing | |
| Email Workers | |
| Static Assets | |
| Bindings | |
| Cache Reserve | |
Troubleshooting
Escalated Network Access
If deployment fails due to network issues (timeouts, DNS errors, connection resets), rerun the deploy with escalated permissions (use
sandbox_permissions=require_escalated). The deploy requires escalated network access when sandbox networking blocks outbound requests.
Example guidance to the user:
The deploy needs escalated network access to deploy to Cloudflare. I can rerun the command with escalated permissions—want me to proceed?