Validate an OKF v0.2 bundle
This skill checks a bundle against OKF v0.2 §11 conformance and the well-formedness of its optional trust vocabulary, and produces an advisory report. It never "fails" a bundle for optional, unknown, or broken content — OKF is deliberately permissive, and a validator that rejects such things is wrong, not strict.
Note: This skill references shared plugin documentation (../../references/) and is designed to be installed as part of the okf-authoring plugin.
Tool-agnostic by design. The full check runs by hand with zero OKF binaries installed. If a validator is installed you MAY shell out to it first, but the by-hand path is always available (see Prefer a validator, fall back by hand).
Load these when you need them (progressive disclosure)
../../references/okf-v0.2-spec-summary.md— conformance (§11), reserved-file structure (§8/§9), cross-linking (§6). The spec version is pinned there, once.../../references/trust-vocabulary.md— the provenance / trust / lifecycle field shapes to check optional frontmatter against.
The reject/advise rule (do not get this wrong)
There are exactly three hard conformance requirements (§11). Everything else is an advisory — surfaced to help the author, never a rejection.
Hard requirements — a bundle is non-conformant only if one of these fails:
- A non-reserved
.mdfile lacks a parseable YAML frontmatter block. - A frontmatter block has no non-empty
typefield. - A reserved file (
index.md,log.md) is present but violates its structure (§8 / §9) — e.g. a non-rootindex.mdcarries frontmatter, or the rootindex.mdputs anything other thanokf_versionin frontmatter.
Advisory only — MUST NOT cause rejection (§11):
- Missing optional frontmatter fields (
title,description,generated, …). - Unknown
typevalues. - Unknown / additional frontmatter keys.
- Broken cross-links (a link whose target file doesn't exist).
- Missing
index.mdfiles. - Trust-signal shape issues (below) — report, don't reject.
Procedure
1. Enumerate the bundle
List every .md file in the tree. Classify each as reserved (index.md,
log.md) or a concept (everything else).
2. Conformance checks (§11) — these can be non-conformant
For each concept file:
- Frontmatter present & parseable. File starts with
---, has a closing---, and the block is valid YAML. → fail #1 if not. - Non-empty
type. The block has atype:key with a non-empty value. → fail #2 if not.
For each reserved file:
index.mdnot at the bundle root → MUST have no frontmatter. → fail #3 if it does.- Root
index.md→ frontmatter, if any, contains onlyokf_version(value"0.2"for this spec version). Any other key there → fail #3. log.md→ date headings are ISO 8601YYYY-MM-DD. Malformed structure → fail #3; loose prose in entries is fine.
3. Trust well-formedness checks — advisory only
When the optional families are present, check shape and report advisories (load
trust-vocabulary.md for exact shapes):
- Actor convention (§7):
generated.byand everyverified[].bymatch<producer>/<version>,human:<id>, orprocess:<id>. Flag anything else. generated: if present, hasby(required within it);atis ISO 8601.verified: a list of{ by, at }, or a single bare mapping (which is a valid one-element list — do not flag it).atis ISO 8601.sources: each entry hasresource;last_modifiedisYYYY-MM-DD; footnote citations reference an existingsources[].id.status∈ {draft,stable,deprecated};stale_afteris an absoluteYYYY-MM-DD.- No stored verdict: flag any
credibility/score/trust/tierfrontmatter key — trust tiers must be derived fromverified, not stored (§5.3). Report the derived tier instead (unverified / machine-confirmed / human-reviewed). - Attested Computation: if
type: Attested Computation,runtimeis present;computationis inline (# Computationfence) xor acomputation:path. Runtime receipts must not be committed to the bundle.
4. Link advisories — never a rejection
Resolve each markdown link between concepts. A link whose target file does not exist is a broken-link advisory, not an error — it may be not-yet-written knowledge (§6). List them so the author can decide, and stop there.
5. Report
Produce a report with three clearly separated sections:
- Conformance verdict —
conformant/non-conformant, listing only true §11 failures (checks in step 2). This is the only pass/fail line. - Advisories — trust-shape, actor-convention, and other soft findings (step 3), each with file + line.
- Broken links — the list from step 4.
Also surface each concept's derived trust tier and staleness
(today >= stale_after) as informational output — derived on read, never taken
from a stored field. Today's date for the staleness comparison should be the
current date at validation time.
Prefer a validator, fall back by hand
If an OKF validator is already installed, you MAY run it first and fold its output into your report — then still apply the reject/advise rule above, since some tools are stricter than the spec permits:
okf validate <bundle>(fromokfcli/okf) — checks OKF v0.2 §11 conformance; JSON-by-default, structured error envelopes. Install per its repo (github.com/okfcli/okf) only if you want it.binder validate <bundle>(fromghchinoy/binder) — OKF v0.2 §11 conformance.factile/openknowledge— offervalidate-style commands.
Detect availability first (e.g. command -v okf, command -v binder). If none
are installed, run the by-hand checks above — that is the expected default, and
it is complete on its own. When a tool reports a "failure" that the spec treats
as advisory (unknown key, broken link, unknown type), downgrade it to an
advisory in your report and say why.
Validating a whole corpus / driving binder end-to-end → the okf-convert skill
The checks above validate a single bundle — by hand, with zero binaries, or
by folding in an installed validator. When the job is instead to ingest an
existing markdown corpus into OKF and validate it as part of driving binder
end-to-end (convert → validate → review), especially for deterministic,
offline/CI, provenance-preserving work at scale, hand off to the named,
purpose-built skill:
-
The binder
okf-convertskill (theokf-convertAgent Skill in theokf-convertplugin fromghchinoy/binder) drives thebinderCLI and reasons over its structured--jsonoutput — includingbinder validate --jsonfor §11 conformance — instead of scraping prose. It carries the ingestion-analysis judgment (pre-convert triage, trust-extraction review, the post-convert acceptance loop) that single-bundle validation does not. Install it with:/plugin marketplace add ghchinoy/binderIt assumes binder is installed and never fabricates trust (no auto
verified, no inventedsources, no stored tier). Stay in this skill (Layer A) for validating an individual bundle and for any zero-binary environment — this handoff adds no binary dependency.
Sources
- Open Knowledge Format (OKF) SPEC.md v0.2 — GoogleCloudPlatform/knowledge-catalog, okf/SPEC.md