OKF v0.2 Spec Compliant

Open Knowledge Format Generator

Generate structured, agent-ready OKF knowledge bundles for your codebases, data systems, and APIs. Cut AI coding token costs by ~97%.

Presets:

Concept Card Attributes

YAML Frontmatter

OKF Spec Linter (v0.2)

✓ Valid Spec
• Required Frontmatter (type, title, description)Passed
• Provenance & Attribution (generated.by, at)Passed
• Cross-reference edges & Call relationshipsPassed
• Footnotes & Source CitationsPassed
Bundle Tree:okf/concepts/user-authentication.md
OKF v0.2 Bundle

The Knowledge Layer for AI Coding Agents: Why OKF Beats Raw Code Scraping & Vector RAG

Modern AI coding tools—such as Cursor, Claude Code, Windsurf, Copilot Workspace, and Antigravity—revolutionize development speed, but suffer from an architectural bottleneck: token waste and context degradation. Every time an agent attempts to answer a question or implement a feature across an unfamiliar repository, it must re-read hundreds of source files just to extract function signatures, return types, and class relationships.

Reading a 600-line source file can consume 14,000 to 45,000 tokens. When dealing with local Small Language Models (SLMs) running on MacBooks or enterprise cloud limits, context windows fill up immediately, causing hallucinations, slow completions, and high API expenses.

Traditional Vector RAG Flaws

Vector databases shred code into arbitrary 500-token chunks based on character count. This destroys Abstract Syntax Tree (AST) hierarchies, severs import pathways, and creates hallucinations when resolving multi-hop caller/callee relationships.

The OKF v0.2 Advantage

OKF maps codebases deterministically into atomic, interconnected Markdown cards with YAML frontmatter. Average lookups drop from 45,000 tokens to just ~140 tokens (a ~97.3% reduction) with compiler-level accuracy.

OKF v0.2 Frontmatter Specification

Every OKF concept card is structured as a standalone Markdown document located inside the okf/ bundle hierarchy (e.g. okf/concepts/, okf/metrics/, okf/tables/, okf/api/). The YAML frontmatter contains standardized, machine-readable metadata:

  • type: The semantic category (Concept, Function, Class, Module, API, Table, Metric, or Decision).
  • title: Human- and agent-readable title of the concept or component.
  • description: Concise, high-density summary answering what the component does and why it exists.
  • resource: Absolute URI mapping the concept back to source code or assets (e.g. repo://src/auth/jwt.ts#L45, db://analytics/orders).
  • generated: Explicit provenance detailing authorship and creation timestamp (e.g. by: human:lead-architect or ast:okf-generator).
  • calls / called_by: Direct relational graph edges documenting caller and callee dependencies.
  • sources: Footnote citations validating the claims and specifications in the document.

Setting up OKF in Cursor, Claude Code, and Agentic Workflows

Integrating OKF into your existing development workflow requires no proprietary infrastructure or vector databases. Follow these 3 steps:

  1. Generate your bundle: Use the interactive builder above to generate your initial okf/index.md manifest and concept cards.
  2. Commit to Git: Check in the okf/ directory directly alongside your source code. Because OKF files are plain Markdown and YAML, they are 100% Git-friendly, diffable, and version-controlled.
  3. Instruct your Agent: Add the following instruction to your project's .cursorrules, CLAUDE.md, or system prompt:
# Coding Agent Instructions
Before exploring or grepping raw source files, ALWAYS consult `okf/index.md` for project architecture.
Look up specific classes, APIs, and data models directly in `okf/` to minimize context overhead.

Learn more about structuring web metadata and structured data in our comprehensive guide to Open Knowledge Format (OKF): The Developer's Guide to Agent-Ready Codebases, or explore our companion tools: