Skip to content
Back to skills

Cloudflare Workers

ASecurity

Build Cloudflare Workers and edge APIs: isolate lifecycle, bindings (KV/D1/R2), waitUntil and streaming

  • 5 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 30, 2026
developmentsqlgitapi

Works with

  • api

Security analysis

A100/100

Scanned November 30, 2026

npx -y skills add AdityaaaTiwari/ANVIL --skill cloudflare-workers --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Cloudflare Workers?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Cloudflare Workers
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/adityaaatiwari-cloudflare-workers-anvil/badge)](https://www.skillsdirectory.com/skills/adityaaatiwari-cloudflare-workers-anvil)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: cloudflare-workers
description: "Build Cloudflare Workers and edge APIs: isolate lifecycle, bindings (KV/D1/R2), waitUntil and streaming"
---

<!-- Generated by `anvil plugin build` from catalog/. Edit the catalog, not this file. -->

# Cloudflare Workers

Use when building edge endpoints, middleware, or binding integrations (`KV`, `D1`, `R2`, `Queues`) on Cloudflare Workers.

## Isolate execution model
- Isolates stay warm across requests for multiple users: never store request-scoped auth, tenant state, or secret references in module-level mutable globals.
- Return the HTTP `Response` immediately and pass non-blocking background work (logging, analytics, cache writes) to `ctx.waitUntil(promise)` with `.catch(...)` error handling.
- Stream large request/response bodies directly via Web Streams (`TransformStream`, `response.body`) rather than buffering full files inside Worker memory limits.

## Bindings and configuration
- Access bindings exclusively via the typed `env` argument in `fetch(request, env, ctx)`; generate types with `wrangler types`.
- Remember `KV` is eventually consistent (avoid it for strict uniqueness/rate-limit counters—use Durable Objects instead); parameterize all `D1` SQL queries (`stmt.bind(...)`).
- Pin `compatibility_date` in `wrangler.jsonc` / `wrangler.toml`, and keep secrets in Wrangler secrets (`.dev.vars` locally, gitignored), never in plain `vars`.

## Verify
Run `wrangler types`, Vitest with `@cloudflare/vitest-pool-workers` (or Miniflare), and test streaming responses, `waitUntil`, and binding error paths under `wrangler dev`.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.