Skip to content
cccskills
FreePublished on GitHub

supabase-postgres-best-practices

Guides Postgres query writing, schema design, and configuration reviews using Supabase's prioritized rules. Helps identify improvements in query performance, connection management, and row-level security, which controls access to individual rows.

OriginalShow the original description

Postgres performance optimization and best practices from Supabase. Use this skill when writing, reviewing, or optimizing Postgres queries, schema designs, or database configurations.

See how to install

Good for

  • Review slow SQL queries and index usage
  • Check table and schema designs
  • Review connection pooling and scaling settings
  • Check row-level access controls

Files included (37)

  • SKILL.md1.8 KB
  • AGENTS.md43.9 KB
  • metadata.json818 B
  • README.md3.0 KB
  • rules/_contributing.md4.0 KB
  • rules/_sections.md1.6 KB
  • rules/_template.md1.0 KB
  • rules/advanced-full-text-search.md1.4 KB
  • rules/advanced-jsonb-indexing.md1.4 KB
  • rules/conn-idle-timeout.md1.3 KB
  • rules/conn-limits.md1.3 KB
  • rules/conn-pooling.md1.3 KB
  • rules/conn-prepared-statements.md1.5 KB
  • rules/data-batch-inserts.md1.3 KB
  • rules/data-n-plus-one.md1.3 KB
  • rules/data-pagination.md1.3 KB
  • rules/data-upsert.md1.4 KB
  • rules/lock-advisory.md1.5 KB
  • rules/lock-deadlock-prevention.md1.8 KB
  • rules/lock-short-transactions.md1.3 KB
  • rules/lock-skip-locked.md1.3 KB
  • rules/monitor-explain-analyze.md1.4 KB
  • rules/monitor-pg-stat-statements.md1.4 KB
  • rules/monitor-vacuum-analyze.md1.5 KB
  • rules/query-composite-indexes.md1.4 KB
  • rules/query-covering-indexes.md1.3 KB
  • rules/query-index-types.md1.4 KB
  • rules/query-missing-indexes.md1.2 KB
  • rules/query-partial-indexes.md1.3 KB
  • rules/schema-data-types.md1.4 KB
  • rules/schema-foreign-key-indexes.md1.6 KB
  • rules/schema-lowercase-identifiers.md1.7 KB
  • rules/schema-partitioning.md1.5 KB
  • rules/schema-primary-keys.md1.8 KB
  • rules/security-privileges.md1.5 KB
  • rules/security-rls-basics.md1.3 KB
  • rules/security-rls-performance.md1.5 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

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

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Create interactive 3D scenes for websites, including product views and scroll-driven animations. Covers choosing Three.js, React Three Fiber, or Spline, preparing lightweight models, showing loading progress, and adapting experiences for mobile devices.

  • Building an interactive 3D product configurator
  • Adding 3D scenes to a portfolio
  • Animating models and cameras as visitors scroll
davila7/claude-code-templates32.7KUpdated Oct 18, 2026

ab-test-setup

FreeSummary

Plan A/B tests that compare page or product changes, with clear hypotheses, sample sizes, success metrics, and traffic allocation. Get a structured test plan and guidance for interpreting results and deciding what to try next.

  • Comparing signup button copy
  • Planning a pricing page experiment
  • Estimating sample size and test duration
davila7/claude-code-templates32.7KUpdated Oct 18, 2026

Prepare an academic CV for faculty, postdoctoral, or research applications. Organize publications, grants, teaching, and research experience, with section order and formatting adapted to the role and academic field.

  • Preparing a CV for faculty applications
  • Updating a CV for postdoctoral applications
  • Organizing publications and research funding
davila7/claude-code-templates32.7KUpdated Oct 18, 2026

accessibility

FreeSummary

Audit and improve web accessibility using WCAG 2.1 guidelines. Covers image descriptions, color contrast, keyboard controls, forms, and screen reader support, with code examples and automated and manual checks to guide fixes.

  • Auditing accessibility before a website launch
  • Improving keyboard navigation
  • Fixing form labels and error announcements
davila7/claude-code-templates32.7KUpdated Oct 18, 2026

Audit websites for accessibility barriers and improve image descriptions, color contrast, forms, keyboard navigation, and screen reader support. Provides code examples and automated and manual testing guidance for work toward WCAG 2.1 AA or AAA accessibility standards.

  • Auditing a website for accessibility issues
  • Fixing form labels and error announcements
  • Checking keyboard navigation and dialog focus
davila7/claude-code-templates32.7KUpdated Oct 18, 2026

Design autonomous agents for Claude Code plugins, including when they should run, what tools they may use, and how they should respond. Provides configuration templates, prompt guidance, and validation steps for creating agent files.

  • Create a code review agent
  • Refine examples that trigger an agent
  • Limit the tools an agent can use
davila7/claude-code-templates32.7KUpdated Oct 18, 2026

See all skills by davila7

Report a problem with this skill