
Database Schema & Query Review Gate — Catch Slow Queries, Missing Indexes & Risky Migrations Before Prod
Review a database schema, queries, or migration for the mistakes that get expensive in production — bad table design, missing or wrong indexes, slow and N+1 queries, SQL injection, and migrations that lock or break prod. Engine-aware (PostgreSQL, MySQL, SQLite, SQL Server), it runs an ordered review and returns a PASS/REVIEW/BLOCK verdict with prioritized fixes. Schema mistakes are the most expensive kind — this catches them before they ship.
- Review a schema or migration before shipping it to production.
- Diagnose and fix a slow query (missing index, N+1, full scan).
- Check a migration won't lock or break your prod database.
$12
· or 60 creditsSecure checkout via Stripe
Included in download
- Review a schema or migration before shipping it to production.
- Diagnose and fix a slow query (missing index, N+1, full scan).
- Ready for Works with Claude Code
Sample input
"Review this migration and these queries before I ship — Postgres."
Sample output
A BLOCK verdict: the migration adds a NOT NULL column to a 50M-row table (it'll rewrite/lock prod — add nullable, backfill in batches, then set NOT NULL); a query filtering WHERE lower(email) can't use a plain index (add an expression index); and the orders.user_id foreign key has no index. Each with the fix, prioritized, ending in "BLOCK until the migration is non-locking."

Database Schema & Query Review Gate — Catch Slow Queries, Missing Indexes & Risky Migrations Before Prod
Review a database schema, queries, or migration for the mistakes that get expensive in production — bad table design, missing or wrong indexes, slow and N+1 queries, SQL injection, and migrations that lock or break prod. Engine-aware (PostgreSQL, MySQL, SQLite, SQL Server), it runs an ordered review and returns a PASS/REVIEW/BLOCK verdict with prioritized fixes. Schema mistakes are the most expensive kind — this catches them before they ship.
$12
· or 60 creditsSecure checkout via Stripe
Included in download
- Review a schema or migration before shipping it to production.
- Diagnose and fix a slow query (missing index, N+1, full scan).
- Ready for Works with Claude Code
- Instant install
Sample input
"Review this migration and these queries before I ship — Postgres."
Sample output
A BLOCK verdict: the migration adds a NOT NULL column to a 50M-row table (it'll rewrite/lock prod — add nullable, backfill in batches, then set NOT NULL); a query filtering WHERE lower(email) can't use a plain index (add an expression index); and the orders.user_id foreign key has no index. Each with the fix, prioritized, ending in "BLOCK until the migration is non-locking."
About This Skill
A bad query is a slow afternoon; a wrong table design or a migration that locks prod can hold your data and your users hostage. This gate reviews schema, queries, and migrations for what actually bites in production and returns a clear ship decision. It runs an engine-aware review (Postgres, MySQL, SQLite, SQL Server): • Schema design — right types, primary/foreign keys, constraints that enforce invariants, sensible normalization • Indexing — missing indexes on FKs and WHERE/JOIN/ORDER BY columns, composite order, over-indexing, engine-appropriate index types • Queries — N+1 patterns, SELECT *, full scans, functions on indexed columns, OFFSET pagination, and more • Security — SQL injection (string-built queries) and least privilege • Migration safety — destructive/irreversible ops, table-locking rewrites on big tables, backfill and rollback plans You get a PASS / REVIEW / BLOCK verdict with prioritized fixes, and it points you to EXPLAIN ANALYZE to confirm performance rather than guessing. It's a static review — it defers to your engine's docs and doesn't replace running it on real data.
Use Cases
- Review a schema or migration before shipping it to production.
- Diagnose and fix a slow query (missing index, N+1, full scan).
- Check a migration won't lock or break your prod database.
- Catch SQL injection in string-built queries.
Known Limitations
A static review — it doesn't run your queries or see your real EXPLAIN plans, data distribution, or load, so confirm performance findings against the real thing. Engine and version behavior differ; defer to your engine's docs. It doesn't replace load testing or a DBA review for high-stakes systems.
How to Install
mkdir -p ~/.claude/skills && curl -sL https://www.agensi.io/api/install/database-schema-query-review-gate-catch-slow-queries-missing-indexes-risky-migrations-before-prod -o /tmp/database-schema-query-review-gate-catch-slow-queries-missing-indexes-risky-migrations-before-prod.zip && unzip -o /tmp/database-schema-query-review-gate-catch-slow-queries-missing-indexes-risky-migrations-before-prod.zip -d ~/.claude/skills && rm /tmp/database-schema-query-review-gate-catch-slow-queries-missing-indexes-risky-migrations-before-prod.zipFree skills install directly. Paid skills require purchase - use the download button above after buying.
Reviews
No reviews yet - be the first to share your experience.
Only users who have downloaded or purchased this skill can leave a review.
Early access skill
Be the first to review this skill.
Only users who have downloaded or purchased this skill can leave a review.
Security Scanned
Passed automated security review
Permissions
No special permissions declared or detected
Tags
Works with Claude Code, Cursor, Codex CLI, Gemini CLI, and other SKILL.md-compatible agents. Covers PostgreSQL, MySQL, SQLite, SQL Server, and common ORMs.