Skip to content

Repository files navigation

llm-wiki-master

llm-wiki-master is a general-purpose skill for building and maintaining persistent LLM-maintained knowledge bases.

It follows the LLM Wiki pattern: raw sources stay immutable, the AI maintains a structured Markdown wiki, and a schema defines how future agents ingest, query, update, lint, and cite knowledge.

This version is based on the open-source llm-wiki-skill project and adds stricter project knowledge-base workflows: multi-source traceability, Lark/Feishu collaboration, Graphify helpers, export quality gates, and checks against empty source pages.

What It Is For

Use this skill when you want an AI agent to maintain durable knowledge instead of answering from raw files every time.

Common uses:

Scenario Examples
Project handoff Code repos, architecture docs, local reports, Lark spaces
Research Papers, PDFs, web articles, interview notes
Team wiki Meeting notes, design docs, decision logs
Personal knowledge base Reading notes, goals, learning paths
Multi-source analysis Local files + web + PDFs + videos + Lark + code graphs

Install

Install with an explicit llm-wiki-master target directory:

# Codex
bash install.sh --platform codex --target-dir ~/.codex/skills/llm-wiki-master

# Claude Code
bash install.sh --platform claude --target-dir ~/.claude/skills/llm-wiki-master

Optional extractors for web pages, X/Twitter, WeChat, YouTube, and Zhihu can be installed separately:

bash install.sh --platform codex --target-dir ~/.codex/skills/llm-wiki-master --with-optional-adapters
bash install.sh --platform claude --target-dir ~/.claude/skills/llm-wiki-master --with-optional-adapters

The optional LLM Wiki desktop app is not installed silently with the skill. Install it only when you want the local visual UI or API.

Codex:

bash ~/.codex/skills/llm-wiki-master/deps/llm-wiki-app/scripts/install_llm_wiki_app.sh

Claude Code:

bash ~/.claude/skills/llm-wiki-master/deps/llm-wiki-app/scripts/install_llm_wiki_app.sh

Check the local app API after launch.

Codex:

bash ~/.codex/skills/llm-wiki-master/deps/llm-wiki-app/scripts/llm_wiki_app_status.sh

Claude Code:

bash ~/.claude/skills/llm-wiki-master/deps/llm-wiki-app/scripts/llm_wiki_app_status.sh

Trigger Examples

Use llm-wiki-master to initialize this knowledge base.
Use llm-wiki-master to ingest these project docs.
Use llm-wiki-master to refresh the local/Lark source diffs.
Use llm-wiki-master to check whether this wiki has empty source pages or broken links.
Use llm-wiki-master to answer this architecture question and save reusable findings back into the wiki.

Core Model

Every knowledge base has three layers:

Layer Typical Location Rule
Raw sources raw/, .ai-wiki-cache/, local repos, exported docs Immutable inputs. Do not rewrite them into summaries.
Wiki wiki/ or docs/ai-wiki/ AI-maintained Markdown synthesis.
Schema .wiki-schema.md, schema.md, AGENTS.md, CLAUDE.md Operating rules for future agents.

Generated wiki pages are not more authoritative than their sources. For accuracy-sensitive answers, reopen or cite the underlying raw source.

Recommended Project Wiki Tree

For project or codebase knowledge bases:

wiki/
├── overview.md
├── knowledge-tree.md
├── modules/
│   └── <module>/
│       ├── index.md
│       ├── design.md
│       ├── implementation.md
│       ├── flows.md
│       ├── risks.md
│       ├── security.md
│       └── source-traceability.md
├── concepts/
├── entities/
├── questions/
├── sources/
├── state/
├── index.md
└── log.md

A useful project wiki is not just a file tree. Each important module should have overview, design, implementation, flows, risks, security, and source traceability pages.

Source Types

Source Source ID Pattern Notes
Local file local:path/to/file.md Prefer stable relative paths from the workspace root.
Local code local:path/to/repo or local:path/to/file.go Summarize architecture, ownership, APIs, state machines, and risks.
Lark / Feishu lark:<node_token> Use lark-reader or project scripts when available. Do not publish raw caches by default.
Web page web:<url> Use adapter extraction when installed; otherwise paste or export Markdown.
PDF pdf:<path> Extract text, then visually inspect pages when layout or figures matter.
Video video:<url> or transcript:<path> Prefer transcript extraction. If unavailable, use manual transcription.
Graphify graphify:<query> Treat graph output as an auxiliary source, not as final evidence.

Ingest Workflow

When adding or refreshing sources:

  1. Capture source state or snapshots.
  2. Assign stable source IDs.
  3. Create or update source summary pages.
  4. Update affected module, concept, entity, and synthesis pages.
  5. Flag contradictions, superseded claims, and gaps.
  6. Update index.md.
  7. Append a parseable entry to log.md.
  8. Run lint and export quality checks.

Do not create source pages that only contain a path, link, or source_ref. A source page must contain enough preview, status, summary, evidence, or manifest information for a future AI to understand what the source is.

Query Workflow

When answering questions:

  1. Read index.md first.
  2. Read knowledge-tree.md if present.
  3. Read relevant module, concept, entity, source, and question pages.
  4. Reopen raw sources for high-stakes facts or exact behavior.
  5. Answer with source IDs.
  6. Save reusable answers into questions/ or update the related module/concept page.

Useful confidence labels:

Label Meaning
EXTRACTED Directly stated by a source.
INFERRED Synthesized by the AI from multiple sources.
AMBIGUOUS Source wording or ownership is unclear.
UNVERIFIED Not yet confirmed against raw source.
CONTRADICTION Sources disagree.
SUPERSEDED Newer source replaces older claim.

