Communitygithub.com

PhuongDeveloper 登陸頁面

由 Supabase 維護的 Postgres 最佳實踐,適用於任何環境下的 Postgres。在編寫或修改任何與 Postgres 資料庫相關的內容(例如建立或修改表格與欄位型態、Schema 設計、遷移與宣告式 Schema 檔案、RLS 政策及其測試、索引、觸發器、資料庫函數、佇列與排程工作、向量/語意搜尋,以及還原傾印或匯入資料)之前,請先載入此技能。此外,在診斷慢查詢、高 CPU、逾時、EXPLAIN 計畫、連線耗盡、鎖定、資料膨脹,或發現使用者/租戶看到的行數錯誤時,也請載入此技能。這不僅是一份效能指南——Schema、遷移、安全性及 SQL 撰寫任務同樣需要這些規則,即使只修改一個欄位或執行單一查詢也不例外。

PhuongDeveloper 登陸頁面 是什麼?

此技能提供由 Supabase 維護、全面且優先級排序的 Postgres 最佳實踐。它涵蓋八個類別,從對查詢效能、連線管理及安全性的影響最關鍵的規則開始,再到 Schema 設計、鎖定、資料存取模式、監控及進階功能。其主要用途是指導開發者在使用 Postgres 時進行自動化查詢最佳化與 Schema 設計,無論資料庫託管於何處。此技能適用於多種平台,包括 Cursor、Claude Code 與 Codex,特別是在編寫或審查 SQL 查詢、設計 Schema、實作 Row-Level Security (RLS) 政策或診斷資料庫效能問題時。每個規則都對應一個包含詳細解釋、不正確與正確 SQL 範例、EXPLAIN 輸出及 Supabase 特定注意事項的 Markdown 檔案,以確保開發者能理解、應用疑難排解建議。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/PhuongDeveloper/landingpage/tree/HEAD/.agents/skills/supabase-postgres-best-practices

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

Supabase Postgres 最佳實踐

由 Supabase 維護的全面效能最佳化指南,適用於 Postgres。包含按影響優先級排序的 8 個類別規則,可引導自動化查詢最佳化與 Schema 設計。

何時套用

在以下情況參考這些指南:

  • 撰寫 SQL 查詢或設計 Schema
  • 實作索引或查詢最佳化
  • 審查資料庫效能問題
  • 設定連線池或擴展
  • 最佳化 Postgres 專有功能
  • 使用 Row-Level Security (RLS)

按優先級排序的規則類別

優先級類別影響前綴
1查詢效能關鍵query-
2連線管理關鍵conn-
3安全性與 RLS關鍵security-
4Schema 設計高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 4 individual skills — each has its own dedicated page.

PhuongDeveloper/landingpage

Deploy applications and websites to Vercel. Use when the user requests deployment actions like "deploy my app", "deploy and give me the link", "push this live", or "create a preview deployment".

PhuongDeveloper/landingpage

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

PhuongDeveloper/landingpage

Deploy and manage projects on Vercel using token-based authentication. Use when working with Vercel CLI using access tokens rather than interactive login — e.g. "deploy to vercel", "set up vercel", "add environment variables to vercel".

PhuongDeveloper/landingpage

React composition patterns that scale. Use when refactoring components with boolean prop proliferation, building flexible component libraries, or designing reusable APIs. Triggers on tasks involving compound components, render props, context providers, or component architecture. Includes React 19 API changes.

相關技能