Supabase Postgres Best Practices
It gives Claude Postgres rules you can rely on when writing SQL, designing schemas, running migrations, writing RLS policies or investigating slow queries.
What is Supabase Postgres Best Practices?
Supabase Postgres Best Practices is a skill for Claude Code that gives your agent rules for working with Postgres databases. Supabase maintains it, but the rules apply to Postgres on any platform. They are grouped into eight categories, from query performance, connection management and Row-Level Security to schema design, locking, data access patterns, monitoring and advanced features.
Every rule sits in its own file. It explains the problem briefly, shows a flawed and a corrected SQL example, and adds EXPLAIN output, metrics or Supabase notes where useful. Claude reads the matching file, for instance on missing or partial indexes, and shapes queries and schemas accordingly. The categories are ordered by impact so the most important issues come first.
Its description asks Claude to load it before any change to a Postgres database, such as new tables, migrations, RLS policies, triggers, functions, pg_cron, pgmq or pgvector. It also helps when you investigate slow queries, high CPU load, timeouts, exhausted connections, lock contention or data that shows up for the wrong tenant. It suits anyone building on Postgres or Supabase. You need an agent that can load skills.
Who it is for
For developers and database teams who work with Postgres or Supabase and use Claude to write SQL, schemas and migrations.
Use cases
- You create a new table and have Claude check column types, indexes and constraints before running the migration.
- A query has become slow and you want Claude to use the EXPLAIN plan to find missing or unsuitable indexes.
- You write RLS policies for a multi-tenant application and want to check whether anyone can see rows that belong to someone else.
What Supabase Postgres Best Practices does
Eight rule categories by priority
The rules range from critical topics like query performance, connections and RLS down to advanced features, which sit lower in the priority order.
Incorrect and correct side by side
Each rule file shows the problematic SQL pattern first and the corrected version second, with an explanation and, where useful, EXPLAIN output.
Row-Level Security and privileges
A dedicated category covers RLS policies, privilege management and authentication patterns. According to the changelog, the checklist also covers SECURITY DEFINER and BOLA.
Connections and timeouts
Rules on connection limits, connection pooling and idle timeouts show how you reclaim unused connections through configuration, including at the pgbouncer level.
Indexes for JSONB and full-text search
Examples show GIN indexes for JSONB columns and a tsvector column for full-text search as a replacement for LIKE with wildcards.
Say this to activate the skill
"Check this migration against the Supabase Postgres Best Practices.""Why is this query so slow? Look at the EXPLAIN plan.""Write RLS policies for the orders table.""Which index do I need for this JSONB column?" Install
npx skills add supabase/agent-skills --skill supabase-postgres-best-practices
The command installs the original version from the author's repository (Vercel skills CLI, needs Node.js), add -g for all projects. We do not host a copy: updates come straight from the author. Need help with setup? How to install skills →
Checked automatically
- Automated check on 2026-11-13 (revision c9be0e9): 36 files in the skill folder read by pattern search. It found no hidden characters, no instructions to override rules, no download-and-run and no access to credentials.
Independent checks on skills.sh, as of 13 Nov 2026
| Gen Agent Trust Hub | Pass |
|---|---|
| Socket | Pass |
| Snyk | Pass |
Good to know
- Some rules change server settings such as max_connections or timeouts via ALTER SYSTEM. Review these suggestions before you apply them in production.
- The speedup figures in the rule files are guidance from the authors, not measurements on your database.
- The skill header lists version 1.1.1, while the changelog already shows newer version numbers.
- The check is an automated pattern search, not a security guarantee, and reads the skill folder only. The command always installs the author's current version; later versions have not been reviewed by us.
Frequently asked questions about Supabase Postgres Best Practices
What is Supabase Postgres Best Practices?
Supabase Postgres Best Practices is a skill for Claude Code with rules for Postgres databases. It covers queries, connections, security with RLS, schema design, locking, data access, monitoring and advanced features, and shows incorrect and correct SQL for each rule.
How do I install Supabase Postgres Best Practices?
You install Supabase Postgres Best Practices with the command 'npx skills add supabase/agent-skills --skill supabase-postgres-best-practices'. Your agent can then load the skill when you work on a Postgres database.
Is Supabase Postgres Best Practices free?
Yes, Supabase Postgres Best Practices is released under the MIT license and is free to use. The skill itself costs nothing. Costs may come from your Claude access or your database provider.
Does Supabase Postgres Best Practices only work with Supabase?
No, according to its description Supabase Postgres Best Practices applies to Postgres on any platform. Some rules include extra notes that only apply to Supabase.
What data does Supabase Postgres Best Practices send?
Supabase Postgres Best Practices consists of Markdown files with rules and SQL examples. The files we read describe no data transfer of their own. Only your agent can run SQL, using the tools you allow it.
Who is Supabase Postgres Best Practices for?
Supabase Postgres Best Practices is for developers who use Claude to write SQL, schemas, migrations or RLS policies for Postgres, or to investigate slow queries and connection problems.
Share this skill
About this skill
Supabase Postgres Best Practices comes from supabase and is an open-source project maintained by its author and community.
Author: supabase / github.com. Source: github.com/supabase/agent-skills/tree/main/skills/supabase-postgres-best-practices. Licence: MIT.
Curated by Collective Brain, an AI and automation digital agency from Hamburg, together with WhiteFox Automations. More vetted skills in the skills catalog.
Working in Germany, Austria or Switzerland? We help teams roll out Claude, in English or German.
Want this skill tailored to your team?
Supabase Postgres Best Practices is a strong starting point. A skill gets really powerful once it knows your workflows, templates and tone of voice. We build custom skills for teams, from analysis to rollout, and connect them to our work in AI consulting.
Request a custom skill →