workers-best-practices

Review Cloudflare Workers code for security flaws, configuration errors, and anti-patterns.

Updated Feb 12, 2026
One-click install
npx skills add https://github.com/mynameistito/opencode-config --skill workers-best-practices-mynameistito
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: workers-best-practices
Source: https://github.com/mynameistito/opencode-config/tree/main/skills/workers-best-practices
Command: npx skills add https://github.com/mynameistito/opencode-config --skill workers-best-practices-mynameistito

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

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.

Frequently Asked Questions about workers-best-practices

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I review Cloudflare Workers code for security vulnerabilities and anti-patterns?

To review Cloudflare Workers code, analyze scripts for floating promises, unbounded response streaming, hardcoded secrets, and insecure crypto usage. Enforce compliance with current type definitions and configuration schemas to eliminate anti-patterns causing production failures.

What are common Cloudflare Workers anti-patterns that cause production failures?

Common Cloudflare Workers anti-patterns include floating promises, unbounded response streaming, hardcoded secrets, incorrect binding access, and insecure crypto usage. These anti-patterns cause performance degradation and security breaches in serverless deployments.

How do I validate wrangler.jsonc configuration for Cloudflare Workers bindings?

Validate wrangler.jsonc configuration by checking for correct compatibility dates, required flags like nodejs_compat, binding consistency with code, and proper secret handling. This ensures compliant serverless deployments without configuration errors.

Can I use this approach to validate R2 bindings and Queues for background processing in Workers?

Yes, you can validate R2 bindings and Queues for background processing in Workers. Ensure correct binding setup, secure secret management, and proper offloading of async work to avoid request timeouts in production serverless environments.

What is the best way to write production-grade TypeScript for Cloudflare Workers?

The best way to write production-grade TypeScript for Cloudflare Workers is enforcing retrieval of the latest official documentation and type definitions. Adhere to current API signatures, wrangler configuration standards, and security requirements for observability and architecture.