# Knowledge Collections
Every approved article in `knowledge/` lives under a **collection** — the first directory of its path, such as `knowledge/sop/…`. The collection says what kind of reading the article serves. At build time it decides which package root the article goes to, and package `select.collections` filters by it.
```mermaid
flowchart LR
k["knowledge/collection/..."] --> w["wikis/
entities and relationships"]
k --> g["guides/
explanations and procedures"]
k --> r["rules/
standards and checks"]
k --> f["feats/
feature records"]
```
## The collections
| Collection | Holds | Package path | OKF type |
| --- | --- | --- | --- |
| `codeindex` | Source-backed code indexes, with optional structured relationships | `wikis/codeindex/` | Wiki |
| `business` | Structured business entities and relationships | `wikis/business/` | Wiki |
| `product` | Structured product entities, behavior and relationships | `wikis/product/` | Wiki |
| `architecture` | Architecture explanations and design narratives | `guides/architecture/` | Guide |
| `sop` | Procedures and runbooks | `guides/sop/` | Guide |
| `faq` | Question-oriented explanations and troubleshooting | `guides/faq/` | Guide |
| `decision` | Decision records and trade-off narratives | `guides/decision/` | Guide |
| `incident` | Incident timelines, response and follow-up | `guides/incident/` | Guide |
| `standards` | Normative standards and constraints | `rules/standards/` | Rule |
| `test` | Validation rules, scenarios and acceptance checks | `rules/test/` | Rule |
| `feats` | Feature capability records | `feats/` | Feature |
`codegraph` is still accepted as the legacy name of the code index collection and maps to `wikis/` like `codeindex`.
## What the package roots mean
- **`wikis/`** is the structured entity-and-relationship layer and the required default entry of a knowledge package, starting at `wikis/index.md`.
- **`guides/`** and **`rules/`** explain, operationalize or constrain that knowledge. Placing an article there does not create a relationship to anything; only a typed edge recorded by Context does.
- **`feats/`** holds feature records.
A package can choose roots with `select.okfRoots` as well as collections; see [Package Templates]().
## Choosing a collection
The Indexer proposes a collection from the reader's need, not from the source type: a document can become a runbook in `sop`, a decision record in `decision` or a standard in `standards`. Typical pairings:
| Reader need | Useful form |
| --- | --- |
| Understand a term, boundary or business rule | Domain explanation with scope and examples |
| Understand architecture or integration | Technical explanation, contracts and limitations |
| Complete a repeatable task | Guide with prerequisites, actions and checks |
| Diagnose or recover | Runbook with symptoms, safe actions and verification |
| Understand a choice | Decision, alternatives, rationale and consequences |
| Learn from an incident | Impact, observations, causes and response |
| Interpret a test | Method, scope and what the result establishes |
You can move an approved article to another collection later with `context revise --move-to `, which keeps its identity.
## Reserved names
`index.md` is reserved for package bundle and directory indexes. A source document may be called `index.md`, but an article must use another name such as `index-page.md`; `context build` rejects copied knowledge that would occupy `wikis/**/index.md`.
---
## Sources
- [context/packages/context/src/contracts.ts L45–L59 · 3b0ce0a]()
- [context/packages/context/docs/reference/package-templates.md L397–L408 · 3b0ce0a]()
- [context/packages/context/docs/guides/package-outputs.md L299–L313 · 3b0ce0a]()
- [context/packages/context-cli/src/project/okfTypes.ts L7–L35 · 3b0ce0a]()
- [context/packages/context-cli/src/project/codeIndexCollection.ts L3–L8 · 3b0ce0a]()
- [context/packages/context/docs/guides/package-outputs.md L315–L317 · 3b0ce0a]()
- [context/packages/context/docs/reference/package-templates.md L253–L261 · 3b0ce0a]()
- [context/plugins/context/skills/context-markdown-indexer/references/classification.md L1–L23 · 3b0ce0a]()
- [context/packages/context-cli/src/commands/documentRevisionCommands.ts L204–L216 · 3b0ce0a]()
- [context/packages/context/docs/guides/package-outputs.md L319–L322 · 3b0ce0a]()