OKF Builder Reference / Open Knowledge Format v0.2, explained for builders OKF v0.2
OKF OpenKnowledgeFormat

Content updated

Examples

Open Knowledge Format examples

Copy small OKF v0.2 bundles with root indexes, logs, typed concepts, provenance, trust, lifecycle, links, and keyed source footnotes.

Start with the minimal OKF example below. Save each code block at its displayed path, then upload the folder to the validator. The result is a readable knowledge bundle, not a running application. Source names and business rules in these examples are illustrative.

Minimal OKF example

A bundle root with an optional versioned index, one concept file, and a chronological update log.

File tree

okf/
|-- index.md
|-- log.md
`-- metrics/monthly-recurring-revenue.md

index.md

markdown

---
okf_version: "0.2"
---

# Metrics

* [Monthly Recurring Revenue](metrics/monthly-recurring-revenue.md) - Recurring subscription revenue normalized to a monthly period.

# Tables

* [Subscriptions](tables/subscriptions.md) - Source table for active subscription revenue.

# Playbooks

* [Revenue Review](playbooks/revenue-review.md) - Weekly review process for subscription revenue changes.

metrics/monthly-recurring-revenue.md

markdown

---
type: Metric
title: Monthly Recurring Revenue
description: Recurring subscription revenue normalized to a monthly period.
resource: dashboard://revenue/mrr
tags: [revenue, saas, finance]
generated: { by: human:revenue-owner, at: 2026-06-13T00:00:00Z }
sources:
  - id: revenue-dashboard
    resource: dashboard://revenue/mrr
    title: Revenue dashboard
---

# Calculation

MRR is the predictable recurring revenue generated by active subscriptions in the [subscriptions table](../tables/subscriptions.md).[^revenue-dashboard]

Include active subscriptions with recurring billing. Exclude one-time setup fees, refunds, and usage-only charges unless normalized into a recurring plan.

# Examples

```sql
select sum(monthly_amount_usd) as mrr
from analytics.subscriptions
where status = 'active';
```

[^revenue-dashboard]: Revenue dashboard

log.md

markdown

# Directory Update Log

## 2026-06-13
* **Creation**: Added the [MRR metric](metrics/monthly-recurring-revenue.md).
* **Update**: Linked MRR to the [subscriptions table](tables/subscriptions.md).

SaaS metrics bundle

Capture metrics, source tables, dashboards, and review playbooks as linked concepts.

File tree

okf/
|-- index.md
|-- log.md
|-- metrics/monthly-recurring-revenue.md
|-- tables/subscriptions.md
`-- playbooks/revenue-review.md

metrics/monthly-recurring-revenue.md

markdown

---
type: Metric
title: Monthly Recurring Revenue
description: Recurring subscription revenue normalized to a monthly period.
resource: dashboard://revenue/mrr
tags: [revenue, saas, finance]
generated: { by: human:revenue-owner, at: 2026-06-13T00:00:00Z }
sources:
  - id: revenue-dashboard
    resource: dashboard://revenue/mrr
    title: Revenue dashboard
---

# Calculation

MRR is the predictable recurring revenue generated by active subscriptions in the [subscriptions table](../tables/subscriptions.md).[^revenue-dashboard]

Include active subscriptions with recurring billing. Exclude one-time setup fees, refunds, and usage-only charges unless normalized into a recurring plan.

# Examples

```sql
select sum(monthly_amount_usd) as mrr
from analytics.subscriptions
where status = 'active';
```

[^revenue-dashboard]: Revenue dashboard

tables/subscriptions.md

markdown

---
type: Warehouse Table
title: Subscriptions
description: One row per customer subscription and billing state.
resource: warehouse://analytics.subscriptions
tags: [warehouse, subscriptions, revenue]
generated: { by: warehouse-export/1.0, at: 2026-06-13T00:00:00Z }
---

# Schema

| Column | Type | Description |
|--------|------|-------------|
| `subscription_id` | string | Unique subscription identifier. |
| `customer_id` | string | Customer that owns the subscription. |
| `status` | string | Current billing state. |
| `monthly_amount_usd` | decimal | Normalized monthly recurring amount. |

# Related concepts

Feeds the [Monthly Recurring Revenue](../metrics/monthly-recurring-revenue.md) metric and the [Revenue Review](../playbooks/revenue-review.md) playbook.

API documentation bundle

Describe endpoints, schemas, errors, authentication, and business rules without replacing OpenAPI.

File tree

okf/
|-- index.md
|-- endpoints/create-customer.md
|-- schemas/customer.md
`-- errors/rate-limit.md

endpoints/create-customer.md

markdown

---
type: API Endpoint
title: Create Customer
description: Creates a new customer record.
resource: https://api.example.com/customers
method: POST
path: /api/customers
tags: [api, customers]
generated: { by: openapi-export/1.0, at: 2026-06-13T00:00:00Z }
---

# Request

Accepts a customer payload shaped by the [Customer schema](../schemas/customer.md).

# Response

Returns the created customer object or a [rate limit error](../errors/rate-limit.md).

# Examples

```http
POST /api/customers
Content-Type: application/json
```

Laravel app bundle

Make routes, models, policies, jobs, and operational context easier for humans and agents to inspect.

File tree

okf/
|-- index.md
|-- models/user.md
|-- routes/api-users.md
`-- policies/user-policy.md

