3.4 KiB
3.4 KiB
Phase: Setup — Create a New Wiki Vault
Run when user says "set up a wiki about X", "create a knowledge base for X", "build a second brain".
Step 1 — Determine topic and location
Ask: "What topic is this wiki for? And where should I create it? (default: ~/wikis/<topic-slug>)"
Slugify the topic: lowercase, spaces → hyphens, remove special chars.
Example: "AI Research" → ai-research
Step 2 — Scaffold vault structure
TOPIC_SLUG="<slug>"
VAULT="$HOME/wikis/$TOPIC_SLUG"
mkdir -p "$VAULT"/{raw/assets,wiki/{sources,concepts,entities,queries},tools}
cd "$VAULT"
git init
printf ".obsidian/workspace.json\n.obsidian/workspace\n.DS_Store\n.firecrawl/\n" > .gitignore
Step 3 — Write CLAUDE.md
Fill in the template at ../templates/CLAUDE.md.template with:
{{TOPIC}}→ the wiki's subject (e.g. "AI Research"){{VAULT_PATH}}→ absolute path to vault{{DATE}}→ today's date YYYY-MM-DD
Write to $VAULT/CLAUDE.md.
Step 4 — Write initial wiki files
Write these files using the templates (fill in topic/date):
$VAULT/wiki/index.md— from../templates/index.md.template$VAULT/wiki/log.md— from../templates/log.md.template$VAULT/wiki/overview.md— from../templates/overview.md.template
Step 5 — Write search tool
Write $VAULT/tools/search.sh from ../scripts/search.sh.
Make it executable: chmod +x "$VAULT/tools/search.sh"
Step 6 — Initial git commit
cd "$VAULT"
git add CLAUDE.md wiki/ tools/ .gitignore
git commit -m "init: scaffold wiki vault for $TOPIC_SLUG"
Step 7 — Open in Obsidian
obsidian "$VAULT"
If obsidian CLI isn't available:
open -a Obsidian "$VAULT"
Step 8 — Tell the user what to do next
Output this message:
Wiki vault created at: ~/wikis/<topic>/
Next steps:
1. Obsidian is opening your vault — explore the graph view
2. Drop source files into raw/ (articles, PDFs, transcripts)
3. Say "ingest raw/<filename>" to process any source
4. Or say "ingest https://..." to scrape + ingest a URL directly
Recommended Obsidian plugins to install:
- Obsidian Web Clipper (browser extension) — clip articles directly to raw/
- Dataview — query page frontmatter as a database
- Marp — generate slide decks from wiki content
Your CLAUDE.md schema is at: ~/wikis/<topic>/CLAUDE.md
Edit it anytime to change how Claude maintains this wiki.
Vault Structure Reference
~/wikis/<topic>/
├── CLAUDE.md ← schema: how Claude maintains this wiki
├── .gitignore
├── raw/ ← immutable sources (YOU manage, Claude reads)
│ ├── assets/ ← downloaded images
│ └── *.md / *.pdf / *.txt ← your source documents
├── wiki/ ← Claude-maintained markdown
│ ├── index.md ← catalog of ALL wiki pages (Claude updates)
│ ├── log.md ← append-only operation log (Claude appends)
│ ├── overview.md ← high-level synthesis (Claude maintains)
│ ├── sources/ ← one summary page per ingested source
│ ├── concepts/ ← concept pages (ideas, techniques, theories)
│ ├── entities/ ← entity pages (people, orgs, products, places)
│ └── queries/ ← saved query answers
└── tools/
└── search.sh ← grep-based search helper