What problem does it solve? SQL queries often pass a casual review while hiding defects: joins that silently fan out rows, window function frames that are off by one, indexes the planner never uses, or migrations that lock large tables. This Skill catches those correctness and performance issues before they reach production. ## Core Features & Use Cases - Query Correctness Review: Verifies joins, filters, aggregations, NULL handling, and window function semantics against the intended business question. - Performance Optimization: Reads execution plans, diagnoses cardinality-estimate mismatches, and designs selective composite or covering indexes. - Schema and Migration Safety: Assesses constraint design, backfill risk, lock implications, and rollback paths for schema changes. - Use Case: When a diff adds a new query against a large table or changes a join, invoke this Skill to confirm the query returns the right rows and that the planner can actually use the proposed indexes. ## Quick Start Ask the agent to review and optimize this SQL query and explain its execution plan using the sql-engineer skill.