motherduckdb/agent-skills

motherduck-create-flight

Create, run, schedule, or debug MotherDuck Flights, Python jobs executed on MotherDuck compute.

Hot #3963 First seen Jun 10, 2026

Installation

$ npx skills add motherduckdb/agent-skills --skill motherduck-create-flight

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from motherduckdb/agent-skills · top by installs.

npx skills add motherduckdb/agent-skills

Browse all from motherduckdb/agent-skills

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 56
License LICENSE
Default branch main
Open issues 0
Status Active

Skill metadata

Parsed from SKILL.md frontmatter.

LicenseMIT

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 6,147 B
  • docs SUMMARY.md 127 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 181 installs

SKILL.md

Create and Manage MotherDuck Flights

Source Of Truth

  • Non-negotiable ordering: when MotherDuck MCP is available, call getflightguide before createflight, updateflight, or editflightsource. The guide defines the current authoring contract, runtime limits, and tool semantics.
  • getflightguide also surfaces conventions from the reserved flights Guide topic. Apply those conventions when they fit the requested workload.
  • Prefer current MotherDuck Flights docs over memory. Verify lifecycle status, runtime limits, and tool semantics instead of preserving them as durable prompt claims.
  • Without MCP, the same operations exist as SQL functions (MDCREATEFLIGHT, MDRUNFLIGHT, MDLISTFLIGHTS(), ...) that execute server-side on a MotherDuck connection. Parameter names differ slightly between the two surfaces; see the naming table in references/FLIGHTS_GUIDE.md.

Default Posture

  • One Flight = one single-file Python script with def main(): ... and if name == "main": main(). No CLI args — every knob comes from env vars via config (non-secret) or TYPE flights secrets (sensitive).
  • Connect with duckdb.connect("md:"); the runtime injects MOTHERDUCK_TOKEN automatically. Never hardcode a token in source, config, or requirements.
  • Always pin dependencies in requirements_txt. Resolve the highest MotherDuck-supported DuckDB version from https://motherduck.com/docs/duckdb-versions.json before authoring a new Flight; use the tested pin in the included templates only when reproducing those examples. An unpinned or unsupported duckdb can fail at connect.
  • Each secret param is injected under a stable namespaced <secretname><PARAM> key and, when safe, a bare <PARAM> convenience alias. Prefer namespaced keys in deployed Flight code; bare aliases can collide, be overridden by config, and are withheld for reserved runtime keys.
  • Bulk-load, never row-by-row: stage to /tmp/ and readcsvauto/readjsonauto/read_parquet, or one CTAS / INSERT ... SELECT. No executemany() against MotherDuck.
  • Make every run idempotent: CREATE OR REPLACE TABLE full refresh, partition DELETE + INSERT, or dlt write_disposition="merge" with a primary key. Bootstrap with CREATE DATABASE IF NOT EXISTS / CREATE SCHEMA IF NOT EXISTS so the first run succeeds on a fresh account.
  • Validate any config-supplied identifier (database, schema, table names) against [A-Za-z][A-Za-z0-9]* before interpolating it into DDL; bind all data values as ? parameters.
  • Create the flight without a schedule first, trigger one on-demand run, read the logs, and only then attach schedule_cron (5-field cron, UTC).
  • Set and validate maxruntimesec when the workload needs an explicit cap; read the current plan limit from getflightguide instead of hardcoding it.
  • For production, use a service-account token via accesstokenname and keep its database permissions as narrow as the workload allows.
  • Treat a Flight as orchestration and light processing, not a place to crunch large tables in Python memory. Push heavy compute into SQL and verify runtime capacity with getflightguide before sizing disk- or memory-intensive work.

Workflow

  1. Classify the job: ingestion, transformation/refresh, export or alerting, or admin automation. If the job is interactive analysis or a one-off query, use motherduck-query instead — no Flight needed.
  2. Call getflightguide (MCP) and confirm which database the flight writes to with motherduck-explore.
  3. Reuse a matching template in references/FLIGHT_EXAMPLES.md when it fits; otherwise write a focused script that preserves the runtime, secrets, and idempotency contracts.
  4. Create any required TYPE flights secret first, then createflight with name, sourcecode, pinned requirementstxt, config, and secret names — no schedulecron yet.
  5. runflight, poll getflightrun when available (or listflightruns as a fallback) until terminal, and read getflightlogs. Iterate with editflightsource (surgical) or updateflight (full field replacement); each content change creates a new version.
  6. If scheduling was requested, set it only after a successful run with updateflight(schedulecron = ...) and state that cron is UTC. Clear it with schedule_cron = "" only when requested; preserve an existing schedule during unrelated edits.

For answer, review, or planning requests, do not create or schedule a Flight. For create or update requests, complete the requested in-scope deployment and on-demand validation; attaching a recurring schedule is authorized only when the request includes scheduling.

References

Read only the reference sections needed for the current task.

  • Read references/FLIGHTS_GUIDE.md for the full concept and operations reference: anatomy, runtime environment, config vs secrets, scheduling, versioning, run lifecycle, the complete MCP tool reference, MCP-vs-SQL naming, loading strategies by data volume, and troubleshooting.
  • Read references/FLIGHT_EXAMPLES.md for three complete, best-practice flight templates (dlt ingestion, Postgres ingestion, scheduled S3 partition refresh) with their requirements.txt, secret setup, and deploy calls.

Related Skills

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

  • motherduck-load-data for choosing the ingestion SQL the flight will run (CTAS, INSERT ... SELECT, cloud-storage secrets)
  • motherduck-query for validating the DuckDB SQL inside the flight before deploying it
  • motherduck-explore for confirming target databases, schemas, and tables exist
  • motherduck-build-data-pipeline when the work is a full raw/staging/analytics pipeline design and the flight is just its scheduler
  • motherduck-cli when the agent has a shell and should keep Flight source in local files
  • motherduck-manage-guides for reusable personal or organization Flight conventions