Skip to content

01 — Naming Conventions

A consistent name is the cheapest documentation we have. When a Worker is paging someone at 2 a.m., the name alone should tell them what it does, who it belongs to, and whether it’s production.

{scope}-{category}-{project}[-{service}]-{env}

Worker names in Cloudflare are lowercase, 1–63 characters, and may only contain a–z, 0–9, and -. This pattern complies with that constraint and still leaves headroom for meaningful names.

SegmentRequiredRulesPurpose
scopeYes2–6 lowercase letters. adv for Adventive-owned. Client short-codes for client builds (e.g. acme, nova, rho). Subsidiary brands get their own code.Answers “who owns this?” at a glance.
categoryYesOne of int, site, svc, cli.Answers “what kind of thing is this?”
projectYes3–24 chars, kebab-case, lowercase letters, digits, and hyphens only. No leading/trailing hyphen.The product, site, or client engagement this Worker is part of.
serviceOptionalSame rules as project, typically 3–10 chars. Use only when a project has more than one Worker.Distinguishes Workers within the same project (e.g. api, cron, webhook, edge, img).
envYesExactly one of dev, stg, prd.The deployment environment. Always last so the eye finds it.
CodeMeaningTypical examples
intInternal tool — built for Adventive staff or internal workflows.ops dashboards, billing helpers, internal webhooks
siteFull website — a web property or its edge logic.marketing site, docs site, landing page, SSR shell
svcMicroservice / API — a shared or standalone service consumed by other systems.turnstile proxy, image resizer, form relay, auth helper
cliClient-specific build — scoped to a single client engagement, not a reusable platform.ACME campaign page, client X’s form handler

We use exactly three environments. No more (inventing qa, uat, pilot creates drift); no fewer (skipping staging is how outages happen).

CodeNamePurpose
devDevelopmentPer-engineer or shared dev. Allowed to break. Never routed to customer traffic.
stgStagingMirror of production config and bindings, but using non-production data stores. Every change lands here first.
prdProductionCustomer-facing. Change only via the promote-from-staging flow in 04 — QA & Deployment.
Worker nameWhat it is
adv-int-ops-dashboard-prdInternal ops dashboard, production
adv-int-billing-sync-cron-stgInternal billing-sync scheduled Worker, staging
adv-site-marketing-edge-prdEdge Worker fronting the Adventive marketing site, production
adv-site-docs-stgAdventive docs site, staging (single-Worker project — no service segment)
adv-svc-turnstile-proxy-prdTurnstile verification proxy microservice, production
adv-svc-image-resize-devImage-resizing service, developer sandbox
adv-svc-form-relay-webhook-prdWebhook-handler variant of the form-relay service, production
acme-cli-landing-edge-prdClient ACME’s landing-page edge Worker, production
nova-cli-intake-api-stgClient Nova’s lead-intake API, staging

Workers don’t live alone. KV namespaces, D1 databases, R2 buckets, Queues, Durable Object namespaces, secrets, and DNS routes all get named by the same segment logic, with a type prefix. This makes searching the dashboard trivial — one search for acme-cli-landing surfaces the Worker, its KV, its R2, and its routes together.

ResourcePatternExample
Worker{scope}-{category}-{project}[-{service}]-{env}adv-svc-form-relay-prd
KV namespacekv-{scope}-{category}-{project}[-{purpose}]-{env}kv-adv-svc-form-relay-sessions-prd
D1 databased1-{scope}-{category}-{project}-{env}d1-adv-int-billing-sync-prd
R2 bucketr2-{scope}-{category}-{project}[-{purpose}]-{env}r2-adv-svc-image-resize-cache-prd
Queueq-{scope}-{category}-{project}-{purpose}-{env}q-adv-svc-form-relay-inbound-prd
Durable Object namespacedo-{scope}-{category}-{project}-{purpose}-{env}do-adv-site-marketing-ratelimit-prd
SecretSCREAMING_SNAKE_CASE inside the Worker; no env suffix (each env has its own secret store).STRIPE_SECRET_KEY
DNS route (zones)Human-friendly hostname; map to Worker via route, not name.forms.adventive.com/*adv-svc-form-relay-prd
Wrangler env name (inside wrangler.toml)Match the env suffix: dev, staging, production.

Note on Wrangler env names vs. Worker names. Cloudflare’s own conventions use the full words staging and production inside wrangler.toml’s [env.*] tables. We follow that inside the config file, but the deployed Worker name still ends in stg / prd via the name override in each env block. Section 02 shows exactly how.

Cloudflare lets you tag Workers. Every Adventive Worker carries these tags, set via Wrangler or the dashboard, because they power cost reports and ownership lookups that the name alone can’t:

  • owner:<team-or-person> — e.g. owner:platform, owner:client-services
  • criticality:<tier> — one of tier-1, tier-2, tier-3 (see 05 — Resiliency & DR)
  • cost-center:<code> — for chargeback on client work
  • repo:<github-slug> — so anyone in the dashboard can find the source in one click
  1. When in doubt, include the service segment. A name with one too many segments is easy to read. A name where two Workers collide is painful.
  2. Don’t encode version numbers in names. Use git tags, Worker versions, and Wrangler’s gradual deploys. A Worker named adv-svc-form-relay-v2-prd is a sign we botched a migration.
  3. Rename by creating, not editing. Cloudflare doesn’t support Worker rename. If a name is wrong, deploy the correctly named Worker, move the route, verify, then delete the old one.
  4. Client scopes must be pre-registered. Before deploying the first {clientcode}-cli-* Worker, add the client code to the table in this document via PR. This keeps the short-code registry auditable.
CodeOwnerNotes
advAdventiveDefault for everything Adventive-owned.
(add rows via PR as clients onboard)

See also: 02 — Wrangler Configuration for how these names are wired into config.