portaljs-connect-ckan

portaljs-connect-ckan is a command for Claude Code from datopian/portaljs. It costs 51 tokens per session (5,225 once invoked), scanned A, original, MIT.

A command that connects a PortalJS catalogue website to a CKAN data-management system through CKAN's REST API. CKAN is software for publishing and browsing datasets.

In plain words
What is it for?
Use it to connect an existing PortalJS portal's search and dataset showcase pages to CKAN's package search and package details endpoints using editable Next.js code.
Why use it?
It replaces a fixed local dataset list with data fetched from a live CKAN service, so the portal can show the service's current catalogue and dataset pages.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is import { ckan, datasetHref, ORG_FILTER, GROUP_FILTER, MAX_DATASETS, type DatasetCard } from '../lib/ckan'.

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

Good fit Use it to connect an existing PortalJS portal's search and dataset showcase pages to CKAN's package search and package details endpoints using editable Next.js code.

Compare 6 commands from other repositories ↓
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,350 stars · on GitHub · portaljs.com

Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

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

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-connect-ckan

README.md
[![agentmods](https://agentmods.dev/badge/commands/datopian/portaljs/portaljs-connect-ckan/github.svg)](https://agentmods.dev/commands/datopian/portaljs/portaljs-connect-ckan)
Your own site
<a href="https://agentmods.dev/commands/datopian/portaljs/portaljs-connect-ckan"><img src="https://agentmods.dev/badge/commands/datopian/portaljs/portaljs-connect-ckan/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for portaljs-connect-ckan

Your own site · 80×15
<a href="https://agentmods.dev/commands/datopian/portaljs/portaljs-connect-ckan"><img src="https://agentmods.dev/badge/commands/datopian/portaljs/portaljs-connect-ckan.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 51 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 5,225 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
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.00051 $0.05225
Opus 5 $0.00026 $0.02612
Sonnet 5 $0.00010 $0.01045
Haiku 4.5 $0.00005 $0.00522

Measured 10d ago against content hash 1d58296d5c1c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

portaljs-connect-ckan scanned grade A with 1 finding 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 10d 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -s -m 20 "CKAN_URL/api/3/action/package_search?rows=1"
.claude/commands/portaljs-connect-ckan.md · 455 lines

How it starts

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

/portaljs-connect-ckan

Connect an existing portaljs-catalog portal to a live CKAN backend. The portal stops reading the static datasets.json manifest (and files in /public/data/) and instead feeds its two data surfaces — the /search catalog and the /@<namespace>/<slug> showcases — straight from a CKAN instance's REST API (package_search / package_show) through a tiny generated fetch client. Output is plain, editable Next.js code with no runtime dependency — no opaque framework wiring.

Why a fetch client, not @portaljs/ckan? That package's bundle wires React UI components to React 18 internals (ReactCurrentDispatcher) and crashes at import under the template's React 19 — even server-side, where this skill imports it. The CKAN client class is locked inside that same module, so it can't be used in isolation. A ~40-line fetch wrapper covers the two REST actions this skill needs (package_search, package_show), is server-side only, ships zero client bytes, and has no React coupling.

Use this for the "decoupled / any backend" path: the user has a CKAN data management system (their own or a public one) and wants a browseable portal in front of it.

You can run this right after /portaljs-new-portal. A fresh portal ships with a few sample datasets so it builds and renders immediately — you do NOT need to hand-author a static dataset list first. If the user says up front they want a CKAN backend, scaffold with the sample data, then run /portaljs-connect-ckan to swap the source over to CKAN. Only a CKAN base URL is required.

The generated pages fetch CKAN server-side in getStaticProps/getStaticPaths, so the catalog is pre-rendered at build time and the site can be statically deployed.

Required input — ask, don't error

  • CKAN base URL (required) — e.g. https://demo.dev.datopian.com. The root of the CKAN instance; the skill appends /api/3/action/... itself. Must be publicly reachable.
  • Org filter (optional) — one or more CKAN organization names to restrict the catalog to.
  • Group filter (optional) — one or more CKAN group names to restrict the catalog to.
  • Portal directory (optional) — path to the portal project (default: current directory).

Read the full file on GitHub · 455 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. 10d ago First seen · 455 lines · 51 tokens per session scan A 1d58296d5c1c

Subscribe to this mod's changes

portaljs-connect-ckan is a command published in the GitHub repository datopian/portaljs (2,350 stars, last pushed 2d ago), licensed MIT. It adds 51 tokens to every session and 5,225 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.