The master skill in PlanetScale's official pack: runs a full read-only best-practices assessment of a database or org, then produces one evidence-backed report.
DuckDB QuerySkill
Summary
Run SQL — or a plain-English question — against DuckDB databases, CSV, Parquet, JSON and Excel files, with schema inspection and error recovery built in.
Features
- Accepts raw SQL or a natural-language question
- Reads the schema before generating SQL
- Queries CSV, JSON, Parquet, Avro, Excel and spatial files directly
- Estimates result size before running to avoid dumping huge outputs
- Automatic error recovery and retry
- Uses DuckDB Friendly SQL idioms (FROM-first, GROUP BY ALL, EXCLUDE, COLUMNS)
Install This Skill
Add this skill to your favorite AI agent in a few steps.
Skill Content
Example Usage
/duckdb-skills:query "which five customers spent the most last quarter?"
Description
DuckDB's official query skill lets an agent treat DuckDB as its analysis engine: you give it SQL or an ordinary question, and it works out the rest.
What it actually does
The skill first resolves state. If a previous attach-db run left a state file (either .duckdb-skills/state.sql in the repo or a per-project copy under ~/.duckdb-skills/), it runs in session mode against those attached databases; otherwise it drops into ad-hoc mode and queries files directly, including an in-memory fallback. It checks that duckdb is on PATH and hands off to the companion install-duckdb skill if not.
When the input is natural language rather than SQL, the skill pulls the schema first — duckdb_tables() for the table list, DESCRIBE for the columns it needs — and only then generates a query. That ordering is the point: it writes SQL against a schema it has read, not against a guess.
It also estimates result size before running, so a SELECT * over a hundred-million-row Parquet file gets narrowed rather than dumped into the transcript, and it retries automatically on common errors instead of surfacing a raw DuckDB stack trace.
Friendly SQL
Generated queries use DuckDB's Friendly SQL dialect — FROM-first statements, GROUP BY ALL, SELECT * EXCLUDE (...), COLUMNS(...) — which is both shorter and, in practice, harder for a model to get wrong than the ANSI equivalents.
Fitting it into a workflow
This is one of six skills in duckdb/duckdb-skills, alongside attach-db, read-file, duckdb-docs, read-memories and install-duckdb. Used together they cover the arc from installing the CLI to querying a remote Parquet file on object storage without an ETL step in between. The skill needs only the Bash tool and the DuckDB CLI — no server, no credentials, no data leaving the machine.
Published by the DuckDB team under the MIT licence.
Related Skills
Build crash-safe AI agents on AgentKit and step.ai — durable tool calls, human-in-the-loop approval, realtime progress, and when not to reach for an agent loop at all.
Inngest's durable-execution playbook as an agent skill — steps and memoisation, event and cron triggers, idempotency, cancellation, retries and non-retriable errors.
Temporal's official skill for building durable workflows — SDK patterns across seven languages, plus the determinism rules that decide whether a workflow survives a replay.