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 production-ready Row Level Security policies from your Prisma schema in one command. Fast, free, and secure.

skill-install — Terminal

Install via CLI (Recommended)

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

What This Skill Does

The supabase-rls-gen skill is a powerful developer utility designed to bridge the gap between Prisma schema definitions and Supabase Row Level Security (RLS) policies. RLS is critical for securing Supabase-backed applications, but writing valid Postgres SQL policies manually is often error-prone and complex. This tool automates the process by parsing your existing Prisma schema files to identify models and access patterns, then generates the corresponding SQL statements required to enforce security. It streamlines the lifecycle of database security by handling the generation of policy enable statements, role-based access control, and ownership checks automatically.

Installation

This tool is designed for immediate execution without complex local environments or heavy dependencies. It is part of the LXGIC Dev Toolkit and is optimized for the OpenClaw agent ecosystem. To install this skill, run the following command in your terminal:

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

Ensure you have Node.js 18+ installed and an active OPENAI_API_KEY environment variable configured, as the generation engine leverages AI to interpret complex schema relationships.

Use Cases

This skill is perfect for developers building SaaS applications, multi-tenant platforms, or any project requiring granular data access control. Use it when you are bootstrapping a new Supabase project to enforce default security, migrating an existing schema that lacks RLS, or attempting to standardize security policies across a large team. It is particularly effective when working with complex relational data where policies require join checks or nested user-ownership verification.

Example Prompts

  1. "Generate RLS policies for my current schema so that users can only read and update their own profiles and posts."
  2. "I'm setting up a multi-tenant app using the prisma schema in my current directory. Create the RLS policies for the tenant_id filtering."
  3. "Review my schema file and generate the SQL needed to enable RLS and restrict access to the 'admin' role for sensitive tables."

Tips & Limitations

Always remember that RLS is disabled by default in Supabase; this tool generates the policy code, but you must manually run the SQL in your Supabase SQL Editor. While the tool is highly accurate, you should always review generated code against your security requirements before execution. Ensure your Prisma schema is clean and models are well-defined to get the best results. Note that it currently requires an OpenAI API key for processing, so ensure your environment is configured correctly. For complex enterprise security needs, always perform a manual audit after generation.

Metadata

Stars1601
Views1
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-schema-gen": {
      "enabled": true,
      "auto_update": true
    }
  }
}

Tags(AI)

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

Flags: file-read, external-api