Communitygithub.com

Supabase Postgres ベストプラクティス

Supabase が管理する、あらゆる環境で動作する Postgres のためのベストプラクティス集です。テーブル作成・変更、スキーマ設計、マイグレーション、RLS ポリシー、インデックス、クエリ診断など、Postgres に関わる作業の前にこのスキルを読み込んでください。

Supabase Postgres ベストプラクティス とは?

このスキルは、Supabase チームが管理する包括的な Postgres パフォーマンス最適化ガイドです。クエリパフォーマンス、接続管理、セキュリティ・RLS、スキーマ設計、並行性・ロック、データアクセスパターン、監視・診断、高度な機能の8カテゴリにわたるルールを提供し、自動クエリ最適化やスキーマ設計を支援します。特に、インデックス欠落の検出、部分インデックス、RLS ポリシーの設計、マイグレーションの安全な実行など、実践的なSQL例と説明が含まれています。Supabase、および一般的な Postgres 環境で動作し、データベースの設計・変更・診断を行う開発者やAIエージェントにとって必須のリファレンスです。各ルールファイルは、問題の説明、誤ったSQL例、正しいSQL例、EXPLAIN出力、追加コンテキストで構成されており、初心者から上級者まで幅広く活用できます。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Audomsub/Tiktok-Shop/tree/HEAD/.agents/skills/supabase-postgres-best-practices

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

Supabase Postgres ベストプラクティス は何をしますか?

Supabase が管理する、Postgres のための包括的なパフォーマンス最適化ガイドです。影響度の高い順に優先順位付けされた8カテゴリのルールが含まれており、自動クエリ最適化とスキーマ設計を支援します。

適用タイミング

以下の状況でこれらのガイドラインを参照してください:

  • SQL クエリの作成またはスキーマ設計時
  • インデックスの実装またはクエリ最適化時
  • データベースのパフォーマンス問題のレビュー時
  • コネクションプーリングまたはスケーリングの設定時
  • Postgres 固有の機能の最適化時
  • Row-Level Security (RLS) の操作時

ルールカテゴリ(優先順位順)

優先順位カテゴリ影響度プレフィックス
1クエリパフォーマンス致命的query-
2接続管理致命的conn-
3セキュリティとRLS致命的security-
4スキーマ設計高schema-
5並行性とロック中~高lock-
6データアクセスパターン中data-
7監視と診断低~中monitor-
8高度な機能低advanced-

使い方

詳細な説明とSQL例については、個別のルールファイルを参照してください:

references/query-missing-indexes.md
references/query-partial-indexes.md
references/_sections.md

各ルールファイルには以下が含まれています:

  • それが重要である理由の簡単な説明
  • 誤ったSQL例とその説明
  • 正しいSQL例とその説明
  • オプションのEXPLAIN出力またはメトリクス
  • 追加のコンテキストと参照情報
  • Supabase固有の注意事項(該当する場合)

参考資料

Individual skills in this repo

This repo contains 6 individual skills — each has its own dedicated page.

Audomsub/Tiktok-Shop

Review the changes since a fixed point (commit, branch, tag, or merge-base) along two axes: Standards (does the code follow this repo's documented coding standards?) and Spec (does the code match what the originating issue/spec asked for?). Runs both reviews in parallel sub-agents and reports them side by side. Use when the user wants to review a branch, a PR, work-in-progress changes, or asks to \"review since X\".

Audomsub/Tiktok-Shop

A relentless interview to sharpen a plan or design, which also creates docs (ADR's and glossary) as we go.

Audomsub/Tiktok-Shop

Implement a piece of work based on a spec or set of tickets.

Audomsub/Tiktok-Shop

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).

Audomsub/Tiktok-Shop

Turn the current conversation into a spec and publish it to the project issue tracker: no interview, just synthesis of what you've already discussed.

Audomsub/Tiktok-Shop

Break a plan, spec, or the current conversation into a set of tracer-bullet tickets, each declaring its blocking edges, published to the configured tracker (edges as text in one file per ticket locally, or native blocking links on a real tracker).

関連スキル