/prime:wiki-knowledge-basefrom prime
Build and maintain LLM-powered topic wikis. Usage: /wiki-knowledge-base <init|ingest|query|lint|status> <topic> [-- <text>]
Ships in prime. Installing the plugin adds it to Claude Code.
Build persistent, interlinked knowledge bases using LLMs — for research, competitive analysis, domain deep-dives, or any topic where knowledge accumulates over time.
Attribution: This skill implements the "LLM Wiki" pattern described by Andrej Karpathy in his idea file (April 2026). The pattern — persistent wiki over RAG, three-layer architecture (raw sources / wiki / schema), ingest/query/lint operations — is his design. This implementation adapts it for the claude-agents toolkit with integrated context loading, agent workflows, and project knowledge base interop.
Three layers per wiki:
.claude/wikis/{topic}/
├── raw/ ← Immutable source documents (articles, papers, data)
│ └── assets/ ← Downloaded images, PDFs
├── wiki/ ← LLM-generated, interlinked markdown pages
│ ├── index.md ← Content catalog: every page with link + one-line summary
│ ├── log.md ← Append-only chronological record of operations
│ └── pages/ ← Entity pages, concept pages, summaries, comparisons
└── schema.md ← Conventions, page types, workflows for this wiki
Raw sources: Your curated collection. The LLM reads but never modifies these. The wiki: LLM-generated and LLM-maintained. You read it; the LLM writes it. The schema: Co-evolved by you and the LLM as you figure out what works.
This skill follows the context loading protocol defined in
context-loading.md. When other skills (/planning,
/fix, /implement) discover topic wikis, they use the same protocol:
wiki/index.md (~2-3KB catalog)| Input | Action |
|---|---|
/wiki-knowledge-base init video-research | Scaffold new wiki |
/wiki-knowledge-base fetch video-research -- https://docs.livekit.io/agents | Fetch URL via Chrome browser, save to raw/ |
/wiki-knowledge-base ingest video-research | Process new raw sources into wiki |
/wiki-knowledge-base query video-research -- compare vendor latency | Search wiki, synthesize answer |
/wiki-knowledge-base lint video-research | Health-check the wiki |
/wiki-knowledge-base status | List all wikis with stats |
/wiki-knowledge-base status video-research | Stats for one wiki |
init <topic>Scaffold a new wiki. Creates the directory structure and generates an initial schema.
Steps:
Validate topic name (kebab-case, no spaces):
mkdir -p .claude/wikis/{topic}/raw/assets
mkdir -p .claude/wikis/{topic}/wiki/pages
Ask the user with AskUserQuestion:
"Describe this wiki's focus in 1-2 sentences — what domain, what questions should it answer?"
Store response as WIKI_FOCUS.
Generate .claude/wikis/{topic}/schema.md:
# Schema: {topic}
> Auto-generated by /wiki-knowledge-base init. Co-evolve this with your LLM.
## Focus
{WIKI_FOCUS}
## Page Types
| Type | Naming | Purpose |
|------|--------|---------|
| Entity | `entities/{name}.md` | A specific thing: company, product, person, API |
| Concept | `concepts/{name}.md` | An idea, technique, or principle |
| Summary | `summaries/{source-slug}.md` | Digest of a single raw source |
| Comparison | `comparisons/{a}-vs-{b}.md` | Structured comparison of entities/concepts |
| Synthesis | `synthesis/{topic}.md` | Cross-source analysis on a theme |
## Conventions
- All wiki pages use markdown with YAML frontmatter
- Frontmatter must include: `type`, `created`, `updated`, `sources` (list)
- Cross-references use standard markdown links: `[Display](../entities/name.md)`
- Every page must be reachable from index.md
- One-line summary required in index.md for every page
## Workflows
### Ingest
1. Read raw source
2. Discuss key takeaways with user
3. Write summary page in wiki/pages/summaries/
4. Create or update entity pages for key actors/products/tools
5. Create or update concept pages for key ideas
6. Update cross-references across affected pages
7. Update wiki/index.md with new/changed pages
8. Append entry to wiki/log.md
### Query
1. Read wiki/index.md to find relevant pages
2. Read relevant pages
3. Synthesize answer with citations to wiki pages
4. If answer is valuable, offer to file as new wiki page
### Lint
Check for: contradictions between pages, stale claims, orphan pages
(no inbound links), missing entity/concept pages for frequently
mentioned terms, missing cross-references, data gaps.
Generate .claude/wikis/{topic}/wiki/index.md:
# {Topic} Wiki — Index
> Last updated: {ISO date}
> Sources ingested: 0
> Total pages: 0
## Pages
_No pages yet. Run `/wiki-knowledge-base ingest {topic}` after adding sources to `raw/`._
Generate .claude/wikis/{topic}/wiki/log.md:
# {Topic} Wiki — Log
## [{ISO date}] init | Wiki created
Focus: {WIKI_FOCUS}
Report to user:
Wiki initialized: .claude/wikis/{topic}/
Next steps:
1. Add source documents to .claude/wikis/{topic}/raw/
(markdown, text, PDF — use Obsidian Web Clipper for articles)
2. Run /wiki-knowledge-base ingest {topic} to process them
fetch <topic> -- <url> [url2] [url3] ...Fetch web pages via Chrome browser and save as raw sources. Bypasses bot protection
(Cloudflare, etc.) that blocks WebFetch. Use this for vendor documentation, blog
posts, competitor pages, or any URL that returns 403 to automated requests.
Requires: mcp__claude-in-chrome__* MCP tools (Chrome browser extension).
Steps:
Validate wiki exists:
ls .claude/wikis/{topic}/raw/
If not found, tell user to run init first.
For each URL provided:
a. Load the Chrome tab tools:
ToolSearch("select:mcp__claude-in-chrome__tabs_create_mcp")
ToolSearch("select:mcp__claude-in-chrome__get_page_text")
b. Create a new Chrome tab and navigate to the URL:
mcp__claude-in-chrome__tabs_create_mcp(url="{url}")
c. Wait for page load, then extract full page text:
mcp__claude-in-chrome__get_page_text(tabId={id})
d. If the page has multiple sections/tabs (common in API docs), use
mcp__claude-in-chrome__find or mcp__claude-in-chrome__navigate to
explore sub-pages and concatenate content.
e. Generate a slug from the URL domain + path:
https://docs.livekit.io/agents/overview → livekit-agents-overviewhttps://developers.deepgram.com/docs/streaming → deepgram-streamingf. Write the content as markdown to raw/:
Write(.claude/wikis/{topic}/raw/{slug}.md)
Include a source header:
# {Page Title}
**Source:** {url}
**Fetched:** {ISO date}
---
{extracted content, converted to clean markdown}
For multi-page docs (e.g., "fetch the LiveKit Agents SDK docs"):
If the user provides a docs root URL rather than a specific page, navigate to the root, identify the key sub-pages from the sidebar/nav, and fetch the most important 3-5 pages. Don't crawl the entire site — focus on:
Append to log.md:
## [{ISO date}] fetch | {N} URLs fetched for {topic}
URLs: {list}
Files created: {list}
Report to user:
Fetched {N} pages → .claude/wikis/{topic}/raw/
Files: {list with sizes}
Run /wiki-knowledge-base ingest {topic} to process into wiki pages.
Fallback: If Chrome tools are not available (MCP server not connected), fall
back to WebFetch. If that also fails (403), tell the user to:
.claude/wikis/{topic}/raw/ingest <topic>Process new raw sources into wiki pages. This is the core operation — a single source may create or update 10-15 wiki pages.
Steps:
Load wiki context:
# Read schema for conventions
cat .claude/wikis/{topic}/schema.md
# Read current index for existing pages
cat .claude/wikis/{topic}/wiki/index.md
# Read log for recent activity
tail -20 .claude/wikis/{topic}/wiki/log.md
Find unprocessed sources:
# List all raw sources
ls -1 .claude/wikis/{topic}/raw/ | grep -v assets/
# Check log for already-ingested sources
grep "ingest |" .claude/wikis/{topic}/wiki/log.md
Compare the two lists. Present unprocessed sources to user. If none found:
"No new sources found in
.claude/wikis/{topic}/raw/. Add documents there first."
For each unprocessed source (process one at a time unless user requests batch):
a. Read the source document fully.
b. Discuss with user — present 3-5 key takeaways and ask:
"Key takeaways from {source}:
- {takeaway}
- {takeaway} ... Anything to emphasize or correct before I update the wiki?"
c. Write summary page: Create wiki/pages/summaries/{source-slug}.md with frontmatter:
---
type: summary
source: raw/{filename}
created: {ISO date}
updated: {ISO date}
sources: ["{filename}"]
---
d. Update entity pages: For each entity (company, product, person, API, tool) mentioned in the source:
updated date
and sources listwiki/pages/entities/e. Update concept pages: For each concept (technique, pattern, principle, technology) mentioned:
f. Update cross-references: Scan all affected pages for missing links between related entities/concepts. Add links where relationships exist.
g. Update index.md: Add/update entries for all new/changed pages. Each entry:
- [Page Title](pages/{type}/{slug}.md) — {one-line summary} ({N} sources)
h. Append to log.md:
## [{ISO date}] ingest | {Source Title}
Pages created: {list}
Pages updated: {list}
Key entities: {list}
Key concepts: {list}
Report to user:
Ingested: {source title}
Created: {N} new pages ({list names})
Updated: {N} existing pages ({list names})
Wiki now has {total} pages from {total} sources.
query <topic> -- <question>Search the wiki and synthesize an answer. Good answers can be filed back into the wiki as new pages.
Steps:
Load wiki index (Tier 1 — always small):
cat .claude/wikis/{topic}/wiki/index.md
Find relevant pages — grep the index for keywords from the question. Also grep page files directly for deeper matches:
grep -rli "{keywords}" .claude/wikis/{topic}/wiki/pages/
Read relevant pages (Tier 2 — selective, typically 3-8 pages).
Synthesize answer with citations. Answers can take different forms depending on the question:
## Answer: {question}
{Synthesized answer referencing wiki pages}
**Sources**: [Entity A](pages/entities/a.md), [Concept B](pages/concepts/b.md)
Offer to file back: If the answer contains novel synthesis (comparison, analysis, connection), ask:
"This answer synthesizes across {N} wiki pages. File it as a new wiki page? Suggested:
wiki/pages/{type}/{slug}.md"
If user agrees, write the page, update index.md, append to log.md.
Append to log.md:
## [{ISO date}] query | {question summary}
Pages consulted: {list}
Filed as page: {path or "no"}
lint <topic>Health-check the wiki. Find problems and suggest improvements.
Steps:
Read all page filenames and index.md.
Check for issues (spawn explore-light on haiku for large wikis > 20 pages):
| Check | How | Severity |
|---|---|---|
| Orphan pages | Pages not in index.md or not linked from any other page | MEDIUM |
| Missing pages | Terms frequently mentioned but lacking their own page | LOW |
| Stale sources | Source updated date > 90 days old | LOW |
| Contradictions | Conflicting claims across pages (LLM judgment) | HIGH |
| Dead links | Links pointing to non-existent pages | HIGH |
| Missing cross-refs | Related entities/concepts not linked | LOW |
| Empty sections | Pages with placeholder content never filled | MEDIUM |
| Index drift | Pages on disk not reflected in index.md | HIGH |
For large wikis (> 20 pages), use explore-light (model: haiku) subagent:
subagent_type: "explore-light"
model: haiku
prompt: "Scan all pages in .claude/wikis/{topic}/wiki/pages/ and check for:
1. Pages not listed in index.md
2. Broken markdown links
3. Pages with no inbound links from other pages
Return a structured list of issues found."
This keeps the lint cost at ~1x Haiku regardless of wiki size.
Report:
## Wiki Health: {topic}
| Metric | Value |
|--------|-------|
| Total pages | {N} |
| Sources ingested | {N} |
| Last ingest | {date} |
| Issues found | {N} |
### Issues
**HIGH**
- {issue description} → {suggested fix}
**MEDIUM**
- {issue description} → {suggested fix}
**LOW**
- {issue description} → {suggested fix}
### Suggested Next Steps
- {New sources to look for based on gaps}
- {Questions to investigate based on contradictions}
- {Pages to create for missing concepts}
Append to log.md:
## [{ISO date}] lint | Health check
Issues found: {N high}, {N medium}, {N low}
status [topic]Show wiki statistics.
If no topic provided — list all wikis:
ls -d .claude/wikis/*/wiki/index.md 2>/dev/null
Display dashboard:
# Topic Wikis
| Wiki | Pages | Sources | Last Updated | Focus |
|------|-------|---------|--------------|-------|
| {name} | {N} | {N} | {date} | {first line of schema focus} |
If topic provided — show detail for one wiki:
Read index.md and log.md, display:
# Wiki: {topic}
**Focus**: {from schema.md}
**Pages**: {N} ({N} entities, {N} concepts, {N} summaries, {N} comparisons, {N} synthesis)
**Sources**: {N} ingested
**Last activity**: {from log.md}
## Recent Activity (last 5)
{from log.md}
## Page Breakdown
{from index.md, grouped by type}
Topic wikis are automatically discovered by other skills during their context loading phase. See context-loading.md for the full protocol.
| Skill | When | What it reads |
|---|---|---|
/planning | Shared context block (Step 6) | Wiki index → grep for feature keywords → read matching pages |
/fix | Bug context (Step 0) | Wiki index → grep for affected area → read matching pages |
/implement | Domain context (Step 1) | Wiki index → grep for task keywords → read matching pages |
/review-pr | Review context (Step 1b) | Wiki index → grep for changed file domains → read matching pages |
When skills discover domain insights from wiki pages during their work:
.claude/knowledge/shared/domain.md (existing pattern).claude/knowledge/shared/decisions.md| Operation | Model | Rationale |
|---|---|---|
fetch (Chrome browser) | Inherited (parent session) | Needs MCP tools, minimal LLM work |
ingest (read + write pages) | Inherited (parent session) | Synthesis quality matters |
query (search + synthesize) | Inherited (parent session) | Answer quality matters |
lint (scan for issues) | explore-light / haiku | Mechanical checking, 60x cheaper |
status (read metadata) | Inherited (parent session) | Trivial, no subagent needed |
| Wiki search by other skills | explore-light / haiku | Index scan is mechanical |
/wiki-knowledge-base fetch {topic} -- {url} to grab docs via Chrome — bypasses Cloudflare/bot protection that blocks WebFetch. Best for vendor docs, API references, and protected pages.raw/. Manual alternative to fetch.raw/assets/. The LLM can view them separately for additional context.> /wiki-knowledge-base init stripe-payments
# Describe the focus: "Stripe payment integration — APIs, webhooks, pricing, compliance"
# Fetch vendor docs via Chrome browser (bypasses bot protection)
> /wiki-knowledge-base fetch stripe-payments -- https://docs.stripe.com/payments https://docs.stripe.com/webhooks
# Opens each URL in Chrome, extracts content, saves to raw/
# Or manually add sources: copy markdown articles, API docs into raw/
> /wiki-knowledge-base ingest stripe-payments
# LLM reads each source, discusses key takeaways, builds wiki pages
# Drop a new article into raw/ (e.g. via Obsidian Web Clipper)
> /wiki-knowledge-base ingest stripe-payments
# Answer: "1 new source found. Key takeaways: ..."
# Ask a question that synthesizes across your research
> /wiki-knowledge-base query stripe-payments -- "what's the total cost per transaction including fees?"
# Answer synthesized from vendor pages, filed back as wiki/pages/comparisons/cost-per-transaction.md
# Weekly: health-check
> /wiki-knowledge-base lint stripe-payments
# "2 HIGH: dead links. 3 LOW: missing cross-refs. Stripe pricing page is 60 days stale."
The wiki is automatically picked up by the development workflow — no extra steps:
# Planning reads the wiki for domain context
> /planning stripe-checkout -- "Add Stripe checkout for team billing"
# PM references wiki's cost-per-transaction page
# Architect cites webhook reliability data from wiki
# Bug fix searches the wiki for domain knowledge
> /fix "webhook signature verification failing"
# Finds wiki/pages/entities/stripe-webhooks.md with known signature gotchas
# Implementation agents get wiki context injected
> /implement stripe-checkout
# Backend agent knows Stripe's idempotency key requirements from wiki
/wiki-knowledge-base init video-avatar-apis
# Add: D-ID docs, HeyGen pricing, Tavus API reference, WebRTC articles
/wiki-knowledge-base ingest video-avatar-apis
/wiki-knowledge-base query video-avatar-apis -- "compare latency and cost across all vendors"
# → creates wiki/pages/comparisons/vendor-matrix.md
/planning video-avatar -- "AI avatar for mock interviews"
# Planning team has full vendor research available
/wiki-knowledge-base init competitor-landscape
# Add: competitor product pages, G2 reviews, Crunchbase profiles, industry reports
/wiki-knowledge-base ingest competitor-landscape
/wiki-knowledge-base query competitor-landscape -- "where are competitors weak on AI features?"
/wiki-knowledge-base lint competitor-landscape
# "Competitor X page hasn't been updated in 90 days — refresh recommended"
/wiki-knowledge-base init healthcare-compliance
# Add: HIPAA guidelines, audit requirements, BAA templates, past audit findings
/wiki-knowledge-base ingest healthcare-compliance
# Now every /fix, /review-pr, and /planning run can check compliance context
/fix "PHI data showing in logs"
# Finds wiki/pages/concepts/phi-handling.md with logging restrictions
/wiki-knowledge-base init designing-data-intensive-apps
# Add each chapter as a markdown file to raw/
/wiki-knowledge-base ingest designing-data-intensive-apps
# Wiki builds: entity pages (LSM trees, SSTables), concept pages (consistency models),
# summaries per chapter, cross-references between related concepts
/wiki-knowledge-base query designing-data-intensive-apps -- "compare all replication strategies"
After init or ingest operations (heavy agent work), print this block verbatim.
Skip for query, lint, and status (lightweight reads).
─────────────────────────────────────────────
💡 Context tip — wiki init/ingest spawns research agents and generates many
interlinked pages. All output is written to .claude/wikis/{topic}/
The session context is dead weight once the wiki is built.
Init or ingest complete?
/clear — the wiki is in files. Every future skill reads it automatically
via the context-loading protocol (Tier 2 wiki discovery).
Brief for next session: "Wiki '{topic}' is ready. Use it for {next task}."
Ingesting multiple topics back-to-back?
New session per topic. Research context from topic 1 contaminates topic 2.
Query after ingest in same session?
/compact focus on {topic} wiki — ingest complete, ready to query
(Keeps topic context alive without the full ingest load.)
─────────────────────────────────────────────
What the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
53 commands in this plugin
/adapters:READMEDiagram AdaptersThis directory contains push adapters for `/kb-diagram --push <adapter>`./arth-helpAnswer questions about installing, using, trusting and removing Arth, from the docs bundled with the plugin only — cites the page, says when the docs do not cover it, and makes no network call. Usage: /arth-help <question>/arth-setupSet up Arth in one command. Open edition: Arth Intelligence (/otel-setup, local Docker) plus Arth Decisions (off by default); memory and model routing are built in. `/arth-setup local` does the whole local setup with defaults and no questions. Pro edition adds memory (/memory-setup), router (/router-setup) and the Central posture. Also handles `switch <local|cloud|off>` (plus `switch <shadow|enforce> decisions`) and `uninstall`. Usage: /arth-setup, /arth-setup local, /arth-setup switch <local|cloud|off> <product|all>, /arth-setup switch <off|shadow|enforce> decisions, /arth-setup uninstall <product|all> --purge-data/autopilotAutonomous work loop — picks up issues, implements, QAs, PRs. Stops for merge approval. Flags: <--dry-run> <--urgent-first|--least-first> <--decisions off|shadow|enforce>/brainstormGrounded thinking partner. Turn a vague thought, question, or 'help me understand this' into clarity — answers anchored in this repo's calibrated knowledge base and the org's memory (arth-memory). Asks the right clarifying questions, labels repo / org / generic advice, and steers you to the right toolkit skill (/planning, /fix, /explore, etc.) when intent crystallizes. Usage: /brainstorm <thought | question>/calibrateDeep-learn a project and configure the full toolkit — scans code patterns, recommends MCP servers/agents/skills/workflows, installs everything. The single entry point for project adaptation. Usage: /calibrate <full|rescan|recommend|status|best-practices>npx claudepluginhub arthtech-ai/sarathi --plugin prime2 plugins in one repository ship this exact command · first indexed Dec 1, 2026