docs(skills): point the skills at the why-register and gate on okf-check

- docs(model-domain): rename ADR-FORMAT.md to DECISION-FORMAT.md — the
  register file format, gated by the warrant test rather than three-of-three
- docs(write-OKF): document decisions/, the warrant contract, and okf-check
  in the layout; require its pasted output in the done-criteria
- docs(skills): retarget OKF/adr references in architect, moor, grill-with-docs,
  write-handoff, the index template, and README

implements blueprint 002
This commit is contained in:
Łukasz Boryń 2026-07-21 02:41:58 +02:00
parent 4dd65c22be
commit 6791bc045d
11 changed files with 143 additions and 112 deletions

View File

@ -109,8 +109,8 @@ All loop skills are user-invoked (`disable-model-invocation: true`).
- **grill-with-docs** — user-invoked router that runs `grill-me` using - **grill-with-docs** — user-invoked router that runs `grill-me` using
`model-domain` on an existing codebase. `model-domain` on an existing codebase.
- **model-domain** — actively build / sharpen a project's domain - **model-domain** — actively build / sharpen a project's domain
model — challenge terms, update `CONTEXT.md` inline, offer ADRs only model — challenge terms, update `CONTEXT.md` inline, offer decision
on the three-of-three rule. files only on the warrant test.
- **design-codebase** — shared vocabulary for designing deep modules - **design-codebase** — shared vocabulary for designing deep modules
(module, interface, seam, adapter, depth, leverage, locality); (module, interface, seam, adapter, depth, leverage, locality);
`DEEPENING.md` for dependency-aware seam strategy, `DESIGN-IT-TWICE.md` `DEEPENING.md` for dependency-aware seam strategy, `DESIGN-IT-TWICE.md`
@ -183,9 +183,9 @@ script — read the relevant SKILL.md as you enter each step.
### Architecture & vocabulary ### Architecture & vocabulary
- **Design conversation** — `/design-codebase` (solution-structure vocab: - **Design conversation** — `/design-codebase` (solution-structure vocab:
module / interface / seam / adapter / depth) + `/model-domain` module / interface / seam / adapter / depth) + `/model-domain`
(problem-domain vocab: `CONTEXT.md`, ADRs on the three-of-three rule). (problem-domain vocab: `CONTEXT.md`, decisions on the warrant test).
- **Stress-test a plan against the codebase** — `/grill-with-docs` - **Stress-test a plan against the codebase** — `/grill-with-docs`
(Socratic interview against `OKF/CONTEXT.md` and `OKF/adr/`). (Socratic interview against `OKF/CONTEXT.md` and `OKF/decisions/`).
### Meta ### Meta
- **Author a new skill in this repo** — `/conjure-a-skill` → `/commit-atomic-jj`. - **Author a new skill in this repo** — `/conjure-a-skill` → `/commit-atomic-jj`.

View File

@ -8,8 +8,8 @@ disable-model-invocation: true
User-invoked router. Run [grill-me](../../productivity/grill-me/SKILL.md) User-invoked router. Run [grill-me](../../productivity/grill-me/SKILL.md)
(the Socratic interview) **using** [model-domain](../model-domain/SKILL.md) (the Socratic interview) **using** [model-domain](../model-domain/SKILL.md)
(the active glossary / ADR discipline) — interview the user about the (the active glossary / decision discipline) — interview the user about the
plan, and update `OKF/CONTEXT.md` and `OKF/adr/` as terms and decisions plan, and update `OKF/CONTEXT.md` and `OKF/decisions/` as terms and decisions
crystallise. crystallise.
Skip when no codebase exists yet — use [grill-me](../../productivity/grill-me/SKILL.md) Skip when no codebase exists yet — use [grill-me](../../productivity/grill-me/SKILL.md)

View File

