跳到正文
cccskills
免费在 GitHub 公开

portaljs-new-portal

Create a new PortalJS data portal from a project brief. The skill gathers missing details about pages, datasets, language, and catalog organization, then applies them to the PortalJS template and checks the generated project with type and localization checks.

中文简介正在准备中。当前显示英语简介。

原文查看原文说明

Scaffold a new PortalJS data portal from a brief. Copies the canonical template from examples/portaljs-catalog and substitutes project tokens. Use when starting a brand-new data portal project from scratch.

实测评分 未实测

查看安装方法

适用场景

  • Starting a data portal from a short project brief
  • Choosing how datasets are grouped in the catalog
  • Creating a portal in a non-English interface language
  • Setting up a portal shell before adding datasets

包含的文件(2)

  • SKILL.md6.4 KB
  • references/reference.md3.9 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

PortalJS — New Portal

Overview

Scaffold a production-ready PortalJS data portal from a brief. The skill is interactive: if the brief is thin it interviews the user in three short rounds (mapped to the template's three surfaces — Home, Catalog, Showcase), echoes a brief back for confirmation, then copies examples/portaljs-catalog (locally or via a remote tiged fetch), substitutes placeholder tokens, sets the namespace mode and the UI language, seeds any datasets named in the interview, installs dependencies, and verifies the scaffold with a type check.

Prerequisites

  • Node.js >=22 and npm available on PATH.
  • Network access, unless a current local checkout of the portaljs repo is available (the resolver defaults to a remote fetch of the template).
  • A destination directory name that does not already contain files (or user consent to overwrite one that does).

Instructions

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

  1. Interview the user in up to three rounds — Home/basics (incl. the UI language, default English), Catalog & discovery (datasets, namespace mode theme vs owner), Showcase/views — skipping any round already answered by the input brief. Accept "use defaults" at any point.
  2. Confirm a short brief (name, slug, description, language, namespace, datasets, views) before building.
  3. Resolve the template source: prefer a remote tiged fetch of examples/portaljs-catalog at main (or PORTALJS_TEMPLATE_REF); use a local checkout only when it is current (has pages/[owner]/[slug].tsx) and the destination is outside that repo.
  4. Materialize the template into ./PROJECT_SLUG, asking first if the destination already exists and is non-empty.
  5. Substitute __PROJECT_NAME__, __PROJECT_SLUG__, __DESCRIPTION__ tokens across all files with perl -pi, escaping /, \, and & in the values.
  6. Set NAMESPACE_TYPE ('theme' or 'owner') in lib/datasets.ts per the interview.
  7. Set the UI language (skip for English): translate locales/en.json into locales/<code>.json (every key, {placeholders} verbatim, the plural forms the language uses, _intl BCP 47 tag such as it-IT), register it in lib/i18n.ts, set DEFAULT_LOCALE in next.config.js, and run npm run i18n:check.
  8. Seed datasets captured in Round 2 (via /portaljs-add-dataset or by hand), or clear datasets.json to [] if none were named.
  9. Run npm install inside the scaffolded portal.
  10. Verify with npm run i18n:check and npx tsc --noEmit (never next build here — it would corrupt a running dev server's .next/ directory).
  11. Report the scaffolded routes, namespace mode, language, and next steps.

Output

  • Created: a new directory ./PROJECT_SLUG/ containing the full examples/portaljs-catalog template with tokens substituted.
  • Modified: lib/datasets.ts (NAMESPACE_TYPE); datasets.json (seeded datasets or cleared to []); for a non-English portal, locales/<code>.json (created), lib/i18n.ts (registered) and next.config.js (DEFAULT_LOCALE).
  • Verified: npm run i18n:check and npx tsc --noEmit pass inside the scaffolded portal.
  • Result: a runnable portal at ./PROJECT_SLUG with Home (/), Catalog (/search), and Showcase (/@<namespace>/<slug>) surfaces wired up.

Error Handling

SymptomCauseFix
DIR_EXISTS./PROJECT_SLUG already exists and is non-emptyAsk the user for a different name or consent to remove it; then proceed.
Remote fetch failsBad PORTALJS_TEMPLATE_REF, network outage, or tiged unavailableTell the user plainly and ask to retry, use a different ref, or check network.
Stale local scaffold (pages/datasets/[slug].tsx)Old local clone missing pages/[owner]/[slug].tsxResolver already falls back to remote in this case — do not force local mode.
npm install failsNode <22 or no networkReport the error and ask the user to check Node version and connectivity.
tsc --noEmit failsToken substitution or manifest errorPrint the log and fix before reporting success — never report success with a failing type check.

Examples

Example 1 — Full brief up front

/portaljs-new-portal Auckland Open Data Portal — datasets published by several council
departments (multiple publishers). Start with ./data/parks.csv and ./data/budget.csv.

Infers name + description, picks NAMESPACE_TYPE = 'owner', asks for namespace values (e.g. parks-dept, finance), confirms the brief, scaffolds the template, and seeds both datasets at /@parks-dept/parks and /@finance/budget.

Example 2 — No arguments, full interview

/portaljs-new-portal

Runs all three interview rounds from scratch, accepting "use defaults" for any round, then confirms the brief before scaffolding.

Example 3 — Single-publisher portal with no datasets yet

/portaljs-new-portal Reference Data Hub — a single-team reference catalog, no data yet.

Picks NAMESPACE_TYPE = 'theme' with namespace reference, clears datasets.json to [], and reports /portaljs-add-dataset as the next step.

Resources

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Migrate an ArcGIS Hub open data site into a PortalJS catalog. The skill collects the inventory, exports and converts spatial and tabular data for publishing, uploads files to Cloudflare R2 through Git LFS, and produces a report comparing source and derived data.

中文简介正在准备中。当前显示英语简介。

  • Moving a city ArcGIS Hub catalog to PortalJS
  • Migrating selected datasets from a Hub site
  • Comparing exported data with its ArcGIS source
datopian/portaljs23702026年10月21日 更新

Add a line, bar, area, pie, or scatter chart to the showcase for a dataset already registered in PortalJS. The skill creates a reusable Chart component and displays it in the dataset’s Views section using the existing data source.

中文简介正在准备中。当前显示英语简介。

  • Show yearly emissions as a line chart
  • Compare imports and exports with grouped series
  • Display a categorical budget breakdown as a pie chart
datopian/portaljs23702026年10月21日 更新

Register a CSV, TSV, JSON, or GeoJSON source in an existing PortalJS portal. The skill adds it to the dataset catalog and routes local files or remote URLs so the catalog and showcase can display the data.

中文简介正在准备中。当前显示英语简介。

  • Register a local CSV in a PortalJS catalog
  • Add a public dataset URL without copying the file
  • Publish a GeoJSON dataset through the portal
datopian/portaljs23702026年10月21日 更新

Generate DCAT catalog feeds for a PortalJS site so open data catalogs can harvest its datasets. The skill supports JSON-LD, Turtle, and RDF/XML formats, adds feed discovery, and checks conformance to selected profiles.

中文简介正在准备中。当前显示英语简介。

  • Making a PortalJS catalog harvestable by an EU open data portal
  • Preparing feeds for a US or national open data catalog
  • Publishing catalog metadata in multiple RDF formats
datopian/portaljs23702026年10月21日 更新

Prepare a vector geospatial dataset for a PortalJS portal by converting its coordinate system, creating a map-ready PMTiles file and a queryable GeoParquet file, and registering both with the original data for an automatically rendered showcase.

中文简介正在准备中。当前显示英语简介。

  • Turn GeoJSON into a portal map and spatial query view
  • Ingest a zipped Shapefile from a URL
  • Publish a GeoPackage layer with its original file
datopian/portaljs23702026年10月21日 更新

Add an interactive Leaflet map to a selected GeoJSON dataset’s PortalJS showcase. The skill can register a local or remote GeoJSON source, install the map dependencies, and render the map in the page’s Views section.

中文简介正在准备中。当前显示英语简介。

  • Show a map alongside a registered GeoJSON dataset
  • Register a local GeoJSON file and display it on a map
  • Add a remote GeoJSON source to a PortalJS showcase
datopian/portaljs23702026年10月21日 更新

查看 datopian 的全部技能

报告此技能的问题