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.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/lxgicstudios/supabase-schema-genWhat 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
- "Generate RLS policies for my current schema so that users can only read and update their own profiles and posts."
- "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."
- "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
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 skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-lxgicstudios-supabase-schema-gen": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: file-read, external-api
Related Skills
script-gen
Generate package.json scripts with AI. Use when setting up npm scripts.
email-template-gen
Generate responsive email templates. Use when building transactional emails.
branch-namer
Generate descriptive git branch names from plain English. Use when you need a branch name that follows conventions.
cloudflare-gen
Generate Cloudflare Workers configuration and code. Use when building on the edge.
adr-writer
Generate Architecture Decision Records with AI. Use when documenting technical decisions.