Repository navigation
TML-2503: prisma-next-supabase — the user-facing skill for the Supabase extension - #987
Conversation
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]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughAdds a dedicated ChangesSupabase integration guidance
Estimated code review effort: 2 (Simple) | ~15 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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
⛔ Files ignored due to path filters (1)
projects/extension-supabase/slices/user-skills-supabase/spec.mdis excluded by!projects/**
📒 Files selected for processing (7)
skills/README.mdskills/journey-tests/08-supabase-rls.mdskills/prisma-next-contract/SKILL.mdskills/prisma-next-queries/SKILL.mdskills/prisma-next-runtime/SKILL.mdskills/prisma-next-supabase/SKILL.mdskills/prisma-next/SKILL.md
- 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]>
…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]>
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]>
What this is
The user-facing skills cluster (
skills/prisma-next-*, installed into user projects byprisma-next init) predates the shipped Supabase integration: nothing taught thesupabase()role-first runtime, RLS authoring, JWT modes, grants, or thedb.supabaseadmin root — and the contract skill's Supabase section still showed the pre-ADR-230 runtime wiring (extensions: [supabaseExtension]into the stockpostgres()factory). This PR closes that gap.What ships
New skill —
skills/prisma-next-supabase/SKILL.md(248 lines), the end-to-end usage workflow: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, mirroringexamples/supabaseverbatim).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/rolefrom@prisma-next/postgres/contract-builder) named.db.tswith the asyncsupabase()factory; role-bound queries (asUser/asAnon/asServiceRole→RoleBoundDb); theservice_role-only.supabaseadmin root (incl.nativeEnums, the no-cross-root-transaction boundary, the GoTrue-Admin-API caveat).GRANTs;permission deniedvs filtered rows) and real-connection guidance from the live acceptance run: session pooler 5432 / IPv6-only direct connection / never the 6543 transaction pooler.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/controlsubpath).Sibling touch-ups:
prisma-next-contract: the stale pre-facadedb.tssnippet 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 stockpostgres()for a Supabase app, no invented/controlsubpath, no 6543 pooler).No CLI wiring needed: init installs via
skills add …/skills --skill '*', which picks up the new directory automatically.Verified
pnpm lint:skillsgreen;pnpm lint:codegreen; 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-coverageunaffected (skills/is not a coverage substrate). Slice record atprojects/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
prisma-next-supabase), bringing the total to eleven skills.