supabase/agent-skills
Overview
This skill helps developers apply Supabase-backed Postgres performance optimizations and best practices when writing, reviewing, or tuning SQL, schemas, and database configs. It consolidates prioritized rules across query performance, connection management, security (RLS), schema design, and operational monitoring. Use it to surface high-impact fixes and guide automated or manual optimizations.
How this skill works
The skill inspects SQL, schema definitions, and configuration choices against a prioritized rule set maintained by Supabase. It identifies issues like missing indexes, inefficient joins, RLS misconfigurations, and connection pooling problems, then suggests concrete corrections and patterns. Each recommendation links to a focused explanation, example SQL, and Supabase-specific notes for real-world application.
When to use it
- Writing or reviewing SQL queries to improve latency and resource use
- Designing or refactoring schema and indexes for large tables
- Diagnosing production performance problems or slow queries
- Configuring connection pooling, scaling, or concurrency behavior
- Implementing or auditing Row-Level Security rules
Best practices
- Prioritize index and query plan fixes first—these are highest impact
- Use connection pooling and tune max connections to avoid overload
- Model schemas for common access patterns and prefer partial/indexed columns
- Test RLS policies in staging and benchmark their performance
- Monitor slow queries, locks, and resource metrics continuously
Example use cases
- Detecting missing or unused indexes and proposing targeted CREATE INDEX statements
- Rewriting multi-join queries into more efficient forms and showing EXPLAIN comparisons
- Suggesting connection pool settings for serverless or high-concurrency workloads
- Reviewing schema changes and recommending partial or covering indexes
- Auditing RLS policies for correctness and performance impact
FAQ
No. It provides recommendations, example SQL, and notes. Apply changes manually after review and testing.
Does it cover Supabase-specific features?
Yes. Recommendations include Supabase notes where applicable, such as RLS guidance and platform-specific connection considerations.