Official agent skill

Spatial

by duckdb in duckdb/duckdb-skills

Answer questions about spatial data using DuckDB. An agent skill from duckdb/duckdb-skills.

OfficialMITAuto-check: notesBackend & APIs

Install Spatial

skills CLI
$ npx skills add duckdb/duckdb-skills --skill spatial -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install duckdb/duckdb-skills spatial --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/duckdb/duckdb-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/spatial .claude/skills/spatial && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
spatial
GitHub stars
600
Used in
1 other repo
Token cost
~1k tokens
SKILL.md length
413 words
Files
3 (incl. references)
Skills in repo
8
Repo updated
First seen
Licence
MIT

At a glance

Answer questions about spatial data using DuckDB. An agent skill from duckdb/duckdb-skills.

  • Works in 3 steps: Understand what the user needs → Write and run the query → Present results
  • The user mentions locations
  • SKILL.md covers Step 1 — Understand what the…, Step 2 — Write and run the query and Step 3 — Present results
  • Calls duckdb

What it does

Spatial is an agent skill from duckdb/duckdb-skills, published by the product's own GitHub organization. Answer questions about spatial data using DuckDB. Use when the user mentions locations, coordinates, lat/lng, distances, maps, addresses, "near", "within", "closest", geographic names, or spatial file formats (GeoJSON, Shapefile, GeoPackage, GPX, GeoParquet). Also triggers when the user wants to find places, buildings, or roads — Overture Maps provides free global data on S3 with zero API keys. Handles spatial joins, distance calculations, containment checks, density analysis, and format conversions for…

Its SKILL.md is about 1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files, including reference files (for example `references/functions.md` and `references/overture.md`).

It sits in Backend & APIs, covering File uploads and storage and Geospatial analysis. It works with DuckDB. The licence is MIT.

