coding-rules-for-supabase-edge-functions

coding-rules-for-supabase-edge-functions is a cursor rule for coding agents from fumito-ito/mdcvalult. It costs 0 tokens per session (1,066 once invoked), scanned A, original, MIT.

A set of rules for writing Supabase Edge Functions, which are server-side TypeScript or JavaScript functions run on Supabase’s edge infrastructure. It covers Deno APIs, shared utilities, dependency imports, and versioned packages.

In plain words
What is it for?
Use it when creating or reviewing Supabase Edge Functions that use TypeScript, JavaScript, Deno, shared code, or external packages.
Why use it?
It helps avoid unsupported imports, conflicting function dependencies, and unclear package versions in Edge Functions.

Cursor rule

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/fumito-ito/mdcvalult/coding-rules-for-supabase-edge-functions
Clone the repo
git clone --depth 1 https://github.com/fumito-ito/mdcvalult

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for coding-rules-for-supabase-edge-functions

README.md
[![agentmods](https://agentmods.dev/badge/rules/fumito-ito/mdcvalult/coding-rules-for-supabase-edge-functions.svg)](https://agentmods.dev/rules/fumito-ito/mdcvalult/coding-rules-for-supabase-edge-functions)
Your own site
<a href="https://agentmods.dev/rules/fumito-ito/mdcvalult/coding-rules-for-supabase-edge-functions"><img src="https://agentmods.dev/badge/rules/fumito-ito/mdcvalult/coding-rules-for-supabase-edge-functions.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 1,066 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.01066
Opus 5 $0.00000 $0.00533
Sonnet 5 $0.00000 $0.00213
Haiku 4.5 $0.00000 $0.00107

Measured 5d ago against content hash 602ec0b4dc61, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

coding-rules-for-supabase-edge-functions scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

2 near-identical copies found in the catalogue:

mdc/coding-rules-for-supabase-edge-functions.mdc · 117 lines

How it starts

The opening of the file, as written. The whole thing — 117 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Writing Supabase Edge Functions

You're an expert in writing TypeScript and Deno JavaScript runtime. Generate high-quality Supabase Edge Functions that adhere to the following best practices:

Guidelines

  1. Try to use Web APIs and Deno’s core APIs instead of external dependencies (eg: use fetch instead of Axios, use WebSockets API instead of node-ws)
  2. If you are reusing utility methods between Edge Functions, add them to supabase/functions/_shared and import using a relative path. Do NOT have cross dependencies between Edge Functions.
  3. Do NOT use bare specifiers when importing dependecnies. If you need to use an external dependency, make sure it's prefixed with either npm: or jsr:. For example, @supabase/supabase-js should be written as npm:@supabase/supabase-js.
  4. For external imports, always define a version. For example, npm:@express should be written as npm:[email protected].
  5. For external dependencies, importing via npm: and jsr: is preferred. Minimize the use of imports from @deno.land/x , esm.sh and @unpkg.com . If you have a package from one of those CDNs, you can replace the CDN hostname with npm: specifier.
  6. You can also use Node built-in APIs. You will need to import them using node: specifier. For example, to import Node process: `import process from "node:process". Use Node APIs when you find gaps in Deno APIs.
  7. Do NOT use import { serve } from "https://deno.land/[email protected]/http/server.ts". Instead use the built-in Deno.serve.
  8. Following environment variables (ie. secrets) are pre-populated in both local and hosted Supabase environments. Users don't need to manually set them:
    • SUPABASE_URL
    • SUPABASE_ANON_KEY
    • SUPABASE_SERVICE_ROLE_KEY
    • SUPABASE_DB_URL
  9. To set other environment variables (ie. secrets) users can put them in a env file and run the supabase secrets set --env-file path/to/env-file
  10. A single Edge Function can handle multiple routes. It is recommended to use a library like Express or Hono to handle the routes as it's easier for developer to understand and maintain. Each route must be prefixed with /function-name so they are routed correctly.
  11. File write operations are ONLY permitted on /tmp directory. You can use either Deno or Node File APIs.
  12. Use EdgeRuntime.waitUntil(promise) static method to run long-running tasks in the background without blocking response to a request. Do NOT assume it is available in the request / execution context.

Read the full file on GitHub · 117 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 117 lines · 0 tokens per session scan A 602ec0b4dc61

Subscribe to this mod's changes

coding-rules-for-supabase-edge-functions is a cursor rule published in the GitHub repository fumito-ito/mdcvalult (33 stars, last pushed 1y ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,066 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.