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
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
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
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.
Backend & APIs 3
Pagination and Filtering
Page one and page ten thousand cost the same
Claude builds list endpoints on keyset pagination with a unique tiebreaker instead of OFFSET, so deep pages stay fast and concurrent inserts never duplicate rows. It signs opaque cursors bound to the sort and filters, whitelists filter and sort syntax, creates an index for each allowed shape, replaces exact counts with estimates or capped counts, and proves it with EXPLAIN and a paging-under-writes test.
Bun Runtime
Adopt Bun one role at a time, with proof
Claude treats Bun as four separate tools and adopts the low-risk ones first: package manager, then test runner, then bundler, then runtime. It commits the text lockfile, freezes it in CI, audits blocked install scripts, writes Bun.serve handlers with graceful shutdown and raised idle timeouts, and proves Node compatibility with the real suite and a staging image before anything ships.
GraphQL Schema Design
Client-shaped schemas that resolve in bounded queries
Claude designs GraphQL types from the queries clients actually send, chooses nullability that will not wipe a whole response on one failed field, and routes every relation through per-request DataLoaders so list queries stop fanning out into hundreds of SQL calls. It adds depth and cost limits, trusted documents, and schema diffs before anything is removed.
Cloud Platforms 2
Google BigQuery
Scan less, pay less, know who spent what
Claude starts a BigQuery task by finding the real cost drivers in INFORMATION_SCHEMA, then fixes table design with partitioning, clustering and required partition filters, rewrites the worst queries and proves the savings with dry runs. It adds byte caps and daily quotas, compares on-demand with editions using measured slot-hours, and grants access through datasets, authorized views and row policies.
Supabase Backend
Treat the database as the security boundary it is
Claude builds Supabase projects with the CLI and versioned migrations, enables RLS on every exposed table with per-operation policies that are indexed and tested as two different users, and keeps the secret key off clients. Server auth uses @supabase/ssr with verified users, storage paths are scoped by user folder, and types are regenerated after each schema change.
Databases 9
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.
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.
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.
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.
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.
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.
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.
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.
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.
Data Engineering 7
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.
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.
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.
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.
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.
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.
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.
Security 2
Input Validation
Safe sinks first, schemas second, payload tests always
Claude stops relying on character stripping and fixes injection where it happens: bound parameters for SQL and allowlists for identifiers, context-specific encoding and sanitizers for HTML, resolved-IP checks for user-supplied URLs, resolved-path checks for file access, and argument arrays for commands. Boundary schemas in Zod or Pydantic add a second layer, and every fix ships with a payload test.
OWASP Top 10 Review
Findings with file:line evidence, not vague advice
Turns a vague 'is this secure?' into a structured source review. Claude maps every entry point, sweeps each OWASP Top 10:2025 category with targeted searches, confirms each lead by tracing attacker input to the sink, and only then reports. Findings come with severity, a concrete attack path, the fix, and an honest list of what was not reviewed.
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.