supabase-postgres-best-practices
Skill2.7k starsChanged 6 months agoMITView on GitHub
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.
38 other projects use a version of this, 29 of them edited.
Trending
More talk lately.about the whole repository
Most recently taken up by
- crbnos/carbonedited, first seen Oct 4, 2026
- baekenough/oh-my-customcodetheir own version, first seen Oct 3, 2026
- laguagu/claude-code-nextjs-skillsedited, first seen Sep 30, 2026
- lecluse-net/galarisedited, first seen Sep 27, 2026
- nafiskabbo/skillsword for word, first seen Sep 23, 2026
- NiazMorshed2007/jcrword for word, first seen Sep 20, 2026
Who's talking about supabase/agent-skills
- amoai-tech/mdeai“Make agents reuse existing code before writing new code, and make every PR explain itself”GitHub · Sep 29, 2026 · 2 reactions
- amoai-tech/mdeai“SB-002 · Make Fresh Supabase Rebuilds Match Production Without Copying Known Breakage”GitHub · Sep 17, 2026 · 2 reactions
- amoai-tech/ipixai“IPI-1200 · PR-REVIEW-V2-001 — Catch Risky iPix Code Changes Automatically Before Merge”GitHub · Sep 13, 2026 · 2 reactions
- @githubfeed.bsky.social“🚀 GitHub Intelligence Drop agent-skills (TypeScript • 🟢) ⭐ 2.3K → …”Bluesky · Jul 14, 2026 · 2 likes
- @tom-doerr.bsky.social“https://github.com/supabase/agent-skills”Bluesky · Jul 30, 2026 · 1 likes
The biggest 5 of 42 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 42
Talked about on GitHub, Bluesky and Hacker News (42 times).
On GitHub · 36
- Sep 29, 2026Make agents reuse existing code before writing new code, and make every PR explain itself — amoai-tech/mdeai2 reactions · 11 comments
- Sep 17, 2026SB-002 · Make Fresh Supabase Rebuilds Match Production Without Copying Known Breakage — amoai-tech/mdeai2 reactions · 5 comments
- Sep 13, 2026IPI-1200 · PR-REVIEW-V2-001 — Catch Risky iPix Code Changes Automatically Before Merge — amoai-tech/ipixai2 reactions · 13 comments
- Jan 30, 2026Supabase Postgres Best Practicesエージェントスキルの追加 — ykzts/bingify1 reaction · 8 comments
- Oct 5, 2026New rules from the agent-skills review: 11 checks (SQL, Drizzle, TS, shadcn, Tailwind, Expo) — rbaumier/comply0 reactions
31 more on GitHub
- Oct 5, 2026supabase-skills: upstream update — robomotionio/robomotion-skills0 reactions
- Oct 4, 2026claude-code-plugins.github.supabase.agent-skills: init at 0.1.9 — sudosubin/agents.nix0 reactions
- Oct 4, 2026claude-code-marketplaces.github.supabase.agent-skills: init at 0.1.9 — sudosubin/agents.nix0 reactions
- Oct 4, 2026agent-skills.github.supabase.agent-skills: 0.1.8 → 0.1.9 — sudosubin/agents.nix0 reactions
- Oct 2, 2026agent-skills.github.supabase.agent-skills: init at 0.1.8 — sudosubin/agents.nix0 reactions
- Sep 25, 2026[skill-health] supabase-postgres-best-practices: the VACUUM and pagination reference links are both 404 — stanfish06/skillquarium0 reactions
- Sep 23, 2026Update clients.data.ts — supabase/supabase0 reactions · 4 comments
- Sep 15, 2026SAN-1272 — Make MDE AI coding agents choose the right skills, workflow, and checks — amoai-tech/mdeai0 reactions · 4 comments
- Sep 14, 2026Add Supabase agent-skills package — seerobshot-web/formedible0 reactions
- Aug 11, 2026Slice: Skills × MCP capability packaging and eval — ed3c/agent-architect-notes0 reactions
- Jul 28, 2026Docs/telemetry mcp tools — supabase/supabase0 reactions · 5 comments
- Jul 13, 2026feat: bump submodules/agent-skills from `e5f7a7c` to `1ad9aae` — supabase-community/gemini-extension0 reactions
- Jul 10, 2026feat: bump submodules/agent-skills from `e5f7a7c` to `1ad9aae` — supabase-community/cursor-plugin0 reactions
- Jul 9, 2026fix: declarative schema guidance and scoring — supabase/evals0 reactions · 2 comments
- Jul 2, 2026supabase skills 追加 — engineer-first/idea-boost0 reactions
- Jun 18, 2026docs(content): add Supabase agent skills — JSONbored/awesome-claude0 reactions · 4 comments
- Jun 8, 2026feat: bump submodules/agent-skills from `e5f7a7c` to `1356046` — supabase-community/gemini-extension0 reactions · 1 comment
- Jun 3, 2026feat: bump submodules/agent-skills from `e5f7a7c` to `759fddf` — supabase-community/gemini-extension0 reactions · 1 comment
- May 28, 2026feat: bump submodules/agent-skills from `e5f7a7c` to `577e626` — supabase-community/gemini-extension0 reactions · 1 comment
- May 27, 2026feat: bump submodules/agent-skills from `e5f7a7c` to `30e4d71` — supabase-community/cursor-plugin0 reactions · 1 comment
- May 25, 2026feat: bump submodules/agent-skills from `e5f7a7c` to `4e69c80` — supabase-community/gemini-extension0 reactions · 1 comment
- May 22, 2026feat: bump submodules/agent-skills from `e5f7a7c` to `4e69c80` — supabase-community/cursor-plugin0 reactions · 1 comment
- May 22, 2026feat: bump submodules/agent-skills from `e5f7a7c` to `5f25299` — supabase-community/gemini-extension0 reactions · 1 comment
- May 20, 2026feat: bump submodules/agent-skills from `e5f7a7c` to `a5648b6` — supabase-community/gemini-extension0 reactions · 1 comment
- May 20, 2026feat: bump submodules/agent-skills from `e5f7a7c` to `a5648b6` — supabase-community/cursor-plugin0 reactions · 1 comment
- May 14, 2026feat: bump submodules/agent-skills from `e5f7a7c` to `daaed4a` — supabase-community/gemini-extension0 reactions · 1 comment
- May 13, 2026feat: bump submodules/agent-skills from `e5f7a7c` to `daaed4a` — supabase-community/cursor-plugin0 reactions · 1 comment
- May 12, 2026feat: bump submodules/agent-skills from `e5f7a7c` to `3e77715` — supabase-community/gemini-extension0 reactions · 1 comment
- May 7, 2026feat: bump submodules/agent-skills from `e5f7a7c` to `fa9911a` — supabase-community/gemini-extension0 reactions · 1 comment
- Apr 15, 2026New skill: /supabase-supabase (safe risk) — aiskillstore/marketplace0 reactions
- Feb 20, 2026supabase-postgres-best-practices — AAswordman/OperitSkillMarket0 reactions
On Bluesky · 5
- Jul 14, 2026🚀 GitHub Intelligence Drop agent-skills (TypeScript • 🟢) ⭐ 2.3K → https://github.com/supabase/agent-skills llm-d (Shell • 🟢) ⭐ 3.8K →… — @githubfeed.bsky.social2 likes and reposts
- Jul 30, 2026https://github.com/supabase/agent-skills — @tom-doerr.bsky.social1 likes and repost
- Feb 4, 2026https://github.com/supabase/agent-skills — @tom-doerr.bsky.social1 likes and repost
- Jan 27, 2026github.com/supabase/agent-... GitHub - supabase/agent-skills: Agent Skills to help developers using AI agents with Supabase — @technews4869.bsky.social1 likes and repost
- Jan 26, 2026SupabaseのAIエージェント向けスキル群でPostgresの最適化知識を組み込んでいるらしい AIによるDB操作の精度向上に期待できるかも yug1224 starred supabase/agent-skills… — @yug1224.com1 likes and repost
On Hacker News · 1
- Jan 23, 2026Agent Skills to help developers using AI agents with Supabase1 point
Used with
Projects with it also use make-interfaces-feel-better, ai-elements and 8 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
DinanathDashSkillmake-interfaces-feel-better
Design engineering principles for making interfaces feel polished. Use when building UI components, reviewing frontend code, implementing animations, hover states, shadows, borders, typography, micro-interactions, enter/exit animations, or any visual detail work. Triggers on UI polish, design details, "make it feel better", "feels off", stagger animations, border radius, optical alignment, font smoothing, tabular numbers, image outlines, box shadows.
Also in 3 projects that use this
VercelSkillai-elements
Build AI chat interfaces using ai-elements components — conversations, messages, tool displays, prompt inputs, and more. Use when the user wants to build a chatbot, AI assistant UI, or any AI-powered chat interface.
Also in 3 projects that use this
VercelSkillshadcn
Pre-built shadcn/ui components for json-render. Use when working with @json-render/shadcn, adding standard UI components to a catalog, or building web UIs with Radix UI + Tailwind CSS components.
Also in 5 projects that use this
VercelSkillfind-skills
Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.
Also in 7 projects that use this
AWSSkillprototype
Build a throwaway prototype to answer a design question. Use when the user wants to sanity-check whether a state model or logic feels right, or explore what a UI should look like.
Also in 3 projects that use this
VercelSkillagent-browser
Automates browser interactions for web testing, form filling, screenshots, and data extraction. Use when the user needs to navigate websites, interact with web pages, fill forms, take screenshots, test web applications, or extract information from web pages.
Also in 3 projects that use this
Other versions38 projects use a version of this.
Word for word · 7
- Dimon94/skills★ 107100% same
- NiazMorshed2007/jcr★ 19100% same
- idexal/idexal-skills★ 13100% same
- nafiskabbo/skills★ 1100% same
- 02falgun/AI-Powered-B2B-Revenue-Recovery-Engine★ 0100% same
- EstebanT1112/codex-engineering-workflow★ 0100% same
- lamxy/agent-skill-web★ 0100% same
Edited · 29
- openai/plugins★ 7.3k88% same
- crbnos/carbon★ 2.7k91% same
- syahiidkamil/Software-Engineer-AI-Agent-Atlas★ 39791% same
- JetBrains/skills★ 36080% same
- julianromli/ai-skills★ 19273% same
- laguagu/claude-code-nextjs-skills★ 6778% same
- vobase/vobase★ 6188% same
- PracticalSwan/agent-skills★ 1847% same
- ruloCode/hermes-os★ 1591% same
- autohandai/community-skills★ 1188% same
19 more not listed
Wrote their own version · 2
- baekenough/oh-my-customcode★ 43same name
- ecocee/skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
We split this skill into the rules it gives an agent
1 rule. 1 is common, 0 are distinctive, and 0 are very specific to this project.
1
Common
Most of the 31 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Common: line 42
Read individual rule files for detailed explanations and SQL examples:
“Common” is measured: kept by at least 6 in 10 of the 31 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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
| 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:
references/query-missing-indexes.md
references/query-partial-indexes.md
references/_sections.mdEach 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
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

