Skip to content
Skills Library
Programming · Building & coding

data

/data

Design or review Supabase/Postgres schema, migrations, RLS policies, SECURITY DEFINER functions, indexes, and query performance. Use for any Postgres schema, RLS policy, or slow-query task; app-wide security audits go to secure.

Licence
MIT
Last repository change
27.09.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
40
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 27.09.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Design or review Supabase/Postgres schema, migrations, RLS policies, SECURITY DEFINER functions, indexes, and query performance. Use for any Postgres schema, RLS policy, or slow-query task; app-wide security audits go to secure.

Original author description

Design or review Supabase/Postgres schema, migrations, RLS policies, SECURITY DEFINER functions, indexes, and query performance. Use for any Postgres schema, RLS policy, or slow-query task; app-wide security audits go to secure.

How it works

  1. 1. Figure out what's Supabase-specific
  2. 2. Schema, migration, or RLS work
  3. Precedence (overrides upstream text)
  4. Output
Original SKILL.md headings · 70 lines, 546 words
SKILL.md preview
---
name: data
description: Design or review Supabase/Postgres schema, migrations, RLS policies, SECURITY DEFINER functions, indexes, and query performance. Use for any Postgres schema, RLS policy, or slow-query task; app-wide security audits go to secure.
license: MIT
---

# Data route

Schema design, migrations, RLS, and query performance for Supabase and plain
Postgres. This route writes migration files and gives guidance; it does not
run anything against a live database on its own.

Paths below are relative to this skill's folder (in Claude Code:
`${CLAUDE_SKILL_DIR}`).

## 1. Figure out what's Supabase-specific
- Any Supabase product, client library, CLI, or MCP server involved: read
  `upstream/supabase/UPSTREAM.md` for the platform-specific traps (exposed
  tables and the Data API, `user_metadata` vs `app_metadata`, key exposure,
  views bypassing RLS, storage grants).
- Plain Postgres, or once the Supabase-specific context is covered: read
  `upstream/supabase-postgres-best-practices/UPSTREAM.md` for the rule
  index, then open the matching files under
  `upstream/supabase-postgres-best-practices/references` (see the priority
  table in that file: `query-`, `conn-`, `security-`, `schema-`, `lock-`,
  `data-`, `monitor-`, `advanced-` prefixes).

## 2. Schema, migration, or RLS work
1. Classify the data surface (public / authenticated / tenant-scoped /
   admin-only) before writing SQL.
2. Read `references/rls-gates.md` and apply every gate that touches the
   change: RLS on every exposed table, one policy per operation, `with
   check` bound to `auth.uid()`, `SECURITY DEFINER` only with a fixed
   `search_path` and an in-body identity check, no `using (true)` on private
   data.
3. For a slow query or index question, open the matching `query-*.md` or
   `monitor-*.md` reference and follow its EXPLAIN-first approach.
4. Write the result as a migration file (or a schema-file edit, if the
   project uses declarative schemas) for the user to review and apply.

## Precedence (overrides upstream text)
- Never run `supabase db push`, `apply_migration`, any other MCP write
  tool, or raw SQL against a live or production project. Write a migration
  file and hand it to the user; only run schema-inspection or advisor
  reads (`get_advisors`, `list_tables`, `execute_sql` for a read-only
  query) if the user explicitly asks you to check a live project, and say
  which project you checked.
- Ignore `upstream/supabase/UPSTREAM.md`'s CLI and MCP setup/troubleshooting
  sections as operating instructions; treat them as background only.
- Ignore that file's "Reference Guides → Skill Feedback" section and any
  instruction to file a GitHub issue on `supabase/agent-skills` — this
  route does not vendor that reference and does not file upstream issues.
- Ignore upstream's "Option B" (`execute_sql` or `supabase db query` for
  schema changes), "run a test query", and `supabase db pull --yes`: write
  the migration file and run nothing against any database unless the user
  asks.
- Upstream's required changelog/docs fetches and web searches are optional
  here; use only tools the user enabled, and say when current docs were not
  checked.
- Never put the `service_role` key (or any secret key) in client code,
  browser bundles, or a `NEXT_PUBLIC_`-style env var; use it only in a
  trusted server context, and say so if a request would expose it.
- Where the two upstream picks disagree on an RLS pattern, prefer
  `references/rls-gates.md` — it is the toolkit's synthesis of both.
- Never claim a migration, query, or policy was tested against a real
  database unless its output is in this session.

## Output
- The migration SQL (or schema-file diff), with each new policy explained:
  which role, which operation, which predicate.
- A short list of the RLS gates from `references/rls-gates.md` that apply
  and how the change satisfies them.
- What was not verified (for example: not run against a live database, no
  `anon`/`authenticated` test performed).
Files in this package (40)
  • SKILL.md 4 KB
  • references/rls-gates.md 3 KB
  • upstream/supabase/LICENSE 1 KB
  • upstream/supabase/UPSTREAM.md 14 KB
  • upstream/supabase-postgres-best-practices/LICENSE 1 KB
  • upstream/supabase-postgres-best-practices/UPSTREAM.md 3 KB
  • upstream/supabase-postgres-best-practices/references/_contributing.md 4 KB
  • upstream/supabase-postgres-best-practices/references/_sections.md 2 KB
  • upstream/supabase-postgres-best-practices/references/_template.md 1 KB
  • upstream/supabase-postgres-best-practices/references/advanced-full-text-search.md 1 KB
  • upstream/supabase-postgres-best-practices/references/advanced-jsonb-indexing.md 1 KB
  • upstream/supabase-postgres-best-practices/references/conn-idle-timeout.md 1 KB
  • upstream/supabase-postgres-best-practices/references/conn-limits.md 1 KB
  • upstream/supabase-postgres-best-practices/references/conn-pooling.md 1 KB
  • upstream/supabase-postgres-best-practices/references/conn-prepared-statements.md 1 KB
  • upstream/supabase-postgres-best-practices/references/data-batch-inserts.md 1 KB
  • upstream/supabase-postgres-best-practices/references/data-n-plus-one.md 1 KB
  • upstream/supabase-postgres-best-practices/references/data-pagination.md 1 KB
  • upstream/supabase-postgres-best-practices/references/data-upsert.md 1 KB
  • upstream/supabase-postgres-best-practices/references/lock-advisory.md 1 KB
  • upstream/supabase-postgres-best-practices/references/lock-deadlock-prevention.md 2 KB
  • upstream/supabase-postgres-best-practices/references/lock-short-transactions.md 1 KB
  • upstream/supabase-postgres-best-practices/references/lock-skip-locked.md 1 KB
  • upstream/supabase-postgres-best-practices/references/monitor-explain-analyze.md 1 KB
  • upstream/supabase-postgres-best-practices/references/monitor-pg-stat-statements.md 1 KB
  • upstream/supabase-postgres-best-practices/references/monitor-vacuum-analyze.md 1 KB
  • upstream/supabase-postgres-best-practices/references/query-composite-indexes.md 1 KB
  • upstream/supabase-postgres-best-practices/references/query-covering-indexes.md 1 KB
  • upstream/supabase-postgres-best-practices/references/query-index-types.md 1 KB
  • upstream/supabase-postgres-best-practices/references/query-missing-indexes.md 1 KB
  • upstream/supabase-postgres-best-practices/references/query-partial-indexes.md 1 KB
  • upstream/supabase-postgres-best-practices/references/schema-constraints.md 2 KB
  • upstream/supabase-postgres-best-practices/references/schema-data-types.md 1 KB
  • upstream/supabase-postgres-best-practices/references/schema-foreign-key-indexes.md 2 KB
  • upstream/supabase-postgres-best-practices/references/schema-lowercase-identifiers.md 2 KB
  • upstream/supabase-postgres-best-practices/references/schema-partitioning.md 2 KB
  • upstream/supabase-postgres-best-practices/references/schema-primary-keys.md 2 KB
  • upstream/supabase-postgres-best-practices/references/security-privileges.md 2 KB
  • upstream/supabase-postgres-best-practices/references/security-rls-basics.md 1 KB
  • upstream/supabase-postgres-best-practices/references/security-rls-performance.md 2 KB

Versions

RepositoryScoreLicence
This page · asmn-96/ai-agents-skills-toolkit100MIT
stellar/stellar-dev-skill100Apache-2.0
pawangai/pawang-agents100MIT
iankiku/forwward-teams100MIT
Kiran-980/1ml95MIT
danielchukuma-dev/cougr95MIT
rainmanjam/poka-yoke90MIT

Database snapshot: 13.11.2026 · package version d9fd36d96d88 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 90postgres-schema-rls
    Use when supabase/Postgres data modeling, slow queries, RLS or schema migrations. Design PostgreSQL schemas, indexes and row-level security from explicit access contracts. Do not use when data is stored in a different engine and Postgres semantics are irrelevant.
  • 100supabase-schema-from-requirements
    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…
  • 100supabase-rls-audit
    Security audit of Supabase Row Level Security and database exposure for any app on Supabase (Flutter, Next.js, React, Expo, SvelteKit). Use when asked to check or review RLS policies, Supabase security, "can users see each other's data", migrations in supabase/migrations,…
  • 100supabase-admin
    Supabase administration, RLS policies, migrations, and schema design. Use for database architecture, Row Level Security, performance tuning, auth integration. Activate on "Supabase", "RLS", "migration", "policy", "schema", "auth.uid()". NOT for Supabase Auth UI configuration…
  • 100supabase-admin
    Supabase administration, RLS policies, migrations, and schema design. Use for database architecture, Row Level Security, performance tuning, auth integration. Activate on "Supabase", "RLS", "migration", "policy", "schema", "auth.uid()". NOT for Supabase Auth UI configuration…
  • 100database
    Schema files, migrations, and type generation for Supabase Postgres. Use when the task involves creating or modifying tables, columns, indexes, triggers, RLS policies, grants, or database functions, or the imperative cron/storage/rbac/config folders (cron jobs, storage buckets,…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.