25 skills · 7 categories

Claude Code skills for SQL

SQL skills for transactional and analytical databases: reading query plans, window functions, data modeling, dbt projects, DuckDB and warehouse cost control. Database-specific hubs go deeper on Postgres and MySQL.

Start with these

  1. 1

    SQL Query Tuning

    Find the slow plan node, fix the estimate behind it

    Claude stops guessing from SQL text and works from the plan. It ranks queries by total time in pg_stat_statements, captures EXPLAIN ANALYZE with real parameters, finds the node where estimates diverge, then applies the smallest fix in order: statistics, query rewrite, index, scoped config. Every change gets a before/after plan comparison with buffer counts and a short tuning note.

  2. 2

    Analytics SQL

    Stated grain, no fan-out, numbers that reconcile

    Claude writes the metric definition first, comments the grain of every CTE, and checks row counts after each join so duplicate keys cannot inflate totals. It writes explicit window frames, zero-fills missing days with a date spine, adapts date functions to Postgres, Snowflake, BigQuery or DuckDB, and reconciles the result with a direct total and one hand-checked entity.

  3. 3

    DuckDB Analytics

    SQL over Parquet and CSV files, no warehouse needed

    Claude queries data files directly with DuckDB instead of loading them into pandas first. It inspects schemas with DESCRIBE and SUMMARIZE, pins types that auto-detection gets wrong such as zip codes and day-first dates, writes analysis with GROUP BY ALL, QUALIFY and ASOF JOIN, sets memory limits so big jobs spill to disk, and checks row counts and totals against the source.

All 25 SQL skills

Grouped by category. Each card opens the full playbook, example prompts and install commands.

Databases 9

★ No. 210

SQL Query Tuning

Find the slow plan node, fix the estimate behind it

Claude stops guessing from SQL text and works from the plan. It ranks queries by total time in pg_stat_statements, captures EXPLAIN ANALYZE with real parameters, finds the node where estimates diverge, then applies the smallest fix in order: statistics, query rewrite, index, scoped config. Every change gets a before/after plan comparison with buffer counts and a short tuning note.

sql-query-tuning 215 lines · 2 files
No. 196

DuckDB Analytics

SQL over Parquet and CSV files, no warehouse needed

Claude queries data files directly with DuckDB instead of loading them into pandas first. It inspects schemas with DESCRIBE and SUMMARIZE, pins types that auto-detection gets wrong such as zip codes and day-first dates, writes analysis with GROUP BY ALL, QUALIFY and ASOF JOIN, sets memory limits so big jobs spill to disk, and checks row counts and totals against the source.

duckdb-analytics 219 lines
No. 193

ClickHouse Analytics

Sorting keys that skip 99% of granules

Claude designs ClickHouse tables from the dominant queries: a sorting key that prunes granules, coarse monthly partitions, LowCardinality and codecs, and the right MergeTree variant for upserts or rollups. Ingestion is batched or uses async inserts with wait enabled, dedup queries use FINAL or argMax, and EXPLAIN indexes plus system.parts confirm granules read and part counts.

clickhouse-analytics 235 lines
No. 195

Drizzle ORM

Typed SQL, reviewed migrations, zero drift

Claude writes Drizzle schemas as the single source of truth: timezone-aware timestamps, named indexes on every foreign key, types inferred with $inferSelect instead of duplicated interfaces. It keeps push for local prototyping only, reads each generated SQL file for accidental drop-and-add renames, and picks between the core builder and relational queries based on what the result needs.

drizzle-orm 239 lines
No. 206

Prisma ORM

Read the SQL Prisma writes before it hits prod

Claude treats Prisma as a SQL generator it must supervise. Models get timestamptz and indexed relation fields, every generated migration.sql is read for silent drops and table rewrites, and production only ever sees migrate deploy. Queries select only needed fields with cursor pagination, transactions stay short, and the setup matches your installed Prisma major, including the Prisma 7 driver-adapter client.

prisma-orm 238 lines
No. 192

Backup and Restore

Backups count only after a timed restore

Claude starts from agreed RPO and RTO targets and picks the mechanism that meets them: logical dumps, physical backups with WAL archiving for point-in-time recovery, or managed PITR plus off-account copies. It restores to a separate instance by default, verifies restored data with queries and smoke tests, alerts on archive failures and backup age, and records each drill's real recovery time.

backup-restore 243 lines
No. 194

Connection Pooling

Pools sized to database cores, not request counts

Claude writes down every process that connects and sums its maximum connections against the database limit at full autoscale before touching a setting. Pools are sized from database parallelism, PgBouncer transaction mode is configured with its session-state caveats and prepared statement support, serverless platforms get a proxy, and exhaustion is diagnosed from pg_stat_activity and SHOW POOLS.

connection-pooling 173 lines · 2 files
No. 201

Neo4j Graphs

Graph models anchored on indexes, traversals bounded

Claude first checks whether the questions are really traversals, then models nouns as labeled nodes and verbs as typed, directed relationships. Constraints come before data, loads MERGE only on constrained keys in batched transactions, and every hot Cypher query is profiled until it starts with an index seek and has no unbounded expansion, cartesian product or Eager step.

