supabase-rls-policy-generator

Generate Supabase RLS policies with auth.uid() and auth.jwt() claims.

6|Updated Nov 11, 2025
One-click install
npx skills add https://github.com/hopeoverture/worldbuilding-app-skills --skill supabase-rls-policy-generator
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: supabase-rls-policy-generator
Source: https://github.com/hopeoverture/worldbuilding-app-skills/tree/main/skills/development/supabase-rls-policy-generator
Command: npx skills add https://github.com/hopeoverture/worldbuilding-app-skills --skill supabase-rls-policy-generator

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and assets (resource) components.

What problem does it solve?

Automates creation of Row-Level Security (RLS) policies for multi-tenant or RBAC scenarios in Supabase.

Core Features & Use Cases

  • Generate RLS policies for SELECT/INSERT/UPDATE/DELETE
  • Provide policy templates and examples
  • Create migration and documentation templates
  • Provide testing scenarios for RLS policies

Quick Start

Use this generator to create policy templates for your tables and export documentation.

Frequently Asked Questions about supabase-rls-policy-generator

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate Row-Level Security policies for Supabase?

Row-Level Security policies enforce data access rules at the database level. This generator creates SELECT, INSERT, UPDATE, and DELETE policies using auth.uid() and auth.jwt() claims to automatically restrict rows based on user identity and roles, eliminating the need to write policies manually for multi-tenant or RBAC applications.

Can I use RLS policies to isolate data between tenants in Supabase?

Yes. RLS policies enforce tenant isolation by evaluating auth.jwt() claims and auth.uid() during query execution, ensuring users only access rows belonging to their tenant. This generator produces tenant-isolation templates and migration scripts to apply policies across your tables consistently.

What's included in the RLS policy templates this generator creates?

The generator produces policy templates for common scenarios, helper functions to simplify policy logic, testing queries to validate policies work as intended, migration scripts to deploy policies to your database, and documentation describing each policy's scope and security model.

How do I test if my RLS policies are working correctly?

This generator provides testing scenarios and queries that verify policies block unauthorized access while allowing legitimate queries. Test queries simulate different user roles and auth claims to confirm policies enforce the intended access control without breaking application queries.

Do I need to understand PostgreSQL to use this RLS policy generator?

While familiarity with database concepts helps, the generator abstracts policy complexity by producing ready-to-use templates and migration scripts. You define your tables, roles, and tenant model; the generator handles the SQL policy syntax and documentation.

What happens if I enable RLS but policies are incomplete?

Incomplete RLS policies can block all queries on protected tables, breaking application functionality. This generator reduces that risk by providing comprehensive policy sets, testing queries, and migration validation, helping you deploy policies that cover all expected access patterns before enabling RLS in production.