From llm-wiki-agent
Initialize a knowledge base in the current project. Creates raw/, wiki/, wiki-schema.md, and extraction tools.
How this command is triggered — by the user, by Claude, or both
Slash command
/llm-wiki-agent:wiki-initThis command is limited to the following tools:
The summary Claude sees in its command listing — used to decide when to auto-load this command
# Initialize Knowledge Base
Set up a knowledge base in the current project so Claude can ingest source files and maintain a compiled wiki.
## Step 1: Check for Existing KB
Check if `raw/` already exists in the project root.
- If it exists, tell the user: "A knowledge base already exists in this project. Existing data will not be overwritten. Proceeding to verify structure."
- If it does not exist, proceed normally.
## Step 2: Create Directory Structure
## Step 3: Initialize State Files
Create `raw/.manifest.json` with content `{}` (only if it doesn't already exist).
Create `wiki/i...Set up a knowledge base in the current project so Claude can ingest source files and maintain a compiled wiki.
Check if raw/ already exists in the project root.
mkdir -p raw/.extracted
mkdir -p wiki/sources wiki/entities wiki/concepts wiki/comparisons
mkdir -p tools
Create raw/.manifest.json with content {} (only if it doesn't already exist).
Create wiki/index.md with this content (only if it doesn't already exist):
# Wiki Index
Updated: (not yet populated) | Total: 0 pages
## Sources (0)
## Entities (0)
## Concepts (0)
## Comparisons (0)
Create HANDOFF.md (only if it doesn't already exist) by copying the template at ${CLAUDE_PLUGIN_ROOT}/templates/handoff.md. Read it and write it to ./HANDOFF.md.
Copy the wiki schema template into the project root as wiki-schema.md (only if it doesn't already exist).
The template is at ${CLAUDE_PLUGIN_ROOT}/templates/wiki-schema.md. Read it and write it to ./wiki-schema.md.
Tell the user: "Edit wiki-schema.md to describe your domain. A good domain description dramatically improves compilation quality."
Copy these files from the plugin into the project's tools/ directory:
${CLAUDE_PLUGIN_ROOT}/tools/extract-pdf.py → ./tools/extract-pdf.py${CLAUDE_PLUGIN_ROOT}/tools/extract-repo.sh → ./tools/extract-repo.shMake them executable:
chmod +x tools/extract-pdf.py tools/extract-repo.sh
Append these lines to .gitignore if they are not already present:
# Knowledge base — extracted files (regenerated from raw sources)
raw/.extracted/
# Knowledge base — binary source files (avoid bloating git history)
raw/*.pdf
raw/*.epub
raw/*.docx
raw/*.xlsx
raw/*.pptx
Run these checks and report results:
python3 -c "import pymupdf4llm; print('pymupdf4llm: OK')" 2>/dev/null || echo "pymupdf4llm: MISSING — run: pip3 install --user pymupdf4llm"
command -v repomix &>/dev/null && echo "repomix: OK" || echo "repomix: MISSING — run: npm install -g repomix (or npx will be used as fallback)"
Summarize what was created and give next steps:
Knowledge base initialized:
raw/ — drop source files here (PDF, markdown, text)
wiki/ — compiled wiki pages (managed by agent)
wiki-schema.md — domain rules (customize this!)
tools/ — extraction scripts
HANDOFF.md — session persistence
Next steps:
1. Edit wiki-schema.md to describe your domain
2. Drop files into raw/
3. Start a new session or say "compile the new files"
If any dependencies are missing, list them with install commands.
npx claudepluginhub gal-tab/agent_knowledgebase --plugin llm-wiki-agent/wiki-initInteractively sets up a knowledge base wiki: checks existing config, auto-detects markdown directories, prompts for name/sources/output, creates .wiki-compiler.json and output structure.