Skip to content
This repository was archived by the owner on Nov 25, 2026. It is now read-only.

TML-2503: prisma-next-supabase — the user-facing skill for the Supabase extension - #987

Merged
wmadden-electric merged 2 commits into
mainfrom
tml-2503-supabase-user-skill
Jul 15, 2026
Merged

wmadden-electric merged 2 commits into
mainfrom
tml-2503-supabase-user-skill

Conversation

@wmadden-electric

@wmadden-electric wmadden-electric commented Jul 15, 2026 •

Copy link
Copy Markdown
Contributor

What this is

The user-facing skills cluster (skills/prisma-next-*, installed into user projects by prisma-next init) predates the shipped Supabase integration: nothing taught the supabase() role-first runtime, RLS authoring, JWT modes, grants, or the db.supabase admin root — and the contract skill's Supabase section still showed the pre-ADR-230 runtime wiring (extensions: [supabaseExtension] into the stock postgres() factory). This PR closes that gap.

What ships

New skill — skills/prisma-next-supabase/SKILL.md (248 lines), the end-to-end usage workflow:

  • Config wiring (extensionPacks: [supabasePack] in the low-level config — the /control-subpath gap is named, and the low-level imports are annotated as the deliberate façade-rule exception, mirroring examples/supabase verbatim).
  • Contract: cross-space FK (supabase:auth.AuthUser) + RLS authoring (policy_select / policy_update / @@rls, predicate quoting/casting, PSL_EXTENSION_TARGET_MODEL_MISSING_ATTRIBUTE), with the TS-builder parity (policySelect / rlsEnabled / role from @prisma-next/postgres/contract-builder) named.
  • db.ts with the async supabase() factory; role-bound queries (asUser / asAnon / asServiceRole → RoleBoundDb); the service_role-only .supabase admin root (incl. nativeEnums, the no-cross-root-transaction boundary, the GoTrue-Admin-API caveat).
  • The grants-vs-policies distinction (one-time GRANTs; permission denied vs filtered rows) and real-connection guidance from the live acceptance run: session pooler 5432 / IPv6-only direct connection / never the 6543 transaction pooler.
  • Testing via bootstrapSupabaseShim + the hermetic/acceptance test pair as canonical references.

Every surface claim was verified against source while drafting per skills/DEVELOPING.md (exports map, options/type shapes, error codes, TS RLS exports, no GRANT emission, no /control subpath).

Sibling touch-ups:

  • Router: routes Supabase / RLS / role-binding prompts to the new skill.
  • prisma-next-contract: the stale pre-facade db.ts snippet replaced with a pointer to the new skill; export-subpath list gains /test/utils.
  • prisma-next-runtime / prisma-next-queries: When Not to Use pointers.
  • skills/README.md: cluster table row.

Journey test — skills/journey-tests/08-supabase-rls.md: the canonical browse-as-anon / update-own flow, with the anti-confabulation criteria (no stock postgres() for a Supabase app, no invented /control subpath, no 6543 pooler).

No CLI wiring needed: init installs via skills add …/skills --skill '*', which picks up the new directory automatically.

Verified

pnpm lint:skills green; pnpm lint:code green; the DEVELOPING.md façade-import audit over the new skill flags only the config block, which is annotated as the documented exception; check:upgrade-coverage unaffected (skills/ is not a coverage substrate). Slice record at projects/extension-supabase/slices/user-skills-supabase/spec.md.

Part of the extension-supabase project (TML-2503) — the user-facing skills were its last uncovered surface after #985.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Documented a new Prisma Next skill for end-to-end Supabase integration, including RLS authoring, role-bound execution, JWT configuration, and required setup items.
  • Documentation
    • Updated related skill guidance to route Supabase/RLS topics to the new skill, clarified wiring through extension packs, and refined runtime/contract usage recommendations.
    • Updated the “Prisma Next skills” box to include Supabase (prisma-next-supabase), bringing the total to eleven skills.
  • Tests
    • Added a new Supabase RLS journey test spec for profile listing and policy/role-binding behavior.

Add prisma-next-supabase — the end-to-end usage skill for
@prisma-next/extension-supabase: pack wiring, cross-space FKs to
supabase:auth.AuthUser, RLS policy authoring (policy_* + @@rls,
auth.uid() predicates), the role-first supabase() runtime
(asUser/asAnon/asServiceRole), JWT validation modes, the service_role
db.supabase admin root, the grants-vs-policies distinction, and
real-connection guidance (session pooler 5432; never the 6543
transaction pooler).

Sibling touch-ups: the router routes Supabase/RLS prompts; the contract
skill drops its stale pre-facade runtime wiring (extensions:
[supabaseExtension] into the stock postgres() factory) for a pointer to
the new skill; runtime + queries gain When-Not-to-Use pointers; the
cluster README gains the row. Journey test 08-supabase-rls covers the
canonical browse-anon/update-own flow.

Part of extension-supabase (TML-2503).

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
@wmadden-electric
wmadden-electric requested a review from a team as a code owner July 15, 2026 18:28
@coderabbitai

coderabbitai Bot commented Jul 15, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: 0916e0ef-374a-40a2-9290-c77507595979

📥 Commits

