Llm-wiki wiki-manager
git clone https://github.com/nvk/llm-wiki
T=$(mktemp -d) && git clone --depth=1 https://github.com/nvk/llm-wiki "$T" && mkdir -p ~/.claude/skills && cp -r "$T/claude-plugin/skills/wiki-manager" ~/.claude/skills/nvk-llm-wiki-wiki-manager && rm -rf "$T"
claude-plugin/skills/wiki-manager/SKILL.mdLLM Wiki Manager
You manage an LLM-compiled knowledge base. Source documents are ingested into
raw/, then incrementally compiled into a wiki of interconnected markdown articles. Claude Code is both the compiler and the query engine — no Obsidian, no external tools.
Hub Path
The hub defaults to
~/wiki/. If ~/wiki/ exists and is initialized (has _index.md), it is used directly — no config file needed. This is the simplest, most reliable path.
To use a different location (e.g., iCloud Drive) when
~/wiki/ is not set up, create ~/.config/llm-wiki/config.json:
{ "hub_path": "~/Library/Mobile Documents/com~apple~CloudDocs/wiki" }
Resolution: At the start of every operation, resolve HUB by following the protocol in references/hub-resolution.md — check
~/wiki/ first, then fall back to config. This handles tilde expansion, paths with spaces, and iCloud directory names correctly. All references to ~/wiki/ below mean HUB.
Wiki Location
Topic sub-wikis are the default. HUB is a hub — content lives in
HUB/topics/<name>/. Each topic gets isolated indexes, sources, and articles. This keeps queries focused and prevents unrelated topics from polluting each other's search space.
Resolution order:
flag →--local
in current project.wiki/
flag → named wiki from--wiki <name>HUB/wikis.json- Current directory has
→ use it.wiki/ - Otherwise → HUB (the hub)
When a command targets the hub and the hub has no content, suggest creating a topic sub-wiki instead.
See references/wiki-structure.md for the complete directory layout and all file format conventions.
Core Principles
-
Indexes are a derived cache. The
files and their YAML frontmatter are the source of truth..md
files are a cached view rebuilt on read when stale. Always read indexes first for navigation — but before trusting one, stale-check it (file count vs row count). See references/indexing.md for the Derived Index Protocol._index.md -
Raw is immutable. Once ingested into
, sources are never modified. They are a record of what was ingested and when. All synthesis happens inraw/
.wiki/ -
Articles are synthesized, not copied. A wiki article draws from multiple sources, contextualizes, and connects to other concepts. Think textbook, not clipboard.
-
Dual-linking for Obsidian + Claude. Cross-references use both
(for Obsidian graph view) and standard markdown[[wikilink]]
(for Claude navigation) on the same line:[text](path)
. Bidirectional when it makes sense.[[slug|Name]] ([Name](../category/slug.md)) -
Frontmatter is structured data. Every
file has YAML frontmatter with title, summary, tags, dates. This makes the wiki searchable without full-text scans..md -
Incremental over wholesale. Compilation processes only new sources by default. Full recompilation is expensive and explicit (
).--full -
Honest gaps. When answering questions, if the wiki doesn't have the answer, say so. Never hallucinate. Suggest what to ingest to fill the gap.
-
Multi-wiki awareness. When querying, answer from the primary wiki first. Then peek at sibling wiki indexes (via
) for relevant overlap. Flag connections but never merge content across wikis.HUB/wikis.json
Ambient Behavior
When this skill activates outside of an explicit
/wiki:* command:
- Resolve the hub path (see Hub Path section above), then check if
orHUB/_index.md
exists.wiki/_index.md - Read the master
to assess if the wiki might cover the user's question_index.md - If relevant content exists → read the relevant articles and answer with citations
- If no relevant content → answer normally, optionally suggest: "This could be added to your wiki with
"/wiki:ingest - When peeking at sibling wikis, only read their
— do not read full articles unless the user asks_index.md
Workflows
Ingestion
See references/ingestion.md. Flow: Source (URL/file/text/tweet/inbox) → fetch/read → extract metadata → write to
raw/{type}/ → update indexes → suggest compile if many uncompiled.
Compilation
See references/compilation.md. Flow: Survey uncompiled sources → plan articles → classify (concept/topic/reference) → write/update articles with cross-references → update all indexes.
Query
Flow: Read
_index.md → identify relevant articles by summary/tag → read articles → follow See Also links → Grep for additional matches → synthesize answer with citations → note gaps → peek sibling wikis. Supports --resume to reload context after a session break — reads session files, recent log entries, wiki stats, and last-updated articles to produce a "where you left off" briefing.
Linting
See references/linting.md. Flow: Check structure → indexes → links → content → coverage → report → optionally auto-fix.
Search
Flow: Scan indexes for summary/tag matches → Grep full-text → rank results → present.
Output
Flow: Gather relevant articles → generate artifact (summary/report/slides/etc) → save to
output/ → update indexes.
Links: File Paths and URLs
Terminal links break when they wrap to a second line. Rules for all wiki operations:
- Full absolute paths — expand
, HUB, and all relative segments. Relative paths are not clickable.~ - Markdown link syntax for URLs — use
, never bare long URLs that wrap and break.[short text](url) - No indentation before links — indentation eats terminal width. Put links flush-left on their own line.
- One link per line — don't embed a long path mid-sentence. Break it out:
Saved to: /Users/name/wiki/topics/my-topic/output/report-2026-04-08.md
See
references/research-infrastructure.md § Agent Prompt Templates for examples. Applies to ingest, compile, research, output, assess.
Activity Log
Every wiki operation appends to
log.md in the wiki root. Format: ## [YYYY-MM-DD] operation | Description. See references/wiki-structure.md for full format. Never edit or delete existing log entries — append only.
Confidence Scoring
Wiki articles include a
confidence field in frontmatter: high, medium, or low.
- high: Multiple peer-reviewed sources agree, well-established knowledge
- medium: Single source, or sources partially agree, or recent findings not yet replicated
- low: Anecdotal, single non-peer-reviewed source, or sources disagree
When answering queries, note confidence levels. When linting, flag
low confidence articles for review.
Compilation Nudge
Track uncompiled sources by comparing
raw/_index.md ingestion dates against the last compile date in _index.md. If 5+ uncompiled sources exist after an ingestion, suggest: "You have N uncompiled sources. Run /wiki:compile to integrate them."
Structural Guardian
Automatically run a quick structural check when any of these triggers occur:
Triggers
- After any write operation (ingest, compile, research, output) — verify what was just written
- When the skill activates and the wiki hasn't been linted in 7+ days (check "Last lint" in
)_index.md - When content is found in the wrong place — articles in the global hub instead of a topic sub-wiki
- When a user mentions wiki problems — "wiki is broken", "empty", "missing", "wrong"
- When no wiki exists (first-run) — switch to guided onboarding flow instead of showing a command list. Walk the user through topic selection → init → first action suggestion. See
§ "If no wiki exists".commands/wiki.md
Quick Structure Check (lightweight, runs inline — not a full lint)
-
Hub integrity: The hub (HUB) should ONLY contain
,wikis.json
,_index.md
, andlog.md
. Iftopics/
,raw/
,wiki/
,output/
, orinbox/
exist at the hub level → warn, do not delete. These may hold user data from an older wiki layout. Suggestconfig.md
, which will move contents to the appropriate topic wiki or quarantine to/wiki:lint --fix
per C11/C12 ininbox/.unknown/
.references/linting.md -
Index freshness: For the active topic wiki, compare actual file count in
,wiki/concepts/
,wiki/topics/
against the rows in theirwiki/references/
. If mismatched → auto-fix by adding missing entries or removing dead ones._index.md -
Orphan detection: Check if any
files exist in wiki directories but are not listed in any.md
. If found → add them to the index._index.md -
Missing directories: Verify all expected subdirectories exist in the topic wiki (
,raw/articles/
, etc.). If missing → create them with emptyraw/papers/
._index.md -
wikis.json sync: Check that all topic sub-wikis under
are registered inHUB/topics/
. If a directory exists but isn't registered → add it. If registered but directory is missing → remove the entry.wikis.json -
Log existence: Verify
exists in the active wiki and at the hub. If missing → create it.log.md
Behavior
- Silent when clean — don't report anything if everything checks out
- Auto-fix trivial issues — missing indexes, unregistered wikis, orphan files. Just fix and note in log.
- Warn on structural problems — content in wrong place, missing directories, stale indexes. Tell the user what's wrong and suggest
./wiki:lint --fix - Never block the user's request — run the check, fix what you can, report issues, then continue with what the user actually asked for.
Concurrency
Multiple Claude Code sessions can safely read and write to the same wiki simultaneously. No locks are needed.
- Indexes are derived from the actual files on disk. If two sessions write articles at the same time, the next read rebuilds the index from whatever files exist. Both rebuilds converge to the same correct result.
- log.md is append-only with small atomic writes. Concurrent appends are safe.
- Article/source files are written independently. Two sessions creating different files never conflict. Two sessions editing the same file is unlikely and handled by last-write-wins (acceptable for a wiki — the content is always rebuildable from raw sources).
See references/indexing.md for the Derived Index Protocol.
Session Management
Research Session Registry
When a
--min-time research or thesis session is active, the wiki root contains a .research-session.json or .thesis-session.json file.
Structural Guardian behavior:
- If a session file exists with
andstatus: "in_progress"
> 7 days ago → warn: "Stale research session found. Clean up withstart_time
or delete manually."/wiki:research - Session files are ephemeral — never included in structural health checks or index counts
- Session files should NOT be committed to git