What problem does it solve?
This Skill solves the problem of writing or reviewing Cloudflare Workers code that contains outdated API usage, security vulnerabilities, configuration errors, or common anti-patterns that lead to production failures, performance issues, or security breaches. It eliminates reliance on potentially outdated pre-trained knowledge by enforcing retrieval of the latest official Cloudflare documentation and type definitions for all Workers-related tasks.
Core Features & Use Cases
- Production-Grade Code Review: Reviews existing Workers code for anti-patterns like floating promises, unbounded response streaming, hardcoded secrets, incorrect binding access, and insecure crypto usage, with prioritized, evidence-backed fixes.
- Compliant Code Authoring: Guides the creation of new Workers code that adheres to current API signatures, wrangler configuration standards, and Cloudflare best practices for security, observability, and architecture.
- Configuration Validation: Validates wrangler.jsonc files for correct compatibility dates, required flags like nodejs_compat, binding consistency with code, and proper secret handling.
- Use Case: A developer building a new Worker that uses R2 bindings and Queues for background processing can use this Skill to ensure correct binding setup, secure secret management, and proper offloading of async work to avoid request timeouts.
Quick Start
Use the workers-best-practices skill to review your Cloudflare Worker code for security flaws, configuration errors, and common anti-patterns, and receive a prioritized list of fixes with references to the latest official Cloudflare documentation.