Skip to main content

Build

Portaljs New Portal

portaljs

Scaffold a new PortalJS data portal from a brief. Copies the canonical template from examples/portaljs-catalog and substitutes project tokens. Use when starting a brand-new data portal project from scratch.

  • New
  • v1.0.1
  • Reviewed Aug 24
  • No reviews yet

Capabilities

  • Example 1 — Full brief up front

    Infers name + description, picks NAMESPACE_TYPE = 'owner', asks for…

  • Example 2 — No arguments, full interview

    Runs all three interview rounds from scratch, accepting "use defaults"…

Getting started

Full instructions

Install the skill, then ask your AI tool for the task in plain words. The full SKILL.md below shows what it covers.

Instructions: SKILL.mdv1.0.1

PortalJS — New Portal

Overview

Scaffold a production-ready PortalJS data portal from a brief. 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 (locally or via a
remote tiged fetch), substitutes placeholder tokens, sets the namespace mode and the
UI language, seeds any datasets named in the interview, installs dependencies, and verifies the scaffold
with a type check.

Prerequisites

  • Node.js >=22 and npm available on PATH.
  • Network access, unless a current local checkout of the portaljs repo is available
    (the resolver defaults to a remote fetch of the template).
  • A destination directory name that does not already contain files (or user consent
    to overwrite one that does).

Instructions

