Onboarding: Run llm-wiki as an Agent-First Harness
This guide is for someone adopting this repo as their own agent-first knowledge harness — a system where an AI coding agent does the reading, writing, linking, and quality-checking, and you stay in the loop as the curator and decision-maker. It is a tutorial, not a reference. Follow it top to bottom once. For deep operational detail afterward, seeGUIDE.md (skills, MCP tools, scenario playbooks) and
README.md (architecture and install detail).
What “agent-first, human-second” means here
Most documentation is written for humans, and an AI agent reads it as a side effect. This repo inverts the priority: the primary reader is the agent, and the human-readable view is a projection of the same content. That inversion is cheaper than it sounds, because of one finding the wiki itself has on file (see Software Documentation):Practices that make docs LLM-friendly are the same practices that make docs human-friendly.So you do not maintain two things. You maintain one corpus that is:
- Self-contained per page — an agent retrieves a single page out of context and it still makes sense. Humans benefit identically.
- Consistently named — stable terminology so retrieval matches and humans don’t get whiplash from synonyms.
- Semantically structured — heading hierarchy and
[[wikilinks]]encode relationships the agent (and a reader) can traverse.
The agent owns the wiki layer. You own the curation and the calls.
The harness, in one picture
This repo is not just a folder of markdown. It is a harness with four moving parts that make the agent reliable across sessions:- Rules —
CLAUDE.md+@-imported rule files +mistakes/global-prevention-rules.md. Loaded every session. They encode model-tier routing, epistemic discipline (“default stance: uncertain”), and citation rules. This is the agent’s standing operating procedure. - Skills — invokable procedures (
wiki-context,pdf-ingest,capture-mistake,judge,council, …). Deterministic triggers decide when each fires. See Agent Skills. - Hooks — a post-commit hook re-indexes the knowledge graph automatically after every wiki commit. The human never re-runs indexing by hand.
- Retrieval (RAG) — three tools over the same corpus: in-session search (
wiki-contextvia qmd), a standalone terminal Q&A TUI (wiki-chat), and an MCP server (wiki-mcp) for other agents. See Local Wiki RAG: LightRAG Graph Stack.
15-minute quickstart
Prerequisites and full install detail live in README.md. This is the
condensed path to a working loop.
1. Clone and install
Prerequisites (install these yourself first —install.sh does not install them):
Then:
install.sh handles the rest: uv (if missing), copies wiki-index / wiki-chat / wiki-mcp
to ~/.local/bin, pulls nomic-embed-text and qwen2.5:3b via ollama, installs the
post-commit and pre-push git hooks. Ensure ~/.local/bin is on $PATH:
2. Point Claude Code at the harness config
~/.claude → ~/repos/llm-wiki/claude-setup. If ~/.claude is an existing real
directory, the script moves it to ~/.claude.bak-<timestamp> first. Re-running is a no-op.
If ~/.claude is already a symlink to a different path, the script refuses and tells you to
remove it.
This is what makes a session agent-first: the rules, skills, and prevention log load
automatically.
3. Run your first ingest
index.md and log.md, and commits. The post-commit hook
indexes the new pages in the background. Skip the questions with "just ingest it".
4. Query what you just built
wiki-context skill searches, loads the relevant pages, and the agent answers with
[[page]] citations. That round trip — curate → ingest → query — is the entire system.
The daily loop
Once set up, day-to-day work is one repeating cycle:lint the wikiperiodically — the agent scans for orphan pages, stale claims, and missing concepts, and suggests sources to ingest next.- Let it log its own mistakes — when the agent self-corrects, the
capture-mistakeskill files the error so the same one doesn’t recur. Distilled rules live inmistakes/global-prevention-rules.mdand load every session.
What makes the agent trustworthy
The harness encodes a few rules worth understanding before you rely on its output (full set inREADME.md and mistakes/global-prevention-rules.md):
- Default stance: uncertain. Claims are provisional unless backed by a cited wiki page or
verified current docs. Unsourced claims are prefixed
(training data — verify). - Numbers need provenance. Self-reported README figures are not benchmarks; unverified
numbers are marked
(claimed, unverified). - Model-tier routing. The agent classifies task complexity (Haiku / Sonnet / Opus) before acting and sets the model explicitly when spawning sub-agents. See Model Tier Routing.
Make it yours
Swap the domain
The taxonomy (summaries / entities / concepts / comparisons / syntheses / systems /
patterns) is domain-agnostic. To repurpose:
- Fork, then clear
raw/,wiki/,index.md,log.md. - Keep
CLAUDE.md,claude-setup/, andmistakes/global-prevention-rules.md. - Edit
CLAUDE.mdto describe your domain. - Start ingesting. The harness behavior carries over unchanged.
Add the lean workflow to an existing project
AGENTS.md so the same agent rules apply in your other repos.
Tune the rules
Rule files underclaude-setup/rules/ are @-imported into CLAUDE.md. Edit them to change
model routing, communication style, or skill triggers. Changes take effect next session.
Where to go next
Adopting this means accepting one trade: you give the agent ownership of a layer, and in return you stop forgetting 90% of what you read. Curate well, review often, and let it compound.