/claude-skills:cloudflare-managerfrom claude-skills
Manages Cloudflare services: deploys Workers, configures KV/R2 storage, sets up DNS/routing and Pages. Requires CLOUDFLARE_API_KEY and Bun runtime.
Ships in claude-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Comprehensive Cloudflare service management skill that enables deployment and configuration of Workers, KV Storage, R2 buckets, Pages, DNS records, and routing. Automatically validates API credentials, extracts deployment URLs, and provides actionable error messages.
Before using this skill for the first time:
Install Dependencies
cd ~/.claude/skills/cloudflare-manager
bun install
Configure API Key
Create a .env file in your project root:
CLOUDFLARE_API_KEY=your_api_token_here
CLOUDFLARE_ACCOUNT_ID=your_account_id # Optional, auto-detected
Getting your API token:
Validate Credentials
Run validation to verify your API key and check permissions:
cd ~/.claude/skills/cloudflare-manager
bun scripts/validate-api-key.ts
Expected output:
✅ API key is valid!
ℹ️ Token Status: active
ℹ️ Account: Your Account Name (abc123...)
🔑 Granted Permissions:
✅ Workers Scripts: Edit
✅ Workers KV Storage: Edit
✅ Workers R2 Storage: Edit
Troubleshooting validation:
.env--no-cache flag to force fresh validation: bun scripts/validate-api-key.ts --no-cacheRun bun scripts/validate-api-key.ts to populate this section with your current permissions.
User request:
"Set up a Cloudflare worker for handling API requests and give me the URL"
Workflow:
bun scripts/workers.ts deploy api-handler ./worker.js
https://api-handler.username.workers.devExpected output:
✅ Worker deployed successfully!
📍 URL: https://api-handler.username.workers.dev
🆔 Worker ID: abc123def456
Time: 2-5 seconds
User request:
"Set up a complete Cloudflare application with worker, key-value storage, and file storage"
Workflow:
Create KV namespace for session caching:
bun scripts/kv-storage.ts create-namespace app-sessions
# Returns: namespace-id-123
Create R2 bucket for user uploads:
bun scripts/r2-storage.ts create-bucket app-uploads
# Returns: Bucket created: app-uploads
Deploy worker with bindings:
bun scripts/workers.ts deploy app-api ./worker.js \
--kv-binding SESSION_STORE=namespace-id-123 \
--r2-binding UPLOADS=app-uploads
Configure custom domain route:
bun scripts/dns-routes.ts create-route example.com \
"api.example.com/*" app-api
Expected output:
✅ KV namespace created: app-sessions (namespace-id-123)
✅ R2 bucket created: app-uploads
✅ Worker deployed: https://app-api.username.workers.dev
✅ Route configured: api.example.com/* → app-api
Time: 8-12 seconds total
User request:
"Deploy my static site to Cloudflare Pages"
Workflow:
Create Pages project (if doesn't exist):
bun scripts/pages.ts deploy my-site ./dist
For first deployment with files, use Wrangler:
npx wrangler pages deploy ./dist --project-name=my-site
Set environment variables:
bun scripts/pages.ts set-env my-site API_URL https://api.example.com
bun scripts/pages.ts set-env my-site DEBUG false --env production
Expected output:
✅ Pages project created: my-site
📍 URL: https://my-site.pages.dev
🚀 Deploying files... (via Wrangler)
✅ Deployment complete!
✅ Environment variables set
Time: 15-30 seconds (depends on site size)
To deploy a new worker container sandbox:
# Using the skill
bun scripts/workers.ts deploy worker-name ./worker-script.js
What happens:
https://worker-name.username.workers.dev)Example conversation:
User: "Set up and deploy a new cloudflare worker container sandbox named 'api-handler' and return the URL"
Claude: [Deploys worker using bun scripts/workers.ts deploy api-handler ./worker.js]
Returns URL: https://api-handler.username.workers.dev
Exit codes:
0: Success - worker deployed and URL returned1: Failure - check error message for detailsPerformance: Deployment typically completes in 2-5 seconds
⚠️ Most Critical Issues — Address these first if you encounter problems:
The Problem: API tokens with insufficient or incorrectly scoped permissions fail silently with 403 errors, making debugging very difficult.
How to Avoid:
bun scripts/validate-api-key.ts
This shows exactly which permissions you have. Do this every time you create or update a token.Quick Diagnosis:
# If you see "Insufficient permissions", stop and fix the token:
bun scripts/validate-api-key.ts
# If any required permission shows ❌, update token at:
# https://dash.cloudflare.com/profile/api-tokens
The Problem: wrangler login uses port 8976 for the OAuth callback. If another wrangler dev or wrangler pages dev process is already running, the login flow will fail silently — the browser tab opens but never receives the OAuth redirect.
How to Avoid:
wrangler login, kill all other Wrangler processes:
pkill -f wrangler
wrangler login
wrangler dev or Pages after login completesWhy This Happens: Wrangler doesn't queue OAuth callbacks — the first process to bind port 8976 gets the callback. If that's a dev server, login attempts silently fail.
The Problem: Workers and Pages deployments timeout if the project is too large or network connectivity is unstable. Timeouts also occur during peak Cloudflare load.
How to Avoid:
.cloudflare/ ignore patterns to exclude node_modules, build caches, etc.npx wrangler pages deploy ./dist --project-name=my-app
bun scripts/pages.ts list-deployments my-app # Check status
# If truly stuck, delete and recreate the project
For detailed solutions to specific error messages, see the Troubleshooting section below.
To create a KV namespace and store data:
# Create namespace
bun scripts/kv-storage.ts create-namespace user-sessions
# Returns: Namespace ID (e.g., abc123def456)
# Save this ID for binding to workers
# Write key-value pair
bun scripts/kv-storage.ts write <namespace-id> "session:user123" '{"userId":"123","token":"abc"}'
# Read value
bun scripts/kv-storage.ts read <namespace-id> "session:user123"
# Returns: {"userId":"123","token":"abc"}
# List all keys (useful for debugging)
bun scripts/kv-storage.ts list-keys <namespace-id>
# Delete a key
bun scripts/kv-storage.ts delete <namespace-id> "session:user123"
Important: KV storage uses eventual consistency. Writes may take up to 60 seconds to propagate globally. For immediate reads, use the same edge location where you wrote the data.
To create an R2 bucket and manage objects:
# Create bucket
bun scripts/r2-storage.ts create-bucket media-assets
# Upload file
bun scripts/r2-storage.ts upload media-assets ./images/logo.png logo.png
# List objects
bun scripts/r2-storage.ts list-objects media-assets
# Download object
bun scripts/r2-storage.ts download media-assets logo.png ./downloaded-logo.png
To deploy a static site or application to Pages:
# Create Pages project (or get existing project info)
bun scripts/pages.ts deploy my-app ./dist
# Returns: https://my-app.pages.dev
# Set environment variable
bun scripts/pages.ts set-env my-app API_URL https://api.example.com
# Set environment variable for specific environment
bun scripts/pages.ts set-env my-app DEBUG true --env preview
# Get deployment URL
bun scripts/pages.ts get-url my-app
Auto-extracted URLs: The Pages script automatically extracts and returns the Cloudflare-generated URL (e.g., https://my-app.pages.dev) from the deployment response.
Note: The API creates the project structure, but for actual file uploads, you'll need Wrangler CLI:
npx wrangler pages deploy ./dist --project-name=my-app
Why this works: The skill creates/verifies the Pages project and returns the URL. For the initial deployment with files, Wrangler handles the complex multipart upload process.
To create DNS records and configure worker routes:
# Create DNS A record
bun scripts/dns-routes.ts create-dns example.com A api 192.168.1.1
# Route pattern to worker
bun scripts/dns-routes.ts create-route example.com "*.example.com/api/*" api-handler
To set up a complete application with worker, KV storage, and R2 bucket:
Create KV namespace for caching
bun scripts/kv-storage.ts create-namespace app-cache
Create R2 bucket for media
bun scripts/r2-storage.ts create-bucket app-media
Deploy worker with bindings
bun scripts/workers.ts deploy app-worker ./worker.js --kv-binding app-cache --r2-binding app-media
Configure route
bun scripts/dns-routes.ts create-route example.com "example.com/*" app-worker
To update an existing worker's code or bindings:
# Update worker code
bun scripts/workers.ts update worker-name ./new-worker-script.js
# Get worker details
bun scripts/workers.ts get worker-name
# List all workers
bun scripts/workers.ts list
To perform bulk operations on KV storage:
# Bulk write from JSON file
bun scripts/kv-storage.ts bulk-write namespace-name ./data.json
# Delete multiple keys
bun scripts/kv-storage.ts bulk-delete namespace-name key1 key2 key3
If .env file is missing or CLOUDFLARE_API_KEY is not set:
Error: CLOUDFLARE_API_KEY not found in environment
Solution: Create .env file in project root:
echo "CLOUDFLARE_API_KEY=your_token_here" > .env
If API token lacks required permissions:
Error: Insufficient permissions for Workers deployment
Required: Workers Scripts: Edit
Current: Workers Scripts: Read
Solution: Update token permissions at:
https://dash.cloudflare.com/profile/api-tokens
If too many requests are made:
Error: Rate limit exceeded (429)
Solution: Retry automatically with exponential backoff (3 attempts)
If API is unreachable:
Error: Failed to connect to Cloudflare API
Solution: Check internet connection and retry
Security:
.env files - always add to .gitignorewrangler secret put SECRET_NAMEPerformance:
Development Workflow:
wrangler dev for local testingbun scripts/validate-api-key.tswrangler tail worker-nameapi-v1, api-v2Naming Conventions:
user-auth-worker not worker1)app-sessions, api-cache)media-assets-prod)Resource Management:
For advanced scenarios including:
See examples.md for comprehensive examples and patterns.
All scripts are located in ~/.claude/skills/cloudflare-manager/scripts/:
Starter templates are available in ~/.claude/skills/cloudflare-manager/templates/:
For the most critical problems encountered in production, see Common Pitfalls above:
First steps when something fails:
# 1. Validate API credentials and permissions
bun scripts/validate-api-key.ts
# 2. List existing resources to check state
bun scripts/workers.ts list
bun scripts/kv-storage.ts list-namespaces
bun scripts/r2-storage.ts list-buckets
bun scripts/pages.ts list-projects
# 3. Check specific resource details
bun scripts/workers.ts get worker-name
bun scripts/pages.ts list-deployments project-name
When to use each:
Issue: "Worker deployment failed with unknown error"
Symptoms: Deployment command exits with error code 1, no specific error message
Solutions:
node --check ./worker.jsls -lh ./worker.jsbun scripts/validate-api-key.ts --no-cacheIssue: "KV namespace not found"
Symptoms: Error when trying to read/write to namespace
Solutions:
bun scripts/kv-storage.ts list-namespacesIssue: "R2 bucket already exists" or "Bucket name taken"
Symptoms: Cannot create bucket with chosen name
Solutions:
my-app-media-2024 instead of mediabun scripts/r2-storage.ts list-bucketsIssue: "Pages deployment timeout" or "Deployment pending"
Symptoms: Deployment doesn't complete, stays in pending state
Solutions:
bun scripts/pages.ts list-deployments project-nameIssue: "DNS record creation failed"
Symptoms: Cannot create DNS records or routes
Solutions:
bun scripts/dns-routes.ts list-zonesdig NS yourdomain.comIssue: "API rate limit exceeded (429)"
Symptoms: Commands fail with "Too many requests"
Solutions:
Issue: "CLOUDFLARE_API_KEY not found in environment"
Symptoms: Commands fail immediately with environment error
Solutions:
.env file in project root (not skill directory)cat .env | grep CLOUDFLARE_API_KEYCLOUDFLARE_API_KEY=token (no spaces around =).env existsQuick Fix:
cd /path/to/your/project
echo "CLOUDFLARE_API_KEY=your_token_here" > .env
bun scripts/validate-api-key.ts
DOCS.md (opens in a new tab)bun.lock (opens in a new tab)examples.md (opens in a new tab)package.json (opens in a new tab)scripts/dns-routes.ts (opens in a new tab)scripts/kv-storage.ts (opens in a new tab)scripts/pages.ts (opens in a new tab)scripts/r2-storage.ts (opens in a new tab)scripts/utils.ts (opens in a new tab)scripts/validate-api-key.ts (opens in a new tab)scripts/workers.ts (opens in a new tab)templates/worker-template.js (opens in a new tab)templates/wrangler.toml.template (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Generated from the plugin's indexed repository (ckorhonen/claude-skills) — no native marketplace selected
npx claudepluginhub p/ckorhonen-claude-skills59 skills in this plugin
/agent-browserAutomate headless browser interactions using agent-browser CLI. Use when scraping web pages, automating form submissions, testing web apps, or performing browser automation tasks. Works with element refs (@e1, @e2) optimized for AI agent reasoning./agent-engineeringBattle-tested engineering principles for AI coding agents. Covers plan-first workflow, subagent delegation, self-improvement loops, verification gates, elegant solutions, autonomous bug fixing, and structured task management. Use when configuring agent behavior, writing AGENTS.md files, or improving agent reliability and code quality./app-marketing-copyWrite marketing copy and App Store / Google Play listings (ASO keywords, titles, subtitles, short+long descriptions, feature bullets, release notes), plus screenshot caption sets and text-to-image prompt templates for generating store screenshot backgrounds/promo visuals. Use when asked to: write/refresh app marketing copy, craft app store metadata, brainstorm taglines/value props, produce ad/landing/email copy, or generate prompts for screenshot/creative generation./ascii-pixel-artGenerate animated ASCII art from images with subject detection, blurred pixelated backgrounds, and dynamic visual effects. Use when asked to create ASCII art, convert an image to ASCII, generate pixel art, add animated text art effects, or make retro-style visual art from photos./autopredictWrap the howdymary/autopredict Polymarket trading-agent repo. Use when you need to scan live Polymarket markets, inspect structural event mispricing, evaluate a market with your own fair probability, run reproducible backtests against a JSON dataset, tune strategy parameters safely, or review the repo's paper/live trading scaffolds and failure modes./autoresearchRun a rigorous autonomous experiment loop for any optimization target using explicit hypotheses, repeated trials, structured experiment logs, and local HTML reports. Use when asked to "run autoresearch", "optimize X in a loop", "start experiments", or "improve this with benchmark-driven iteration".Other plugins' skills for the same job