models/user.md

markdown

---
type: Laravel Model
title: User Model
description: Authenticated account model for customers and internal operators.
resource: repo://app/Models/User.php
tags: [laravel, model, authentication]
generated: { by: codebase-export/1.0, at: 2026-06-13T00:00:00Z }
sources:
  - id: user-model-source
    resource: repo://app/Models/User.php
    title: User model source file
---

# Responsibilities

The User model represents an authenticated account and owns customer-facing resources.[^user-model-source]

# Related concepts

Used by the [API users route](../routes/api-users.md) and protected by the [user policy](../policies/user-policy.md).

[^user-model-source]: User model source file

WordPress site bundle

Package custom post types, taxonomies, fields, and theme templates as portable Markdown knowledge.

File tree

okf/
|-- index.md
|-- post-types/product.md
|-- acf/product-fields.md
`-- templates/single-product.md

post-types/product.md

markdown

---
type: WordPress Post Type
title: Product
description: Custom post type used to manage product content.
resource: wp-admin/edit.php?post_type=product
tags: [wordpress, post-type, content]
generated: { by: wordpress-export/1.0, at: 2026-06-13T00:00:00Z }
---

# Purpose

The Product post type stores product landing pages and related metadata.

# Related concepts

Rendered by the [single product template](../templates/single-product.md) and enriched by [product fields](../acf/product-fields.md).

Data warehouse bundle

Document datasets, tables, metrics, lineage, dashboards, and data quality notes near the systems they describe.

File tree

okf/
|-- index.md
|-- datasets/sales.md
|-- tables/orders.md
|-- tables/customers.md
`-- metrics/gross-revenue.md

tables/orders.md

markdown

---
type: BigQuery Table
title: Orders
description: One row per completed customer order.
resource: https://console.cloud.google.com/bigquery?p=acme&d=sales&t=orders
tags: [sales, orders, revenue]
generated: { by: data-catalog-export/1.0, at: 2026-06-13T00:00:00Z }
sources:
  - id: orders-table
    resource: https://console.cloud.google.com/bigquery?p=acme&d=sales&t=orders
    title: Orders BigQuery table
---

# Schema

| Column | Type | Description |
|--------|------|-------------|
| `order_id` | STRING | Unique order identifier. |
| `customer_id` | STRING | Foreign key to [customers](customers.md). |
| `total_usd` | NUMERIC | Order total in US dollars.[^orders-table] |

[^orders-table]: Orders BigQuery table

Company knowledge bundle

Represent policies, teams, systems, playbooks, and decisions as linked Markdown concepts.

File tree

okf/
|-- index.md
|-- teams/support.md
|-- policies/refunds.md
|-- systems/billing.md
`-- playbooks/incident-response.md

policies/refunds.md

markdown

---
type: Policy
title: Refund Policy
description: Rules support and billing teams use when evaluating customer refund requests.
resource: docs://policies/refunds
tags: [support, billing, policy]
generated: { by: human:support-policy-owner, at: 2026-06-13T00:00:00Z }
sources:
  - id: refund-policy-source
    resource: docs://policies/refunds
    title: Refund policy source
---

# Purpose

The refund policy defines when support can approve a refund, when billing review is required, and which cases must be escalated.[^refund-policy-source]

# Decision points

* Check whether the customer has an active subscription in the [billing system](../systems/billing.md).
* Escalate disputes, chargebacks, and unclear billing events through the [incident response playbook](../playbooks/incident-response.md).

[^refund-policy-source]: Refund policy source

AI agent context bundle

Give agents durable context about systems, tools, playbooks, metrics, and operating constraints before they act.

File tree

okf/
|-- index.md
|-- systems/billing.md
|-- tools/stripe.md
|-- playbooks/support-triage.md
`-- constraints/agent-safety-rules.md

constraints/agent-safety-rules.md

markdown

---
type: Constraint
title: Agent Safety Rules
description: Operating boundaries an AI agent must follow before using tools or changing customer-facing systems.
resource: docs://agent-context/safety-rules
tags: [agent, safety, tools]
generated: { by: human:agent-platform-owner, at: 2026-06-13T00:00:00Z }
---

# Rules

The agent must read relevant system, tool, metric, and playbook concepts before taking action.

Do not change billing data, refund customers, send external messages, or modify production settings unless a human explicitly approves the specific action.

# Related concepts

Read the [billing system](../systems/billing.md), [Stripe tool](../tools/stripe.md), and [support triage playbook](../playbooks/support-triage.md) before using operational tools.
Mathias Onea

Mathias Onea

Senior Engineer, Product Builder, and Founder

Systems, product software, and practical execution for teams that need clear decisions, durable implementation, and agent-ready knowledge structures.

Focus
Knowledge systems, Laravel platforms, automation, and technical SEO infrastructure.
Related work
Founder-led software work through Craftwell and independent open-source projects.
Profile
mathiasonea.com