$npx -y skills add stjbrown/agent-knowledge --skill kb-initScaffold a new OKF knowledge bundle in this project — run when starting a wiki or adding a bundle under knowledge/.
| 1 | # kb-init — scaffold a knowledge bundle |
| 2 | |
| 3 | Scaffold a conformant **bundle** per [kb](../kb/SKILL.md). Your unique work is the **schema layer** |
| 4 | (step 2) and adapting the seed (step 3). |
| 5 | |
| 6 | Read [../kb/reference/glossary.md](../kb/reference/glossary.md) if the terms below are unfamiliar. |
| 7 | |
| 8 | ## 1. Resolve location and bundle name |
| 9 | |
| 10 | Default to a bundle at **`knowledge/`**. Accept overrides from the user's request: |
| 11 | |
| 12 | - A different path (e.g. `docs/kb`) → scaffold there instead. |
| 13 | - A **named bundle** (e.g. "a `ci` bundle") → scaffold at `knowledge/<name>/` and treat `knowledge/` |
| 14 | as a **multi-bundle** folder: ensure a top-level `knowledge/index.md` exists that catalogs the |
| 15 | bundles (create it if missing; add this bundle to it). |
| 16 | |
| 17 | If the target directory already contains a bundle (a root `index.md`), stop and report it — do not |
| 18 | overwrite. Offer [kb-ingest](../kb-ingest/SKILL.md) instead. |
| 19 | |
| 20 | **Completion criterion:** the target path and bundle name are fixed, and confirmed not to collide |
| 21 | with an existing bundle. |
| 22 | |
| 23 | ## 2. Understand the domain before scaffolding |
| 24 | |
| 25 | The scaffold is deterministic; the **schema layer** needs judgment, so gather it first. Inspect the |
| 26 | workspace for signal (README, existing docs, the code, any notes the user points at) and ask the |
| 27 | user only what you still can't infer: |
| 28 | |
| 29 | - What kind of knowledge will this bundle hold? (work context — people, deals, product; a research corpus you keep adding papers to; a codebase or product handbook; competitive landscape; a book/course you're studying; a spec or pattern you're documenting, like this repo's OKF bundle, …) |
| 30 | - What are the main **entities** — the recurring things worth a concept each? These become the |
| 31 | `type` vocabulary (e.g. `person`, `deal`, `metric`; or `character`, `chapter`, `theme`). |
| 32 | - What raw **sources** will be ingested, and how should they route to those entities? |
| 33 | |
| 34 | Keep it short — a few types and a one-line routing rule is enough to start; the schema layer |
| 35 | co-evolves later. |
| 36 | |
| 37 | **Completion criterion:** you can name the bundle's initial `type` values, its raw sources, and a |
| 38 | one-line ingest routing rule. |
| 39 | |
| 40 | ## 3. Copy the seed and write the schema layer |
| 41 | |
| 42 | Copy [../kb/example-bundle/](../kb/example-bundle/) into the target, then adapt every seed artifact: |
| 43 | |
| 44 | | Artifact | Action | |
| 45 | |---|---| |
| 46 | | `index.md` | Keep `okf_version: "0.1"` frontmatter; replace the body with this bundle's title and section list. | |
| 47 | | `log.md` | Start fresh with a single dated `**Creation**` entry. | |
| 48 | | `spec/types.md` | Replace example types with the domain's `type` vocabulary from step 2. | |
| 49 | | `spec/conventions.md` | Replace with folder taxonomy, naming, ingest routing rule, and a trust-model pointer. | |
| 50 | | `concepts/*` | Remove example entities (`customers`, `orders`); leave `concepts/` empty or create domain starter folders. | |
| 51 | | `knowledge/index.md` | If multi-bundle (step 1): create or update the catalog entry for this bundle. | |
| 52 | |
| 53 | Use [../kb/templates/](../kb/templates/) for any new concept/index/log files. |
| 54 | |
| 55 | **Completion criterion:** the bundle exists on disk; every row above is accounted for; `spec/types.md` |
| 56 | and `spec/conventions.md` describe *this* project (not the example's orders/customers); multi-bundle |
| 57 | catalog updated if applicable. |
| 58 | |
| 59 | ## 4. Validate |
| 60 | |
| 61 | Run [kb-lint](../kb-lint/SKILL.md) if available; otherwise verify the bundle is conformant per |
| 62 | [kb](../kb/SKILL.md) (SPEC §9 — the one hard rule). |
| 63 | |
| 64 | **Completion criterion:** zero conformance errors. |
| 65 | |
| 66 | ## 5. Hand off |
| 67 | |
| 68 | Tell the user the bundle is ready, where it lives, and the two next moves: |
| 69 | [kb-ingest](../kb-ingest/SKILL.md) to add knowledge, [kb-query](../kb-query/SKILL.md) to ask it |
| 70 | questions. If this project uses `CLAUDE.md`/`AGENTS.md`, offer to add a one-line pointer so agents |
| 71 | read the bundle's root `index.md` before relevant tasks. |