Install
openclaw skills install @nemo4110/041-llm-wikiUse when an AI Agent (Claude Code, Codex, OpenClaw, or similar) needs to operate an llm-wiki knowledge base: ingest source files into Markdown wiki pages, answer questions from wiki/index.md and linked pages, run agent-bridge status/lint/link/relink/merge/query/index/Zotero relocation tasks, preserv
openclaw skills install @nemo4110/041-llm-wikiTreat the LLM as the programmer and the wiki as the codebase. The user provides materials and judgment; the Agent extracts durable knowledge, preserves provenance, maintains links, and keeps the Markdown wiki structurally consistent.
Keep this file as the operational skill. Use README.md for user-facing overview, AGENTS.md / CLAUDE.md for the full protocol, and ROADMAP.md for project plans.
AGENTS.md or CLAUDE.md when the task touches wiki behavior, source handling, or ingest/query protocol..venv\Scripts\python.exe on Windows, .venv/bin/python on Unix, or uv run python when configured.<PY> scripts/agent-bridge.py check before wiki operations. If it reports missing dependencies, state the exact blocker and continue only with tasks that do not require the unavailable runtime.sources/: never write Agent-generated summaries, drafts, or speculative content there. Only user-provided files or verified network fetches or Zotero MCP material may be source assets.git status --short before editing. Do not revert user changes.wiki/* is gitignored by default; when using ripgrep for wiki/source discovery, pass --no-ignore or read the files directly so ignored knowledge pages are not silently omitted.| Task | Use | Notes |
|---|---|---|
| Status, lint, link discovery, relink, merge, semantic query, embedding index, Zotero sync planning | scripts/agent-bridge.py | Algorithmic/read-only tasks. Prefer dry-run before writing. |
| Ingest source material | Protocol mode | Requires LLM judgment: read source, extract metadata, create/update pages. |
| Answer wiki questions | Protocol mode | Read wiki/index.md, relevant pages, and link neighbors; synthesize with [[PageName]] citations. |
| Apply relation updates | Hybrid | Let agent-bridge.py discover candidates, then review and merge only safe changes. |
| Plan/apply Zotero attachment relocation | Hybrid | Use zotero-relocate; review dry-run, require local authorization for apply, and never bypass the Phase 0/API gate. Read the managed root from config.yaml zotero_relocation.root (prefer a cloud-synced path for cross-device use); --root is only a one-off override. |
Agent Bridge quick commands:
<PY> scripts/agent-bridge.py check
<PY> scripts/agent-bridge.py status
<PY> scripts/agent-bridge.py lint
<PY> scripts/agent-bridge.py link --source "PageName" --mode light
<PY> scripts/agent-bridge.py merge --source "NewPage" --target "OldPage" --strategy append_related --dry-run
<PY> scripts/agent-bridge.py relink --since 2026-04-20 --mode deep --dry-run
<PY> scripts/agent-bridge.py index
<PY> scripts/agent-bridge.py query "question" --semantic
<PY> scripts/agent-bridge.py zotero-plan --snapshot temp/zotero-snapshot.yaml --manifest-out temp/zotero-mutation-manifest.yaml
<PY> scripts/agent-bridge.py zotero-refresh --collection-key A9VNJUPI --manifest-out temp/zotero-refresh.yaml
<PY> scripts/agent-bridge.py zotero-ingest-verify --snapshot temp/zotero-snapshot.yaml --allocation temp/zotero-allocation.yaml --report-out temp/zotero-ingest-report.yaml
<PY> scripts/agent-bridge.py zotero-heal --snapshot temp/zotero-snapshot.yaml --manifest-out temp/zotero-heal.yaml
<PY> scripts/agent-bridge.py zotero-writeback --plan temp/zotero-write-plan.yaml --action audit --report-out temp/zotero-write-audit.yaml
<PY> scripts/agent-bridge.py zotero-relocate
Use legacy python -m src.llm_wiki ... only for human scripting or debugging. Do not use the legacy CLI as a substitute for LLM judgment during ingest.
agent-bridge.py lint reports Shallow Pages as warning-only findings. The detector excludes related-page, source, and changelog sections, then combines normalized knowledge size, paragraph and section structure, local text-source volume, source count, and compression ratio. QRF is skipped by default; lint_depth: skip is reserved for deliberately concise pages whose source-coverage audit explains the exemption.
A clean depth result is not proof of source coverage. Re-read allocated sources and account for important mechanisms, equations, evidence, comparisons, procedures, failure modes, trade-offs, and decision rules. Never pad a page mechanically to satisfy a threshold.
wiki/index.md and log.md.temp/ and run zotero-ingest-verify before declaring coverage complete. Then run zotero-plan, review managed-tag/relation candidates, and use either Zotero MCP or the explicitly authorized restricted local write-back path; always verify the post-write state.Source maps and coverage notes are temporary Agent working state. Keep them outside sources/; retain them under temp/ only when the user requests an ingest audit or experiment.
Never treat created or updated as publication dates. They are wiki maintenance dates only.
wiki/index.md first.[[PageName]].wiki/*.md stem by the end of ingest.[[AI-Coding-Workflow|AI Coding Workflow]].All Zotero discovery, reads, source access, metadata planning, and normal writes for this skill MUST use the MCP tools provided by 54yyyu/zotero-mcp. Before any Zotero task, read and follow docs/ZOTERO_MCP_INTEGRATION.md, the single operational source of truth for availability gates, read/write workflows, source bindings, provenance, and safety.
The only temporary exceptions are the user-authorized Zotero 10 loopback write paths documented there. zotero-writeback accepts only a reviewed mode: authorized-write plan, adds llm-wiki:* tags, ensures reviewed reciprocal Related pairs, and performs read-after-write verification. zotero-relocate is separately gated and may update only an existing attachment linkMode / path plus private local bindings after filesystem and post-write verification. Neither path may clone/delete items, edit notes, change collections, or perform arbitrary API access. Tag removal is a separate scoped opt-in: only when a plan sets policy.allow_managed_removals: true and lists a tag under an item's reviewed_removals, and even then only managed llm-wiki:* tags other than the protected llm-wiki:ingested status tag and preserved tags (e.g. llm-wiki:index-card) may be removed — never unmanaged/user tags. zotero-plan --removal-plan-out generates such a plan whitelisted to retired llm-wiki:<page_stem> binding tags only. --memory-authorize keeps the local key in process memory only.
Do not substitute another Zotero skill/client or bypass Zotero MCP with direct SQLite/Web API access. If the required MCP or restricted local capability is unavailable, report the blocker, stop Zotero-side work, and continue only with useful wiki-local work.
After any network fetch, verify before ingest:
%PDF.If verification fails, do not create source-derived wiki pages. Record the failure in log.md when appropriate and ask the user for a correct source.
scripts/read_pdf.py; fall back to OCR only when necessary.Prefer the project-managed Python environment: .venv, uv run, or the configured conda environment. Do not use global pip casually.
For documentation-only edits, run:
git diff --check -- <changed-files>
For wiki/runtime operations, also run the relevant agent-bridge.py command (check, lint, link, merge --dry-run, status, or query) and report exact blockers if dependencies are missing.
For code changes, run the focused pytest target or the full suite when the change touches shared behavior:
.venv\Scripts\python.exe -m pytest tests/
End by summarizing changed files, verification output, and any skipped checks with the reason.