# Portaljs Add Resource

Add another file (resource) to an EXISTING dataset in a PortalJS portal, a data...

- Repository: https://github.com/datopian/portaljs (2370 stars)
- Category: Data and ML
- License: MIT
- Last updated: 2026-10-28
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add datopian/portaljs --skill portaljs-add-resource -g -a claude-code -y`
Codex: `npx skills add datopian/portaljs --skill portaljs-add-resource -g -a codex -y`
Cursor: `npx skills add datopian/portaljs --skill portaljs-add-resource -g -a cursor -y`
Gemini CLI: `npx skills add datopian/portaljs --skill portaljs-add-resource -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add datopian/portaljs`

## Description

Add another file (resource) to an EXISTING dataset in a PortalJS portal, a data dictionary, methodology, or an additional data file. Turns a single-file dataset into a multi-resource one; the showcase renders a section per resource. Use when a dataset needs a second file, such as a data dictionary, methodology doc, or an additional period's data.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# PortalJS, Add Resource

## Overview

Add a resource, an additional file, to a dataset that already exists in a
`portaljs-catalog` portal. Where `/portaljs-add-dataset` creates a **new** dataset
(one file), this skill adds a file to an **existing** one: a data dictionary, a
methodology document, or another data file (e.g. a second year's figures).

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 migrates to `resources[]` automatically the
first time a second file is added, no data is lost.

## Prerequisites

- An existing PortalJS portal (`portaljs-catalog` template) with `datasets.json`,
  `package.json`, and `pages/[owner]/[slug].tsx` present.
- The target dataset already registered in `datasets.json`.
- The new resource's source: a local file path or a public URL, in CSV, TSV, JSON
  (array), or GeoJSON format.
- Node 18+ installed to run `npx next build` for verification.

## Instructions

The canonical, full step-by-step workflow lives in
[`.claude/commands/portaljs-add-resource.md`](https://github.com/datopian/portaljs/blob/main/.claude/commands/portaljs-add-resource.md)
in this repository, that file is the single source of truth. Read and follow it. Summary:

The rest: https://github.com/datopian/portaljs/blob/HEAD/skills/portaljs-add-resource/SKILL.md
