Motherduck query

From motherduckdb/agent-skills · View interactive version

Motherduck query is an AI agent skill from the GitHub repository motherduckdb/agent-skills. Write, run, optimize, or troubleshoot DuckDB SQL against MotherDuck, including AI functions such as prompt_jev for in-SQL classification. Use for any SQL that targets MotherDuck, even simple queries, because MotherDuck has its own dialect and naming rules.

How to use this skill

Skill file

Query MotherDuck

Prerequisites

Default Posture

Workflow

  1. Confirm the actual tables, columns, and grain before writing SQL.
  2. Load relevant Guide context when MCP is available, without treating it as a substitute for schema inspection.
  3. Write the query in SQL first, then wrap it in Python or TypeScript only if needed.
  4. Use DuckDB-native patterns when they simplify the query; a simple lookup does not need a CTE or a materialization.
  5. Verify result shape and key aggregates. When performance is part of the request or execution shows a problem, check EXPLAIN ANALYZE and md_information_schema.query_history (wait_time, bytes_spilled_to_disk, instance_type) before changing the query or the Duckling size.
  6. Materialize expensive repeated queries into serving tables or light views when warranted.

References

Read only the reference sections needed for the current task.

Related Skills

Load related skills only for missing capabilities; reuse established context.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.