@ -1,79 +0,0 @@
# ADR format
ADRs live in `OKF/adr/` with sequential numbering: `0001-<slug>.md`,
`0002-<slug>.md`, etc. Create `OKF/adr/` lazily — only when the first
ADR is needed.
## Template
```md
# {Short title of the decision}
{1–3 sentences: context, what was decided, and why.}
```
That's it. An ADR can be a single paragraph. The value is recording
*that* a decision was made and *why* — not in filling out sections.
## Optional sections
Add only when they add genuine value. Most ADRs won't need them.
- **Status** frontmatter (`proposed | accepted | deprecated | superseded
by ADR-NNNN`) — when decisions are revisited.
- **Considered Options** — when rejected alternatives are worth
remembering.
- **Consequences** — when non-obvious downstream effects need calling
out.
## Numbering
Scan `OKF/adr/` for the highest existing number and increment by one.
## When to offer an ADR — three-of-three test
All three must hold. If any one is missing, skip the ADR.
1. **Hard to reverse.** The cost of changing your mind later is
meaningful.
2. **Surprising without context.** A future reader will look at the code
and wonder *"why on earth did they do it this way?"*
3. **The result of a real trade-off.** There were genuine alternatives
and you picked one for specific reasons.
### What qualifies
- **Architectural shape.** "Monorepo." "Write model is event-sourced,
read model is projected into Postgres." "Bookdown chapters are knit
per-chapter to bound render time."
- **Integration patterns between contexts.** "Ordering and Billing
communicate via domain events, not synchronous HTTP."
- **Technology choices that carry lock-in.** Database, message bus, auth
provider, deployment target, pipeline framework (`targets` vs
`drake`). Not every library — only the ones that would take a quarter
to swap.
- **Boundary and scope decisions.** "Customer data is owned by the
Customer context; others reference by ID only." The *no*-s are as
valuable as the *yes*-s.
- **Deliberate deviations from the obvious path.** "Manual SQL instead
of an ORM because X." "`data.table` instead of `dplyr` in `R/inf/`
because of memory." Stops the next engineer from "fixing" something
deliberate.
- **Constraints not visible in the code.** "Can't use cloud X because of
compliance." "Response times must be < 200 ms because of partner
contract."
- **Rejected alternatives when the rejection is non-obvious.** If you
considered GraphQL and picked REST for subtle reasons, record it —
otherwise someone will suggest GraphQL again in six months.
### What does NOT qualify
- Easy to reverse: a function rename, a config tweak. You'll just
reverse it.
- Not surprising: the obvious choice nobody would question.
- No real alternative: there was nothing to weigh.
---
_Format adapted from
<https://github.com/mattpocock/skills/blob/main/skills/engineering/model-domain/ADR-FORMAT.md>._

View File

