๐ŸŽ Get the FREE AI Skills Starter Guide โ€” Subscribe โ†’
BytesAgainBytesAgain
๐Ÿฆ€ ClawHub

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...

Versionv1.0.1
Downloads451
TERMINAL
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/failed
  • Tasks can have dependencies (blockedBy)
  • Tasks can spawn child tasks

  • 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 paths

    Phase 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 content

    Phase 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 pages

    Phase 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:

  • If file size <= 50KB: read entire file
  • If file size > 50KB: read in chunks, aggregate
  • Return complete content with metadata
  • 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 --version

    If 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:

  • Original file is preserved (immutable sources)
  • Markdown copy is created in same directory
  • Markdown includes YAML frontmatter with source reference
  • If conversion fails, log error and skip file
  • 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, news
  • research/ - Research papers, technical documents, analysis reports
  • books/ - Book chapters, reading notes
  • meetings/ - Meeting notes, transcripts
  • projects/ - Project documents, PRDs, plans, milestones
  • inbox/ - Todo items, temporary files, unprocessed
  • journal/ - Diaries, daily logs, weekly reviews
  • reference/ - Reference materials, cheatsheets, handbooks
  • notes/ - General notes
  • others/ - Uncategorized
  • Priority Rules: 1. Filename keywords (strongest) 2. File extension 3. First 500 chars of content (if needed)

    Auto-Maintenance Mode Behavior:

  • Deterministic judgment: Based on explicit filename keywords (e.g., meeting, sync, paper, research, etc.)
  • No ambiguous questions: If category is unclear, use inbox/ or others/ directly
  • Keyword mapping:
  • - meeting, 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/
  • Quick return: Only read first 500 chars as auxiliary, no deep content analysis
  • 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 - People
  • organization - Companies, institutions
  • product - Products, services
  • place - Locations
  • Output: List of entities with context quotes.

    Auto-Maintenance Mode Behavior:

  • Extract all possible entities, include even if uncertain
  • Entity disambiguation: Merge when same noun appears multiple times, preserve all contexts
  • Auto-categorize: Determine entity type based on context
  • No questions asked: Directly output extraction results

  • ConceptExtractor Agent

    Purpose: Extract key concepts and frameworks.

    Output: List of concepts with:

  • Definition
  • Context from source
  • Related concepts
  • Auto-Maintenance Mode Behavior:

  • Extract all explicitly defined concepts (e.g., "X refers to...")
  • Extract recurring terms (may imply importance)
  • Keep definitions brief: No more than 2-3 sentences
  • Annotate source context: Each concept must include quote from source
  • No questions asked: Directly output all identified concepts

  • 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:

  • Source pages: Always create new page (each source is unique)
  • Entity/Concept pages:
  • - Read existing page (if present) - Auto-merge: Append new content to existing content - Handle conflicts: Add ## Contradictions section to document differences - Update metadata: Append source reference, update updated timestamp
  • No confirmation: Directly write to file
  • Atomic write: Complete content written at once, avoid partial writes
  • 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:

  • Network errors: retry 3 times with backoff
  • File not found: fail immediately
  • Parse errors: try alternative parser

  • 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 updates

    For 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 operation

    For the User

    1. Check TaskList - Monitor progress of long operations 2. Review sub-agent outputs - Verify correctness 3. Report failures - Help improve error handling


    Directory 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

  • OpenClaw scheduled task triggers (e.g., every 4 hours, daily)
  • No user input or confirmation required
  • All decisions made automatically
  • 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:

  • OpenClaw may read only part of large files
  • Complex operations can be interrupted
  • Context limits may truncate outputs
  • 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.

    ๐Ÿ“‹ Tips & 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 updates

    For 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 operation

    For the User

    1. Check TaskList - Monitor progress of long operations 2. Review sub-agent outputs - Verify correctness 3. Report failures - Help improve error handling