The toolkit
okf-skills is a handful of separate parts. You can use one without the others. For each part: what it does, what it needs, how to run it.
| Part | Works on | Needs |
|---|---|---|
| Validator | Any OKF bundle, any domain | Python 3.11+ with uv, or pip and PyYAML |
| Visualizer | Any OKF bundle, any domain | Python 3.11+ with uv, or pip and PyYAML |
| okf skill | Any domain | A coding agent. Written for Claude Code first |
| Backfill skill | A git repository | Claude Code with the plugin (it uses the plugin's subagents) and its session history |
| Stop hook | A git repository | Claude Code with the plugin. Off until you opt in |
| MCP server | Any OKF bundle | An MCP host. Claude Code wires it automatically |
| GitHub Action | Any OKF bundle | GitHub Actions |
Validator
A checker in one Python file, skills/validate/scripts/okf_validate.py. No AI involved: the same bundle always gets the same report. It reads a bundle and reports findings in three groups, so you can tell a broken bundle from a bundle that could be tidier.
| Finding | Comes from | Examples | Fails by default |
|---|---|---|---|
| Error | Spec conformance, §11.1 | Frontmatter that is not a YAML mapping, duplicate keys, an unquoted impossible date like 2026-02-30 (written in quotes in a timestamp field, it is a warning instead), frontmatter in a subfolder index.md or in a log.md, a log.md date heading that is not a real YYYY-MM-DD | Yes |
| Warning | Spec guidance | A broken link, a .md file without type, a malformed sources or verified entry, a timestamp in the wrong form, an unprefixed custom key at the bundle root | No |
| Lint | okf-skills advice, not the spec | A concept without title, description, tags or generated | No, and only shown with --lint |
Most findings name the spec section they come from. A concept with only type passes, also with --strict.
A README.md inside the bundle and a link to a file that does not exist yet are both warnings, so --strict fails on them. Use --max-warnings if you want to keep them. When the bundle is conformant but a gate fails, the last line says so, for example conformant, but --strict allows no warnings (2 found).
Run it on a bundle folder. Without flags, errors fail the run and warnings are listed:
uv run skills/validate/scripts/okf_validate.py my-bundle
| Flag | Effect |
|---|---|
--strict | Any warning fails the run too |
--lint | Also show our style advice |
--max-warnings N | Fail only above N warnings |
--json | Print a machine-readable report |
--migrate | Upgrade a v0.1 or v0.2 bundle in place, then validate |
--strict fails on any warning that is shown. Lint findings count only when you also pass --lint. --migrate is described on Upgrading to v0.3. In Claude Code, the same checker runs as /okf-skills:validate.
Visualizer
Turns a bundle into one self-contained HTML file with an interactive graph. Concepts are nodes, coloured by type. Links and in-bundle path fields are edges. Clicking a node opens the rendered concept with its sources, its backlinks, its trust tier and whether it is stale. The page works out staleness when you open it, so a page you published last month still marks a concept stale on the day it expires.
uv run skills/visualize/scripts/okf_visualize.py my-bundle -o viz.html --title "My bundle"
Every concept gets a deep link, such as viz.html#tables/orders. Above 1000 concepts the layout falls back to a simpler one. --max-nodes N refuses bundles larger than N.
The page loads three libraries (Cytoscape, marked, DOMPurify) from a CDN, pinned to exact versions with Subresource Integrity. Viewing it needs a network connection. Bundle content never leaves the page.
Live demos: a storefront, a data catalog, and this repository's own bundle.
The okf skill
Instructions for a coding agent to produce, maintain and consume bundles, with the full v0.3 spec vendored next to them as the reference. It covers any domain: tables, metrics, policies, services, decisions. It tells the agent to record itself honestly in generated, never to mark its own work as verified, and never to invent a human: identity. Those rules are listed on Spec and our conventions.
/okf-skills:okf produce .okf # capture knowledge into a bundle
/okf-skills:okf maintain .okf # update concepts after the code or docs changed
/okf-skills:okf consume .okf # answer from the bundle
The skill also ships a scaffold script that works without an agent:
uv run skills/okf/scripts/okf_init.py my-bundle --title "Finance knowledge"
Backfill skill
Rebuilds a bundle for a repository that never had one, by replaying its history. A deterministic script turns git commits and Claude Code session transcripts into a list of events. Then subagents summarise the events in batches, and a single writer subagent turns the summaries into concepts.
/okf-skills:backfill .
Backfill assumes a git repository and Claude Code. It reads Claude Code session history (you can turn that off with --no-sessions), and it needs the plugin install, because the subagents live outside the skill folder. The extraction step gives the same events for the same repository. The writing step uses a language model, so two runs do not produce identical files.
Stop hook (enforced upkeep)
An optional check that runs when Claude Code is about to finish a task. If tracked files have uncommitted changes and nothing in the bundle changed, it blocks and asks the agent to update the bundle first. It does nothing until you opt in, in the bundle-root index.md:
---
okf_version: "0.3"
title: Invoice platform
x-okf-skills-upkeep: enforced
---
If the bundle also documents git repositories checked out inside the project, add x-okf-skills-recursive: true so the hook looks at them too. Set OKF_HOOK=off in the environment to turn it off for a session.
For a softer version, paste templates/CLAUDE-okf.md into your CLAUDE.md. It asks the agent to read the bundle before a task and update it after, without blocking anything.
The hook is a bash script for Claude Code and a git repository. It only notices that something changed, not whether the bundle update was correct.
MCP server
A small server that lets an AI app read a bundle through MCP, the Model Context Protocol. It is for apps that cannot open files themselves. It is read-only, talks over stdio, and serves the bundle given as an argument, else $OKF_BUNDLE, else ./.okf. It never writes, and it refuses any ID that would resolve outside the bundle.
| Tool | Returns |
|---|---|
search_concepts(query, limit) | Short cards for matching concepts: ID, type, title, description, status, trust tier, staleness |
read_concept(concept_id) | One concept, verbatim, frontmatter included |
get_neighbors(concept_id) | The concepts it links to and the ones that link to it |
uv run servers/okf_mcp.py my-bundle
In Claude Code the plugin starts it for you. There it mostly duplicates what the agent can already do with file reads and search, and we say so in the decision record. It exists for hosts that have nothing else.
GitHub Action
A composite action around the validator: uses: ekar-is/okf-skills@v1. Inputs are bundle (default .okf), strict and max-warnings. The JSON report is the report output. A full workflow is on Getting started.
What has been measured
We ran three experiments. Each is published in the repository with its protocol, its runs and the problems it exposed, including the results that did not go our way. None of them measures what OKF is worth in a real repository, where prose and git history already say a lot about what is current.
- Trust metadata, protocol published before the run. With lifecycle fields present, the reading agent never stated a superseded fact. The main comparison is invalid under the protocol's own rule: on 7 of 43 items one group never committed to an answer, mostly the control, which said "unknown".
- Write-side gate, protocol published before the run. Two things each reduced outdated answers: an instruction that makes the writing agent update the docs, and an expired
stale_afteron the old doc. With 20 test items we cannot say which works better. Without the instruction, the writing agent left the docs untouched in 57% of runs. In this second setup a concept markeddeprecatedstill produced a stale answer in 27% of trials, against 0% in the first experiment. - Backfill model tier, an engineering A/B with one run per arm. Batching small events eight per call cut the summarising phase by about a third.