Skip to content
venizia.ai

Documentation · VULCAN

okf ​

okf manages knowledge bundles in Open Knowledge Format (OKF) v0.2. You run commands through vulcan okf <command>. Run it at the project root: it reads .configs/vulcan.config.mts of the current folder, and without that file okf stops with the error okf: no project config.

CommandWhat it doesExit codes
vulcan okf checkValidate the bundle against OKF v0.2 conformance rules0 (pass), 1 (conformance error)
vulcan okf check --strictCheck OKF v0.2 conformance and project house rules0 (pass), 1 (rule violation)
vulcan okf genRegenerate source-derived pages, regions, and contents lists0 (success), 1 (generation failure)
vulcan okf coverage [--min <n>]Report source coverage and evaluate coverage threshold gates0 (pass), 1 (gate failure, project error, bad frontmatter), 2 (invalid --min)

Running an invalid command or omitting the command prints usage and exits with code 2.

To run the basic conformance check:

text
$ bun node_modules/.bin/vulcan okf check
check: OK - OKF v0.2 - 2 files, 1 concepts

To run conformance checks with house rules:

text
$ bun node_modules/.bin/vulcan okf check --strict
check: OK - OKF v0.2 + house rules - 2 files, 1 concepts

The bundle ​

The knowledge bundle lives in the directory configured by knowledge.bundle in .configs/vulcan.config.mts. By default, the bundle lives at .agents/knowledge.

index.md ​

The root index.md file defines the entry point of the bundle. It may carry frontmatter containing only okf_version (a root index with no frontmatter passes):

md
---
okf_version: "0.2"
---

# demo-app knowledge

Facts about demo-app, in the Open Knowledge Format. Rules live in `../rules.md`.

The scaffold comment line is not shown in the index sample. Nested index.md files in subdirectories must not carry frontmatter.

Concept files ​

Every other markdown file in the bundle represents a concept. A concept file requires a top-level type property in its YAML frontmatter. It can also include title and description:

md
---
type: Concept
title: A
description: about a
---

A.

Reserved files index.md and log.md do not count as concepts.

check ​

Run vulcan okf check to validate the knowledge bundle against OKF v0.2 conformance rules. Guidance warnings print to standard error.

The check validates concepts, root and nested index files, log headings, and trust metadata:

RuleFailure message
§11.1no YAML frontmatter block
§11.1unparseable frontmatter - <reason>
§11.2missing or empty top-level type
§8a nested index.md carries no frontmatter
§8unparseable frontmatter - <reason>
§8the root index may carry only okf_version - remove: <keys>
§9date heading is not YYYY-MM-DD: "## <heading>"
§9entries must be newest first: <date> follows <previous>
§5 (warning)<field> must be an ISO 8601 datetime with an offset, e.g. 2026-06-30T14:00:00Z (got <value>)
§5.1 (warning)sources[<index>] needs a resource
§5.4 (warning)status must be draft, stable or deprecated (got <status>)
§7 (warning)<field> must be <producer>/<version>, human:<id> or process:<id> (got <value>)
§12 (warning)declares okf_version <version>; the latest is 0.2 (read best-effort)

When check finds problems or warnings, messages print to standard error:

text
check: N problem(s):
  - <path>: <rule> <message>
text
check: N warning(s):
  - <path>: <rule> <message>

check --strict ​

To enforce house rules on top of OKF conformance, pass --strict. House style rules run over every markdown file in the bundle, index and log included.

check --strict enforces eight groups of house rules:

  1. Broken links: Every markdown link target in concept prose must resolve to an existing concept in the bundle:

    • <file>: broken link -> <target>.md

    When concepts fail to load, link checking is skipped and prints to standard error:

    text
    check: links skipped - <reason>
  2. Style rules: Prose outside code spans must use hyphens and proper brand casing:

    • <file>: use a hyphen, not an em-dash or en-dash (found "<match>")
    • <file>: the brand is always written <brand> (found "<match>")

    The brand rule fires only when the brand is all capitals of 2+ letters (for example VULCAN). It rejects the title-case spelling. The brand comes from knowledge.okf.brand (default: root package name unscoped and upper-cased).

  3. Structural coverage: Every directory matched by a coverage axis must have a concept or resource mapping:

    • coverage: <section>/<name> has no concept (<section>/<name>.md)
    • coverage: axis '<name>' (<path>) matches no directory
    • coverage: axis '<name>' (<path>) has no directory left after exclude/denylist
  4. Managed regions: Content between generated region markers must match renderer output:

    • freshness: region '<id>' host file missing (<file>)
    • freshness: <error>

    When a managed region is out of date:

    text
    freshness: region '<id>' is stale - run `vulcan okf gen`
  5. Generated reference pages: Whole generated pages must match current renderer output:

    text
    freshness: <path> is stale - run `vulcan okf gen`
  6. Contents lists: Long agent-read files must have fresh contents lists:

    text
    contents: <file> has no fresh contents list - run `vulcan okf gen`

    The check covers every bundle .md file except log.md, generated files, and renderer-owned pages. It also checks entries in knowledge.okf.contents.files. The check fails only for files over 100 lines that need a contents list.

  7. Changelog declarations: Dated changelog entries (YYYY-MM-DD-*.md) under knowledge.changelogs must satisfy package rules:

    • changelog: <path>: the frontmatter is not valid YAML (<error>)
    • changelog: <path> names '<name>', not a declared package's npm name
    • changelog: <path>: release '<release>' is not '<declared npm name>@<version>'
    • changelog: <path>: release '<release>' names no tag (<expected>)

    When a changelog entry declares no packages:

    text
    changelog: <path> declares no packages - add `packages: [<npm name>, ...]` to its frontmatter (`packages: []` for an entry about no package)

    The check runs only when knowledge.changelogs is set. A release: override lists the tags with git tag --list, so git must be on the PATH and the tags must be in the clone.

  8. Code in the wiki: The fenced ts, tsx, js, jsx, mts and mjs blocks of every page under knowledge.wiki, changelogs excluded, follow the code rules, because a reader copies them:

    • docs-code: <file>:<line>: an explicit cast (<as ...>) - parse or narrow the value instead (V-C-10)
    • docs-code: <file>:<line>: any or AnyType as a type - type it, or take unknown and narrow it
    • docs-code: <file>:<line>: a conditional spread - build the object, then assign the optional key
    • docs-code: <file>:<line>: a string-literal union - a const class and its value type (V-C-08)

    as const, import { A as B }, export { A as B } and import * as ns are not casts. Strings, template literals and comments are taken out before the rules run, so an as in a SQL template, a JSDoc comment or prose is not read, and neither is anything outside a fence. The check scans the code rather than parsing it, because an example is often a fragment; code inside a ${} of a template is still code.

    Two kinds of content are left out: a page that carries the note a generator writes (a blockquote that starts Generated and ends do not edit., as vulcan atlas api gen writes), and everything between <!-- okf:generated:<id> start --> and end markers. For a signature a page quotes from the source, wrap it in <!-- docs-code: off --> and <!-- docs-code: on -->. The marker is for a quoted source signature, never an example: the check prints every page that uses it with a count (check: docs-code off - 3 region(s) in 2 page(s): <page> (2), ...), and warns about an off region that holds a function body, a call or a statement (docs-code: <file>:<line>: a docs-code off region holds a function body - off is for a quoted source signature, never an example).

    The same run prints warnings, which never fail it, about the shape of the tables of the wiki:

    • docs-table: <file>:<line>: a cell of <n> characters (over 120) - a heading and a short table, or a list
    • docs-table: <file>:<line>: a continuation row with an empty first cell - one row for one item

