LightState Registry / Verified X Builder Use Cases / Security & Infra / supabase-schema-drift-auditor
⚡ Pulse Score 90/100
Nightly Staging vs Production Postgres Schema & RLS Drift Auditor
Compares table definitions, indexes, and Row-Level Security policies between staging and production every night—alerting on unmigrated drift or exposed tab
⚡ 1-Click Agent & Developer Install
Zero Auth · Ready for Grok Bot, Claude Code & Cursornpx lightstate inspect supabase-schema-drift-auditor
Copy-Paste System Prompt / Routine Blueprint:
Implement the 'Nightly Staging vs Production Postgres Schema & RLS Drift Auditor' workflow curated with @supabase.
1. OBJECTIVE:
Compares table definitions, indexes, and Row-Level Security policies between staging and production every night—alerting on unmigrated drift or exposed tables.
2. CONNECTED TOOL STACK:
Supabase Official MCP, Postgres MCP, Slack
3. STEP-BY-STEP EXECUTION LOOP:
- Step A (Ingest & Ground): Query live inputs from Supabase Official MCP and cross-reference state in Postgres MCP.
- Step B (Analyze & Validate): Apply strict filtering rules, verify schema/policy constraints, and flag any anomalies or missing fields.
- Step C (Stage & Report): Prepare the structured output, draft replies/tickets in Slack, and request human confirmation before executing any external send or production write.
Synthesized Engineering Blueprint & Setup Guide
### 1. The Workflow Bottleneck & Problem Statement
Ad-hoc SQL changes run in the dashboard cause staging and production schemas to drift apart, leading to failed release deployments.
### 2. Synthesized Agent Architecture & Connected Stack
**Nightly Staging vs Production Postgres Schema & RLS Drift Auditor** (`supabase-schema-drift-auditor`) is a verified production blueprint curated from **@supabase**'s real-world implementation.
- **Primary Capability:** Compares table definitions, indexes, and Row-Level Security policies between staging and production every night—alerting on unmigrated drift or exposed tables.
- **Connected Tool Stack:** Supabase Official MCP, Postgres MCP, Slack
- **Execution Governance:** `Read-Only Discovery` → `Deterministic Policy Check` → `Ask-First Human Approval`
- **Certified Builder Source:** [@supabase](https://github.com/supabase-community/supabase-mcp)
### 3. Step-by-Step Implementation Blueprint
1. **Trigger & Data Ingestion:** Configure your agent routine to watch **Supabase Official MCP** on a scheduled cadence or event webhook. Treat all external text as untrusted data inside XML fences.
2. **Cross-System Enrichment & Verification:** Query **Postgres MCP** to validate live capacity, account status, or code state before generating recommendations.
3. **Human-in-the-Loop Action Staging:** Post a structured summary card to **Slack** with 1-click approve/edit controls so your team retains full oversight.
### 4. Copy-Paste System Prompt & Routine Configuration
```text
Implement the 'Nightly Staging vs Production Postgres Schema & RLS Drift Auditor' workflow curated with @supabase.
1. OBJECTIVE:
Compares table definitions, indexes, and Row-Level Security policies between staging and production every night—alerting on unmigrated drift or exposed tables.
2. CONNECTED TOOL STACK:
Supabase Official MCP, Postgres MCP, Slack
3. STEP-BY-STEP EXECUTION LOOP:
- Step A (Ingest & Ground): Query live inputs from Supabase Official MCP and cross-reference state in Postgres MCP.
- Step B (Analyze & Validate): Apply strict filtering rules, verify schema/policy constraints, and flag any anomalies or missing fields.
- Step C (Stage & Report): Prepare the structured output, draft replies/tickets in Slack, and request human confirmation before executing any external send or production write.
```
### 5. Measured ROI & Production Impact
- **Verified Outcome:** Guarantees 100% schema and RLS policy parity across staging and production databases.
- **Builder Portfolio:** [Explore all capabilities by @supabase →](/u/supabase)
Tags: #supabase-schema-drift-auditor#use-case#security-ops#supabase#supabase-official-mcp#postgres-mcp
✓ CERTIFIED X BUILDER PORTFOLIO
More Capabilities Curated from @supabase
Related Verified Capabilities
Explore Security & Infra → Use Case
⚡ 95
Local Service SEO & Seasonal Demand Content Engine
Use Case
⚡ 94
Unsold Field Estimate & Open Quote Recovery Pipeline
Use Case ✓ Claimed
⚡ 93