ckorhonen/claude-skills/cloudflare-manager
Claude Code and agent skill by ckorhonen/claude-skills
- community
Checking that the SKILL.md file is still in the repository.
Comprehensive Cloudflare account management for deploying Workers, KV Storage, R2, Pages, DNS, and Routes. Use when deploying cloudflare services, managing worker containers, configuring KV/R2 storage, or setting up DNS/routing. Requires CLOUDFLARE_API_KEY in .env and Bun runtime with dependencies installed.
Install
npx vskill@latest install ckorhonen/claude-skills/cloudflare-managerSKILL.md
Cloudflare Manager
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.
Initial Setup
Before using this skill for the first time:
- Install Dependencies
``bash cd ~/.claude/skills/cloudflare-manager bun install ``
- Configure API Key
Create a .env file in your project root: ``bash CLOUDFLARE_API_KEY=your_api_token_here CLOUDFLARE_ACCOUNT_ID=your_account_id # Optional, auto-detected ``
Getting your API token:
- Visit https://dash.cloudflare.com/profile/api-tokens
- Click "Create Token"
- Use "Edit Cloudflare Workers" template (or create custom token)
- Required permissions:
- Account > Workers Scripts > Edit
- Account > Workers KV Storage > Edit
- Account > Workers R2 Storage > Edit
- Account > Cloudflare Pages > Edit
- Zone > DNS > Edit (if using custom domains)
- Validate Credentials
Run validation to verify your API key and check permissions: ``bash 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:
- If validation fails with 401/403: Check your API token is correct in
.env - If validation fails with network error: Check internet connection
- Use
--no-cacheflag to force fresh validation:bun scripts/validate-api-key.ts --no-cache
Current API Permissions
<!-- PERMISSIONS_START --> Run bun scripts/validate-api-key.ts to populate this section with your current permissions. <!-- PERMISSIONS_END -->
Examples
Example 1: Deploy New Worker API
User request:
Workflow:
- Validate API credentials exist in .env
- Deploy worker script:
``bash bun scripts/workers.ts deploy api-handler ./worker.js ``
- Extract Cloudflare-generated URL from response
- Return URL:
https://api-handler.username.workers.dev
Expected output:
Time: 2-5 seconds
Example 2: Full Application Stack (Worker + KV + R2)
User request:
Workflow:
- Create KV namespace for session caching:
``bash bun scripts/kv-storage.ts create-namespace app-sessions # Returns: namespace-id-123 ``
- Create R2 bucket for user uploads:
``bash bun scripts/r2-storage.ts create-bucket app-uploads # Returns: Bucket created: app-uploads ``
- Deploy worker with bindings:
``bash 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:
``bash bun scripts/dns-routes.ts create-route example.com \ "api.example.com/*" app-api ``
Expected output:
Time: 8-12 seconds total
Example 3: Deploy Static Site to Pages
User request:
Workflow:
- Create Pages project (if doesn't exist):
``bash bun scripts/pages.ts deploy my-site ./dist ``
- For first deployment with files, use Wrangler:
``bash npx wrangler pages deploy ./dist --project-name=my-site ``
- Set environment variables:
``bash 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:
Time: 15-30 seconds (depends on site size)
Quick Start Guide
Deploy a Worker Container
To deploy a new worker container sandbox:
What happens:
- Creates new worker container
- Deploys JavaScript/TypeScript code
- Automatically extracts and returns Cloudflare-generated URL (e.g.,
https://worker-name.username.workers.dev) - Returns worker ID and configuration
Example conversation:
Exit codes:
0: Success - worker deployed and URL returned1: Failure - check error message for details
Performance: Deployment typically completes in 2-5 seconds
Common Pitfalls
⚠️ Most Critical Issues — Address these first if you encounter problems:
1. API Token Scoping (Most Common Cause of Failures)
The Problem: API tokens with insufficient or incorrectly scoped permissions fail silently with 403 errors, making debugging very difficult.
How to Avoid:
- When creating a token at https://dash.cloudflare.com/profile/api-tokens, use the "Edit Cloudflare Workers" template — don't use "Read All" or custom scopes without the right permissions
- Required minimum scopes:
- Account > Workers Scripts > Edit
- Account > Workers KV Storage > Edit
- Account > Workers R2 Storage > Edit
- Zone > DNS > Edit (only if using custom domains)
- Verify your token immediately after creation:
``bash 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:
2. Wrangler OAuth Port Conflicts
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:
- Before running
wrangler login, kill all other Wrangler processes:
``bash pkill -f wrangler ``
- Then run login:
``bash wrangler login ``
- Only start
wrangler devor Pages after login completes
Why 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.
3. Deployment Timeouts (Large Projects)
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:
- Worker scripts: Keep under 1MB (smaller = faster cold start)
- Pages deployments:
- Projects with >1000 files may take 5-10 minutes
- Use
.cloudflare/ignore patterns to exclude node_modules, build caches, etc. - For large deployments, use Wrangler CLI directly:
``bash npx wrangler pages deploy ./dist --project-name=my-app ``
- Network: Deploy from a stable connection. Retries use exponential backoff and should succeed automatically
- If stuck in pending state:
``bash bun scripts/pages.ts list-deployments my-app # Check status # If truly stuck, delete and recreate the project ``
Reference: Troubleshooting Guide
For detailed solutions to specific error messages, see the Troubleshooting section below.
Create and Use KV Storage
To create a KV namespace and store data:
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.
Create R2 Bucket and Upload Files
To create an R2 bucket and manage objects:
Deploy to Cloudflare Pages
To deploy a static site or application to Pages:
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:
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.
Configure DNS and Routes
To create DNS records and configure worker routes:
Common Workflows
Multi-Service Setup
To set up a complete application with worker, KV storage, and R2 bucket:
- Create KV namespace for caching
``bash bun scripts/kv-storage.ts create-namespace app-cache ``
- Create R2 bucket for media
``bash bun scripts/r2-storage.ts create-bucket app-media ``
- Deploy worker with bindings
``bash bun scripts/workers.ts deploy app-worker ./worker.js --kv-binding app-cache --r2-binding app-media ``
- Configure route
``bash bun scripts/dns-routes.ts create-route example.com "example.com/*" app-worker ``
Update Worker Configuration
To update an existing worker's code or bindings:
Bulk KV Operations
To perform bulk operations on KV storage:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/cloudflare-manager/SKILL.md
Popularity
- Repository stars
- 1
- 7-day trend score
- 3
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 17 Mar 2026, 8 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/ckorhonen/claude-skills/cloudflare-manager)