Supabase Postgres Best Practices skill
Schema, RLS, indexes and query tuning rules for any Postgres database.
Official vendorby SupabaseChecked November 18, 2026
Install Supabase Postgres Best Practices free
Leave your email and the install steps open right here: one prompt to paste into your AI tool. Works for all 151 skills.
Supabase Postgres Best Practices is Supabase's rule book as a Claude skill for agents that touch a Postgres database: 31 short rule files on query speed, connections, row level security, schema design, locking and monitoring. The rules are plain SQL advice, so they work for Postgres hosted anywhere. How to use it: load it before Claude changes a table, a policy or an index, or when a query is slow. On November 8, 2026, with Claude Opus 5.5, it found three causes of a slow order history in our demo schema in 69 seconds and switched to keyset paging. Install steps above are free with one email; our Vibe coding course (early access) covers apps with a database.
Who is Supabase Postgres Best Practices for?
- Backend developers
- Vibe coders using Supabase
- Data engineers
What's inside Supabase Postgres Best Practices
A 64-line SKILL.md works as the index to 31 one-topic rule files in 8 categories, with no scripts. The rules are plain SQL advice for Postgres hosted anywhere, so it works in any tool that reads skills and needs no Supabase account.
When it switches on
The author wants it loaded before any change to a Postgres database, even one column: tables, types, migrations, row level security policies, indexes, triggers, queues and vector search. It also applies to slow queries, timeouts, locks and rows seen by the wrong user.
What the instructions cover
- 8 categories ranked by impact, with query speed, connections and security first
- Each rule pairs wrong and right SQL with the author's estimate of the gain
- Fast row security: wrap auth.uid() in a select so it runs once per query, not once per row
- Pooling and connection limits, short transactions, and SKIP LOCKED for worker queues
- Finding costly queries with Postgres's EXPLAIN ANALYZE and pg_stat_statements tools
| File | What it is |
|---|---|
SKILL.md | 64 lines: when to apply it, the category table and the rule file layout |
references/ | 31 rule files of 40 to 80 lines, named by prefix such as query-, conn- and security- |
references/_contributing.md | 170 lines for rule authors, with _template.md and _sections.md |
CHANGELOG.md | 73 lines of version history |
Watch out: Functions marked SECURITY DEFINER bypass row security, so the rules say to keep them in a private schema and check the calling user inside.
How to use Supabase Postgres Best Practices: which prompts work?
Design the tables and row level security policies for a [multi-tenant invoicing] app where each customer sees only their own dataThis query takes [8 seconds]: [paste the query]. Run EXPLAIN ANALYZE, find out why and fix itReview this migration before I run it in production: [paste the migration]How do you install Supabase Postgres Best Practices?
Skills follow the open Agent Skills standard, so this one is not tied to one company. Pick the AI tool you use. Not sure? The first tab covers most of them in one step. New to this? Our guide on how to install Claude skills walks through it, and Anthropic's plugin guide covers the Claude app.
Install this skill for me so it works in every project: run `npx skills add https://github.com/supabase/agent-skills/tree/main/skills/supabase-postgres-best-practices -g -y` in my terminal. If Node.js is missing, tell me how to install it first. When it's done, confirm the skill is installed and tell me how to start using it.Or do it yourself:
One command installs the skill: it finds the AI tools on your computer and asks which ones should get it.
npx skills add https://github.com/supabase/agent-skills/tree/main/skills/supabase-postgres-best-practices -gYou need Node.js installed (free, from nodejs.org). The -g flag makes the skill available in every project.
Good to know: The official Supabase plugin bundles this skill, the general supabase skill and the Supabase MCP server. Skills only: /plugin marketplace add supabase/agent-skills then /plugin install postgres-best-practices@supabase-agent-skills.
Unlock the install steps
Free. Leave your email once to open the install steps for all 151 skills, and get the best new skills each month.
How did we check Supabase Postgres Best Practices?
On November 8, 2026 we read all 36 files in the skill's folder, starting with its 64-line SKILL.md. The section on what's inside comes from those files. Its license is MIT. Its files were last changed in July 2026.
On November 8, 2026 we ran it with Claude Opus 5.5 in Claude Code on a shop schema we wrote, where the customer's order history got slow on page 101. In 69 seconds it named three causes (no index for the page query, no index on the order items' foreign key, and OFFSET 2000), switched to keyset paging and rewrote the row security policy to call auth.uid() once. It also caught two problems we had not asked about: the limit of 20 counted order lines, not orders, and the order items table had row level security switched off. It did not mention that the customers table had it off too.
Building the page this skill reviews? The Builders course teaches the skills every site builder needs, from planning to publishing; it is in early access and open for pre-order.