What this skill does
Inheriting someone else's SQL — a gnarly multi-join report query, a migration script, a query pasted from a bug report — usually means reading it line by line to reconstruct intent. This skill reads any SQL query and produces a plain-English walkthrough of what it does, plus a short list of anything that looks like a performance or correctness risk.
How it works
- Structural walkthrough — breaks the query into its logical steps (what's being selected, joined, filtered, grouped, ordered) and explains each in plain language, in execution order rather than just reading top to bottom.
- Risk flagging — checks for common issues: missing indexes implied by filter columns, an unbounded result set, an
N+1-shaped pattern if multiple queries are supplied together, or a join condition that looks like it could unintentionally fan out rows. - Plain summary — ends with a one-paragraph summary of what the query is for, suitable for pasting into a PR description or a teammate's Slack thread.
Requirements
- Works on Claude AI (any surface — claude.ai, Claude Code, or the API) — this is a pure reasoning skill with no external tool dependency.
- No database connection required; it explains the query text itself, not live execution behavior (though you can paste an
EXPLAINoutput alongside the query for a sharper performance read).
Setup
- Unzip the package into your Skills directory, keeping the folder structure intact.
- Paste any SQL query as input, optionally alongside its
EXPLAINoutput for a sharper read.
What you get
- A plain-English, execution-order walkthrough of any SQL query, however gnarly
- Performance and correctness risks flagged automatically — missing indexes, unbounded results, N+1 patterns, fan-out joins
- A one-paragraph summary ready to paste into a PR description or a teammate's message
- A worked example on a multi-join reporting query