sql-pro

Installation
SKILL.md

SQL Pro — Advanced Query & Schema Mastery


Mandatory Pre-Flight Context Inspection

Before writing complex SQL queries or optimizing database performance, you MUST inspect:

  1. Parameterized Queries Mandatory → All queries MUST use parameter markers ($1, ?, :param); never concatenate raw user input into SQL strings
  2. SARGability Verification → Ensure WHERE clauses are SARGable (no functions or expressions wrapping indexed columns)
  3. Keyset Cursor Pagination → Use WHERE (created_at, id) < ($1, $2) ORDER BY created_at DESC, id DESC LIMIT 50; ban OFFSET on datasets > 1,000 rows
  4. EXPLAIN (ANALYZE, BUFFERS) → Check actual execution plan, shared buffer hits, and sequential scan flags

Activation Boundaries

  • Activate when: Designing complex SQL queries, CTEs, window functions, query performance tuning, index optimization, and debugging slow transactions.
  • DO NOT activate when: Writing NoSQL document queries (Mongo/Redis) or handling client-side state.

2026 SQL Performance & Query Invariants

Installs
4
GitHub Stars
7
First Seen
Apr 26, 2026