Supabase Postgres Best Practices
supabase/agent-skills
Gives the agent Postgres rules to consult before writing or changing tables, queries, indexes, RLS policies or migrations, and when diagnosing slow queries.
Agent skill
by jeremylongshore in jeremylongshore/tons-of-skills-marketplace
Design Supabase Postgres schema from business requirements with migrations, RLS, and types.
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill supabase-schema-from-requirements -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install jeremylongshore/tons-of-skills-marketplace supabase-schema-from-requirements --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/.curated/supabase-schema-from-requirements .claude/skills/supabase-schema-from-requirements && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "supabase-schema-from-requirements" agent skill from https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/main/skills/.curated/supabase-schema-from-requirements into .claude/skills/supabase-schema-from-requirements/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "supabase-schema-from-requirements", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/main/skills/.curated/supabase-schema-from-requirementsType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill supabase-schema-from-requirements -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install jeremylongshore/tons-of-skills-marketplace supabase-schema-from-requirements --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/.curated/supabase-schema-from-requirements .agents/skills/supabase-schema-from-requirements && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "supabase-schema-from-requirements" agent skill from https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/main/skills/.curated/supabase-schema-from-requirements into .agents/skills/supabase-schema-from-requirements/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "supabase-schema-from-requirements", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill supabase-schema-from-requirements -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install jeremylongshore/tons-of-skills-marketplace supabase-schema-from-requirements --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/.curated/supabase-schema-from-requirements .cursor/skills/supabase-schema-from-requirements && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "supabase-schema-from-requirements" agent skill from https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/main/skills/.curated/supabase-schema-from-requirements into .cursor/skills/supabase-schema-from-requirements/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "supabase-schema-from-requirements", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/jeremylongshore/tons-of-skills-marketplace.git --path skills/.curated/supabase-schema-from-requirements--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill supabase-schema-from-requirements -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install jeremylongshore/tons-of-skills-marketplace supabase-schema-from-requirements --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/.curated/supabase-schema-from-requirements .gemini/skills/supabase-schema-from-requirements && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "supabase-schema-from-requirements" agent skill from https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/main/skills/.curated/supabase-schema-from-requirements into .gemini/skills/supabase-schema-from-requirements/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "supabase-schema-from-requirements", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install jeremylongshore/tons-of-skills-marketplace supabase-schema-from-requirementsInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill supabase-schema-from-requirements -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/.curated/supabase-schema-from-requirements .github/skills/supabase-schema-from-requirements && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "supabase-schema-from-requirements" agent skill from https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/main/skills/.curated/supabase-schema-from-requirements into .github/skills/supabase-schema-from-requirements/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "supabase-schema-from-requirements", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill supabase-schema-from-requirements -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install jeremylongshore/tons-of-skills-marketplace supabase-schema-from-requirements --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/.curated/supabase-schema-from-requirements .opencode/skills/supabase-schema-from-requirements && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "supabase-schema-from-requirements" agent skill from https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/main/skills/.curated/supabase-schema-from-requirements into .opencode/skills/supabase-schema-from-requirements/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "supabase-schema-from-requirements", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
supabase-schema-from-requirementsDesign Supabase Postgres schema from business requirements with migrations, RLS, and types.
Supabase Schema From Requirements is an agent skill from jeremylongshore/tons-of-skills-marketplace. Design Supabase Postgres schema from business requirements with migrations, RLS, and types. Use when translating specifications into database tables, creating migration files, adding Row Level Security policies, or generating TypeScript types from schema. Trigger with phrases like "supabase schema", "design database supabase", "schema from requirements", "supabase migration", "supabase tables from spec".
Its SKILL.md is about 1.8k tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including reference files (for example `references/rls-policies.md`, `references/typescript-client.md` and `references/worked-schema-examples.md`). Compatibility notes: Designed for Claude Code
It sits in Databases, covering PRD writing, Type safety and Translation. It works with Supabase and PostgreSQL. The repository describes itself as: Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com. The licence is MIT.
3 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit cfae287. It shows what the files ask for, not the result of running them.
Pre-approves these tools, so the agent can use them without asking each time:
ReadWriteBash(supabase:*)Bash(npx:*)From allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
npxsupabasenpmFrom the folder's file list and the shell code blocks in SKILL.md.
Links to these hosts (documentation or services it may open):
supabase.compostgresql.orgFrom URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Designed for Claude Code
From compatibility in the SKILL.md frontmatter.
Supabase Schema From Requirements loads about 1.8k tokens when it runs, and up to ~4.3k if it reads all its reference files. Until then it costs about 110 tokens; SKILL.md has 652 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from jeremylongshore/tons-of-skills-marketplace at commit cfae287, republished under its MIT licence (© jeremylongshore). 652 words, ~1,836 tokens.
.claude/skills/supabase-schema-from-requirements/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.Translate business requirements into a production-ready Postgres schema inside Supabase, covering the full path from specification to applied migration: entity extraction, tables with proper types and constraints, Row Level Security policies, performance indexes, timestamp triggers, and TypeScript type generation. Getting this right early matters because every downstream feature — auth, storage, realtime, edge functions — depends on well-designed tables.
npm install -g supabase) and project linked (supabase link)@supabase/supabase-js v2+ installed in the projectsupabase start) or a linked remote projectRead the requirements document and extract entities, attributes, relationships, and access control rules. Map each entity to a Postgres table.
Entity extraction example (project management app):
| Entity | Key Columns | Relationships |
|---|---|---|
| Organization | name, slug, plan | has many Projects, has many Members |
| Project | name, description, status | belongs to Organization, has many Tasks |
| Task | title, priority, status, due_date | belongs to Project, assigned to User |
| Member | role (owner/admin/member) | junction linking User to Organization |
Create the migration file:
npx supabase migration new create_tables
# Creates: supabase/migrations/TIMESTAMP_create_tables.sqlWrite the migration SQL using standard Postgres data types (uuid, text, integer, boolean, timestamptz, jsonb):
Full worked migration (project-management app — tables, FKs, indexes, moddatetime triggers): references/worked-schema-examples.md.
Data type selection guide:
| Use case | Type | Notes |
|---|---|---|
| Primary keys | uuid | Always with uuid_generate_v4() default |
| Names, titles | text | Prefer over varchar in Postgres |
| Counts, ranks | integer | Use bigint for sequences |
| Flags | boolean | Default explicitly to true or false |
| Timestamps | timestamptz | Never use timestamp without timezone |
| Flexible data | jsonb | Queryable JSON; use for settings, metadata |
| Lists | text[] | Postgres arrays for simple tags or labels |
Every table exposed to the client must have RLS enabled. Write reusable security definer helper functions first, then write per-table policies that call them. The
skeleton for one table:
alter table public.organizations enable row level security;
create policy "Users read own orgs"
on public.organizations for select
using (public.is_org_member(id));The full worked policy set — the is_org_member / is_org_admin helper functions and
every select/insert/update/delete policy across organizations, members, projects, and
tasks — is in references/rls-policies.md. Name policies
after who and what action ("Admins manage members", "Assignee updates tasks").
# Apply migration locally
npx supabase db reset
# Or push to a linked remote project
npx supabase db push
# Generate TypeScript types from the live schema
npx supabase gen types typescript --local > types/supabase.tsPass the generated Database type as the generic parameter to createClient (see
import type { Database } from './types/supabase') for end-to-end type safety on every
query. Full typed-client walkthrough — typed inserts, foreign-key joins, nested multi-table
joins, and an RLS-enforcement check — is in
references/typescript-client.md.
supabase/migrations/ with all tables, constraints, and indexesis_org_member, is_org_admin) for reusable authorization checksmoddatetime triggers for automatic updated_at managementtypes/supabase.ts for type-safe client queries| Error | Cause | Solution |
|---|---|---|
42P07: relation already exists | Table name collision in migration | Use create table if not exists or rename the table |
23503: foreign key violation | Insert references a nonexistent parent row | Insert parent rows first, or check the UUID |
42501: insufficient privilege | RLS helper function permissions | Add security definer to the function definition |
42883: function uuid_generate_v4() does not exist | Extension not enabled | Add create extension if not exists "uuid-ossp" |
supabase db push succeeds but tables missing | Migration was already recorded | Check supabase_migrations.schema_migrations and repair |
PGRST204: column not found | TypeScript types out of sync | Re-run npx supabase gen types typescript --local > types/supabase.ts |
new row violates row-level security | RLS policy blocks the operation | Verify auth.uid() matches expected value; check policy using clause |
moddatetime trigger fails | Extension not enabled | Add create extension if not exists "moddatetime" at top of migration |
E-commerce schema (different domain, same pattern). The complete e-commerce migration SQL — stores, products, orders, order_items with FKs and indexes — is in references/worked-schema-examples.md, and the matching typed client queries are in references/typescript-client.md.
For auth integration, file storage, and realtime subscriptions on top of this schema, proceed to supabase-auth-storage-realtime-core.
© jeremylongshore, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 3 other files (references) in skills/.curated/supabase-schema-from-requirements of jeremylongshore/tons-of-skills-marketplace.
Open the folder on GitHubat commit cfae287
Supabase Schema From Requirements next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Supabase Schema From Requirements this skilljeremylongshore/tons-of-skills-marketplace | 2.8k | — | ~1.8k | Automated safety check: Pass | MIT | |
| Supabase Postgres Best Practicessupabase/agent-skills | 2.7k | 24 repos | ~808 | Automated safety check: Pass | MIT | |
| Expert DatabaseReJeCtAll/ExpertTeam-Codex | 113 | — | ~692 | Automated safety check: Pass | MIT | |
| Database Domain Specialistmodu-ai/moai-adk | 1.2k | — | ~2.8k | Automated safety check: Pass | Apache-2.0 | |
| Postgres Patternsaffaan-m/ECC | 276k | — | ~1k | Automated safety check: Pass | MIT | |
| Memstack Security Rls Guardiancwinvestments/memstack | 423 | — | ~3.4k | Automated safety check: Pass | Proprietary |
supabase/agent-skills
Gives the agent Postgres rules to consult before writing or changing tables, queries, indexes, RLS policies or migrations, and when diagnosing slow queries.
ReJeCtAll/ExpertTeam-Codex
数据库优化专家入口。用于 Codex CLI 的 $expert-database 调用. An agent skill from ReJeCtAll/ExpertTeam-Codex.
modu-ai/moai-adk
Database guidance for PostgreSQL, MongoDB, Redis and Oracle plus Neon, Supabase and Firestore: schema design, indexing, query tuning and cloud database choice.
affaan-m/ECC
PostgreSQL database patterns for query optimization, schema design, indexing, and security.
cwinvestments/memstack
A skill your agent uses when creating or altering database tables in Supabase or PostgreSQL projects.
ericrisco/rsc-harness
A skill your agent uses when building on Firebase — Firestore data modeling, Security Rules, Auth and custom claims, Cloud Functions, Storage, modular Web/Admin SDK imports — including symptoms like…
jeremylongshore/tons-of-skills-marketplace
Execute this skill enables AI assistant to conduct a security-focused code review using the security-agent plugin.
jeremylongshore/tons-of-skills-marketplace
Build this skill automates the adaptation of pre-trained machine learning models using transfer learning techniques.
jeremylongshore/tons-of-skills-marketplace
Execute proactive auto-loading: automatically detects and loads agents.md files.
jeremylongshore/tons-of-skills-marketplace
Aggregate and centralize performance metrics from applications, systems, databases, caches, and services.
jeremylongshore/tons-of-skills-marketplace
Execute this skill enables AI assistant to analyze capacity requirements and plan for future growth.
jeremylongshore/tons-of-skills-marketplace
Process use when you need to work with database indexing. An agent skill from jeremylongshore/tons-of-skills-marketplace.
Works with
Design Supabase Postgres schema from business requirements with migrations, RLS, and types. Supabase Schema From Requirements is an agent skill from jeremylongshore/tons-of-skills-marketplace. Design Supabase Postgres schema from business requirements with migrations, RLS, and types.
Supabase Schema From Requirements fits situations like: translating specifications into database tables; creating migration files; adding Row Level Security policies; generating TypeScript types from schema.
Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill supabase-schema-from-requirements -a claude-code`. Or copy the skill folder (skills/.curated/supabase-schema-from-requirements in jeremylongshore/tons-of-skills-marketplace) into .claude/skills/supabase-schema-from-requirements in your project. Claude Code loads it when a task matches its description.
Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill supabase-schema-from-requirements -a codex`. Or copy the skill folder (skills/.curated/supabase-schema-from-requirements in jeremylongshore/tons-of-skills-marketplace) into .agents/skills/supabase-schema-from-requirements in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill supabase-schema-from-requirements -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/supabase-schema-from-requirements, .gemini/skills/supabase-schema-from-requirements, .github/skills/supabase-schema-from-requirements and .opencode/skills/supabase-schema-from-requirements in your project.
Going by SKILL.md and its folder, Supabase Schema From Requirements needs the command-line tools its instructions call (npx, supabase and npm). Our summary lists: Node.js. Its frontmatter pre-approves these tools: Read, Write, Bash(supabase:*), Bash(npx:*). Compatibility (from SKILL.md): Designed for Claude Code.
SKILL.md names 2 domains. As links in the text: supabase.com and postgresql.org. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Supabase Schema From Requirements is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.8k tokens (SKILL.md is roughly 7.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2.4k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Supabase Schema From Requirements: Supabase Postgres Best Practices (supabase/agent-skills, 2.7k stars), Expert Database (ReJeCtAll/ExpertTeam-Codex, 113 stars), Database Domain Specialist (modu-ai/moai-adk, 1.2k stars) and Postgres Patterns (affaan-m/ECC, 276k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
jeremylongshore (a GitHub user) maintains it in jeremylongshore/tons-of-skills-marketplace, which has 2,827 GitHub stars. The repository holds 3,342 skills in this directory. The repository was last updated on October 10, 2026.
Source: jeremylongshore/tons-of-skills-marketplace on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.