{
  "id": "uc_42bdfe9b4109",
  "slug": "supabase-schema-drift-auditor",
  "asset_type": "use_case",
  "name": "Nightly Staging vs Production Postgres Schema & RLS Drift Auditor",
  "tagline": "Compares table definitions, indexes, and Row-Level Security policies between staging and production every night—alerting on unmigrated drift or exposed tab",
  "description_md": "### 1. The Workflow Bottleneck & Problem Statement\nAd-hoc SQL changes run in the dashboard cause staging and production schemas to drift apart, leading to failed release deployments.\n\n### 2. Synthesized Agent Architecture & Connected Stack\n**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.\n\n- **Primary Capability:** Compares table definitions, indexes, and Row-Level Security policies between staging and production every night—alerting on unmigrated drift or exposed tables.\n- **Connected Tool Stack:** Supabase Official MCP, Postgres MCP, Slack\n- **Execution Governance:** `Read-Only Discovery` → `Deterministic Policy Check` → `Ask-First Human Approval`\n- **Certified Builder Source:** [@supabase](https://github.com/supabase-community/supabase-mcp)\n\n### 3. Step-by-Step Implementation Blueprint\n1. **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.\n2. **Cross-System Enrichment & Verification:** Query **Postgres MCP** to validate live capacity, account status, or code state before generating recommendations.\n3. **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.\n\n### 4. Copy-Paste System Prompt & Routine Configuration\n```text\nImplement the 'Nightly Staging vs Production Postgres Schema & RLS Drift Auditor' workflow curated with @supabase.\n\n1. OBJECTIVE:\nCompares table definitions, indexes, and Row-Level Security policies between staging and production every night—alerting on unmigrated drift or exposed tables.\n\n2. CONNECTED TOOL STACK:\nSupabase Official MCP, Postgres MCP, Slack\n\n3. STEP-BY-STEP EXECUTION LOOP:\n- Step A (Ingest & Ground): Query live inputs from Supabase Official MCP and cross-reference state in Postgres MCP.\n- Step B (Analyze & Validate): Apply strict filtering rules, verify schema/policy constraints, and flag any anomalies or missing fields.\n- 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.\n```\n\n### 5. Measured ROI & Production Impact\n- **Verified Outcome:** Guarantees 100% schema and RLS policy parity across staging and production databases.\n- **Builder Portfolio:** [Explore all capabilities by @supabase →](/u/supabase)\n",
  "primary_category": "security-ops",
  "categories_json": "[\"security-ops\", \"use-cases\"]",
  "tags_json": "[\"supabase-schema-drift-auditor\", \"use-case\", \"security-ops\", \"supabase\", \"supabase-official-mcp\", \"postgres-mcp\"]",
  "compatible_agents_json": "[\"grok-bot\", \"claude-code\", \"cursor\"]",
  "integrations_json": "[\"Supabase Official MCP\", \"Postgres MCP\", \"Slack\"]",
  "includes_json": "[]",
  "safety_level": "Read-Only / Ask-First",
  "safety_summary": "Verified capability blueprint by @supabase.",
  "share_url": "",
  "deep_link_uri": "",
  "mcp_endpoint": "",
  "mcp_transport": "http",
  "install_command": "npx lightstate inspect supabase-schema-drift-auditor",
  "skill_markdown": "",
  "starter_prompt": "Implement the 'Nightly Staging vs Production Postgres Schema & RLS Drift Auditor' workflow curated with @supabase.\n\n1. OBJECTIVE:\nCompares table definitions, indexes, and Row-Level Security policies between staging and production every night—alerting on unmigrated drift or exposed tables.\n\n2. CONNECTED TOOL STACK:\nSupabase Official MCP, Postgres MCP, Slack\n\n3. STEP-BY-STEP EXECUTION LOOP:\n- Step A (Ingest & Ground): Query live inputs from Supabase Official MCP and cross-reference state in Postgres MCP.\n- Step B (Analyze & Validate): Apply strict filtering rules, verify schema/policy constraints, and flag any anomalies or missing fields.\n- 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.",
  "project_url": "https://github.com/supabase-community/supabase-mcp",
  "repo_url": "https://github.com/supabase-community/supabase-mcp",
  "creator_handle": "supabase",
  "creator_name": "Supabase Engineering",
  "creator_avatar_url": null,
  "creator_url": "https://x.com/supabase",
  "creator_platform": "x",
  "creator_cal_url": null,
  "claimed_by_user_id": null,
  "scouted_by_handle": null,
  "source_url": "https://github.com/supabase-community/supabase-mcp",
  "source_tweet_id": null,
  "source_origin": "certified_builder",
  "source_posted_at": null,
  "x_likes": 288,
  "x_bookmarks": 673,
  "x_retweets": 168,
  "x_views": 4032,
  "human_upvotes": 288,
  "human_installs": 288,
  "bot_pulls": 673,
  "pulse_score": 90,
  "gravity_rank_score": 2386.5,
  "is_featured": 0,
  "is_verified": 1,
  "is_sponsored": 0,
  "sponsor_tier": "free",
  "sponsor_label": "",
  "sponsor_cta_url": "",
  "sponsor_expires_at": null,
  "commercial_intent_score": 0,
  "status": "active",
  "created_at": "2026-10-24T20:00:00Z",
  "updated_at": "2026-10-24T20:00:00Z",
  "verified_at": null,
  "primitive": "use_case",
  "title": "Nightly Staging vs Production Postgres Schema & RLS Drift Auditor",
  "description": "Compares table definitions, indexes, and Row-Level Security policies between staging and production every night—alerting on unmigrated drift or exposed tab",
  "category": "security-ops",
  "tags": "[\"supabase-schema-drift-auditor\", \"use-case\", \"security-ops\", \"supabase\", \"supabase-official-mcp\", \"postgres-mcp\"]",
  "agent_compatibility": "[\"grok-bot\", \"claude-code\", \"cursor\"]",
  "author_handle": "supabase",
  "author_name": "Supabase Engineering",
  "author_avatar": null,
  "source_tweet_url": "https://github.com/supabase-community/supabase-mcp",
  "github_url": "https://github.com/supabase-community/supabase-mcp",
  "external_url": "https://github.com/supabase-community/supabase-mcp",
  "upvotes_count": 288,
  "installs_count": 288
}