supabase-expert-skill

Implement Supabase schemas, RLS policies, and CRUD services for multi-tenant apps.

Updated Sep 29, 2025
One-click install
npx skills add https://github.com/fercracix33/poli2-clean-architecture --skill supabase-expert-skill
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: supabase-expert-skill
Source: https://github.com/fercracix33/poli2-clean-architecture/tree/main/.claude/skills/supabase-expert-skill
Command: npx skills add https://github.com/fercracix33/poli2-clean-architecture --skill supabase-expert-skill

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires npm, supabase-cli, and includes assets (resource) and references (resource) and scripts (resource) components.

What problem does it solves? This Skill automates the complex and error-prone process of implementing data services, designing optimized database schemas, and configuring high-performance Row Level Security (RLS) policies in Supabase/PostgreSQL. It ensures security, performance, and architectural best practices, eliminating hours of manual configuration and debugging.

Core Features & Use Cases

  • Optimized Schema Design: Creates database schemas with proper multi-tenancy, indexes (critical for RLS), constraints, and auto-update triggers.
  • Secure RLS Policy Implementation: Configures Row Level Security policies following best practices to prevent circular dependencies, optimize performance, and ensure multi-tenant data isolation.
  • Pure Data Services: Implements CRUD (Create, Read, Update, Delete) data services with snake_casecamelCase transformations and robust error handling, ensuring no business logic leaks into the data layer.
  • TypeScript Type Generation: Automates the generation and validation of TypeScript types directly from your Supabase schema for end-to-end type safety.
  • Use Case: After use cases are defined, this Skill designs the tasks table schema, implements RLS policies to ensure users only access their organization's tasks, creates a TaskService for CRUD operations, and generates TypeScript types, all while making existing service tests pass.

Quick Start

1. Start with mandatory Context7 research:

mcp__context7__get_library_docs({ context7CompatibleLibraryID: "/supabase/supabase", topic: "RLS row level security policies performance joins security definer circular", tokens: 3000 })

2. Then, proceed through the 6-phase workflow for schema, RLS, and services.

Frequently Asked Questions about supabase-expert-skill

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

FAQPage Schema
How do I design a PostgreSQL schema for multi-tenant applications in Supabase?

Multi-tenant schema design in Supabase requires proper table structure, indexing on tenant columns, and foreign key constraints. This Skill automates schema creation with built-in multi-tenancy patterns, auto-update triggers, and mandatory indexes that support Row Level Security policies and optimize query performance across tenant boundaries.

What's the best way to configure Row Level Security policies in Supabase without performance issues?

Row Level Security in Supabase can degrade performance without proper indexing and policy structure. This Skill implements RLS following security-definer patterns, eliminates circular dependencies, indexes all RLS-filtered columns, and validates policies with explain analyze to ensure data isolation without query slowdown.

How do I generate TypeScript types directly from my Supabase database schema?

TypeScript type generation from Supabase ensures end-to-end type safety and catches schema mismatches at compile time. This Skill automates type extraction from your PostgreSQL schema, validates generated types against your database structure, and maintains consistency across your data layer and application code.

Can I implement CRUD services with automatic snake_case to camelCase transformation in Supabase?

CRUD services in Supabase often require manual data transformation between database naming conventions and application expectations. This Skill provides pure, business-logic-free data service templates that handle snake_case to camelCase conversion, robust error handling, and separation of concerns between data and business layers.

Do I need to manually test Row Level Security policies and database performance in Supabase?

Manual RLS testing and performance validation are error-prone and time-consuming. This Skill automates validation using explain analyze, runs policy tests to verify multi-tenant isolation, and identifies performance bottlenecks before deployment, eliminating hours of debugging.

What prerequisites do I need before implementing Supabase data services and RLS policies?

Implementing Supabase RLS and data services requires understanding your data model, tenant boundaries, and security requirements. This Skill begins with mandatory Context7 research into RLS best practices, security patterns, and PostgreSQL performance, then guides you through phase-driven implementation from schema design through validation.