Motherduck Create Flight logo

Motherduck Create Flight

Organization
motherduckdb
motherduck-create-flight

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

Overview

Publishermotherduckdb
Repositoryagent-skills
Skill namemotherduck-create-flight
Stars
62
Forks
6
Bundled files
2
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 2 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by motherduckdb on GitHub. Read the source before you install it.

Installation

Install the Motherduck Create Flight AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/motherduckdb/agent-skills/tree/main/plugins/motherduck-skills-claude/skills/motherduck-create-flight
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/motherduckdb/agent-skills.git /tmp/agent-skills
mkdir -p .claude/skills
cp -r /tmp/agent-skills/plugins/motherduck-skills-claude/skills/motherduck-create-flight .claude/skills/motherduck-create-flight
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Motherduck Create Flight in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Motherduck Create Flight on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Motherduck Create Flight is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Create and Manage MotherDuck Flights

Source Of Truth

  • Non-negotiable ordering: when MotherDuck MCP is available, call get_flight_guide before create_flight, update_flight, or edit_flight_source. The guide defines the current authoring contract, runtime limits, and tool semantics.
  • get_flight_guide 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 (MD_CREATE_FLIGHT, MD_RUN_FLIGHT, MD_LIST_FLIGHTS(), ...) 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 <secret_name>_<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 read_csv_auto/read_json_auto/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 max_runtime_sec when the workload needs an explicit cap; read the current plan limit from get_flight_guide instead of hardcoding it.
  • For production, use a service-account token via access_token_name 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 get_flight_guide before sizing disk- or memory-intensive work.
  • Keep the default size (F16) for dbt, dlt, and multi-step Python. Choose F4 for light jobs that mostly call APIs or send SQL, since SQL over md: runs on a Duckling, not the Flight. Move to F32 (Business and Enterprise) only when runs still fail from memory after reducing peak memory. Set it with instance_type on create_flight/update_flight or MD_CREATE_FLIGHT/MD_UPDATE_FLIGHT.
  • When a Flight touches only one or a few databases, connect with duckdb.connect("md:<db>?attach_mode=single") and attach the others explicitly; attaching the whole workspace slows every run's startup.
  • For classification, extraction, or embeddings inside a Flight, call prompt_jev(), prompt(), or embedding() in SQL over the existing connection instead of adding an LLM SDK.
  • To let teammates, a role, or a Dive's viewers start a Flight, the owner grants run (grant_access over MCP, or GRANT RUN ON FLIGHT '<flight_id>' TO ROLE <role>). Recommend the grantees and grant only after the user confirms; a request to share a Dive is not that confirmation. Prefer a role over ORGANIZATION, which includes service accounts. Every run uses the owner's token and secrets, so validate each config value a caller can pass as untrusted input.
  • Instrument every new Flight for the Flight Explainer by default: a # @flight Mermaid step chart plus a mark() helper that prints @flight-run <step> <status> lines (see the templates). It costs a few lines and cannot be added to a run after it starts, so skip it only when the user asks. Call get_flight_viz_guide for fan-out, branches, or child Flights, and use view_flight_run to show a run as a step diagram instead of pasting raw logs.
  • Ask the user to create Flight secrets in the MotherDuck UI (Settings, Secrets) so values never pass through chat; check existence with SELECT name FROM duckdb_secrets() WHERE type = 'flights'.

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 get_flight_guide (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 create_flight with name, source_code, pinned requirements_txt, config, and secret names — no schedule_cron yet.
  5. run_flight, poll get_flight_run when available (or list_flight_runs as a fallback) until terminal, and read get_flight_logs. Iterate with edit_flight_source (surgical) or update_flight (full field replacement); each content change creates a new version.
  6. If scheduling was requested, set it only after a successful run with update_flight(schedule_cron = ...) and state that cron is UTC. Clear it with schedule_cron = "" only when requested; preserve an existing schedule during unrelated edits.
  7. After the first successful run that creates or refreshes a durable table, create or update a private (user access) Guide for it under the data-sources topic, as get_flight_guide directs, and tell the user which Guide changed (see motherduck-manage-guides).
  8. If other users or a Dive must trigger the Flight, recommend run grants, apply them only after the user confirms, and verify with SHOW GRANTS ON FLIGHT '<flight_id>'.

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 and sizes, config vs secrets, scheduling, versioning, run lifecycle, run grants, Flight Explainer instrumentation, 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-create-dive when a Dive button or form should start the Flight (write-back)
  • 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

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Motherduck Create Flight AI skill do?

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

Why use Motherduck Create Flight on TypingMind?

Because you install it once and use it with any model. Motherduck Create Flight is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Motherduck Create Flight in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/motherduckdb/agent-skills/tree/main/plugins/motherduck-skills-claude/skills/motherduck-create-flight. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Motherduck Create Flight?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Motherduck Create Flight?

As many as you like. As long as a model supports skills, you can use Motherduck Create Flight with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Motherduck Create Flight AI skill free?

Yes. It is published on GitHub by motherduckdb under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