Skip to content
Skillpedia
Databases48k · #3856

postgres-best-practices

Helps your agent optimize the PostgreSQL database. It improves performance and ensures queries are efficient.

What it does

This tool helps improve your PostgreSQL database performance. It provides advice on how to write faster SQL queries, organize your tables, and configure the database to work better.

When to use it

  • ✓When writing new SQL queries.
  • ✓When your database is running slowly.
  • ✓When planning your table structure.

Example of what to ask your AI

“How can I optimize this SQL query to run faster?”

Want more? Open the sections below.

How to use

The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.

Skill link

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/postgres-best-practices/SKILL.md

Ready-to-paste message

Use this skill to help me: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/postgres-best-practices/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
How it works

The tool compares your queries and configurations against a best practices guide. It identifies areas that can be improved and suggests examples on how to fix them.

Installation

Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.

In the terminal (Claude Code, Codex, Cursor), in your project folder:

npx skills add sickn33/agentic-awesome-skills --skill postgres-best-practices

Or download just the file:

curl -L https://raw.githubusercontent.com/sickn33/agentic-awesome-skills/main/plugins/agentic-awesome-skills-claude/skills/postgres-best-practices/SKILL.md -o SKILL.md
Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

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 Use

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

Priority Category Impact Prefix
1 Query Performance CRITICAL query-
2 Connection Management CRITICAL conn-
3 Security & RLS CRITICAL security-
4 Schema Design HIGH schema-
5 Concurrency & Locking MEDIUM-HIGH lock-
6 Data Access Patterns MEDIUM data-
7 Monitoring & Diagnostics LOW-MEDIUM monitor-
8 Advanced Features LOW advanced-

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

When to Use

This skill is applicable to execute the workflow or actions described in the overview.

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
FAQ

What is PostgreSQL?

It's a popular system for storing and managing data on computers, like a large digital filing cabinet.

What are 'best practices'?

These are the best known ways to do something, based on the experience of many experts, to ensure it works well and securely.

What is 'optimization'?

It's the process of making something more efficient, faster, or better. In the case of a database, it's making it respond more quickly to your requests.

Details

Original description by the author

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

repo: sickn33/agentic-awesome-skills

Popularity

GitHub stars
48k
Ranking position
#3856
License
MIT
Updated
10/15/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills