prisma-next-supabase
БесплатноБез исполняемых скриптовНе проверенUse Prisma Next with a Supabase project via `@prisma-next/extension-supabase` — wire `extensions: [supabasePack]`, declare cross-space FKs to…
от prisma★ 407 звёзд на GitHubОб этом скилле
Prisma Next — Supabase
Edit your data contract. Prisma handles the rest.
This skill covers using Prisma Next against a Supabase project end-to-end: composing the Supabase extension pack, referencing Supabase-owned tables from your contract, authoring row-level-security (RLS) policies, and running role-bound queries through the supabase() runtime.
When to Use
- User has a Supabase project (or wants one) and is wiring Prisma Next into it.
- User wants RLS policies on their tables (
policy_select,@@rls,auth.uid()). - User wants per-request role binding (
asUser(jwt),asAnon(),asServiceRole()). - User wants a foreign key into
auth.users(cross-space FK). - User wants to read Supabase-internal tables (
auth.*,storage.*) as an admin. - User mentions: supabase, RLS, row level security, policy, anon, authenticated, service_role, auth.users, auth.uid(), JWT, jwtSecret, jwksUrl, SUPABASE.JWT_INVALID, RoleBoundDb, session pooler.
When Not to Use
- General contract editing (models, fields, relations) →
prisma-next-contract. - Non-Supabase
db.tswiring, middleware, teardown →prisma-next-runtime. - General query shapes (filtering, includes, aggregates) →
prisma-next-queries— everything there applies to a role-bounddbtoo. - Migration planning / applying →
prisma-next-migrations.
Key Concepts
- The pack is an
externalcontract space.@prisma-next/extension-supabase/packships a complete, introspection-generated contract of everything Supabase owns — theauthandstorageschemas, their native enum types, and the platform roles (anon,authenticated,service_role) — all with control policyexternal. Composed viaextensions, it means: the migration planner emits no DDL for those objects (Supabase manages them), anddb verifyconfirms they exist in the live database. Your own tables staymanagedas usual. - Roles come from the pack; you never declare them. RLS
roles = [authenticated]identifiers resolve against the composed contract. Pointing the runtime at a non-Supabase Postgres fails verify with anot-foundissue naming the missing role — the common "wrong database" misconfiguration surfaces before queries run. - The runtime is role-first.
supabase()returns aSupabaseDbwith no top-level query surface — there is nodb.sql/db.ormuntil you bind a role.await db.asUser(jwt)/db.asAnon()/db.asServiceRole()each return aRoleBoundDbexposing.sql,.orm,.raw,.execute(plan), and.transaction(fn). This is deliberate: in a Supabase app there is no meaningful "no role" execution context, and defaulting to the connection's login role is a silent-RLS-bypass footgun. - Role binding is below middleware and cannot leak. Each role-bound query runs on a connection that had
set_config('role', …)andset_config('request.jwt.claims', …)applied beneath the user-middleware chain, withRESET ALLon release. Postgres-sideauth.uid()/auth.jwt()read those session vars — RLS enforcement is Postgres's job; the runtime's job is binding the context. - RLS is enforced by policies and grants. Policies filter rows;
GRANTcontrols table access. Prisma Next authors and migrates the policies; it does not author grants (see What Prisma Next doesn't do yet). A role with policies but noGRANTgets a permission error, not filtered rows. On Supabase yourpublictables already carry the platform-role grants via default privileges — the grant that is actually missing out of the box isservice_role's onauth.*/storage.*(see Workflow — Grants). - JWT validation is eager and configurable — current Supabase projects need
jwksUrl.asUser(jwt)verifies the token (viajose) before any connection is acquired: signature + expiry againstjwksUrl(asymmetric signing keys — the default on current Supabase projects, which sign ES256) xorjwtSecret(the symmetric HS256 secret — legacy projects only). Both or neither → a structured error with codeSUPABASE.CONFIG_INVALID. Bad tokens throw a structured error with codeSUPABASE.JWT_INVALIDand a typedmeta.reason— including a mismatch between the token's algorithm and the configured key source (an ES256 token against ajwtSecretclient names the problem and tells you to switch tojwksUrl). The Postgres role is derived from the token'sroleclaim (defaults toauthenticated). Note:supabase statusstill prints aJWT_SECRETeven on projects that sign ES256 — its presence does not mean your project uses it. - Admin access to
auth.*/storage.*is a secondary root onservice_roleonly — and needs a one-time grant.db.asServiceRole().supabaseexposes the pack's own contract (.sql,.orm,.nativeEnums,.execute). The root exists only onservice_roleby design, but a real Supabase project grantsservice_roleno table privileges onauth.*/storage.*(only schemaUSAGE; o
Установить prisma-next-supabase в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл prisma-next-supabase?
Use Prisma Next with a Supabase project via `@prisma-next/extension-supabase` — wire `extensions: [supabasePack]`, declare cross-space FKs to `supabase:auth.AuthUser`, author RLS policies (`policy_select` / `policy_update` / `@@rls`, `auth.uid()` predicates), build `db.ts` with the `supabase()` factory, bind roles per request (`asUser(jwt)` / `asAnon()` / `asServiceRole()`), query `auth.*` / `storage.*` via the `db.asServiceRole().supabase` admin root, and validate JWTs (`jwksUrl` for current projects / `jwtSecret` for legacy HS256). Use for supabase, RLS, row level security, policy, role binding, anon, authenticated, service_role, auth.users, auth.uid(), JWT, JWKS, SUPABASE_JWKS_URL, SUPABASE_JWT_SECRET, SUPABASE.JWT_INVALID, SUPABASE.CONFIG_INVALID, RoleBoundDb, session pooler, supabase:auth.AuthUser, @prisma-next/extension-supabase.
Как установить скилл prisma-next-supabase?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл prisma-next-supabase запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic