# Supabase Sample Cursor Rules

> Pre-configured Cursor AI rules and prompt templates for Supabase development

A collection of ready-to-use Cursor .mdc rule files and prompt templates provided by the Supabase team. They configure Cursor AI to follow official best practices when writing Supabase Edge Functions, SQL migrations, and RLS policies. It also demonstrates how to structure glob patterns and descriptions in Cursor rules.

## How it works

Walkthrough shown in video: In Cursor, run command palette '\>new ru' → 'File: New Cursor Rule'. Rules live in .cursor/rules/ as .mdc files. Example pasted rule (edge-functions.mdc): description: 'Coding rules for Supabase Edge Functions'; globs: 'supabase/functions/\*\*/\*.ts'; body: '\# 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:' with Guidelines including: (1) prefer Web APIs and Deno core APIs over external deps (fetch over Axios, WebSockets API over node-ws); (2) reuse utility methods between Edge Functions via supabase/functions/\_shared with relative imports, no cross dependencies; (3) no bare specifiers — prefix external deps with npm: or jsr: (e.g. @supabase/supabase-js → npm:@supabase/supabase-js); (4) always pin versions for external imports (npm:express → npm:express@4.18.2); (5) prefer npm: and jsr: imports over deno.land/x, esm.sh, unpkg.com; replace CDN hostnames with npm: specifiers; (6) Node built-in APIs imported via node: specifier (import process from 'node:process'); use Node APIs where Deno has gaps. The Supabase repo's examples/prompts folder also contains: code-format-sql.md, database-create-migration.md, database-functions.md, database-rls-policies.md, edge-functions.md, nextjs-supabase-auth.md.

## What it is for

- Configure Cursor AI to follow Deno and TypeScript best practices for Supabase Edge Functions
- Scope AI editor rules to specific directory globs like supabase/functions/\*\*/\*.ts
- Standardize SQL formatting and migration creation across a team using Cursor
- Generate secure Row Level Security (RLS) policies using tailored prompt guidelines

## Key points

- Uses Cursor's native .cursor/rules directory structure with .mdc files
- Includes scoped glob patterns to trigger rules only on relevant project files
- Edge function rules enforce Deno core APIs and Web APIs over external dependencies
- Specifies pinned dependency syntax using npm: and jsr: specifiers
- Collection includes templates for SQL formatting, migrations, edge functions, and Next.js auth

## Pricing

Free

## Details

- Type: Tip
- Category: [Development](https://xiry.app/topics/development.md)
- Topic: [AI Prompts](https://xiry.app/topics/ai/ai-prompts.md)
- Open source: yes
- Platforms: macOS, Windows, Linux
- For: Developers building Supabase projects inside the Cursor editor
- Tags: cursor, supabase, ai, edge functions, deno, developer tools

## Why it was saved

- [@dshukertjr, 12 March 2025](https://x.com/dshukertjr/status/1899792992967213116): Drop-in AI coding rules for a Supabase codebase; also demonstrates how to author Cursor rules properly.

## Related

- [agency-agents](https://xiry.app/resources/agency-agents): Curated library of specialized AI agent personas and workflows for Claude Code (GitHub repo, Open source)
- [Senior Product Manager PRD Prompt](https://xiry.app/resources/prd-prompt-for-llms): System prompt to convert rough software ideas into structured, agent-ready PRDs (Prompt, Free)
- [15 ChatGPT Prompts by Topic (Atul Kumar)](https://xiry.app/resources/15-chatgpt-prompts-by-topic-atul-kumar): A cheat sheet of 15 business and marketing prompts for ChatGPT. (Prompt, Free)
- [5-Year Life Prediction Prompt Sequence](https://xiry.app/resources/5-year-life-prediction-prompt-sequence): Three-step transactional analysis prompt sequence for forecasting your future life trajectory (Prompt, Free)
- [9 ChatGPT Prompts for Accelerated Learning](https://xiry.app/resources/9-chatgpt-prompts-for-accelerated-learning): A collection of reusable ChatGPT prompts designed for studying and mastering topics (Prompt, Free)
- [Absolute Mode](https://xiry.app/resources/absolute-mode): A system prompt that removes conversational fluff and engagement-seeking behaviors from LLMs (Prompt, Free)

Updated 11 October 2026. Page: https://xiry.app/resources/supabase-sample-cursor-rules

Make your own library: Xiry takes your saved reels, tweets, Reddit bookmarks and Watch Later videos, makes them searchable and pulls the useful stuff out, like this library. It's invite-only for now; join the waitlist at https://xiry.app/#waitlist.
