cloudflare-workers
cloudflare workers — production-ready cloudflare configuration and management for cloud infrastructure.
Cloudflare Workers
Deploy and manage cloudflare infrastructure with battle-tested patterns and automation.
Overview
This skill provides comprehensive guidance for cloudflare workers in production environments. It covers initial setup, configuration management, scaling strategies, and operational best practices that teams use to run reliable infrastructure.
The skill handles the full lifecycle — from bootstrapping a new cloudflare configuration to debugging production issues, managing upgrades, and implementing security hardening. It produces infrastructure-as-code that is reviewable, testable, and version-controlled.
Built on real-world patterns from organizations running cloudflare at scale, this skill emphasizes repeatability, observability, and cost-efficiency while avoiding common footguns that lead to outages or security incidents.
When to Use
Activate this skill when the user needs to:
Set up cloudflare for a new project or environment
Migrate existing infrastructure to cloudflare-managed configuration
Debug and troubleshoot cloudflare deployment issues
Implement security hardening for cloudflare resources
Optimize cloud costs through cloudflare configuration
Create CI/CD pipelines that include cloudflare operations
Core Capabilities
Initial Setup & Configuration
Generates complete cloudflare configuration files with sensible defaults, proper directory structure, and environment-specific overrides. Includes documentation comments explaining each configuration choice.
Security Hardening
Applies least-privilege principles, encrypts sensitive data, implements network policies, and follows CIS benchmarks for cloudflare deployments. Generates audit-ready configurations.
Scaling & Performance
Configures auto-scaling policies, resource limits, health checks, and load balancing. Monitors resource utilization and recommends right-sizing based on actual usage patterns.
Disaster Recovery
Implements backup strategies, failover configurations, and recovery procedures. Tests disaster scenarios and documents runbooks for operational teams.
Example Prompts
Users might ask:
"Set up cloudflare for our cloud production environment"
"Create a cloudflare module for the database cluster"
"Debug why the cloudflare deployment is failing on the staging environment"
"Add monitoring and alerting to our cloudflare infrastructure"
"Optimize the cloudflare configuration to reduce our monthly cloud bill"
Configuration
ParameterDefaultDescription
environmentproductionTarget deployment environment
regionus-east-1Primary cloud region
dryRunfalsePreview changes without applying
backupEnabledtrueEnable automated backups
Best Practices
Use version control for all infrastructure code — Every configuration change should go through code review, just like application code
Implement state locking — Prevent concurrent modifications that can corrupt infrastructure state
Use modules for reusability — Extract common patterns into reusable modules with well-defined interfaces
Tag all resources — Apply consistent tags for cost allocation, ownership, and environment identification
Test infrastructure changes — Use plan/preview commands before applying, and run automated validation tests
Document operational procedures — Maintain runbooks for common operations like scaling, failover, and rollback
Common Pitfalls
⚠️ Hardcoding secrets in configuration files — use secret managers or environment variables
⚠️ Not using state locking — concurrent applies can corrupt infrastructure state
⚠️ Skipping the plan/preview step — always review what will change before applying
⚠️ Over-provisioning resources — start small and scale based on actual metrics
⚠️ Not testing disaster recovery — untested backups are not backups
Output Format
Generates complete cloudflare configuration files, module structures, variable definitions, and CI/CD pipeline configurations. Includes inline documentation and operational runbooks.