rls-policy-consolidator

Consolidate redundant permissive RLS policies into unified OR-logic migrations.

Updated Oct 16, 2025
One-click install
npx skills add https://github.com/sanchezx1/v0-fullcolor-cotizador --skill rls-policy-consolidator
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: rls-policy-consolidator
Source: https://github.com/sanchezx1/v0-fullcolor-cotizador/tree/main/.claude/skills/rls-policy-consolidator
Command: npx skills add https://github.com/sanchezx1/v0-fullcolor-cotizador --skill rls-policy-consolidator

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Consolida múltiples políticas permisivas redundantes en Supabase para el mismo rol y acción, reduciendo la sobrecarga de evaluación de políticas y mejorando rendimiento.

Core Features & Use Cases

  • Policy audit: Listar políticas actuales por tabla con MCP Supabase.
  • Consolidation: Crear migración que DROPEE policies redundantes y cree una política unificada con lógica OR.
  • Targeted tables: cotizaciones, items_cotizacion, lead_actividades, leads, precios_escalonados, productos, profiles.

Quick Start

  1. Listar policies actuales por tabla con MCP Supabase, 2) identificar policies redundantes (mismo rol + misma acción), 3) crear migración que elimine las redundantes y cree una policy unificada, 4) aplicar y verificar con advisor de Supabase.

Frequently Asked Questions about rls-policy-consolidator

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

FAQPage Schema
How do I consolidate redundant RLS policies in Supabase to improve database performance?▼

Consolidate redundant RLS policies by auditing current policies per table, identifying those with the same role and action, creating a migration that drops redundant policies and creates a unified policy using OR logic, then verifying permissions with Supabase advisor.

Why are my Supabase RLS policies causing performance warnings?▼

Multiple permissive policies granting the same role and action across tables cause sequential policy evaluation overhead. Consolidating them into a single unified policy with OR logic reduces evaluation cycles and resolves performance warnings.

Can I merge multiple RLS policies into one policy in Supabase?▼

Yes. You can merge redundant permissive policies by creating a migration that combines conditions using OR logic, eliminating sequential evaluation of duplicate policies while maintaining the same permissions.

What tables can I consolidate RLS policies for?▼

This approach targets Supabase tables including cotizaciones, items_cotizacion, lead_actividades, leads, precios_escalonados, productos, and profiles where redundant permissive policies exist for the same role and action.

How do I verify RLS policy consolidation works correctly?▼

After applying the migration, test permissions in a development environment using MCP Supabase to confirm that the unified policy grants the same access as the original redundant policies without performance degradation.

When should I consolidate RLS policies instead of leaving them separate?▼

Consolidate when Supabase advisor warns of performance issues, or when multiple policies grant identical permissions to the same role and action—consolidation reduces policy evaluation overhead without changing access behavior.