| name | portaljs-new-portal |
| description | 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. |
| allowed-tools | Read, Write, Edit, Bash(npm:*), Bash(npx:*), Bash(cp:*), Bash(mkdir:*), Bash(git:*) |
| 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","scaffold","nextjs","template","catalog"] |
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, 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:
- Interview the user in up to three rounds — Home/basics, 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.
- Confirm a short brief (name, slug, description, namespace, datasets, views) before
building.
- 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.
- Materialize the template into
./PROJECT_SLUG, asking first if the destination
already exists and is non-empty.
- Substitute
__PROJECT_NAME__, __PROJECT_SLUG__, __DESCRIPTION__ tokens
across all files with perl -pi, escaping /, \, and & in the values.
- Set
NAMESPACE_TYPE ('theme' or 'owner') in lib/datasets.ts per the
interview.
- Seed datasets captured in Round 2 (via or by hand), or
clear to if none were named.