PlugWiki

supabase-postgres-best-practices Skill for Claude: Postgres Rules From Supabase

Gives Claude 31 Postgres rules from Supabase, covering queries, indexes, row-level security, schema design and locking, for Postgres anywhere.

Installs
469.8K
on skills.sh
Stars
3K
on GitHub
Files
35
besides SKILL.md
Updated
Oct 2026
last repo commit

supabase-postgres-best-practices is a rulebook. It has 31 rule files in 8 categories, ranked by impact: query performance, connection management and security (critical), schema design (high), locking, data access, monitoring and advanced features. Each rule shows a wrong example, a right example, and sometimes query plan output.

SKILL.md tells Claude to load it before writing or changing anything in a Postgres database, even a one-column change. That covers tables, types, migrations, RLS policies, indexes, triggers, functions, queues, pgvector and pg_cron, and also slow queries, timeouts, locking and bloat. It is for Postgres anywhere, not only Supabase. The skill bundles no scripts.

Good for

  • Developers writing SQL, migrations or schemas with Claude
  • Teams debugging slow queries, locks or connection limits
  • Anyone writing row-level security policies who wants them checked against known rules

Install supabase-postgres-best-practices

Claude Code

  1. 1

    Copy this prompt.

    Install the supabase-postgres-best-practices skill in Claude Code. Run this command:
    
    npx skills add https://github.com/supabase/agent-skills --skill supabase-postgres-best-practices
    
    Then check that it loaded and tell me how to use it.
  2. 2

    Paste it into Claude Code. It shows the change and asks before running it.

Requires Node.js.

From its listing on skills.sh. Source.

What's in the skill

When it loads

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.

Sections in SKILL.md

  1. When to Apply
  2. Rule Categories by Priority
  3. How to Use
  4. References

Key facts

Author
Supabase
Installs on skills.sh
469,799 as of 2026-11-02
License
MIT
Last repo commit
2026-10-02

What it includes

  • Missing, composite, covering, partial indexes and index types

    Five rule files, marked critical.

    Read · Query performance

  • Pooling, limits, idle timeouts and prepared statements

    Four rule files, marked critical.

    Read · Connection management

  • Row-level security basics and performance, privileges

    Three rule files, marked critical.

    Read · Security and RLS

  • Data types, primary keys, constraints, foreign key indexes, partitioning, lowercase names

    Six rule files, marked high.

    Read · Schema design

  • Advisory locks, deadlocks, short transactions, SKIP LOCKED

    Four rule files, marked medium-high.

    Read · Concurrency and locking

  • Batch inserts, N+1 queries, pagination, upserts

    Four rule files, marked medium.

    Read · Data access patterns

  • EXPLAIN ANALYZE, pg_stat_statements, vacuum and analyze

    Three rule files, marked low-medium.

    Read · Monitoring and diagnostics

  • Full-text search and JSONB indexing

    Two rule files, marked low.

    Read · Advanced features

From the official docs

Questions

How do I install supabase-postgres-best-practices?

Use the install box at the top of this page. The repo README also documents a Claude Code plugin route for it. You do not need a Supabase account to install it.

Do I need Supabase to use it?

No. The description says these are Postgres best practices maintained by Supabase for Postgres running anywhere. A few rules add Supabase-specific notes where they apply.

When does Claude use it?

SKILL.md asks Claude to load it before writing or changing anything in a Postgres database, including a single column change, and when diagnosing slow queries, locking, connection exhaustion or rows visible to the wrong tenant.

What is the difference between this and the supabase skill?

This one is a Postgres rulebook. The supabase skill in the same repo covers all Supabase products, such as Auth, Edge Functions, Storage and the client libraries. They can be installed together.

Is it safe?

It is a set of text rules and bundles no scripts, so Claude reads guidance rather than running code from the skill. It cannot stop Claude from writing risky SQL, so review migrations before running them.

Information

updated Nov 2, 2026

Folder
skills/supabase-postgres-best-practices

supabase/agent-skillsskills.sh

Sources

Docs, issue trackers and discussions this page is built from.

Show all 2
  1. supabase-postgres-best-practices SKILL.md · github.com
  2. supabase/agent-skills README · github.com

Updated Nov 2, 2026.