The canonical, full step-by-step workflow is
.claude/commands/portaljs-new-portal.md —
the single source of truth. Read and follow it when executing. Summary:

  1. Interview the user in up to three rounds — Home/basics (incl. the UI language,
    default English), Catalog & discovery
    (datasets, namespace mode theme vs owner), Showcase/views — skipping any round
    already answered by the input brief. Accept "use defaults" at any point.
  2. Confirm a short brief (name, slug, description, language, namespace, datasets,
    views) before building.
  3. Resolve the template source: prefer a remote tiged fetch of
    examples/portaljs-catalog at main (or PORTALJS_TEMPLATE_REF); use a local
    checkout only when it is current (has pages/[owner]/[slug].tsx) and the
    destination is outside that repo.
  4. Materialize the template into ./PROJECT_SLUG, asking first if the destination
    already exists and is non-empty.
  5. Substitute __PROJECT_NAME__, __PROJECT_SLUG__, __DESCRIPTION__ tokens
    across all files with perl -pi, escaping /, \, and & in the values.
  6. Set NAMESPACE_TYPE ('theme' or 'owner') in lib/datasets.ts per the
    interview.
  7. Set the UI language (skip for English): translate locales/en.json into
    locales/<code>.json (every key, {placeholders} verbatim, the plural forms the
    language uses, _intl BCP 47 tag such as it-IT), register it in lib/i18n.ts,
    set DEFAULT_LOCALE in next.config.js, and run npm run i18n:check.
  8. Seed datasets captured in Round 2 (via /portaljs-add-dataset or by hand), or
    clear datasets.json to [] if none were named.
  9. Run npm install inside the scaffolded portal.
  10. Verify with npm run i18n:check and npx tsc --noEmit (never next build here —
    it would corrupt a running dev server's .next/ directory).
  11. Report the scaffolded routes, namespace mode, language, and next steps.

Output

  • Created: a new directory ./PROJECT_SLUG/ containing the full
    examples/portaljs-catalog template with tokens substituted.
  • Modified: lib/datasets.ts (NAMESPACE_TYPE); datasets.json (seeded
    datasets or cleared to []); for a non-English portal, locales/<code>.json
    (created), lib/i18n.ts (registered) and next.config.js (DEFAULT_LOCALE).
  • Verified: npm run i18n:check and npx tsc --noEmit pass inside the scaffolded
    portal.
  • Result: a runnable portal at ./PROJECT_SLUG with Home (/), Catalog
    (/search), and Showcase (/@<namespace>/<slug>) surfaces wired up.

Error Handling

Symptom Cause Fix
DIR_EXISTS ./PROJECT_SLUG already exists and is non-empty Ask the user for a different name or consent to remove it; then proceed.
Remote fetch fails Bad PORTALJS_TEMPLATE_REF, network outage, or tiged unavailable Tell the user plainly and ask to retry, use a different ref, or check network.
Stale local scaffold (pages/datasets/[slug].tsx) Old local clone missing pages/[owner]/[slug].tsx Resolver already falls back to remote in this case — do not force local mode.
npm install fails Node <22 or no network Report the error and ask the user to check Node version and connectivity.
tsc --noEmit fails Token substitution or manifest error Print the log and fix before reporting success — never report success with a failing type check.

Examples

Example 1 — Full brief up front

text
/portaljs-new-portal Auckland Open Data Portal — datasets published by several council
departments (multiple publishers). Start with ./data/parks.csv and ./data/budget.csv.

Infers name + description, picks NAMESPACE_TYPE = 'owner', asks for namespace
values (e.g. parks-dept, finance), confirms the brief, scaffolds the template, and
seeds both datasets at /@parks-dept/parks and /@finance/budget.

Example 2 — No arguments, full interview

text
/portaljs-new-portal

Runs all three interview rounds from scratch, accepting "use defaults" for any round,
then confirms the brief before scaffolding.

Example 3 — Single-publisher portal with no datasets yet

text
/portaljs-new-portal Reference Data Hub — a single-team reference catalog, no data yet.

Picks NAMESPACE_TYPE = 'theme' with namespace reference, clears datasets.json to
[], and reports /portaljs-add-dataset as the next step.

Resources

  • Full workflow: .claude/commands/portaljs-new-portal.md
  • Template and token reference: references/reference.md
  • Related skills: portaljs-add-dataset, portaljs-add-chart, portaljs-add-map, portaljs-connect-ckan
  • PortalJS documentation: https://portaljs.org

Explore more skills

Browse all
This skill doesn’t include stateful context yet, instructions only. Learn about stateful skills.

Security

Loading security scan...

Reviews (0)

More from portaljs

View source →
arcgis-to-portaljsMigrate a whole ArcGIS Hub site into a PortalJS Arc portal end-to-end. Harvests the Hub /data.json (DCAT-US) inventory, exports every FeatureService layer through the ArcGIS REST query API with resultOffset paging, converts each to the…1 installsportaljs-add-geoAuto-ingest a geospatial file (GeoJSON, Shapefile, GeoPackage, KML/KMZ, FlatGeobuf, CSV-with-geometry) into a PortalJS portal on the user's own machine, with no server. Normalizes CRS to EPSG:4326, derives a PMTiles render tier and a…0 installsportaljs-add-chartAdd a chart (line, bar, area, pie, or scatter) to a dataset's showcase in a PortalJS portal. Installs recharts, writes a reusable Chart component, and renders it in the showcase Views section. Use when visualizing a dataset already…0 installsportaljs-add-dcatMake a PortalJS portal harvestable by national/EU/US open-data portals — emit standards-compliant DCAT catalog feeds (DCAT 2/3, DCAT-AP, DCAT-US, national profiles) in JSON-LD, Turtle, and RDF/XML at build, with autodiscovery and…0 installsportaljs-add-mapRender a GeoJSON dataset on an interactive Leaflet map in the Views section of a dataset's showcase. Installs react-leaflet and a Map component, then renders the map for the chosen dataset. Use when a dataset's data is geographic and a map…0 installsportaljs-add-datasetAdd a dataset (CSV, TSV, JSON, or GeoJSON) to an existing PortalJS portal. Appends an entry to datasets.json so the catalog and showcase render it automatically; routes the data by source (local file vs remote URL) — R2 via Git LFS by…0 installs

Frequently asked questions about portaljs-new-portal

What does the portaljs-new-portal skill do?

Scaffold a new PortalJS data portal from a brief. Copies the canonical template from examples/portaljs-catalog and substitutes project tokens. Use when starting a brand-new data portal project from scratch. It's a reusable SKILL.md instruction set that loads into your AI coding assistant on demand, no prompt engineering, no copy-pasting every session.

How do I install the portaljs-new-portal skill?

Run `npx @skills-hub-ai/cli install portaljs-new-portal` from your terminal. The CLI writes the SKILL.md to the correct location for your AI tool (e.g. ~/.claude/skills/portaljs-new-portal/ for Claude Code or ~/.cursor/skills/ for Cursor with --target cursor) and adds it to your project's .skills.json lockfile.

Which AI tools does portaljs-new-portal work with?

portaljs-new-portal runs in Claude Code. It follows the open Agent Skills standard (SKILL.md), so the same skill works in every supported tool without modification.

Is the portaljs-new-portal skill free?

Yes. Every skill on skills-hub.ai is free and open-source. There are no premium tiers, paywalls, or usage limits. You only pay for whatever AI assistant you're already using.

How do I use portaljs-new-portal after installing it?

In Claude Code, type `/portaljs-new-portal` (or whatever slash command the skill registers) and the AI follows the skill's instructions immediately. You can also reference it by name in natural language, your AI loads the skill into context when relevant.

Can I share the portaljs-new-portal skill with my team?

Yes. Commit your project's .skills.json lockfile and teammates run `npx @skills-hub-ai/cli install` (no args) to install every skill at the exact version you pinned. Organization-scoped installs work via skills-hub.ai organizations.

Badge for your README

Show that this skill is on Skills Hub. The badge links back to this page and shows the live install count.

Install on Skills Hub badge preview
Markdown
[![Install on Skills Hub](https://skills-hub.ai/api/badges/skill/portaljs-new-portal)](https://skills-hub.ai/skills/portaljs-new-portal)
HTML
<a href="https://skills-hub.ai/skills/portaljs-new-portal"><img src="https://skills-hub.ai/api/badges/skill/portaljs-new-portal" alt="Install on Skills Hub"></a>

More options in the badge docs.