supabase-gen_skill

This skill generates Supabase RLS policies from a Prisma schema, delivering secure defaults and SQL ready for deployment.
  • Python

2.5k

GitHub Stars

6

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill openclaw/skills --skill supabase-gen

  • _meta.json282 B
  • package-lock.json30.2 KB
  • package.json652 B
  • README.md259 B
  • SKILL.md2.5 KB
  • tsconfig.json251 B

Overview

This skill generates Supabase row-level security (RLS) policies from a Prisma schema so you can secure tables quickly and consistently. It produces SQL policies for SELECT, INSERT, UPDATE, and DELETE with sensible defaults like auth.uid() checks and organization scoping. One command, no config required — output is ready to paste into Supabase SQL editor or save as a migration file.

How this skill works

The tool parses your Prisma schema to detect models, fields, relations, and common ownership patterns. It maps those patterns to RLS rules (user-owned rows, org-scoped rows, public/private) and emits SQL for each CRUD operation, including auth.uid() checks where appropriate. GPT-based heuristics handle edge cases and produce readable, editable policies you should review and test.

When to use it

  • Setting up RLS for a new Supabase project driven by an existing Prisma schema
  • Adding row-level security to tables that currently lack RLS policies
  • Auditing current database policies and generating a baseline for comparison
  • Rapid prototyping of access controls to learn RLS patterns and iterate quickly

Best practices

  • Always review and adapt generated policies to match real app access patterns
  • Test policies with multiple user accounts and roles to validate all flows
  • Start with restrictive policies and gradually relax rules once verified
  • Use the service role sparingly — it bypasses RLS and should be limited to trusted server operations
  • Save generated SQL as a migration file and keep it under version control

Example use cases

  • Generate SQL policies from prisma/schema.prisma and apply them in Supabase SQL editor
  • Pipe output into a migration file: npx ai-supabase-gen prisma/schema.prisma > supabase/migrations/001_rls.sql
  • Use generated policies as a security baseline when onboarding a new team or auditing existing rules
  • Quickly scaffold RLS for multi-tenant apps using organization-scoped fields detected in the schema

FAQ

Yes. Node.js runs the tool via npx and an OPENAI_API_KEY environment variable is required for the GPT-based heuristics.

Is the generated SQL ready to run as-is?

The SQL is ready to run, but you should review and test every policy against your app scenarios before deploying to production.

Can it detect multi-tenant or org-scoped models?

Yes. The parser looks for common organization or tenant fields and generates appropriate scoping checks, but confirm the exact field names and semantics.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational