supabase-postgres-best-practices

Audit Supabase Postgres schemas for anti-patterns and generate remediation steps.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/gonzoblasco/antigravity-developer-stack --skill supabase-postgres-best-practices-gonzoblasco
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: supabase-postgres-best-practices
Source: https://github.com/gonzoblasco/antigravity-developer-stack/tree/main/backend-infra/postgres-best-practices
Command: npx skills add https://github.com/gonzoblasco/antigravity-developer-stack --skill supabase-postgres-best-practices-gonzoblasco

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This skill helps teams identify and remediate common Postgres performance and schema anti-patterns using automated audits and guidance.

Core Features & Use Cases

  • Automated schema audits to flag usage of deprecated or suboptimal types (e.g., varchar(n), timestamp without time zone) and missing indexes on foreign keys.
  • Guidance for indexing, partitioning, RLS, and conformance with best practices to improve query performance, security, and maintainability.
  • Real-world applicability across schema design reviews, production deployments, and ongoing maintenance with actionable recommendations.

Quick Start

Run the included audit script against a SQL schema to surface issues, then consult the generated AGENTS.md and references to apply fixes in your project.

Frequently Asked Questions about supabase-postgres-best-practices

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I audit my Postgres schema for missing indexes and suboptimal data types in Supabase?

You can audit your Postgres schema in Supabase by running an automated Python script that flags missing foreign key indexes and suboptimal types like varchar(n) or timestamp without time zone, then generates actionable remediation steps.

What are common Postgres performance anti-patterns I should check before deploying Supabase to production?

Common Postgres performance anti-patterns include using deprecated data types, missing indexes on foreign keys, and inefficient schema design. Automated audits can detect these issues and provide guidance for indexing, partitioning, and RLS to improve performance.

How does Row Level Security (RLS) configuration affect my Supabase database performance and security?

RLS configuration directly impacts Supabase database security and query performance. Auditing your RLS policies ensures conformance with best practices, preventing unauthorized access while maintaining efficient query execution through proper indexing and partitioning strategies.

Can I automate Postgres table partitioning and connection management recommendations for my Supabase project?

Yes, you can automate Postgres partitioning and connection management recommendations using an audit script that evaluates your schema and generates actionable guidance to optimize query performance and maintainability in Supabase environments.

Do I need Python to run the Postgres schema audit tool in my Supabase environment?

You need Python to run the included audit script against your SQL schema. The script surfaces performance and security issues, and you then consult the generated AGENTS.md and reference materials to apply fixes in your project.

Why does my Supabase Postgres query performance degrade when using varchar(n) instead of text?

Using varchar(n) instead of text can degrade Postgres query performance and maintainability. An automated schema audit detects this anti-pattern along with missing indexes and timestamp issues, then generates actionable remediation steps to optimize your database.