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.

porttyperequireddescriptionconstraint
injsonFlagEmit both reports as JSON instead of the console summary.boolean · A boolean switch — projects to a bare flag, with no value word
outreportTextConsole (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:

processsteplanevia skill
KG to public portalSerialize to JSON-LDBuild pipelinekg-export
Build and publish a per-slice SQLite fileWrite the slice definitionPlatform authoring agentkg-export
Build and publish a per-slice SQLite fileBuild it locally and measure the filePlatform authoring agentkg-export
Build and publish a per-slice SQLite fileReport the measurement; ship nothingPlatform authoring agentkg-export
Build and publish a per-slice SQLite fileWire it: gate, deploy line, search, testsPlatform authoring agentkg-export
Build and publish a per-slice SQLite fileGate every slice: slice:sqlite:checkCI/CD Pipelinekg-export
Build and publish a per-slice SQLite fileBuild each slice into _site at deployCI/CD Pipelinekg-export

How it is deployed and reached

  • Command line. From the repository root: bun run cat check:content-keys. cat check:content-keys runs bun run cat-harness-tools/scripts/check-content-keys.ts (declared in cat-harness-tools/package.json).
  • GitHub Actions. 1 workflow line(s) run its command:
workflowline
.github/workflows/code-quality-gates.yml2218run: bun run cat check:content-keys

As an API: its operation in the OpenAPI document and the MCP tool list of its layer.

installnone
runtimebun
networkno

What it is made of

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
  }
}

folio-assistant — code under the Apache License 2.0, documentation under CC BY 3.0. Generated schema and API references are rebuilt from source on every push to main.

deployed dev