# Supabase postgres best practices

> Supabase postgres best practices is an open-source agent skill for databases. Postgres best practices maintained by Supabase, for Postgres running anywhere. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/supabase/agent-skills/tree/main/skills/supabase-postgres-best-practices
- **Repository:** https://github.com/supabase/agent-skills
- **GitHub stars:** 3,098
- **License:** MIT
- **Skill name:** supabase-postgres-best-practices
- **Collection:** https://github.com/supabase/agent-skills
- **Categories:** databases
- **Listing updated:** 2026-11-17

## About

Postgres best practices maintained by Supabase, for Postgres running anywhere. Load this skill BEFORE writing or changing anything that lives in a Postgres database: creating or altering tables and columns (including choosing column types), schema design, migrations and declarative schema files, RLS policies and the tests that verify them, indexes, triggers, database functions, queues and scheduled jobs (pg_cron, pgmq), vector/semantic search (pgvector), and restoring dumps (pg_restore) or importing data. Also load it when diagnosing slow queries, high CPU, timeouts, EXPLAIN plans, connection exhaustion, locking, bloat, or rows visible to the wrong user or tenant. This is not just a performance guide — schema, migration, security, and SQL authoring tasks need these rules too, even for a one-column change or a single query.

## When your agent uses it

> Postgres best practices maintained by Supabase, for Postgres running anywhere. Load this skill BEFORE writing or changing anything that lives in a Postgres database: creating or altering tables and columns (including choosing column types), schema design, migrations and declarative schema files, RLS policies and the tests that verify them, indexes, triggers, database functions, queues and scheduled jobs (pg_cron, pgmq), vector/semantic search (pgvector), and restoring dumps (pg_restore) or importing data. Also load it when diagnosing slow queries, high CPU, timeouts, EXPLAIN plans, connection exhaustion, locking, bloat, or rows visible to the wrong user or tenant. This is not just a performance guide — schema, migration, security, and SQL authoring tasks need these rules too, even for a one-column change or a single query.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/supabase/agent-skills/tree/HEAD/skills/supabase-postgres-best-practices)
- [License: MIT](https://github.com/supabase/agent-skills/tree/HEAD/skills/supabase-postgres-best-practices)

## Install

### Claude Code

This skill ships in the `postgres-best-practices` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add supabase/agent-skills
/plugin install postgres-best-practices@supabase-agent-skills
```

Or copy only this skill to `~/.claude/skills/supabase-postgres-best-practices`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/supabase/agent-skills.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/supabase-postgres-best-practices &&
cp -R "$tmp/skills/supabase-postgres-best-practices" ~/.claude/skills/supabase-postgres-best-practices &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/supabase-postgres-best-practices` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/supabase-postgres-best-practices` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/supabase/agent-skills.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/supabase-postgres-best-practices &&
cp -R "$tmp/skills/supabase-postgres-best-practices" ~/.agents/skills/supabase-postgres-best-practices &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/supabase-postgres-best-practices` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/supabase-postgres-best-practices` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/supabase/agent-skills.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/supabase-postgres-best-practices &&
cp -R "$tmp/skills/supabase-postgres-best-practices" ~/.cursor/skills/supabase-postgres-best-practices &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/supabase-postgres-best-practices` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/supabase/agent-skills.git --path skills/supabase-postgres-best-practices
```

Or copy the folder to `~/.gemini/skills/supabase-postgres-best-practices` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/supabase-postgres-best-practices`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/supabase/agent-skills.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/supabase-postgres-best-practices &&
cp -R "$tmp/skills/supabase-postgres-best-practices" ~/.copilot/skills/supabase-postgres-best-practices &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/supabase-postgres-best-practices` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/supabase/agent-skills.git
```

Then copy `agent-skills/skills/supabase-postgres-best-practices` into your agent's skills folder as `supabase-postgres-best-practices`. Agents that support SKILL.md read one folder per skill.

## FAQ

### How do I install Supabase postgres best practices in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/supabase-postgres-best-practices to use it in all your projects, or to .claude/skills/supabase-postgres-best-practices in one project. Or install the postgres-best-practices plugin, which includes it: /plugin marketplace add supabase/agent-skills, then /plugin install postgres-best-practices@supabase-agent-skills.

### Does Supabase postgres best practices run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Supabase postgres best practices?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Supabase postgres best practices?

The closest alternatives to Supabase postgres best practices are Bigquery pipeline audit, SQL server table reconciliation, Postgresql optimization, Pinecone rag and Supabase rls policies.

## Alternatives

- [Bigquery pipeline audit](https://ai-powered.com/skills/bigquery-pipeline-audit): Bigquery pipeline audit is an open-source agent skill for databases.
- [SQL server table reconciliation](https://ai-powered.com/skills/sql-server-table-reconciliation): SQL server table reconciliation is an open-source agent skill for databases.
- [Postgresql optimization](https://ai-powered.com/skills/postgresql-optimization): Postgresql optimization is an open-source agent skill for databases.
- [Pinecone rag](https://ai-powered.com/skills/pinecone-rag): Pinecone rag is an open-source agent skill for knowledge and memory.
- [Supabase rls policies](https://ai-powered.com/skills/supabase-rls-policies): Supabase rls policies is an open-source agent skill for databases.
- [Snowflake semanticview](https://ai-powered.com/skills/snowflake-semanticview): Snowflake semanticview is an open-source agent skill for databases.
- [Creating oracle to postgres migration integration tests](https://ai-powered.com/skills/creating-oracle-to-postgres-migration-integration-tests): Creating oracle to postgres migration integration tests is an open-source agent skill for databases.
- [Migrating oracle to postgres data access code](https://ai-powered.com/skills/migrating-oracle-to-postgres-data-access-code): Migrating oracle to postgres data access code is an open-source agent skill for databases.

---
Source: https://ai-powered.com/skills/supabase-postgres-best-practices
