本文へ移動
cccskills
無料GitHub で公開

supabase-postgres-best-practices

Postgres best practices maintained by Supabase, for Postgres running anywhere. Load this skill BEFORE writing or changing anything that lives in a Postgres database: creating or altering tables and columns (including choosing column types), schema design, migrations and declarative schema files, RLS policies and the tests that verify them, indexes, triggers, database functions, queues and scheduled jobs (pg_cron, pgmq), vector/semantic search (pgvector), and restoring dumps (pg_restore) or importing data. Also load it when diagnosing slow queries, high CPU, timeouts, EXPLAIN plans, connection exhaustion, locking, bloat, or rows visible to the wrong user or tenant. This is not just a performance guide — schema, migration, security, and SQL authoring tasks need these rules too, even for a one-column change or a single query.

インストール方法を見る

含まれるファイル(36)

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

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

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:

references/query-missing-indexes.md
references/query-partial-indexes.md
references/_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)

References

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

supabase

無料

Use when doing ANY task involving Supabase. Triggers: Supabase products (Database, Auth, Edge Functions, Realtime, Storage, Vectors, Cron, Queues); client libraries and SSR integrations (supabase-js, @supabase/ssr) in Next.js, React, SvelteKit, Astro, Remix; auth issues (login, logout, sessions, JWT, cookies, getSession, getUser, getClaims, RLS); Supabase CLI or MCP server; schema changes, migrations, declarative schemas, security audits, Postgres extensions (pg_graphql, pg_cron, pg_vector); debugging and troubleshooting errors or unexpected behavior on Supabase projects (HTTP errors, Postgres errors, RLS surprises, permission denied, schema cache issues, timeouts, Edge Function crashes, Realtime drops, Storage failures) and reading or querying logs (Logs Explorer, ClickHouse).

日本語の概要は準備中です。原文の説明を表示しています。

supabase/agent-skills2,7202026年10月2日 更新

supabase のスキルをすべて見る

このスキルの問題を報告する