# Cloudflare Workers Production Pack

> Eight agent skills and two scripts that make your AI agent ship Cloudflare Workers right: wrangler config, D1, R2, KV, Queues, Durable Objects, limits, CI.

Cloudflare Workers Production Pack is a paid AI agent skill on Agensi by Abdalkader Alhamoud, in DevOps & Cloud. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $24 (one-time purchase)
- Creator: [Abdalkader Alhamoud](https://www.agensi.io/creators/abdalkaderdev)
- Category: [DevOps & Cloud](https://www.agensi.io/skills/devops-cloud)
- Version: 1.0
- Last updated: 2026-10-13
- Security: scan passed (2026-10-13); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/cloudflare-workers-production-pack
- Tags: devops, api, database, cloudflare, cloudflare-workers, wrangler, d1, r2

## About this skill

Agents write a Worker's `fetch` handler well. They get production wrong: a staging environment that deploys without its D1 binding because bindings are not inherited, a staging deploy that takes the production Custom Domain because routes are, an API key in `vars`, `BEGIN TRANSACTION` in D1, `wrangler d1 migrations apply` without `--remote` in CI (it succeeds and changes nothing), KV used as a counter, a queue consumer that throws and redelivers the whole batch, Durable Objects on the key-value backend that can never move to SQLite, test setups built on `defineWorkersConfig` that the current Vitest integration removed, and size limits quoted from three years ago.

This pack gives the agent current rules, checked against the Cloudflare developer docs, the wrangler 4.150 config schema and CLI help, and the package source:

- **cloudflare-workers-production**: routing, pre-flight checklist, current versions, the boundaries that change behaviour.
- **workers-wrangler-config**: `wrangler.jsonc`, compatibility dates and flags, environments, vars vs secrets and `secrets.required`, `wrangler types`, Custom Domains vs routes vs workers.dev, Version URLs.
- **workers-d1-hyperdrive**: migrations, prepared statements, `batch` transactions, retryable errors, read replication, Time Travel, the foreign-key cascade trap in table rebuilds; Hyperdrive with node-postgres and Postgres.js.
- **workers-r2-kv**: conditional and range reads, multipart uploads, presigned URLs with a signed content type, bucket CORS, KV consistency and when not to use KV.
- **workers-queues-workflows**: per-message ack and retry, idempotent consumers, dead letter queues, Workflows steps, retries, `waitForEvent`, rollback handlers.
- **workers-durable-objects**: SQLite storage, the `exports` field, alarms, WebSocket hibernation, RPC, retry rules, duration billing.
- **workers-limits-caching**: CPU, memory, subrequests, size and startup limits with docs page and date, pricing gotchas, Workers Cache, Cache API, Cache Rules precedence.
- **workers-testing-release**: `@cloudflare/vitest-plugin`, D1 migrations in tests, MSW mocking, GitHub Actions deploys, gradual rollouts, rollbacks, logs, tail, traces.

Two zero-dependency Node scripts: `lint-wrangler-config.mjs` flags old compatibility dates, secrets in vars, bindings missing from environments, inherited routes, bad Custom Domain patterns, Durable Object storage mistakes and stale generated types; `check-worker-limits.mjs` reads a dry-run bundle and the config and warns on size, CPU, env var, asset and subrequest limits for your plan.

Works with Claude Code (skills folder or plugin), Codex, Gemini CLI and Cursor. Plain Agent Skills format.

Versions: wrangler 4.150, `@cloudflare/workers-types` 5.x, `@cloudflare/vitest-plugin` 1.4 with Vitest 4.1 or 5, `cloudflare/wrangler-action` v4. Reviewed after Wrangler releases that change config or deploys and after limits or pricing changes.

## Requires

- Wrangler
- Node.js
- vitest
- tsc
- @cloudflare/codemods

## Known limitations

Scripts need Node.js 22+. Nothing in the pack was deployed to a live Cloudflare account; deploy, rollback, tail and gradual rollout steps follow the docs and wrangler 4.150 CLI help. Where Cloudflare's own docs disagree (Free-plan Durable Object storage, Workflows concurrency), the pack shows both values. Targets TypeScript or JavaScript Workers on wrangler 4.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Cloudflare Workers Production Pack skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### Why not just ask my agent?

Agents write a fetch handler fine but carry stale production facts: old size limits, nodejs_compat rules from before 2026-08-04, migrations instead of the exports field, defineWorkersConfig from the old Vitest integration. The pack gives current rules checked against the Cloudflare docs and wrangler 4.150, plus a config linter that catches the deploy traps.

### What is in the zip?

One entry skill with seven guides (wrangler config, D1 and Hyperdrive, R2 and KV, Queues and Workflows, Durable Objects, limits and caching, testing and release) and two zero-dependency Node scripts: lint-wrangler-config.mjs and check-worker-limits.mjs.

### Does it work with wrangler.toml?

The guides cover both formats and use wrangler.jsonc in examples, which Cloudflare now recommends. The linter fully checks wrangler.jsonc and wrangler.json; for wrangler.toml it checks only the compatibility date and suggests converting.

### Which test setup does it use?

@cloudflare/vitest-plugin 1.4 with Vitest 4.1 or 5, the current package. It also covers moving off the old @cloudflare/vitest-pool-workers setup.

### Do the scripts need a Cloudflare account?

No. They only read local files. You need your own account to deploy, as usual.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
