ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified developer tools Safety 4/5

supabase-rls-gen

Generate Supabase RLS policies from Prisma schema. Use when securing database.

Why use this skill?

Automate database security with supabase-rls-gen. Generate robust Row Level Security policies from your Prisma schema instantly.

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/lxgicstudios/supabase-rls-gen
Or

What This Skill Does

The supabase-rls-gen skill is a powerful developer utility designed to bridge the gap between abstract Prisma schema models and concrete Supabase Row Level Security (RLS) policies. Manually writing PostgreSQL policies can be error-prone and complex, especially when dealing with nuanced multi-tenant access or role-based logic. This skill automates the process by parsing your existing prisma/schema.prisma file, identifying your data models, and generating the necessary SQL commands to secure your tables. It goes beyond simple table access by crafting intelligent policies that handle common security patterns, such as verifying user ownership via auth.uid() or validating team membership, ensuring your database remains secure while reducing boilerplate code.

Installation

To integrate this skill into your environment, use the OpenClaw command line interface. Execute the following command in your terminal:

clawhub install openclaw/skills/skills/lxgicstudios/supabase-rls-gen

Ensure you have Node.js 18+ installed and that your OPENAI_API_KEY environment variable is configured, as the skill leverages AI to interpret your schema and translate it into effective security policies.

Use Cases

This skill is ideal for teams and individual developers working with the T3 stack, Next.js, or any environment utilizing Prisma and Supabase. Use it when initializing a new project to secure your public and private tables immediately, when refactoring legacy database schemas to include granular security, or when building multi-tenant SaaS platforms where data isolation is non-negotiable. It is particularly helpful for developers who want to follow security best practices without spending hours debugging PostgreSQL policy syntax.

Example Prompts

  1. "Analyze my prisma schema and generate RLS policies for a multi-tenant blog system where only the author can edit their own posts."
  2. "Create Supabase RLS policies for a users table and a profiles table, ensuring that users can read their own profiles but only admins can update roles."
  3. "Generate RLS security rules for my schema.prisma file that allow team members to view shared documents if their team_id matches."

Tips & Limitations

Always remember that RLS must be enabled on your tables before policies will take effect. While this tool generates highly accurate baseline policies, you should always review the outputted SQL against your specific business logic. Testing policies with Supabase's built-in query editor is highly recommended to ensure expected behavior. Note that this skill requires read access to your local schema files to function correctly. Treat the generated SQL as a draft that you can further customize to handle complex cross-table joins or custom claims logic.

Metadata

Stars1601
Views0
Updated2026-02-27
View Author Profile
AI Skill Finder

Not sure this is the right skill?

Describe what you want to build — we'll match you to the best skill from 16,000+ options.

Find the right skill
Add to Configuration

Paste this into your clawhub.json to enable this plugin.

{
  "plugins": {
    "official-lxgicstudios-supabase-rls-gen": {
      "enabled": true,
      "auto_update": true
    }
  }
}

Tags(AI)

#supabase#prisma#security#database#rls
Safety Score: 4/5

Flags: file-read, external-api