pxwebapi-skills / pxwebapi-v1-generic-skill
CLAUDE.md18 starsChanged 6 days agoMITView on GitHub
This is not an application codebase. It is a Claude Code Skill package that teaches Claude how to query any PxWebApi v1 installation (the PxWeb 1.0 API). Changes here are documentation/prompt edits that get loaded when the skill triggers. The only build step is scripts/build_zip.sh, which packages the distribution ZIP; there are no unit tests, and correctness is established by probing live installations (see "Editing guidance") and by the scenarios in evals/. The defining constraint of v1, and the thing…
In this repository11 other files it gives its agents.
- pxwebapi-v2-generic-skill/CLAUDE.mdCLAUDE.md
- scb-pxwebapi-v2-skill/CLAUDE.mdCLAUDE.md
- ssb-chart-skill/CLAUDE.mdCLAUDE.md
- ssb-histstat-skill/CLAUDE.mdCLAUDE.md
- ssb-pxwebapi-v2-skill/CLAUDE.mdCLAUDE.md
- generic-pxweb-v1-skillSkill
- generic-pxweb-v2-skillSkill
- scb-pxwebapi-v2Skill
- ssb-chartSkill
- ssb-histstatSkill
- ssb-pxwebapi-v2Skill
The file
We split this CLAUDE.md into the rules it gives an agent
8 rules. About 0 are common, 3 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 99
Add a DEVLOG.md entry — what changed, what was verified live, and on what date.
- Very specific: line 102
Run scripts/build_zip.sh and commit the ZIP.
- Distinctive: line 103
If a factual claim changed, do the sibling check below and record its outcome, including when the answer is "does not apply".
- Very specific: line 105
If you changed a step, an endpoint or a limit that docs/skill-map-workflow.svg shows, redraw it.
- Very specific: line 176
Remember which installations are file-based: Only SSB and SCB are relational.
- Very specific: line 181
Do not import v2 filter syntax (top(5), from(), range(), ?
- Distinctive: line 183
When a behaviour varies by installation (search support, available formats, aggregation prefixes, cell limits), call that out explicitly.
- Distinctive: line 200
When you correct a factual claim here, look at whether the siblings say the same thing — then
≈ “Common” is an estimate: at least 1 in 5 of the 29,248 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
What this repo is
This is not an application codebase. It is a Claude Code Skill package that teaches Claude
how to query any PxWebApi v1 installation (the PxWeb 1.0 API). Changes here are
documentation/prompt edits that get loaded when the skill triggers. The only build step is
scripts/build_zip.sh, which packages the distribution ZIP; there are no unit tests, and
correctness is established by probing live installations (see "Editing guidance") and by the
scenarios in evals/.
The defining constraint of v1, and the thing every page here has to keep in view: data is
POST-only, metadata is thin, and there is no codelist endpoint and no saved-query API. Limits
are discoverable, but through ?config as a query parameter on the language level — the
/config path returns 400.
v1 is not "v2 with fewer features" — the request shape is genuinely different, and the gaps in discovery drive most of the guidance.
Like its sibling generic-pxweb-v2-skill, this skill is vendor-neutral. Where a behaviour is
agency-specific (SSB's K-/F- aggregation prefixes, SCB's TotSA totals), say so explicitly
rather than presenting it as universal.
Layout
SKILL.md— the skill entrypoint. Frontmatter (name,description) controls auto-triggering; the body is the operational guide. Note the name mismatch: the repo folder ispxwebapi-v1-generic-skillwhile the frontmatternameand the ZIP aregeneric-pxweb-v1-skill. Claude Code triggers by folder name in practice; the frontmatternameis what counts when the skill is packaged and uploaded to claude.ai, so the ZIP's top-level directory follows the frontmatter, not the repo folder.Section order in the body, after the intro: data integrity → installation table → v1-vs-v2 table → environment check → Steps 1–5 → pitfalls → fallback. Data integrity comes first deliberately, and Fallback last carries the pointers to
troubleshooting.mdandpx-files-and-classifications.mdrather than owning sections of its own.references/— deeper material loaded on demand:query-syntax.md— the{"query": […], "response": {…}}body, the item/all/top/agg/vs filters, elimination rules, discovering aggregations, worked examples, cURLapi-details.md— URL structure, hierarchy navigation,?query=search syntax, output formats, PX-JSON, limitsjson-stat2.md— same layout as SSB's v2 file since 0.12.2: Contents, «How to read an extract» (eight rules adapted to v1), then the format sections, with PX keywords in parentheses and installations and dates inline. v1 facts that differ from v2: only the data response is json-stat2;category.indexfollows the table's order, not the request's (SSB and SCB v1, 2026-10-14) — don't port v2's "follows the request" text here; mandatory notes exist (table and value level), but only in the data; SCB's v1 sets norole.geo;describedbyis URNs at SSB (two in one string onRegion) and plain text at SCB; nolink.related, nocodelists,discontinuedalwaysnulltroubleshooting.md— HTTP codes and the three distinct v1 error payloadsinstallations.md— the broad inventory: 50 known v1 installations with status, languages and?configlimits, grouped by countrypx-files-and-classifications.md— file-based vs relational installations,.vs/.aggfile structure, and the PX keywords behind the API's metadata (ELIMINATION,AGGREGALLOWED, …)v1-vs-v2.md— endpoint/body/filter translation both directions, and using v2 to fill v1's discovery gaps
CHANGELOG.mdandDEVLOG.md— two logs for two readers.CHANGELOG.mdships in the ZIP and tells users what is different in the answers: a few bullets per version, no sweep counts, no sibling checks.DEVLOG.mdis the maintainer's record and is not shipped: what changed, what was verified live, on which installations and when, and every sibling-check outcome. It is the oldCHANGELOG.md, split off on 2026-10-03. Every version appears in both. TheCHANGELOG.mdheader links toDEVLOG.mdby full GitHub URL, because a relative link is dead inside the ZIP.evals/eval-scenarios.md— end-to-end scenarios. Repo-internal, not shipped.docs/— material for people, not for the model, and not shipped. Two parts:The skill map (for readers of the repo):
skill-map-workflow.svg(the environment check, Steps 1–5, the endpoint each step calls, the POST response as the only source of numbers) andskill-map-checks-and-packaging.svg(no example checker, verification by hand, the ZIP build) are hand-drawn and are the only copy of each drawing;skill-map.htmlwraps them with<img>and prose. Each SVG carries its own<style>and an opaque background, since GitHub serves it as an image and no page CSS or web font reaches it — size text for wide fallback fonts like DejaVu Sans. Both name the version they were drawn from; no checker reads.svgor.html. The siblings'docs/use the same layout.For agencies:
llms-template.txt(an llms.txt any v1 installation can fill in),llms-example-statfin.txt(the template filled in for Statistics Finland, every URL and the POST body checked live). Both follow the llmstxt.org v2 format: free-text rules go before the first H2 with no heading of their own, every H2 section is a pure- [name](url): notelist, and links point to LLM-friendly content (raw GitHub, JSON,.md). Percent-encode(/)inside link URLs, since llms.txt parsers end the link at the first). There is no checker for them; re-probe the Finland example by hand when you touch it, and keep the template's rules in step withSKILL.md— it is a condensed copy.scripts/build_zip.sh— buildsgeneric-pxweb-v1-skill.zipfrom the user-facing files only (SKILL.md,README.md,CHANGELOG.md,references/) plusLICENSEfrom the repo root.LICENSE(MIT) lives in the repo root and covers the whole repo;build_zip.shcopies it into the package because MIT requires the notice to travel with every copy, and the zip is the copy that gets handed out. Don't add a per-skillLICENSE— edit the root one, and rebuild all six zips when it changes (every zip-sync workflow hasLICENSEin itspaths:filter).SKILL.mdfrontmatter carrieslicense: MIT. LICENSE has complete terms(the optional Agent Skills field — keep it short, it names the file besideSKILL.mdin the zip); never put licence text in the body, which is loaded on every trigger. CI (.github/workflows/check-v1-zip.yaml, in the repo root, not here) rebuilds it anddiff -rs against the committed ZIP, so an outdated ZIP fails the build.
Release checklist
Every content change:
- Bump
metadata.versioninSKILL.mdfrontmatter (semver; stay below 1.0.0 while the rootREADME.mdmarks the skill beta). A version that isn't bumped lies about copies being current. - Add a
DEVLOG.mdentry — what changed, what was verified live, and on what date. Then add the user entry inCHANGELOG.md, derived from it: what is different in the answers, in a few bullets, with corrections marked Corrected:. Same version and date in both files. - Run
scripts/build_zip.shand commit the ZIP. CI will catch it if you forget. - If a factual claim changed, do the sibling check below and record its outcome, including when the answer is "does not apply".
- If you changed a step, an endpoint or a limit that
docs/skill-map-workflow.svgshows, redraw it. It is outside the ZIP, so CI will not catch it drifting.
The README duplicates two things on purpose — the seven-row installation table and the file
tree. README is for humans, SKILL.md for the model. That means an installation change has to be
made in three places: SKILL.md, README.md and references/installations.md.
Editing guidance
- The Data integrity — the base rule section near the top of
SKILL.mdoutranks everything else in the skill: never state a number not fetched from the API in that conversation, never blend other sources, never interpolate. Don't weaken, shorten or relocate it. It mirrors the same section ingeneric-pxweb-v2-skill,ssb-pxwebapi-v2(Norwegian) andscb-pxwebapi-v2(Swedish); a change to the rule belongs in all four. The v1 version deliberately differs on two points: thestatusbullet notes that symbols are per-PX-file (DATASYMBOL1–6), and the API-failure bullet notes that several v1 installations return a bareBad Request, which makes a failed call easy to mistake for an empty result. There is nodiscontinuedbullet — v1 has no such flag. Since 0.12.2 the mandatory-notes bullet is mirrored here; it adds that v1's metadata has no notes, so they arrive only with the data. - Versioning:
metadata.versioninSKILL.mdfrontmatter plus aDEVLOG.mdand aCHANGELOG.mdentry on every content change (semver; stay below 1.0.0 while the rootREADME.mdmarks the skill beta). A version that isn't bumped lies about copies being current. - Verify against a live installation before changing a factual claim. Each claim in these
files was reproduced with
curlagainst the installations it names, on the date it gives. Where a claim contradicts published documentation, the file says so and states which one is right — keep that habit, and keep the verification date accurate when you re-check. - Known contradictions between the official PxWeb 1.0 spec and live behaviour, already documented
and worth not "correcting" back:
- Format names are hyphenated (
json-stat2,json-stat). The spec'sjsonstat2/jsonstatreturn 400 on both SSB and SCB. - Multiple wildcards in one
alllist work. The spec says only one is permitted. - The cell-limit response is 403, not 400 or 413 (and at Finland it is an IIS HTML page, not a JSON body).
- The JSON error payloads (
{"error":"Parameter error"}etc.) are SSB-only. SCB, Finland and Greenland all return a bareBad Requestwith no diagnostic. - A table id or database that does not exist is a 400, not a 404, at all seven verified installations (2026-09-28). 404 comes only from segments above the language, an unknown language at SSB, and a file extension on a table id at SCB. Agencies' own guides say 404 (Finland's does); until 0.12.1 this skill said so too.
?configreports limits that differ from the agencies' own published figures — SSB documents 30 calls/60 s where?configsays 300; Finland's help page says 100,000 cells where?configsays 120,000 (confirmed by bisection).?configwins.- The default output format when
"response"is omitted is installation-specific, with three outcomes. Measured on all seven verified installations 2026-09-04:json-stat2at SSB, Finland and Estonia; PX at SCB and Greenland; PX-JSON at the Faroe Islands and Iceland. The spec prescribes PX, which two of seven do. Earlier revisions stated "the default is PX" as a universal rule in four places. The advice that followed from it — always set"response"explicitly — was right; the reason given was wrong, which is worse than useless because it invites a reader to conclude an omitted"response"is safe on an installation they have seen return JSON. Note that PX-JSON is JSON with a wholly different shape, so "did I get JSON?" is not a sufficient check.
- Format names are hyphenated (
- Probe the query-parameter form before declaring an endpoint absent. v1 puts config on
?config, not/config; testing only the path form produced a wrong "v1 has no config endpoint" claim that survived several revisions of this skill. - The inventory has two levels, and they are verified to different depths. The table in
SKILL.mdis the operational list: seven installations with a base URL through DATABASEID, the hierarchy walked, and the?query=support column probed — search is genuinely absent (400) at SCB and Statistics Iceland, and that is load-bearing for the workflow.references/installations.mdis the broad inventory: 50 installations — 49 from the R packagepxweb, verified only to the LANGUAGE level (root endpoint returns JSON,?configread). Re-probe before adding a row to either. An entry may not move from the broad list to theSKILL.mdtable without probing?query=and finding its DATABASEID — that is exactly the work the two levels distinguish. ?configoutranks every other source of limits. Agencies' published figures and third-party catalogues are wrong often enough to be unusable: across the 26 installations the R catalogue and?configboth describe, 10 disagree on the call limit and 10 on the value limit, some by orders of magnitude (askdata.rks-gov.netlisted at 10 calls/10 s where?configreports 100 000). The pattern is that catalogues record what agencies publish and?configreports what the installation enforces. Never write a limit into this skill from anywhere else. Note also thatmaxCellsis absent from five of 43?configpayloads — absence is not "unlimited".- The R package
pxwebships two catalogues, and they disagree. The development version on GitHub has 46 installations with modern URLs but no rate-limit fields; CRAN 0.17.0 has 30 with older URLs (11 stillhttp://), the limit fields, and an SSB entry the development version has dropped.references/installations.mdmerges them — URLs and coverage from the development catalogue, the three CRAN-only entries marked‡, limits from live?config. Anyone regenerating that file needs to know both exist, and that the limit fields are on their way out upstream. - Examples should stay schematic (
POST {table_url}) except where a concrete, verified call makes the point better — the Finland example exists specifically becausealue_23_20260101/contentscode/timeperiod_yproves that Nordic variable names are not universal. Keep at least one non-Nordic example for that reason. - Remember which installations are file-based. Only SSB and SCB are relational; everywhere else
a table is a
.pxfile and its classifications are.vs/.aggfiles the API never reads. This is the reason the.pxextension appears in most URLs, and the reason the "query v2 for aggregation names" trick helps only at the two installations that need it least. Do not present that trick as a general solution. - Do not import v2 filter syntax (
top(5),from(),range(),?masking) into v1 guidance. The overlap is smaller than it looks, andreferences/v1-vs-v2.mdis where the mapping belongs. - When a behaviour varies by installation (search support, available formats, aggregation prefixes, cell limits), call that out explicitly. The skill will be applied to installations nobody has tested.
Related sibling skills
generic-pxweb-v2-skill— the same shape for PxWebApi v2; vendor-neutralssb-pxwebapi-v2— Norway-specific v2 (Klass/VarDok URNs,agg_KommFylker/agg_KommSummerwithF-/K-prefixes, curated table index)scb-pxwebapi-v2— Sweden-specific v2
These skills share the json-stat2 response format and the elimination semantics, so a fix to
json-stat2.md or to the elimination rules probably belongs in more than one of them. The
request-side material does not transfer — v1 and v2 differ there completely.
The sibling check is a check, not a propagation
When you correct a factual claim here, look at whether the siblings say the same thing — then verify it there before changing it. Two rounds have now shown that the "fix it everywhere" reflex introduces new errors while removing old ones:
- The
maxCallsPerTimeWindowcorrection inssb-pxwebapi-v2did not port toscb-pxwebapi-v2: the sentence that was wrong at SSB is correct at SCB, which really does enforce 30 calls / 10 s. extension.px.aggregallowed: falseblocksagg:at SSB's v1 (400) but not at SSB's v2, where the same aggregation on the same table returns data. Both skills are right about their own API. Reconciling them would have broken one of them.- The same flag was then probed on all seven installations and turned out to vary along a second
axis as well: absent entirely at Iceland, the Faroes and Estonia, and
falseyet not enforced at SCB, whereagg:ISD2onAKURLBefMreturns 200 with the aggregation applied. A claim scoped to "SSB v1" survived this; a claim scoped to "v1" would not have.
This skill's whole premise is that installations behave differently, so scope every finding to
where it was actually measured — "verified at SSB v1" says nothing about Finland, Greenland or
Iceland, and the wording in the file must show which reach the evidence has. Record the outcome in
DEVLOG.md with a date even when the answer is "does not apply"; a check that left no trace
gets redone. It stays out of CHANGELOG.md, which is about this skill's answers.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