gen ​

Run vulcan okf gen to regenerate source-derived content across the knowledge bundle. Whole files and managed regions render in memory first. Contents lists are written last. If a renderer fails, gen stops before writing any files.

text
$ bun node_modules/.bin/vulcan okf gen
gen: wrote .agents/knowledge/reference/makefile-targets.md

gen performs three tasks:

  1. Whole files: Writes pages registered in knowledge.okf.renderers (by default under reference/).
  2. Managed regions: Replaces content between <!-- okf:generated:<id> start --> and <!-- okf:generated:<id> end --> registered in knowledge.okf.regions.
  3. Contents lists: Inserts contents lists into files over 100 lines that need one (knowledge.okf.contents.files).

As files are written or skipped, gen reports its actions:

text
gen: wrote region '<id>' (<file>)
gen: wrote the contents list of <file>
gen: skipped region '<id>' - <file> does not exist yet

With a renderer configured but already current, gen prints:

text
gen: up to date

When knowledge.okf.renderers and knowledge.okf.regions are empty and no contents list was written, gen prints:

text
gen: nothing configured - knowledge.okf.renderers and knowledge.okf.regions are empty; add a renderer to knowledge.okf.renderers in the vulcan config (built in: source-map, makefile-targets, binding-keys, packages-table)

Contents lists default to AGENTS.md and .agents/rules.md. To configure built-in or custom renderers, see okf renderers.

coverage ​

Run vulcan okf coverage to report bundle documentation coverage against project source code.

text
$ bun node_modules/.bin/vulcan okf coverage

COVERAGE - 2 curated concepts

STRUCTURAL  (target 100% - one curated concept each)

REFERENCE  (advisory - generated)
  make targets    14      generated

KNOWLEDGE TYPES  (Diátaxis / arc42)
  Reference:1  Concept:1
  how-to (Playbook) 0  (target >= 1)  <- gap
  tutorial 0  (target 1)  <- gap
  glossary 0  (target 1)  <- gap

structural: 0/0  100%

The report provides four sections:

  • Structural coverage: Evaluates curated concept coverage against source directory axes.
  • Reference coverage: Advisory table of facts and generation status reported by configured renderers.
  • Knowledge types: Distribution of concepts across Diataxis types, flagging gaps below targets.
  • Structural summary: Overall percentage of covered structural directories.

Threshold gates ​

To fail CI when structural coverage drops below a target percentage, pass --min <n>. When structural coverage falls below <n>, the command exits with code 1:

text
coverage gate FAILED: structural 80% < 90%

Code 1 also indicates a coverage axis matching no directory (a project error), or bad bundle frontmatter. When <n> is missing or not a finite number, the command exits with code 2:

text
coverage: --min needs a number, got (nothing)

For an invalid value, the message shows got "<value>".

Coverage axes ​

You define structural coverage axes under knowledge.okf.coverage in .configs/vulcan.config.mts. Each axis globs directories under the repository root:

OptionTypeDefaultMeaning
namestringnoneSection name and concept directory prefix
pathstringnoneDirectory glob pattern relative to repository root
excludestring[][]Globs from repository root excluded from this axis
denyliststring[][]Directory names excluded from this axis

The global knowledge.okf.denylist lists directory names excluded across every axis. An axis item is covered when a concept exists at /<name>/<directory>.md. An item is also covered when a concept declares a matching resource: value. The covering resource: value is the directory path from the repository root. To configure renderer coverage rows, see okf renderers.

make targets ​

The shared Makefile at packages/cli/base/make/vulcan.mk defines four okf-* targets:

TargetDescription
make okf-checkCheck the knowledge bundle against OKF v0.2
make okf-check-strictokf-check plus the house rules: links, style, coverage, freshness
make okf-genRegenerate the generated pages and regions of the knowledge bundle
make okf-coverageReport how much of the code the knowledge bundle covers

See also ​