
PortalJS Add Dataset
FreeEasily register datasets in your PortalJS portal.
Free · Opens the source repo
What PortalJS Add Dataset does
The PortalJS Add Dataset skill facilitates the integration of various datasets into an existing PortalJS portal, specifically designed for users who need to catalog and showcase data efficiently. This skill allows you to append entries to the datasets.json file, which serves as the main catalog for your portal. By supporting formats such as CSV, TSV, JSON, and GeoJSON, it ensures that your datasets are rendered automatically in the portal's showcase and search functionalities.
When using this skill, you can route data from either local files or remote URLs. For local files, the skill defaults to using R2 via Git LFS for storage, while remote URLs are handled as passthroughs, meaning the data is referenced directly without duplication. This flexibility is crucial for maintaining an organized and efficient data management system, especially when working with large datasets or when data is frequently updated.
To utilize the skill, you must have a scaffolded PortalJS portal that includes the necessary files such as datasets.json and package.json. The skill performs several validation checks to ensure the portal is properly set up before proceeding with the dataset registration process. It also includes error handling mechanisms to guide users in resolving common issues, such as unsupported formats or missing files, ensuring a smooth user experience.
This skill is particularly beneficial for developers and data managers who are looking to enhance their PortalJS portals with new datasets without the hassle of manual entry or complex configurations. By automating the dataset registration process, it saves time and reduces the potential for errors, making it an essential tool for anyone working with data in a PortalJS environment.
When to use it
Use this skill when you want to register new datasets in a PortalJS portal, especially when dealing with various data formats and sources.
When not to use it
This skill is not suitable for users without a scaffolded PortalJS portal or those who do not need to manage datasets in this specific environment.
What you can build with it
Adding a Local CSV File
Use the skill to add a local CSV file to your PortalJS portal, automatically routing it to R2 for storage.
Registering a Remote Dataset
Register a dataset from a remote URL, allowing users to access the data without duplicating it in your portal.
Integrating GeoJSON Data
Adopt GeoJSON data into your portal for enhanced mapping and geographical analysis capabilities.
How to install PortalJS Add Dataset
View source1. Install with the skills CLI
npx skills add jeremylongshore/claude-code-plugins-plus-skills/portaljs-add-dataset --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 Dataset
Overview
Register a dataset in a PortalJS (portaljs-catalog) portal. The skill appends one entry to
datasets.json — the single source of truth for the catalog — and routes the underlying
bytes by source first, then size: a local file defaults to R2 via Git LFS, a remote URL
defaults to passthrough (no copy). No per-dataset page is created; the catalog at /search
lists the new entry and the dynamic showcase route pages/[owner]/[slug].tsx renders it
automatically at /@<namespace>/<slug>. Supported formats for the showcase preview: CSV,
TSV, JSON (array), and GeoJSON.
Prerequisites
- A scaffolded PortalJS portal (see
portaljs-new-portal) withdatasets.json,package.json, andpages/[owner]/[slug].tsxpresent. - The source data: a local file path or a publicly reachable URL.
- For the R2/Git LFS default route:
gitandgit-lfsinstalled, and an Arc account token (or an OSS Giftless key) to mint a push-scoped LFS credential. - Node 18+ and npm available in the portal directory.
Instructions
The canonical, full step-by-step workflow is
.claude/commands/portaljs-add-dataset.md —
the single source of truth. Read and follow it when executing. Summary:
- Gather input from
$ARGUMENTS— source (file path or URL), portal directory (default.), dataset name/slug, description, namespace. If the source is missing, interview the user; never dead-end. - Validate the portal directory: confirm
datasets.json,package.json, andpages/[owner]/[slug].tsxexist. - Detect the format from the file extension, URL extension, or
Content-Typeheader (CSV, TSV, JSON array, or GeoJSON); reject anything else and ask for a conversion. - Route the data by source: remote URL → passthrough (default) or adopt into R2 (opt-in);
local file → R2 via Git LFS (default) or inline into
public/data/(fenced exception for bundled samples or an OSS-no-R2 fallback). - Append one entry to
datasets.json—slug,namespace,name,description,file(the routed path/URL),format— keeping(namespace, slug)unique. - Verify the build with
npx next build; fix errors (commonly malformed JSON) before reporting success. - Report the route taken, the manifest change, and the showcase URL.
Output
- Modified:
datasets.json(one entry appended). - Created (route-dependent):
data/<slug>.<ext>tracked via Git LFS (R2 default), orpublic/data/<slug>.<ext>(inline exception). Nothing is created for remote passthrough. - Verified:
npx next buildpasses. - Result: the dataset appears in
/searchand renders at/@<namespace>/<slug>.
Error Handling
| Symptom | Cause | Fix |
|---|---|---|
| Fetch fails for a URL source | Non-200 status or unreachable host | Report the HTTP status and ask the user to confirm the URL is publicly accessible. |
| "Not a portaljs-catalog portal" | datasets.json missing | This is an older single-page template; ask the user how to proceed rather than failing silently. |
| Unsupported format | Extension/content-type isn't csv/tsv/json/geojson | Ask the user to convert the source before continuing. |
git lfs push has nothing to stream | git lfs install --local never ran, so raw bytes were committed instead of a pointer | Run git lfs install --local before git lfs track, re-add and re-commit the file. |
| R2 PUT returns 400 | A broad http.extraHeader was set and replayed onto the presigned URL | Use the _jwt Basic-auth piggyback in lfs.url only — never a global http.extraHeader. |
(namespace, slug) clash | Another entry already uses that pair | Ask the user for a different slug or namespace. |
next build fails | Malformed JSON in datasets.json | Print the build log, fix the JSON, rebuild before reporting success. |
Examples
Example 1 — Local CSV, default R2 route
/portaljs-add-dataset ./data/co2-emissions.csv namespace=climate
Moves the file into data/, tracks it with Git LFS, pushes it to R2, and appends a manifest
entry whose file is the resulting https://data.portaljs.com/... URL.
Example 2 — Remote URL, passthrough (no download)
/portaljs-add-dataset https://example.org/open-data/trade.csv namespace=trade
Detects the format from the response headers and records the URL as-is in datasets.json —
no bytes are copied.
Example 3 — GeoJSON adopted into R2
/portaljs-add-dataset https://example.org/boundaries.geojson namespace=reference adopt=true
Downloads the file, then routes it as a local file through the Git LFS → R2 path so it is hosted and versioned under the portal (useful when in-browser range queries are needed).
Example 4 — Bundled sample data, inline exception
/portaljs-add-dataset ./samples/demo.csv namespace=reference
When the portal has no R2 credentials (OSS self-host) or the file is bundled sample data,
the skill copies it into public/data/ instead, per the .gitattributes inline fence.
Resources
- Full workflow:
.claude/commands/portaljs-add-dataset.md - Manifest fields and routing details:
references/reference.md - Related skills:
portaljs-new-portal,portaljs-add-chart,portaljs-add-map,portaljs-define-schema - Git LFS documentation: https://git-lfs.com/
Frequently asked questions about PortalJS Add Dataset
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.
