portaljs-add-resource

portaljs-add-resource is a command for Claude Code from datopian/portaljs. It costs 48 tokens per session (1,598 once invoked), scanned A, original, MIT.

A command that adds another file to an existing PortalJS dataset. A dataset can contain several resources, such as data, a data dictionary, or a methodology document.

In plain words
What is it for?
Use it to add CSV, TSV, JSON, or GeoJSON files to an existing dataset, including converting a single-file dataset into a multi-file collection.
Why use it?
It keeps related files together and makes the dataset showcase display a separate section for each resource.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is /portaljs-add-resource orders ./data/orders-data-dictionary.csv (title: "Data dictionary").

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

Good fit Use it to add CSV, TSV, JSON, or GeoJSON files to an existing dataset, including converting a single-file dataset into a multi-file collection.

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,349 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-resource

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

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

Your own site · 80×15
<a href="https://agentmods.dev/commands/datopian/portaljs/portaljs-add-resource"><img src="https://agentmods.dev/badge/commands/datopian/portaljs/portaljs-add-resource.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 48 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,598 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.00048 $0.01598
Opus 5 $0.00024 $0.00799
Sonnet 5 $0.00010 $0.00320
Haiku 4.5 $0.00005 $0.00160

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

Security

Grade A, and why

portaljs-add-resource 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 9d 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.

# or for URLs: curl -L SOURCE -o PORTAL_DIR/public/data/RESOURCE_NAME.EXT
.claude/commands/portaljs-add-resource.md · 140 lines

How it starts

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

/portaljs-add-resource

Add a resource (an additional file) to a dataset that already exists in a portaljs-catalog portal. Use this when a dataset is more than one file — data + a data dictionary + a methodology doc, or quarterly/yearly files under one dataset. Where /portaljs-add-dataset creates a new dataset (one file), this adds a file to an existing one.

Mirrors the Frictionless Data Package model: a dataset holds a resources[] array, and the showcase at /@<namespace>/<slug> renders one section per resource (preview, schema, download). A single-file dataset is migrated to resources[] automatically the first time you add a second file — no data is lost.

Required input — ask, don't error

  • Target dataset — which dataset to add to, by slug (or namespace/slug).
  • Source — a local file path or a public URL for the new resource.
  • Portal directory — defaults to the current directory.
  • Resource name/title (optional) — a short id + human title for the resource.

Supported formats: CSV, TSV, JSON (array), GeoJSON (same as /portaljs-add-dataset).

If the target dataset or source is missing, ask — never dead-end. When the user doesn't know the slug, read datasets.json and list the datasets so they can pick.

Steps

1. Gather input from $ARGUMENTS (interview if thin)

Extract:

  • DATASET — target dataset slug (or namespace/slug).
  • SOURCE — file path or URL of the new resource.
  • PORTAL_DIR — portal directory (default: .).
  • RESOURCE_NAME — short id within the dataset (default: lowercase-hyphenated filename stem; must be unique among the dataset's resources).
  • RESOURCE_TITLE — human title (default: derived from the filename).
  • DESCRIPTION — optional one-line description of the resource.

If DATASET or SOURCE is missing, ask (listing existing datasets from datasets.json when the slug is unknown) and wait.

2. Validate the portal + locate the dataset

Read the full file on GitHub · 140 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. 9d ago First seen · 140 lines · 48 tokens per session scan A b084556192e3

Subscribe to this mod's changes

portaljs-add-resource is a command published in the GitHub repository datopian/portaljs (2,349 stars, last pushed yesterday), licensed MIT. It adds 48 tokens to every session and 1,598 once invoked, about $0.0002 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.