From 07afbe8473b85e97f644700debd162b4cbead4ef Mon Sep 17 00:00:00 2001 From: Lukasz Boryn Date: Mon, 20 Jul 2026 00:41:43 +0200 Subject: [PATCH] feat(write-OKF): conform OKF contract to Google OKF v0.1 spec feat(write-OKF): require type frontmatter on every page; okf_version in index; conformance block + page-type vocabulary in okf-layout.md feat(write-OKF): rename INDEX.md to reserved lowercase index.md across templates and cross-referencing skills feat(blueprint): add type: Blueprint to blueprint-format frontmatter feat(ferry): add type: Ferry Map / Decision to decision-format docs(write-OKF): cite Google OKF v0.1 spec alongside Karpathy and LangChain OpenWiki in the layout contract --- .../model-domain/CONTEXT-FORMAT.md | 4 +- skills/engineering/model-domain/SKILL.md | 4 +- skills/loop/blueprint/SKILL.md | 4 +- skills/loop/blueprint/blueprint-format.md | 3 ++ skills/loop/ferry/decision-format.md | 7 ++++ skills/loop/weave/SKILL.md | 4 +- skills/loop/write-OKF/SKILL.md | 16 ++++---- skills/loop/write-OKF/agents-md-hook.md | 4 +- skills/loop/write-OKF/okf-layout.md | 37 +++++++++++++------ .../write-OKF/templates/ARCHITECTURE.md.tpl | 4 ++ .../loop/write-OKF/templates/LEARNINGS.md.tpl | 4 ++ .../loop/write-OKF/templates/SUMMARY.md.tpl | 4 ++ .../templates/{INDEX.md.tpl => index.md.tpl} | 15 ++++++-- skills/productivity/write-handoff/SKILL.md | 2 +- 14 files changed, 80 insertions(+), 32 deletions(-) rename skills/loop/write-OKF/templates/{INDEX.md.tpl => index.md.tpl} (67%) diff --git a/skills/engineering/model-domain/CONTEXT-FORMAT.md b/skills/engineering/model-domain/CONTEXT-FORMAT.md index 2759495..7315346 100644 --- a/skills/engineering/model-domain/CONTEXT-FORMAT.md +++ b/skills/engineering/model-domain/CONTEXT-FORMAT.md @@ -44,7 +44,7 @@ _Avoid_: Client, buyer, account. **Single context (most repos):** one `OKF/CONTEXT.md`. **Multi-context:** glossaries split into `OKF/context/.md` — -one per bounded context — with a Contexts section in `OKF/INDEX.md` +one per bounded context — with a Contexts section in `OKF/index.md` listing them and how they relate: ```md @@ -64,7 +64,7 @@ listing them and how they relate: ``` Decision rule: -- If `OKF/context/` exists → multi-context. Read INDEX.md to find contexts. +- If `OKF/context/` exists → multi-context. Read index.md to find contexts. - Else if `OKF/CONTEXT.md` exists → single-context. - Else (neither) → create `OKF/CONTEXT.md` lazily when the first term is resolved. Switch to multi-context only on observing ≥ 2 obvious diff --git a/skills/engineering/model-domain/SKILL.md b/skills/engineering/model-domain/SKILL.md index ec24dbb..9a9c0bd 100644 --- a/skills/engineering/model-domain/SKILL.md +++ b/skills/engineering/model-domain/SKILL.md @@ -48,7 +48,7 @@ habit any skill can do; that's not this skill. OKF/ # open-knowledge-format wiki (see write-OKF) ├── CONTEXT.md # single-context default — THE canonical glossary ├── context/ # multi-context mode: one .md per -│ └── .md # bounded context, indexed from OKF/INDEX.md +│ └── .md # bounded context, indexed from OKF/index.md └── adr/ └── 0001-.md ``` @@ -64,7 +64,7 @@ Default is single-context. Switch to **multi-context mode** only on observing **≥ 2 obvious sub-roots** (e.g. `R/ingest/`, `R/analysis/`; `src/ordering/`, `src/billing/`) *and* a second resolved term clearly belonging to one of them — then propose `OKF/context/.md` files -indexed from `OKF/INDEX.md`. **The split axis is the bounded context +indexed from `OKF/index.md`. **The split axis is the bounded context (stable), never the issue (transient)** — issue-local terms live in their `OKF/blueprints/` entry until they recur, then get promoted here. diff --git a/skills/loop/blueprint/SKILL.md b/skills/loop/blueprint/SKILL.md index 8e477f8..e1dcb09 100644 --- a/skills/loop/blueprint/SKILL.md +++ b/skills/loop/blueprint/SKILL.md @@ -35,7 +35,7 @@ blueprint with justification. The interview happened upstream done-gate runs exactly this. 4. **Show the blueprint**; iterate. On explicit user yes → flip status to `locked`. No yes, no lock. -5. **Index it** — add `NNN — — <status>` to `OKF/INDEX.md` +5. **Index it** — add `NNN — <title> — <status>` to `OKF/index.md` Blueprints section. 6. **Seal** via [commit-atomic-jj](../../productivity/commit-atomic-jj/SKILL.md): `docs(blueprint): add NNN <slug>`. @@ -47,7 +47,7 @@ with a new number instead. The "tracker" is `grep -r "^status:" OKF/blueprints/`. ## Output / done criteria -- Blueprint exists, matches blueprint-format.md, indexed in INDEX.md. +- Blueprint exists, matches blueprint-format.md, indexed in index.md. - Justification traces to a real source; Verify is runnable. - Locked only on explicit user approval. diff --git a/skills/loop/blueprint/blueprint-format.md b/skills/loop/blueprint/blueprint-format.md index 8350890..b2181bf 100644 --- a/skills/loop/blueprint/blueprint-format.md +++ b/skills/loop/blueprint/blueprint-format.md @@ -2,6 +2,7 @@ ```markdown --- +type: Blueprint status: draft | locked | implemented | superseded-by-NNN traces-to: ROADMAP.md phase N | ferries/<topic>/D-<n> | user request <date> --- @@ -36,6 +37,8 @@ up in the diff.> ## Rules - Title is imperative — a blueprint names a change, not a state. +- `type: Blueprint` is the OKF-v0.1 conformance field (see + [write-OKF/okf-layout.md](../write-OKF/okf-layout.md)) — always first. - `traces-to` is mandatory; a blueprint that traces to nothing fails [sieve](../../engineering/sieve/SKILL.md)'s Real test by definition. - Locked blueprint's Contract/Verify sections are immutable — supersede, don't diff --git a/skills/loop/ferry/decision-format.md b/skills/loop/ferry/decision-format.md index 597727e..031330a 100644 --- a/skills/loop/ferry/decision-format.md +++ b/skills/loop/ferry/decision-format.md @@ -3,6 +3,10 @@ ## MAP.md — `OKF/ferries/<topic>/MAP.md` ```markdown +--- +type: Ferry Map +--- + # ferry — <topic> Destination: <one sentence — what "the way is clear" means>. @@ -18,6 +22,7 @@ Destination: <one sentence — what "the way is clear" means>. ```markdown --- +type: Decision status: open | resolved | superseded-by-D-<m> blocked-by: [D-1, D-2] # empty list if unblocked --- @@ -42,6 +47,8 @@ Append-only — a changed mind is a new decision superseding this one.> ## Rules - One genuine decision per file; a compound question splits. +- `type:` frontmatter (`Ferry Map` / `Decision`) is the OKF-v0.1 + conformance field — always first. - `blocked-by` edges must be acyclic — check when adding, not when stuck. - Status flips only with a filled Resolution; Resolution never edited after — supersede with a new decision instead. diff --git a/skills/loop/weave/SKILL.md b/skills/loop/weave/SKILL.md index 6aca4a9..636de0d 100644 --- a/skills/loop/weave/SKILL.md +++ b/skills/loop/weave/SKILL.md @@ -18,7 +18,7 @@ superpowers' subagent-driven-development, jj-native. ## Preconditions (check, don't assume) - The blueprint exists and `status: locked` — `draft` → back to blueprint for the user's lock; none named → list locked blueprints, ask which. -- `OKF/INDEX.md` read; the OKF pages the blueprint references read. +- `OKF/index.md` read; the OKF pages the blueprint references read. ## Process 1. **Frame** — restate the blueprint's Contract section in one sentence; list its @@ -40,7 +40,7 @@ superpowers' subagent-driven-development, jj-native. message body cites `blueprint NNN`. Fix + regression test in the same change. 6. **Close the loop** — flip blueprint status to `implemented`; update its - INDEX.md line; tick the roadmap item via + index.md line; tick the roadmap item via [architect](../architect/SKILL.md) revise mode; wiki-worthy learnings → `OKF/LEARNINGS.md` ([write-OKF](../write-OKF/SKILL.md) refresh if pages went stale). diff --git a/skills/loop/write-OKF/SKILL.md b/skills/loop/write-OKF/SKILL.md index 2910281..55c4778 100644 --- a/skills/loop/write-OKF/SKILL.md +++ b/skills/loop/write-OKF/SKILL.md @@ -8,7 +8,8 @@ disable-model-invocation: true The OKF is a Karpathy-LLM-wiki-style knowledge substrate: dense synthesis, not raw dumps; agents read it *before* code; every page inspectable, -versioned, agent-maintained. Layout contract: [okf-layout.md](okf-layout.md). +versioned, agent-maintained. Layout and Google-OKF-v0.1 conformance +contract: [okf-layout.md](okf-layout.md). ## When to use - User says "scribe OKF", "/write-OKF", "set up the knowledge folder", @@ -26,9 +27,10 @@ versioned, agent-maintained. Layout contract: [okf-layout.md](okf-layout.md). ## Scaffold mode 1. **Confirm the first write** — creating `OKF/` in a repo is a new convention; get a yes before writing anything. -2. Materialise the skeleton from [templates/](templates/) — headers and - `TODO(scribe)` markers only. **Never invent facts**: an empty section - with a TODO beats a fabricated architecture claim. +2. Materialise the skeleton from [templates/](templates/) — headers, + `type` frontmatter, and `TODO(scribe)` markers only. **Never invent + facts**: an empty section with a TODO beats a fabricated architecture + claim. 3. Fill only what is *derivable from disk right now*: SUMMARY from an existing README, ARCHITECTURE bones from the directory tree and manifests, ROADMAP/CONTEXT stay TODO until @@ -49,13 +51,13 @@ versioned, agent-maintained. Layout contract: [okf-layout.md](okf-layout.md). [architect/revise.md](../architect/revise.md) discipline. 4. Every ARCHITECTURE.md claim must be **traceable to a file** — cite `path` (or `path:line`) inline. A claim you can't cite doesn't go in. -5. Keep `INDEX.md` complete: every page and every `blueprints/` entry +5. Keep `index.md` complete: every page and every `blueprints/` entry listed, one line each (`NNN — title — status`); every ferry one line (`<topic> — n/m resolved → MAP.md`) — decisions stay in MAP.md only. ## Output / done criteria -- `OKF/` matches [okf-layout.md](okf-layout.md); `INDEX.md` links every - page that exists. +- `OKF/` matches [okf-layout.md](okf-layout.md) including its + conformance block; `index.md` links every page that exists. - `AGENTS.md` carries the hook block. - Scaffold: no fabricated content — unfillable sections carry `TODO(scribe)`. diff --git a/skills/loop/write-OKF/agents-md-hook.md b/skills/loop/write-OKF/agents-md-hook.md index 7f08d06..4db3014 100644 --- a/skills/loop/write-OKF/agents-md-hook.md +++ b/skills/loop/write-OKF/agents-md-hook.md @@ -6,10 +6,10 @@ never overwrite existing prose). `<project>` substituted from SUMMARY.md. ```markdown ## Knowledge — read before you code -This project keeps an agent-first wiki at [`OKF/`](OKF/INDEX.md) +This project keeps an agent-first wiki at [`OKF/`](OKF/index.md) (open-knowledge-format). Before extending or modifying <project>: -1. Read [`OKF/INDEX.md`](OKF/INDEX.md), then the pages it flags for your +1. Read [`OKF/index.md`](OKF/index.md), then the pages it flags for your task — at minimum `SUMMARY.md`; `ARCHITECTURE.md` before structural work. 2. Use the canonical vocabulary from [`OKF/CONTEXT.md`](OKF/CONTEXT.md) diff --git a/skills/loop/write-OKF/okf-layout.md b/skills/loop/write-OKF/okf-layout.md index 1bb3fc4..3b86a45 100644 --- a/skills/loop/write-OKF/okf-layout.md +++ b/skills/loop/write-OKF/okf-layout.md @@ -1,18 +1,21 @@ # OKF layout contract OKF = **open-knowledge-format**: a file-based, agent-first project wiki at -the repo root. Inspired by Karpathy's LLM-wiki pattern (precomputed -synthesis agents read before code) as implemented by LangChain's OpenWiki — -format-compatible in spirit, dependency-free in practice. +the repo root. Conforms to Google's [OKF v0.1 +spec](https://github.com/GoogleCloudPlatform/knowledge-catalog/blob/main/okf/SPEC.md) +(a bundle of markdown concept files with typed frontmatter). Page set and +loop wiring follow Karpathy's LLM-wiki pattern (precomputed synthesis +agents read before code) as implemented by LangChain's OpenWiki — +dependency-free in practice. ``` OKF/ -├── INDEX.md # map of the wiki — the ONE file AGENTS.md points at +├── index.md # map of the wiki — the ONE file AGENTS.md points at ├── SUMMARY.md # what the project is, for an agent landing cold ├── ARCHITECTURE.md # modules, seams, main flows — design-codebase vocab ├── CONTEXT.md # canonical domain glossary (model-domain owns content) ├── context/ # only in multi-context repos: <subroot>.md per -│ # bounded context, indexed from INDEX.md +│ # bounded context, indexed from index.md ├── ROADMAP.md # phased plan — architect owns content ├── adr/ # 0001-<slug>.md — three-of-three rule (model-domain) ├── blueprints/ # NNN-<slug>.md only — flat, grep-able namespace @@ -20,9 +23,21 @@ OKF/ └── LEARNINGS.md # debunked claims, gotchas — append-only, sourced ``` -## Page contracts (one line each in INDEX.md) +## Conformance (OKF v0.1) -- **INDEX.md** — every existing page + blueprint, one line + hook each. No +- Every page except `index.md` opens with YAML frontmatter carrying a + non-empty `type` (extra fields like `status` follow it). +- `index.md` carries **only** `okf_version: "0.1"` in its frontmatter — + the one field the spec permits there. Reserved name, lowercase. +- Page types: `Summary`, `Architecture`, `Glossary` (CONTEXT and + `context/*`), `Roadmap`, `Learnings`, `ADR`, `Blueprint`, `Decision`, + `Ferry Map`. New page kinds coin a new type — types are producer-defined. +- Conformance check: `grep -rL "^type:" OKF/ --include='*.md'` returns + only `index.md`. + +## Page contracts (one line each in index.md) + +- **index.md** — every existing page + blueprint, one line + hook each. No content of its own beyond the map. - **SUMMARY.md** — ≤1 screen: what it is, who for, how run, where to start reading. The cold-start page. @@ -34,11 +49,11 @@ OKF/ - **ROADMAP.md** — architect's skeleton (locked decisions, phases with verify steps, risks, out-of-scope). - **blueprints/** — blueprint output; status lives in frontmatter, so the - "tracker" is `grep -r "^status:" OKF/blueprints/`. INDEX lists one line - per blueprint: `NNN — title — status`. + "tracker" is `grep -r "^status:" OKF/blueprints/`. index.md lists one + line per blueprint: `NNN — title — status`. - **ferries/** — one directory per ferry; MAP.md is the per-ferry index. - INDEX lists one line per ferry: `<topic> — n/m resolved → MAP.md`; - decisions are never listed in INDEX (single source: MAP.md). + index.md lists one line per ferry: `<topic> — n/m resolved → MAP.md`; + decisions are never listed in index.md (single source: MAP.md). - **LEARNINGS.md** — what was believed / what is true / source. Never edited retroactively, only appended or superseded. diff --git a/skills/loop/write-OKF/templates/ARCHITECTURE.md.tpl b/skills/loop/write-OKF/templates/ARCHITECTURE.md.tpl index 41af0ca..25cd1d2 100644 --- a/skills/loop/write-OKF/templates/ARCHITECTURE.md.tpl +++ b/skills/loop/write-OKF/templates/ARCHITECTURE.md.tpl @@ -1,3 +1,7 @@ +--- +type: Architecture +--- + # <project> — architecture <!-- Every claim cites a file path. Vocabulary: module / interface / seam / diff --git a/skills/loop/write-OKF/templates/LEARNINGS.md.tpl b/skills/loop/write-OKF/templates/LEARNINGS.md.tpl index 2ce422f..d2f15a1 100644 --- a/skills/loop/write-OKF/templates/LEARNINGS.md.tpl +++ b/skills/loop/write-OKF/templates/LEARNINGS.md.tpl @@ -1,3 +1,7 @@ +--- +type: Learnings +--- + # <project> — learnings <!-- Append-only. Format per entry: what was believed / what is true / diff --git a/skills/loop/write-OKF/templates/SUMMARY.md.tpl b/skills/loop/write-OKF/templates/SUMMARY.md.tpl index 979bc10..caa16fa 100644 --- a/skills/loop/write-OKF/templates/SUMMARY.md.tpl +++ b/skills/loop/write-OKF/templates/SUMMARY.md.tpl @@ -1,3 +1,7 @@ +--- +type: Summary +--- + # <project> — summary <!-- ≤1 screen. The cold-start page: an agent that reads only this should diff --git a/skills/loop/write-OKF/templates/INDEX.md.tpl b/skills/loop/write-OKF/templates/index.md.tpl similarity index 67% rename from skills/loop/write-OKF/templates/INDEX.md.tpl rename to skills/loop/write-OKF/templates/index.md.tpl index 92e533a..f97406b 100644 --- a/skills/loop/write-OKF/templates/INDEX.md.tpl +++ b/skills/loop/write-OKF/templates/index.md.tpl @@ -1,3 +1,7 @@ +--- +okf_version: "0.1" +--- + # <project> — OKF index Open-knowledge-format wiki. Agents: read this page first, then the pages @@ -15,7 +19,12 @@ your task needs. Humans welcome too. - `adr/` — TODO(scribe): list ADRs here as they land. -## Specs +## Blueprints -- `specs/` — TODO(scribe): list specs here as blueprint writes them - (`NNN — title — status`). +- `blueprints/` — TODO(scribe): list blueprints here as blueprint writes + them (`NNN — title — status`). + +## Ferries + +- `ferries/` — TODO(scribe): one line per ferry + (`<topic> — n/m resolved → MAP.md`). diff --git a/skills/productivity/write-handoff/SKILL.md b/skills/productivity/write-handoff/SKILL.md index d9c805f..0025941 100644 --- a/skills/productivity/write-handoff/SKILL.md +++ b/skills/productivity/write-handoff/SKILL.md @@ -31,7 +31,7 @@ subagent spawn (the handoff-gate brief — will focus on and tailor the doc. ## Process -1. Skim the task list, recent edits, `OKF/INDEX.md`, any active ferry. +1. Skim the task list, recent edits, `OKF/index.md`, any active ferry. 2. Write the doc (template below). File exit: `./HANDOFF.md` unless the user names a path or asks for the temp dir. Subagent exit: same sections as the spawn prompt, plus the gate's verify command.