← knowledge.oriz.in

Agent minimum-context protocol — find before deriving

rule ruleagentknowledgenavigationcontextprotocolcookbook

Agent minimum-context protocol

TL;DR for any agent reading this

  1. Decision-shaped question? ? open knowledge/_navigation.md, find the matching row, follow the link.
  2. About to write a new rule/decision? ? first git grep -i '<keyword>' knowledge/ to find what already exists. If a related rule exists, edit it or supersede it; do not duplicate.
  3. Writing a new knowledge file? ? keep it = 80 lines. One concept. Terse. Future agents pay tokens to read it.
  4. Cross-reference everything ? use [[file-slug]] wikilinks to point at related knowledge files.
  5. Update in same turn ? if a chat-decision is captured, the knowledge file lands in the same commit.

Why this matters

Every agent session pays tokens to load context. The knowledge bundle (knowledge/) is the shortcut: it pre-digests architectural decisions, taste rules, and runbooks so a fresh agent doesn't re-derive them from scratch. But the bundle only earns its keep if agents:

The 5-step protocol in detail

Step 1: Load the navigation index first

Before answering any question that smells like an architectural / naming / stack / policy choice, read knowledge/_navigation.md. It maps user intent ("looking for X") ? the right file. Reading nav costs ~2k tokens; reading the wrong files costs 10–50k tokens.

Trigger phrases that mean "go to nav first":

Step 2: Grep before writing

About to write knowledge/rules/foo.md or knowledge/decisions/bar/baz.md?

# From the umbrella root:
git grep -li '<keyword>' knowledge/
ls knowledge/rules/ knowledge/decisions/*/  | grep -i '<keyword>'

If a file already covers = 60% of what you're about to write — edit it, don't create a new one. If two files cover overlapping concepts, mark the older as superseded_by: <new-slug> and the newer as supersedes: <old-slug> (see _okf.md for the convention).

Step 3: Terse + self-contained

Every knowledge file is:

Step 4: Wikilink everything related

[[file-slug]] or <!-- TODO: broken link, was [file](../relative/path.md) --> — both work. Pick at least 2 related files to link from any new knowledge file. The bundle's graph density is what makes it navigable; isolated files rot.

Step 5: Same-turn commit

Per [[rules/self-update-rule]], when a chat-decision lands, the knowledge file lands in the same commit. NEVER "I'll add it later" — later means never. NEVER add knowledge/log.md entries that just restate the diff. The git log is the durable record of "what was decided when."

What to NEVER write to knowledge

(From the stricter self-update-rule revision):

Cookbook — recurring tasks and where to look first

If the user wants to… Start here
Add a new submodule fork [[rules/fork-discipline]] ? [[runbooks/git-upstream-merge-private-fork]] ? [[policy/forked-extension-cws-rules]] (if CWS-shipping)
Patch a fork's code [[rules/development/fork-discipline]]
Merge upstream into our forks scripts/merge-upstreams.mjs pattern (see this rule's runbook section below)
Add an env / secret [[security/sops-plus-doppler-hybrid]] ? [[rules/git-identity-chirag127-noreply]]
Change repo / folder layout [[infrastructure/projects-owner-own-forks-layout]]
Decide where a repo lives (owner / brand vs personal) [[branding/keep-chirag127-recruiter-via-pinning]] ? [[rules/recruiter-strategy]]
Mirror / back up code or metadata [[decisions/ops/mirror-to-7-popular-alternatives-2026-06-28]] ? [[runbooks/backup-metadata-to-b2]] ? [[decisions/ops/backup-channels-alternative]]
Write a userscript [[decisions/apps/userscript-prototype-via-tweeks]] ? develop-userscripts skill
Download a Chrome extension's source scripts/download-cws-extension.mjs <EXT_ID>
Decide which AI / LLM provider for a feature [[decisions/compute/ai-puter-plus-cf-workers-ai]] + scan services/llm/*
Set up payments [[monetisation/max-payment-methods]] ? [[security/razorpay-donation-button]]
Pick a hosting target [[rules/hosting-split-cf-and-github-pages]] + scan services/infra/hosting/*
Name a new repo [[branding/repo-naming-suffixes]]

Anti-patterns

Self-check before committing

# Before any commit that touches knowledge/, run:
git diff --cached --stat knowledge/

# If you wrote a new file: confirm it has nav entry, related: refs, = 80 lines.
# If you edited an existing file: confirm the title/description still matches.