type: decision
timestamp: 2026-06-20
tags: [architecture, knowledge, okf, agent-context]

Knowledge bundle depth scales with folder size, ceiling 5

Folder depth adaptive: flat for tiny, 5 levels for big

Depth scales with folder size, ceiling 5

Decision

Depth tracks the L1 folder’s file count. Apply the deepest tier the folder qualifies for; never exceed 5.

L1 file countDepthExample
=152knowledge/glossary/api.md
16–503knowledge/rules/security/no-hardcoded-secrets.md
51–1504knowledge/services/business/auth/firebase/firebase-auth.md
151+5knowledge/decisions/knowledge-bundle/depth/5-level-hierarchy.md

index.md exists at every level and lists only direct children.

Why

A grep / glob / read should pull one concept, not a 30-file category dump. Minimum context = minimum tokens = sharper agent attention.

Forcing 5 levels everywhere (the rejected earlier rule) bloats tiny folders with empty pass-through subdirs. Letting depth float with size keeps the bottom of the tree tight in big areas and flat in small ones. Same property — minimum leaf — without the make-work.

Implementation


Edit on GitHub · Back to index