Skip to content
cccskills
FreePublished on GitHub

postgres-best-practices

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

The English summary is being prepared. Showing the original description.

See how to install

Files included (37)

  • SKILL.md2.3 KB
  • AGENTS.md43.9 KB
  • metadata.json818 B
  • README.md3.1 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 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

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

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.

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

Use when manage multiple local CLI agents via tmux sessions (start/stop/monitor/assign) with cron-friendly scheduling.

The English summary is being prepared. Showing the original description.

hybridlabor-api/aos6Updated Oct 16, 2026

Use when a hybrid memory system that provides persistent, searchable knowledge management for AI agents (Architecture, Patterns, Decisions).

The English summary is being prepared. Showing the original description.

hybridlabor-api/aos6Updated Oct 16, 2026

Reference for how BDB structures autonomous software engineering work — the seven-node dispatcher graph (Architect, TechLead, UI/UX, Engineering, Media/EventTech, Reviewer, Shipping) that /startcycle-graph actually runs. Use when you need the high-level lifecycle framing without inventing your own process.

The English summary is being prepared. Showing the original description.

hybridlabor-api/aos6Updated Oct 16, 2026

Tools are how AI agents interact with the world. A well-designed tool is the difference between an agent that works and one that hallucinates, fails silently, or costs 10x more tokens than necessary. This skill covers tool design from schema to error handling.

The English summary is being prepared. Showing the original description.

hybridlabor-api/aos6Updated Oct 16, 2026

Harness patterns for coding agents — memory, permissions, context engineering, delegation, skills, hooks, bootstrap.

The English summary is being prepared. Showing the original description.

hybridlabor-api/aos6Updated Oct 16, 2026

agenttrail: live map of a multi-agent build in the browser: which plan component is being worked on, by which agent or harness, what is done and what is stuck. Use when a multi-agent pipeline starts (/startcycle, /startcycle-graph, /teamwork-preview) or after a plan-canvas approve, when the user asks to see what the agents are doing ("live map", "build board", "who is running now"), or by yourself whenever a multi-agent run is under way — no user prompt needed.

The English summary is being prepared. Showing the original description.

hybridlabor-api/aos6Updated Oct 16, 2026

See all skills by hybridlabor-api

Report a problem with this skill