portaljs-define-schema

portaljs-define-schema is a command for Claude Code from datopian/portaljs. It costs 57 tokens per session (2,951 once invoked), scanned A, original, MIT.

A command for describing a dataset's structure and meaning using a standard data format. A dataset is an organized collection of data, such as a table or file.

In plain words
What is it for?
Inspecting dataset data, inferring a Frictionless Table Schema, collecting metadata, and saving the result in datasets.json.
Why use it?
It adds field names, data types, constraints, licensing, sources, and keywords so a catalogue can explain the data clearly.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the portaljs plugin — 14 skills, 25 commands shipped together

About the project

PortalJS is a framework for building data portals that present searchable datasets through a home page, catalog, and dataset showcase. It is for teams that want to choose a data backend, scaffold a Next.js portal, load CSV or JSON data, connect services such as CKAN, and deploy the result. The catalogue entries are agent commands, skills, instructions, and a plugin that guide portal creation and data loading.

datopian/portaljs · 2,349 stars · on GitHub · portaljs.com

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/datopian/portaljs/portaljs-define-schema
Clone the repo
git clone --depth 1 https://github.com/datopian/portaljs

Made for: Claude Code.

Or install portaljs, the plugin that ships this one along with the rest of its 14 skills, 25 commands.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for portaljs-define-schema

README.md
[![agentmods](https://agentmods.dev/badge/commands/datopian/portaljs/portaljs-define-schema.svg)](https://agentmods.dev/commands/datopian/portaljs/portaljs-define-schema)
Your own site
<a href="https://agentmods.dev/commands/datopian/portaljs/portaljs-define-schema"><img src="https://agentmods.dev/badge/commands/datopian/portaljs/portaljs-define-schema.svg" alt="Measured on agentmods" height="20"></a>
Per session 57 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,951 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00057 $0.02951
Opus 5 $0.00028 $0.01476
Sonnet 5 $0.00011 $0.00590
Haiku 4.5 $0.00006 $0.00295

Measured 6d ago against content hash 225190ea898d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

portaljs-define-schema scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/portaljs-define-schema.md · 236 lines

How it starts

The opening of the file, as written. The whole thing — 236 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/portaljs-define-schema

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: it infers a Frictionless Table Schema (fields, types, constraints) from the data, adds the Data Package descriptor fields a catalog surfaces (title, licenses, sources, keywords), and writes them onto the dataset's entry in datasets.json. The showcase at /@<namespace>/<slug> then renders a typed column/description table instead of a bare preview.

The model is Frictionless-native. DCAT / DCAT-AP is a serialization layer on top (designed-in at lib/metadata/dcat.ts, built in the later DCAT-interop phase) — this skill authors the native model, not the export.

The skill is interactive and never dead-ends: if the brief is thin it interviews in short rounds, infers sensible defaults from the data, echoes the schema for confirmation, and lets you reply "use defaults" to accept the inferred schema as-is.

See lib/metadata/README.md for the contract and the L0→L3 ladder.

The profile ladder — pick a level

Most datasets want L0. Reach for higher levels only when you actually need them.

Level What it is When
L0 Use the default frictionless-tabular profile as-is; just declare the dataset's schema + metadata. Default. Tabular CSV/TSV with the standard Frictionless types.
L1 Extend L0 — same default profile, plus a few extra package fields you care about. You need extra descriptive metadata but standard validation is fine.
L2 A fully custom profile (your own schema template + validate()), registered in lib/metadata. A dataset type with validation rules L0 doesn't express.
L3 Multiple profiles in the registry, resolved per dataset by its profile field. A portal mixing dataset types, each with its own profile.

Read the full file on GitHub · 236 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 236 lines · 57 tokens per session scan A 225190ea898d

Subscribe to this mod's changes

portaljs-define-schema is a command published in the GitHub repository datopian/portaljs (2,349 stars, last pushed 2d ago), licensed MIT. It adds 57 tokens to every session and 2,951 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.