portaljs-new-portal

本条目收录公开技能“portaljs-new-portal”,归入 Skillπ「写代码与代码审查」使用场景,并关联「软件开发与 IT」职业。目录标签:ai-lab、PortalJS、数据门户、脚手架。此页用于按任务发现相关资源;请通过固定原站版本核对实际能力、依赖环境和所需权限。本站仅提供独立目录介绍与原站入口,原始文件和附件依各自许可开放。

仓库
jeremylongshore/tons-of-skills-marketplace

安装方式

先用 Prompt 核对来源,也可切换到安装命令或下载可用的安装包。

安装方式

用 AI 助手安装

复制提示词,让助手先核对固定版本和依赖。

查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "portaljs-new-portal":https://skillpi.com/zh/skills/deepskill-c96e1b4fedf513e3ec955e1e794ff6110bceda282f673b6cddff4caed66ad55b。安装前核对上游来源和版本:https://github.com/jeremylongshore/tons-of-skills-marketplace/blob/6ea46b08dce892944db7c16f28d0b5308d402402/plugins/community/portaljs/skills/portaljs-new-portal/SKILL.md。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。

此命令从 GitHub 来源仓库获取指定技能。运行前请先查看源文件。

运行工具
npx skills add https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/6ea46b08dce892944db7c16f28d0b5308d402402/plugins/community/portaljs/skills/portaljs-new-portal --skill portaljs-new-portal
许可协议: —

来源与配置

查看 GitHub 源码

jeremylongshore/tons-of-skills-marketplace固定提交 6ea46b08dce892944db7c16f28d0b5308d402402

配置方式待核实

请查看原始来源中的适用工具、依赖和权限要求。

安装实测待补充

本条目收录公开技能“portaljs-new-portal”,归入 Skillπ「写代码与代码审查」使用场景,并关联「软件开发与 IT」职业。目录标签:ai-lab、PortalJS、数据门户、脚手架。此页用于按任务发现相关资源;请通过固定原站版本核对实际能力、依赖环境和所需权限。本站仅提供独立目录介绍与原站入口,原始文件和附件依各自许可开放。

↓ 0 下载 ↗ 0 分享点击

文件浏览

在原站浏览文件 ↗

原始 SKILL.md

打开原文 ↗
---
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`](https://github.com/datopian/portaljs/blob/main/.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, 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, 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. Seed datasets captured in Round 2 (via `/portaljs-add-dataset` or by hand), or
   clear `datasets.json` to `[]` if none were named.
8. Run `npm install` inside the scaffolded portal.
9. Verify with `npx tsc --noEmit` (never `next build` here — it would corrupt a
   running dev server's `.next/` directory).
10. Report the scaffolded routes, namespace mode, 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 `[]`).
- **Verified:** `npx tsc --noEmit` passes inside the scaffolded portal.
- **Result:** a runnable portal at `./PROJECT_SLUG` with Home (`/`), Catalog
  (`/search`), and Showcase (`/@<namespace>/<slug>`) surfaces wired up.

## Error Handling

| Symptom | Cause | Fix |
| --- | --- | --- |
| `DIR_EXISTS` | `./PROJECT_SLUG` already exists and is non-empty | Ask the user for a different name or consent to remove it; then proceed. |
| Remote fetch fails | Bad `PORTALJS_TEMPLATE_REF`, network outage, or `tiged` unavailable | Tell 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].tsx` | Resolver already falls back to remote in this case — do not force local mode. |
| `npm install` fails | Node <22 or no network | Report the error and ask the user to check Node version and connectivity. |
| `tsc --noEmit` fails | Token substitution or manifest error | Print 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

- Full workflow: [`.claude/commands/portaljs-new-portal.md`](https://github.com/datopian/portaljs/blob/main/.claude/commands/portaljs-new-portal.md)
- Template and token reference: [`references/reference.md`](references/reference.md)
- Related skills: `portaljs-add-dataset`, `portaljs-add-chart`, `portaljs-add-map`, `portaljs-connect-ckan`
- PortalJS documentation: <https://portaljs.org>

当前收录版本

1.0.0

核对来源版本 ↗

质量评测

满分 100。前四项来自 DeepSkill 收录的质量报告。

场景价值92/100
评分依据

高价值数据门户搭建工具,解决从零创建 PortalJS 项目的核心痛点

触发精准95/100
评分依据

触发描述精准完整,清晰界定 Skill 的用途和使用边界

结构规范94/100
评分依据

文档结构完整,包含完整的执行流程、错误处理和示例

执行可靠93/100
评分依据

工具来源明确,参数使用正确,覆盖主要异常场景

证据可验 (前四项均值)94/100
计算方式

取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。

权限与使用前检查

根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。

文档引用的域名或地址

这些地址可能用于文档链接或示例,不是已批准的联网清单。使用前核对实际目的地及发送的数据。

  • github.com
  • portaljs.org

本站展示提示不会授予权限。涉及文件改动、密钥、外部发送或费用时,仍由你使用的工具按需确认。

安全评级与访问范围

risk · 静态证据核验,不代表运行安全保证。

使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。

来源与使用声明 SkillPi 的部分技能资料来自公开来源或创作者提交。第三方内容的权利归各自权利人所有。安装或运行前,请查看原站的许可、权限要求和使用风险。

来源与使用

请按详情页的作者、原始来源和许可证核对使用条件,运行前检查技能需要的权限。目录收录不等于已验证安装或安全性。