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.
npx agentmods add rules/squirrelogic/cursor-rules/supabase-writing-edge-functionsgit clone --depth 1 https://github.com/squirrelogic/cursor-rulesWrote 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.
[](https://agentmods.dev/rules/squirrelogic/cursor-rules/supabase-writing-edge-functions)<a href="https://agentmods.dev/rules/squirrelogic/cursor-rules/supabase-writing-edge-functions"><img src="https://agentmods.dev/badge/rules/squirrelogic/cursor-rules/supabase-writing-edge-functions.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00000 | $0.01039 |
| Opus 5 | $0.00000 | $0.00519 |
| Sonnet 5 | $0.00000 | $0.00208 |
| Haiku 4.5 | $0.00000 | $0.00104 |
Grade A, and why
supabase-writing-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 3d 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.
This is a copy
94% identical to coding-rules-for-supabase-edge-functions — 6 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 115 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
- 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)
- If you are reusing utility methods between Edge Functions, add them to
supabase/functions/_sharedand import using a relative path. Do NOT have cross dependencies between Edge Functions. - Do NOT use bare specifiers when importing dependecnies. If you need to use an external dependency, make sure it's prefixed with either
npm:orjsr:. For example,@supabase/supabase-jsshould be written asnpm:@supabase/supabase-js. - For external imports, always define a version. For example,
npm:@expressshould be written asnpm:[email protected]. - For external dependencies, importing via
npm:andjsr:is preferred. Minimize the use of imports from @deno.land/x,esm.shand @unpkg.com. If you have a package from one of those CDNs, you can replace the CDN hostname withnpm:specifier. - 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. - Do NOT use
import { serve } from "https://deno.land/[email protected]/http/server.ts". Instead use the built-inDeno.serve. - 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
- 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 - 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-nameso they are routed correctly. - File write operations are ONLY permitted on
/tmpdirectory. You can use either Deno or Node File APIs. - 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.
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.
- 3d ago First seen · 115 lines · 0 tokens per session scan A 2b30869941bb
supabase-writing-edge-functions is a cursor rule published in the GitHub repository squirrelogic/cursor-rules (20 stars, last pushed 1y ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,039 tokens. A static security scan graded it A with 0 findings. It is 94% identical to coding-rules-for-supabase-edge-functions, differing in 6 lines, and is treated as a copy.
Other cursor rules, from other repositories
vue-typescript-patterns
Cursor rule "vue-typescript-patterns" from soaring-xiongkulu/easyaiot, covering vue3 + typescript 开发规范, vue 组件规范, vue sfc 组件规范, typescript 规范 and 状态管理.
project-overview
这是一个基于 uniapp + Vue3 + TypeScript + Vite5 + UnoCSS 的跨平台开发框架。.
frontend-patterns
React/TypeScript patterns for src/ code.
bundling
The project uses a custom type bundling system to provide full TypeScript IntelliSense support in the Monaco editor for @bubblelab/bubble-core and its dependencies. This is necessary because Monaco cannot directly resolve workspace packages or external dependencies.
typescript-coding-rule
It allows a subset of JSDoc tags. Most tags must occupy their own line, with the tag at the beginning of the line.
typescript-mcp
MCP TypeScript SDK implements the full Model Context Protocol specification, allowing you to build MCP servers and clients using TypeScript.