JSON-LD content-key check
Check every committed JSON-LD document that names the content context, or a layer’s own generated context: every plain key is a declared term (never descending into an @json value), and no file path sits under an @id-coerced term. An empty corpus is a finding, never a clean run. Prefixes are checked by jsonld:contexts --check.
Skills it satisfies
A skill states the capability; this Tool is one way to exercise it. Each skill’s declared input and output contract follows, where it has one.
kg-export
Serialize a layer’s knowledge graph to one JSON document, for publication and inspection. Read when asked to visualize, audit or share the KG, before adding a node type to the export, and before minting or authoring any subject IRI — subjects are <doc dir>/<kind>/<id>, never #fragments.
Source: cat-harness/skills/kg/kg-core/kg-export.md.
Also satisfied by: cat-harness-schema, ci-publish-context, content-context, kg-graph-export, ns-vocabulary, pages-publish, slice-sqlite, tool-schema, tool-types-schema.
The skill declares no I/O contract (schemas/skills/kg-export/{input,output}.schema.json).
Inputs and outputs
Each port names a shared type by IRI, so two Tools for one skill can be checked for interchangeability.
| port | type | required | description | constraint | |
|---|---|---|---|---|---|
| in | json | Flag | Emit both reports as JSON instead of the console summary. | boolean · A boolean switch — projects to a bare flag, with no value word | |
| out | report | Text | Console (or JSON) report; exit 1 on an undeclared key, a path under an @id term, or an empty corpus. | string · A short single-line human string. Not admissible as a command-line argument. |
Processes and tasks
Steps this Tool can carry out, because each names a skill it satisfies:
| process | step | lane | via skill |
|---|---|---|---|
| KG to public portal | Serialize to JSON-LD | Build pipeline | kg-export |
| Build and publish a per-slice SQLite file | Write the slice definition | Platform authoring agent | kg-export |
| Build and publish a per-slice SQLite file | Build it locally and measure the file | Platform authoring agent | kg-export |
| Build and publish a per-slice SQLite file | Report the measurement; ship nothing | Platform authoring agent | kg-export |
| Build and publish a per-slice SQLite file | Wire it: gate, deploy line, search, tests | Platform authoring agent | kg-export |
| Build and publish a per-slice SQLite file | Gate every slice: slice:sqlite:check | CI/CD Pipeline | kg-export |
| Build and publish a per-slice SQLite file | Build each slice into _site at deploy | CI/CD Pipeline | kg-export |
How it is deployed and reached
- Command line. From the repository root:
bun run cat check:content-keys.cat check:content-keysrunsbun run cat-harness-tools/scripts/check-content-keys.ts(declared incat-harness-tools/package.json). - GitHub Actions. 1 workflow line(s) run its command:
| workflow | line | |
|---|---|---|
.github/workflows/code-quality-gates.yml | 2218 | run: bun run cat check:content-keys |
As an API: its operation in the OpenAPI document and the MCP tool list of its layer.
| install | none |
| runtime | bun |
| network | no |
What it is made of
| role | file | |
|---|---|---|
| definition | cat-harness/tools/context-prefixes/context-prefixes.json | |
| script | cat-harness-tools/scripts/check-content-keys.ts |
Linked data
The Tool is published as its own JSON-LD document at its IRI, https://litlfred.github.io/folio-assistant/cat-harness/tools/context-prefixes.jsonld, partOf its layer’s document. The node below is the definition this page was drawn from, and is embedded in the page as application/ld+json.
{
"@context": "https://litlfred.github.io/folio-assistant/cat-harness/cat-harness.context.jsonld",
"@id": "https://litlfred.github.io/folio-assistant/cat-harness/tools/context-prefixes.jsonld",
"@type": "https://litlfred.github.io/cat-harness/v0/ns/Tool",
"partOf": "https://litlfred.github.io/folio-assistant/cat-harness/cat-harness.jsonld",
"name": "context-prefixes",
"title": "JSON-LD content-key check",
"description": "Check every committed JSON-LD document that names the content context, or a layer's own generated context: every plain key is a declared term (never descending into an `@json` value), and no file path sits under an `@id`-coerced term. An empty corpus is a finding, never a clean run. Prefixes are checked by `jsonld:contexts --check`.",
"install": {
"none": true
},
"invoke": {
"shell": "bun run cat check:content-keys"
},
"io": {
"inputs": [
{
"name": "json",
"schema": "https://litlfred.github.io/folio-assistant/cat-harness/tool-types.schema.json#/$defs/Flag",
"description": "Emit both reports as JSON instead of the console summary.",
"required": false,
"arg": {
"flag": "--json"
}
}
],
"outputs": [
{
"name": "report",
"schema": "https://litlfred.github.io/folio-assistant/cat-harness/tool-types.schema.json#/$defs/Text",
"description": "Console (or JSON) report; exit 1 on an undeclared key, a path under an `@id` term, or an empty corpus."
}
]
},
"satisfies": [
"kg-export"
],
"requirements": {
"runtime": [
"bun"
],
"network": false
}
}