portaljs-migrate

portaljs-migrate is a command for Claude Code from datopian/portaljs. It costs 135 tokens per session (10,211 once invoked), scanned A, original, MIT.

A command for copying datasets from open-data platforms into a PortalJS catalog, a website that lists and presents public datasets. It reads supported catalog APIs or feeds, converts records to one format, and saves them in the catalog.

In plain words
What is it for?
Use it to import datasets from CKAN, DCAT catalogs, Socrata, OpenDataSoft, or ArcGIS FeatureServer into PortalJS's static catalog and search pages.
Why use it?
It lets the portal keep its own snapshot of external datasets, so it can work without connecting to the source platform at build time. The migration can be run again when the source changes.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

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

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,349 stars · on GitHub · portaljs.com

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

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

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-migrate

README.md
[![agentmods](https://agentmods.dev/badge/commands/datopian/portaljs/portaljs-migrate.svg)](https://agentmods.dev/commands/datopian/portaljs/portaljs-migrate)
Your own site
<a href="https://agentmods.dev/commands/datopian/portaljs/portaljs-migrate"><img src="https://agentmods.dev/badge/commands/datopian/portaljs/portaljs-migrate.svg" alt="Measured on agentmods" height="20"></a>
Per session 135 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 10,211 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
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.00135 $0.10211
Opus 5 $0.00068 $0.05105
Sonnet 5 $0.00027 $0.02042
Haiku 4.5 $0.00014 $0.01021

Measured 6d ago against content hash dd03e8cbba99, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

portaljs-migrate scanned grade A with 1 finding 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 6d 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.

Makes network callslowCapability

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

- Otherwise probe CKAN: `curl -s -m 20 "SOURCE_URL/api/3/action/package_search?rows=1"` →
.claude/commands/portaljs-migrate.md · 623 lines

How it starts

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

/portaljs-migrate

Harvest datasets from an external open-data platform into an existing portaljs-catalog portal. The source's datasets are read over its API, mapped to the portal's canonical dataset shape, and written into datasets.json (the static catalog's single source of truth) — so the /search catalog and the /@<namespace>/<slug> showcases render them like any hand-added dataset.

This is the copy-into-the-portal path. It is the inverse of /portaljs-connect-ckan: connect-ckan keeps the source authoritative and reads it live at build time; /portaljs-migrate takes a one-time (re-runnable) snapshot into the static catalog, so the portal stands alone and needs no backend.

Hub-and-spoke model

Every source is read into one canonical shape (the template's Dataset/Resource type — a Frictionless-aligned { slug, namespace, name, description, resources[] }), then written to the target from that canonical form. Add a source once and it migrates to every target.

Sources:

Source --source How it's read Covers
CKAN ckan REST API (package_search / package_show) any CKAN instance
DCAT-US /data.json dcat one catalog document (plain JSON) DKAN, ArcGIS Hub, data.gov, other DCAT-US publishers
DCAT / DCAT-AP RDF feed dcat-rdf RDF catalog in JSON-LD, Turtle, or RDF/XML data.europa.eu, national DCAT-AP portals (SE/CH/DE), GeoDCAT-AP, any DCAT 2/3 RDF feed
Socrata socrata Discovery API + per-dataset resource exports Socrata-powered open-data sites
OpenDataSoft ods Explore API v2 catalog + exports ODS-powered portals
ArcGIS FeatureServer / MapServer arcgis layer metadata + GeoJSON query individual ArcGIS map/feature services

DKAN, ArcGIS Hub, and data.gov publish a DCAT-US /data.json — use the dcat source for those whole catalogs. Use arcgis for an individual FeatureServer/MapServer (each layer becomes a GeoJSON dataset, which /data.json doesn't expose).

dcat vs dcat-rdf. dcat reads the flat DCAT-US /data.json (Project Open Data JSON — dataset[] with distribution[]). dcat-rdf reads a DCAT / DCAT-AP RDF graph serialized as JSON-LD (.jsonld), Turtle (.ttl), or RDF/XML (.rdf) — the form data.europa.eu and national DCAT-AP portals publish. This is the inbound counterpart of /portaljs-add-dcat (which EXPOSES the portal as DCAT-AP RDF): the two make a portal a full two-way DCAT interop node — expose to, and harvest from, national DCAT-AP portals. Both read through the SAME profile registry (lib/metadata/dcat-profiles.ts), so expose and consume stay in sync.

Read the full file on GitHub · 623 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. 6d ago First seen · 623 lines · 135 tokens per session scan A dd03e8cbba99

Subscribe to this mod's changes

portaljs-migrate is a command published in the GitHub repository datopian/portaljs (2,349 stars, last pushed 2d ago), licensed MIT. It adds 135 tokens to every session and 10,211 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.