portaljs-new-portal

portaljs-new-portal is a command for Claude Code from datopian/portaljs. It costs 28 tokens per session (3,786 once invoked), scanned C, original, MIT.

A command that scaffolds a new PortalJS data portal from a project brief. PortalJS is a framework for publishing searchable datasets with pages for a homepage, catalogue, and individual dataset details.

In plain words
What is it for?
Creating the portal files, asking for missing requirements, filling in project details, adding initial datasets, installing dependencies, and checking that the build works.
Why use it?
It provides a repeatable starting structure when a data portal brief is incomplete or a new project would otherwise require manual setup.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: positional $N argument.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is departments (multiple publishers). Start with ./data/parks.csv and ./data/budget.csv..

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

Good fit Creating the portal files, asking for missing requirements, filling in project details, adding initial datasets, installing dependencies, and checking that the build works.

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-new-portal

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-new-portal

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

Your own site · 80×15
<a href="https://agentmods.dev/commands/datopian/portaljs/portaljs-new-portal"><img src="https://agentmods.dev/badge/commands/datopian/portaljs/portaljs-new-portal.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 28 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,786 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 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.00028 $0.03786
Opus 5 $0.00014 $0.01893
Sonnet 5 $0.00006 $0.00757
Haiku 4.5 $0.00003 $0.00379

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

Security

Grade C, and why

portaljs-new-portal scanned grade C 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 12d 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

rm -rf "./$PROJECT_SLUG/node_modules" "./$PROJECT_SLUG/.next"
.claude/commands/portaljs-new-portal.md · 318 lines

How it starts

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

/portaljs-new-portal

Scaffold a production-ready PortalJS data portal. The skill is interactive: if the brief is thin, it interviews the user in three short rounds (mapped to the template's three surfaces — Home, Catalog, Showcase), echoes a brief back for confirmation, then copies examples/portaljs-catalog, substitutes placeholder tokens, sets the namespace mode, seeds any datasets, installs dependencies, and verifies the build.

The template you are scaffolding

examples/portaljs-catalog is the canonical template. It has three surfaces:

Surface Route File What it is
Home / pages/index.tsx Search-first landing: hero + search box + suggested-query chips (__PROJECT_NAME__ / __DESCRIPTION__ tokens)
Catalog / search /search pages/search.tsx Client-side full-text list over datasets.json
Dataset showcase /@<namespace>/<slug> pages/[owner]/[slug].tsx One dataset: metadata, Table data preview, Download & API, and a Views placeholder for charts/maps

The catalog is driven by datasets.json (the single source of truth) — each entry is { slug, name, description, file, format, namespace }. lib/datasets.ts exposes getDatasets(), getDataset(slug), getDatasetByNamespace(ns, slug), datasetHref(d)/@${namespace}/${slug}, and a NAMESPACE_TYPE: 'theme' | 'owner' constant.

A portal uses exactly one namespace mode:

  • 'theme' — a single-publisher portal whose datasets are grouped by subject (e.g. @reference/country-codes). The showcase labels the namespace "Theme".
  • 'owner' — a multi-publisher portal whose datasets are grouped by who published them (e.g. @worldbank/country-codes). The showcase labels the namespace "Owner".

Search is a static client-side list for now. A live backend (e.g. CKAN, via /portaljs-connect-ckan) can replace datasets.json later without changing the URL structure.

Required input — interview, don't error

You need a project name and one-line description. Datasets are optional at scaffold time. Never dead-end with a missing-input error. If $ARGUMENTS is empty or thin, run the structured interview in Step 1 to gather what's missing. The user can say "use defaults" at any point to skip a round and accept the defaults below.

Read the full file on GitHub · 318 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. 12d ago First seen · 318 lines · 28 tokens per session scan C 5fab3426066b

Subscribe to this mod's changes

portaljs-new-portal is a command published in the GitHub repository datopian/portaljs (2,350 stars, last pushed 4d ago), licensed MIT. It adds 28 tokens to every session and 3,786 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.