database-reviewer

Review database schemas, migrations, queries, and multi-tenant isolation for production risks.

3|2|Updated Jan 23, 2026
One-click install
npx skills add https://github.com/robotijn/ctoc --skill database-reviewer-robotijn
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-reviewer
Source: https://github.com/robotijn/ctoc/tree/main/skills/specialized/database-reviewer
Command: npx skills add https://github.com/robotijn/ctoc --skill database-reviewer-robotijn

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Unsafe database schema changes, unvetted migrations, and unoptimized queries cause costly production downtime, silent data corruption, and cross-tenant data leaks that are often only discovered during regulatory audits or customer incidents.

Core Features & Use Cases

  • Schema Audit: Validates table structures for missing primary keys, incorrect data types (e.g. FLOAT for monetary values), naming inconsistencies, and reserved keyword usage.
  • Migration Risk Review: Flags blocking DDL, missing rollback plans, non-zero-downtime patterns, and unindexed foreign keys that can cause cascade performance failures.
  • Query & Security Validation: Detects N+1 queries, sequential scans on large tables, non-sargable predicates, and missing row-level security (RLS) policies for multi-tenant applications.
  • Use Case: For a SaaS platform rolling out a new orders table, this skill catches that the migration uses a non-concurrent index on a 100M-row table (which would lock writes for minutes) and flags the absence of RLS on the tenant-scoped documents table to prevent cross-tenant data access.

Quick Start

Use the database-reviewer skill to audit your latest database migration and schema changes for production risks before merging to the main branch.

Frequently Asked Questions about database-reviewer

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

FAQPage Schema
How do I review database migrations for zero-downtime risks?

To review database migrations for zero-downtime risks, validate scripts against expand-contract patterns, flag blocking DDL, check for unindexed foreign keys, and ensure rollback plans exist to prevent write locks and production downtime.

How do I validate row-level security policies for multi-tenant applications?

Validating row-level security policies for multi-tenant applications requires auditing schema definitions to ensure RLS is strictly enforced on tenant-scoped tables, preventing silent cross-tenant data leaks and regulatory compliance violations.

Does the database schema review work with ORM ecosystems like Prisma and EF Core?

Yes, database schema review works with ORM ecosystems including EF Core, JPA/Hibernate, SQLAlchemy, Prisma, and Drizzle, analyzing ORM-generated query patterns to detect N+1 queries and non-sargable predicates across Postgres, MySQL, SQL Server, and SQLite.

What is a non-concurrent index creation risk on large tables?

A non-concurrent index creation risk on large tables involves executing a blocking DDL command that locks database writes for extended periods, causing significant production downtime instead of using safe, concurrent indexing patterns.

How do I audit database schemas for missing primary keys and naming inconsistencies?

Auditing database schemas for missing primary keys and naming inconsistencies involves scanning table structures to enforce mandatory primary keys, verify correct data types like UUID v7, and flag reserved keyword usage before deployment.