neo4j-graphs 171 lines
No. 204

Postgres JSONB

Flexible documents without giving up indexes

Claude decides per attribute whether it belongs in a column, a JSONB document or a child table, then validates documents with CHECK constraints at the database edge. Queries are written with GIN-compatible containment and jsonpath operators, hot keys become indexed expressions or stored generated columns, and expression statistics fix the planner's blind spot for keys inside JSON.

postgres-jsonb 177 lines

Data Engineering 7

No. 216

Analytics SQL

Stated grain, no fan-out, numbers that reconcile

Claude writes the metric definition first, comments the grain of every CTE, and checks row counts after each join so duplicate keys cannot inflate totals. It writes explicit window frames, zero-fills missing days with a date spine, adapts date functions to Postgres, Snowflake, BigQuery or DuckDB, and reconciles the result with a direct total and one hand-checked entity.

analytics-sql 171 lines · 2 files
No. 223

dbt Models

Declared grain, tested keys, idempotent increments

Claude organizes dbt projects into source-backed staging views, reusable intermediate models and documented fct and dim marts. Every mart states its grain and enforces it with tests, incremental models get a unique key plus a late-data lookback, and changes are built with dbt build on the modified subgraph, then reconciled against the source system.

dbt-models 257 lines
No. 221

Data Quality Checks

Catch bad data before the dashboard does

Claude starts from the numbers consumers rely on, profiles history to pick thresholds, and adds schema, key, validity, freshness, volume and reconciliation checks in the tool the project already uses. Each check gets a severity that blocks or warns, bad rows land in quarantine with a reason, and every new check is proven by making it fail on injected faults.

data-quality-checks 219 lines
No. 218

CSV Cleaning

From mojibake and shifted columns to clean UTF-8

Claude preserves the raw file, runs a bundled profiler that detects encoding, BOM, delimiter, ragged rows, ambiguous dates and European number formats, then repairs structure and parses every column explicitly. Duplicates are removed by a stated rule, bad lines go to a rejects file, and a cleaning log records rows in and out for each step.

csv-cleaning 206 lines · 2 files
No. 224

Dimensional Modeling

Declare the grain, conform the dimensions

Claude starts warehouse design with a bus matrix and a one-sentence grain for every fact table, then checks each measure's additivity at that grain. Dimensions get surrogate keys, unknown members and a deliberate SCD type per attribute, special cases use junk, role-playing or bridge dimensions, and the model is reconciled against source totals before anyone builds a dashboard on it.

dimensional-modeling 181 lines
No. 229

Lakehouse with Apache Iceberg

One catalog, pruned scans, maintenance on a schedule

Helps Claude decide whether an Iceberg lakehouse is worth it, then build tables that every engine reaches through one catalog. It picks partition transforms and sort orders that keep files near target size, chooses copy-on-write or merge-on-read per workload, and schedules compaction, snapshot expiry and orphan cleanup in a safe order, with confirmation before anything that removes time travel.

lakehouse-iceberg 265 lines · 2 files
No. 234

Streamlit Apps

Data apps that do not re-query on every click

Claude designs Streamlit apps around the rerun model: data loaders cached with TTLs, shared clients in cache_resource, multi-input filters inside forms, and live panels in fragments so one widget does not refresh the world. State lives in session_state with stable keys and callbacks, secrets come from st.secrets, and an AppTest suite covers the main path before deploy.

streamlit-apps 210 lines

Install

Every SQL skill in one command

Installs into ~/.claude/skills/. Add --project after -- to install into the current repository.

curl -fsSL https://claudeskills.page/install.sh | sh -s -- sql-query-tuning analytics-sql duckdb-analytics gcp-bigquery clickhouse-analytics dbt-models pagination-filtering data-quality-checks input-validation owasp-review csv-cleaning drizzle-orm prisma-orm bun-runtime graphql-schema supabase-backend backup-restore connection-pooling neo4j-graphs postgres-jsonb dimensional-modeling lakehouse-iceberg streamlit-apps data-partitioning report-automation

SQL skills FAQ

What is the best Claude Code skill for SQL?

Start with SQL Query Tuning: Find the slow plan node, fix the estimate behind it. Then add Analytics SQL and DuckDB Analytics, which cover the next most common SQL requests.

How do I install all 25 SQL skills at once?

Pass every name to the installer in one command: curl -fsSL https://claudeskills.page/install.sh | sh -s -- sql-query-tuning analytics-sql duckdb-analytics gcp-bigquery clickhouse-analytics dbt-models pagination-filtering data-quality-checks input-validation owasp-review csv-cleaning drizzle-orm prisma-orm bun-runtime graphql-schema supabase-backend backup-restore connection-pooling neo4j-graphs postgres-jsonb dimensional-modeling lakehouse-iceberg streamlit-apps data-partitioning report-automation. Add --project to install them into the current repository's .claude/skills/ folder so your team gets them too.

Do these SQL skills work outside Claude Code?

Yes. Each skill uses only the portable Agent Skills frontmatter, so the same folder works on claude.ai, through the Claude API and in the Agent SDK. Skills that run bundled scripts need an environment with code execution.

esc