data-supabase-patterns

data-supabase-patterns is a skill for Claude Code from joaoguirunas/team-os. It costs 77 tokens per session (2,023 once invoked), scanned A, original, MIT.

A collection of PostgreSQL and Supabase database practices covering indexes, row-level security, connection pooling, schema design, locking, and query diagnosis with EXPLAIN.

In plain words
What is it for?
Use it when writing SQL, creating database migrations, designing tables, adding row-level security policies, optimizing slow queries, or investigating timeouts and connection issues.
Why use it?
It helps prevent slow queries, inefficient security policies, connection problems, and database designs that are difficult to maintain.

Skill for Claude Code

Written for Claude Code: installed under .claude/. Also seen: positional $N argument.

Good fit Use it when writing SQL, creating database migrations, designing tables, adding row-level security policies, optimizing slow queries, or investigating timeouts and connection issues.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/joaoguirunas/team-os/data-supabase-patterns
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 joaoguirunas/team-os --skill data-supabase-patterns
Clone the repo
git clone --depth 1 https://github.com/joaoguirunas/team-os

Made for: Claude Code.

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 data-supabase-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/joaoguirunas/team-os/data-supabase-patterns/github.svg)](https://agentmods.dev/skills/joaoguirunas/team-os/data-supabase-patterns)
Your own site
<a href="https://agentmods.dev/skills/joaoguirunas/team-os/data-supabase-patterns"><img src="https://agentmods.dev/badge/skills/joaoguirunas/team-os/data-supabase-patterns/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 data-supabase-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/joaoguirunas/team-os/data-supabase-patterns"><img src="https://agentmods.dev/badge/skills/joaoguirunas/team-os/data-supabase-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 77 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,023 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.00077 $0.02023
Opus 5.5 $0.00031 $0.00809
Sonnet 5.5 $0.00015 $0.00405
Haiku 4.5 $0.00008 $0.00202

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

Security

Grade A, and why

data-supabase-patterns 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 27d 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.

.claude/skills/data-supabase-patterns/SKILL.md · 150 lines

How it starts

The opening of the file, as written. The whole thing — 150 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Supabase / Postgres Patterns

Skill de banco de dados destilada do guia oficial supabase-postgres-best-practices (8 categorias priorizadas por impacto). Usada por dev-data-engineer, sites-data (schema, migrations, RLS) e dev-bi (queries analíticas), com dev-qa/sites-qa em review de migrations. Segue o protocolo de segurança da squad: snapshot → dry-run → apply → smoke-test.

1. Query Performance (CRITICAL)

1.1 — Index every column used in WHERE, JOIN, and ORDER BY of hot queries. Missing indexes are the #1 cause of slow queries.

-- ❌ seq scan on 1M rows
SELECT * FROM orders WHERE customer_id = $1;
-- ✅
CREATE INDEX idx_orders_customer_id ON orders (customer_id);

1.2 — Composite indexes: equality columns first, then range/sort.

-- query: WHERE status = 'paid' AND created_at > now() - interval '30 days'
CREATE INDEX idx_orders_status_created ON orders (status, created_at);

1.3 — Partial indexes for skewed data (e.g., only 2% of rows are pending):

CREATE INDEX idx_orders_pending ON orders (created_at) WHERE status = 'pending';

1.4 — Never wrap an indexed column in a function — it disables the index. Index the expression instead:

-- ❌ WHERE lower(email) = $1  (index on email unused)
CREATE INDEX idx_users_email_lower ON users (lower(email)); -- ✅

1.5 — Covering indexes (INCLUDE) for index-only scans on hot read paths.

1.6 — Keyset pagination, not OFFSET, for deep pages:

-- ❌ OFFSET 100000 scans and discards 100k rows
-- ✅ WHERE (created_at, id) < ($last_created_at, $last_id) ORDER BY created_at DESC, id DESC LIMIT 20

1.7 — SELECT only needed columns — SELECT * breaks index-only scans and inflates payloads (especially over PostgREST).

1.8 — Always EXPLAIN (ANALYZE, BUFFERS) before and after optimizing. Look for Seq Scan on large tables, misestimated rows, and high buffer reads.

2. Connection Management (CRITICAL)

2.1 — Serverless/edge functions MUST use the transaction-mode pooler (Supavisor, port 6543), never direct connections — each lambda invocation would otherwise hold a Postgres backend.

Read the full file on GitHub · 150 lines

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. 27d ago Changed 0812a7e79bc7
  2. 1mo ago Changed · +3 lines a9e8b20aadd6
  3. 1mo ago First seen · 147 lines · 77 tokens per session scan A d411c32896e6

Subscribe to this mod's changes

data-supabase-patterns is a skill published in the GitHub repository joaoguirunas/team-os (5 stars, last pushed 3d ago), licensed MIT. It adds 77 tokens to every session and 2,023 once invoked, about $0.0003 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-08-31.

Related

Other skills, from other repositories

kysely

Guidelines for developing with Kysely, a type-safe TypeScript SQL query builder with autocompletion support.

Mindrally/skills · 26 tokens

postgresql-best-practices

PostgreSQL development best practices for schema design, query optimization, and database administration.

Mindrally/skills · 23 tokens

database-migrator

Migrates databases between providers (Postgres, MySQL, Supabase, PlanetScale, MongoDB). Reads source schema, generates migration scripts, handles data type mapping, foreign keys, indexes, triggers, stored procedures. Validates migration with row counts and checksums. Generates migration-plan.md with step-by-step…

OneWave-AI/claude-skills · 76 tokens

database-schema-designer

Designs relational and document database schemas from requirements or an existing app - tables and collections, keys, relationships, constraints, indexes driven by real query patterns, ERDs, and reversible migration scripts - with PostgreSQL (including Supabase) as the default and MySQL, SQLite, and MongoDB supported.…

OneWave-AI/claude-skills · 141 tokens

using-relational-databases

Relational database implementation across Python, Rust, Go, and TypeScript. Use when building CRUD applications, transactional systems, or structured data storage. Covers PostgreSQL (primary), MySQL, SQLite, ORMs (SQLAlchemy, Prisma, SeaORM, GORM), query builders (Drizzle, sqlc, SQLx), migrations, connection pooling…

ancoleman/ai-design-components · 92 tokens

sql-optimization

A guide to improving SQL queries, the commands used to read and change data in databases. It covers examining how MySQL and PostgreSQL execute queries and designing indexes that help them find data faster.

chaterm/terminal-skills · 10 tokens