Reviewing files that changed from the base of the PR and between 7a5e2fc and 8444ef9.

📒 Files selected for processing (3)
  • skills/README.md
  • skills/prisma-next-queries/SKILL.md
  • skills/prisma-next-supabase/SKILL.md
🚧 Files skipped from review as they are similar to previous changes (3)
  • skills/README.md
  • skills/prisma-next-queries/SKILL.md
  • skills/prisma-next-supabase/SKILL.md

📝 Walkthrough

Walkthrough

Adds a dedicated prisma-next-supabase skill covering extension-pack wiring, RLS contracts, role-bound queries, admin reads, grants, connections, and testing. Related skills now route Supabase-specific questions to it, and a Supabase RLS journey-test specification was added.

Changes

Supabase integration guidance

Layer / File(s) Summary
Pack wiring and RLS contract
skills/prisma-next-supabase/SKILL.md, skills/prisma-next-contract/SKILL.md
Documents Supabase extension-pack configuration, cross-space AuthUser relations, and contract-based RLS policies.
Role-bound runtime and project setup
skills/prisma-next-supabase/SKILL.md
Covers runtime construction, role-bound access, admin reads, grants, connection requirements, testing, pitfalls, and unsupported scopes.
Skill discovery and RLS journey specification
skills/README.md, skills/prisma-next*.md, skills/prisma-next-queries/SKILL.md, skills/journey-tests/08-supabase-rls.md
Adds skill discovery and routes Supabase-specific usage to the new skill, with a journey-test specification for RLS behavior.

Estimated code review effort: 2 (Simple) | ~15 minutes

Possibly related PRs

Suggested reviewers: wmadden

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly reflects the main change: adding the user-facing prisma-next-supabase skill for Supabase extension support.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch tml-2503-supabase-user-skill

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@skills/prisma-next-queries/SKILL.md`:
- Line 39: Update the target guide matrix in SKILL.md to include a Supabase
entry for `@prisma-next/extension-supabase/runtime` and link it to the
prisma-next-supabase guidance, or narrow the role-bound db handoff to explicitly
cover only shared query APIs. Keep the existing asUser/asAnon/asServiceRole and
RoleBoundDb guidance consistent with the selected scope.

In `@skills/prisma-next-supabase/SKILL.md`:
- Line 221: Update the “Passing both jwtSecret and jwksUrl” entry in the
Supabase configuration documentation to state that async supabase() rejects its
returned promise with SupabaseConfigError for both invalid combinations, rather
than throwing synchronously.

In `@skills/README.md`:
- Line 21: Update the skills count in the README introduction from ten to eleven
so it matches the table's eleven entries, while leaving the table contents
unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: abb02451-e733-46e8-8fab-de3bb6746587

📥 Commits

Reviewing files that changed from the base of the PR and between dd8756a and 7a5e2fc.

⛔ Files ignored due to path filters (1)
  • projects/extension-supabase/slices/user-skills-supabase/spec.md is excluded by !projects/**
📒 Files selected for processing (7)
  • skills/README.md
  • skills/journey-tests/08-supabase-rls.md
  • skills/prisma-next-contract/SKILL.md
  • skills/prisma-next-queries/SKILL.md
  • skills/prisma-next-runtime/SKILL.md
  • skills/prisma-next-supabase/SKILL.md
  • skills/prisma-next/SKILL.md

Comment thread skills/prisma-next-queries/SKILL.md Resolved
Comment thread skills/prisma-next-supabase/SKILL.md Resolved
Comment thread skills/README.md Resolved
- README: skill count ten -> eleven (the new row).
- queries: add the @prisma-next/extension-supabase/runtime row to the
  target-guide matrix (a Supabase RoleBoundDb is a Postgres surface ->
  postgres.md), so the handoff from prisma-next-supabase lands.
- prisma-next-supabase: correct the jwtSecret/jwksUrl misconfig note —
  supabase() is async, so SupabaseConfigError surfaces as a promise
  rejection, not a synchronous throw.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
@wmadden-electric
wmadden-electric added this pull request to the merge queue Jul 15, 2026
Merged via the queue into main with commit 9bead94 Jul 15, 2026
19 checks passed
@wmadden-electric
wmadden-electric deleted the tml-2503-supabase-user-skill branch July 15, 2026 18:50
wmadden-electric added a commit that referenced this pull request Jul 15, 2026
…r is valid YAML

The unquoted description contains `extensionPacks: [supabasePack]`; the
`: ` sequence turns the scalar into a nested mapping, so the skills CLI
silently skips the skill and `prisma-next init` never installs it. The
init-skill-distribution integration test caught this on the release PR;
it passed on #987 itself only because that docs-only diff was classified
inert and the Integration job short-circuited.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
wmadden-electric added a commit that referenced this pull request Jul 15, 2026
The description is an unquoted YAML scalar containing `: ` sequences
(extensionPacks: [supabasePack], auth.uid(), …), which the skills installer
rejects — so the skill did not install and cli.init-skill-distribution counted
11 skills instead of 12. Folded block scalar (>-), matching prisma-next-queries.
Landed inert in #987, so its Integration job was skipped; surfaced here as the
first non-inert PR.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants