Authoring OKF concepts
OKF is how librocat stores knowledge: Markdown files with YAML frontmatter, kept
in the user's Git repo (Local) or the hosted workspace (Cloud — export gives the
same files back). The index is derived and rebuildable. Write for two
readers at once — a human skimming, and an agent retrieving.
The shape of a concept
Every concept needs a non-empty type. Everything else is optional but strongly
recommended:
---
type: Decision
title: Use Orama for local search
description: One sentence a reader can act on without opening the body.
tags: [search, local, index]
status: stable # draft | stable | deprecated (default: stable)
---
# Context
Why this exists. Keep the first paragraph self-contained.
# Decision
The claim, stated plainly.
# Consequences
What follows. Link related concepts: see [the index layer](/architecture/index.md).
Rules that make retrieval work
- One library, many shelves. Put a project's concepts under one leading
directory, its shelf (
acme/…). Read your project's shelf first
(search/list with shelf: "acme") and the whole library second. Never
make a separate library for a project; make a shelf. Separate libraries
only when access must differ.
- One concept, one idea. If a file needs "and" in its title, split it.
- Write the
description as a standalone sentence. It is what search and
list show first, and what an index page quotes. No "This concept covers…".
- Front-load the body. Put the answer in the first paragraph; details below.
This is progressive disclosure — a reader stops as soon as they have enough.
- Link with Markdown, to
.md targets. /path/from/bundle.md is
bundle-relative; ./sibling.md is relative. librocat turns these into graph
edges, so neighbors and graph only see links you actually write.
- Pick a stable
type and reuse it. Common types: Note, Decision,
Runbook, Reference, Concept, Code File. Types are free-form; be
consistent so list --type and search --type stay useful.
Treat tags the same way — as a controlled vocabulary. Before coining a
new type or tag, run status (reuse by_type/by_tag) and thesaurus
(reuse a preferred tag, or add the synonym as use_for on it instead of a
new tag — writes map synonyms onto the preferred tag); auth, authn, and
authentication as three tags splinter retrieval into thirds.
- Choose the id from the path. The concept id is the file path without
.md (for example decisions/use-orama). Group with directories.
Workflow with the MCP
- Create: call
ingest with type, title, description, body, tags,
and status (draft while you are still writing; stable is the default).
Writing several at once: pass concepts: [...] and get one result per item.
- Refine: call
update with only the fields that change — including
status: "stable" when a draft is done, or "deprecated" when it no
longer holds (set superseded_by when a successor exists, so readers are
sent to it).
- Verify: call
search for the new title, then neighbors to confirm links
resolved. Run status and check broken_links is 0.
Good vs weak
- Weak title: "Auth". Good: "Sessions expire after 30 days".
- Weak description: "Notes about the parser". Good: "The parser reads frontmatter
in one pass and never rejects unknown keys."
- Weak body: a wall of text. Good: answer first, then
# Details, then links.
1---2name: okf-authoring3description: Write and structure high-quality Open Knowledge Format (OKF) concepts for a librocat library. Use when creating or editing knowledge with the librocat MCP (ingest/update): choosing a concept type, writing a one-sentence summary, adding cross-links, and applying progressive disclosure. Trigger when the user asks to capture a decision, note, runbook, or code understanding into librocat.4---56# Authoring OKF concepts78OKF is how librocat stores knowledge: Markdown files with YAML frontmatter, kept9in the user's Git repo (Local) or the hosted workspace (Cloud — export gives the10same files back). The index is derived and rebuildable. Write for two11readers at once — a human skimming, and an agent retrieving.1213## The shape of a concept1415Every concept needs a non-empty `type`. Everything else is optional but strongly16recommended:1718```markdown19---20type: Decision21title: Use Orama for local search22description: One sentence a reader can act on without opening the body.23tags: [search, local, index]24status: stable # draft | stable | deprecated (default: stable)25---2627# Context28Why this exists. Keep the first paragraph self-contained.2930# Decision31The claim, stated plainly.3233# Consequences34What follows. Link related concepts: see [the index layer](/architecture/index.md).35```3637## Rules that make retrieval work38391. **One library, many shelves.** Put a project's concepts under one leading40 directory, its shelf (`acme/…`). Read your project's shelf first41 (`search`/`list` with `shelf: "acme"`) and the whole library second. Never42 make a separate library for a project; make a shelf. Separate libraries43 only when access must differ.442. **One concept, one idea.** If a file needs "and" in its title, split it.453. **Write the `description` as a standalone sentence.** It is what `search` and46 `list` show first, and what an index page quotes. No "This concept covers…".474. **Front-load the body.** Put the answer in the first paragraph; details below.48 This is progressive disclosure — a reader stops as soon as they have enough.495. **Link with Markdown, to `.md` targets.** `/path/from/bundle.md` is50 bundle-relative; `./sibling.md` is relative. librocat turns these into graph51 edges, so `neighbors` and `graph` only see links you actually write.526. **Pick a stable `type` and reuse it.** Common types: `Note`, `Decision`,53 `Runbook`, `Reference`, `Concept`, `Code File`. Types are free-form; be54 consistent so `list --type` and `search --type` stay useful.55 **Treat tags the same way — as a controlled vocabulary.** Before coining a56 new type or tag, run `status` (reuse `by_type`/`by_tag`) and `thesaurus`57 (reuse a preferred tag, or add the synonym as `use_for` on it instead of a58 new tag — writes map synonyms onto the preferred tag); `auth`, `authn`, and59 `authentication` as three tags splinter retrieval into thirds.607. **Choose the id from the path.** The concept id is the file path without61 `.md` (for example `decisions/use-orama`). Group with directories.6263## Workflow with the MCP6465- Create: call `ingest` with `type`, `title`, `description`, `body`, `tags`,66 and `status` (`draft` while you are still writing; `stable` is the default).67 Writing several at once: pass `concepts: [...]` and get one result per item.68- Refine: call `update` with only the fields that change — including69 `status: "stable"` when a draft is done, or `"deprecated"` when it no70 longer holds (set `superseded_by` when a successor exists, so readers are71 sent to it).72- Verify: call `search` for the new title, then `neighbors` to confirm links73 resolved. Run `status` and check `broken_links` is 0.7475## Good vs weak7677- Weak title: "Auth". Good: "Sessions expire after 30 days".78- Weak description: "Notes about the parser". Good: "The parser reads frontmatter79 in one pass and never rejects unknown keys."80- Weak body: a wall of text. Good: answer first, then `# Details`, then links.