Codex skills for SQL
These skills change how Codex writes and reviews SQL across Postgres, MySQL, BigQuery, Snowflake, DuckDB and ClickHouse: window frames are stated, metrics are defined in a sentence first, and join fan-out or NULL mistakes are shown with a small fixture. dbt models, warehouse cost and injection-safe query building are covered too.
Start with these 3
- SQL Window Functions Rankings and running totals that are actually right Codex writes window queries with explicit partitions, deterministic tiebreakers and stated frames, so LAST_VALUE and running totals stop returning quietly wrong numbers. It covers latest-row dedupe, top N per group, period-over-period with date spines, streaks, sessionization and recursive CTEs, adapts syntax per dialect including QUALIFY, and proves results on a small fixture with ties and gaps.
- SQL Query Review Catch fan-out, NULL and injection bugs before merge Codex reviews SQL in passes for NULL semantics, join fan-out, time boundaries, injection, blast radius and concurrency before looking at performance. A bundled standard-library scanner flags risky statements in .sql files as a starting point, and each confirmed finding comes with a tiny VALUES fixture showing the wrong result next to the expected one, plus a severity label and a fix.
- Snowflake SQL Faster queries and a smaller credit bill Codex tunes Snowflake from the query profile: partitions scanned versus total, local and remote spill, exploding joins and queue time. It sizes warehouses for the workload, sets 60-second auto-suspend and resource monitors, attributes credits per query pattern from ACCOUNT_USAGE, and only proposes clustering or search optimization where the numbers justify the serverless cost.
17 more SQL skills
-
SQL for Analytics
Funnels, cohorts and retention you can defend -
SQL Injection Prevention
Bind every value, allowlist every column -
DuckDB Analytics
SQL straight over Parquet and CSV, no load step -
dbt Models
Incremental models that stay correct on run 100 -
ClickHouse Analytics
Sorting keys and rollups that read fewer granules -
dbt Testing
Guard the grain, not every column -
BigQuery Optimization
Scan gigabytes, not terabytes -
Postgres Query Tuning
Read the plan, fix the estimate, then measure -
Drizzle ORM
TypeScript schema in, reviewed SQL migrations out -
Kysely Query Builder
SQL you would write by hand, checked by tsc -
API Pagination
Every row once, page 10,000 as fast as page 1 -
Dagster Pipelines
Model data products, not task chains -
Dimensional Modeling
Star schemas with one grain and honest totals -
Exploratory Data Analysis
Findings with evidence, not forty histograms -
CSV Processing
Big, messy CSVs cleaned without losing a digit -
Postgres Schema Design
Make invalid rows impossible to insert -
PySpark Jobs
Fix the straggler task, not the cluster size
General skills with SQL guidance
Not built around SQL, but they include steps or tools for it. Not part of the install-all command.
-
Zero-Downtime Migrations
Change big tables without a lock-queue outage -
Prisma ORM
Reviewed migrations, lean queries, Prisma 7 ready -
Data Backfills
Touch 80 million rows without anyone noticing -
Bun Runtime
Adopt Bun without surprise Node fallbacks -
GraphQL Resolvers
Constant query counts and auth on every path -
Postgres JSONB
Flexible JSON without slow, unindexed queries -
Active Record Performance
Faster Rails queries, proven with numbers -
MongoDB Aggregation
Pipelines that hit indexes and stay under limits -
Supabase Backend
Migrations, RLS and auth checks that hold up -
Connection Pooling
Fit every pool inside max_connections -
Data Quality Checks
Stop bad data before the dashboard sees it -
Lakehouse Iceberg & Delta
Right-sized files, bounded snapshots, one catalog
Every SQL skill in one command
Installs these 20 into ~/.agents/skills/. Add --project after -- to install into the current repository instead.
The installer is a 104-line POSIX shell script. It fetches the skills you name from codexskills.dev and unpacks each into its own folder in your skills directory. No sudo, no telemetry, and every skill page shows the full SKILL.md first. Read install.sh
curl -fsSL codexskills.dev/install.sh | sh -s -- sql-window-functions sql-query-review snowflake-sql sql-for-analytics sql-injection-prevention duckdb-analytics dbt-models clickhouse-analytics dbt-testing bigquery-optimization postgres-query-tuning drizzle-orm kysely-query-builder api-pagination dagster-pipelines dimensional-modeling exploratory-data-analysis csv-processing postgres-schema-design pyspark-jobs SQL FAQ
Can Codex review SQL queries for correctness, not just speed?
SQL Query Review checks NULL semantics, join fan-out, time boundaries, injection, unbounded UPDATE or DELETE and concurrency before looking at performance. It ships a standard-library scanner, run as python3 scripts/sql_risk_scan.py on .sql files, and each confirmed finding comes with a tiny VALUES fixture showing the wrong and expected results.
Which SQL dialects do the window function and analytics skills support?
SQL Window Functions covers PostgreSQL, MySQL 8, SQLite, SQL Server, BigQuery, Snowflake and DuckDB, and uses QUALIFY only where the dialect supports it, with alternatives such as DISTINCT ON in Postgres. SQL for Analytics handles dialect differences between Postgres, DuckDB, BigQuery and Snowflake for funnels, cohorts and active-user metrics.
Is there a Codex skill for dbt incremental models?
dbt Models targets dbt Core 1.8 to 1.10, writes incremental models with merge, delete+insert or microbatch strategies, and adds lookback windows so late-arriving rows are not dropped. It previews with dbt show and never runs dbt run or build against a production target, or a costly --full-refresh, without your confirmation. dbt Testing adds grain, relationship and unit tests in the syntax your dbt version expects.
How do I install all 20 SQL skills at once?
Pass every name to the installer in one command: curl -fsSL https://codexskills.dev/install.sh | sh -s -- sql-window-functions sql-query-review snowflake-sql sql-for-analytics sql-injection-prevention duckdb-analytics dbt-models clickhouse-analytics dbt-testing bigquery-optimization postgres-query-tuning drizzle-orm kysely-query-builder api-pagination dagster-pipelines dimensional-modeling exploratory-data-analysis csv-processing postgres-schema-design pyspark-jobs. Add --project right after -- to put them in the current repository's .agents/skills/ so your team gets them too.
Which SQL skill should I try first?
SQL Window Functions is the closest fit for most SQL work. Mention it with $sql-window-functions in a prompt to load it on purpose; after that, Codex picks it up on its own whenever a task matches.