Supabase RLS Generator for Openclaw

An automated utility that transforms Prisma schema definitions into robust Supabase Row Level Security (RLS) policies.

lxgicstudios
v1.0.0
Jan 29, 2026
0
0
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install supabase-rls-gen

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install supabase-rls-gen using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Supabase RLS Generator?

Supabase RLS Generator is a developer-centric tool designed to simplify the complex task of securing databases. Writing Row Level Security policies manually can be error-prone and time-consuming; this skill automates the process by parsing your existing Prisma schema to understand data models and relationships. By integrating this into your workflow with Openclaw Skills, you can ensure that your database remains secure from the first line of code.

The tool specifically targets the nuances of PostgreSQL policy syntax, translating model definitions into actionable SQL. It handles the 'One command. Zero config.' philosophy, allowing developers to focus on building features rather than debugging database access rules. It is an essential part of the modern developer's toolkit for maintaining high security standards in multi-tenant and user-driven applications.

Supabase RLS Generator Use Cases

  • Securing new Supabase projects by generating RLS policies directly from a Prisma source of truth.
  • Adding fine-grained access control to existing database tables without manual SQL authoring.
  • Implementing multi-tenant security patterns where users only access their own data or their team's data.
  • Speeding up the development lifecycle by automating repetitive database security configuration tasks.

How Supabase RLS Generator Works

  1. The tool parses the provided Prisma schema file to extract table names, column types, and relationships.
  2. It identifies specific fields (like user_id or team_id) that typically dictate access control boundaries.
  3. It generates appropriate PostgreSQL SQL statements including ENABLE RLS commands and specific policies for SELECT, INSERT, UPDATE, and DELETE.
  4. The output provides ready-to-use SQL that leverages Supabase helper functions like auth.uid() and auth.role().

Supabase RLS Generator Setup

To utilize this skill, you must have Node.js 18+ installed. No permanent installation is required as it can be run via npx. Ensure your OPENAI_API_KEY is set in your environment variables. Use the following command to generate policies:

npx ai-supabase-gen ./prisma/schema.prisma

To view all configuration options, run:

npx ai-supabase-gen --help

Supabase RLS Generator Data Schema & Taxonomy

This skill focuses on transforming application-level schemas into database-level security rules. Below is how this Openclaw Skills utility maps your data:

Prisma Element SQL Output Component
Model Definition CREATE POLICY target table
User/Owner ID auth.uid() check logic
Table Metadata ALTER TABLE ENABLE ROW LEVEL SECURITY
Relationships Subquery or Join-based access policies

Supabase RLS Generator Advanced Features

  • Intelligent detection of common access patterns such as owner-based or team-based isolation.
  • Support for all CRUD operations, generating unique policies for specific database actions.
  • Integration-ready CLI output that can be piped into other database migration tools.
  • Leverages AI to interpret complex schema relationships and suggest optimal security constraints.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*