obsidian-wiki
by @jayxjw
Build and maintain a personal knowledge Wiki using the LLM Wiki pattern with OpenClaw-optimized step-by-step execution. Use sub-agents for parallel processin...
clawhub install obsidian-wiki-auto๐ About This Skill
name: obsidian-wiki description: Build and maintain a personal knowledge Wiki using the LLM Wiki pattern with OpenClaw-optimized step-by-step execution. Use sub-agents for parallel processing of file operations, content extraction, and wiki maintenance. This skill is designed for OpenClaw environments where file reading may be partial - it uses chunked reading and task delegation to ensure completeness. For PDF/Word conversion, it automatically checks and installs Python and required packages (pypdf, python-docx) if not present.
Obsidian Wiki Builder for OpenClaw
A skill for building and maintaining personal knowledge bases using the LLM Wiki pattern, optimized for OpenClaw with step-by-step execution and sub-agent delegation.
How to use: Send the following command: Set cron to run "obsidian-wiki" from skills.
Initial Setup: The skill will automatically initialize and create a vault named "Obsidian Wiki" in your root directory. Simply open this vault with Obsidian to view your knowledge base.
Workflow: When sending files to OpenClaw, instruct it to save them in the ~/Obsidian Wiki/raw/ directory.
> Note: This skill utilizes parallel task descriptions ("spawn X agent for each file"), which OpenClaw automatically executes as sub-agents. It automatically manages Python environment setup and library installations to handle diverse file formats. This skill is specifically optimized for autonomous execution to align with OpenClaw's native workflow.
The Core Idea
Unlike traditional RAG, the LLM Wiki is a persistent, compounding artifact. When you add a source, the LLM doesn't just index it โ it reads, extracts, and integrates knowledge into the existing wiki.
Key principle: The human curates sources and asks questions; the LLM does all the bookkeeping through delegated sub-agents.
Architecture
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ORCHESTRATOR (Main Claude) โ
โ - Plans and coordinates all operations โ
โ - Spawns sub-agents for parallel work โ
โ - Aggregates results and maintains TaskList โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ SUB-AGENTS โ
โ โโ FileReader โ Reads files in chunks โ
โ โโ CategoryDetector โ Detects file categories โ
โ โโ EntityExtractor โ Extracts entities from content โ
โ โโ ConceptExtractor โ Extracts concepts from content โ
โ โโ PageCreator โ Creates wiki pages โ
โ โโ IndexUpdater โ Updates index.md and log.md โ
โ โโ CrossReferencer โ Creates wiki links โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ THREE-LAYER ARCHITECTURE โ
โ ~/Obsidian Wiki/ โ
โ โโโ CLAUDE.md (Schema) โ
โ โโโ raw/ (Immutable sources) โ
โ โโโ wiki/ (LLM-generated knowledge) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
TaskList-Driven Workflow
Every operation uses a TaskList to track progress. Tasks are executed by sub-agents in parallel where possible.
Task States
pending โ in_progress โ completed/failedblockedBy)Core Operations
1. Initialize Wiki
Create the complete directory structure with TaskList tracking.
Workflow:
TaskList: Initialize Wiki
โโโ [1] Create base directory (~/Obsidian Wiki/)
โโโ [2] Create raw/ folder
โโโ [3] Create wiki/ folder
โโโ [4] Create wiki subdirectories
โ โโโ [4a] wiki/00_Index/
โ โโโ [4b] wiki/10_Sources/
โ โโโ [4c] wiki/20_Entities/
โ โโโ [4d] wiki/30_Concepts/
โ โโโ [4e] wiki/40_Syntheses/
โ โโโ [4f] wiki/99_Attachments/
โโโ [5] Create CLAUDE.md (depends on [1])
โโโ [6] Create index.md (depends on [4a])
โโโ [7] Create log.md (depends on [4a])
Execution: 1. Create TaskList with all tasks 2. Execute independent tasks in parallel (1-3) 3. Execute dependent tasks sequentially (4-7) 4. Report completion status
2. Auto-Organize Raw Files
Scan, categorize, rename, and move files using parallel sub-agents.
Workflow:
Phase 1: Discovery
โโโ Spawn FileScanner agent
โโโ Scan raw/ for unorganized files
โโโ Return: list of files with pathsPhase 2: Categorization (Parallel)
โโโ For each file, spawn CategoryDetector agent
โโโ Analyze filename (priority 1)
โโโ If unclear, read first 500 chars (priority 2)
โโโ Return: detected category + confidence
Phase 3: Organization (Parallel)
โโโ For each categorized file, spawn FileOrganizer agent
โโโ Generate timestamp: YYYYMMDD-HHMMSS
โโโ Create category folder if needed
โโโ Rename: timestamp-original_name.ext
โโโ Move to category folder
โโโ Return: new path + metadata
Phase 4: Ingest (Parallel)
โโโ For each organized file, spawn Ingestor agent
โโโ Read full content (chunked if large)
โโโ Create source summary page
โโโ Extract entities โ create/update entity pages
โโโ Extract concepts โ create/update concept pages
โโโ Return: pages created/updated
Phase 5: Aggregation
โโโ Spawn IndexUpdater agent
โโโ Update index.md with all new/updated pages
โโโ Append entries to log.md
โโโ Return: final summary
TaskList Structure:
TaskList: Auto-Organize Raw Files
โโโ Phase 1: Discovery
โ โโโ [1] Scan raw directory
โโโ Phase 2: Categorization
โ โโโ [2] Detect category: file1.md (depends on [1])
โ โโโ [3] Detect category: file2.pdf (depends on [1])
โ โโโ [4] Detect category: file3.txt (depends on [1])
โโโ Phase 3: Organization
โ โโโ [5] Organize file1.md (depends on [2])
โ โโโ [6] Organize file2.pdf (depends on [3])
โ โโโ [7] Organize file3.txt (depends on [4])
โโโ Phase 4: Ingest
โ โโโ [8] Ingest file1.md (depends on [5])
โ โโโ [9] Ingest file2.pdf (depends on [6])
โ โโโ [10] Ingest file3.txt (depends on [7])
โโโ Phase 5: Aggregation
โโโ [11] Update index and log (depends on [8,9,10])
3. Ingest Single Source
Deep ingestion of one source file with parallel extraction.
Workflow:
Phase 1: Read Content
โโโ Spawn FileReader agent with chunked reading
โโโ If file > 50KB, read in 50KB chunks
โโโ Aggregate all chunks
โโโ Return: full contentPhase 2: Parallel Analysis
โโโ Spawn SummaryGenerator agent (depends on Phase 1)
โ โโโ Generate source summary
โ โโโ Return: summary content
โโโ Spawn EntityExtractor agent (depends on Phase 1)
โ โโโ Extract people, orgs, products
โ โโโ Return: entity list with context
โโโ Spawn ConceptExtractor agent (depends on Phase 1)
โโโ Extract key concepts, frameworks
โโโ Return: concept list with definitions
Phase 3: Page Creation (Parallel)
โโโ Spawn SourcePageCreator agent
โ โโโ Create wiki/10_Sources/.md
โโโ For each entity, spawn EntityPageCreator agent
โ โโโ Create/update wiki/20_Entities/.md
โโโ For each concept, spawn ConceptPageCreator agent
โโโ Create/update wiki/30_Concepts/.md
Phase 4: Cross-Reference
โโโ Spawn CrossReferencer agent
โโโ Add wiki links between related pages
โโโ Update entity pages with mentions
Phase 5: Index Update
โโโ Spawn IndexUpdater agent
โโโ Update wiki/00_Index/index.md
โโโ Append to wiki/00_Index/log.md
4. Query Knowledge Base
Answer questions using parallel page reading.
Workflow:
Phase 1: Index Analysis
โโโ Read wiki/00_Index/index.md
โโโ Identify relevant pagesPhase 2: Parallel Page Reading
โโโ For each relevant page, spawn PageReader agent
โโโ Read page content
โโโ Return: page content + relevance score
Phase 3: Synthesis
โโโ Spawn AnswerSynthesizer agent
โโโ Combine all page contents
โโโ Generate answer with citations
โโโ Return: synthesized answer
Phase 4: Optional Filing
โโโ If answer is valuable:
โโโ Spawn SynthesisPageCreator agent
โโโ Create wiki/40_Syntheses/.md
5. Lint (Health Check)
Parallel health check of the wiki.
Workflow:
TaskList: Lint Wiki
โโโ Phase 1: Data Collection (Parallel)
โ โโโ [1] Check for contradictions
โ โโโ [2] Find orphan pages
โ โโโ [3] Find missing concept pages
โ โโโ [4] Check for stale claims
โ โโโ [5] Verify cross-references
โ โโโ [6] Identify data gaps
โโโ Phase 2: Report Generation
โ โโโ [7] Aggregate findings (depends on [1-6])
โโโ Phase 3: Optional Fixes
โโโ [8] Create missing pages (depends on [7])
โโโ [9] Fix broken references (depends on [7])
Auto-Maintenance Mode Behavior:
In auto-maintenance mode, Lint will automatically fix simple issues and flag complex issues:
| Check Item | Auto-Fix Behavior | Flag Behavior |
|------------|-------------------|---------------|
| Orphan pages | Add reference in index.md Inbox | None |
| Missing concept pages | Auto-create basic page (draft) | Log to log.md for later refinement |
| Broken cross-references | None | Mark as [[Broken Link]] |
| Contradictory claims | None | Add ## Contradictions section |
| Stale claims | None | Add [stale?] tag |
| Data gaps | None | Log to log.md Suggested Research |
Auto-Fix Rules:
1. Orphan pages: Read page content, add reference line in index.md under appropriate category
2. Missing concept pages:
- Extract context from existing mentions
- Create basic template page
- Add tags: [concept, draft]
- Add > [!warning] Auto-created, needs refinement at page top
3. Broken links: Preserve original text, add comment
Sub-Agent Specifications
FileReader Agent
Purpose: Read files completely, handling large files via chunking.
Input:
{
"file_path": "/path/to/file",
"chunk_size": 50000, // bytes
"start_offset": 0
}
Behavior:
Output:
{
"content": "full file content",
"file_size": 123456,
"chunks_read": 3,
"complete": true
}
FileConverter Agent
Purpose: Convert PDF, Word, and other non-Markdown files to Markdown format.
Supported Formats:
.pdf โ .md (requires pypdf or pdfplumber).docx, .doc โ .md (requires python-docx).txt โ .md (native, just copy)Prerequisites Check:
# Step 1: Check if Python is installed
python --version || python3 --versionIf not installed, install Python:
macOS: brew install python
Linux: sudo apt-get install python3 python3-pip
Windows: Download from python.org
Step 2: Check if required packages are installed
python -c "import pypdf" 2>/dev/null || echo "pypdf not installed"
python -c "import docx" 2>/dev/null || echo "python-docx not installed"Step 3: Auto-install missing packages
pip install pypdf python-docx
Conversion Process: 1. Detect file type from extension 2. Check/install required Python packages 3. Extract text content 4. Create Markdown version alongside original file 5. Return path to Markdown file
Behavior:
Output:
{
"success": true,
"original_file": "document.pdf",
"markdown_file": "document.md",
"conversion_method": "pypdf",
"pages_extracted": 5,
"error": null
}
CategoryDetector Agent
Purpose: Detect file category based on filename and content.
Categories:
articles/ - Articles, blog posts, newsresearch/ - Research papers, technical documents, analysis reportsbooks/ - Book chapters, reading notesmeetings/ - Meeting notes, transcriptsprojects/ - Project documents, PRDs, plans, milestonesinbox/ - Todo items, temporary files, unprocessedjournal/ - Diaries, daily logs, weekly reviewsreference/ - Reference materials, cheatsheets, handbooksnotes/ - General notesothers/ - UncategorizedPriority Rules: 1. Filename keywords (strongest) 2. File extension 3. First 500 chars of content (if needed)
Auto-Maintenance Mode Behavior:
inbox/ or others/ directlymeeting, sync, discuss, ไผ่ฎฎ, ่ฎจ่ฎบ โ meetings/
- paper, research, study, analysis, ่ฐ็ , ็ ็ฉถ, ๅๆ โ research/
- article, blog, post, ๆ็ซ , ๅๅฎข โ articles/
- book, chapter, reading, ไนฆ็ฑ, ็ซ ่, ้
่ฏป โ books/
- project, prd, spec, plan, milestone, ้กน็ฎ, ้ๆฑ, ่งๅ, ๅค็ โ projects/
- todo, inbox, temp, ๅพ
ๅ, ๆถไปถ็ฎฑ, ไธดๆถ โ inbox/
- journal, diary, daily, ๆฅๅฟ, ๆฅ่ฎฐ, ๅจ่ฎฐ โ journal/
- ref, cheatsheet, handbook, guide, manual, ๅ่, ๆๅ, ้ๆฅ โ reference/
- note, memo, draft, ็ฌ่ฎฐ, ๅคๅฟๅฝ, ่็จฟ โ notes/
- Others or ambiguous โ others/
Output Format:
{
"file": "filename.md",
"category": "articles|research|books|meetings|projects|inbox|journal|reference|notes|others",
"confidence": "high|medium|low",
"reason": "brief explanation"
}
EntityExtractor Agent
Purpose: Extract entities from source content.
Entity Types:
person - Peopleorganization - Companies, institutionsproduct - Products, servicesplace - LocationsOutput: List of entities with context quotes.
Auto-Maintenance Mode Behavior:
ConceptExtractor Agent
Purpose: Extract key concepts and frameworks.
Output: List of concepts with:
Auto-Maintenance Mode Behavior:
PageCreator Agent
Purpose: Create or update wiki pages.
Input:
{
"page_type": "source|entity|concept|synthesis",
"title": "Page Title",
"content": {...},
"template": "standard"
}
Output: Path to created/updated page.
Auto-Maintenance Mode Behavior:
## Contradictions section to document differences
- Update metadata: Append source reference, update updated timestamp
Merge Strategy Example:
Existing Concept page definition: "X is A"
New source definition: "X is B"After auto-merge:
Definition
X has multiple definitional perspectives:
[[Source A]]: X is A
[[Source B]]: X is B Contradictions
Source A and Source B have different definitions for X
Page Templates
Source Page (wiki/10_Sources/)
---
title: "Source Title"
source: "raw/category/filename.md"
ingested: "2026-04-11"
tags: [source, domain/topic]
entities: [Entity A, Entity B]
concepts: [Concept X, Concept Y]
Source Title
Summary
Brief summary (2-3 paragraphs).Key Points
Point 1
Point 2 Entities Mentioned
[[Entity A]] โ context Concepts Discussed
[[Concept X]] โ how used here Questions Raised
Questions from source Related Sources
[[Related Source]]
Entity Page (wiki/20_Entities/)
---
title: "Entity Name"
type: person|organization|product|place
created: "2026-04-11"
updated: "2026-04-11"
sources: [Source A, Source B]
tags: [entity, category]
Entity Name
Overview
Brief description.Key Information
| Attribute | Value |
|-----------|-------|
| Type | Category |
| First mentioned | [[Source A]] |Mentions in Sources
From [[Source A]]: "quote or summary" Related
[[Related Concept]]
Concept Page (wiki/30_Concepts/)
---
title: "Concept Name"
created: "2026-04-11"
updated: "2026-04-11"
sources: [Source A, Source B]
tags: [concept, domain]
Concept Name
Definition
Clear definition.Key Aspects
Aspect 1
Aspect 2 Sources
[[Source A]] โ context Related Concepts
[[Related Concept]]
Error Handling
Each sub-agent should: 1. Report success/failure status 2. On failure: provide error message + partial results 3. Allow parent to retry or skip
Retry Strategy:
Best Practices
For the Orchestrator
1. Always use TaskList - Track every operation 2. Parallelize where possible - Independent tasks run together 3. Chunk large files - Prevent partial reads 4. Aggregate before updating - Batch index updatesFor Sub-Agents
1. Complete the task fully - Don't return partial results 2. Report errors clearly - Include context for debugging 3. Respect dependencies - Wait for prerequisite tasks 4. Write atomically - Complete page writes in one operationFor the User
1. Check TaskList - Monitor progress of long operations 2. Review sub-agent outputs - Verify correctness 3. Report failures - Help improve error handlingDirectory Structure
~/Obsidian Wiki/
โโโ CLAUDE.md # This schema file
โโโ raw/ # Original sources (immutable)
โ โโโ (auto-organized into subfolders)
โ โโโ articles/ # Articles, blog posts
โ โโโ research/ # Research papers, technical docs
โ โโโ books/ # Book chapters, reading notes
โ โโโ meetings/ # Meeting notes, transcripts
โ โโโ projects/ # Project documents, PRDs, plans
โ โโโ inbox/ # Todo items, temporary files
โ โโโ journal/ # Diaries, daily logs
โ โโโ reference/ # Reference materials, cheatsheets
โ โโโ notes/ # General notes
โ โโโ others/ # Uncategorized
โโโ wiki/ # LLM-generated knowledge base
โโโ 00_Index/
โ โโโ index.md # Master catalog
โ โโโ log.md # Operation history
โโโ 10_Sources/ # Source summaries
โโโ 20_Entities/ # People, orgs, products
โโโ 30_Concepts/ # Ideas, frameworks
โโโ 40_Syntheses/ # Analyses, comparisons
โโโ 99_Attachments/ # Images and files
Auto-Maintenance Mode
When the skill is triggered by OpenClaw scheduled tasks, it enters unattended auto-maintenance mode, automatically completing the full wiki maintenance workflow.
Trigger Conditions
Auto-Execution Workflow
Auto-Maintenance Cycle
โโโ Phase 1: Auto-Organize
โ โโโ Scan raw/ root directory for uncategorized files
โ โโโ Auto-detect category (based on filename/content)
โ โโโ Rename and move to corresponding category folder
โ โโโ Log to log.md
โ
โโโ Phase 2: Ingest New Sources
โ โโโ Discover all uningested new files
โ โโโ Ingest each new file in parallel
โ โโโ Create Source page
โ โโโ Extract and update Entity pages
โ โโโ Extract and update Concept pages
โ โโโ Create cross-references
โ โโโ Update index.md
โ โโโ Log to log.md
โ
โโโ Phase 3: Health Check (Lint)
โ โโโ Check for orphan pages
โ โโโ Check for missing concept pages
โ โโโ Verify cross-reference validity
โ โโโ Identify data gaps
โ โโโ Auto-fix simple issues
โ โโโ Create backlinks for orphan pages
โ โโโ Create missing concept pages (basic template)
โ โโโ Flag complex issues for manual handling
โ
โโโ Phase 4: Report Generation
โโโ Generate execution summary
โโโ Update log.md
โโโ Output statistics
Auto-Decision Rules
| Scenario | Auto Behavior |
|----------|---------------|
| Uncertain file category | Use others/ category, no pause to ask |
| Entity exists but content conflicts | Add contradiction note on Entity page, preserve all versions |
| Concept definition conflicts | Add multi-source definition comparison on Concept page |
| Orphan page | Auto-add reference in index.md, mark as pending organization |
| Missing concept page | Auto-create basic page, mark as draft |
| Broken cross-reference | Mark as pending fix, do not auto-delete |
Execution Report Format
After auto-maintenance completes, append to log.md:
## [2026-04-12 02:00] auto-maintenance | Scheduled maintenance complete
Duration: 45s
Organized: 3 files โ articles/, notes/
Ingested: 2 new sources
- [[New Article A]] โ extracted 5 entities, 3 concepts
- [[New Article B]] โ extracted 2 entities, 4 concepts
Lint fixes:
- Fixed orphan pages: 1
- Created missing concept pages: 2 (draft)
- Flagged pending issues: 0
Status: โ
Healthy
Comparison with Manual Mode
| Aspect | Manual Mode | Auto-Maintenance Mode |
|--------|-------------|----------------------|
| User confirmation | Confirm/cancel at each step | Fully automated, no confirmation |
| Uncertain category | Ask user | Use others/ |
| Content conflicts | Discuss solutions | Log conflicts, preserve all |
| Report format | Display in conversation | Write only to log.md |
| Suitable scenarios | First ingestion, important sources | Daily maintenance, scheduled sync |
Best Practices
1. First-time use: Run manually a few times first to ensure category rules are correct 2. Schedule frequency: Recommend every 4-6 hours or once daily 3. Regular review: Manually check maintenance logs in log.md weekly 4. Process drafts: Auto-created draft pages need manual refinement
Why This Works for OpenClaw
The Problem:
The Solution: 1. Chunked Reading - FileReader agent reads large files in pieces 2. Task Persistence - TaskList maintains state across interruptions 3. Parallel Processing - Sub-agents work independently 4. Aggregation - Results combined only when all sub-tasks complete 5. Error Recovery - Failed sub-tasks can be retried without restarting all
Note: This is a pattern optimized for OpenClaw. The core insight is divide and conquer through sub-agents โ each agent has a focused task, and the orchestrator coordinates them via TaskList.