Agent skill

Portaljs Define Schema

by datopian in datopian/portaljs

Define a dataset's metadata profile — infer a Frictionless Table Schema from its data, add Data Package metadata (license, sources, keywords), and write it into datasets.json so the showcase renders…

MITAuto-check passed

Install Portaljs Define Schema

skills CLI
$ npx skills add datopian/portaljs --skill portaljs-define-schema -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install datopian/portaljs portaljs-define-schema --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/datopian/portaljs.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/portaljs-define-schema .claude/skills/portaljs-define-schema && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
portaljs-define-schema
GitHub stars
2.4k
Used in
1 other repo
Token cost
~1.7k tokens
SKILL.md length
679 words
Files
2 (incl. references)
Skills in repo
14
Repo updated
First seen
Licence
MIT

At a glance

Define a dataset's metadata profile — infer a Frictionless Table Schema from its data, add Data Package metadata (license, sources, keywords), and write it into datasets.json so the showcase renders…

  • Works in 9 steps: Gather PORTAL_DIR, DATASET (slug or… → Validate the portal has the metadata… → For tabular datasets, sample the header… → …
  • A registered dataset needs field types
  • SKILL.md covers Overview, Prerequisites, Instructions and Output, plus 3 more sections
  • Calls npx

What it does

Portaljs Define Schema is an agent skill from datopian/portaljs. Define a dataset's metadata profile — infer a Frictionless Table Schema from its data, add Data Package metadata (license, sources, keywords), and write it into datasets.json so the showcase renders a typed field table. Extend or customize via the L0-L3 profile ladder. Use when a registered dataset needs field types, constraints, or catalog metadata before publishing.

Its SKILL.md is about 1.7k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/reference.md`). Compatibility notes: Claude Code with PortalJS portals (Next.js 14, React 18, Node 18+). Runs from any project via the plugin, a personal ~/.claude/commands install, or a portaljs…

The repository describes itself as: 🌀 AI-native framework for building data portals. Scaffold a full portal from a brief and load datasets in minutes with agentic skills — any backend (CKAN, GitHub, Frictionless). The licence is MIT.

When your agent uses it

  • A registered dataset needs field types
  • Catalog metadata before publishing

Example prompts

  • “/portaljs-define-schema”

Requirements

  • Node.js
  • Compatibility (from SKILL.md): Claude Code with PortalJS portals (Next.js 14, React 18, Node 18+). Runs from any project via the plugin, a personal ~/.claude/commands install, or a portaljs clone.
  • Pre-approved tools (allowed-tools): Read, Write, Edit, Bash(npx:*), Bash(node:*), Bash(head:*)

Workflow steps

9 steps, taken from the first numbered list in SKILL.md.

  1. Gather PORTAL_DIR, DATASET (slug or namespace/slug), and LEVEL (default L0)
  2. Validate the portal has the metadata contract (datasets.json, lib/metadata/types.ts,
  3. For tabular datasets, sample the header and ~50 rows from public/data/ and infer
  4. Echo the inferred schema as a table for confirmation; offer to go beyond L0 only if
  5. Ask for optional Data Package metadata: license, source(s), keywords, version.
  6. Write the schema and metadata onto the dataset's entry in datasets.json in place,
  7. Optionally validate the schema against the data's rows via the profile's validate().
  8. Verify with npx next build; fix malformed JSON or an invalid FieldType before
  9. Report the profile, fields, metadata set, and the showcase URL.

What it can do on your machine

Read from SKILL.md and the folder at commit d5c096a. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Edit
    • Bash(npx:*)
    • Bash(node:*)
    • Bash(head:*)

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npx

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • datapackage.org

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Claude Code with PortalJS portals (Next.js 14, React 18, Node 18+). Runs from any project via the plugin, a personal ~/.claude/commands install, or a portaljs clone.

    From compatibility in the SKILL.md frontmatter.

Context cost

Portaljs Define Schema loads about 1.7k tokens when it runs, and up to ~2.6k if it reads all its reference files. Until then it costs about 98 tokens; SKILL.md has 679 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~98
When it runs · the whole SKILL.md, loaded when a task matches
~1.7k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~2.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from datopian/portaljs at commit d5c096a, republished under its MIT licence (© datopian). 679 words, ~1,672 tokens.

Download SKILL.mdSave it as .claude/skills/portaljs-define-schema/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
portaljs-define-schema
description
Define a dataset's metadata profile — infer a Frictionless Table Schema from its data, add Data Package metadata (license, sources, keywords), and write it into datasets.json so the showcase renders a typed field table. Extend or customize via the L0-L3 profile ladder. Use when a registered dataset needs field types, constraints, or catalog metadata before publishing.
allowed-tools
Read, Write, Edit, Bash(npx:*), Bash(node:*), Bash(head:*)
compatibility
Claude Code with PortalJS portals (Next.js 14, React 18, Node 18+). Runs from any project via the plugin, a personal ~/.claude/commands install, or a portaljs clone.
version
1.0.0
author
Datopian <hello@datopian.com>
license
MIT
tags
portaljs, data-portal, schema, frictionless, metadata, datapackage

PortalJS — Define Schema

Overview

Define a dataset's metadata profile — the authoring skill for the metadata-profile contract (lib/metadata). Where portaljs-add-dataset registers that a dataset exists, this skill describes what its data means: infer a Frictionless Table Schema (fields, types, constraints) from sampled data, add the Data Package fields a catalog surfaces (title, licenses, sources, keywords), and write them onto the dataset's entry in datasets.json. The showcase at /@<namespace>/<slug> then renders a typed field table instead of a bare preview. The model is Frictionless-native; DCAT is a serialization layer built on top later, not authored here.

The skill runs on a profile ladder — reach for higher levels only when needed:

LevelWhat it isWhen
L0Default frictionless-tabular profile; declare schema + metadata.Default. Standard tabular CSV/TSV.
L1L0 plus extra descriptive package fields.Extra metadata, standard validation is fine.
L2Fully custom profile (own schema template + validate()).A dataset type needing custom validation rules.
L3Multiple registered profiles, resolved per dataset.A portal mixing dataset types.

The skill is interactive and never dead-ends: if input is thin it interviews in short rounds, infers defaults from the data, echoes the schema for confirmation, and accepts "use defaults" to proceed with the inferred schema as-is.

Prerequisites

  • A scaffolded PortalJS portal with the metadata contract (lib/metadata/types.ts, pages/[owner]/[slug].tsx); see portaljs-new-portal.
  • The target dataset already registered in datasets.json (see portaljs-add-dataset).
  • For tabular schema inference, the dataset's CSV/TSV file present under PORTAL_DIR/public/data/. JSON/GeoJSON datasets get package metadata only — no fields.
  • Node 18+; tsx optional, used for the schema-validation check.

Instructions

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

  1. Gather PORTAL_DIR, DATASET (slug or namespace/slug), and LEVEL (default L0) from input; if DATASET is missing, list the portal's slugs and ask.
  2. Validate the portal has the metadata contract (datasets.json, lib/metadata/types.ts, the showcase route); proceed anyway if lib/metadata/ predates the contract.
  3. For tabular datasets, sample the header and ~50 rows from public/data/<file> and infer each field's type, constraints (required, unique, pattern), and a primary key.
  4. Echo the inferred schema as a table for confirmation; offer to go beyond L0 only if warranted.
  5. Ask for optional Data Package metadata: license, source(s), keywords, version.
  6. Write the schema and metadata onto the dataset's entry in datasets.json in place, preserving all other fields; for L2/L3, scaffold and register a custom profile module.
  7. Optionally validate the schema against the data's rows via the profile's validate().
  8. Verify with npx next build; fix malformed JSON or an invalid FieldType before reporting success.
  9. Report the profile, fields, metadata set, and the showcase URL.
Show full SKILL.md (244 more words)Show less

Output

  • Modified: datasets.json (target entry gains profile, schema, licenses, sources, keywords, version — unset fields omitted).
  • Created (L2/L3 only): lib/metadata/<profile-id>.ts; lib/metadata/registry.ts updated with a registerProfile(...) call.
  • Verified: npx next build succeeds.
  • Result: /@<namespace>/<slug> renders a typed field table in place of a bare preview.

Error Handling

SymptomCauseFix
Dataset not found in datasets.jsonWrong slug or missing namespace/ prefixList available slugs and re-prompt.
lib/metadata/ missingPortal predates the metadata-profile contractProceed anyway — schema fields are optional and ignored by older showcases.
No fields schema producedDataset is JSON/GeoJSON, not tabularExpected — capture Data Package metadata only.
Validation reports type errorsSampled values don't coerce to the inferred typeRelax the type or drop the offending required/pattern constraint.
next build fails on datasets.jsonStray comma or a type outside FieldTypeFix the JSON/type and rebuild before reporting success.

Examples

Example 1 — Default L0 schema for a CSV dataset
/portaljs-define-schema population-2022

Infers fields (e.g. country: string, population: integer), drafts titles, asks for a license and source, and writes the schema under the default frictionless-tabular profile.

Example 2 — Metadata only for a GeoJSON dataset
/portaljs-define-schema neighborhoods-geo

GeoJSON has no tabular fields; the skill captures license, sources, and keywords onto the entry and skips schema inference.

Example 3 — Custom L2 profile with its own validation
/portaljs-define-schema co2-emissions level=L2

Scaffolds lib/metadata/co2-emissions-profile.ts with a custom validate(), registers it in lib/metadata/registry.ts, and sets "profile": "co2-emissions-profile" on the entry.

Resources

© datopian, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (references) in skills/portaljs-define-schema of datopian/portaljs.

  • SKILL.md
  • references/reference.md

Open the folder on GitHubat commit d5c096a

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in datopian/portaljs, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Portaljs Define Schema next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Portaljs Define Schema compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Portaljs Define Schema this skilldatopian/portaljs2.4k1 repos~1.7kAutomated safety check: PassMIT
Inference Latency Profilerjeremylongshore/tons-of-skills-marketplace2.8k—~584Automated safety check: PassMIT
Ito Inferenceaffaan-m/ECC275k1 repos~1.5kAutomated safety check: PassMIT
Profileccusage/ccusage19k—~430Automated safety check: PassCustom licence
Table Headersthedaviddias/Front-End-Checklist74k—~460Automated safety check: PassMIT
Dataset Profileroxbshw/LLM-Agents-Ecosystem-Handbook552—~492Automated safety check: PassMIT

Similar skills

  • Inference Latency Profiler

    jeremylongshore/tons-of-skills-marketplace

    Profile inference latency profiler operations. An agent skill from jeremylongshore/tons-of-skills-marketplace.

    2.8k GitHub stars~584 tokensUpdated today
    DevelopmentAuto-check passed
  • Ito Inference

    affaan-m/ECC

    Inspect the availability of model serving on a completed Itô compute booking and, when the canonical backend becomes available, hand off an explicitly confirmed serving manifest.

    275k GitHub starsUsed in 1 repo~1.5k tokens
    AI & LLM EngineeringAuto-check passed
  • Profile

    ccusage/ccusage

    Profiles ccusage performance. An agent skill from ccusage/ccusage.

    19k GitHub stars~430 tokensUpdated today
    Auto-check passed
  • Table Headers

    thedaviddias/Front-End-Checklist

    A skill your agent uses when reviewing rendered HTML, interactive components, or design-system patterns related to Define proper table headers.

    74k GitHub stars~460 tokensUpdated 2 days ago
    Frontend & DesignAuto-check passed
  • Dataset Profiler

    oxbshw/LLM-Agents-Ecosystem-Handbook

    A skill your agent uses when first encountering a new dataset — produces a structured profile (schema, missingness, distributions, outliers, gotchas) before any analysis.

    552 GitHub stars~492 tokensUpdated 3 mo ago
    DevelopmentAuto-check passed
  • Profiling Tables

    astronomer/agents

    Deep-dive data profiling for a specific table. An agent skill from astronomer/agents.

    451 GitHub stars~964 tokensUpdated today
    Data & AnalyticsAuto-check passed

More from datopian/portaljs

All 14 skills in this repo
  • Arcgis To Portaljs

    datopian/portaljs

    Migrate a whole ArcGIS Hub site into a PortalJS Arc portal end-to-end.

    2.4k GitHub starsUsed in 1 repo~2k tokens
    Auto-check passed
  • Portaljs Add Chart

    datopian/portaljs

    Add a chart (line, bar, area, pie, or scatter) to a dataset's showcase in a PortalJS portal.

    2.4k GitHub starsUsed in 1 repo~1.1k tokens
    Auto-check passed
  • Portaljs Add Dataset

    datopian/portaljs

    Add a dataset (CSV, TSV, JSON, or GeoJSON) to an existing PortalJS portal.

    2.4k GitHub starsUsed in 1 repo~1.6k tokens
    Auto-check passed
  • Portaljs Add Dcat

    datopian/portaljs

    Make 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…

    2.4k GitHub starsUsed in 1 repo~1.8k tokens
    Auto-check passed
  • Portaljs Add Geo

    datopian/portaljs

    Auto-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.

    2.4k GitHub starsUsed in 1 repo~1.7k tokens
    Auto-check passed
  • Portaljs Add Map

    datopian/portaljs

    Render a GeoJSON dataset on an interactive Leaflet map in the Views section of a dataset's showcase.

    2.4k GitHub starsUsed in 1 repo~1.3k tokens
    Auto-check passed

Questions about Portaljs Define Schema

What does Portaljs Define Schema do?

Define a dataset's metadata profile — infer a Frictionless Table Schema from its data, add Data Package metadata (license, sources, keywords), and write it into datasets.json so the showcase renders…. Portaljs Define Schema is an agent skill from datopian/portaljs.json so the showcase renders a typed field table.

When should I use Portaljs Define Schema?

Portaljs Define Schema fits situations like: A registered dataset needs field types; catalog metadata before publishing.

How do I install Portaljs Define Schema in Claude Code?

Run `npx skills add datopian/portaljs --skill portaljs-define-schema -a claude-code`. Or copy the skill folder (skills/portaljs-define-schema in datopian/portaljs) into .claude/skills/portaljs-define-schema in your project. Claude Code loads it when a task matches its description.

How do I install Portaljs Define Schema in Codex?

Run `npx skills add datopian/portaljs --skill portaljs-define-schema -a codex`. Or copy the skill folder (skills/portaljs-define-schema in datopian/portaljs) into .agents/skills/portaljs-define-schema in your project. Codex loads it when a task matches its description.

Can I use Portaljs Define Schema in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add datopian/portaljs --skill portaljs-define-schema -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/portaljs-define-schema, .gemini/skills/portaljs-define-schema, .github/skills/portaljs-define-schema and .opencode/skills/portaljs-define-schema in your project.

What does Portaljs Define Schema need to run?

Going by SKILL.md and its folder, Portaljs Define Schema needs the command-line tools its instructions call (npx). Our summary lists: Node.js. Its frontmatter pre-approves these tools: Read, Write, Edit, Bash(npx:*), Bash(node:*), Bash(head:*). Compatibility (from SKILL.md): Claude Code with PortalJS portals (Next.js 14, React 18, Node 18+). Runs from any project via the plugin, a personal ~/.claude/commands install, or a portaljs clone..

Does Portaljs Define Schema access the network?

SKILL.md names 1 domain. As links in the text: datapackage.org. This is read from the text; nothing was executed.

Is Portaljs Define Schema safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Portaljs Define Schema use?

Portaljs Define Schema is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Portaljs Define Schema use?

About 1.7k tokens (SKILL.md is roughly 6.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 923 tokens, read only when the agent opens those files.

What are the alternatives to Portaljs Define Schema?

Skills that share tags, products or a category with Portaljs Define Schema: Inference Latency Profiler (jeremylongshore/tons-of-skills-marketplace, 2.8k stars), Ito Inference (affaan-m/ECC, 275k stars), Profile (ccusage/ccusage, 19k stars) and Table Headers (thedaviddias/Front-End-Checklist, 74k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Portaljs Define Schema?

datopian (a GitHub organization) maintains it in datopian/portaljs, which has 2,358 GitHub stars. The repository holds 14 skills in this directory. The repository was last updated on September 7, 2026.

Source: datopian/portaljs on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.