refactor(skills): retarget canonical knowledge paths into OKF/

- refactor(domain-modeling): CONTEXT.md, adr/ and multi-context layout move under OKF/
- refactor(domain-modeling): bounded-context-only split rule; per-issue glossaries forbidden
- refactor(grill-with-docs): glossary and ADR updates target OKF/ paths
This commit is contained in:
Łukasz Boryń 2026-07-19 23:18:16 +02:00
parent 7ec15a4e9d
commit 246a81d0dc
4 changed files with 38 additions and 32 deletions

View File

@ -1,7 +1,7 @@
# ADR format # ADR format
ADRs live in `docs/adr/` with sequential numbering: `0001-<slug>.md`, ADRs live in `OKF/adr/` with sequential numbering: `0001-<slug>.md`,
`0002-<slug>.md`, etc. Create `docs/adr/` lazily — only when the first `0002-<slug>.md`, etc. Create `OKF/adr/` lazily — only when the first
ADR is needed. ADR is needed.
## Template ## Template
@ -28,7 +28,7 @@ Add only when they add genuine value. Most ADRs won't need them.
## Numbering ## Numbering
Scan `docs/adr/` for the highest existing number and increment by one. Scan `OKF/adr/` for the highest existing number and increment by one.
## When to offer an ADR — three-of-three test ## When to offer an ADR — three-of-three test

View File

@ -41,21 +41,20 @@ _Avoid_: Client, buyer, account.
## Single vs multi-context repos ## Single vs multi-context repos
**Single context (most repos):** one `CONTEXT.md` at the repo root. **Single context (most repos):** one `OKF/CONTEXT.md`.
**Multi-context:** a `CONTEXT-MAP.md` at the repo root lists the contexts, **Multi-context:** glossaries split into `OKF/context/<subroot>.md` —
where they live, and how they relate: one per bounded context — with a Contexts section in `OKF/INDEX.md`
listing them and how they relate:
```md ```md
# Context Map
## Contexts ## Contexts
- [Ordering](./src/ordering/CONTEXT.md) — receives and tracks customer orders - [Ordering](context/ordering.md) — receives and tracks customer orders
- [Billing](./src/billing/CONTEXT.md) — generates invoices and processes payments - [Billing](context/billing.md) — generates invoices and processes payments
- [Fulfillment](./src/fulfillment/CONTEXT.md) — warehouse picking and shipping - [Fulfillment](context/fulfillment.md) — warehouse picking and shipping
## Relationships ### Relationships
- **Ordering → Fulfillment**: Ordering emits `OrderPlaced` events; - **Ordering → Fulfillment**: Ordering emits `OrderPlaced` events;
Fulfillment consumes them to start picking. Fulfillment consumes them to start picking.
@ -65,11 +64,13 @@ where they live, and how they relate:
``` ```
Decision rule: Decision rule:
- If `CONTEXT-MAP.md` exists → multi-context. Read it to find contexts. - If `OKF/context/` exists → multi-context. Read INDEX.md to find contexts.
- Else if a single root `CONTEXT.md` exists → single-context. - Else if `OKF/CONTEXT.md` exists → single-context.
- Else (neither) → create a root `CONTEXT.md` lazily when the first term - Else (neither) → create `OKF/CONTEXT.md` lazily when the first term
is resolved. Switch to multi-context only on observing ≥ 2 obvious is resolved. Switch to multi-context only on observing ≥ 2 obvious
sub-roots *and* a second term that clearly belongs to one of them. sub-roots *and* a second term that clearly belongs to one of them.
- Split by bounded context only — never per issue; issue-local terms
stay in their `OKF/specs/` entry until they recur.
When multiple contexts exist, infer which one the current topic relates When multiple contexts exist, infer which one the current topic relates
to. If unclear, ask. to. If unclear, ask.

View File

@ -45,25 +45,28 @@ habit any skill can do; that's not this skill.
## File layout the skill expects ## File layout the skill expects
``` ```
/ OKF/ # open-knowledge-format wiki (see scribe-OKF)
├── CONTEXT.md # single-context default ├── CONTEXT.md # single-context default — THE canonical glossary
├── CONTEXT-MAP.md # only when ≥2 obvious sub-roots exist ├── context/ # multi-context mode: one <subroot>.md per
├── docs/adr/ │ └── <subroot>.md # bounded context, indexed from OKF/INDEX.md
│ └── 0001-<slug>.md └── adr/
└── src/ (or R/, app/, ...) └── 0001-<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 `CONTEXT.md` yet? Create it when the first term is resolved. No No `OKF/CONTEXT.md` yet? Create it when the first term is resolved (run
`docs/adr/`? Create it when the first ADR is needed. Confirm the *first* [scribe-OKF](../../loop/scribe-OKF/SKILL.md) scaffold if `OKF/` itself is
write to any new file in the repo before proceeding. missing). No `OKF/adr/`? Create it when the first ADR is needed. Confirm
the *first* write to any new file in the repo before proceeding. A legacy
root `CONTEXT.md` or `docs/adr/` → offer to migrate into `OKF/`.
If `CONTEXT-MAP.md` exists at root, the repo is in **multi-context mode**. Default is single-context. Switch to **multi-context mode** only on
Default is single-context. Switch only when you observe **≥ 2 obvious observing **≥ 2 obvious sub-roots** (e.g. `R/ingest/`, `R/analysis/`;
sub-roots** (e.g. `R/ingest/`, `R/analysis/`, `R/report/`; or `src/ordering/`, `src/billing/`) *and* a second resolved term clearly
`src/ordering/`, `src/billing/`). On the second resolved term that clearly belonging to one of them — then propose `OKF/context/<subroot>.md` files
belongs to one of them, propose `CONTEXT-MAP.md` at the root + indexed from `OKF/INDEX.md`. **The split axis is the bounded context
per-context `CONTEXT.md` under each sub-root. (stable), never the issue (transient)** — issue-local terms live in their
`OKF/specs/` entry until they recur, then get promoted here.
## Language references — R ## Language references — R
@ -78,8 +81,10 @@ per-context `CONTEXT.md` under each sub-root.
glossary, not a spec. glossary, not a spec.
- **Never** open an ADR unless all three of {hard to reverse, surprising - **Never** open an ADR unless all three of {hard to reverse, surprising
without context, real trade-off} are true. When in doubt, don't. without context, real trade-off} are true. When in doubt, don't.
- **Never** create a `CONTEXT.md` / `docs/adr/` in the repo without - **Never** create an `OKF/CONTEXT.md` / `OKF/adr/` in the repo without
confirming the first such write. confirming the first such write.
- **Never** create a per-issue glossary — one canonical glossary per
bounded context, full stop.
## See also ## See also
- [../codebase-design/SKILL.md](../codebase-design/SKILL.md) — sibling - [../codebase-design/SKILL.md](../codebase-design/SKILL.md) — sibling

View File

@ -9,7 +9,7 @@ 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** [domain-modeling](../domain-modeling/SKILL.md) (the Socratic interview) **using** [domain-modeling](../domain-modeling/SKILL.md)
(the active glossary / ADR discipline) — interview the user about the (the active glossary / ADR discipline) — interview the user about the
plan, and update `CONTEXT.md` and `docs/adr/` as terms and decisions plan, and update `OKF/CONTEXT.md` and `OKF/adr/` 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)