audit-db-schema
Installation
SKILL.md
Database Schema Audit Skill
Degree of freedom: MIXED — Steps 0, 1, 3 [HIGH freedom]; Steps 2 and 4
MCP/SQL probes [LOW freedom — run exactly] (run the query; do not invent a schema).
How to reason
- Observe — quote the column, constraint, advisor row, or query result
- Interpret — what fails at write-time, read-time, or migrate-time?
- Classify — naming / type / constraint / index / RLS / migration / correct
- Severity — missing FK/RLS on public data = P0; type/index drift = P1; naming = P2
Worked example
Observe:
orders.user_idis nullabletext, no FK, no index;rowsecurity = false. Interpret: orphan rows can insert; the client can SELECT every order; lookups seq-scan. Classify: constraint + index + RLS (not a naming nit). Severity: P0 — public table, no RLS, no FK. Finding:orders| RLS+FK | P0 | enable RLS +user_id uuid references users(id)+ index.