Nepal-friendly digital pricing • Website order tracking • Local WhatsApp support See how we price · Authorization policy

TRIHEXDIGITALNepal-First AI & Cloud
CODING3 Multi-file Components

Supabase Fullstack Engineering & RLS Guardian

Equips autonomous coding agents with the exact patterns for implementing secure Postgres Row-Level Security (RLS) policies, handling Next.js @supabase/ssr cookie auth sessions, writing idempotently runnable migration scripts, and managing Postgres indexes safely.

Author: TRIHEX Architecture Lab
License: MIT
Version: 1.2.0
Inert Code Verified · Heuristic Static Security ScannerHeuristic Scanner: LOW Risk

Heuristic static security scanner audited 3 files (3910 bytes). External code. Review before execution.

v1.2.0
Skill Files (3)
Compatible Runtimes
AntigravityClaude CodeCursorWindsurf
SKILL.md·markdown
# Supabase Fullstack Engineering & RLS Guardian

Use this skill whenever building or refactoring applications with Supabase (Database, Auth, Storage, Edge Functions, or Vector).

## Golden Rules
1. **Never Disable RLS**: Always enable Row Level Security on every table:
   `ALTER TABLE my_table ENABLE ROW LEVEL SECURITY;`
2. **Use Server-Side getUser()**: Never trust `getSession()` for server-side authorization in Next.js. Always call `supabase.auth.getUser()` to validate the JWT with the Supabase Auth server.
3. **Keep Service Role Keys Server-Only**: Never expose `SUPABASE_SERVICE_ROLE_KEY` to client code or environment variables prefixed with `NEXT_PUBLIC_`.

## Workflow
1. Inspect existing migrations in `supabase/migrations/`.
2. Draft incremental schema changes with explicit foreign keys and check constraints.
3. Define granular RLS policies for SELECT, INSERT, UPDATE, and DELETE.
4. Test with authenticated and anonymous roles before committing.