supabase-rls-fix

Fix Supabase RLS issues with compatibility views and standardized templates for missing user context scenarios.

5|Updated Nov 6, 2025
One-click install
npx skills add https://github.com/Primadetaautomation/primadata-marketplace --skill supabase-rls-fix
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: supabase-rls-fix
Source: https://github.com/Primadetaautomation/primadata-marketplace/tree/main/.claude/skills/supabase-rls-fix
Command: npx skills add https://github.com/Primadetaautomation/primadata-marketplace --skill supabase-rls-fix

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill fixes Supabase Row Level Security (RLS) issues by ensuring proper user context, handling system processes, and providing standardized RLS templates for new and existing tables.

Core Features & Use Cases

  • Missing user context handling: creates compatibility views and safe access patterns.
  • System/process awareness: ensures background jobs and system tasks have appropriate visibility.
  • RLS templates: ready-to-use policies and templates for new tables and common scenarios.
  • Debugging helpers: quick checks to verify current user/tenant context.

Quick Start

Tell the AI to set up a compatible RLS configuration: "Create a compatibility view for user_tenants from tenant_memberships and grant SELECT to authenticated; add an is_system_process helper and universal access policy wrapper."

Frequently Asked Questions about supabase-rls-fix

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

FAQPage Schema
How do I fix Row Level Security issues in Supabase when background jobs can't access data?

RLS blocks background jobs and system processes because they lack user context. This Skill creates compatibility views, helper functions, and system-process detection patterns that grant appropriate visibility to scheduled tasks and automated workflows while maintaining security policies.

What's the best way to standardize RLS policies across multiple Supabase tables?

Standardized RLS templates reduce policy inconsistencies and manual errors. This Skill provides ready-to-use policy patterns and universal access checks that you apply across new and existing tables, ensuring consistent security rules and faster onboarding.

How do I handle missing user context in Supabase system processes?

System processes need to bypass or safely navigate RLS without breaking security. This Skill implements compatibility views and helper functions like `is_system_process` that detect system-initiated requests and apply appropriate access rules.

Can I apply RLS to new tables without rewriting policies from scratch?

Yes. This Skill provides standardized RLS templates and debugging utilities for new tables, eliminating repetitive policy writing and reducing setup time while maintaining compatibility with existing tenant and user structures.

Why do scheduled tasks fail with RLS policy blocks in Supabase?

Scheduled tasks execute outside user sessions, so RLS policies reject them as unauthorized. This Skill solves this by establishing system-process awareness and creating policies that distinguish legitimate background work from unauthorized access attempts.

How do I verify current user and tenant context in Supabase RLS policies?

Debugging context visibility prevents policy failures. This Skill provides helper functions and quick checks to inspect the active user and tenant session, letting you confirm context is available before RLS policies evaluate access.