What This Is

An LLM-maintained wiki compounds in value, and in risk. Sources update, the agent under-updates on ingest, confidence inflates, and pages quietly drift from what their sources actually say. A wiki you can’t trust is worse than no wiki.

tng-wiki is the layer that keeps attribution honest as the wiki grows. Inspired by Karpathy’s LLM Wiki pattern; built for the failure mode nobody else addressed: keeping the wiki trustworthy over time.

  • A per-claim citation lockfile that answers “which claims changed since a human last verified them?”, not “which files were touched.” Content-hashed and move-aware: it can tell a citation that merely shifted line numbers apart from one whose cited content actually changed.
  • A three-layer grounding pipeline: structural lint (zero LLM calls), agent-driven semantic re-verification, and opt-in authority validation against web sources or a local codebase. That last one is built for reverse-engineering and porting work, where the code is ground truth and the AI-generated docs are just hypotheses.
  • Claim-next-to-evidence review: every citation printed beside the exact source lines it points at, so a human can verify without hunting.

The CLI makes zero LLM calls itself. It verifies structure and configures tools; your agent is the intelligence.


Quickstart

npx @thenewguard/tng-wiki init

The interactive flow picks a domain template (AI Research, Competitive Intel, Publication, Business Ops, Learning, Software Engineering, Code Archaeology, or Blank), your agent (Claude Code, OpenAI Codex, Cursor, or all), and integrations (Git, QMD hybrid search). Headless scaffolding for agents:

tng-wiki init --yes --dir ./my-wiki --domain software-engineering --agent claude-code --name "My Wiki"

What You Get Out of the Box

  • Verification toolchain: the citation lockfile, ground / cite, marker lint verbs (drift, stale, unsourced, unverified, orphans), and rounds to run the whole maintenance bundle at once
  • 8 domain templates, each with a tailored schema, directory layout, and page types
  • Agent-agnostic schema: one canonical AGENTS.md with per-agent aliases for Claude Code, Codex, Cursor, Aider, and anything that reads the agents.md convention
  • Multi-wiki registry: one user, many wikis, reachable from any directory by slug
  • Claude Code skill + MCP server: tng-wiki install-skill teaches every session the verbs; tng-wiki-mcp serves shell-less agents (Claude Desktop, web UIs)
  • QMD hybrid search: optional BM25 + vector + LLM re-rank for wikis past ~100 pages
  • Git + Obsidian ready out of the box

Why This Exists

Karpathy described the pattern; dozens of people built scaffolders around it. The gap nobody filled is keeping the wiki trustworthy over time. tng-wiki applies a package-lockfile mindset to knowledge claims, so “verified against this source, at this version” becomes a checkable fact instead of a hope.

Its sharpest fit is high-stakes, source-grounded work with fallible inputs (reverse-engineering a codebase, due diligence, porting), where a real codebase is the ground truth the wiki validates against. It also scaffolds a clean general-purpose research wiki in one command.