Portaljs Add Resource logo

Portaljs Add Resource

OrganizationPopular
datopian
portaljs-add-resource

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.

Overview

Publisherdatopian
Repositoryportaljs
Skill nameportaljs-add-resource
Stars
2.4K
Forks
332
Bundled files
1
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by datopian on GitHub. Read the source before you install it.

Installation

Install the Portaljs Add Resource AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/datopian/portaljs.git /tmp/portaljs
mkdir -p .claude/skills
cp -r /tmp/portaljs/skills/portaljs-add-resource .claude/skills/portaljs-add-resource
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Portaljs Add Resource in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Portaljs Add Resource on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Portaljs Add Resource is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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 in this repository — that file is the single source of truth. Read and follow it. Summary:

  1. Gather input (interview if thin): DATASET (slug or namespace/slug), SOURCE (path or URL), PORTAL_DIR (default .), RESOURCE_NAME, RESOURCE_TITLE, DESCRIPTION. If DATASET or SOURCE is missing, list datasets from datasets.json and ask.
  2. Validate the portal and locate the dataset entry by slug (and namespace, if given). If the dataset does not exist, offer /portaljs-add-dataset instead.
  3. 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.
  4. Update datasets.json: if the dataset has no resources yet, migrate its top-level file/format/schema into the first resource (lossless), then append the new resource; if resources already exists, just append, keeping name unique within the array.
  5. Verify the build with npx next build, capturing output to a log file; fix malformed JSON before reporting success.
  6. 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

SymptomCauseFix
"Dataset not found"DATASET slug/namespace doesn't match any entry in datasets.jsonList 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 errorManually edited datasets.json has a trailing comma or unescaped characterRe-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 downConfirm 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/dataAuto-derived RESOURCE_NAME matches an existing file stemPick a distinct RESOURCE_NAME, or let the skill append a numeric suffix
Showcase doesn't render the new section after buildname in the new resource object duplicates an existing resource's nameRename 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

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Portaljs Add Resource AI skill do?

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.

Why use Portaljs Add Resource on TypingMind?

Because you install it once and use it with any model. Portaljs Add Resource is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Portaljs Add Resource in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/datopian/portaljs/tree/main/skills/portaljs-add-resource. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Portaljs Add Resource?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Portaljs Add Resource?

As many as you like. As long as a model supports skills, you can use Portaljs Add Resource with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Portaljs Add Resource AI skill free?

Yes. It is published on GitHub by datopian under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