
PortalJS Add Resource
FreeEasily extend existing datasets with additional files.
Free · Opens the source repo
What PortalJS Add Resource does
PortalJS Add Resource is a skill designed for users working with datasets in a PortalJS environment, specifically those utilizing the portaljs-catalog template. This skill allows you to add supplementary files, such as data dictionaries or methodology documents, to an existing dataset. By transforming a single-file dataset into a multi-resource dataset, it enhances the dataset's usability and comprehensiveness. The skill follows the Frictionless Data Package model, which organizes datasets into a resources[] array, ensuring a structured approach to data management.
To use this skill, you need to have an existing PortalJS portal set up with the necessary files, including datasets.json and package.json. The process begins with gathering input, such as the dataset slug and the source of the new resource, which can be either a local file path or a public URL in various formats like CSV, JSON, or GeoJSON. The skill validates the dataset's existence and ensures that the new resource is correctly formatted before adding it to the dataset.
Once the resource is added, the skill updates the datasets.json file to reflect the new structure, ensuring that no data is lost during the transition from a single-file dataset to a multi-resource one. The skill also includes error handling to manage common issues, such as missing datasets or malformed JSON, providing users with clear guidance on how to resolve these problems. This makes it an essential tool for data managers and developers looking to enhance their datasets efficiently.
When to use it
Use this skill when you need to augment an existing dataset with additional resources, such as a new data file or documentation.
When not to use it
This skill is not suitable for creating new datasets; use `/portaljs-add-dataset` for that purpose.
What you can build with it
Adding a Data Dictionary
You can add a data dictionary to an existing dataset to provide context and descriptions for the data fields.
Appending Methodology Documents
This skill allows you to append methodology documents to datasets, ensuring users understand the data collection and analysis processes.
Updating with Additional Data Files
If you have additional data files, such as yearly updates, you can easily add them to the existing dataset for comprehensive coverage.
How to install PortalJS Add Resource
View source1. Install with the skills CLI
npx skills add jeremylongshore/claude-code-plugins-plus-skills/portaljs-add-resource --agent claude-code2. Or install it manually
Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.
Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs
Inside SKILL.md
Written by jeremylongshorePortalJS — 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-catalogtemplate) withdatasets.json,package.json, andpages/[owner]/[slug].tsxpresent. - 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 buildfor verification.
Instructions
The canonical, full step-by-step workflow lives in
.claude/commands/portaljs-add-resource.md
in this repository — that file is the single source of truth. Read and follow it. Summary:
- Gather input (interview if thin):
DATASET(slug ornamespace/slug),SOURCE(path or URL),PORTAL_DIR(default.),RESOURCE_NAME,RESOURCE_TITLE,DESCRIPTION. IfDATASETorSOURCEis missing, list datasets fromdatasets.jsonand ask. - Validate the portal and locate the dataset entry by slug (and namespace, if
given). If the dataset does not exist, offer
/portaljs-add-datasetinstead. - Detect the format from extension/Content-Type, fetch (check HTTP status) or
confirm the local path exists, then copy into
PORTAL_DIR/public/data/under a non-colliding filename. - Update
datasets.json: if the dataset has noresourcesyet, migrate its top-levelfile/format/schemainto the first resource (lossless), then append the new resource; ifresourcesalready exists, just append, keepingnameunique within the array. - Verify the build with
npx next build, capturing output to a log file; fix malformed JSON before reporting success. - Report the outcome (see Output below).
Output
✓ Resource added to DATASET: RESOURCE_TITLE (RESOURCE_NAME.EXT)
- Data file: public/data/RESOURCE_NAME.EXT
- Manifest: datasets.json (dataset now has <n> resources)
- Showcase: /@<namespace>/<slug> renders a section per resource
If this was the first migration to multi-resource, note that the dataset's single
file was moved into resources[] with no data lost.
Error Handling
| Symptom | Cause | Fix |
|---|---|---|
| "Dataset not found" | DATASET slug/namespace doesn't match any entry in datasets.json | List datasets from datasets.json and ask the user to pick, or run /portaljs-add-dataset to create it |
npx next build fails with a JSON parse error | Manually edited datasets.json has a trailing comma or unescaped character | Re-open the file, fix the JSON, and rebuild before reporting success |
| Resource file fails to fetch (non-2xx) | SOURCE URL is wrong, private, or the host is down | Confirm the URL in a browser or with curl -I SOURCE; ask for a corrected URL or a local path |
New resource's filename collides with an existing one in /public/data | Auto-derived RESOURCE_NAME matches an existing file stem | Pick a distinct RESOURCE_NAME, or let the skill append a numeric suffix |
| Showcase doesn't render the new section after build | name in the new resource object duplicates an existing resource's name | Rename the resource's name to something unique within that dataset's resources[] |
Examples
Example 1 — Add a data dictionary to a single-file dataset
/portaljs-add-resource orders ./data/orders-data-dictionary.csv --title "Data dictionary"
orders was a single CSV. It is migrated to a two-resource dataset (the original
data plus the dictionary), and its showcase now renders a section for each.
Example 2 — Add a resource by URL to a dataset that already has resources
/portaljs-add-resource climate-observations https://example.org/data/methodology.json --name methodology --title "Methodology notes"
The skill fetches the URL, checks the HTTP status, copies it to
public/data/methodology.json, and appends it to the existing resources[] array.
Example 3 — Run with no arguments (interview mode)
/portaljs-add-resource
With no arguments, the skill lists datasets from datasets.json, asks which one to
extend and for the new file's path or URL, then proceeds through steps 2-6 above.
Resources
.claude/commands/portaljs-add-resource.md— canonical workflow this skill followsreferences/reference.md— resource entry fields, single-to-multi-resource layout, troubleshooting- Related skills:
/portaljs-add-dataset(create a new dataset),/portaljs-define-schema(describe a resource's fields) - Frictionless Data — Data Package resources — the data model this feature mirrors
Frequently asked questions about PortalJS Add Resource
Similar skills
Single-Cell RNA-seq QC
Automate quality control for single-cell RNA-seq data.
Instrument Data to Allotrope Converter
Standardize lab data for seamless integration.
SQL Server Table Reconciliation
Efficiently compare SQL Server tables across instances.
Data Cleaning and Variable Screening
Streamline credit risk data preprocessing for modeling.
Arize Dataset
Manage and query Arize datasets efficiently.
Spreadsheet Management
Efficiently create, edit, and analyze spreadsheet files.
