workers-best-practices

Analyze Cloudflare Workers source code and configuration against production best practices.

Updated Mar 8, 2026
One-click install
npx skills add https://github.com/martinezharo/fewya --skill workers-best-practices-martinezharo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: workers-best-practices
Source: https://github.com/martinezharo/fewya/tree/main/.agents/skills/workers-best-practices
Command: npx skills add https://github.com/martinezharo/fewya --skill workers-best-practices-martinezharo

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill prevents common runtime errors, security vulnerabilities, and performance bottlenecks in Cloudflare Workers by enforcing production-ready architectural patterns and configuration standards.

Core Features & Use Cases

  • Code Review: Analyzes Workers code for anti-patterns like floating promises, global state leaks, and improper binding access.
  • Configuration Validation: Ensures wrangler.jsonc settings, compatibility dates, and secret handling follow current Cloudflare best practices.
  • Use Case: Use this Skill when refactoring a Worker to ensure it correctly implements ctx.waitUntil for background tasks, uses Hyperdrive for database connections, and avoids memory-intensive buffering of large request bodies.

Quick Start

Use the workers-best-practices skill to review the current directory for common anti-patterns and configuration errors.

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 production anti-patterns?

Review Cloudflare Workers code by analyzing source files for floating promises, global state leaks, and improper binding access. This validates request handling and platform-specific architectural constraints to ensure reliable deployment.

How do I validate wrangler.jsonc settings and compatibility dates for Cloudflare Workers?

Validate wrangler.jsonc settings by checking compatibility dates and secret handling against current Cloudflare best practices. This ensures configuration follows production-ready standards and prevents common runtime errors.

What are common Cloudflare Workers anti-patterns I should check before deployment?

Common Cloudflare Workers anti-patterns include floating promises, global state leaks, improper binding access, and memory-intensive buffering of large request bodies. Identifying these prevents runtime errors and performance bottlenecks.

How does ctx.waitUntil work for background tasks in Cloudflare Workers?

The ctx.waitUntil mechanism in Cloudflare Workers extends request lifetimes to execute background tasks. Reviewing its implementation ensures refactored Workers correctly handle asynchronous operations without terminating prematurely.

Why does my Cloudflare Worker leak state between requests?

Cloudflare Workers leak state between requests when global variables are mutated during execution. Analyzing source code for global state leaks enforces production-ready architectural patterns to prevent data contamination across isolated requests.

Can I use Hyperdrive for database connections in my Cloudflare Workers code?

You can use Hyperdrive for database connections in Cloudflare Workers to optimize external database access. Reviewing code ensures correct implementation and adherence to current platform-specific architectural constraints.