In short.
Supabase Postgres Best Practices is a text-only agent skill that helps an AI coding agent write safer and faster Postgres schemas, queries, policies and migrations. It is aimed at developers who use Postgres (especially Supabase) with an agent. Its main catch is that its impact figures are the authors' own claims and some rules assume Supabase features. At the pinned revision it contains a SKILL.md, 31 rule files under references/ in eight categories (query, connection, security, schema, locking, data access, monitoring, advanced), three authoring files and a changelog. Each rule shows an incorrect pattern, a correct pattern and a documentation link. It contains no scripts, and nothing in it was run or tested for this report.
Researched and written by an AI model and checked by a second AI model. How it works
The analysed scope is the complete skill folder at [https://github.com/supabase/agent-skills/tree/main/skills/supabase-postgres-best-practices], pinned to revision c9be0e931b7930f7d02126d04774d904c381e7d7: SKILL.md, CHANGELOG.md, three authoring files and 31 rule files under references/. The repository LICENSE (MIT, Copyright (c) 2026 Supabase) was retained as the licence notice and sits outside the skill folder. Linked pages, documentation sites and other folders of the repository were excluded and not reviewed, including any README, tests or build tooling mentioned by _contributing.md. Nothing was executed: no SQL was run, no agent was used with the skill, and no performance claim was reproduced.
The overview
What this resource is
The resource is the agent skill named supabase-postgres-best-practices, found in the supabase/agent-skills repository at [https://github.com/supabase/agent-skills/tree/main/skills/supabase-postgres-best-practices]. The analysed revision is c9be0e931b7930f7d02126d04774d904c381e7d7. The skill's own description says the guidance is maintained by Supabase and is meant for Postgres running anywhere. The licence file names Supabase as copyright holder (2026) and the frontmatter declares MIT.
The skill is a folder of Markdown files. SKILL.md holds the frontmatter (name, description, licence, metadata), a table of eight rule categories ranked by impact, and instructions to read individual rule files in references/. Each rule file has its own frontmatter (title, impact, impactDescription, tags) followed by a short explanation, an Incorrect SQL block, a Correct SQL block and a reference link. The folder also holds three authoring files (_contributing.md, _sections.md, _template.md) and a CHANGELOG.md.
The version information does not agree. The SKILL.md metadata says version 1.1.1 and date January 2026, while the changelog lists releases up to 1.6.0 dated 2026-07-30. The evidence does not say which is authoritative, so treat the SKILL.md metadata block as possibly out of date.
Overall assessment
Read as a document, this is a well-organised, practical rulebook. The rules are concrete rewrites rather than general advice (for example add an index on the foreign key column, wrap auth.uid() in a select inside an RLS policy, use keyset pagination instead of OFFSET, claim queue jobs with FOR UPDATE SKIP LOCKED). The authoring guide says rules should show the problem pattern first, use semantic names and cite primary sources such as the Postgres documentation and Supabase documentation. The content I read is consistent with that standard.
It should be used as input to review, not as an authority. The numeric impact figures (for example 100-1000x faster, 5-20x smaller) are written by the authors as guidance on prioritisation and are not backed by benchmarks in the retained files. Some rules are Supabase-specific, a few have gaps noted under limitations, and the long description promises topics (pgvector, pg_cron, pgmq, pg_restore, declarative schema files, RLS tests) that have no dedicated rule file in the captured scope.
Behaviour in a real agent was not assessed. No agent was run with the skill, no SQL was executed against a Postgres server, and the quality of the advice an agent actually produces is unknown.
Who it is for
The main audience is developers who ask an AI coding agent to write or change anything stored in Postgres: tables, columns, migrations, RLS policies, indexes, triggers, functions or queries. The description explicitly says to load the skill before such work, even for a one-column change, and also when diagnosing slow queries, timeouts, connection exhaustion, locking, bloat or rows visible to the wrong tenant. Teams on Supabase get the most direct value, because several rules use Supabase features such as auth.uid() and the authenticated role.
Beginners can use it because each rule is short and shows a wrong and a right example, but they should not accept every recommendation without understanding it, since the tuning numbers and settings depend on the workload. Experienced database engineers may find most of the advice familiar; for them the value is steering an agent away from common mistakes rather than learning new techniques.
It is a poor fit if you do not use Postgres, if you want a tool that automatically checks a live database (it contains no executable checks), or if you need guidance on topics with no rule file, such as pgvector tuning or restore procedures.
What it covers
SKILL.md ranks eight categories. Query Performance (critical, 5 files): indexes on WHERE and JOIN columns, composite indexes with equality columns before range columns, covering indexes with INCLUDE, partial indexes, and choosing between B-tree, GIN, GiST, BRIN and hash. Connection Management (critical, 4 files): pooling with PgBouncer-style transaction and session modes, connection limits and memory, idle timeouts, and named prepared statements under transaction pooling. Security and RLS (critical, 3 files): enabling row level security, wrapping functions in a select for speed, SECURITY DEFINER helper functions kept in a private schema with search_path set empty, and least-privilege roles.
Schema Design (high, 6 files): safe idempotent constraint creation in migrations (Postgres has no ADD CONSTRAINT IF NOT EXISTS), data types (bigint identity, text, timestamptz, numeric), indexing foreign keys, lowercase snake_case identifiers, time-range partitioning, and primary key strategy including UUIDv7. Concurrency and Locking (medium-high, 4 files): advisory locks, consistent lock ordering to avoid deadlocks, short transactions, and SKIP LOCKED queues. Data Access Patterns (medium, 4 files): batch inserts and COPY, removing N+1 queries, keyset pagination, and INSERT ... ON CONFLICT upserts. Monitoring (low-medium, 3 files): EXPLAIN ANALYZE, pg_stat_statements, and VACUUM/ANALYZE with autovacuum tuning. Advanced (low, 2 files): tsvector full-text search and GIN indexing for JSONB.
Individual files carry their own impact labels, which do not always match the category label (for example the idle-timeout rule is labelled high and the privileges rule medium, both inside the critical categories).
Topics named in the skill description but with no dedicated rule file in the captured scope: pgvector, pg_cron, pgmq, pg_restore, declarative schema files, and tests for RLS policies. Bulk data import is covered by references/data-batch-inserts.md, which recommends COPY for large imports. references/lock-skip-locked.md is related queue-processing guidance only; it does not cover pg_cron or pgmq. The changelog also mentions a security checklist covering auth.role() deprecation and BOLA. The captured files contain no such text, so where it lives is unknown.
Using it
What you need
You need an AI coding agent or assistant that can load skills in the SKILL.md format (a folder with a Markdown file whose frontmatter has a name and description, and that can read the files in references/). The evidence does not name any specific agent product, so which tools support it is not established here.
You also need a Postgres database to apply the advice to. No minimum Postgres version is stated anywhere in the retained files. Some rules rely on settings or optional components, so confirm they are available on your Postgres version and host: the idle_session_timeout setting, the pg_uuidv7 extension for UUIDv7 keys, the pg_stat_statements extension, and a pooler such as PgBouncer for the pooling and timeout rules. Several rules use Supabase-specific objects (auth.uid() and the authenticated, anon and service_role roles), so on plain Postgres you would need equivalents. The prepared-statements rule mentions ports 5432 and 6543 in its session-mode pooling option. It presents them as example pooler ports, so confirm the actual connection endpoint and pooling mode for your deployment.
The skill does not need a Supabase account, API key or network access to be read. Whether your agent needs any permissions to read the references folder is unknown.
How it works
The skill is a set of written instructions and examples for an agent to read. The captured folder contains no executable code. The description lists intended triggers; discovery and loading order depend on the host agent and are unknown here. The listed triggers are situations in which the agent should load the skill: creating or altering tables, migrations, RLS policies, indexes, triggers, queues, pgvector, restores, slow queries, locking and wrong-tenant visibility. The changelog records a change that made the description more trigger-rich.
Once loaded, SKILL.md tells the agent when to apply the guidance, gives the priority table, and points to individual rule files such as references/query-missing-indexes.md and references/_sections.md. The agent is expected to read the rule files relevant to the task. Each rule is a small pattern: a one or two sentence reason, an incorrect SQL example, a correct SQL example, sometimes EXPLAIN output or catalogue queries, and a link to Postgres or Supabase documentation.
The authoring guide explains the design intent: concrete transformations, an error-first layout so agents recognise anti-patterns, quantified impact so agents can prioritise, self-contained examples, and SQL-only examples unless application code matters (pooling, transactions, ORM patterns). The folder contains no scripts, hooks or tools, so all behaviour depends on the host agent following the text.
Setup
The retained evidence contains no installation instructions, so a specific install command or target directory is unknown. Because the resource is a plain folder in the standard skill layout, setup in a compatible agent would normally mean placing the whole supabase-postgres-best-practices folder (SKILL.md and references/) where that agent looks for skills. The evidence does not give that location, so check your agent's documentation.
Keep the references/ folder next to SKILL.md. The skill tells the agent to open files by relative paths such as references/query-missing-indexes.md, so a copy of SKILL.md alone would lose all 31 rules. Keep the MIT licence notice with any copy you redistribute.
No configuration options, environment variables or credentials are described. Whether your agent loads the skill automatically from the description or needs it to be requested by name depends on the agent and was not assessed.
Worked example
This example is derived from reading the rules and was not run. Suppose you ask an agent to add an orders table owned by a user in a multi-tenant app. With the skill loaded, the rules point to these choices: an id column of type bigint generated always as identity primary key (schema-primary-keys); timestamptz for created_at and numeric for money (schema-data-types); an index on the foreign key column, for example create index orders_customer_id_idx on orders (customer_id) (schema-foreign-key-indexes); lowercase snake_case names (schema-lowercase-identifiers); and alter table orders enable row level security with a policy written as using ((select auth.uid()) = user_id) so the function is evaluated once rather than per row, plus create index orders_user_id_idx on orders (user_id) (security-rls-basics, security-rls-performance).
If you then report that a list page gets slower on deep pages, the pagination rule points the agent from limit 20 offset 199980 to a keyset query such as where id > 199980 order by id limit 20. The monitoring rules point to explain (analyze, buffers) and pg_stat_statements to confirm where time is spent. EXPLAIN ANALYZE actually executes the statement it explains, as the monitor-explain-analyze rule states, so it is not a read-only check. Run it in an isolated test database for any statement that could modify data or cause other side effects. Whether a given agent will actually choose and apply these rules correctly is unknown.
Assessment & evidence
Limitations and risks
Unverified numbers: some rules include numerical impact claims; others give qualitative impact descriptions. For example, query-missing-indexes.md claims 100-1000x faster queries on large tables and conn-pooling.md claims you can handle 10-100x more concurrent users. In contrast, conn-limits.md says 'Prevent database crashes and memory exhaustion' and data-upsert.md says 'Atomic operation, eliminates race conditions'. The numerical claims come with no benchmark method, data set or Postgres version in the captured files. Actual results depend on table size, data distribution, hardware and workload. The pagination rule claims O(1) performance; that complexity claim is unverified.
Content gaps and mismatches: the description advertises pgvector, pg_cron, pgmq, pg_restore, declarative schema files and RLS tests, but no rule file for these is in the captured scope. The changelog mentions BOLA and auth.role() deprecation coverage that is not visible in the captured files. The SKILL.md metadata (version 1.1.1, January 2026, 'performance rules across 8 categories') does not match the 1.6.0 changelog or the broader description.
Portability: the description says the guidance is for Postgres running anywhere, but many rules use Supabase objects and Supabase documentation links. Settings advice such as alter system set may not be permitted on managed Postgres services; the evidence does not discuss this. The connection-limit rule shows alter system set max_connections but does not say how or when that change takes effect, so check the Postgres documentation for your version before relying on it. The generic RLS example reads a session setting (app.current_user_id), which is only safe if untrusted code cannot change it.
Example quality: the constraint rule uses names from a specific app (birthchart). Two of its three existence checks look up pg_constraint by constraint name alone, without filtering by table, which could match a same-named constraint on another table. _sections.md still contains scaffold wording telling authors to replace the sections with real categories, so the authoring files are not fully polished. The changelog repeats earlier entries under each release, which makes it hard to see what each version changed.
Nothing was executed. All SQL was read, not run, and the effect of the skill on any real agent is untested.
Why these judgements
The resource is judged useful for its stated purpose because the rules are specific and checkable. A reader can compare each incorrect and correct pair with the linked Postgres or Supabase documentation. This skill recommends indexing foreign key columns, using timestamptz, keyset pagination, INSERT ... ON CONFLICT upserts, SKIP LOCKED queues and SECURITY DEFINER functions with an empty search_path. The SECURITY DEFINER rule is notably careful: it warns that such functions bypass RLS, keeps them in a private schema and revokes EXECUTE from public roles.
The caveats come from the evidence itself: numbers without methods, a description that outruns the captured references, mismatched version metadata, Supabase-specific assumptions, and a few examples that need adjustment. None of these makes the skill unusable. They do mean its output should be reviewed by a person who can read SQL and, ideally, checked against EXPLAIN output on representative data.
The captured folder contains Markdown files and no bundled executable scripts; installation behaviour is unknown. The main risk visible in the text is an agent confidently applying a rule where it does not fit. Examples include adding indexes to a write-heavy table, or changing server settings such as max_connections or timeouts without checking how the change takes effect on your host.
Alternatives
The simplest alternative is to read the sources the rules cite directly: the PostgreSQL documentation [https://www.postgresql.org/docs/current/], the Postgres wiki performance page [https://wiki.postgresql.org/wiki/Performance_Optimization] and the Supabase documentation [https://supabase.com/docs]. These are reference sources named by the skill; their current contents and version coverage are unknown here. They are not packaged as agent instructions.
You could instead write your own short rules file or agent instruction set that encodes your team's conventions (naming, key types, RLS patterns, migration style). That avoids the Supabase assumptions here at the cost of authoring time. For measured tuning, EXPLAIN (ANALYZE, BUFFERS) and pg_stat_statements on your own data are better evidence than any generic rule, and this skill itself points to both. Because EXPLAIN ANALYZE executes the statement, run it in an isolated test database whenever the statement could change data.
I did not compare this skill with other published Postgres skills or linters, so I make no claim about whether another option is better.
Evidence base
This report rests on the captured text of the skill folder at revision c9be0e931b7930f7d02126d04774d904c381e7d7: SKILL.md, CHANGELOG.md, the three authoring files (_contributing.md, _sections.md, _template.md) and all 31 rule files in references/, plus the repository LICENSE as the licence notice. Every one of these files was read in full.
Statements about what the rules say are taken directly from those files. Statements about suitability, gaps and risks are my reading of the text. Quoted performance gains are the authors' claims and were not reproduced. No Postgres server, agent or build was used, and external pages linked by the rules were not fetched or reviewed.
Access & freshness
Costs
The evidence states no price for the skill, and the licence grants use free of charge. The money cost of using it is therefore not the skill itself but whatever your agent or model provider charges for the extra context the skill adds. That cost is unknown; it depends on the agent, the model and how many rule files are read per task. For scale, SKILL.md is 3,231 bytes and the rule files range from about 1.2 KB to about 2.1 KB each, so loading a handful of rules is a small amount of text.
Costs of the services the advice refers to (Supabase hosting, PgBouncer, extensions) are not stated in the evidence and were not assessed. Applying the advice can also have operational costs that the rules only partly discuss, such as extra indexes slowing writes or a table lock during a change.
Rights and licence
The repository LICENSE is the MIT licence with the notice 'Copyright (c) 2026 Supabase', and the SKILL.md frontmatter also declares license: MIT. MIT allows you to use, copy, modify, merge, publish, distribute, sublicense and sell the software, provided the copyright notice and permission notice are included in all copies or substantial portions. The software is provided as is, without warranty and without liability for the authors.
The LICENSE file sits at the repository root, outside the skill folder, so keep it with any copy you pass on. The licence text says nothing about trademarks or patents, and the evidence does not address them. The external documentation pages the rules link to (postgresql.org, supabase.com) are separate works with their own terms and are not covered here.
Freshness
The content was captured on 2026-11-12 from revision c9be0e931b7930f7d02126d04774d904c381e7d7 (content checksum af4103933c3e17923ce61b6107cc1757551f0ca6130b66e271a544cf48e2212d). The newest dated changelog entry is version 1.6.0 on 2026-07-30; 1.5.0 carries the same date and an identical list of entries. Earlier entries are 1.4.0 (2026-07-10), 1.3.0 (2026-06-05) and 1.2.0 (2026-06-02). The oldest release entry shown is 1.2.0; the file opens with 1.6.0.
The SKILL.md metadata still says version 1.1.1 and January 2026, so it appears behind the changelog. The source address points to the main branch, so the live folder may have changed since this revision. Postgres and Supabase also evolve, and the rules do not state which Postgres versions they were written for. Check version-dependent advice (extensions, settings, Supabase pooler behaviour) against current documentation.
Suggested next steps
If you use Postgres or Supabase with a coding agent, try the skill on a non-production database or a scratch branch first. Ask the agent to design a small table and an RLS policy, then review the output against the matching rule files.
Always check agent-generated SQL before applying it. In an isolated test database with representative data, run explain (analyze, buffers) before and after index changes. EXPLAIN ANALYZE executes the statement being explained, as the monitor-explain-analyze rule states, so it is not a read-only validation step: any insert, update, delete or other side effect in that statement will happen. Confirm that settings changes (max_connections, idle timeouts, autovacuum) are allowed and safe on your host. If you are not on Supabase, replace auth.uid() and the Supabase role names with your own equivalents. Before following the pooling and prepared-statement rules, confirm the actual connection endpoint and pooling mode for your deployment rather than relying on the example ports.
For topics the description names but the captured files do not cover (pgvector, pg_cron, pgmq, pg_restore, declarative schema files, RLS tests), rely on the Postgres and Supabase documentation instead of assuming the skill has detailed rules. If you copy the skill into your own repository, include SKILL.md, the whole references/ folder and the MIT licence notice. Re-check the upstream folder periodically, because the pinned revision is a snapshot.