@ -0,0 +1,90 @@
# Decision format
Settled decisions live in the why-register: `OKF/decisions/NNN-<slug>.md`,
zero-padded to three digits, indexed by `OKF/decisions/index.md`. Numbers
are permanent — they are cited from `CONTEXT.md` and commit messages, so
superseding adds a file, never renumbers one. Create `OKF/decisions/`
lazily — only when the first decision is settled.
## Template
```md
---
type: Decision
purpose: {why this page exists, one line}
answers:
- "{the question this decision settles}"
cites:
- {path the decision binds}
status: live
reversible: {how to undo it, or the cost of undoing it}
---
# {NNN} — {short title of the decision}
{1–3 sentences: context, what was decided, and why.}
```
The body can be a single paragraph. The value is recording *that* a
decision was made and *why* — not in filling out sections. Add
**Considered options** or **Consequences** only when rejected
alternatives or non-obvious downstream effects are worth remembering.
`status:` is `live` or `superseded-by-NNN`. Superseding never edits the
old file's body.
## Index lines
`index.md` carries one **question-shaped** line per decision:
```
- [NNN](NNN-<slug>.md) — {question it settles} — {verdict} — {status}
```
The question is *derived* from the file's first `answers:` entry, never
written twice; `okf-check` errors when a line and its source disagree.
Question-shaped is a requirement, not a style note — it is what makes the
index answer a query instead of listing titles.
## When to open a decision file — the warrant test
The warrant is the gate. Open a file when the decision **answers a
question no other page already answers**, and you can name the `cites:`
it binds. No question, or a question the glossary or architecture page
already owns → no file. Default is *no*.
### What typically warrants one
- **Architectural shape.** "Monorepo." "Write model is event-sourced,
read model is projected into Postgres." "Bookdown chapters are knit
per-chapter to bound render time."
- **Integration patterns between contexts.** "Ordering and Billing
communicate via domain events, not synchronous HTTP."
- **Technology choices that carry lock-in.** Database, message bus, auth
provider, deployment target, pipeline framework (`targets` vs
`drake`). Not every library — only the ones that would take a quarter
to swap.
- **Boundary and scope decisions.** "Customer data is owned by the
Customer context; others reference by ID only." The *no*-s are as
valuable as the *yes*-s.
- **Deliberate deviations from the obvious path.** "Manual SQL instead
of an ORM because X." "`data.table` instead of `dplyr` in `R/inf/`
because of memory." Stops the next engineer from "fixing" something
deliberate.
- **Constraints not visible in the code.** "Can't use cloud X because of
compliance." "Response times must be < 200 ms because of partner
contract."
- **Rejected alternatives when the rejection is non-obvious.** If you
considered GraphQL and picked REST for subtle reasons, record it —
otherwise someone will suggest GraphQL again in six months.
### What does not
- Easy to reverse and unsurprising: a function rename, a config tweak.
- A question another page already answers — the warrant is duplicate, so
the page is inadmissible.
---
_Format adapted from
<https://github.com/mattpocock/skills/blob/main/skills/engineering/model-domain/ADR-FORMAT.md>._

View File

