supabase-patterns

Enforce secure Supabase interaction patterns for Hará Match.

Updated Dec 28, 2025
One-click install
npx skills add https://github.com/mbelenmontoya/hara --skill supabase-patterns-mbelenmontoya
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: supabase-patterns
Source: https://github.com/mbelenmontoya/hara/tree/main/.claude/skills/supabase-patterns
Command: npx skills add https://github.com/mbelenmontoya/hara --skill supabase-patterns-mbelenmontoya

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a robust and secure framework for interacting with Supabase databases, ensuring data integrity and preventing common security vulnerabilities within the Hará Match application.

Core Features & Use Cases

  • Service Role Client Enforcement: Guarantees all database writes are performed with the secure service role, bypassing Row Level Security (RLS) for internal operations.
  • RLS Policy Enforcement: Defines strict read/write access controls for different user roles on critical tables like professionals, leads, and pqls.
  • Billing Pipeline Integrity: Protects the critical billing flow, from event tracking via attribution tokens to the automatic creation of Pay-Per-Qualified-Lead (PQL) records, preventing fraud and duplicate charges.
  • Attribution Token Security: Utilizes JWTs to securely sign events, preventing tampering and ensuring accurate lead attribution.
  • Rate Limiting: Implements rate limiting on public API routes to protect against abuse and ensure service availability.

Quick Start

Use the supabase-patterns skill to understand how to securely insert new professional data into the Supabase database using the service-role client.

Frequently Asked Questions about supabase-patterns

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

FAQPage Schema
How do I enforce Row Level Security policies in Supabase for different user roles?

Row Level Security policies enforce strict read and write access controls for different user roles on critical database tables like professionals and leads. This prevents unauthorized data access by ensuring users can only interact with permitted records.

How does Supabase service role client bypass RLS for internal database operations?

The Supabase service role client bypasses Row Level Security to guarantee all internal database writes are performed securely. This ensures backend operations can manage data integrity without being blocked by user-level access restrictions.

What is the best way to secure attribution tokens and prevent billing fraud in a database pipeline?

Securing attribution tokens with JWTs prevents tampering and ensures accurate lead attribution within the billing pipeline. This protects the flow from event tracking to Pay-Per-Qualified-Lead record creation, preventing fraud and duplicate charges.

How do I implement rate limiting on public API routes connected to a Supabase database?

Implementing rate limiting on public API routes protects the connected Supabase database against abuse. This enforces request thresholds on endpoints to maintain service availability and prevent malicious traffic spikes.

Can I use Supabase database patterns to protect a Pay-Per-Qualified-Lead billing flow?

Supabase database patterns protect the Pay-Per-Qualified-Lead billing flow by validating attribution tokens and tracking events securely. This framework prevents duplicate charges and fraud during the automatic creation of billing records.

Why does my Supabase database query fail with RLS policy restrictions on the pqls table?

Supabase database queries fail when RLS policy restrictions block unauthorized access to the pqls table. Defining strict read and write access controls for specific user roles ensures only permitted operations execute successfully on critical tables.