supabase-postgres-best-practices

Review and rewrite Postgres queries, schemas, and RLS policies for Supabase.

Updated Jun 4, 2026
One-click install
npx skills add https://github.com/Seva-Eats/seva-web --skill supabase-postgres-best-practices-seva-eats
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: supabase-postgres-best-practices
Source: https://github.com/Seva-Eats/seva-web/tree/main/.agents/skills/supabase-postgres-best-practices
Command: npx skills add https://github.com/Seva-Eats/seva-web --skill supabase-postgres-best-practices-seva-eats

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you diagnose and fix slow, unsafe, or fragile Postgres usage by turning performance and schema problems into clear, high-impact SQL improvements.

Core Features & Use Cases

It covers query tuning, index strategy, connection management, row level security, schema design, locking, pagination, monitoring, and migration safety. Use it when a database query is slow, a policy is expensive, a migration is risky, or a table design is starting to create scale and reliability problems. It is especially useful for Supabase-backed applications that need practical rewrites, concrete examples, and prioritized recommendations instead of vague advice.

Quick Start

Ask for a Postgres review of your query, schema, or RLS policy and request the safest high-impact rewrite with a short explanation.

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 optimize slow Postgres queries in Supabase?

Optimize slow Postgres queries by analyzing execution plans, applying targeted index strategies, rewriting SQL queries, and tuning connection pooling based on prioritized performance impact.

What is the best way to write Supabase row level security policies?

The best way to write Supabase row level security policies is to tune them for query efficiency, diagnosing expensive policies and providing concrete SQL rewrites grounded in documented best practices.

How do I make Postgres schema migrations safer in a Supabase application?

Make Postgres schema migrations safer by evaluating locking risks, pagination strategies, and scale constraints, then applying prioritized, high-impact schema design improvements to prevent reliability problems.

Does this work for query tuning and connection pooling in Postgres?

Yes, it works for query tuning and connection pooling in Postgres by diagnosing slow or fragile usage and delivering concrete rewrite recommendations, index selections, and Supabase-specific guidance.

Why is my Supabase database query slow even with indexes?

Your Supabase database query may be slow due to inefficient schema design, expensive row level security policies, or connection pooling limits, requiring execution plan analysis and concrete SQL rewrites.