portaljs-define-schema
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
Install / Use
npx skills add datopian/portaljs --skill portaljs-define-schemaInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
Development & EngineeringSupported Platforms
Tags
Our assessment of portaljs-define-schema
portaljs-define-schema scores 91/100 on our quality scale, 1068th of 4,700 Development & Engineering skills we index (top 23%).
Its SKILL.md is 6.5 KB long, well organised into 11 sections with 3 code examples: a thorough specification that gives an agent plenty to work with.
With 2,356 GitHub stars, it is one of the more widely adopted skills in the catalogue.
Maintenance, license and trust
- The repository was last updated about 2 months ago, so portaljs-define-schema is actively maintained.
- Our last check on 2026-10-29 found the source still online.
- It is released under the MIT license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 100/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
Safety scan
No issues foundOur scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful.
AI review by kimi-k2.7-code on 2026-09-30. Automated pattern scan on 2026-09-29. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.
portaljs-define-schema compared with similar skills
All 4 of these similar skills score higher than portaljs-define-schema; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| portaljs-define-schema (this skill)by datopian | 91 | 2.4k | 2mo ago | SKILL.md |
| taste-skillby Leonxlnx | 100 | 116.8k | 8d ago | CLAUDE.md |
| ai-job-searchby ai-job-search-dev | 100 | 72.1k | today | CLAUDE.md |
| claude-howtoby luongnv89 | 100 | 47.3k | 2d ago | CLAUDE.md |
| lobehubby lobehub | 100 | 85.6k | today | MCP Server |
Frequently asked questions
- How do I install portaljs-define-schema?
- Run
npx skills add datopian/portaljs --skill portaljs-define-schema. The install tabs above show the steps for each supported agent. - Which AI agents does portaljs-define-schema work with?
- It is written for Claude Code, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is portaljs-define-schema safe to use?
- Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful. It is MIT-licensed and scores 100/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is portaljs-define-schema still maintained?
- The repository was last updated about 2 months ago, so portaljs-define-schema is actively maintained.
Skill content
View source on GitHubname: 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:*) version: 1.0.0 author: Datopian hello@datopian.com license: MIT 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. 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:
| Level | What it is | When |
| --- | --- | --- |
| L0 | Default frictionless-tabular profile; declare schema + metadata. | Default. Standard tabular CSV/TSV. |
| L1 | L0 plus extra descriptive package fields. | Extra metadata, standard validation is fine. |
| L2 | Fully custom profile (own schema template + validate()). | A dataset type needing custom validation rules. |
| L3 | Multiple 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); seeportaljs-new-portal. - The target dataset already registered in
datasets.json(seeportaljs-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 — nofields. - Node 18+;
tsxoptional, 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:
- Gather
PORTAL_DIR,DATASET(slug ornamespace/slug), andLEVEL(defaultL0) from input; ifDATASETis missing, list the portal's slugs and ask. - Validate the portal has the metadata contract (
datasets.json,lib/metadata/types.ts, the showcase route); proceed anyway iflib/metadata/predates the contract. - 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. - Echo the inferred schema as a table for confirmation; offer to go beyond L0 only if warranted.
- Ask for optional Data Package metadata: license, source(s), keywords, version.
- Write the schema and metadata onto the dataset's entry in
datasets.jsonin place, preserving all other fields; for L2/L3, scaffold and register a custom profile module. - Optionally validate the schema against the data's rows via the profile's
validate(). - Verify with
npx next build; fix malformed JSON or an invalidFieldTypebefore reporting success. - Report the profile, fields, metadata set, and the showcase URL.
Output
- Modified:
datasets.json(target entry gainsprofile,schema,licenses,sources,keywords,version— unset fields omitted). - Created (L2/L3 only):
lib/metadata/<profile-id>.ts;lib/metadata/registry.tsupdated with aregisterProfile(...)call. - Verified:
npx next buildsucceeds. - Result:
/@<namespace>/<slug>renders a typed field table in place of a bare preview.
Error Handling
| Symptom | Cause | Fix |
| --- | --- | --- |
| Dataset not found in datasets.json | Wrong slug or missing namespace/ prefix | List available slugs and re-prompt. |
| lib/metadata/ missing | Portal predates the metadata-profile contract | Proceed anyway — schema fields are optional and ignored by older showcases. |
| No fields schema produced | Dataset is JSON/GeoJSON, not tabular | Expected — capture Data Package metadata only. |
| Validation reports type errors | Sampled values don't coerce to the inferred type | Relax the type or drop the offending required/pattern constraint. |
| next build fails on datasets.json | Stray comma or a type outside FieldType | Fix 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
- Full workflow:
.claude/commands/portaljs-define-schema.md - Field-type and troubleshooting reference:
references/reference.md - Related skills:
portaljs-add-dataset,portaljs-add-dcat,portaljs-check-data-quality - Frictionless Table Schema specification: https://datapackage.org/standard/table-schema/
Related Skills
taste-skill
116.8kAgent skills that give coding agents taste: art direction, reference images and a browser check instead of generic AI pages
ai-job-search
72.1kThe job search that runs on your machine. AI job application framework built on Claude Code: evaluate postings, tailor CVs, write cover letters, prep interviews. Fork it and own it.
claude-howto
47.3kA visual, example-driven guide to Claude Code — from basic concepts to advanced agents, with copy-paste templates that bring immediate value.
lobehub
85.6k🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
