supabase-database

supabase-database is a skill for Claude Code, Codex from monkilabs/opencastle. It costs 41 tokens per session (520 once invoked), scanned A, original, MIT.

Database guidance for Supabase, a hosted platform built around PostgreSQL with authentication and access rules. It covers database migrations, row-level security policies, authentication, and generated TypeScript types.

In plain words
What is it for?
Use it to create tables and migrations, protect rows by user or role, connect authentication to database access, and generate types for application code.
Why use it?
It helps prevent accidental data exposure or blocked access caused by incorrect row-level security policies. It also provides a safer process for changing schemas and checking access for different user roles.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to create tables and migrations, protect rows by user or role, connect authentication to database access, and generate types for application code.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/monkilabs/opencastle/supabase-database
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add monkilabs/opencastle --skill supabase-database
Clone the repo
git clone --depth 1 https://github.com/monkilabs/opencastle

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for supabase-database

README.md
[![agentmods](https://agentmods.dev/badge/skills/monkilabs/opencastle/supabase-database/github.svg)](https://agentmods.dev/skills/monkilabs/opencastle/supabase-database)
Your own site
<a href="https://agentmods.dev/skills/monkilabs/opencastle/supabase-database"><img src="https://agentmods.dev/badge/skills/monkilabs/opencastle/supabase-database/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for supabase-database

Your own site · 80×15
<a href="https://agentmods.dev/skills/monkilabs/opencastle/supabase-database"><img src="https://agentmods.dev/badge/skills/monkilabs/opencastle/supabase-database.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 41 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 520 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00041 $0.00520
Opus 5.5 $0.00016 $0.00208
Sonnet 5.5 $0.00008 $0.00104
Haiku 4.5 $0.00004 $0.00052

Measured 12d ago against content hash 438b0984bee7, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

supabase-database scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

src/orchestrator/plugins/supabase/skills/supabase-database/SKILL.md · 39 lines

What it actually says

Supabase Database

Project schema, roles, migration history, auth flow, and key files: .opencastle/stack/supabase-config.md. Docs: https://supabase.com/docs

RLS gotchas

  • ENABLE ROW LEVEL SECURITY with no policy denies everything. Enabling and adding policies must land in the same migration.
  • Policies are per-operation. FOR SELECT USING (...) does not cover writes; INSERT needs WITH CHECK, not USING.
  • auth.uid() is the owner check (auth.uid() = id). It is NULL for the anon role, so any policy relying on it silently blocks anonymous access.
  • Policies target the Postgres roles anon, authenticated and service_role (which bypasses RLS). Test every policy as anon and as authenticated, plus any app-level role your policies check. A policy that works as your own user tells you nothing about anon.
  • Reference auth.users(id) with ON DELETE CASCADE on profile-style tables, or deleted users leave orphans.

Confirm RLS coverage before shipping:

SELECT tablename, rowsecurity FROM pg_tables WHERE schemaname = 'public';

Migration workflow

  1. Create the file with supabase migration new add_profiles (it writes supabase/migrations/<14-digit timestamp>_add_profiles.sql); comment intent and rollback considerations inline.
  2. Apply to a local/ephemeral DB; run smoke tests plus per-role RLS checks.
  3. Review the SQL for destructive actions (table drops, column rewrites) — those need a backfill script and phased rollout, never a single migration.
  4. Re-run in CI against a test replica with the full suite.
  5. Deploy via the safe-deploy pipeline, then re-verify RLS, indexes, and a data sanity query.

Regenerate types after every schema change (CI step):

supabase gen types typescript --project-id <project-id> > src/types/supabase.ts

Assert at steps 2 and 4 that the migration completes, per-role RLS queries still pass, and tests on changed paths pass. On failure: revert, adjust, re-run.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago Changed · -2 lines · -8 tokens per session 438b0984bee7
  2. 13d ago First seen · 41 lines · 49 tokens per session scan A 8733c57cc125

Subscribe to this mod's changes

supabase-database is a skill published in the GitHub repository monkilabs/opencastle (80 stars, last pushed yesterday), licensed MIT. It adds 41 tokens to every session and 520 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-04.

Related

Other skills, from other repositories

idempotency-patterns

Use when making retried HTTP commands or message processing safe against duplicate effects, including database-backed request keys, payload conflicts and concurrent retries. Do not apply caching as a substitute for business idempotency.

rrezartprebreza/spring-boot-skills · 46 tokens

crestapps-core-postgresql

Skill for integrating PostgreSQL pgvector indexing data sources documents vector retrieval and memory in CrestApps.Core.

CrestApps/CrestApps.AgentSkills · 26 tokens

alibaba-analyticdb-realtime

Operate AnalyticDB for MySQL and PostgreSQL, Hologres real-time OLAP analytics, and DAS real-time diagnostics for sub-second interactive analytics workloads.

VincentChuWaiChow/vanguard-frontier-agentic · 40 tokens

db

Use when inspecting schemas, querying data or making authorized database changes.

eddmann/agent-toolkit · 15 tokens

alloydb-basics

Manages clusters, instances, and backups for AlloyDB for PostgreSQL, and integrates with AlloyDB Model Context Protocol (MCP) tools for automated database operations. Use when creating, configuring, or administering AlloyDB databases. Do NOT use for general PostgreSQL instances (e.g. Cloud SQL) or other GCP databases.

google/skills · 72 tokens

postgresdb

Use when PostgreSQL engine behaviour decides the answer — schema and type design, index choice, reading EXPLAIN on a slow query, zero-downtime DDL and backfills, or ops (roles, RLS, pooling, vacuum, partitioning, PITR). PG16, ORM-agnostic. NOT portable query logic (that is sql), NOT a managed provider's platform…

ericrisco/rsc-harness · 91 tokens