sql-hardener

Audit Supabase SQL schemas and generate CLI migrations for RLS and indexes.

3|Updated Aug 3, 2025
One-click install
npx skills add https://github.com/CleanExpo/Synthex --skill sql-hardener
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sql-hardener
Source: https://github.com/CleanExpo/Synthex/tree/main/.claude/skills/sql-hardener
Command: npx skills add https://github.com/CleanExpo/Synthex --skill sql-hardener

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

The SQL Hardener automates cleanup and security hardening of Supabase database schemas by discovering missing indexes, identifying RLS policy gaps, and generating safe, testable migrations to prepare schemas for production deployment.

Core Features & Use Cases

  • Schema Audits: Detect missing indexes, nullable fields that should be NOT NULL, and absent or overly permissive RLS policies.
  • Migration Generation: Produce Supabase CLI migration files with index creation, RLS templates, and constraint improvements suitable for review and testing.
  • Safety & Validation: Provide dry-run workflows, linting, backups, and explicit confirmation steps before pushing changes to remote.
  • Use Case: Consolidate multiple SQL schema files into a hardened migration set, add missing FK and timestamp indexes, and enforce user-owned RLS policies before production rollout.

Quick Start

Run a dry audit of the linked Supabase project to list issues and generate recommended migration SQL without applying changes.

Frequently Asked Questions about sql-hardener

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

FAQPage Schema
How do I detect missing indexes in Supabase schemas?

To detect missing indexes and nullable fields in Supabase schemas, run a schema audit to evaluate constraints and query patterns. The audit identifies missing FK and timestamp indexes, then generates migration files with the necessary index creation statements.

Can I generate Supabase CLI migrations for SQL security hardening?

You generate Supabase CLI migrations for SQL security hardening by running an audit that produces migration files containing RLS templates and constraint improvements. These generated files are suitable for review, testing, and explicit confirmation before pushing to production.

What is the best way to consolidate multiple Supabase SQL schema files?

The best way to consolidate multiple Supabase SQL schema files is to use an automated cleanup tool that merges them into a hardened migration set. This process prepares schemas for production readiness by adding missing constraints and enforcing user-owned RLS policies.

How do I safely apply Supabase schema migrations without breaking changes?

To safely apply Supabase schema migrations without breaking changes, use a dry-run workflow with linting and backups to validate modifications. The system provides explicit confirmation steps and surfaces warnings for potential breaking changes before pushing to remote.

Will a Supabase schema audit modify my production database?

A Supabase schema audit will not modify your production database. The dry-run audit workflow lists issues and generates recommended migration SQL without applying changes, ensuring you can review constraints and RLS policies safely.