portaljs-add-geo

portaljs-add-geo is a command for Claude Code from datopian/portaljs. It costs 103 tokens per session (6,256 once invoked), scanned B, original, MIT.

A command that turns a geospatial file—such as GeoJSON, a Shapefile, GeoPackage, KML, or a geometry-containing CSV—into a PortalJS dataset with map and query versions.

In plain words
What is it for?
Use it to normalize coordinates to EPSG:4326, create PMTiles for map rendering and GeoParquet for spatial SQL queries, upload the outputs to R2 through Git LFS, and add the required catalogue entry.
Why use it?
It prepares the same upload for both interactive map display and spatial data analysis, while preserving the original file for download.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is `TOKEN=$(python3 ../../giftless/mint-token.py --org datopian --repo <project-slug> --ttl 3600 --algorithm RS256 --key-file ../../giftless/jwt_private_key)`.

Part of the portaljs plugin — 14 skills, 25 commands shipped together

Good fit Use it to normalize coordinates to EPSG:4326, create PMTiles for map rendering and GeoParquet for spatial SQL queries, upload the outputs to R2 through Git LFS, and add the required catalogue entry.

Compare 6 commands from other repositories ↓
About the project

PortalJS is a framework for building data portals that present searchable datasets through a home page, catalog, and dataset showcase. It is for teams that want to choose a data backend, scaffold a Next.js portal, load CSV or JSON data, connect services such as CKAN, and deploy the result. The catalogue entries are agent commands, skills, instructions, and a plugin that guide portal creation and data loading.

datopian/portaljs · 2,350 stars · on GitHub · portaljs.com

Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/datopian/portaljs
agentmods
npx agentmods add commands/datopian/portaljs/portaljs-add-geo

Made for: Claude Code.

Or install portaljs, the plugin that ships this one along with the rest of its 14 skills, 25 commands.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for portaljs-add-geo

README.md
[![agentmods](https://agentmods.dev/badge/commands/datopian/portaljs/portaljs-add-geo/github.svg)](https://agentmods.dev/commands/datopian/portaljs/portaljs-add-geo)
Your own site
<a href="https://agentmods.dev/commands/datopian/portaljs/portaljs-add-geo"><img src="https://agentmods.dev/badge/commands/datopian/portaljs/portaljs-add-geo/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for portaljs-add-geo

Your own site · 80×15
<a href="https://agentmods.dev/commands/datopian/portaljs/portaljs-add-geo"><img src="https://agentmods.dev/badge/commands/datopian/portaljs/portaljs-add-geo.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 103 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 6,256 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 2 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00103 $0.06256
Opus 5 $0.00051 $0.03128
Sonnet 5 $0.00021 $0.01251
Haiku 4.5 $0.00010 $0.00626

Measured 11d ago against content hash 2011da4957b8, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade B, and why

portaljs-add-geo scanned grade B with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

Debian/Ubuntu: sudo apt-get install -y gdal-bin duckdb # tippecanoe: apt where available,

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -fL "$SOURCE" -o "/tmp/$DATASET_SLUG.$EXT"
.claude/commands/portaljs-add-geo.md · 426 lines

How it starts

The opening of the file, as written. The whole thing — 426 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/portaljs-add-geo

Turn one geospatial upload into a dual-tier PortalJS dataset entirely on the user's machine — no server-side container compute, keeping the zero-backend bet end-to-end. From a single source file this produces two derivatives plus the preserved original:

  • PMTiles — the render tier. A single vector-tile archive <MapPreview> renders with MapLibre GL over HTTP range requests: any dataset size pans/zooms with no tile server.
  • GeoParquet — the query tier. A GeoParquet 1.1 file (covering bbox column, Hilbert-sorted) <GeoQuery> runs spatial SQL over in place via DuckDB-Wasm.
  • Original — the untouched upload in its native CRS, kept downloadable as the source artifact.

All three land on Cloudflare R2 (via Git LFS → Giftless), and the skill appends one datasets.json entry whose resources[] are exactly the shape the showcase auto-renders (PR #1647 / the @reference/world-boundaries demo): a pmtiles resource → <MapPreview>, a geoparquet resource → <GeoQuery>, and the original as a download. No page edits — the dynamic showcase route pages/[owner]/[slug].tsx renders each resource by its format.

This automates the manual tippecanoe / duckdb recipes documented in the template README (the interim ingest path). Use it whenever the source is a vector geo format; for plain tabular data use /portaljs-add-dataset, and for a Leaflet view over small GeoJSON use /portaljs-add-map.

Runtime — native shell-out, detect-or-instruct

This runs native CLIs on the user's machine (locked direction, 2026-07-08 — overrides po-6sr §7's server-compute sketch). No container, no cloud job. tippecanoe has no mature WASM build, so the PMTiles tier fundamentally needs the native binary; skills already shell out to git-lfs and npm, so native geo deps fit the model. Three tools:

Tool Role Why this tool
GDAL (ogr2ogr, ogrinfo) Read every vector input; reproject → EPSG:4326; emit the normalized GeoJSON intermediate Widest driver set (SHP, GPKG, KML/KMZ, FGB, CSV-geom)
tippecanoe normalized GeoJSON → PMTiles (render tier) The de-facto tiler; no WASM equivalent
duckdb (+ spatial) normalized GeoJSON → GeoParquet 1.1 with covering bbox + Hilbert sort (query tier) The proven writer — PR #1647 verified <GeoQuery> against duckdb output; ogr2ogr's Parquet driver won't cleanly emit the covering-bbox column + Hilbert ordering the bbox-first query needs to prune

Read the full file on GitHub · 426 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 426 lines · 103 tokens per session scan B 2011da4957b8

Subscribe to this mod's changes

portaljs-add-geo is a command published in the GitHub repository datopian/portaljs (2,350 stars, last pushed 3d ago), licensed MIT. It adds 103 tokens to every session and 6,256 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it B with 2 findings (asks for root, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.