[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M74B3E7X6N7HFTDYCSJF4J8D":3,"skill-same:01M74B3E7X6N7HFTDYCSJF4J8D":96},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":6,"repositoryNo":11,"starsCount":12,"licenseSpdxId":13,"licenseFileUrl":6,"sourceHtmlUrl":14,"categories":15,"keywords":16,"publishedAt":17,"linkOnly":18,"markdownContent":19,"markdownBody":20,"frontMatter":21,"refName":22,"commitSha":23,"skillDirectory":24,"forksCount":12,"repositoryHtmlUrl":25,"repositoryHomepageUrl":6,"ownerHtmlUrl":26,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":27,"install":28,"resources":41},"01M74B3E7X6N7HFTDYCSJF4J8D","cloudflare-manager",null,"aicreator350\u002FaurionOFFICIELLE","aicreator350","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F217751428?v=4","01M731QVHB22WCM6PDX5VFN1RV","01M731QVJ0TAD058M1SW9MY548",0,"MIT","https:\u002F\u002Fgithub.com\u002Faicreator350\u002FaurionOFFICIELLE\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fcloudflare-manager\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"﻿---name: Cloudflare Managerdescription: Comprehensive Cloudflare account management for deploying Workers, KV Storage, R2, Pages, DNS, and Routes. Use when deploying cloudflare services, managing worker containers, configuring KV\u002FR2 storage, or setting up DNS\u002Frouting. Requires CLOUDFLARE_API_KEY in .env and Bun runtime with dependencies installed.---# Cloudflare ManagerComprehensive 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 SetupBefore using this skill for the first time:1. **Install Dependencies**   ```bash   cd ~\u002F.claude\u002Fskills\u002Fcloudflare-manager   bun install   ```2. **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:\u002F\u002Fdash.cloudflare.com\u002Fprofile\u002Fapi-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)3. **Validate Credentials**   Run validation to verify your API key and check permissions:   ```bash   cd ~\u002F.claude\u002Fskills\u002Fcloudflare-manager   bun scripts\u002Fvalidate-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\u002F403: Check your API token is correct in `.env`   - If validation fails with network error: Check internet connection   - Use `--no-cache` flag to force fresh validation: `bun scripts\u002Fvalidate-api-key.ts --no-cache`## Current API Permissions\u003C!-- PERMISSIONS_START -->Run `bun scripts\u002Fvalidate-api-key.ts` to populate this section with your current permissions.\u003C!-- PERMISSIONS_END -->## Quick Start Guide### Deploy a Worker ContainerTo deploy a new worker container sandbox:```bash# Using the skillbun scripts\u002Fworkers.ts deploy worker-name .\u002Fworker-script.js```**What happens**:- Creates new worker container- Deploys JavaScript\u002FTypeScript code- Automatically extracts and returns Cloudflare-generated URL (e.g., `https:\u002F\u002Fworker-name.username.workers.dev`)- Returns worker ID and configuration**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\u002Fworkers.ts deploy api-handler .\u002Fworker.js]       Returns URL: https:\u002F\u002Fapi-handler.username.workers.dev```**Exit codes**:- `0`: Success - worker deployed and URL returned- `1`: Failure - check error message for details**Performance**: Deployment typically completes in 2-5 seconds### Create and Use KV StorageTo create a KV namespace and store data:```bash# Create namespacebun scripts\u002Fkv-storage.ts create-namespace user-sessions# Returns: Namespace ID (e.g., abc123def456)# Save this ID for binding to workers# Write key-value pairbun scripts\u002Fkv-storage.ts write \u003Cnamespace-id> \"session:user123\" '{\"userId\":\"123\",\"token\":\"abc\"}'# Read valuebun scripts\u002Fkv-storage.ts read \u003Cnamespace-id> \"session:user123\"# Returns: {\"userId\":\"123\",\"token\":\"abc\"}# List all keys (useful for debugging)bun scripts\u002Fkv-storage.ts list-keys \u003Cnamespace-id># Delete a keybun scripts\u002Fkv-storage.ts delete \u003Cnamespace-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.### Create R2 Bucket and Upload FilesTo create an R2 bucket and manage objects:```bash# Create bucketbun scripts\u002Fr2-storage.ts create-bucket media-assets# Upload filebun scripts\u002Fr2-storage.ts upload media-assets .\u002Fimages\u002Flogo.png logo.png# List objectsbun scripts\u002Fr2-storage.ts list-objects media-assets# Download objectbun scripts\u002Fr2-storage.ts download media-assets logo.png .\u002Fdownloaded-logo.png```### Deploy to Cloudflare PagesTo deploy a static site or application to Pages:```bash# Create Pages project (or get existing project info)bun scripts\u002Fpages.ts deploy my-app .\u002Fdist# Returns: https:\u002F\u002Fmy-app.pages.dev# Set environment variablebun scripts\u002Fpages.ts set-env my-app API_URL https:\u002F\u002Fapi.example.com# Set environment variable for specific environmentbun scripts\u002Fpages.ts set-env my-app DEBUG true --env preview# Get deployment URLbun scripts\u002Fpages.ts get-url my-app```**Auto-extracted URLs**: The Pages script automatically extracts and returns the Cloudflare-generated URL (e.g., `https:\u002F\u002Fmy-app.pages.dev`) from the deployment response.**Note**: The API creates the project structure, but for actual file uploads, you'll need Wrangler CLI:```bashnpx wrangler pages deploy .\u002Fdist --project-name=my-app```**Why this works**: The skill creates\u002Fverifies the Pages project and returns the URL. For the initial deployment with files, Wrangler handles the complex multipart upload process.### Configure DNS and RoutesTo create DNS records and configure worker routes:```bash# Create DNS A recordbun scripts\u002Fdns-routes.ts create-dns example.com A api 192.168.1.1# Route pattern to workerbun scripts\u002Fdns-routes.ts create-route example.com \"*.example.com\u002Fapi\u002F*\" api-handler```## Common Workflows### Multi-Service SetupTo set up a complete application with worker, KV storage, and R2 bucket:1. **Create KV namespace for caching**   ```bash   bun scripts\u002Fkv-storage.ts create-namespace app-cache   ```2. **Create R2 bucket for media**   ```bash   bun scripts\u002Fr2-storage.ts create-bucket app-media   ```3. **Deploy worker with bindings**   ```bash   bun scripts\u002Fworkers.ts deploy app-worker .\u002Fworker.js --kv-binding app-cache --r2-binding app-media   ```4. **Configure route**   ```bash   bun scripts\u002Fdns-routes.ts create-route example.com \"example.com\u002F*\" app-worker   ```### Update Worker ConfigurationTo update an existing worker's code or bindings:```bash# Update worker codebun scripts\u002Fworkers.ts update worker-name .\u002Fnew-worker-script.js# Get worker detailsbun scripts\u002Fworkers.ts get worker-name# List all workersbun scripts\u002Fworkers.ts list```### Bulk KV OperationsTo perform bulk operations on KV storage:```bash# Bulk write from JSON filebun scripts\u002Fkv-storage.ts bulk-write namespace-name .\u002Fdata.json# Delete multiple keysbun scripts\u002Fkv-storage.ts bulk-delete namespace-name key1 key2 key3```## Error Handling### Missing API KeyIf `.env` file is missing or `CLOUDFLARE_API_KEY` is not set:```Error: CLOUDFLARE_API_KEY not found in environmentSolution: Create .env file in project root:  echo \"CLOUDFLARE_API_KEY=your_token_here\" > .env```### Invalid PermissionsIf API token lacks required permissions:```Error: Insufficient permissions for Workers deploymentRequired: Workers Scripts: EditCurrent: Workers Scripts: ReadSolution: Update token permissions at:  https:\u002F\u002Fdash.cloudflare.com\u002Fprofile\u002Fapi-tokens```### API Rate LimitingIf too many requests are made:```Error: Rate limit exceeded (429)Solution: Retry automatically with exponential backoff (3 attempts)```### Network IssuesIf API is unreachable:```Error: Failed to connect to Cloudflare APISolution: Check internet connection and retry```## Best Practices**Security**:- Never commit `.env` files - always add to `.gitignore`- Use token-based authentication (not API keys)- Rotate tokens periodically (every 90 days recommended)- Use least-privilege principle: only grant required permissions- Store secrets via Wrangler CLI: `wrangler secret put SECRET_NAME`**Performance**:- Deploy workers to minimize latency (they run at Cloudflare edge)- Use KV storage for frequently-read data (not frequently-written)- Use R2 for large files (KV has 25MB limit per key)- Enable caching with appropriate TTLs- Keep worker scripts under 1MB for faster cold starts**Development Workflow**:- Test locally first: `wrangler dev` for local testing- Use staging environment before production- Validate credentials after token updates: `bun scripts\u002Fvalidate-api-key.ts`- Monitor worker logs: `wrangler tail worker-name`- Version your workers: use names like `api-v1`, `api-v2`**Naming Conventions**:- Workers: Use descriptive names (e.g., `user-auth-worker` not `worker1`)- KV namespaces: Include purpose (e.g., `app-sessions`, `api-cache`)- R2 buckets: Use lowercase with hyphens (e.g., `media-assets-prod`)- Be consistent across your infrastructure**Resource Management**:- Delete unused workers, namespaces, and buckets- Monitor usage in Cloudflare dashboard- Free tier limits: 100,000 requests\u002Fday for Workers- Set up billing alerts to avoid surprises## Advanced UsageFor advanced scenarios including:- Complex routing configurations- Multi-region deployments- Custom domain setup- Worker-to-worker communication- Durable Objects integration- Bulk operations and migrationsSee [examples.md](examples.md) for comprehensive examples and patterns.## Script ReferenceAll scripts are located in `~\u002F.claude\u002Fskills\u002Fcloudflare-manager\u002Fscripts\u002F`:- **validate-api-key.ts**: Validate API credentials and display permissions- **workers.ts**: Deploy, update, and manage Workers- **kv-storage.ts**: Create and manage KV namespaces and key-value pairs- **r2-storage.ts**: Create and manage R2 buckets and objects- **pages.ts**: Deploy and configure Cloudflare Pages projects- **dns-routes.ts**: Configure DNS records and worker routes- **utils.ts**: Shared utilities for API calls and error handling## TemplatesStarter templates are available in `~\u002F.claude\u002Fskills\u002Fcloudflare-manager\u002Ftemplates\u002F`:- **worker-template.js**: Basic worker template with fetch handler- **wrangler.toml.template**: Wrangler configuration template## Troubleshooting### Common Issues and Solutions**Issue**: \"Worker deployment failed with unknown error\"**Symptoms**: Deployment command exits with error code 1, no specific error message**Solutions**:1. Check script syntax: `node --check .\u002Fworker.js`2. Verify file exists: `ls -lh .\u002Fworker.js`3. Re-validate API key: `bun scripts\u002Fvalidate-api-key.ts --no-cache`4. Check worker name is valid (alphanumeric, hyphens, underscores only)---**Issue**: \"KV namespace not found\"**Symptoms**: Error when trying to read\u002Fwrite to namespace**Solutions**:1. List all namespaces: `bun scripts\u002Fkv-storage.ts list-namespaces`2. Verify you're using namespace ID (not name) in commands3. Check namespace wasn't deleted4. Ensure API token has KV Storage permissions---**Issue**: \"R2 bucket already exists\" or \"Bucket name taken\"**Symptoms**: Cannot create bucket with chosen name**Solutions**:1. Bucket names must be globally unique across all Cloudflare accounts2. Try a more specific name: `my-app-media-2024` instead of `media`3. Use existing bucket: `bun scripts\u002Fr2-storage.ts list-buckets`4. Names must be 3-63 characters, lowercase letters\u002Fnumbers\u002Fhyphens only---**Issue**: \"Pages deployment timeout\" or \"Deployment pending\"**Symptoms**: Deployment doesn't complete, stays in pending state**Solutions**:1. Check deployment status: `bun scripts\u002Fpages.ts list-deployments project-name`2. View in dashboard: https:\u002F\u002Fdash.cloudflare.com\u002Fpages3. Large deployments (>1000 files) may take 5-10 minutes4. Cancel and retry if stuck: Delete project and recreate---**Issue**: \"DNS record creation failed\"**Symptoms**: Cannot create DNS records or routes**Solutions**:1. Verify zone exists: `bun scripts\u002Fdns-routes.ts list-zones`2. Ensure domain is added to Cloudflare and active3. Check nameservers point to Cloudflare: `dig NS yourdomain.com`4. Verify API token has Zone > DNS > Edit permission---**Issue**: \"API rate limit exceeded (429)\"**Symptoms**: Commands fail with \"Too many requests\"**Solutions**:1. Scripts automatically retry with exponential backoff2. Wait 1-2 minutes before retrying manually3. Reduce concurrent operations4. Rate limits: 1200 requests per 5 minutes---**Issue**: \"CLOUDFLARE_API_KEY not found in environment\"**Symptoms**: Commands fail immediately with environment error**Solutions**:1. Create `.env` file in project root (not skill directory)2. Verify file content: `cat .env | grep CLOUDFLARE_API_KEY`3. Ensure no extra spaces: `CLOUDFLARE_API_KEY=token` (no spaces around `=`)4. Run commands from project root where `.env` exists**Quick Fix**:```bashcd \u002Fpath\u002Fto\u002Fyour\u002Fprojectecho \"CLOUDFLARE_API_KEY=your_token_here\" > .envbun scripts\u002Fvalidate-api-key.ts```## Security Notes- API keys are never logged or displayed in output- All API requests use HTTPS- User inputs are validated before API calls- Destructive operations (delete) require confirmation- Permissions are cached for 24 hours to minimize token exposure## Additional Resources- Cloudflare API Documentation: https:\u002F\u002Fdevelopers.cloudflare.com\u002Fapi\u002F- Workers Documentation: https:\u002F\u002Fdevelopers.cloudflare.com\u002Fworkers\u002F- KV Storage Guide: https:\u002F\u002Fdevelopers.cloudflare.com\u002Fkv\u002F- R2 Storage Guide: https:\u002F\u002Fdevelopers.cloudflare.com\u002Fr2\u002F- Pages Documentation: https:\u002F\u002Fdevelopers.cloudflare.com\u002Fpages\u002F","---name: Cloudflare Managerdescription: Comprehensive Cloudflare account management for deploying Workers, KV Storage, R2, Pages, DNS, and Routes. Use when deploying cloudflare services, managing worker containers, configuring KV\u002FR2 storage, or setting up DNS\u002Frouting. Requires CLOUDFLARE_API_KEY in .env and Bun runtime with dependencies installed.---# Cloudflare ManagerComprehensive 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 SetupBefore using this skill for the first time:1. **Install Dependencies**   ```bash   cd ~\u002F.claude\u002Fskills\u002Fcloudflare-manager   bun install   ```2. **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:\u002F\u002Fdash.cloudflare.com\u002Fprofile\u002Fapi-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)3. **Validate Credentials**   Run validation to verify your API key and check permissions:   ```bash   cd ~\u002F.claude\u002Fskills\u002Fcloudflare-manager   bun scripts\u002Fvalidate-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\u002F403: Check your API token is correct in `.env`   - If validation fails with network error: Check internet connection   - Use `--no-cache` flag to force fresh validation: `bun scripts\u002Fvalidate-api-key.ts --no-cache`## Current API Permissions\u003C!-- PERMISSIONS_START -->Run `bun scripts\u002Fvalidate-api-key.ts` to populate this section with your current permissions.\u003C!-- PERMISSIONS_END -->## Quick Start Guide### Deploy a Worker ContainerTo deploy a new worker container sandbox:```bash# Using the skillbun scripts\u002Fworkers.ts deploy worker-name .\u002Fworker-script.js```**What happens**:- Creates new worker container- Deploys JavaScript\u002FTypeScript code- Automatically extracts and returns Cloudflare-generated URL (e.g., `https:\u002F\u002Fworker-name.username.workers.dev`)- Returns worker ID and configuration**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\u002Fworkers.ts deploy api-handler .\u002Fworker.js]       Returns URL: https:\u002F\u002Fapi-handler.username.workers.dev```**Exit codes**:- `0`: Success - worker deployed and URL returned- `1`: Failure - check error message for details**Performance**: Deployment typically completes in 2-5 seconds### Create and Use KV StorageTo create a KV namespace and store data:```bash# Create namespacebun scripts\u002Fkv-storage.ts create-namespace user-sessions# Returns: Namespace ID (e.g., abc123def456)# Save this ID for binding to workers# Write key-value pairbun scripts\u002Fkv-storage.ts write \u003Cnamespace-id> \"session:user123\" '{\"userId\":\"123\",\"token\":\"abc\"}'# Read valuebun scripts\u002Fkv-storage.ts read \u003Cnamespace-id> \"session:user123\"# Returns: {\"userId\":\"123\",\"token\":\"abc\"}# List all keys (useful for debugging)bun scripts\u002Fkv-storage.ts list-keys \u003Cnamespace-id># Delete a keybun scripts\u002Fkv-storage.ts delete \u003Cnamespace-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.### Create R2 Bucket and Upload FilesTo create an R2 bucket and manage objects:```bash# Create bucketbun scripts\u002Fr2-storage.ts create-bucket media-assets# Upload filebun scripts\u002Fr2-storage.ts upload media-assets .\u002Fimages\u002Flogo.png logo.png# List objectsbun scripts\u002Fr2-storage.ts list-objects media-assets# Download objectbun scripts\u002Fr2-storage.ts download media-assets logo.png .\u002Fdownloaded-logo.png```### Deploy to Cloudflare PagesTo deploy a static site or application to Pages:```bash# Create Pages project (or get existing project info)bun scripts\u002Fpages.ts deploy my-app .\u002Fdist# Returns: https:\u002F\u002Fmy-app.pages.dev# Set environment variablebun scripts\u002Fpages.ts set-env my-app API_URL https:\u002F\u002Fapi.example.com# Set environment variable for specific environmentbun scripts\u002Fpages.ts set-env my-app DEBUG true --env preview# Get deployment URLbun scripts\u002Fpages.ts get-url my-app```**Auto-extracted URLs**: The Pages script automatically extracts and returns the Cloudflare-generated URL (e.g., `https:\u002F\u002Fmy-app.pages.dev`) from the deployment response.**Note**: The API creates the project structure, but for actual file uploads, you'll need Wrangler CLI:```bashnpx wrangler pages deploy .\u002Fdist --project-name=my-app```**Why this works**: The skill creates\u002Fverifies the Pages project and returns the URL. For the initial deployment with files, Wrangler handles the complex multipart upload process.### Configure DNS and RoutesTo create DNS records and configure worker routes:```bash# Create DNS A recordbun scripts\u002Fdns-routes.ts create-dns example.com A api 192.168.1.1# Route pattern to workerbun scripts\u002Fdns-routes.ts create-route example.com \"*.example.com\u002Fapi\u002F*\" api-handler```## Common Workflows### Multi-Service SetupTo set up a complete application with worker, KV storage, and R2 bucket:1. **Create KV namespace for caching**   ```bash   bun scripts\u002Fkv-storage.ts create-namespace app-cache   ```2. **Create R2 bucket for media**   ```bash   bun scripts\u002Fr2-storage.ts create-bucket app-media   ```3. **Deploy worker with bindings**   ```bash   bun scripts\u002Fworkers.ts deploy app-worker .\u002Fworker.js --kv-binding app-cache --r2-binding app-media   ```4. **Configure route**   ```bash   bun scripts\u002Fdns-routes.ts create-route example.com \"example.com\u002F*\" app-worker   ```### Update Worker ConfigurationTo update an existing worker's code or bindings:```bash# Update worker codebun scripts\u002Fworkers.ts update worker-name .\u002Fnew-worker-script.js# Get worker detailsbun scripts\u002Fworkers.ts get worker-name# List all workersbun scripts\u002Fworkers.ts list```### Bulk KV OperationsTo perform bulk operations on KV storage:```bash# Bulk write from JSON filebun scripts\u002Fkv-storage.ts bulk-write namespace-name .\u002Fdata.json# Delete multiple keysbun scripts\u002Fkv-storage.ts bulk-delete namespace-name key1 key2 key3```## Error Handling### Missing API KeyIf `.env` file is missing or `CLOUDFLARE_API_KEY` is not set:```Error: CLOUDFLARE_API_KEY not found in environmentSolution: Create .env file in project root:  echo \"CLOUDFLARE_API_KEY=your_token_here\" > .env```### Invalid PermissionsIf API token lacks required permissions:```Error: Insufficient permissions for Workers deploymentRequired: Workers Scripts: EditCurrent: Workers Scripts: ReadSolution: Update token permissions at:  https:\u002F\u002Fdash.cloudflare.com\u002Fprofile\u002Fapi-tokens```### API Rate LimitingIf too many requests are made:```Error: Rate limit exceeded (429)Solution: Retry automatically with exponential backoff (3 attempts)```### Network IssuesIf API is unreachable:```Error: Failed to connect to Cloudflare APISolution: Check internet connection and retry```## Best Practices**Security**:- Never commit `.env` files - always add to `.gitignore`- Use token-based authentication (not API keys)- Rotate tokens periodically (every 90 days recommended)- Use least-privilege principle: only grant required permissions- Store secrets via Wrangler CLI: `wrangler secret put SECRET_NAME`**Performance**:- Deploy workers to minimize latency (they run at Cloudflare edge)- Use KV storage for frequently-read data (not frequently-written)- Use R2 for large files (KV has 25MB limit per key)- Enable caching with appropriate TTLs- Keep worker scripts under 1MB for faster cold starts**Development Workflow**:- Test locally first: `wrangler dev` for local testing- Use staging environment before production- Validate credentials after token updates: `bun scripts\u002Fvalidate-api-key.ts`- Monitor worker logs: `wrangler tail worker-name`- Version your workers: use names like `api-v1`, `api-v2`**Naming Conventions**:- Workers: Use descriptive names (e.g., `user-auth-worker` not `worker1`)- KV namespaces: Include purpose (e.g., `app-sessions`, `api-cache`)- R2 buckets: Use lowercase with hyphens (e.g., `media-assets-prod`)- Be consistent across your infrastructure**Resource Management**:- Delete unused workers, namespaces, and buckets- Monitor usage in Cloudflare dashboard- Free tier limits: 100,000 requests\u002Fday for Workers- Set up billing alerts to avoid surprises## Advanced UsageFor advanced scenarios including:- Complex routing configurations- Multi-region deployments- Custom domain setup- Worker-to-worker communication- Durable Objects integration- Bulk operations and migrationsSee [examples.md](examples.md) for comprehensive examples and patterns.## Script ReferenceAll scripts are located in `~\u002F.claude\u002Fskills\u002Fcloudflare-manager\u002Fscripts\u002F`:- **validate-api-key.ts**: Validate API credentials and display permissions- **workers.ts**: Deploy, update, and manage Workers- **kv-storage.ts**: Create and manage KV namespaces and key-value pairs- **r2-storage.ts**: Create and manage R2 buckets and objects- **pages.ts**: Deploy and configure Cloudflare Pages projects- **dns-routes.ts**: Configure DNS records and worker routes- **utils.ts**: Shared utilities for API calls and error handling## TemplatesStarter templates are available in `~\u002F.claude\u002Fskills\u002Fcloudflare-manager\u002Ftemplates\u002F`:- **worker-template.js**: Basic worker template with fetch handler- **wrangler.toml.template**: Wrangler configuration template## Troubleshooting### Common Issues and Solutions**Issue**: \"Worker deployment failed with unknown error\"**Symptoms**: Deployment command exits with error code 1, no specific error message**Solutions**:1. Check script syntax: `node --check .\u002Fworker.js`2. Verify file exists: `ls -lh .\u002Fworker.js`3. Re-validate API key: `bun scripts\u002Fvalidate-api-key.ts --no-cache`4. Check worker name is valid (alphanumeric, hyphens, underscores only)---**Issue**: \"KV namespace not found\"**Symptoms**: Error when trying to read\u002Fwrite to namespace**Solutions**:1. List all namespaces: `bun scripts\u002Fkv-storage.ts list-namespaces`2. Verify you're using namespace ID (not name) in commands3. Check namespace wasn't deleted4. Ensure API token has KV Storage permissions---**Issue**: \"R2 bucket already exists\" or \"Bucket name taken\"**Symptoms**: Cannot create bucket with chosen name**Solutions**:1. Bucket names must be globally unique across all Cloudflare accounts2. Try a more specific name: `my-app-media-2024` instead of `media`3. Use existing bucket: `bun scripts\u002Fr2-storage.ts list-buckets`4. Names must be 3-63 characters, lowercase letters\u002Fnumbers\u002Fhyphens only---**Issue**: \"Pages deployment timeout\" or \"Deployment pending\"**Symptoms**: Deployment doesn't complete, stays in pending state**Solutions**:1. Check deployment status: `bun scripts\u002Fpages.ts list-deployments project-name`2. View in dashboard: https:\u002F\u002Fdash.cloudflare.com\u002Fpages3. Large deployments (>1000 files) may take 5-10 minutes4. Cancel and retry if stuck: Delete project and recreate---**Issue**: \"DNS record creation failed\"**Symptoms**: Cannot create DNS records or routes**Solutions**:1. Verify zone exists: `bun scripts\u002Fdns-routes.ts list-zones`2. Ensure domain is added to Cloudflare and active3. Check nameservers point to Cloudflare: `dig NS yourdomain.com`4. Verify API token has Zone > DNS > Edit permission---**Issue**: \"API rate limit exceeded (429)\"**Symptoms**: Commands fail with \"Too many requests\"**Solutions**:1. Scripts automatically retry with exponential backoff2. Wait 1-2 minutes before retrying manually3. Reduce concurrent operations4. Rate limits: 1200 requests per 5 minutes---**Issue**: \"CLOUDFLARE_API_KEY not found in environment\"**Symptoms**: Commands fail immediately with environment error**Solutions**:1. Create `.env` file in project root (not skill directory)2. Verify file content: `cat .env | grep CLOUDFLARE_API_KEY`3. Ensure no extra spaces: `CLOUDFLARE_API_KEY=token` (no spaces around `=`)4. Run commands from project root where `.env` exists**Quick Fix**:```bashcd \u002Fpath\u002Fto\u002Fyour\u002Fprojectecho \"CLOUDFLARE_API_KEY=your_token_here\" > .envbun scripts\u002Fvalidate-api-key.ts```## Security Notes- API keys are never logged or displayed in output- All API requests use HTTPS- User inputs are validated before API calls- Destructive operations (delete) require confirmation- Permissions are cached for 24 hours to minimize token exposure## Additional Resources- Cloudflare API Documentation: https:\u002F\u002Fdevelopers.cloudflare.com\u002Fapi\u002F- Workers Documentation: https:\u002F\u002Fdevelopers.cloudflare.com\u002Fworkers\u002F- KV Storage Guide: https:\u002F\u002Fdevelopers.cloudflare.com\u002Fkv\u002F- R2 Storage Guide: https:\u002F\u002Fdevelopers.cloudflare.com\u002Fr2\u002F- Pages Documentation: https:\u002F\u002Fdevelopers.cloudflare.com\u002Fpages\u002F",{},"main","5593cf3c72898ea9fc67225d452fe38f866ba6dd",".claude\u002Fskills\u002Fcloudflare-manager","https:\u002F\u002Fgithub.com\u002Faicreator350\u002FaurionOFFICIELLE","https:\u002F\u002Fgithub.com\u002Faicreator350","2026-05-18 03:39:30",{"source":7,"skillName":5,"commands":29,"prompt":39,"zipAvailable":40},[30,33,36],{"tool":31,"command":32},"npx","npx skills add aicreator350\u002FaurionOFFICIELLE --skill cloudflare-manager",{"tool":34,"command":35},"bunx","bunx skills add aicreator350\u002FaurionOFFICIELLE --skill cloudflare-manager",{"tool":37,"command":38},"pnpm","pnpm dlx skills add aicreator350\u002FaurionOFFICIELLE --skill cloudflare-manager","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Faicreator350\u002FaurionOFFICIELLE\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fcloudflare-manager\u002FSKILL.md",true,[42,48,52,56,62,66,70,74,78,82,86,90],{"path":43,"resourceType":44,"resourceTypeDesc":45,"sizeBytes":46,"sourceHtmlUrl":47},"examples.md","REFERENCE","参考文档",23361,"https:\u002F\u002Fgithub.com\u002Faicreator350\u002FaurionOFFICIELLE\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fcloudflare-manager\u002Fexamples.md",{"path":49,"resourceType":44,"resourceTypeDesc":45,"sizeBytes":50,"sourceHtmlUrl":51},"package.json",666,"https:\u002F\u002Fgithub.com\u002Faicreator350\u002FaurionOFFICIELLE\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fcloudflare-manager\u002Fpackage.json",{"path":53,"resourceType":44,"resourceTypeDesc":45,"sizeBytes":54,"sourceHtmlUrl":55},"README.md",7192,"https:\u002F\u002Fgithub.com\u002Faicreator350\u002FaurionOFFICIELLE\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fcloudflare-manager\u002FREADME.md",{"path":57,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":60,"sourceHtmlUrl":61},"scripts\u002Fdns-routes.ts","SCRIPT","脚本",11271,"https:\u002F\u002Fgithub.com\u002Faicreator350\u002FaurionOFFICIELLE\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fcloudflare-manager\u002Fscripts\u002Fdns-routes.ts",{"path":63,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":64,"sourceHtmlUrl":65},"scripts\u002Fkv-storage.ts",13586,"https:\u002F\u002Fgithub.com\u002Faicreator350\u002FaurionOFFICIELLE\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fcloudflare-manager\u002Fscripts\u002Fkv-storage.ts",{"path":67,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":68,"sourceHtmlUrl":69},"scripts\u002Fpages.ts",12725,"https:\u002F\u002Fgithub.com\u002Faicreator350\u002FaurionOFFICIELLE\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fcloudflare-manager\u002Fscripts\u002Fpages.ts",{"path":71,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":72,"sourceHtmlUrl":73},"scripts\u002Fr2-storage.ts",13269,"https:\u002F\u002Fgithub.com\u002Faicreator350\u002FaurionOFFICIELLE\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fcloudflare-manager\u002Fscripts\u002Fr2-storage.ts",{"path":75,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":76,"sourceHtmlUrl":77},"scripts\u002Futils.ts",12415,"https:\u002F\u002Fgithub.com\u002Faicreator350\u002FaurionOFFICIELLE\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fcloudflare-manager\u002Fscripts\u002Futils.ts",{"path":79,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":80,"sourceHtmlUrl":81},"scripts\u002Fvalidate-api-key.ts",8779,"https:\u002F\u002Fgithub.com\u002Faicreator350\u002FaurionOFFICIELLE\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fcloudflare-manager\u002Fscripts\u002Fvalidate-api-key.ts",{"path":83,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":84,"sourceHtmlUrl":85},"scripts\u002Fworkers.ts",13445,"https:\u002F\u002Fgithub.com\u002Faicreator350\u002FaurionOFFICIELLE\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fcloudflare-manager\u002Fscripts\u002Fworkers.ts",{"path":87,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":88,"sourceHtmlUrl":89},"templates\u002Fworker-template.js",7760,"https:\u002F\u002Fgithub.com\u002Faicreator350\u002FaurionOFFICIELLE\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fcloudflare-manager\u002Ftemplates\u002Fworker-template.js",{"path":91,"resourceType":92,"resourceTypeDesc":93,"sizeBytes":94,"sourceHtmlUrl":95},"templates\u002Fwrangler.toml.template","OTHER","其他",3806,"https:\u002F\u002Fgithub.com\u002Faicreator350\u002FaurionOFFICIELLE\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fcloudflare-manager\u002Ftemplates\u002Fwrangler.toml.template",[97,106,113,120,127,134],{"skillNo":98,"name":99,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":6,"repositoryNo":11,"starsCount":12,"licenseSpdxId":101,"licenseFileUrl":102,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":17},"01M74CAJWR9WB6DX1HF2V461Y0","webapp-testing","Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Faicreator350\u002FaurionOFFICIELLE\u002Fblob\u002Fmain\u002Fskills\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Faicreator350\u002FaurionOFFICIELLE\u002Fblob\u002Fmain\u002Fskills\u002Fwebapp-testing\u002FSKILL.md",[],[],{"skillNo":107,"name":108,"nameZh":6,"description":109,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":6,"repositoryNo":11,"starsCount":12,"licenseSpdxId":13,"licenseFileUrl":6,"sourceHtmlUrl":110,"categories":111,"keywords":112,"publishedAt":17},"01M74CAFWC2H75GJ81B39C9RSW","web-design-guidelines","Review UI code for Web Interface Guidelines compliance. Use when asked to \"review my UI\", \"check accessibility\", \"audit design\", \"review UX\", or \"check my site against best practices\".","https:\u002F\u002Fgithub.com\u002Faicreator350\u002FaurionOFFICIELLE\u002Fblob\u002Fmain\u002Fskills\u002Fweb-design-guidelines\u002FSKILL.md",[],[],{"skillNo":114,"name":115,"nameZh":6,"description":116,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":6,"repositoryNo":11,"starsCount":12,"licenseSpdxId":13,"licenseFileUrl":6,"sourceHtmlUrl":117,"categories":118,"keywords":119,"publishedAt":17},"01M74CA9N2HTGCKJ93AE9NQMHA","vercel-react-view-transitions","Guide for implementing smooth, native-feeling animations using React's View Transition API (`\u003CViewTransition>` component, `addTransitionType`, and CSS view transition pseudo-elements). Use this skill whenever the user wants to add page transitions, animate route changes, create shared element animations, animate enter\u002Fexit of components, animate list reorder, implement directional (forward\u002Fback) navigation animations, or integrate view transitions in Next.js. Also use when the user mentions view transitions, `startViewTransition`, `ViewTransition`, transition types, or asks about animating between UI states in React without third-party animation libraries.","https:\u002F\u002Fgithub.com\u002Faicreator350\u002FaurionOFFICIELLE\u002Fblob\u002Fmain\u002Fskills\u002Fvercel-react-view-transitions\u002FSKILL.md",[],[],{"skillNo":121,"name":122,"nameZh":6,"description":123,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":6,"repositoryNo":11,"starsCount":12,"licenseSpdxId":13,"licenseFileUrl":6,"sourceHtmlUrl":124,"categories":125,"keywords":126,"publishedAt":17},"01M74CA364D4EVDXZZQRVK1Z73","vercel-react-best-practices","React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React\u002FNext.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.","https:\u002F\u002Fgithub.com\u002Faicreator350\u002FaurionOFFICIELLE\u002Fblob\u002Fmain\u002Fskills\u002Fvercel-react-best-practices\u002FSKILL.md",[],[],{"skillNo":128,"name":129,"nameZh":6,"description":130,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":6,"repositoryNo":11,"starsCount":12,"licenseSpdxId":13,"licenseFileUrl":6,"sourceHtmlUrl":131,"categories":132,"keywords":133,"publishedAt":17},"01M74C9YQZX1GVS18V0AYCYPZE","vercel-composition-patterns","React composition patterns that scale. Use when refactoring components with boolean prop proliferation, building flexible component libraries, or designing reusable APIs. Triggers on tasks involving compound components, render props, context providers, or component architecture. Includes React 19 API changes.","https:\u002F\u002Fgithub.com\u002Faicreator350\u002FaurionOFFICIELLE\u002Fblob\u002Fmain\u002Fskills\u002Fvercel-composition-patterns\u002FSKILL.md",[],[],{"skillNo":135,"name":136,"nameZh":6,"description":137,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":6,"repositoryNo":11,"starsCount":12,"licenseSpdxId":13,"licenseFileUrl":6,"sourceHtmlUrl":138,"categories":139,"keywords":140,"publishedAt":17},"01M74C9SEYD6F764Q1JACZX3A6","vercel-cli-with-tokens","Deploy and manage projects on Vercel using token-based authentication. Use when working with Vercel CLI using access tokens rather than interactive login — e.g. \"deploy to vercel\", \"set up vercel\", \"add environment variables to vercel\".","https:\u002F\u002Fgithub.com\u002Faicreator350\u002FaurionOFFICIELLE\u002Fblob\u002Fmain\u002Fskills\u002Fvercel-cli-with-tokens\u002FSKILL.md",[],[]]