[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-supabase-supabase-postgres-best-practices":3,"mdc-m0onxl-key":37,"related-org-supabase-supabase-postgres-best-practices":483,"related-repo-supabase-supabase-postgres-best-practices":529},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":11,"stars":23,"repoUrl":24,"updatedAt":25,"license":26,"forks":27,"topics":28,"repo":32,"sourceUrl":35,"mdContent":36},"supabase-postgres-best-practices","optimize Postgres queries and schema design","Postgres performance optimization and best practices from Supabase. Use this skill when writing, reviewing, or optimizing Postgres queries, schema designs, or database configurations.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},"supabase","Supabase","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fsupabase.png",[12,16,17,20],{"name":13,"slug":14,"type":15},"Performance","performance","tag",{"name":9,"slug":8,"type":15},{"name":18,"slug":19,"type":15},"Database","database",{"name":21,"slug":22,"type":15},"PostgreSQL","postgresql",2343,"https:\u002F\u002Fgithub.com\u002Fsupabase\u002Fagent-skills","2026-04-06T17:55:03.601545","MIT",171,[29,30,31,8],"ai","ai-agents","skills",{"repoUrl":24,"stars":23,"forks":27,"topics":33,"description":34},[29,30,31,8],"Agent Skills to help developers using AI agents with Supabase","https:\u002F\u002Fgithub.com\u002Fsupabase\u002Fagent-skills\u002Ftree\u002FHEAD\u002Fskills\u002Fsupabase-postgres-best-practices","---\nname: supabase-postgres-best-practices\ndescription: Postgres performance optimization and best practices from Supabase. Use this skill when writing, reviewing, or optimizing Postgres queries, schema designs, or database configurations.\nlicense: MIT\nmetadata:\n  author: supabase\n  version: \"1.1.1\"\n  organization: Supabase\n  date: January 2026\n  abstract: Comprehensive Postgres performance optimization guide for developers using Supabase and Postgres. Contains performance rules across 8 categories, prioritized by impact from critical (query performance, connection management) to incremental (advanced features). Each rule includes detailed explanations, incorrect vs. correct SQL examples, query plan analysis, and specific performance metrics to guide automated optimization and code generation.\n---\n\n# Supabase Postgres Best Practices\n\nComprehensive performance optimization guide for Postgres, maintained by Supabase. Contains rules across 8 categories, prioritized by impact to guide automated query optimization and schema design.\n\n## When to Apply\n\nReference these guidelines when:\n- Writing SQL queries or designing schemas\n- Implementing indexes or query optimization\n- Reviewing database performance issues\n- Configuring connection pooling or scaling\n- Optimizing for Postgres-specific features\n- Working with Row-Level Security (RLS)\n\n## Rule Categories by Priority\n\n| Priority | Category | Impact | Prefix |\n|----------|----------|--------|--------|\n| 1 | Query Performance | CRITICAL | `query-` |\n| 2 | Connection Management | CRITICAL | `conn-` |\n| 3 | Security & RLS | CRITICAL | `security-` |\n| 4 | Schema Design | HIGH | `schema-` |\n| 5 | Concurrency & Locking | MEDIUM-HIGH | `lock-` |\n| 6 | Data Access Patterns | MEDIUM | `data-` |\n| 7 | Monitoring & Diagnostics | LOW-MEDIUM | `monitor-` |\n| 8 | Advanced Features | LOW | `advanced-` |\n\n## How to Use\n\nRead individual rule files for detailed explanations and SQL examples:\n\n```\nreferences\u002Fquery-missing-indexes.md\nreferences\u002Fquery-partial-indexes.md\nreferences\u002F_sections.md\n```\n\nEach rule file contains:\n- Brief explanation of why it matters\n- Incorrect SQL example with explanation\n- Correct SQL example with explanation\n- Optional EXPLAIN output or metrics\n- Additional context and references\n- Supabase-specific notes (when applicable)\n\n## References\n\n- https:\u002F\u002Fwww.postgresql.org\u002Fdocs\u002Fcurrent\u002F\n- https:\u002F\u002Fsupabase.com\u002Fdocs\n- https:\u002F\u002Fwiki.postgresql.org\u002Fwiki\u002FPerformance_Optimization\n- https:\u002F\u002Fsupabase.com\u002Fdocs\u002Fguides\u002Fdatabase\u002Foverview\n- https:\u002F\u002Fsupabase.com\u002Fdocs\u002Fguides\u002Fauth\u002Frow-level-security\n",{"data":38,"body":43},{"name":4,"description":6,"license":26,"metadata":39},{"author":8,"version":40,"organization":9,"date":41,"abstract":42},"1.1.1","January 2026","Comprehensive Postgres performance optimization guide for developers using Supabase and Postgres. Contains performance rules across 8 categories, prioritized by impact from critical (query performance, connection management) to incremental (advanced features). Each rule includes detailed explanations, incorrect vs. correct SQL examples, query plan analysis, and specific performance metrics to guide automated optimization and code generation.",{"type":44,"children":45},"root",[46,54,60,67,72,107,113,366,372,377,389,394,427,433],{"type":47,"tag":48,"props":49,"children":50},"element","h1",{"id":4},[51],{"type":52,"value":53},"text","Supabase Postgres Best Practices",{"type":47,"tag":55,"props":56,"children":57},"p",{},[58],{"type":52,"value":59},"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.",{"type":47,"tag":61,"props":62,"children":64},"h2",{"id":63},"when-to-apply",[65],{"type":52,"value":66},"When to Apply",{"type":47,"tag":55,"props":68,"children":69},{},[70],{"type":52,"value":71},"Reference these guidelines when:",{"type":47,"tag":73,"props":74,"children":75},"ul",{},[76,82,87,92,97,102],{"type":47,"tag":77,"props":78,"children":79},"li",{},[80],{"type":52,"value":81},"Writing SQL queries or designing schemas",{"type":47,"tag":77,"props":83,"children":84},{},[85],{"type":52,"value":86},"Implementing indexes or query optimization",{"type":47,"tag":77,"props":88,"children":89},{},[90],{"type":52,"value":91},"Reviewing database performance issues",{"type":47,"tag":77,"props":93,"children":94},{},[95],{"type":52,"value":96},"Configuring connection pooling or scaling",{"type":47,"tag":77,"props":98,"children":99},{},[100],{"type":52,"value":101},"Optimizing for Postgres-specific features",{"type":47,"tag":77,"props":103,"children":104},{},[105],{"type":52,"value":106},"Working with Row-Level Security (RLS)",{"type":47,"tag":61,"props":108,"children":110},{"id":109},"rule-categories-by-priority",[111],{"type":52,"value":112},"Rule Categories by Priority",{"type":47,"tag":114,"props":115,"children":116},"table",{},[117,146],{"type":47,"tag":118,"props":119,"children":120},"thead",{},[121],{"type":47,"tag":122,"props":123,"children":124},"tr",{},[125,131,136,141],{"type":47,"tag":126,"props":127,"children":128},"th",{},[129],{"type":52,"value":130},"Priority",{"type":47,"tag":126,"props":132,"children":133},{},[134],{"type":52,"value":135},"Category",{"type":47,"tag":126,"props":137,"children":138},{},[139],{"type":52,"value":140},"Impact",{"type":47,"tag":126,"props":142,"children":143},{},[144],{"type":52,"value":145},"Prefix",{"type":47,"tag":147,"props":148,"children":149},"tbody",{},[150,179,205,231,258,285,312,339],{"type":47,"tag":122,"props":151,"children":152},{},[153,159,164,169],{"type":47,"tag":154,"props":155,"children":156},"td",{},[157],{"type":52,"value":158},"1",{"type":47,"tag":154,"props":160,"children":161},{},[162],{"type":52,"value":163},"Query Performance",{"type":47,"tag":154,"props":165,"children":166},{},[167],{"type":52,"value":168},"CRITICAL",{"type":47,"tag":154,"props":170,"children":171},{},[172],{"type":47,"tag":173,"props":174,"children":176},"code",{"className":175},[],[177],{"type":52,"value":178},"query-",{"type":47,"tag":122,"props":180,"children":181},{},[182,187,192,196],{"type":47,"tag":154,"props":183,"children":184},{},[185],{"type":52,"value":186},"2",{"type":47,"tag":154,"props":188,"children":189},{},[190],{"type":52,"value":191},"Connection Management",{"type":47,"tag":154,"props":193,"children":194},{},[195],{"type":52,"value":168},{"type":47,"tag":154,"props":197,"children":198},{},[199],{"type":47,"tag":173,"props":200,"children":202},{"className":201},[],[203],{"type":52,"value":204},"conn-",{"type":47,"tag":122,"props":206,"children":207},{},[208,213,218,222],{"type":47,"tag":154,"props":209,"children":210},{},[211],{"type":52,"value":212},"3",{"type":47,"tag":154,"props":214,"children":215},{},[216],{"type":52,"value":217},"Security & RLS",{"type":47,"tag":154,"props":219,"children":220},{},[221],{"type":52,"value":168},{"type":47,"tag":154,"props":223,"children":224},{},[225],{"type":47,"tag":173,"props":226,"children":228},{"className":227},[],[229],{"type":52,"value":230},"security-",{"type":47,"tag":122,"props":232,"children":233},{},[234,239,244,249],{"type":47,"tag":154,"props":235,"children":236},{},[237],{"type":52,"value":238},"4",{"type":47,"tag":154,"props":240,"children":241},{},[242],{"type":52,"value":243},"Schema Design",{"type":47,"tag":154,"props":245,"children":246},{},[247],{"type":52,"value":248},"HIGH",{"type":47,"tag":154,"props":250,"children":251},{},[252],{"type":47,"tag":173,"props":253,"children":255},{"className":254},[],[256],{"type":52,"value":257},"schema-",{"type":47,"tag":122,"props":259,"children":260},{},[261,266,271,276],{"type":47,"tag":154,"props":262,"children":263},{},[264],{"type":52,"value":265},"5",{"type":47,"tag":154,"props":267,"children":268},{},[269],{"type":52,"value":270},"Concurrency & Locking",{"type":47,"tag":154,"props":272,"children":273},{},[274],{"type":52,"value":275},"MEDIUM-HIGH",{"type":47,"tag":154,"props":277,"children":278},{},[279],{"type":47,"tag":173,"props":280,"children":282},{"className":281},[],[283],{"type":52,"value":284},"lock-",{"type":47,"tag":122,"props":286,"children":287},{},[288,293,298,303],{"type":47,"tag":154,"props":289,"children":290},{},[291],{"type":52,"value":292},"6",{"type":47,"tag":154,"props":294,"children":295},{},[296],{"type":52,"value":297},"Data Access Patterns",{"type":47,"tag":154,"props":299,"children":300},{},[301],{"type":52,"value":302},"MEDIUM",{"type":47,"tag":154,"props":304,"children":305},{},[306],{"type":47,"tag":173,"props":307,"children":309},{"className":308},[],[310],{"type":52,"value":311},"data-",{"type":47,"tag":122,"props":313,"children":314},{},[315,320,325,330],{"type":47,"tag":154,"props":316,"children":317},{},[318],{"type":52,"value":319},"7",{"type":47,"tag":154,"props":321,"children":322},{},[323],{"type":52,"value":324},"Monitoring & Diagnostics",{"type":47,"tag":154,"props":326,"children":327},{},[328],{"type":52,"value":329},"LOW-MEDIUM",{"type":47,"tag":154,"props":331,"children":332},{},[333],{"type":47,"tag":173,"props":334,"children":336},{"className":335},[],[337],{"type":52,"value":338},"monitor-",{"type":47,"tag":122,"props":340,"children":341},{},[342,347,352,357],{"type":47,"tag":154,"props":343,"children":344},{},[345],{"type":52,"value":346},"8",{"type":47,"tag":154,"props":348,"children":349},{},[350],{"type":52,"value":351},"Advanced Features",{"type":47,"tag":154,"props":353,"children":354},{},[355],{"type":52,"value":356},"LOW",{"type":47,"tag":154,"props":358,"children":359},{},[360],{"type":47,"tag":173,"props":361,"children":363},{"className":362},[],[364],{"type":52,"value":365},"advanced-",{"type":47,"tag":61,"props":367,"children":369},{"id":368},"how-to-use",[370],{"type":52,"value":371},"How to Use",{"type":47,"tag":55,"props":373,"children":374},{},[375],{"type":52,"value":376},"Read individual rule files for detailed explanations and SQL examples:",{"type":47,"tag":378,"props":379,"children":383},"pre",{"className":380,"code":382,"language":52},[381],"language-text","references\u002Fquery-missing-indexes.md\nreferences\u002Fquery-partial-indexes.md\nreferences\u002F_sections.md\n",[384],{"type":47,"tag":173,"props":385,"children":387},{"__ignoreMap":386},"",[388],{"type":52,"value":382},{"type":47,"tag":55,"props":390,"children":391},{},[392],{"type":52,"value":393},"Each rule file contains:",{"type":47,"tag":73,"props":395,"children":396},{},[397,402,407,412,417,422],{"type":47,"tag":77,"props":398,"children":399},{},[400],{"type":52,"value":401},"Brief explanation of why it matters",{"type":47,"tag":77,"props":403,"children":404},{},[405],{"type":52,"value":406},"Incorrect SQL example with explanation",{"type":47,"tag":77,"props":408,"children":409},{},[410],{"type":52,"value":411},"Correct SQL example with explanation",{"type":47,"tag":77,"props":413,"children":414},{},[415],{"type":52,"value":416},"Optional EXPLAIN output or metrics",{"type":47,"tag":77,"props":418,"children":419},{},[420],{"type":52,"value":421},"Additional context and references",{"type":47,"tag":77,"props":423,"children":424},{},[425],{"type":52,"value":426},"Supabase-specific notes (when applicable)",{"type":47,"tag":61,"props":428,"children":430},{"id":429},"references",[431],{"type":52,"value":432},"References",{"type":47,"tag":73,"props":434,"children":435},{},[436,447,456,465,474],{"type":47,"tag":77,"props":437,"children":438},{},[439],{"type":47,"tag":440,"props":441,"children":445},"a",{"href":442,"rel":443},"https:\u002F\u002Fwww.postgresql.org\u002Fdocs\u002Fcurrent\u002F",[444],"nofollow",[446],{"type":52,"value":442},{"type":47,"tag":77,"props":448,"children":449},{},[450],{"type":47,"tag":440,"props":451,"children":454},{"href":452,"rel":453},"https:\u002F\u002Fsupabase.com\u002Fdocs",[444],[455],{"type":52,"value":452},{"type":47,"tag":77,"props":457,"children":458},{},[459],{"type":47,"tag":440,"props":460,"children":463},{"href":461,"rel":462},"https:\u002F\u002Fwiki.postgresql.org\u002Fwiki\u002FPerformance_Optimization",[444],[464],{"type":52,"value":461},{"type":47,"tag":77,"props":466,"children":467},{},[468],{"type":47,"tag":440,"props":469,"children":472},{"href":470,"rel":471},"https:\u002F\u002Fsupabase.com\u002Fdocs\u002Fguides\u002Fdatabase\u002Foverview",[444],[473],{"type":52,"value":470},{"type":47,"tag":77,"props":475,"children":476},{},[477],{"type":47,"tag":440,"props":478,"children":481},{"href":479,"rel":480},"https:\u002F\u002Fsupabase.com\u002Fdocs\u002Fguides\u002Fauth\u002Frow-level-security",[444],[482],{"type":52,"value":479},{"items":484,"total":528},[485,506,513],{"slug":8,"name":8,"fn":486,"description":487,"org":488,"tags":489,"stars":23,"repoUrl":24,"updatedAt":505},"build applications with 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\u002Fssr) 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).",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[490,493,494,497,498,501,504],{"name":491,"slug":492,"type":15},"Auth","auth",{"name":18,"slug":19,"type":15},{"name":495,"slug":496,"type":15},"Edge Functions","edge-functions",{"name":21,"slug":22,"type":15},{"name":499,"slug":500,"type":15},"Realtime","realtime",{"name":502,"slug":503,"type":15},"Storage","storage",{"name":9,"slug":8,"type":15},"2026-04-06T17:55:02.34554",{"slug":4,"name":4,"fn":5,"description":6,"org":507,"tags":508,"stars":23,"repoUrl":24,"updatedAt":25},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[509,510,511,512],{"name":18,"slug":19,"type":15},{"name":13,"slug":14,"type":15},{"name":21,"slug":22,"type":15},{"name":9,"slug":8,"type":15},{"slug":514,"name":514,"fn":515,"description":516,"org":517,"tags":518,"stars":525,"repoUrl":526,"updatedAt":527},"supabase-server","write server-side code with Supabase","Use when planning or writing server-side code that uses `@supabase\u002Fserver` — Edge Functions, Hono apps, webhook handlers, or any backend that creates Supabase clients or validates inbound auth. Trigger **before** writing or modifying any file that imports from `@supabase\u002Fserver` (or sub-paths like `@supabase\u002Fserver\u002Fcore`); calls `withSupabase`, `createSupabaseContext`, `createAdminClient`, `createContextClient`, `verifyAuth`, `verifyCredentials`, or `extractCredentials`; configures an `auth:` mode (`'none'` | `'publishable'` | `'secret'` | `'user'`, or keyed variants like `'secret:*'`); or lives under `supabase\u002Ffunctions\u002F` and authenticates an inbound request. Also trigger during planning — if a plan mentions any of the above, load the skill before drafting code; do not extrapolate `auth:` values or auth modes from neighboring functions. Also trigger when you see legacy patterns to migrate to this package — `Deno.serve`, `createClient(Deno.env.get('SUPABASE_URL'))`, imports from `esm.sh\u002F@supabase` or `deno.land\u002Fstd`, usage of `SUPABASE_ANON_KEY` \u002F `SUPABASE_SERVICE_ROLE_KEY`, or the deprecated `allow:` config option \u002F removed `'always'` \u002F `'public'` mode values \u002F removed `authType` field.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[519,520,523,524],{"name":491,"slug":492,"type":15},{"name":521,"slug":522,"type":15},"Backend","backend",{"name":495,"slug":496,"type":15},{"name":9,"slug":8,"type":15},83,"https:\u002F\u002Fgithub.com\u002Fsupabase\u002Fserver","2026-07-17T05:33:41.457911",3,{"items":530,"total":548},[531,541],{"slug":8,"name":8,"fn":486,"description":487,"org":532,"tags":533,"stars":23,"repoUrl":24,"updatedAt":505},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[534,535,536,537,538,539,540],{"name":491,"slug":492,"type":15},{"name":18,"slug":19,"type":15},{"name":495,"slug":496,"type":15},{"name":21,"slug":22,"type":15},{"name":499,"slug":500,"type":15},{"name":502,"slug":503,"type":15},{"name":9,"slug":8,"type":15},{"slug":4,"name":4,"fn":5,"description":6,"org":542,"tags":543,"stars":23,"repoUrl":24,"updatedAt":25},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[544,545,546,547],{"name":18,"slug":19,"type":15},{"name":13,"slug":14,"type":15},{"name":21,"slug":22,"type":15},{"name":9,"slug":8,"type":15},2]