portaljs-add-dataset

portaljs-add-dataset is a command for Claude Code from datopian/portaljs. It costs 66 tokens per session (4,673 once invoked), scanned A, original, MIT.

A command for adding CSV, TSV, JSON, or GeoJSON data to an existing PortalJS data catalogue, a website that lists and displays datasets.

In plain words
What is it for?
Use it to add a dataset entry to PortalJS, store local data through the configured Git LFS and R2 path when appropriate, or reference a remote URL so the catalogue and showcase can display it automatically.
Why use it?
It keeps the catalogue's central dataset list updated and chooses how local files or remote URLs should be stored and served.

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> \.

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

Good fit Use it to add a dataset entry to PortalJS, store local data through the configured Git LFS and R2 path when appropriate, or reference a remote URL so the catalogue and showcase can display it automatically.

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

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

README.md
[![agentmods](https://agentmods.dev/badge/commands/datopian/portaljs/portaljs-add-dataset/github.svg)](https://agentmods.dev/commands/datopian/portaljs/portaljs-add-dataset)
Your own site
<a href="https://agentmods.dev/commands/datopian/portaljs/portaljs-add-dataset"><img src="https://agentmods.dev/badge/commands/datopian/portaljs/portaljs-add-dataset/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-dataset

Your own site · 80×15
<a href="https://agentmods.dev/commands/datopian/portaljs/portaljs-add-dataset"><img src="https://agentmods.dev/badge/commands/datopian/portaljs/portaljs-add-dataset.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 66 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 4,673 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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.00066 $0.04673
Opus 5 $0.00033 $0.02337
Sonnet 5 $0.00013 $0.00935
Haiku 4.5 $0.00007 $0.00467

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

Security

Grade A, and why

portaljs-add-dataset 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 10d 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.

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

How it starts

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

/portaljs-add-dataset

Add a dataset to an existing PortalJS (portaljs-catalog) portal. Appends one entry to datasets.json — the single source of truth for the catalog — and routes the data to the right place by source first, then size. No per-dataset page is created: the catalog at /search lists it and the dynamic showcase route pages/[owner]/[slug].tsx renders it automatically at /@<namespace>/<slug>.

The routing matrix — branch on SOURCE, then size

Where the bytes end up depends first on where they come from, then on size/intent. The manifest's resource.path (or single-file file) is the unifying abstraction: resourceUrl() in lib/datasets.ts serves a repo-relative path from /public/data and passes an absolute URL straight through. So every route below just decides what string to write into path.

Source Default What happens Manifest path
Local file R2 via Git LFS mv into the repo, git lfs track <path>, commit a ~134 B pointer, git lfs push → Giftless → R2 (no GitHub remote needed) absolute R2 URL (browser fetches R2 directly)
Local file (fenced) inline Only bundled SAMPLE data or an OSS self-host with no R2: cp into public/data/ (stays inline per .gitattributes fence) bare filename → /data/<file>
Remote URL passthrough record the URL as-is — no download, no upload, zero duplication the absolute URL, unchanged
Remote URL adopt (opt-in) user wants it hosted/versioned under the portal: fetch → route as a local file (R2/LFS) absolute R2 URL

Storage decision (epic po-g9y): the default for added data is R2, regardless of size or format. Inline is not a size threshold — it is a fenced exception for bundled sample data and the OSS-no-R2 fallback. Remote URLs default to passthrough (copy nothing); adopting one into R2 is an explicit opt-in.

Remote-URL passthrough caveat: serving and linking always work. But in-browser range / DuckDB queries against a 3rd-party URL need CORS + range support on that host, which we don't control. If the user needs querying (not just preview/download) and the remote lacks CORS/range, recommend the adopt-into-R2 option.

Read the full file on GitHub · 326 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. 10d ago First seen · 326 lines · 66 tokens per session scan A 7baf2323272a

Subscribe to this mod's changes

portaljs-add-dataset is a command published in the GitHub repository datopian/portaljs (2,350 stars, last pushed 2d ago), licensed MIT. It adds 66 tokens to every session and 4,673 once invoked, about $0.0003 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.