A directory tree of markdown files — the unit of distribution.
| type | Library |
| title | OKF4net |
| description | Zero-dependency .NET implementation of OKF v0.1 |
OKF4net is its .NET toolchain — a zero-dependency C# library and a Native AOT okf CLI to parse, validate, index and graph bundles of concepts.
If you cancata file, you can read OKF; if you cangit clonea repo, you can ship it.
The Open Knowledge Format represents knowledge as a directory of UTF-8 markdown files with YAML frontmatter. No database, no binary format, no runtime — files that humans, git, and agents already understand.
A directory tree of markdown files — the unit of distribution.
One document: YAML frontmatter delimited by ---, then a markdown body.
The file's path with .md removed: tables/users.md → tables/users.
Ordinary markdown links between concepts — absolute or relative; backlinks derived.
The only hard conformance requirement (§9): a non-empty type on every concept. Everything else — unknown types, unknown keys, broken links — must be tolerated by consumers.
→ what-okf-is.md — reserved files, conformance, and the section-by-section spec mapping
Load a bundle, check conformance, walk the cross-link graph. Bundle.Load never aborts on a bad file — parse failures land in ParseErrors, broken links stay in the graph as edges to missing concepts.
using OKF4net; var bundle = Bundle.Load("./my_bundle"); Console.WriteLine($"{bundle.Count} concepts"); // Conformance check (§9). var report = BundleValidator.Validate(bundle); // Traverse the cross-link graph. var id = ConceptId.Parse("tables/orders"); foreach (var b in bundle.Backlinks(id)) Console.WriteLine($"cited by {b}");
Frontmatter keeps the full ordered mapping with typed getters on top — producer-defined keys survive round-trips byte for byte. Two validation levels: ValidateConformance() enforces only what §9 requires; Validate() matches the stricter producer-side check.
→ library.md — install, examples, design choices, and the full API surface
Published as a self-contained Native AOT single-file binary — no .NET runtime on the target machine. okf validate exits non-zero on a non-conformant bundle, so it drops straight into CI.
| Command | Does |
|---|---|
| okf validate <bundle> | Conformance check (§9), non-zero exit on failure |
| okf info <bundle> | Concepts, types, links, version |
| okf index <bundle> | (Re)generate every index.md (§6) |
| okf graph <bundle> | Cross-link graph, --dot for Graphviz |
| okf parse <file> | One document's structure |
| okf fmt <file> | Normalize by parse + re-serialize (-w writes) |
$ okf validate ./bundles/ga4
42 concept(s); 0 error(s), 0 warning(s), 0 info.
✓ conformant with OKF v0.1
$ okf graph ./bundles/ga4 --dot | dot -Tsvg > graph.svg→ cli.md — building the binary, session transcripts, CI recipes
Run okf-mcp, point it at a bundle, and its nine operations become tools inside Claude Desktop, Claude Code, and Cursor — read, search, and write concepts from a conversation, over the Model Context Protocol. Same engine as the library and the CLI, exposed to any MCP client.
→ docs/mcp.md — install okf-mcp and connect each client, step by step
One prerequisite: the .NET SDK. Zero third-party runtime dependencies is a design rule — contributions keep it that way. Behavioural changes cite their spec section (§) in the PR; the test suite — including byte-exact golden comparisons — is the contract.
→ contributing.md — setup, golden fixtures, code style, and how to submit
Star the repo, open an issue, or pick a good first one. The spec is short, the codebase is dependency-free, and the test suite tells you immediately whether you're right.