docs/wiki — AGENT.md (wiki schema)¶
This directory is yaya's LLM-maintained knowledge wiki, following
Karpathy's LLM Wiki
pattern. The wiki is not product documentation — docs/dev/*
remains the authoritative engineering docs. The wiki compiles
durable lessons, decision history, and notes from sources we consulted.
Three layers¶
- Raw sources (immutable).
vendor/kimi-cli,vendor/bub, external gists, the homework PDF, issue comments. Agents read these; they never modify them. - The wiki (this directory). LLM-written pages that compile knowledge from sources. Every page has a single owner: the structure, not the human.
- The schema (this file). How the wiki is organized, what each page shape looks like, when to update what.
Directory structure¶
docs/wiki/
├── AGENT.md <- this file
├── index.md <- content catalog; updated on every ingest
├── log.md <- append-only chronological log
├── sources/ <- one page per external source consulted
├── concepts/ <- design concepts we converged on
├── lessons/ <- rolling lessons from implementation (was lessons-learned.md)
└── decisions/ <- ADR-style records of major choices
Create subdirectories lazily when the first page of that type lands.
Operations¶
Ingest¶
Triggered when we consult a new source (vendor repo, external doc, gist, paper, thread) for a non-trivial design decision.
- Read the source.
- Create a file under
sources/<slug>.mdusing the Source page shape below. Keep the raw source immutable undervendor/or cite the URL. - If the source introduces a new concept, create or update the
matching
concepts/<slug>.md. - Cross-link: every new page links to at least one other wiki page.
- Append an entry to
log.md: - Update
index.mdwith the new page listed under its category.
Convert relative dates the user mentions to absolute dates
("yesterday" → YYYY-MM-DD) — the log is permanent.
Query¶
Triggered when a design question recurs or an audit is performed.
- Read
index.mdfirst to find relevant pages. - Drill into concept + source pages. Answer with citations.
- If the answer is durable (an audit, a comparison, a non-obvious
synthesis) and not already captured, file it as
concepts/<slug>.mdordecisions/NNNN-<slug>.md. - Append a short entry to
log.md:
Explorations that never get filed back are wasted effort. File them.
Lint¶
Triggered periodically (every few weeks or before a major PR).
Check for:
- Orphans — pages with zero inbound links (they'll rot).
- Stale claims — "kimi does X" may no longer be true; re-check vendor/ commit hash referenced in the source page.
- Contradictions — two concept pages disagreeing on the same claim.
- Missing cross-refs — a concept mentioned in one page but never linked from related pages.
- Gaps — important yaya components with no wiki presence
(
docs/dev/*.mdcovers the spec; the wiki should cover the why and lessons).
Append to log.md:
Page shapes¶
Source page — sources/<slug>.md¶
# <source title>
- **URL / path**: <vendor/kimi-cli, external URL, etc.>
- **Consulted on**: YYYY-MM-DD
- **Commit / version**: <git sha or version string when known>
- **Status**: active | archived
## Why we read it
One paragraph.
## What we took
Concrete patterns, code references, approved decisions. Cite
specific files with line numbers where relevant.
## What we rejected
Things in the source we deliberately did not copy, with reason.
## See also
- concepts/<slug>.md
- decisions/<slug>.md
Concept page — concepts/<slug>.md¶
# <concept>
One-paragraph definition.
## How it appears in yaya
Concrete types, files, events, plugin categories.
## Invariants
What must always be true.
## Sources
- sources/<slug>.md (primary inspiration)
- sources/<slug2>.md (pattern from)
## Related
- concepts/<other>.md
Decision page — decisions/NNNN-<slug>.md¶
Standard ADR: Status / Context / Decision / Consequences. Numbered sequentially; never renumber.
Lesson page — lessons/<slug>.md¶
Rolling log of recurring review findings and hazards. Entry shape lives inside the page itself — append only; never rewrite history.
Conventions¶
- Pages are markdown only. No HTML.
- English only (matches root
AGENT.md). - Cross-references use relative paths
(
[event bus](../concepts/event-bus.md)). - Dates are absolute
YYYY-MM-DD. index.mdandlog.mdare updated in the same PR that adds or modifies a wiki page.- Never edit
log.mdretroactively — append only. - No page exists without at least one inbound link from
index.md.