- Anyone about to put a Cloudflare Workers API, site or app in front of the public, especially one written or scaffolded by an AI.
- Agencies who want the same pre-launch review and a written report for every client Worker.
- Teams who want launch checks in CI with a clear exit code.
Workers Launch Check Kit
Reviews a Cloudflare Workers project before launch: secrets, security headers, rate limits, error handling, observability and wrangler config, fixes what fails and re-runs the bundled checker until it passes.
- Node 18 or newer. The checker has no dependencies.
- A Workers project with a wrangler.jsonc, wrangler.json or wrangler.toml. git is used when it is installed.
- Optional: the deployed or preview address, for the live header and error checks.
- No Cloudflare login. The agent does not deploy, set secrets or change your account unless you say so.
Every file, and a preview of the main ones.
The tree lists everything in the zip. The previews show the first part of each main file, so you can judge the real code before you buy.
Preview the files
Everything in the zip (16 files)
- workers-launch-check/
- LICENSE
- README.md
- SKILL.md preview
- references/
- headers.md
- report-template.md
- scripts/
- verify-launch.mjs preview
- test/
- verify.test.mjs
- fixtures/
- bad/
- gitignore.txt
- wrangler.jsonc
- src/
- index.js
- good/
- gitignore.txt
- wrangler.jsonc
- migrations/
- 0001_init.sql
- src/
- index.js
- toml/
- wrangler.toml
- src/
- index.js
- bad/
workers-launch-check/SKILL.mdLines 1 to 77 of 179---
name: workers-launch-check
description: Review a Cloudflare Workers project before it goes to production, fix what fails and prove it with the bundled verify-launch.mjs script. Covers wrangler config, secrets, input handling, auth on write routes, CORS, rate limits, body size caps, outbound timeouts, error handling, logging and observability, security headers and caching, D1 and R2 data safety, and a rollback plan. Use when asked to check, review, harden or launch a Workers API, site or app, especially one that was written or scaffolded by an AI.
license: Proprietary. See LICENSE in this folder.
metadata:
version: "1.0.0"
author: Red Center Studio
---
# Workers launch check
You are getting a Cloudflare Workers project ready to face the public. Work through the ten phases below in order. The job is done when `scripts/verify-launch.mjs` passes and you have filled in the report, not when the code looks fine to you.
Paths in this file are relative to this skill's folder. The script needs Node 18 or newer and has no dependencies. Commands that touch Cloudflare use `npx wrangler`.
## Ground rules
1. **Read before you change.** Phases 1 and 2 are read-only. Tell the user what you found before Phase 3 edits anything.
2. **Never print, log, commit or paste a secret.** If you find one in code, config or git history, say where it is, say it must be rotated (it has been exposed), and move it to a Wrangler secret. Do not repeat the value in your reply.
3. **No deploys, no remote writes without a yes.** Do not run `wrangler deploy`, `wrangler secret put`, `wrangler d1 migrations apply --remote`, `wrangler d1 time-travel restore` or anything that changes the live account unless the user has said so in this session. Local commands and `--dry-run` are fine.
4. **Change the smallest thing that fixes the finding.** This is a launch review, not a rewrite. Keep the project's style and framework (plain Workers, Hono, itty-router and so on).
5. **Do not invent wrangler keys.** If you are unsure a key exists, check the current Cloudflare docs (developers.cloudflare.com/workers/wrangler/configuration/) before adding it.
6. **Ask before a product decision.** Which origins may call the API, how many requests per minute is fair, whether a bucket is meant to be public: these are the owner's calls. Propose a default, ask once, write the answer down in config or code comments.
7. **Do not weaken a check to make it pass.** A suppression comment (`launch-check-ignore: reason`) is allowed for a real false positive, with the reason written next to it. It is not a way to hide a finding.
## Phase 1: Inventory
Read the project and write down, before running anything:
1. Wrangler config (`wrangler.jsonc`, `wrangler.json` or `wrangler.toml`): name, `main`, `compatibility_date`, routes or custom domains, `workers_dev`, environments under `env`.
2. Bindings: D1, KV, R2, Durable Objects, Queues, service bindings, Workers AI, email, rate limiters, static assets.
3. Vars versus secrets. Vars are plain text in config. Secrets are set with `wrangler secret put` and are only ever read from `env`. List every `env.NAME` the code reads that is not a binding or a var: those are the secrets the deployment needs. The script prints this list as "likely secrets".
4. Entry points: HTTP routes, `scheduled` (cron), `queue` consumers, `email` handlers, Durable Object classes. For HTTP, list each route with its method and whether it is public, signed-in only, or machine-to-machine.
5. Every route that writes (POST, PUT, PATCH, DELETE) or spends money or quota (calls a paid API, sends email, runs AI). These get the most attention in Phases 4 and 5.
6. How the project is deployed (manual `wrangler deploy`, CI, Git integration) and whether there is a staging environment.
Keep this inventory. It goes into the report.
## Phase 2: Run the checker
```
node scripts/verify-launch.mjs --dir .
```
Keep the output as the "before" result. If the project is already deployed or has a preview address, also run the live checks (four polite requests):
```
node scripts/verify-launch.mjs --dir . --url https://the-worker.example.com/
```
Every FAIL and WARN prints what is wrong, where (file and line when it can tell) and the fix. The script is a set of static heuristics and a few live requests. It does not replace your reading in Phases 3 to 9, and a PASS is not a security audit. Phase 10 lists what it cannot see.
## Phase 3: Secrets and config
1. **Secrets out of config.** Nothing secret-looking in `vars`, in any `env.*.vars`, or in source. Keys, tokens, signing secrets, webhook secrets and private keys go in `npx wrangler secret put NAME` (add `--env name` for each environment, because secrets are per environment). If one was ever committed, tell the user to rotate it. Removing it from the latest commit does not un-leak it.
2. **Local secrets stay local.** `.dev.vars` and `.env` (and `.dev.vars.*`) are in `.gitignore` and not tracked by git. Provide a `.dev.vars.example` with names and fake values so the next developer knows what to set. If a real file was tracked, `git rm --cached` it and rotate its contents.
3. **Typed env.** Run `npx wrangler types` so `Env` matches the config. Fail fast if a required secret is missing: check it at the top of the request path and return a generic 500 (and log the missing name, never a value), not a confusing crash later.
4. **Compatibility date.** Set `compatibility_date` to a recent date you have tested with. The checker warns when it is more than 12 months old. Moving it forward changes runtime behaviour, so run the tests after.
5. **Observability on.** `"observability": { "enabled": true }`. On a busy Worker lower `head_sampling_rate` (0 to 1) to control volume. Without logs you cannot debug the first bad hour of a launch.
6. **Source maps.** `"upload_source_maps": true` so stack traces in logs point at your code.
7. **Where it answers.** If the Worker has routes or a custom domain, set `workers_dev` on purpose: `false` if only your domain should serve it, `true` if the workers.dev address is wanted. A forgotten workers.dev address is a second public front door that skips any zone rules (WAF, bot rules, rate limits) you set on the domain.
8. **Environments.** Bindings and vars are not inherited by `env.*` sections. Check that staging and production each declare what they need, and that staging does not point at production data.
## Phase 4: Input handling, auth on every write route, CORS
1. **Validate at the edge of every route.** Check type, length and allowed values of each field you use before using it. Reject with 400 and a short message. Do not trust `content-type`, query strings, path parameters or headers.
2. **SQL.** D1 queries use fixed SQL with `?` placeholders and `.bind(...)`. Never build SQL with template literals or `+`. The checker fails on this. For a column or table name that must vary, map the user's input through an allowlist object and use the mapped constant, then add `launch-check-ignore: allowlisted` on that line.
3. **No code from strings.** No `eval`, `new Function`. Do not pass user text to `fetch` as a URL without checking the host (server-side request forgery): allow only the hosts you mean to call.
4. **Auth on every route that writes or spends.** Walk the list from Phase 1 one route at a time and write down how each is protected: session or token check, signed webhook (verify the signature over the raw body with a constant-time compare, and reject old timestamps), Turnstile for public forms (verify server-side with the secret), or Cloudflare Access for admin paths. A route that is public on purpose says so in a comment. The checker cannot tell whether a handler checks auth, so this is your job: read each handler.
5. **Check ownership, not just login.** A signed-in user must only reach their own records: filter by the user id from the verified session, never from the request body.
6. **Compare secrets safely.** Compare tokens and signatures with `crypto.subtle.timingSafeEqual` on equal-length digests, not `===`. Generate tokens with `crypto.getRandomValues` or `crypto.randomUUID`, never `Math.random`.
7. **CORS.** Decide who calls the API from a browser. Same-origin only: send no CORS headers. Public read-only API: `Access-Control-Allow-Origin: *` is fine with no credentials. Anything with cookies or an Authorization header: compare the request `Origin` with an explicit list, echo it only on a match, add `Vary: Origin`, and never combine `*` or an echoed origin with `Access-Control-Allow-Credentials: true` without that list. Answer `OPTIONS` yourself with 204.
8. **Cookies.** Session cookies are `Secure; HttpOnly; SameSite=Lax` (or `Strict`), with a bounded `Max-Age`. State-changing routes that rely on cookies need a CSRF defence: `SameSite`, an Origin check, or a token.
## Phase 5: Abuse limits
1. **Rate limiting binding.** Put a limiter in front of every public route that writes, sends email, calls a paid API or checks a password. In `wrangler.jsonc`:
Preview ends at line 77. The file continues for 102 more lines in the kit.
workers-launch-check/scripts/verify-launch.mjsLines 1 to 80 of 906#!/usr/bin/env node
// verify-launch.mjs: a launch check for a Cloudflare Workers project.
// No dependencies. Needs Node 18 or newer.
//
// node verify-launch.mjs --dir ./my-worker
// node verify-launch.mjs --url https://my-worker.example.com/
// node verify-launch.mjs --dir . --url https://my-worker.example.com/ --strict
//
// Options:
// --dir <path> Static check of a project folder: wrangler config, git hygiene, source code (src/).
// --url <url> Live check of a deployed Worker: HTTPS, security headers, 404 behaviour, CORS preflight.
// Four requests in total: the page, its plain-HTTP twin, an unknown path, one OPTIONS.
// --strict Treat warnings as failures.
// --json Print the results as JSON instead of text.
//
// Exit code 0 when nothing failed, 1 when at least one check failed, 2 when the arguments are wrong.
//
// This is a set of static heuristics and a few polite live requests. It is not a penetration test and it does
// not prove a project is secure. A finding can be suppressed on one line with a comment containing
// "launch-check-ignore: <reason>" on the same line or the line above.
//
// wrangler.toml support: a small parser for tables, arrays of tables, strings, numbers, booleans, arrays and
// inline tables. It does not read multi-line strings or dates. Prefer wrangler.jsonc if a key is not found.
import { readFile, readdir, stat } from "node:fs/promises";
import { existsSync } from "node:fs";
import { execFileSync } from "node:child_process";
import { join, resolve, relative, sep } from "node:path";
import { pathToFileURL } from "node:url";
export const AREAS = [
["inventory", "Inventory"],
["config", "Wrangler config"],
["secrets", "Secrets"],
["input", "Input, database and code"],
["cors", "CORS"],
["abuse", "Abuse limits"],
["errors", "Errors and logging"],
["data", "Data safety"],
["live", "Live checks"],
];
const UA = "verify-launch/1.0 (launch check)";
const R = (level, area, message, fix, extra = {}) => ({ level, area, message, ...(fix ? { fix } : {}), ...extra });
// ---------- wrangler config parsing ----------
/** Remove // and /* comments and trailing commas outside strings. */
export function stripJsonc(text) {
let out = "";
let inStr = false;
for (let i = 0; i < text.length; i++) {
const c = text[i];
const d = text[i + 1];
if (inStr) {
out += c;
if (c === "\\") out += text[++i] ?? "";
else if (c === '"') inStr = false;
continue;
}
if (c === '"') { inStr = true; out += c; continue; }
if (c === "/" && d === "/") { while (i < text.length && text[i] !== "\n") i++; out += "\n"; continue; }
if (c === "/" && d === "*") { const e = text.indexOf("*/", i + 2); const stop = e < 0 ? text.length : e + 2; out += text.slice(i, stop).replace(/[^\n]/g, " "); i = stop - 1; continue; }
out += c;
}
// trailing commas: a comma followed only by whitespace and a closing bracket, outside strings
let res = "";
inStr = false;
for (let i = 0; i < out.length; i++) {
const c = out[i];
if (inStr) { res += c; if (c === "\\") res += out[++i] ?? ""; else if (c === '"') inStr = false; continue; }
if (c === '"') { inStr = true; res += c; continue; }
if (c === ",") { let j = i + 1; while (j < out.length && /\s/.test(out[j])) j++; if (out[j] === "}" || out[j] === "]") continue; }
res += c;
}
return res;
}
export function parseJsonc(text) {
return JSON.parse(stripJsonc(text));
}
Preview ends at line 80. The file continues for 826 more lines in the kit.
Ten phases, in order.
The agent follows SKILL.md from the first phase to the last. It is not done until verify-launch.mjs passes.
- Inventory. Reads the project and lists the config, bindings, vars and secrets, routes and every route that writes or spends.
- Run the checker. Runs the checker on the folder, and on the live address if there is one, and keeps the output as the before result.
- Secrets and config. Moves secrets out of config, keeps local secret files out of git, types the env and checks the compatibility date.
- Input handling, auth on every write route, CORS. Validates input on every route, uses bound SQL, and checks that every write route is protected. CORS only for the origins you choose.
- Abuse limits. Puts a rate limiter in front of public writes, caps request body sizes and adds timeouts to outbound calls.
- Errors and logging. One top-level catch with generic errors, 404 for unknown routes, structured logs and observability switched on.
- Headers and caching. Security headers for HTML and JSON from one place, and a deliberate cache policy for every response.
- Data safety. D1 migrations in git, the Time Travel backup answer written down, and every public R2 bucket confirmed as meant to be public.
- Rollback plan. Writes down the rollback commands, what a rollback does not undo, and the deploy order for schema changes.
- Verify and report. Re-runs the checker until it passes and fills in the launch report with the before and after results.
Unzip it where your agent looks for skills.
Claude Code, this project
mkdir -p .claude/skills && unzip workers-launch-kit-v1.0.0.zip -d .claude/skills/Cursor
mkdir -p .cursor/skills && unzip workers-launch-kit-v1.0.0.zip -d .cursor/skills/Antigravity
mkdir -p .agent/skills && unzip workers-launch-kit-v1.0.0.zip -d .agent/skills/Then ask in plain words, for example: "Use the workers-launch-check skill on this project."
Workers Launch Check Kit
$15 USD
- Price
- $15 USD, paid once through Stripe. No subscription.
- Licence
- One purchase covers one person or one company. Use the kit on as many projects as you like, your own and your clients'. What you build with it is yours. You may not resell, share or publish the kit itself, or hand a client the kit's folder to reuse.
- Delivery
- Pay once through Stripe Checkout. You land on a download page with your zip, and the same download link is emailed to you. It works for 30 days and up to 10 downloads.
- Version
- Version 1.0.0, updated 20 November 2026.
- Updates
- Each kit has a version number. Updates within version 1 are free: email Hello@redcenterstudio.com with your order id and you get a new download link.
- Refunds
- If a kit has a major problem we cannot fix, you can ask for a refund. Your rights under Australian Consumer Law apply in full. Email Hello@redcenterstudio.com. See the terms for the kits and your rights under Australian Consumer Law.
Workers Launch Check Kit questions
Is this a security audit or a penetration test?
No. The checker reads code with patterns and makes four polite requests to a live address. It catches common launch mistakes, and the skill has the agent read each write route for auth. It cannot see account settings such as WAF rules, dependency vulnerabilities, business logic or load behaviour.
Will it rewrite my code?
No. The first two phases are read-only and the agent reports what it found before editing. After that it changes the smallest thing that fixes each finding and keeps your project's style and framework, whether that is plain Workers, Hono or itty-router.
What do I get at the end?
A filled-in launch report with the before and after checker results, what changed and where, the rollback plan, the D1 backup answer and anything you still need to decide or do yourself.
What if the checker flags something that is fine?
Add a comment containing launch-check-ignore and the reason on that line or the line above. The checker reports how many findings it skipped, and the skill tells the agent never to use it to hide a real finding.
Other Agent Skill kits.
GEO Skill Kit
Free
Audits a website for AI search readiness, fixes robots.txt rules, structured data, canonical and Open Graph tags and llms.txt, then proves the result with a zero-dependency check script.
Remote MCP Server Kit
$39 USD
Builds a production remote MCP server on Cloudflare Workers with OAuth sign-in, tool design rules, rate limits and tests, then checks it against the MCP spec and the connector directory requirements with a bundled script.
Stripe on Workers Kit
$19 USD
Adds Stripe Checkout, a signature-checked webhook and idempotent order fulfilment to a Cloudflare Worker with no Stripe SDK, then tests the webhook path with a bundled script.