@ -1,6 +1,6 @@
--- ---
name: model-domain name: model-domain
description: Actively build and sharpen a project's domain model — challenge fuzzy terms, propose canonical names, update CONTEXT.md inline as terms resolve, and offer ADRs only on the three-of-three rule. Use when the user says "domain model", "/model-domain", "pin down vocabulary", "canonical name for X", "is my language right", "what should this term be", "record this as an ADR", or another skill needs to maintain the domain model. description: Actively build and sharpen a project's domain model — challenge fuzzy terms, propose canonical names, update CONTEXT.md inline as terms resolve, and offer decision files only on the warrant test. Use when the user says "domain model", "/model-domain", "pin down vocabulary", "canonical name for X", "is my language right", "what should this term be", "record this as an ADR", or another skill needs to maintain the domain model.
--- ---
# model-domain # model-domain
@ -8,7 +8,7 @@ description: Actively build and sharpen a project's domain model — challenge f
## When to use ## When to use
- User says "domain model", "/model-domain", "pin down vocabulary", - User says "domain model", "/model-domain", "pin down vocabulary",
"canonical name", "is my language right", "what should this term be", "canonical name", "is my language right", "what should this term be",
"record an ADR". "record an ADR" (they land in the why-register).
- A non-trivial design conversation is *changing* the model — proposing - A non-trivial design conversation is *changing* the model — proposing
new terms, retiring old ones, recording a hard-to-reverse decision. new terms, retiring old ones, recording a hard-to-reverse decision.
- A sibling skill (`diagnose` hypothesis names, `bdd` Given/When/Then - A sibling skill (`diagnose` hypothesis names, `bdd` Given/When/Then
@ -39,8 +39,8 @@ habit any skill can do; that's not this skill.
that contradicts the parquet write you just described."* that contradicts the parquet write you just described."*
6. **Update `CONTEXT.md` inline.** One term resolved → one edit. Never 6. **Update `CONTEXT.md` inline.** One term resolved → one edit. Never
batched. Format: see [CONTEXT-FORMAT.md](CONTEXT-FORMAT.md). batched. Format: see [CONTEXT-FORMAT.md](CONTEXT-FORMAT.md).
7. **Offer ADRs sparingly** (three-of-three rule, see 7. **Offer decision files sparingly** (the warrant test, see
[ADR-FORMAT.md](ADR-FORMAT.md)). Default is *no*. [DECISION-FORMAT.md](DECISION-FORMAT.md)). Default is *no*.
## File layout the skill expects ## File layout the skill expects
@ -49,16 +49,18 @@ OKF/ # open-knowledge-format wiki (see write-OKF)
├── CONTEXT.md # single-context default — THE canonical glossary ├── CONTEXT.md # single-context default — THE canonical glossary
├── context/ # multi-context mode: one <subroot>.md per ├── context/ # multi-context mode: one <subroot>.md per
│ └── <subroot>.md # bounded context, indexed from OKF/index.md │ └── <subroot>.md # bounded context, indexed from OKF/index.md
└── adr/ └── decisions/ # the why-register
└── 0001-<slug>.md ├── index.md # question-shaped, one line per decision
└── NNN-<slug>.md
``` ```
Create files **lazily** — only when there's a real first thing to write. Create files **lazily** — only when there's a real first thing to write.
No `OKF/CONTEXT.md` yet? Create it when the first term is resolved (run No `OKF/CONTEXT.md` yet? Create it when the first term is resolved (run
[write-OKF](../../loop/write-OKF/SKILL.md) scaffold if `OKF/` itself is [write-OKF](../../loop/write-OKF/SKILL.md) scaffold if `OKF/` itself is
missing). No `OKF/adr/`? Create it when the first ADR is needed. Confirm missing). No `OKF/decisions/`? Create it when the first decision is
the *first* write to any new file in the repo before proceeding. A legacy settled. Confirm the *first* write to any new file in the repo before
root `CONTEXT.md` or `docs/adr/` → offer to migrate into `OKF/`. proceeding. A legacy root `CONTEXT.md` or `docs/adr/` → offer to migrate
into `OKF/` (`docs/adr/` entries become register files).
Default is single-context. Switch to **multi-context mode** only on Default is single-context. Switch to **multi-context mode** only on
observing **≥ 2 obvious sub-roots** (e.g. `R/ingest/`, `R/analysis/`; observing **≥ 2 obvious sub-roots** (e.g. `R/ingest/`, `R/analysis/`;
@ -79,10 +81,10 @@ indexed from `OKF/index.md`. **The split axis is the bounded context
utility patterns, language idioms). Only domain-specific terms. utility patterns, language idioms). Only domain-specific terms.
- **Never** write implementation details into `CONTEXT.md`. It's a - **Never** write implementation details into `CONTEXT.md`. It's a
glossary, not a blueprint. glossary, not a blueprint.
- **Never** open an ADR unless all three of {hard to reverse, surprising - **Never** open a decision file whose question another page already
without context, real trade-off} are true. When in doubt, don't. answers — a duplicate warrant is inadmissible. When in doubt, don't.
- **Never** create an `OKF/CONTEXT.md` / `OKF/adr/` in the repo without - **Never** create an `OKF/CONTEXT.md` / `OKF/decisions/` in the repo
confirming the first such write. without confirming the first such write.
- **Never** create a per-issue glossary — one canonical glossary per - **Never** create a per-issue glossary — one canonical glossary per
bounded context, full stop. bounded context, full stop.

View File

@ -43,8 +43,10 @@ fill the missing sections as deltas, don't restart.
- **Vocabulary sync**: one resolved term → one inline `OKF/CONTEXT.md` - **Vocabulary sync**: one resolved term → one inline `OKF/CONTEXT.md`
edit, per [model-domain](../../engineering/model-domain/SKILL.md). edit, per [model-domain](../../engineering/model-domain/SKILL.md).
Roadmap and glossary must use identical canonical terms. Roadmap and glossary must use identical canonical terms.
- **ADRs** only by the three-of-three rule (hard to reverse ∧ surprising - **Decision files** only by the warrant test — the decision answers a
∧ real trade-off). Default no. question no other page answers, and you can name the `cites:` it binds
([DECISION-FORMAT.md](../../engineering/model-domain/DECISION-FORMAT.md)).
Default no.
- Roadmap phases feed [blueprint](../blueprint/SKILL.md) — write phases - Roadmap phases feed [blueprint](../blueprint/SKILL.md) — write phases
concrete enough that a blueprint can trace to them. concrete enough that a blueprint can trace to them.

View File

@ -58,9 +58,9 @@ the wiki so the next cold-start agent reads reality, not history.
are the why-record. Supersede, don't delete. are the why-record. Supersede, don't delete.
- **OKF files only** — moor never touches source code, configs, or - **OKF files only** — moor never touches source code, configs, or
skills. skills.
- **Never auto-promote to ADR** — an architecturally load-bearing - **Never auto-promote a decision** — an architecturally load-bearing
decision is only *flagged* as a candidate; model-domain's decision is only *flagged* as a candidate; model-domain's warrant test
three-of-three rule gates `OKF/adr/`. gates `OKF/decisions/`.
- **Never moor a ferry with open decisions** — that's resolving by - **Never moor a ferry with open decisions** — that's resolving by
neglect. Go back to the ferry skill. neglect. Go back to the ferry skill.

View File

@ -40,7 +40,7 @@ contract: [okf-layout.md](okf-layout.md).
append if it exists — never overwrite prose). append if it exists — never overwrite prose).
5. Migrate legacy artifacts *with consent*: root `CONTEXT.md` → 5. Migrate legacy artifacts *with consent*: root `CONTEXT.md` →
`OKF/CONTEXT.md`, `docs/Roadmap.md` → `OKF/ROADMAP.md`, `OKF/CONTEXT.md`, `docs/Roadmap.md` → `OKF/ROADMAP.md`,
`docs/adr/` → `OKF/adr/`. Offer, show the move, wait for yes. `docs/adr/` → `OKF/decisions/`. Offer, show the move, wait for yes.
## Refresh mode ## Refresh mode
1. **Diff wiki against reality**: code and manifests on disk, `jj log` 1. **Diff wiki against reality**: code and manifests on disk, `jj log`
@ -56,6 +56,9 @@ contract: [okf-layout.md](okf-layout.md).
(`<topic> — n/m resolved → MAP.md`) — decisions stay in MAP.md only. (`<topic> — n/m resolved → MAP.md`) — decisions stay in MAP.md only.
## Output / done criteria ## Output / done criteria
- **`scripts/okf-check <okf-dir>` run and its output pasted**, exiting 0.
Invoke it by this skill's own base directory — `skills/loop/...`
resolves only inside octobot. A claim of conformance is not a gate.
- `OKF/` matches [okf-layout.md](okf-layout.md) including its - `OKF/` matches [okf-layout.md](okf-layout.md) including its
conformance block; `index.md` links every page that exists. conformance block; `index.md` links every page that exists.
- `AGENTS.md` carries the hook block. - `AGENTS.md` carries the hook block.

