New to Claude Skills? Learn how to install them →

davila7 on GitHub

Supabase Postgres Best Practices

Free

Optimize your Postgres database performance with proven guidelines.

Get this skill

Free · Opens the source repo

What Supabase Postgres Best Practices does

The Supabase Postgres Best Practices skill provides a comprehensive set of guidelines aimed at optimizing the performance of Postgres databases. This skill is particularly useful for developers and database administrators who are involved in writing SQL queries, designing schemas, or configuring database settings. It organizes best practices into eight categories, each prioritized by its impact on performance, making it easier to focus on the most critical areas first.

Each rule within the skill is designed to address specific aspects of database performance, from query optimization to connection management and security. The skill includes detailed explanations, incorrect and correct SQL examples, and performance metrics where applicable. This structured approach allows users to not only learn the best practices but also understand the rationale behind them, facilitating better decision-making when it comes to database design and query writing.

Whether you are troubleshooting performance issues, implementing indexing strategies, or configuring connection pooling, this skill serves as a valuable reference. It also includes specific notes related to Supabase, ensuring that users can take advantage of features unique to the Supabase platform. The skill is particularly beneficial for those working with Row-Level Security (RLS) and other advanced Postgres features, providing insights into best practices that enhance both security and performance.

Overall, the Supabase Postgres Best Practices skill is an essential resource for anyone looking to improve their Postgres database management and ensure optimal performance in their applications.

When to use it

Use this skill when writing SQL queries, designing schemas, or addressing database performance issues.

When not to use it

This is not suitable for users looking for general SQL tutorials or those who do not work with Postgres databases.

What you can build with it

Optimizing SQL Queries

Use this skill to refine your SQL queries by following the best practices for indexing and performance.

Designing Efficient Schemas

Refer to the guidelines when creating database schemas to ensure they are optimized for performance.

Troubleshooting Performance Issues

Leverage the skill to diagnose and address performance bottlenecks in your Postgres database.

How to install Supabase Postgres Best Practices

View source

1. Install with the skills CLI

npx skills add davila7/claude-code-templates/supabase-postgres-best-practices --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by davila7

Supabase Postgres Best Practices

Comprehensive performance optimization guide for Postgres, maintained by Supabase. Contains rules across 8 categories, prioritized by impact to guide automated query optimization and schema design.

When to Apply

Reference these guidelines when:

  • Writing SQL queries or designing schemas
  • Implementing indexes or query optimization
  • Reviewing database performance issues
  • Configuring connection pooling or scaling
  • Optimizing for Postgres-specific features
  • Working with Row-Level Security (RLS)

Rule Categories by Priority

PriorityCategoryImpactPrefix
1Query PerformanceCRITICALquery-
2Connection ManagementCRITICALconn-
3Security & RLSCRITICALsecurity-
4Schema DesignHIGHschema-
5Concurrency & LockingMEDIUM-HIGHlock-
6Data Access PatternsMEDIUMdata-
7Monitoring & DiagnosticsLOW-MEDIUMmonitor-
8Advanced FeaturesLOWadvanced-

How to Use

Read individual rule files for detailed explanations and SQL examples:

rules/query-missing-indexes.md
rules/schema-partial-indexes.md
rules/_sections.md

Each rule file contains:

  • Brief explanation of why it matters
  • Incorrect SQL example with explanation
  • Correct SQL example with explanation
  • Optional EXPLAIN output or metrics
  • Additional context and references
  • Supabase-specific notes (when applicable)

Full Compiled Document

For the complete guide with all rules expanded: AGENTS.md

Frequently asked questions about Supabase Postgres Best Practices

Similar skills