/duckless:writing-jobsfrom DuckLess
Writes DuckLess data jobs (SQL, Python with duckless_runtime, or custom images) that read/write Parquet on GCS. Covers job types, performance rules, and GCS optimization.
Ships in DuckLess. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Three kinds of job; pick the simplest that fits:
| Job | When | Command |
|---|---|---|
.sql file | transformations expressible in SQL (most) | duckless run job.sql -m <machine> |
.py file | logic around queries, Python libraries, Arrow/NumPy UDFs | duckless run job.py -m <machine> |
| image + command | an existing tool (dbt-duckdb, a CLI) | duckless exec --image <img> -m <machine> -- <cmd> |
${VAR} is replaced from the job env: ${DUCKLESS_BUCKET}
(work bucket), ${DUCKLESS_JOB_ID}, and anything passed with -e KEY=VALUE.SELECT (20 rows) is shown by duckless result <job-id>: end with a small check
query (counts, min/max) rather than a big result.COPY … TO 'gs://…' (FORMAT parquet, PER_THREAD_OUTPUT, FILE_SIZE_BYTES '256MB').from duckless_runtime import connect, copy_to_parquet, log
con = connect() # GCS auth, memory, threads, spill dir, DuckLake `lake` when configured
copy_to_parquet(con, "SELECT …", "gs://bucket/out/")
log("done", rows=123) # structured log line, visible in `duckless logs`
httpfs. The runner serves gs:// with the gcs extension and
the job's service account. httpfs would take gs:// over and fail on credentials.stage_locally('gs://…') first. GCS gives ~100 MB/s per
stream; the runner fetches 32 ranges at once, and copying to the local SSD with 64 then reading
locally loaded a 12 GB CSV in 15 s instead of 130 s. Not for Cloud Run (no disk) nor Parquet.PER_THREAD_OUTPUT
reached about 900 MB/s on 32 vCPU. copy_to_parquet() does it for Python.con.create_function(..., type="arrow")) or rewrite in SQL.gs:// for files; gcss:// only for a DuckLake DATA_PATH.read_csv) and JSON (read_json) are built in; Excel
(LOAD excel, read_xlsx), Avro and Iceberg are in the runner image. Text formats are parsed
in full on every read: convert CSV/JSON to Parquet or a DuckLake table once, then query that.
Prefer newline-delimited JSON and many medium files over one big .gz (not split across threads).
Other extensions (delta, spatial) need an image built FROM the runner.bigquery_scan('project.dataset.table', filter = '…') in SQL, read_bigquery(con, table, columns, where) in Python (a DuckDB relation: SQL, Arrow batches, pandas, Polars). Select the columns
and filter: only those leave BigQuery. Needs init --bigquery-dataset <dataset>; large tables
read much faster on Cloud Batch (--on batch) than on Cloud Run.duckless.Client.from_env(), then
run(...), wait(job_id, check=True) (raises JobFailedError), cancel, logs. In an Airflow
task, cancel the job in an except BaseException so a killed task doesn't leave it running.to_bigquery(con, query, "project.dataset.table", mode=...) (Parquet on the
work bucket, then a free load job). Pick the mode for cost, never a plain MERGE by habit:
replace_partitions when each batch holds the complete content of every partition it touches
(a close rewrites its month, a daily load its day): bills 10 MB + the new rows, never the table.
Wrong on a table partitioned by load date, or by month with a batch of a few days: it deletes
whole partitions. Ask the user when unsure; it is their data's contract.merge with key=[...] for partial batches (corrections). Put the partition column in the key,
or prune=True if a row never changes partition: the MERGE then reads only the touched
partitions. A bigquery_merge_not_pruned log means it read the whole table.append / replace (whole table) need no existing table (partition_by, cluster_by create it).
On Spot, avoid append: a retried job loads its rows twice.max_bytes_billed= caps the SQL step. Needs init --bigquery-write-dataset <dataset>.FROM ghcr.io/tosun-si/duckless-runner:<version> to keep
duckless_runtime and the extensions; the runner service account needs
roles/artifactregistry.reader on the image's repository.Docs: https://tosun-si.github.io/duckless/guides/writing-jobs/
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub tosun-si/duckless --plugin duckless5 skills in this plugin
/ducklakeUse DuckLake tables with DuckLess - a Cloud SQL catalog attached as `lake` in every job, data as Parquet on GCS, snapshots and time travel. Use when someone wants tables instead of loose Parquet files, incremental loads, updates/deletes, time travel, or when a DuckLake attach fails./setupSet DuckLess up in a GCP project, either with its Terraform module in the team's own Terraform and CI/CD (recommended for teams) or with `duckless init` (quick start), then wire the .envrc. Use when someone starts with DuckLess, adds it to a project, integrates the module into Terraform or Terragrunt, upgrades it, or removes it./sizingChoose the machine, Spot, local SSD and runner (Cloud Batch or Cloud Run Jobs) for a DuckLess job, and resize it from the metrics of a previous run. Use when deciding `-m`, `--spot`, `--local-ssd` or `--on` for `duckless run`/`exec`, or when a job is slow, spills, runs out of memory or costs too much./troubleshootingDiagnose a failed, stuck or slow DuckLess job or a failing `duckless init`, from `duckless status`, `logs` and `result` to the fix. Use when a job is FAILED, stays QUEUED or SCHEDULED, is slower than expected, or when init/destroy errors.Other plugins' skills for the same job