View File

@ -17,7 +17,7 @@ OKF/
├── context/ # only in multi-context repos: <subroot>.md per ├── 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 ├── ROADMAP.md # phased plan — architect owns content
├── adr/ # 0001-<slug>.md — three-of-three rule (model-domain) ├── decisions/ # the why-register — index.md + NNN-<slug>.md
├── blueprints/ # NNN-<slug>.md only — flat, grep-able namespace ├── blueprints/ # NNN-<slug>.md only — flat, grep-able namespace
├── ferries/ # <topic>/ — MAP.md + D-<n>-<slug>.md decision files ├── ferries/ # <topic>/ — MAP.md + D-<n>-<slug>.md decision files
└── LEARNINGS.md # debunked claims, gotchas — append-only, sourced └── LEARNINGS.md # debunked claims, gotchas — append-only, sourced
@ -30,10 +30,16 @@ OKF/
- `index.md` carries **only** `okf_version: "0.1"` in its frontmatter — - `index.md` carries **only** `okf_version: "0.1"` in its frontmatter —
the one field the spec permits there. Reserved name, lowercase. the one field the spec permits there. Reserved name, lowercase.
- Page types: `Summary`, `Architecture`, `Glossary` (CONTEXT and - Page types: `Summary`, `Architecture`, `Glossary` (CONTEXT and
`context/*`), `Roadmap`, `Learnings`, `ADR`, `Blueprint`, `Decision`, `context/*`), `Roadmap`, `Learnings`, `Decision`, `Index`, `Blueprint`,
`Ferry Map`. New page kinds coin a new type — types are producer-defined. `Ferry Map`. New page kinds coin a new type — types are producer-defined.
- Conformance check: `grep -rL "^type:" OKF/ --include='*.md'` returns - **Warrant** — durable pages carry `purpose`, `answers[]`, `cites[]`
only `index.md`. after `type`. Zero `answers`, or a question another page owns, makes the
page inadmissible; an unresolvable `cites` path is drift. Scope: the
root pages and `decisions/`. `blueprints/` and `ferries/` carry their
own frontmatter contracts and are exempt.
- Conformance check: `scripts/okf-check <okf-dir>` — reach for it from
this skill's own base directory, never a repo-relative path. Exit 1 on
any error; over-cap pages and pages with no `cites` are warnings.
## Page contracts (one line each in index.md) ## Page contracts (one line each in index.md)
@ -48,6 +54,12 @@ OKF/
Issue-local terms live in their blueprint until they recur. Issue-local terms live in their blueprint until they recur.
- **ROADMAP.md** — architect's skeleton (locked decisions, phases with - **ROADMAP.md** — architect's skeleton (locked decisions, phases with
verify steps, risks, out-of-scope). verify steps, risks, out-of-scope).
- **decisions/** — the why-register: one file per settled decision,
permanent numbers, format in
[model-domain/DECISION-FORMAT.md](../../engineering/model-domain/DECISION-FORMAT.md).
`decisions/index.md` carries one **question-shaped** line per decision,
the question derived from the file's first `answers:` entry — index.md
lists the register, not its members.
- **blueprints/** — blueprint output; status lives in frontmatter, so the - **blueprints/** — blueprint output; status lives in frontmatter, so the
"tracker" is `grep -r "^status:" OKF/blueprints/`. index.md lists one "tracker" is `grep -r "^status:" OKF/blueprints/`. index.md lists one
line per blueprint: `NNN — title — status`. line per blueprint: `NNN — title — status`.

View File

@ -17,7 +17,8 @@ your task needs. Humans welcome too.
## Decisions ## Decisions
- `adr/` — TODO(scribe): list ADRs here as they land. - `decisions/index.md` — TODO(scribe): the why-register; link it here
once the first decision lands.
## Blueprints ## Blueprints

View File

@ -20,8 +20,8 @@ subagent spawn (the handoff-gate brief —
## Rules (both exits) ## Rules (both exits)
- **Reference, don't duplicate.** Anything already captured in an - **Reference, don't duplicate.** Anything already captured in an
artifact — OKF pages, `OKF/blueprints/NNN`, a ferry `MAP.md`, ADRs, jj artifact — OKF pages, `OKF/blueprints/NNN`, a ferry `MAP.md`, register
change-ids, diffs — is cited by path/id, never restated. Ferried work: decisions, jj change-ids, diffs — is cited by path/id, never restated. Ferried work:
point at `OKF/ferries/<topic>/MAP.md` and stop. point at `OKF/ferries/<topic>/MAP.md` and stop.
- **Redact secrets.** No API keys, tokens, passwords, or PII — name - **Redact secrets.** No API keys, tokens, passwords, or PII — name
where a credential lives (`.env`, secret store), never its value. where a credential lives (`.env`, secret store), never its value.
@ -48,7 +48,7 @@ subagent spawn (the handoff-gate brief —
<done / in progress / blocked — cite jj change-ids and blueprint numbers> <done / in progress / blocked — cite jj change-ids and blueprint numbers>
## Decisions made this session ## Decisions made this session
- <decision> — <one-line reason> (or: see OKF/adr/NNNN, ferry D-n) - <decision> — <one-line reason> (or: see OKF/decisions/NNN, ferry D-n)
## Open questions ## Open questions
- <question> — <who/what would answer it> - <question> — <who/what would answer it>