The official Genkit skill for Node.js and TypeScript — flows, Dotprompt files, tools and the beta agent API with sessions, interrupts and branching.
DuckDB Query
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
An agentic software-development methodology: composable skills that push a coding agent through spec, plan, TDD and review instead of straight into code.
An open-source set of go-to-market skills for solo technical founders — positioning, first users, launch and pricing, sequenced into a roadmap your agent works with you.
Tencent's skill-evolution harness: it rewrites a whole skill folder — SKILL.md, scripts and references together — and lands every decision as a real Git issue, PR and wiki entry you can review.