postgres-schema-audit

Audit Postgres schemas and generate Markdown reports, ER diagrams, and draft migrations.

3|Updated Apr 1, 2026
One-click install
npx skills add https://github.com/anthril/official-claude-plugins --skill postgres-schema-audit
Or copy as Structured Prompt for Agentā–¼
Please help me install this Agent Skill.
Skill: postgres-schema-audit
Source: https://github.com/anthril/official-claude-plugins/tree/main/plugins/database-design/skills/postgres-schema-audit
Command: npx skills add https://github.com/anthril/official-claude-plugins --skill postgres-schema-audit

SYSTEM DOCUMENTATION & REQUIREMENTS

šŸ’” This Skill requires psql, and includes scripts (resource) components.

What problem does it solve?

Audit a Postgres schema to surface structural and relational design quality issues, enabling faster remediation and safer migrations.

Core Features & Use Cases

  • Produces a comprehensive Markdown report (database-design-audit.md) with an executive summary, per-schema findings, cross-schema analysis, and a risk register.
  • Outputs a JSON sidecar (database-design-audit.json) for machine consumption and a draft migrations-suggested.sql for remediation planning.
  • Performs cross-schema analysis to reveal cross-schema FKs, shared enums, and consolidation opportunities.
  • Supports both Supabase MCP-based access and direct read-only Postgres connections via a safe, read-only workflow.
  • Provides evidence-backed findings sourced from catalog queries for verification and traceability.
  • Useful for database design reviews, pre-migration cleanup, and governance.

Quick Start

Run the audit across the selected schemas to generate the report and sidecar JSON for remediation planning.

Frequently Asked Questions about postgres-schema-audit

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

FAQPage Schema
How do I audit a Postgres schema for design debt before a migration?ā–¼

You can audit a Postgres schema for design debt by running catalog-based SQL queries that surface structural and relational issues, producing a Markdown report, ER diagram, JSON sidecar, and draft migrations for remediation planning.

What is Postgres schema design debt and how is it identified?ā–¼

Postgres schema design debt consists of structural and relational quality issues like improper foreign keys or missing RLS, identified through evidence-backed catalog queries that analyze cross-schema relationships, shared enums, and consolidation opportunities.

Can I run a schema audit on a Supabase database using MCP?ā–¼

Yes, you can run a schema audit on a Supabase database using MCP-based access, or via direct read-only Postgres connections, ensuring a safe workflow that does not modify your database during the analysis.

What is the best way to find cross-schema foreign keys in a Postgres database?ā–¼

The best way to find cross-schema foreign keys is to perform a cross-schema analysis using catalog queries, which reveals shared enums, cross-schema FKs, and consolidation opportunities for a comprehensive database design review.

Do I need psql installed to perform a direct Postgres schema audit?ā–¼

Yes, you need psql installed to perform a direct read-only Postgres schema audit, as it is the required dependency for executing the catalog-based SQL queries that gather the evidence-backed findings.

Why does my Postgres database need a schema audit before applying migrations?ā–¼

A Postgres database needs a schema audit before migrations to surface structural design issues early, enabling safer migrations by providing draft migration scripts and a risk register to guide remediation efforts.