Agent Skill · MotherDuck

motherduck-query

Execute DuckDB SQL queries against MotherDuck databases. Use when running analytics, aggregations, transformations, or any SQL operation. Covers query best practices, CTEs, window functions, QUALIFY, and performance optimization.

Provider: MotherDuck Path in repo: plugins/motherduck-skills/skills/motherduck-query/SKILL.md

Skill body

Query MotherDuck

Use this skill when executing SQL queries for analytics, aggregations, transformations, or data exploration against MotherDuck databases.

Prerequisites

Default Posture

Workflow

  1. Confirm the actual tables, columns, and grain before writing SQL.
  2. Write the query in SQL first, then wrap it in Python or TypeScript only if needed.
  3. Use CTEs and DuckDB-native patterns such as GROUP BY ALL, QUALIFY, and arg_max.
  4. Check the plan, row count, and shape for pushdown, unnecessary sorts, or repeated raw rescans.
  5. Materialize expensive repeated queries into serving tables or light views when warranted.

Open Next

Skill frontmatter

license: MIT