Update And Diff Workflow

Knowledge bases should be refreshable.

Projects may provide their own source-state scripts, for example:

node scripts/ai-wiki/collect-local-sources.mjs
node scripts/ai-wiki/ingest-lark-space.mjs --root-url "<lark-space-url>"
node scripts/ai-wiki/ingest-lark-space.mjs --root-url "<lark-space-url>" --fetch-content

After state refresh:

  1. Read state/ snapshots and diffs.
  2. Update only affected wiki pages.
  3. Mark stale or superseded conclusions.
  4. Update index.md and log.md.
  5. Run quality gates.

Quality Gate

Before exporting a wiki to an app, graph viewer, or another AI, run:

bash ~/.codex/skills/llm-wiki-master/scripts/export-quality-gate.sh "<export-root>" "<wiki-root>/state/export-quality-gate.json"

The gate checks for:

  • source pages that are only source_ref, path, or link shells
  • (Analysis not available) placeholders
  • missing source status for local:*, lark:*, web:*, and related IDs
  • collection references rendered as broken single-file pages
  • broad navigation without actual synthesis

Passing the gate does not prove the wiki is perfect. It prevents the most damaging handoff failures.

Graphify Helper

Graphify is optional. Use it when a graph already exists:

bash ~/.codex/skills/llm-wiki-master/scripts/graphify-helper.sh status
bash ~/.codex/skills/llm-wiki-master/scripts/graphify-helper.sh query "How does deposit flow through this system?"
bash ~/.codex/skills/llm-wiki-master/scripts/graphify-helper.sh explain "Risk Center"
bash ~/.codex/skills/llm-wiki-master/scripts/graphify-helper.sh path "Bridge" "Indexer"

Rules:

  • If graphify-out/graph.json exists, use Graphify for scoped architecture and relationship questions.
  • If no graph exists, fall back to index.md, knowledge-tree.md, module pages, and source state.
  • Verify important claims against raw code or documents.

Local Viewing

You do not need Obsidian, but it is useful.

Viewer Best For
Obsidian Markdown browsing, backlinks, graph view, Dataview
LLM Wiki App Three-pane wiki and knowledge graph reading
Self-contained HTML graph Offline visual browsing
Codex / Claude Maintenance, querying, linting, and updates

The durable artifact is the Markdown wiki plus its source traceability. Viewers are interchangeable.

LLM Wiki App

nashsu/llm_wiki is an optional cross-platform desktop app. It is useful for browsing the generated wiki and knowledge graph, but it is not required for wiki maintenance.

Install or stage the latest release.

Codex:

bash ~/.codex/skills/llm-wiki-master/deps/llm-wiki-app/scripts/install_llm_wiki_app.sh

Claude Code:

bash ~/.claude/skills/llm-wiki-master/deps/llm-wiki-app/scripts/install_llm_wiki_app.sh

Download without installing.

Codex:

bash ~/.codex/skills/llm-wiki-master/deps/llm-wiki-app/scripts/install_llm_wiki_app.sh --download-only

Claude Code:

bash ~/.claude/skills/llm-wiki-master/deps/llm-wiki-app/scripts/install_llm_wiki_app.sh --download-only

Supported release families:

OS Support
macOS Apple Silicon .dmg and .app.tar.gz
macOS Intel No dedicated latest asset detected; check GitHub Releases manually
Windows x64 setup .exe, .msi, portable .zip
Linux x64 .AppImage, .deb, .rpm
Linux arm64/aarch64 .AppImage, .deb, .rpm

After launching the app:

  1. Enable Settings -> API Server -> Enable local HTTP API.
  2. If token auth is enabled, set LLM_WIKI_API_TOKEN.
  3. Run:
bash ~/.codex/skills/llm-wiki-master/deps/llm-wiki-app/scripts/llm_wiki_app_status.sh

Claude Code:

bash ~/.claude/skills/llm-wiki-master/deps/llm-wiki-app/scripts/llm_wiki_app_status.sh

Common Pitfalls

  • Building only a file index instead of a synthesized wiki.
  • Generating empty source pages with only source_ref.
  • Treating generated wiki pages as stronger evidence than raw sources.
  • Leaving useful answers only in chat history.
  • Publishing private Lark or local cache content by accident.
  • Treating Graphify, Obsidian, or RAG as the source of truth.
  • Skipping diff state, which makes future incremental updates hard.
  • Not recording contradictions, uncertainty, or superseded claims.

Useful Files In This Skill

File Purpose
SKILL.md Main operating instructions for agents.
scripts/source-registry.tsv Supported source families and extraction boundaries.
scripts/dependency-check.sh Checks optional Lark/PDF/Graphify/web/video dependency availability.
scripts/export-quality-gate.sh Checks exported wiki pages for empty shells and placeholders.
scripts/graphify-helper.sh Thin Graphify wrapper with wiki fallback behavior.
templates/project-traceability-template.md Claim-to-source traceability template.
deps/lark-reader/SKILL.md Lark/Feishu reader companion skill.
deps/pdf/SKILL.md PDF ingestion companion skill and extraction script.
deps/graphify/SKILL.md Graphify companion skill with install script and CLI wrapper.
deps/llm-wiki-app/SKILL.md Optional LLM Wiki desktop app installer and API checker.

Attribution

This skill is based on the public llm-wiki-skill project and the LLM Wiki methodology. The enhanced workflow here keeps the upstream idea but removes project-specific presentation details, focusing on reusable multi-source knowledge-base maintenance.

License

MIT

About

Enhanced llm-wiki Codex skill for building and maintaining local markdown knowledge bases

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages