techmefr/mentis/serverless-edge-worker-pitfalls

Claude Code and agent skill by techmefr/mentis

Trust tier 2
  • community
  • ext:[{"type":"config","description":"Configuration overrides"}]
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Use when writing or reviewing code that runs as a serverless or edge function (Cloudflare Workers first, the same traps on Lambda-style platforms): runtime configuration and bindings, state shared between requests, promises that outlive the response, memory and CPU limits, queues and at-least-once delivery, service-to-service calls, database connections and durable state.

Install

npx vskill@latest install techmefr/mentis/serverless-edge-worker-pitfalls

Semi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard

SKILL.md

The same SKILL.md was published earlier as techmefr/mentis/serverless-edge-worker-pitfalls.

serverless-edge-worker-pitfalls

Step 6 of the pipeline (WORKFLOW.md), for functions that the platform starts, reuses and kills for you. The premise: the handler looks like an ordinary request function, but the process around it is shared, short-lived and limited: a module variable leaks one user's data to the next, a promise nobody awaited dies with the response, a body read whole exhausts memory, a queue delivers the same message twice. Long-lived servers are in nestjs-reliability and queue-worker-runtime-pitfalls; infrastructure as code is in terraform-conventions.

When

  • A function is written for an edge or serverless platform, or its configuration file changes.
  • Work is done after the response is sent, or moved to a queue or a workflow.
  • A function talks to a database, another function, or a durable stateful object.
  • A reviewer asks why a function behaves differently in production than in a local run.

Steps

Read only the section the task meets. They are independent.

§CoversRead it whenFile
1Compatibility date, bindings and generated types, secrets, logs, tests in the real runtimea function or its configuration file is created or changed`01-configuration-and-bindings.md`
2Shared state, promise lifetime, memory and CPU limits, streaming, fail-open error handling, secret comparisona handler is written or reviewed`02-request-lifetime-and-state.md`
3Queues and workflows, service calls, database connections, durable objects, serialization, other platformswork leaves the request, or the function calls something else`03-async-work-and-integration.md`

Output / checkpoint

Each section ends with its own checks. For a change touching this block: no module-level mutable request state, every promise is awaited, returned or attached to the platform's background hook, large bodies stream, each queue consumer is idempotent, and the function's types come from the platform's generator, not from hand.

Guardrails

  • Pass request state as arguments (§2.1). Never keep it in a module variable.
  • Await, return or hand off every promise (§2.2). Never leave one floating.
  • Stream or bound any body that can be large (§2.3). Never read it whole.
  • Make every consumer safe to run twice (§3.1). Never rely on exactly-once delivery.
  • Put secrets in the platform's secret store, never in configuration or source (§1.4).
  • Limits and prices are the platform's; re-read them for the plan in use before relying on a number (🟡, nothing here was deployed).

Origin

Rewritten from the cloudflare/skills repository (Apache-2.0, commit 86505e4), read 2026-10-20. The non-Cloudflare points are our own guidance and are labelled. See `references/origin.md`.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Extension points

  • configConfiguration overrides

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/techmefr/mentis/serverless-edge-worker-pitfalls/badge)](https://verified-skill.com/skills/techmefr/mentis/serverless-edge-worker-pitfalls)

Something wrong with this skill or its page? Tell us.