When your agent uses it

  • The user mentions locations
  • Geographic names
  • Spatial file formats (GeoJSON
  • The user wants to find places

Example prompts

  • “within”
  • “closest”
  • “/spatial”

Requirements

  • Pre-approved tools (allowed-tools): Bash

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. Understand what the user needs
  2. Write and run the query
  3. Present results

What it can do on your machine

Read from SKILL.md and the folder at commit 7feda8e. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Bash

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • duckdb

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Spatial loads about 1k tokens when it runs, and up to ~3.9k if it reads all its reference files. Until then it costs about 133 tokens; SKILL.md has 413 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~133
When it runs · the whole SKILL.md, loaded when a task matches
~1k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~3.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Bash

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from duckdb/duckdb-skills at commit 7feda8e, republished under its MIT licence (© duckdb). 413 words, ~1,026 tokens.

Download SKILL.mdSave it as .claude/skills/spatial/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
spatial
description
Answer questions about spatial data using DuckDB. Use when the user mentions locations, coordinates, lat/lng, distances, maps, addresses, "near", "within", "closest", geographic names, or spatial file formats (GeoJSON, Shapefile, GeoPackage, GPX, GeoParquet). Also triggers when the user wants to find places, buildings, or roads — Overture Maps provides free global data on S3 with zero API keys. Handles spatial joins, distance calculations, containment checks, density analysis, and format conversions for geographic data.
allowed-tools
Bash
argument-hint
<question or file> [additional context]

You are answering spatial questions using DuckDB's spatial extension and, when needed, Overture Maps as a free global data source.

Question or file: $0 Additional context: ${1:-}

Step 1 — Understand what the user needs

Classify the question:

PatternData sourceKey functions
"Find X near Y" (no user file)Overture Maps on S3ST_Distance_Spheroid, bbox filtering
"How far between A and B"Geocode or user dataST_Distance_Spheroid
"Which points fall inside polygons"User filesST_Contains
"Analyze this GeoJSON/Shapefile/GPX"User fileST_Read, measurement functions
"Show density/hotspots"User or Overture dataH3 hex binning
"Convert to GeoJSON/GeoPackage"User fileCOPY TO (FORMAT GDAL)
"Count buildings/roads in area"Overture Mapsbbox filtering + aggregation

If the question involves real-world places, POIs, buildings, roads, or boundaries and the user hasn't provided a file, use Overture Maps — read references/overture.md for S3 paths and schema.

For spatial function syntax, read references/functions.md.

Step 2 — Write and run the query

Always start with:

sql
LOAD spatial;
SET geometry_always_xy = true;

Add extensions as needed:

  • Overture/remote data: LOAD httpfs; CREATE SECRET (TYPE S3, PROVIDER config, REGION 'us-west-2');
  • H3 hex binning: INSTALL h3 FROM community; LOAD h3;
Key principles

bbox filtering first — When querying Overture, always filter on bbox.xmin/xmax/ymin/ymax before any spatial function. This uses Parquet predicate pushdown and avoids downloading the full dataset.

Always set geometry_always_xy = true — This ensures all spatial functions interpret coordinates as longitude, latitude (the standard for Overture, GeoJSON, and most data sources). Without it, spheroid functions assume latitude first and return wrong results.

Use spheroid functions for real-world distances — ST_Distance_Spheroid returns meters on the WGS84 ellipsoid. Plain ST_Distance uses planar coordinates and gives meaningless results for lat/lng. Important: spheroid functions (ST_Distance_Spheroid, ST_Area_Spheroid, etc.) require POINT_2D inputs, not generic GEOMETRY. Overture geometry columns are typed GEOMETRY('OGC:CRS84') and cannot be cast directly. Extract coordinates first:

Show full SKILL.md (123 more words)Show less
sql
ST_Point(ST_X(geometry), ST_Y(geometry))::POINT_2D

CSV with lat/lng needs conversion — ST_Point(longitude, latitude) (longitude first). This is the most common gotcha.

Run the query in a single bash call:

bash
duckdb -c "
LOAD spatial;
<ADDITIONAL_SETUP>
<YOUR_QUERY>
"

Step 3 — Present results

  • For tabular results: show the data directly
  • For spatial results: consider exporting to GeoJSON for visualization (COPY TO 'result.geojson' WITH (FORMAT GDAL, DRIVER 'GeoJSON'))
  • For distance/area results: use human-readable units (km for large distances, m for small)
  • For density/hotspot results: describe the pattern and offer to export for visualization

If the query fails:

  • duckdb: command not found → delegate to /duckdb-skills:install-duckdb
  • Missing extension → INSTALL spatial; LOAD spatial; or INSTALL h3 FROM community; LOAD h3;
  • S3 access denied → suggest checking AWS credentials
  • No results with Overture → widen the bbox, check the category spelling, or try a broader search

© duckdb, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (references) in skills/spatial of duckdb/duckdb-skills.

  • SKILL.md
  • references/functions.md
  • references/overture.md

Open the folder on GitHubat commit 7feda8e

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in duckdb/duckdb-skills, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Spatial next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Spatial compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Spatial this skillduckdb/duckdb-skills6001 repos~1kAutomated safety check: NotesMIT
Ops Telemetry Queryboundless-xyz/boundless193—~3.8kAutomated safety check: PassApache-2.0
Portaljs Add Geodatopian/portaljs2.4k1 repos~1.7kAutomated safety check: PassMIT
Investigate Datawalkthru-earth/geocoding-playground153—~935Automated safety check: PassCC-BY-4.0
Dinobase Connector Builderkappa90/dinobase263—~1.9kAutomated safety check: PassCustom licence
Create Environmentgodatadriven/whirl205—~1.9kAutomated safety check: PassApache-2.0

Similar skills

  • Ops Telemetry Query

    boundless-xyz/boundless

    Internal — for Boundless team members only. An agent skill from boundless-xyz/boundless.

    193 GitHub stars~3.8k tokensUpdated 1 mo ago
    DatabasesAuto-check passed
  • Portaljs Add Geo

    datopian/portaljs

    Auto-ingest a geospatial file (GeoJSON, Shapefile, GeoPackage, KML/KMZ, FlatGeobuf, CSV-with-geometry) into a PortalJS portal on the user's own machine, with no server.

    2.4k GitHub starsUsed in 1 repo~1.7k tokens
    Data & AnalyticsAuto-check passed
  • Investigate Data

    walkthru-earth/geocoding-playground

    Investigates geocoder data quality issues by querying live S3 parquet files via MotherDuck MCP.

    153 GitHub stars~935 tokensUpdated 3 mo ago
    Data & AnalyticsAuto-check passed
  • Writes a new Dinobase YAML connector for a REST API that has no verified dlt source, covering auth, pagination, read and write endpoints and incremental loading.

    263 GitHub stars~1.9k tokensUpdated 3 mo ago
    Backend & APIsAuto-check passed
  • Create Environment

    godatadriven/whirl

    Create a new Whirl environment in the envs/ directory. An agent skill from godatadriven/whirl.

    205 GitHub stars~1.9k tokensUpdated 6 days ago
    Backend & APIsAuto-check passed
  • Querying Big Datasets

    flyrank-bih/flyrank-ml-internship-starter

    Works with datasets far too big to download or load in pandas — SQL over remote Parquet with DuckDB, aggregate-then-model, iterate on samples.

    140 GitHub stars~750 tokensUpdated 1 mo ago
    Data & AnalyticsAuto-check passed

More from duckdb/duckdb-skills

All 8 skills in this repo
  • Convert File

    duckdb/duckdb-skills

    Official

    Convert any data file to another format: CSV, Parquet, JSON, Excel, GeoJSON, and more.

    600 GitHub starsUsed in 1 repo~720 tokens
    Auto-check: notes
  • S3 Explore

    duckdb/duckdb-skills

    Official

    Explore and query data on S3, Cloudflare R2, GCS, MinIO, or any S3-compatible storage.

    600 GitHub starsUsed in 1 repo~848 tokens
    Auto-check: notes
  • Read File

    duckdb/duckdb-skills

    Official

    Read any data file (CSV, JSON, Parquet, Avro, Excel, spatial, SQLite) or remote URL (S3, HTTPS).

    600 GitHub starsUsed in 1 repo~917 tokens
    Auto-check: notes
  • Attach DB

    duckdb/duckdb-skills

    Official

    Attach a DuckDB database file for use with /duckdb-skills:query.

    600 GitHub starsUsed in 1 repo~1.2k tokens
    Auto-check: notes
  • Duckdb Docs

    duckdb/duckdb-skills

    Official

    Search DuckDB and DuckLake documentation and blog posts. An agent skill from duckdb/duckdb-skills.

    600 GitHub starsUsed in 1 repo~1.4k tokens
    Auto-check: notes
  • Query

    duckdb/duckdb-skills

    Official

    Run SQL queries against the attached DuckDB database or ad-hoc against files.

    600 GitHub starsUsed in 1 repo~2k tokens
    Auto-check: notes

Works with

Questions about Spatial

What does Spatial do?

Answer questions about spatial data using DuckDB. An agent skill from duckdb/duckdb-skills. Spatial is an agent skill from duckdb/duckdb-skills, published by the product's own GitHub organization. Answer questions about spatial data using DuckDB.

When should I use Spatial?

Spatial fits situations like: the user mentions locations; geographic names; spatial file formats (GeoJSON; the user wants to find places.

How do I install Spatial in Claude Code?

Run `npx skills add duckdb/duckdb-skills --skill spatial -a claude-code`. Or copy the skill folder (skills/spatial in duckdb/duckdb-skills) into .claude/skills/spatial in your project. Claude Code loads it when a task matches its description.

How do I install Spatial in Codex?

Run `npx skills add duckdb/duckdb-skills --skill spatial -a codex`. Or copy the skill folder (skills/spatial in duckdb/duckdb-skills) into .agents/skills/spatial in your project. Codex loads it when a task matches its description.

Can I use Spatial in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add duckdb/duckdb-skills --skill spatial -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/spatial, .gemini/skills/spatial, .github/skills/spatial and .opencode/skills/spatial in your project.

What does Spatial need to run?

Going by SKILL.md and its folder, Spatial needs the command-line tools its instructions call (duckdb). Its frontmatter pre-approves these tools: Bash.

Does Spatial access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Spatial safe to install?

Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Spatial use?

Spatial is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Spatial use?

About 1k tokens (SKILL.md is roughly 4.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2.9k tokens, read only when the agent opens those files.

What are the alternatives to Spatial?

Skills that share tags, products or a category with Spatial: Ops Telemetry Query (boundless-xyz/boundless, 193 stars), Portaljs Add Geo (datopian/portaljs, 2.4k stars), Investigate Data (walkthru-earth/geocoding-playground, 153 stars) and Dinobase Connector Builder (kappa90/dinobase, 263 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Spatial?

duckdb (a GitHub organization, an official publisher) maintains it in duckdb/duckdb-skills, which has 600 GitHub stars. The repository holds 8 skills in this directory. The repository was last updated on April 23, 2026.

Source: duckdb/duckdb-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.