okf-open-knowledge-format
ASecurityCreate, validate, and enrich Open Knowledge Format (OKF) bundles — the open spec for representing organizational knowledge as markdown files with YAML frontmatter. Use when the user mentions 'OKF', 'Open Knowledge Format', 'knowledge bundle', 'OKF bundle', 'create a knowledge base for agents', 'validate OKF', 'convert to OKF', 'enrich knowledge docs', 'agent-readable knowledge', 'LLM wiki', 'knowledge catalog', 'kcmd', or wants to structure knowledge as markdown files for AI agent consumption...
- 153 stars
- 0 votes
- 1 copy
- 35 views
- Added June 14, 2026
Works with
Security analysis
92/100- Installs packages at runtime which could introduce malicious dependencies
Pro scans all 5 files and shows the line behind each finding
npx -y skills add fabricioctelles/skills --skill okf-open-knowledge-format --agent claude-codeAre you the author of okf-open-knowledge-format?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/fabricioctelles-okf-open-knowledge-format)---
name: okf-open-knowledge-format
description: >
Create, validate, and enrich Open Knowledge Format (OKF) bundles — the open
spec for representing organizational knowledge as markdown files with YAML
frontmatter. Use when the user mentions 'OKF', 'Open Knowledge Format',
'knowledge bundle', 'OKF bundle', 'create a knowledge base for agents',
'validate OKF', 'convert to OKF', 'enrich knowledge docs', 'agent-readable
knowledge', 'LLM wiki', 'knowledge catalog', 'kcmd', or wants to structure
knowledge as markdown files for AI agent consumption. Also use when the user
has a directory of markdown files and wants to make them interoperable or
conformant with the OKF standard. Even for simple requests like 'make this
folder OKF conformant' — the skill has critical structural rules the agent
needs.
metadata:
author: ft.ia.br
version: "3.0"
date: 2026-12-02
repository: https://github.com/fabricioctelles/skills
license: Apache-2.0
category: library-and-api-reference
upstream:
repo: https://github.com/open-knowledge-format/open-knowledge-format
commit: 527e81a
previous: https://github.com/GoogleCloudPlatform/open-knowledge-format
---
# Open Knowledge Format (OKF)
OKF is a vendor-neutral, open spec (v0.3) for representing knowledge as a directory of markdown files with YAML frontmatter. No SDK required — if you can `cat` a file, you can read OKF.
It formalizes the "LLM Wiki" pattern ([Karpathy's gist](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f)) into an interoperable format: wikis written by different producers can be consumed by different agents without translation.
The canonical repository is [open-knowledge-format/open-knowledge-format](https://github.com/open-knowledge-format/open-knowledge-format), pinned here at commit [`527e81a`](https://github.com/open-knowledge-format/open-knowledge-format/commit/527e81aff55992be21507e97004286789126f88c) (2026-11-18). The earlier [GoogleCloudPlatform/open-knowledge-format](https://github.com/GoogleCloudPlatform/open-knowledge-format) repo was marked deprecated on 2026-11-18 (commit `8a8ff87`) and is no longer updated.
**v0.3 adds:** `superseded_by` for deprecated concepts, bundle metadata (`title`, `description`, `license` on the root `index.md`), and rules for extension keys (`x-<producer>-<name>`). It also makes two breaking changes in how a consumer reads a v0.2 value (see [Migrate v0.2 to v0.3](#migrate-v02-to-v03)).
For the full spec, see:
- [references/spec-v03.md](references/spec-v03.md) — Current version (v0.3)
- [references/spec-v02.md](references/spec-v02.md) — Legacy version (v0.2)
- [references/spec-v01.md](references/spec-v01.md) — Legacy version (v0.1)
### Design Principles
1. **Minimally opinionated** — Only `type` is required on a concept. The spec defines the interoperability surface, not the content model.
2. **Producer/consumer independence** — Who writes and who reads are decoupled. Human-authored bundles feed agents; LLM-generated bundles are browsed by humans.
3. **Format, not platform** — No cloud, SDK, or vendor dependency. Value comes from how many parties speak it.
4. **Trust is first-class** — Provenance, verification, freshness, and lifecycle are queryable from frontmatter. Trust tiers use only *current* verification events.
---
## Key Terminology
| Term | Definition |
|------|------------|
| **Bundle** | A directory tree of `.md` files. The unit of distribution (git repo, tarball, or subdirectory). |
| **Bundle root** | The top directory of a bundle. Paths that start with `/` resolve from here. A root `index.md` with frontmatter identifies the root when the bundle lives inside a larger repository. |
| **Concept** | One markdown file with a non-empty `type` = one unit of knowledge (table, metric, playbook, API, etc.). |
| **Concept ID** | File path within the bundle, minus `.md` suffix. Example: `tables/users.md` → ID `tables/users` |
| **Asset** | A non-`.md` file in the bundle (image, attester code). Not a concept. |
| **Frontmatter** | YAML block between `---` delimiters at file top. |
| **Body** | Everything after the frontmatter. CommonMark, plus GFM tables and `[^label]` footnotes. |
| **Link** | A standard markdown link asserting an untyped, directed relationship between concepts. Only the directory tree gives parent/child structure. |
| **Path field** | A frontmatter field whose value is a path or a URI (`resource`, `sources[].resource`, `computation`, `executor.resource`, `attester.resource`, `superseded_by`). |
| **Source** | A material a concept derives from, recorded in the `sources` frontmatter field. |
| **Provenance** | The set of sources a concept derives from. |
| **Actor** | Identity string: `<producer>/<version>` for agents, or `<scheme>:<id>` (`human:`, `team:`, `process:`, or another scheme). |
| **Trust tier** | Level derived from *current* `verified` events: unverified, machine-confirmed, or human-reviewed. |
| **Attested Computation** | A concept (`type: Attested Computation`) carrying a sanctioned way to compute a value. |
| **Extension key** | A frontmatter key the spec does not define. Future versions will not define keys that start with `x-`. |
---
## Quick Reference — Frontmatter Fields
### Core Fields (all concepts)
| Field | Required? | Description |
|-------|-----------|-------------|
| `type` | **YES** | Kind of concept (free-form string, e.g. `BigQuery Table`, `Metric`, `Playbook`, `Attested Computation`) |
| `title` | Recommended | Human-readable display name |
| `description` | Recommended | One-sentence summary |
| `resource` | Recommended | URI identifying the underlying asset (omit for abstract concepts) |
| `tags` | Optional | YAML list of short strings. A scalar value is one tag — consumers MUST NOT split it at commas. |
`type` is the only always-required key. A file without frontmatter or without `type` is not a concept; it does not make the bundle non-conformant (README.md, AGENTS.md, and similar files may live in the bundle).
### Trust & Lifecycle Fields
| Field | Description |
|-------|-------------|
| `generated` | `{ by: <actor>, at: <timestamp> }` — Who/what produced the current content and when. `by` is required in the mapping. `at` is the last *meaningful* change (format, whitespace, or link repair does not change it). |
| `verified` | List of `{ by: <actor>, at: <timestamp> }` — Who confirmed correctness. Both keys are required in an event. A single mapping counts as a one-item list. |
| `status` | `draft` \| `stable` \| `deprecated` — Default when absent: `stable`. Any other value is *not* `stable`; filters to current knowledge exclude the concept. |
| `superseded_by` | Path to the replacement concept. Meaningful only with `status: deprecated`. |
| `stale_after` | Timestamp — content is stale on/after this instant. Stale means "check again", not "false". A value that does not parse is never fresh. |
**Timestamps** (`generated.at`, `verified[].at`, `stale_after`, `sources[].last_modified`, `usage_window.from`, `usage_window.to`) are RFC 3339: a date-time with an offset (`"2026-06-30T14:00:00Z"`) or a date only (`"2026-06-30"`, meaning the start of that day in UTC). A date-time without an offset is invalid. Producers SHOULD use the date-time form for `generated.at` and `verified[].at`, because consumers compare them. Quote values that look like numbers or booleans (for example `okf_version: "0.3"`).
### Provenance Fields
| Field | Description |
|-------|-------------|
| `sources` | List of source entries (see below) |
| `usage_window` | `{ from, to }` — Time range for `usage_count` signals. One source entry MAY override it. |
Each `sources` entry:
- `resource` (REQUIRED): URL, bundle path, or scope descriptor
- `id`: Stable key for footnote attribution (SHOULD be present when the body cites the source)
- `title`: Human-readable label
- `author`: Actor who produced the source
- `usage_count`: How often exercised during `usage_window` (liveness signal, not a precise score)
- `last_modified`: When the source last changed
### Attested Computation Fields
For concepts with `type: Attested Computation`:
| Field | Description |
|-------|-------------|
| `runtime` | REQUIRED. How to run it: `bigquery`, `postgres`, `dbt`, `python`, `Looker` |
| `parameters` | List of `{ name, type, required }` — `name` and `type` are required in an entry; `required` defaults to `false`. Common types: `string`, `integer`, `number`, `boolean`, `date`, `timestamp`. |
| `computation` | Path to a computation file (if not a fenced block in the `# Computation` section) |
| `executor` | `{ resource, receipt: [...] }` — How to run and what evidence to capture |
| `attester` | `{ resource }` — Deterministic code (no LLM) that verifies the receipt and returns at least `{ ok, reason? }` |
Consumers MUST NOT show a value as attested when the concept has no `runtime` or no `attester`.
### Reserved Filenames
| File | Purpose | Has frontmatter? |
|------|---------|-----------------|
| `index.md` | Directory listing for progressive disclosure; bundle metadata at the root | NO in subdirectories. Bundle-root `index.md` MAY have `okf_version`, `title`, `description`, and `license`. |
| `log.md` | Change history, newest first | NO (v0.3: never) |
Dot-paths (files and directories whose names start with `.`) are not part of the bundle.
### Conventional Body Headings
| Heading | When to use |
|---------|-------------|
| `# Schema` | Data assets — describe columns/fields |
| `# Examples` | Show concrete usage (code blocks, queries) |
| `# Computation` | Attested Computation — the sanctioned code/query |
---
## Actor Convention
Fields that record identity (`generated.by`, `verified[].by`, `sources[].author`) use one of two forms:
- `<producer>/<version>` for agents and tools: `reference_agent/gemini-2.5-pro`
- `<scheme>:<id>` for other actors. Defined schemes:
| Scheme | Meaning | Example |
|--------|---------|---------|
| `human:` | A person | `human:ahormati` |
| `team:` | A group of people | `team:finance-fpa` |
| `process:` | An automated process | `process:finance-nightly` |
Other schemes are allowed and count as non-human. Only `human:` gives the human-reviewed trust tier. A `team:` actor in `verified` is machine-confirmed — a team name does not identify the person who did the check.
---
## Trust Tiers
A verification event is **current** when its `at` is equal to or later than `generated.at`, or when `generated` is absent. Consumers MUST calculate the trust tier only from current events. Earlier events stay in the file as history.
| Condition | Trust Tier |
|-----------|------------|
| No current `verified` event | **Unverified** |
| Current events from non-`human:` actors only | **Machine-confirmed** |
| At least one current `human:<id>` event | **Human-reviewed** |
This matters when agents maintain the corpus: if an agent rewrites a concept after a human review, the human did not read the new text, so the concept is not human-reviewed until a human confirms it again.
Trust tiers are advisory signals, not access control. Consumers MUST NOT reject an unverified concept.
---
## Links and Paths
Links and path fields use the same resolution rules:
1. A value with a URI scheme (for example `https:`) is an absolute URL.
2. A value that starts with `/` resolves from the bundle root.
3. Any other value resolves from the directory of the file that contains it.
Both in-bundle forms are valid. v0.2 recommended `/` for links; v0.3 does not prefer one form. Consumers MUST resolve both. A value that resolves outside the bundle root is external — consumers MUST NOT read it from the local filesystem.
Paths are case-sensitive URI references. Percent-encode spaces (`my%20concept.md`).
Broken links are explicitly permitted — they can represent knowledge not yet written. `[[wikilinks]]` are not OKF links.
When writing a path field from the bundle root, use a leading `/`. A bare path such as `references/attesters/foo.py` now resolves from the file's own directory, not from the bundle root (a v0.3 breaking change; see [Migrate v0.2 to v0.3](#migrate-v02-to-v03)).
---
## Create a Bundle
When the user wants to create an OKF bundle from scratch:
### 1. Determine scope and structure
Ask: What knowledge are we capturing? (tables, metrics, APIs, playbooks, etc.)
Organize into a directory tree that makes sense for the domain.
### 2. Create concept documents
Each concept = one `.md` file. Minimal conformant example:
```markdown
---
type: Metric
---
# Monthly Recurring Revenue (MRR)
Sum of all active subscriptions normalized to a monthly amount.
```
Full v0.3 example with provenance and trust:
```markdown
---
type: Metric
title: Monthly Recurring Revenue
description: Sum of all active subscription revenue normalized to monthly.
tags: [revenue, saas, kpi]
status: stable
generated: { by: "human:ftelles", at: "2026-08-25T10:00:00Z" }
verified: { by: "human:finance-lead", at: "2026-08-25T14:00:00Z" }
stale_after: "2026-12-31T00:00:00Z"
sources:
- id: stripe-docs
resource: https://stripe.com/docs/billing/subscriptions
title: Stripe Subscription Billing
author: "team:stripe-docs"
last_modified: "2026-06-01T00:00:00Z"
---
# Monthly Recurring Revenue (MRR)
## Definition
Sum of all active subscriptions normalized to a monthly amount.[^stripe-docs]
Excludes one-time fees and overages.
## Formula
`MRR = Σ(active_subscription_monthly_value)`
## Related
- [Churn Rate](./churn.md) uses MRR as denominator
- [ARR](./arr.md) = MRR × 12
[^stripe-docs]: Stripe Subscription Billing
```
For more examples across domains, see [references/examples.md](references/examples.md).
### 3. Cross-link concepts
Use standard markdown links. Two valid forms:
- **From the bundle root** (starts with `/`): `[customers](/tables/customers.md)`
- **From this file's directory**: `[churn](./churn.md)` or `[customers](../tables/customers.md)`
Links assert relationships. The kind of relationship is conveyed by surrounding prose, not by the link syntax. Broken links are explicitly permitted — they represent knowledge not yet written.
### 4. Add provenance with footnotes
When claims reference external sources, use `sources` in frontmatter and footnotes in body:
```yaml
sources:
- id: ga4-schema
resource: https://developers.google.com/analytics/bigquery/export-schema
title: GA4 BigQuery Export schema
```
```markdown
The `events_` table is sharded daily as `events_YYYYMMDD`.[^ga4-schema]
[^ga4-schema]: GA4 BigQuery Export schema
```
The footnote label is the join key into `sources`. Consumers match on `id`, not on footnote text or list position.
### 5. Generate index.md
Place in any directory for progressive disclosure. Subdirectory indexes have no frontmatter. Format:
```markdown
# Metrics
- [MRR](./mrr.md) - Monthly recurring revenue
- [Churn](./churn.md) - Monthly churn rate
- [NPS](./nps.md) - Net Promoter Score
```
Entries should include the description from the linked concept's frontmatter.
A producer that regenerates `index.md` MUST keep the existing frontmatter of the bundle-root `index.md`.
### 6. Generate log.md (optional)
Chronological change history, newest first, ISO 8601 date headings. No frontmatter.
```markdown
# Update Log
## 2026-08-25
- **Creation**: Added MRR, Churn, and NPS metrics.
- **Creation**: Established directory structure.
## 2026-08-20
- **Initialization**: Bundle created.
```
### 7. Declare version and bundle metadata
Bundle-root `index.md` SHOULD include frontmatter declaring the spec version, plus a title, a one-sentence description (scope and when to use the bundle), and an optional license (SPDX expression or path to a license file):
```markdown
---
okf_version: "0.3"
title: My Knowledge Bundle
description: Tables, metrics, and playbooks for the sales org. Use it for revenue and pipeline questions.
license: CC-BY-4.0
---
# My Knowledge Bundle
- [Tables](./tables/) - Database tables
- [Metrics](./metrics/) - Business KPIs
```
These keys apply to the bundle, not to the concepts in it. Quote `okf_version` as a string.
### 8. Distribution
A bundle can be distributed as:
- A **git repository** (recommended — history, attribution, diffs)
- A tarball or zip archive
- A subdirectory within a larger repository
### 9. Verify conformance
A bundle is conformant with OKF v0.3 when:
1. Each frontmatter block in a `.md` file under the bundle root parses as a YAML mapping
2. Each reserved file (`index.md`, `log.md`) follows §8 / §9 when present
A `.md` file without frontmatter or without `type` is not a concept. It does not make the bundle non-conformant. Validators SHOULD warn about it.
---
## Create an Attested Computation
Attested Computations are concepts that carry not just what a value *means* but a sanctioned way to *compute* it. Use them when you need verifiable, reproducible calculations.
### When to use
- Financial metrics where compliance requires audit trails
- KPIs that must be computed consistently across reports
- Any calculation where "did the sanctioned thing run" matters
### Structure
````markdown
---
type: Attested Computation
title: Revenue for fiscal year
description: Recognized revenue for a fiscal year, per Finance's definition.
tags: [finance, revenue]
status: stable
runtime: bigquery
parameters:
- { name: year, type: integer, required: true }
executor:
resource: /references/skills/run-on-bq.md
receipt: [job_id, executed_sql, result]
attester:
resource: /references/attesters/sql-equality.py
generated: { by: reference_agent/gemini-2.5-pro, at: "2026-06-20T14:00:00Z" }
verified: { by: "human:ahormati", at: "2026-06-25T09:00:00Z" }
stale_after: "2026-12-31T00:00:00Z"
sources:
- id: rev-policy
resource: https://wiki.acme/finance/revenue-recognition
title: Revenue recognition policy
author: "team:finance-fpa"
last_modified: "2026-04-02T00:00:00Z"
---
# Computation
```sql
SELECT SUM(amount) AS revenue
FROM finance.recognized_revenue
WHERE fiscal_year = @year
```
The computation binds only the declared `parameters`, per the recognition
policy.[^rev-policy]
[^rev-policy]: Revenue recognition policy
````
### Key rules
1. **Agent fills parameters only** — The agent supplies *values* for declared `parameters`, never edits the computation itself
2. **Computation can be inline or external** — If `computation` is set, that file is the computation and the body should not also have a fenced block. If it is absent, the computation is the first fenced code block in the `# Computation` section (any ATX level; the section ends at the next heading of the same or a higher level)
3. **Executor produces a receipt** — Evidence the attester inspects
4. **Attester is deterministic** — No LLM, just code that verifies the receipt and returns at least `ok` and an optional `reason`
5. **Verification ≠ attestation** — `verified` confirms the *definition* still agrees with policy (recorded in the bundle). Attestation confirms one *run* used the sanctioned computation (a runtime artifact; the bundle does not record it)
### Linking to computations
Other concepts link to Attested Computations:
```markdown
---
type: Metric
title: Revenue
---
# Definition
Recognized revenue for a fiscal year, computed by
[the revenue computation](../computations/revenue.md).
```
---
## Validate a Bundle
### Preferred: official `validate.py` (when available)
The official repo ships [`skills/okf-generate/scripts/validate.py`](https://github.com/open-knowledge-format/open-knowledge-format/blob/527e81aff55992be21507e97004286789126f88c/skills/okf-generate/scripts/validate.py) (Python 3, PyYAML). If that script is reachable, prefer it — it implements the v0.3 rules, including current-only trust tiers, path-resolution fallbacks, and reserved-file checks.
```bash
python3 /path/to/okf-generate/scripts/validate.py ./bundle/
# add --strict to treat warnings as failure
```
The official repo also has agent skills [`okf-generate`](https://github.com/open-knowledge-format/open-knowledge-format/tree/527e81aff55992be21507e97004286789126f88c/skills/okf-generate) and [`okf-consume`](https://github.com/open-knowledge-format/open-knowledge-format/tree/527e81aff55992be21507e97004286789126f88c/skills/okf-consume). This catalog skill stays a self-contained guide with a bash fallback; it does not replace those official skills.
### Alternative: okflint (community linter)
[okflint](https://github.com/mattdav/okflint) is a dedicated Python linter for OKF bundles with 18 rules across 3 tiers (OKF core, profile, hygiene). If it is installed and the official script is not available, prefer it over the built-in bash script. Confirm which OKF version your installed okflint targets before treating its results as v0.3 conformance.
**Agent behavior:** Before validating, check for the official script, then `command -v okflint`. If neither is available, ask the user:
> "O validador oficial (`validate.py` do repositório open-knowledge-format) não está acessível, e o okflint (linter comunitário para OKF, profiles via manifesto e suporte a wikilinks) não está instalado. Quer que eu instale o okflint, aponte o `validate.py` oficial, ou siga com a validação básica do script bash embutido?
> 1. Apontar o `validate.py` oficial (clone ou path do repositório)
> 2. `uv tool install okflint` (isolado)
> 3. `pip install okflint`
> 4. Seguir sem eles (script bash embutido)"
If the user agrees to install okflint:
```bash
# Option 1: uv (recommended — installs isolated, no venv needed)
uv tool install okflint
# Option 2: pip (installs in current environment)
pip install okflint
# Verify installation
okflint --version
```
After installation (or if already available):
```bash
# Full validation with manifest (if okf-base.yaml exists)
if [ -f okf-base.yaml ]; then
okflint validate --manifest okf-base.yaml ./bundle/
else
# Core OKF validation only (no manifest needed)
okflint validate ./bundle/
fi
```
**okflint advantages over the built-in script:**
- Manifest-driven profiles (enforce custom required fields, status vocabularies, per-type constraints)
- Wikilink resolution against full Obsidian vault
- JSON output (`--json`) for CI pipeline parsing
- Detects broken markdown links and ambiguous wikilinks
- Exit codes: `0` = pass, `1` = conformance failure, `2` = bad manifest
### Fallback: built-in bash script
When the official validator and okflint are not available, use [scripts/validate.sh](scripts/validate.sh). It checks v0.3 conformance plus trust, lifecycle, and provenance signals.
When asked to validate, apply the two conformance rules and report:
```
✅ PASS: 12 concept files; all present frontmatter parses
✅ PASS: reserved index.md / log.md follow structure
⚠ WARNING: 1 file is not a concept (no type) — permitted in v0.3
⚠ WARNING: 2 broken cross-links (permitted but worth noting)
ℹ INFO: 5 files with current trust fields (generated/verified)
ℹ INFO: 1 concept lost its trust tier (verification older than generated.at)
ℹ INFO: 2 Attested Computation concepts found
```
### Errors (conformance failures)
- `E3`: Reserved file `{path}` has unexpected structure (subdirectory `index.md` with frontmatter; `log.md` with frontmatter)
Unparseable frontmatter, when detected, is also a conformance failure (spec §11.1). The bash fallback cannot always parse YAML; prefer `validate.py` for that check.
### Warnings (non-blocking; the bundle stays conformant)
- `W1`: Missing recommended field `title` or `description`
- `W2`: Broken cross-link `{link}` in `{file}`
- `W3`: Using legacy `timestamp` instead of `generated`
- `W4`: No `index.md` in directory `{dir}`
- `W5`: `log.md` dates not in ISO 8601 `YYYY-MM-DD` format, or not newest first
- `W6`: `sources` entry missing `resource` field
- `W7`: `stale_after` date has passed — content is stale (check again, not "false")
- `W8`: File is not a concept (no frontmatter, or frontmatter without `type`)
- `W9`: Attested Computation missing required `runtime` field (consumers cannot treat it as attested)
- `W10`: `superseded_by` present without `status: deprecated`
- `W11`: Unknown `status` value — consumers treat the concept as not current
### Info
- `I1`: No verification is current (each `verified` event is older than `generated.at`) — trust tier is unverified
- `I2`: Attested Computation has no `attester` — consumers cannot show values as attested
Consumers MUST NOT reject a bundle because of: missing optional fields, unknown type values, unknown extension keys, broken links, or missing index files. A null, empty string, or empty list is the same as an absent key. Where a field is a list (`tags`, `sources`, `verified`, `parameters`), a single item counts as a one-item list.
---
## Enrich Concepts
When the user has existing OKF concepts that need enrichment:
### Add schema section
For data assets, add `# Schema` with a columns table:
```markdown
# Schema
| Column | Type | Description |
|--------|------|-------------|
| `order_id` | STRING | Unique identifier |
| `customer_id` | STRING | FK to [customers](/tables/customers.md) |
```
### Add examples section
For APIs, queries, or tools, add `# Examples` with fenced code blocks showing usage.
### Add provenance
Add `sources` to frontmatter and footnotes to body for per-claim attribution:
```yaml
sources:
- id: official-docs
resource: https://example.com/docs
title: Official Documentation
author: "team:product-docs"
last_modified: "2026-07-15T00:00:00Z"
```
### Add trust signals
```yaml
generated: { by: reference_agent/gemini-2.5-pro, at: "2026-08-25T10:00:00Z" }
verified: { by: "human:domain-expert", at: "2026-08-25T14:00:00Z" }
status: stable
stale_after: "2026-12-31T00:00:00Z"
```
Only add `stale_after` when a review date is actually known. Do not invent one. After a meaningful rewrite, update `generated.at` and do not treat earlier `verified` events as current.
### Retire or move a concept
Keep the file, set `status: deprecated`, and add `superseded_by` when a replacement exists. When you rename or move a concept, leave a short deprecated stub at the old path so existing links keep working.
### Add cross-links
Weave links into natural prose. Don't create a standalone "links" section — express relationships in context where they're meaningful.
### Fill recommended fields
If `title`, `description`, `tags` are missing, add them. Derive values from body content when possible. Write `tags` as a YAML list.
### Extensions
Unknown keys are allowed at any level, including inside `sources`, `generated`, `verified`, `executor`, and `attester`. Keep keys you do not recognize. Name new keys `x-<producer>-<name>` (for example `x-acme-owner`); future OKF versions will not define keys that start with `x-`.
### Enrichment workflow reference
The official enrichment agent follows this pattern — apply the same logic manually:
1. Start with metadata-only docs (just frontmatter + minimal body)
2. Add schema/structure from source system
3. Add `sources` from authoritative documentation
4. Weave cross-links based on discovered relationships (FKs, shared tags, join paths)
5. Generate `index.md` files for progressive disclosure; keep existing root frontmatter
6. Add `generated` and optionally `verified` for trust tracking
---
## Migrate v0.2 to v0.3
v0.3 has two breaking changes. Both alter how a consumer reads a v0.2 value.
| Change | Effect on v0.2 bundles | Fallback |
|--------|------------------------|----------|
| A path field without a leading `/` resolves from the directory of its file | Bare paths that v0.2 examples wrote from the bundle root do not resolve | For bundles that declare `okf_version` 0.2 or earlier, or no version, the consumer MAY try the bundle root |
| Only current verification events give the trust tier | Some concepts go from human-reviewed to a lower tier | None. The tier can only go down, which is the safe direction |
### Migration steps
1. Set `okf_version: "0.3"` on the root `index.md`, and add `title` and `description` (optional `license`)
2. Find each path field without a leading `/` that was written from the bundle root, and add the `/`
3. Remove any frontmatter from each `log.md`
4. Convert each scalar `tags` value to a YAML list, and split a comma-separated string into separate tags. Example: `tags: sales, orders` becomes `tags: [sales, orders]`. (Consumers of a leftover scalar will treat it as *one* tag and MUST NOT split on commas.)
5. Add `superseded_by` to each deprecated concept that has a replacement
6. Add an offset to each date-time that has none. If you do not know the time zone, ask the user. Date-only values are valid and mean the start of that day in UTC
7. Re-check trust tiers. Tell the user which concepts lost their tier because verifications are older than `generated.at`
### Other v0.3 clarifications (not breaking, but worth applying)
- Unknown `status` is not `stable`
- Stale means "check again", not "false"
- `parameters` entries require `name` and `type`; `required` defaults to `false`
- Links no longer have a preferred form; both `/` and relative paths are valid
- `team:` is a defined actor scheme
- Frontmatter is YAML 1.2 core schema; do not rewrite values you did not change
---
## Migrate v0.1 to v0.2
Still applies when a bundle (or some files in it) uses v0.1 forms. After these steps, do the v0.2 → v0.3 migration above.
### Breaking changes to address
1. **`timestamp` → `generated.at`**
```yaml
# v0.1
timestamp: 2026-05-28T22:53:05Z
# v0.3
generated: { by: "human:author", at: "2026-05-28T22:53:05Z" }
```
2. **`# Citations` → `sources`**
```markdown
# v0.1 body
# Citations
[1] https://example.com/docs
# v0.3 frontmatter
sources:
- id: docs
resource: https://example.com/docs
title: Example Documentation
```
If you do not know the producer, keep `timestamp`. Consumers MAY use it when `generated` is absent. Consumers MAY also parse a legacy `# Citations` body list when `sources` is absent.
---
## Convert Sources to OKF
For detailed conversion guides, see [references/conversion.md](references/conversion.md).
### Quick rules
**Notion export:** Properties → frontmatter. Remove UUID suffixes from filenames. Convert Notion links → relative markdown links. Map last-edited dates to `generated`, not to the legacy `timestamp` field.
**Obsidian vault:** Convert `[[wikilinks]]` → `[title](./file.md)`. Ensure `type` field exists. Move inline `#tags` to frontmatter as a YAML list.
**CSV/spreadsheet:** Each row = one concept. Map columns to frontmatter fields. First column = filename.
---
## Guardrails
1. **NEVER invent data.** If you don't know the correct `type`, ask. If you don't have schema info, leave it out. No fabricated URLs, column names, or `stale_after` dates.
2. **Preserve unknown fields.** OKF explicitly allows extension. Don't delete fields you don't recognize. Prefer `x-<producer>-<name>` for new keys.
3. **Don't impose taxonomy.** Type values are free-form strings. Suggest descriptive values but never reject a bundle for having unexpected types.
4. **Broken links are OK.** The spec explicitly permits them — they represent not-yet-written knowledge.
5. **Minimal by default.** Generate only `type` (required) + recommended fields that are warranted. Don't pad with empty values.
6. **Ask before assuming.** If the domain is unclear, ask what types and structure make sense.
7. **Respect trust hierarchy.** Only mark as `verified` by `human:` if actually human-reviewed. Don't fabricate verification. After a meaningful rewrite, update `generated.at`; do not treat older human reviews as current.
8. **Computation integrity.** Never edit the computation in an Attested Computation concept — only fill parameters.
9. **Keep root index frontmatter.** When regenerating `index.md` at the bundle root, preserve the existing frontmatter.
10. **Don't split scalar tags.** A leftover scalar `tags` value is one tag.
---
## Serve via Google Cloud Knowledge Catalog
Google Cloud's Knowledge Catalog **natively ingests OKF bundles** and serves them to agents. This is the enterprise path — optional but powerful.
### kcmd CLI (Metadata as Code)
`kcmd` is a bidirectional sync tool between OKF-like local metadata and Knowledge Catalog. Think "git for metadata."
```bash
# Initialize from BigQuery dataset
kcmd init --bigquery-dataset <project>.<dataset>
# Pull current state from catalog
kcmd pull
# Push local changes
kcmd push --dry-run
kcmd push
```
Also ships as an **MCP server** for agent integration:
```json
{
"mcpServers": {
"kc-mac": {
"command": "kcmd",
"args": ["mcp", "--path", "/path/to/root"]
}
}
}
```
MCP tools: `pull`, `push`, `list-entries`, `lookup-entry`, `modify-entry`.
### Reference Enrichment Agent
The official enrichment agent (Python, ADK, Gemini) auto-generates OKF bundles from BigQuery metadata. Two-pass architecture:
1. **BQ pass** — one OKF doc per table/view from metadata
2. **Web pass** — LLM crawls seed URLs and for each page decides to:
- **(a) Enrich** existing concepts with citations/schemas
- **(b) Mint** a new `references/<slug>` doc
- **(c) Skip** irrelevant content
Controls: `--web-seed-file`, `--web-max-pages`, `--web-allowed-host`, `--no-web`.
### Visualizer
The reference agent includes a `visualize` subcommand that renders any OKF bundle as a self-contained interactive HTML file:
```bash
python -m reference_agent visualize --bundle ./bundles/<name>
```
Features:
- Force-directed graph of concepts with colored nodes by type
- Detail panel with frontmatter and rendered markdown
- "Cited by" backlinks
- Search and type filtering
**When to mention this to users:** If they're enriching BigQuery datasets, point them to the [reference agent in the canonical repo](https://github.com/open-knowledge-format/open-knowledge-format). If they want enterprise catalog integration, point to kcmd.
---
## Output Format
When creating a bundle, present results as:
1. **Directory tree** showing the full structure
2. **Each file's content** in fenced code blocks
3. **Conformance check** confirming the bundle passes the v0.3 rules
4. **Trust summary** showing current verified/unverified counts (events older than `generated.at` do not count)
```
saas-metrics/
├── index.md
├── log.md
├── metrics/
│ ├── index.md
│ ├── mrr.md
│ ├── churn.md
│ └── nps.md
└── computations/
└── mrr-calculation.md
```
Then show each file, then confirm:
```
Bundle is OKF v0.3 conformant ✅
- 4 concept files
- 1 Attested Computation
- 3 human-reviewed, 1 unverified (current events only)
- 0 stale concepts
```
Files in this skill
- SKILL.md
- references/conversion.md
- references/examples.md
- references/spec-v01.md
- scripts/validate.sh
Attribution
Related skills
View all in ai-agents →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.