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.
Provision and operate Supabase Postgres for this project — creating the project, picking the right connection string for each job, local CLI workflow, migrations, generated types, RLS policies, and…
$ npx skills add textura-agency/next16-claude-starter --skill supabase-db -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install textura-agency/next16-claude-starter supabase-db --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/textura-agency/next16-claude-starter.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/supabase-db .claude/skills/supabase-db && 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-db" agent skill from https://github.com/textura-agency/next16-claude-starter/tree/main/.claude/skills/supabase-db into .claude/skills/supabase-db/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "supabase-db", 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/textura-agency/next16-claude-starter/tree/main/.claude/skills/supabase-dbType 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 textura-agency/next16-claude-starter --skill supabase-db -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install textura-agency/next16-claude-starter supabase-db --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/textura-agency/next16-claude-starter.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.claude/skills/supabase-db .agents/skills/supabase-db && 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-db" agent skill from https://github.com/textura-agency/next16-claude-starter/tree/main/.claude/skills/supabase-db into .agents/skills/supabase-db/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "supabase-db", 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 textura-agency/next16-claude-starter --skill supabase-db -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install textura-agency/next16-claude-starter supabase-db --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/textura-agency/next16-claude-starter.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.claude/skills/supabase-db .cursor/skills/supabase-db && 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-db" agent skill from https://github.com/textura-agency/next16-claude-starter/tree/main/.claude/skills/supabase-db into .cursor/skills/supabase-db/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "supabase-db", 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/textura-agency/next16-claude-starter.git --path .claude/skills/supabase-db--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 textura-agency/next16-claude-starter --skill supabase-db -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install textura-agency/next16-claude-starter supabase-db --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/textura-agency/next16-claude-starter.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.claude/skills/supabase-db .gemini/skills/supabase-db && 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-db" agent skill from https://github.com/textura-agency/next16-claude-starter/tree/main/.claude/skills/supabase-db into .gemini/skills/supabase-db/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "supabase-db", 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 textura-agency/next16-claude-starter supabase-dbInstalls 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 textura-agency/next16-claude-starter --skill supabase-db -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/textura-agency/next16-claude-starter.git skills-src && mkdir -p .github/skills && cp -r skills-src/.claude/skills/supabase-db .github/skills/supabase-db && 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-db" agent skill from https://github.com/textura-agency/next16-claude-starter/tree/main/.claude/skills/supabase-db into .github/skills/supabase-db/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "supabase-db", 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 textura-agency/next16-claude-starter --skill supabase-db -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install textura-agency/next16-claude-starter supabase-db --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/textura-agency/next16-claude-starter.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.claude/skills/supabase-db .opencode/skills/supabase-db && 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-db" agent skill from https://github.com/textura-agency/next16-claude-starter/tree/main/.claude/skills/supabase-db into .opencode/skills/supabase-db/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "supabase-db", 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-dbProvision and operate Supabase Postgres for this project — creating the project, picking the right connection string for each job, local CLI workflow, migrations, generated types, RLS policies, and…
Supabase DB is an agent skill from textura-agency/next16-claude-starter. Provision and operate Supabase Postgres for this project — creating the project, picking the right connection string for each job, local CLI workflow, migrations, generated types, RLS policies, and storage buckets. Use when the user asks to "set up the database", "add Supabase", "write a migration", "add RLS", "connect Payload to Supabase", or hits pooler/prepared-statement errors.
Its SKILL.md is about 1.4k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Databases. It works with Supabase and PostgreSQL. The repository describes itself as: AI-first Next.js 16 starter for animation-heavy sites, wired with an Obsidian vault & Claude Code hooks. The licence is Unlicense.
7 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 6c6edf9. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
supabasebrewFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md. Its commands use supabase, which can reach the network depending on how they are called.
From URLs in SKILL.md, links to its own repository left out.
Names these keys or tokens, usually read from environment variables:
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEYFrom names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Supabase DB loads about 1.4k tokens when it runs. Until then it costs about 99 tokens; SKILL.md has 553 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 textura-agency/next16-claude-starter at commit 6c6edf9, republished under its Unlicense licence (© textura-agency). 553 words, ~1,359 tokens.
.claude/skills/supabase-db/SKILL.md (or your agent's skills folder).Supabase is the database for this project. In a Payload build it is Payload's Postgres; in a bespoke build it is queried directly. Either way the connection rules below are what break first.
Verified 2026-08 against @supabase/supabase-js 2.112, @supabase/ssr 0.12.
Supabase hands you several strings. They are not interchangeable.
| Job | Connection | Port | Why |
|---|---|---|---|
| App runtime on serverless / Fluid Compute | Supavisor transaction | 6543 | many short-lived connections |
Migrations, payload migrate, psql, pg_dump | Direct | 5432 | needs session state + DDL |
| Long-lived Node server, IPv4-only network | Supavisor session | 5432 | pooled but session-safe |
Two traps:
prepared statement "s0" already exists, or intermittent failures under load.
Disable prepared statements in the client for that URL.Store both: DATABASE_URL (6543, runtime) and DATABASE_URL_DIRECT (5432,
migrations). Wire both into src/env.ts as server-only zod-validated vars.
Legacy anon / service_role JWTs are being retired (end of 2026). Use:
sb_publishable_… → NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY.
Browser-safe only because RLS is enforced. It is not a secret, but it is
also not protection.sb_secret_… → server-only, via getServerEnv(). Bypasses RLS
entirely. Never NEXT_PUBLIC_, never import into a client component, never
log it. Supabase now 401s a secret key sent from a browser user-agent, but do
not rely on that as your control.brew install supabase/tap/supabase # or npx supabase
supabase init # creates supabase/
supabase link --project-ref <ref>
supabase start # local Postgres + Studio in Docker
supabase db pull # snapshot remote schema into a migration
supabase migration new <name> # hand-written SQL migration
supabase db push # apply migrations to the linked project
supabase gen types typescript --linked > src/types/database.tsNever point local dev at the production database. A schema push — Payload's or the CLI's — will rewrite it. Use a separate project or a Supabase branch.
If Payload owns the schema, Payload owns migrations (payload generate:migrations)
and the Supabase CLI is only used for things outside Payload's tables: RLS on your
own tables, extensions, functions, storage policies. Do not let both tools
generate migrations for the same tables.
Every table holding user or tenant data gets RLS enabled plus at least one policy. A table with RLS enabled and no policy denies everything; a table without RLS is readable by anyone holding the publishable key.
alter table public.submissions enable row level security;
create policy "insert own submissions"
on public.submissions for insert to authenticated
with check ((select auth.uid()) = user_id);
create policy "read own submissions"
on public.submissions for select to authenticated
using ((select auth.uid()) = user_id);auth.uid() in (select …) so Postgres caches it per statement instead of
per row — the single biggest RLS performance win on large tables.user_id, tenant_id).to authenticated) — an unqualified policy also applies
to anon.Buckets are private by default — keep it that way for anything user-supplied.
For Payload media, use the S3-compatible endpoint with forcePathStyle: true
(see the payload-cms skill). For direct use, prefer signed URLs over public
buckets, and write storage policies the same way as table policies.
select * from pg_policies where schemaname = 'public'; — every user-data table
appears, with the intended roles.grep -rn "sb_secret" src/ returns nothing outside src/env.ts usage..env.example updated; src/env.ts zod schema updated.obsidian/backend/database-supabase.md, obsidian/architecture/environment-variables.md,
obsidian/architecture/tech-stack.md, obsidian/meta/changelog.md.
© textura-agency, Unlicense. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in .claude/skills/supabase-db of textura-agency/next16-claude-starter.
Open the folder on GitHubat commit 6c6edf9
Supabase DB 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 DB this skilltextura-agency/next16-claude-starter | 133 | — | ~1.4k | Automated safety check: Pass | Unlicense | |
| Supabase Postgres Best Practicessupabase/agent-skills | 2.7k | 24 repos | ~808 | Automated safety check: Pass | MIT | |
| Clickhouse Logs Queriessupabase/supabase | 111k | — | ~2.4k | Automated safety check: Pass | Apache-2.0 | |
| Safe SQL Executionsupabase/supabase | 111k | — | ~4.2k | Automated safety check: Pass | Apache-2.0 | |
| Add Backendahpxex/open-dashboard | 146 | — | ~3.6k | Automated safety check: Pass | MIT | |
| Take Doc Screenshotspgplex/pgconsole | 155 | — | ~841 | Automated safety check: Pass | Apache-2.0 |
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.
supabase/supabase
Write, review, and migrate Supabase logs queries against the ClickHouse-backed logs table (the logs.all.otel analytics endpoint).
supabase/supabase
A skill your agent uses whenever code will build, return, fetch, or execute SQL that runs against a user's real Postgres database — even when the request reads like an ordinary feature or bug fix…
ahpxex/open-dashboard
Everything about the data layer — pick one of six ready-to-run backend templates (TanStack Start + Drizzle + better-auth, Hono + Drizzle + better-auth, Hono + Prisma + better-auth, Hono + Drizzle +…
pgplex/pgconsole
Take screenshots of the running pgconsole app for documentation.
t1mmen/srtd
Expert knowledge for developing the SRTD codebase itself. An agent skill from t1mmen/srtd.
textura-agency/next16-claude-starter
Make a site behave on real phones — the defects no Lighthouse run or headless scroll test sees, learned from site owners reviewing production sites on an iPhone.
textura-agency/next16-claude-starter
Get a page into Lighthouse's green zone on desktop and mobile, for people AND for the robot form crawlers get — build it, audit all four categories (Performance, Accessibility, Best Practices, SEO)…
textura-agency/next16-claude-starter
Make a page in this starter actually smooth — build it, scroll it in real Chrome on PC and on an emulated phone, fix what the measurement blames, re-measure to prove it.
textura-agency/next16-claude-starter
Make a Payload admin feel like part of the site and explain itself — the skin re-tinted from the site's own tokens (calm, light, no added motion), the site's wordmark and favicon, a dashboard…
textura-agency/next16-claude-starter
Put a Payload CMS admin on a site built from this starter — every visible string and content photo editable, derived from the site's own content objects with the code's copy as the fallback, a…
textura-agency/next16-claude-starter
Answer Engine Optimisation — make the site citable by ChatGPT, Claude, Perplexity, Gemini and AI Overviews.
Works with
Categories
Provision and operate Supabase Postgres for this project — creating the project, picking the right connection string for each job, local CLI workflow, migrations, generated types, RLS policies, and…. Supabase DB is an agent skill from textura-agency/next16-claude-starter. Provision and operate Supabase Postgres for this project — creating the project, picking the right connection string for each job, local CLI workflow, migrations, generated types, RLS policies, and storage buckets.
Supabase DB fits situations like: the user asks to set up the database; write a migration; connect Payload to Supabase; hits pooler/prepared-statement errors.
Run `npx skills add textura-agency/next16-claude-starter --skill supabase-db -a claude-code`. Or copy the skill folder (.claude/skills/supabase-db in textura-agency/next16-claude-starter) into .claude/skills/supabase-db in your project. Claude Code loads it when a task matches its description.
Run `npx skills add textura-agency/next16-claude-starter --skill supabase-db -a codex`. Or copy the skill folder (.claude/skills/supabase-db in textura-agency/next16-claude-starter) into .agents/skills/supabase-db 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 textura-agency/next16-claude-starter --skill supabase-db -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-db, .gemini/skills/supabase-db, .github/skills/supabase-db and .opencode/skills/supabase-db in your project.
Going by SKILL.md and its folder, Supabase DB needs the command-line tools its instructions call (supabase and brew) and credentials named NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY. Our summary lists: Node.js; Docker; A credential in NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. 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 DB is published under the Unlicense licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.4k tokens (SKILL.md is roughly 5.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Supabase DB: Supabase Postgres Best Practices (supabase/agent-skills, 2.7k stars), Clickhouse Logs Queries (supabase/supabase, 111k stars), Safe SQL Execution (supabase/supabase, 111k stars) and Add Backend (ahpxex/open-dashboard, 146 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
textura-agency (a GitHub organization) maintains it in textura-agency/next16-claude-starter, which has 133 GitHub stars. The repository holds 16 skills in this directory. The repository was last updated on October 7, 2026.
Source: textura-agency/next16-claude-starter on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.