supabase-health-doctor

Expands the supabase-health edge function into a 13-check backend inspection system with a master-only admin dashboard.

Updated Sep 24, 2025
One-click install
npx skills add https://github.com/chriso789/pitch-1 --skill supabase-health-doctor-chriso789
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: supabase-health-doctor
Source: https://github.com/chriso789/pitch-1/tree/main/.agents/skills/supabase-health-doctor
Command: npx skills add https://github.com/chriso789/pitch-1 --skill supabase-health-doctor-chriso789

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Backend teams lack a single, consistent way to audit Supabase projects for RLS gaps, tenant isolation failures, missing indexes, bloated tables, failing edge functions, and storage misconfigurations, forcing ad-hoc manual queries and scattered dashboards. ## Core Features & Use Cases - 13 mandatory health checks: Covers database, RLS, tenant isolation, storage, edge functions, auth, queues, integrations, and data quality categories, each with explicit red/yellow/green thresholds. - Canonical health pipeline: All checks run inside the supabase-health edge function, persist results to the api_health_report JSONB payload, and feed a master-only dashboard at /admin/health-doctor with status cards. - Use Case: An admin suspects tenant data leakage. Run the inspection to get a red status on tenant_isolation.exposed_tables listing every table with a tenant_id column whose RLS policies do not reference tenant_id, plus remediation hints. ## Quick Start Ask the agent to audit the Supabase backend health and expand the supabase-health edge function with the full 13-check catalog and admin dashboard.

Frequently Asked Questions about supabase-health-doctor

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

FAQPage Schema
How do I audit RLS policies and tenant isolation in Supabase?▼

Run the supabase-health edge function, which checks pg_policies and pg_class.relrowsecurity for tables with RLS disabled or zero policies. Any table with a tenant_id column whose policies do not reference tenant_id is flagged red under tenant_isolation.exposed_tables.

How to detect missing indexes and slow queries in a Supabase database?▼

The database.missing_indexes check uses pg_stat_user_tables seq_scan versus idx_scan ratios and flags foreign key columns without indexes. The database.slow_queries check reads pg_stat_statements and marks queries red when mean execution time exceeds 1000ms.

Can I run a single health check instead of all 13?▼

Yes, every check is independently runnable via supabase-health?check=<id> for debugging. Each check lives in its own file under supabase/functions/supabase-health/checks and default-exports an id and run function.

Who can access the Supabase health dashboard?▼

The /admin/health-doctor route and the supabase-health invocation are master-only. The edge function verifies the master role server-side, and anonymous or regular authenticated callers receive a 403 response.

Why must health check evidence stay in the api_health_report payload column?▼

New evidence fields go into the existing JSONB payload column to avoid schema-cache drift. Adding new top-level columns requires a migration with NOTIFY pgrst reload schema, so JSONB additions keep the PostgREST schema cache stable without migrations.

What are the limitations of the health inspection performance budget?▼

The full inspection must complete in under 30 seconds, so long checks like slow_queries and orphaned_files use LIMIT and sampling. Partial results are persisted even if one check fails, and evidence is capped at 50 rows per check.