postgres-supabase-expert

Guides schema design, RLS policies, and query optimization for PostgreSQL and Supabase databases.

Updated May 12, 2026
One-click install
npx skills add https://github.com/laionazeredo/che-ai --skill postgres-supabase-expert-laionazeredo
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: postgres-supabase-expert
Source: https://github.com/laionazeredo/che-ai/tree/main/skills/postgres-supabase-expert
Command: npx skills add https://github.com/laionazeredo/che-ai --skill postgres-supabase-expert-laionazeredo

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Designing secure and performant PostgreSQL or Supabase databases requires deep knowledge of schema normalization, Row Level Security, indexing strategies, and migration workflows. This Skill encodes those rules so agents produce compliant database designs without missing critical security gates like RLS enforcement. ## Core Features & Use Cases - Schema Design Rules: Enforces 3NF normalization, correct data types (UUID, TIMESTAMPTZ, JSONB), constraints, and index selection (B-tree, GIN, BRIN). - RLS Security Enforcement: Mandates ENABLE ROW LEVEL SECURITY on every new table, per-role policies, auth.uid() default-deny patterns, and documented exceptions for lookup tables. - Performance & Supabase Platform Guidance: Covers EXPLAIN ANALYZE, connection pooling with Supavisor/PgBouncer, keyset pagination, Edge Functions, Realtime, Storage, and CLI-based migrations. - Use Case: When adding a new tickets table to a Supabase project, the Skill ensures the migration enables RLS, defines organizer/admin policies, and adds an RLS acceptance criterion to the spec for QA validation. ## Quick Start Ask the agent to design a new Supabase table with RLS policies and an optimized migration following the postgres-supabase-expert rules.

Frequently Asked Questions about postgres-supabase-expert

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enable Row Level Security on a new Supabase table?▼

Add ALTER TABLE <schema>.<table> ENABLE ROW LEVEL SECURITY directly in the migration for every new table. Then define explicit per-role policies such as organizer_select_policy, since a table with RLS enabled but zero policies denies all reads and writes by default.

How do I write a secure RLS policy in Supabase?▼

Start every policy with the auth.uid() = <owner_column> default-deny pattern, then layer admin or organization overrides on top. Never write a policy that is true for the anon role unless the table is a genuinely public lookup table with a documented exception.

Which index type should I use in PostgreSQL for JSONB columns?▼

Use a GIN index for JSONB and array columns, B-tree for equality and range queries, and BRIN for large sequential datasets. Always verify query plans with EXPLAIN ANALYZE to confirm the index is actually used.

Does this RLS guidance apply to MySQL or MongoDB?▼

No. The RLS rules apply only to PostgreSQL and Supabase. Do not use RLS syntax on MySQL, SQLite, MongoDB, or Cassandra; those databases require different access-control approaches referenced separately in engineering contracts.

When can a table skip Row Level Security in Supabase?▼

Only pure lookup tables such as enum references or immutable public seed data may skip RLS. The exception must be documented in the spec's Non-Goals, logged with user approval in decisions.log.jsonl, and noted in the migration.

How do I paginate large PostgreSQL tables efficiently?▼

Prefer keyset (cursor-based) pagination over OFFSET for large datasets, since OFFSET scans and discards rows as offsets grow. Combine this with EXPLAIN ANALYZE monitoring and connection pooling via Supavisor or PgBouncer for high-concurrency workloads.