Skip to content
Skills Library
Programming · Building & coding

cloudflare-worker

/cloudflare-worker

Build and maintain Cloudflare Workers with D1 in the shape that survived production in a real temp-mail service: API structure, D1 migrations and their classic trap, secret management, scheduled cleanup, and email parsing that handles real-world mail. Use when the user builds or debugs a Worker, a D1 database, or an Email Worker, or says "cloudflare worker", "bikin worker", "d1 database", "wrangler". Do NOT use for Pages-only static sites or non-Cloudflare backends.

Repository
stash ↗
Licence
MIT
Last repository change
08.11.2026

Assessment and security

90/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content25 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
4
Scripts
2
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 08.11.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What to check before installing
  • 2 scripts in this package. Review them before installing, as Claude may execute them.

Scripts: examples/parse-email-worker/index.js, examples/parse-email-worker/test.mjs

What it does and when to use it

Build and maintain Cloudflare Workers with D1 in the shape that survived production in a real temp-mail service: API structure, D1 migrations and their classic trap, secret management, scheduled cleanup, and email parsing that handles real-world mail. Use when the user builds or debugs a Worker, a D1 database, or an Email Worker, or says "cloudflare worker", "bikin worker", "d1 database", "wrangler". Do NOT use for Pages-only static sites or non-Cloudflare backends.

Triggers from the description

cloudflare workerbikin workerd1 databasewrangler
Original author description

Build and maintain Cloudflare Workers with D1 in the shape that survived production in a real temp-mail service: API structure, D1 migrations and their classic trap, secret management, scheduled cleanup, and email parsing that handles real-world mail. Use when the user builds or debugs a Worker, a D1 database, or an Email Worker, or says "cloudflare worker", "bikin worker", "d1 database", "wrangler". Do NOT use for Pages-only static sites or non-Cloudflare backends.

How it works

  1. Project shape
  2. D1 discipline
  3. Secrets and auth
  4. Email Workers (if mail is involved)
  5. Verification (before calling it done)
Original SKILL.md headings · 71 lines, 546 words
SKILL.md preview
---
name: cloudflare-worker
description: Build and maintain Cloudflare Workers with D1 in the shape that survived production in a real temp-mail service: API structure, D1 migrations and their classic trap, secret management, scheduled cleanup, and email parsing that handles real-world mail. Use when the user builds or debugs a Worker, a D1 database, or an Email Worker, or says "cloudflare worker", "bikin worker", "d1 database", "wrangler". Do NOT use for Pages-only static sites or non-Cloudflare backends.
license: MIT
---

# Cloudflare Worker

This skill is the distilled shape of grmail, a temp-mail service that
runs in production on Workers + D1, including the failures that
taught each rule: a database that answered "no such table" because
its migration had never actually run, and HTML mail rendering as raw
base64 soup because the parser never decoded it. The patterns are
small because the platform rewards small.

## Project shape

- One Worker, route-based: a tiny router mapping method + path to
  handlers, no framework. Split handlers by resource in separate
  modules from the start; a single 2,000-line index file is the
  first refactor you will be forced into.
- `wrangler.toml` declares the D1 binding, routes, and cron triggers.
  Bindings are the only way the code touches the platform; no global
  state survives a request, so anything shared goes in D1 or KV.
- Public endpoints and admin endpoints are separate route groups
  with separate auth checks, enforced in the router, not remembered
  per handler.

## D1 discipline

- **Migrations are files, applied explicitly, verified after.** The
  classic trap: the code deploys fine, the first query fails with
  `no such table`, because creating a migration file is not running
  it. After every migration: apply it to the real database, then run
  one probe query against the new schema before deploying code that
  needs it.
- Schema changes are new migrations, never edits to applied ones.
- Every list query is bounded (LIMIT) and every inbox-style table has
  a cleanup path: a cron trigger deleting expired rows, because a
  temp-data service without expiry is a storage bill with a roadmap.
- Store timestamps as epoch integers; format at the edge.

## Secrets and auth

- Secrets are Worker secrets set through the deploy tooling, never
  variables in the repo and never values in chat. The agent sets up
  the plumbing; the owner types the secret.
- Admin auth is a header or a proper session, never a password in a
  query string: URLs get logged, shared, and screenshotted.
- API keys, when issued, are bound to the resource they were issued
  for, and revoking a key retires what it created or the revocation
  is theater. (These last two are written down because an early
  version of the reference service got both wrong; the review found
  it, and the lesson is cheaper in a skill than in a service.)

## Email Workers (if mail is involved)

- Parse defensively: real mail arrives as nested MIME with base64 and
  quoted-printable parts. Decode transfer encodings on intake, and
  decode again defensively on read, so mail stored before a parser
  fix still renders. The base64 bug above lived exactly at this seam.
- Extract the OTP and the confirmation link as first-class fields at
  intake time; the UI should never have to re-parse a body to find a
  code.
- Keep the raw message. Storage is cheap; an unparseable email you
  discarded is a support ticket you cannot answer.

## Verification (before calling it done)

- The deployed Worker answers its health route.
- Each new endpoint is exercised once against the real D1, not a
  local imitation, including the error path (missing field, wrong
  key).
- The migration probe query passes and the cron trigger is listed
  in the deployed configuration.
Files in this package (4)
  • SKILL.md 4 KB
  • examples/parse-email-worker/README.md 1 KB
  • examples/parse-email-worker/index.js 2 KB
  • examples/parse-email-worker/test.mjs 2 KB

Versions

The database has no other skills named cloudflare-worker.

Database snapshot: 13.11.2026 · package version 8f4ac9a88ba1 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100d1-database
    Cloudflare D1 is a serverless SQLite database for Cloudflare Workers. Use when someone asks for "Cloudflare D1", "SQLite at the edge", "database for Workers", "serverless SQL" or "D1 migrations". Covers wrangler setup, SQL migrations, queries from a Worker, Drizzle ORM, read replication and limits.
  • 100cloudflare-worker-dev
    Cloudflare Workers, KV, Durable Objects, and edge computing development. Use for serverless APIs, caching, rate limiting, real-time features. Activate on "Workers", "KV", "Durable Objects", "wrangler", "edge function", "Cloudflare". NOT for Cloudflare Pages configuration (use…
  • 95cloudflare-worker-dev
    Cloudflare Workers, KV, Durable Objects, and edge computing development. Use for serverless APIs, caching, rate limiting, real-time features. Activate on "Workers", "KV", "Durable Objects", "wrangler", "edge function", "Cloudflare". NOT for Cloudflare Pages configuration (use…
  • 100cloudflare-workers
    Build and deploy edge functions with Cloudflare Workers and Wrangler. Use for APIs, cron jobs, and edge middleware.
  • 100cloudflare-workers
    Build and deploy edge functions with Cloudflare Workers and Wrangler. Use for APIs, cron jobs, and edge middleware.
  • 100cloudflare-workers
    Build and deploy edge functions with Cloudflare Workers and Wrangler. Use for APIs, cron jobs, and edge middleware.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.