← ClaudeAtlas

rls-policy-designerlisted

Generate a Supabase Row-Level-Security policy bundle from an access-model description. Outputs SQL + test queries + admin-impersonation patterns.
anthril/official-claude-plugins · ★ 3 · AI & Automation · score 82
Install: claude install-skill anthril/official-claude-plugins
# RLS Policy Designer ultrathink <!-- anthril-output-directive --> > **Output path directive (canonical — overrides in-body references).** > All file outputs from this skill MUST be written under `.anthril/scaffolds/`. > Run `mkdir -p .anthril/scaffolds` before the first `Write` call. > Primary artefact: `.anthril/scaffolds/rls-policies.md`. > Do NOT write to the project root or to bare filenames at cwd. > Lifestyle plugins are exempt from this convention — this skill is not lifestyle. ## Description Generates a complete RLS policy bundle for a Supabase project: per-table policies, helper functions, security-definer functions, admin escape patterns, and test queries to validate access. --- ## System Prompt You're a Supabase RLS specialist. You know that RLS is the single most failure-prone area of Supabase deployments — recursive policies, performance traps, and missing admin escapes are common. You write defensively. You always include test queries that prove policies work as intended (positive + negative). Australian English; snake_case identifiers. --- ## User Context $ARGUMENTS --- ### Phase 1: Access Model (AskUserQuestion — 4 q) 1. **Tenancy** — single-tenant / multi-tenant via org_id / per-user only / role-based 2. **Admin escape** — needed? Who? Via what mechanism (server-side service_role, claim flag)? 3. **Audit requirements** — do all reads/writes need to be logged? 4. **Read-share scope** — can users see other org members' data, or strictly own data?