From 4dc6ff3b32943eee314bc5d51be00b0d103c7438 Mon Sep 17 00:00:00 2001 From: Daniel <223140489+AgriciDaniel@users.noreply.github.com> Date: Tue, 7 Apr 2026 12:05:18 +0300 Subject: [PATCH] chore: sync vault to ~/cosmic-brain (Obsidian-registered path) --- .claude-plugin/marketplace.json | 30 + .claude-plugin/plugin.json | 26 + .gitignore | 24 + .obsidian/app.json | 11 + .obsidian/appearance.json | 5 + .obsidian/core-plugins.json | 33 + .obsidian/graph.json | 55 ++ .obsidian/snippets/vault-colors.css | 60 ++ .raw/.gitkeep | 0 .raw/nate-herk-llm-wiki-transcript.md | 32 + CLAUDE.md | 61 ++ README.md | 237 +++++ WIKI.md | 849 ++++++++++++++++++ Welcome.md | 5 + _templates/comparison.md | 39 + _templates/concept.md | 40 + _templates/entity.md | 32 + _templates/question.md | 31 + _templates/source.md | 39 + agents/wiki-ingest.md | 56 ++ agents/wiki-lint.md | 63 ++ commands/autoresearch.md | 17 + commands/save.md | 16 + commands/wiki.md | 23 + hooks/hooks.json | 26 + skills/autoresearch/SKILL.md | 173 ++++ skills/autoresearch/references/program.md | 75 ++ skills/save/SKILL.md | 116 +++ skills/wiki-ingest/SKILL.md | 100 +++ skills/wiki-lint/SKILL.md | 172 ++++ skills/wiki-query/SKILL.md | 130 +++ skills/wiki/SKILL.md | 202 +++++ skills/wiki/references/css-snippets.md | 96 ++ skills/wiki/references/frontmatter.md | 107 +++ skills/wiki/references/git-setup.md | 58 ++ skills/wiki/references/mcp-setup.md | 91 ++ skills/wiki/references/modes.md | 259 ++++++ skills/wiki/references/plugins.md | 78 ++ skills/wiki/references/rest-api.md | 124 +++ wiki/Wiki Map.canvas | 155 ++++ wiki/concepts/Compounding Knowledge.md | 70 ++ wiki/concepts/Hot Cache.md | 95 ++ wiki/concepts/LLM Wiki Pattern.md | 98 ++ wiki/entities/Andrej Karpathy.md | 48 + wiki/hot.md | 38 + wiki/index.md | 57 ++ wiki/log.md | 38 + wiki/meta/dashboard.md | 59 ++ wiki/overview.md | 65 ++ wiki/sources/Nate Herk LLM Wiki Transcript.md | 93 ++ 50 files changed, 4407 insertions(+) create mode 100644 .claude-plugin/marketplace.json create mode 100644 .claude-plugin/plugin.json create mode 100644 .gitignore create mode 100644 .obsidian/app.json create mode 100644 .obsidian/appearance.json create mode 100644 .obsidian/core-plugins.json create mode 100644 .obsidian/graph.json create mode 100644 .obsidian/snippets/vault-colors.css create mode 100644 .raw/.gitkeep create mode 100644 .raw/nate-herk-llm-wiki-transcript.md create mode 100644 CLAUDE.md create mode 100644 README.md create mode 100644 WIKI.md create mode 100644 Welcome.md create mode 100644 _templates/comparison.md create mode 100644 _templates/concept.md create mode 100644 _templates/entity.md create mode 100644 _templates/question.md create mode 100644 _templates/source.md create mode 100644 agents/wiki-ingest.md create mode 100644 agents/wiki-lint.md create mode 100644 commands/autoresearch.md create mode 100644 commands/save.md create mode 100644 commands/wiki.md create mode 100644 hooks/hooks.json create mode 100644 skills/autoresearch/SKILL.md create mode 100644 skills/autoresearch/references/program.md create mode 100644 skills/save/SKILL.md create mode 100644 skills/wiki-ingest/SKILL.md create mode 100644 skills/wiki-lint/SKILL.md create mode 100644 skills/wiki-query/SKILL.md create mode 100644 skills/wiki/SKILL.md create mode 100644 skills/wiki/references/css-snippets.md create mode 100644 skills/wiki/references/frontmatter.md create mode 100644 skills/wiki/references/git-setup.md create mode 100644 skills/wiki/references/mcp-setup.md create mode 100644 skills/wiki/references/modes.md create mode 100644 skills/wiki/references/plugins.md create mode 100644 skills/wiki/references/rest-api.md create mode 100644 wiki/Wiki Map.canvas create mode 100644 wiki/concepts/Compounding Knowledge.md create mode 100644 wiki/concepts/Hot Cache.md create mode 100644 wiki/concepts/LLM Wiki Pattern.md create mode 100644 wiki/entities/Andrej Karpathy.md create mode 100644 wiki/hot.md create mode 100644 wiki/index.md create mode 100644 wiki/log.md create mode 100644 wiki/meta/dashboard.md create mode 100644 wiki/overview.md create mode 100644 wiki/sources/Nate Herk LLM Wiki Transcript.md diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json new file mode 100644 index 0000000..ff2964b --- /dev/null +++ b/.claude-plugin/marketplace.json @@ -0,0 +1,30 @@ +{ + "name": "cosmic-brain-marketplace", + "owner": { + "name": "AgriciDaniel", + "email": "github@agricidaniel" + }, + "metadata": { + "description": "cosmic-brain — Claude + Obsidian knowledge companion by AgriciDaniel", + "version": "1.0.0" + }, + "plugins": [ + { + "name": "cosmic-brain", + "source": { + "source": "github", + "repo": "AgriciDaniel/cosmic-brain", + "ref": "main" + }, + "description": "Claude + Obsidian knowledge companion. Sets up a persistent, compounding wiki vault. Covers memory management, session notetaking, knowledge organization, and agent context across projects.", + "version": "1.0.0", + "author": { + "name": "AgriciDaniel", + "url": "https://github.com/AgriciDaniel" + }, + "homepage": "https://github.com/AgriciDaniel/cosmic-brain", + "repository": "https://github.com/AgriciDaniel/cosmic-brain", + "license": "MIT" + } + ] +} diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json new file mode 100644 index 0000000..ea19c2f --- /dev/null +++ b/.claude-plugin/plugin.json @@ -0,0 +1,26 @@ +{ + "name": "cosmic-brain", + "version": "1.1.0", + "description": "Claude + Obsidian knowledge companion. Sets up a persistent, compounding wiki vault. Covers memory management, session notetaking, knowledge organization, and agent context across projects. Based on Andrej Karpathy's LLM Wiki pattern.", + "author": { + "name": "AgriciDaniel", + "url": "https://github.com/AgriciDaniel" + }, + "license": "MIT", + "homepage": "https://github.com/AgriciDaniel/cosmic-brain", + "repository": "https://github.com/AgriciDaniel/cosmic-brain", + "keywords": [ + "obsidian", + "knowledge-base", + "wiki", + "memory", + "notetaker", + "second-brain", + "vault", + "markdown", + "cross-project", + "llm-wiki", + "karpathy", + "pkm" + ] +} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f0d2c9b --- /dev/null +++ b/.gitignore @@ -0,0 +1,24 @@ +# Obsidian +.obsidian/workspace.json +.obsidian/workspace-mobile.json +.obsidian/plugins/*/data.json +.smart-connections/ +.obsidian-git-data +.trash/ + +# System +.DS_Store +Thumbs.db + +# Python +__pycache__/ +*.pyc +.venv/ + +# Node +node_modules/ + +# Local secrets +.env +.env.local +*.local.md diff --git a/.obsidian/app.json b/.obsidian/app.json new file mode 100644 index 0000000..9f97002 --- /dev/null +++ b/.obsidian/app.json @@ -0,0 +1,11 @@ +{ + "userIgnoreFilters": [ + "agents", + "commands", + "hooks", + "skills", + "README.md", + "CLAUDE.md", + "WIKI.md" + ] +} diff --git a/.obsidian/appearance.json b/.obsidian/appearance.json new file mode 100644 index 0000000..10a5d52 --- /dev/null +++ b/.obsidian/appearance.json @@ -0,0 +1,5 @@ +{ + "enabledCssSnippets": [ + "vault-colors" + ] +} diff --git a/.obsidian/core-plugins.json b/.obsidian/core-plugins.json new file mode 100644 index 0000000..639b90d --- /dev/null +++ b/.obsidian/core-plugins.json @@ -0,0 +1,33 @@ +{ + "file-explorer": true, + "global-search": true, + "switcher": true, + "graph": true, + "backlink": true, + "canvas": true, + "outgoing-link": true, + "tag-pane": true, + "footnotes": false, + "properties": true, + "page-preview": true, + "daily-notes": true, + "templates": true, + "note-composer": true, + "command-palette": true, + "slash-command": false, + "editor-status": true, + "bookmarks": true, + "markdown-importer": false, + "zk-prefixer": false, + "random-note": false, + "outline": true, + "word-count": true, + "slides": false, + "audio-recorder": false, + "workspaces": false, + "file-recovery": true, + "publish": false, + "sync": true, + "bases": true, + "webviewer": false +} \ No newline at end of file diff --git a/.obsidian/graph.json b/.obsidian/graph.json new file mode 100644 index 0000000..35bb5fb --- /dev/null +++ b/.obsidian/graph.json @@ -0,0 +1,55 @@ +{ + "collapse-filter": false, + "search": "", + "showTags": false, + "showAttachments": false, + "hideUnresolved": true, + "showOrphans": false, + "collapse-color-groups": false, + "colorGroups": [ + { + "query": "path:wiki/entities", + "color": { "a": 1, "rgb": 12945088 } + }, + { + "query": "path:wiki/concepts", + "color": { "a": 1, "rgb": 5227007 } + }, + { + "query": "path:wiki/domains", + "color": { "a": 1, "rgb": 5227007 } + }, + { + "query": "path:wiki/sources", + "color": { "a": 1, "rgb": 6986069 } + }, + { + "query": "path:wiki/questions", + "color": { "a": 1, "rgb": 6986069 } + }, + { + "query": "path:wiki/comparisons", + "color": { "a": 1, "rgb": 6986069 } + }, + { + "query": "path:wiki", + "color": { "a": 1, "rgb": 5676246 } + }, + { + "query": "path:_templates", + "color": { "a": 0.3, "rgb": 6316128 } + } + ], + "collapse-display": true, + "showArrow": true, + "textFadeMultiplier": -1, + "nodeSizeMultiplier": 1.5, + "lineSizeMultiplier": 1, + "collapse-forces": true, + "centerStrength": 0.6, + "repelStrength": 25, + "linkStrength": 1.2, + "linkDistance": 100, + "scale": 0.9, + "close": false +} diff --git a/.obsidian/snippets/vault-colors.css b/.obsidian/snippets/vault-colors.css new file mode 100644 index 0000000..e8def0b --- /dev/null +++ b/.obsidian/snippets/vault-colors.css @@ -0,0 +1,60 @@ +/* ============================================================ + cosmic-brain vault colors + 3-color scheme: blue (knowledge) | green (content) | purple (people) + ============================================================ */ + +:root { + --cb-blue: #4fc1ff; /* concepts, domains — knowledge nodes */ + --cb-green: #6a9955; /* sources, questions — content nodes */ + --cb-purple: #c586c0; /* entities — people & orgs */ + --cb-meta: #569cd6; /* wiki meta: index, hot, log */ + --cb-dim: #606060; /* templates, raw — de-emphasized */ +} + +/* ── Wiki meta (light blue) ── */ +.nav-folder-title[data-path="wiki"] { color: var(--cb-meta); } +.nav-folder-title[data-path^="wiki/meta"] { color: var(--cb-meta); } + +/* ── Knowledge — blue ── */ +.nav-folder-title[data-path^="wiki/concepts"] { color: var(--cb-blue); } +.nav-folder-title[data-path^="wiki/domains"] { color: var(--cb-blue); } + +/* ── Content — green ── */ +.nav-folder-title[data-path^="wiki/sources"] { color: var(--cb-green); } +.nav-folder-title[data-path^="wiki/questions"] { color: var(--cb-green); } +.nav-folder-title[data-path^="wiki/comparisons"] { color: var(--cb-green); } + +/* ── People & orgs — purple ── */ +.nav-folder-title[data-path^="wiki/entities"] { color: var(--cb-purple); } + +/* ── De-emphasized ── */ +.nav-folder-title[data-path=".raw"] { color: var(--cb-dim); opacity: 0.55; } +.nav-folder-title[data-path="_templates"] { color: var(--cb-dim); opacity: 0.55; } +.nav-folder-title[data-path="agents"] { color: var(--cb-dim); opacity: 0.55; } +.nav-folder-title[data-path="commands"] { color: var(--cb-dim); opacity: 0.55; } +.nav-folder-title[data-path="hooks"] { color: var(--cb-dim); opacity: 0.55; } +.nav-folder-title[data-path="skills"] { color: var(--cb-dim); opacity: 0.55; } + +/* ── Custom callouts ── */ +.callout[data-callout='contradiction'] { + --callout-color: 209, 105, 105; + --callout-icon: lucide-alert-triangle; +} +.callout[data-callout='gap'] { + --callout-color: 220, 220, 170; + --callout-icon: lucide-help-circle; +} +.callout[data-callout='key-insight'] { + --callout-color: 79, 193, 255; + --callout-icon: lucide-lightbulb; +} +.callout[data-callout='stale'] { + --callout-color: 128, 128, 128; + --callout-icon: lucide-clock; +} + +/* ── Canvas card accents (match graph node colors) ── */ +.canvas-node[data-color="1"] { --canvas-color: 79, 193, 255; } /* blue */ +.canvas-node[data-color="3"] { --canvas-color: 197, 134, 192; } /* purple */ +.canvas-node[data-color="4"] { --canvas-color: 106, 153, 85; } /* green */ +.canvas-node[data-color="5"] { --canvas-color: 86, 156, 214; } /* meta */ diff --git a/.raw/.gitkeep b/.raw/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/.raw/nate-herk-llm-wiki-transcript.md b/.raw/nate-herk-llm-wiki-transcript.md new file mode 100644 index 0000000..06efdb7 --- /dev/null +++ b/.raw/nate-herk-llm-wiki-transcript.md @@ -0,0 +1,32 @@ +--- +title: "Nate Herk — Obsidian + Karpathy Just 10x'd Claude Code Projects" +source_type: transcript +author: "Nate Herk" +date_published: 2026-04-07 +url: "https://youtube.com/@nateherk" +tags: [raw, transcript] +--- + +# Nate Herk — Obsidian + Karpathy Just 10x'd Claude Code Projects + +Raw transcript. Do not modify. + +--- + +What you're looking at right here is 36 of my most recent YouTube videos organized into an actual knowledge system that makes sense. And in today's video, I'm going to show you how you can set this up in 5 minutes. It's super super easy. You can see here how we have these different nodes and different patterns emerging. And as we zoom in, we can see what each of these little dots represents. So, for example, this is one of my videos, $10,000 aentic workflows. We can see it's got some tags. It's got the video link. It's got the raw file. And it gives an explanation of what this video is about and what the takeaways are. And the coolest part is I can follow the back links to get where I want. There's a backlink for the WAT framework. There's a backlink for Claude Code. There's a backlink for all these different tools I mentioned like Perplexity, Visual Studio Code, Nano Banana, Naden N. It also has techniques like the WT framework or bypass permissions mode or human review checkpoint. So, as this continues to fill up, we can start to see patterns and relationships between every tool or every skill or every MCP server that I might have talked about in a YouTube video. And I can just query it in a really efficient way now that we have this actual system set up. And the crazy part is I said, "Hey, Cloud Code, go grab the transcripts from my recent videos and organize everything. I literally didn't have to do any manual relationship building here. It just figured it all out on its own." + +And then right here, I have a much smaller one, but this is more of my personal brain. So this is stuff going on in my personal life. This is stuff going on with, you know, UpAI or my YouTube channel or my different businesses and my employees and our quarter 2 initiatives and things like that. This is more of my own second brain. So I've got one second brain here and then I've got one basically YouTube knowledge system and I could combine these or I could keep them separate and I can just keep building more knowledge systems and plug them all into other AI agents that I need to have this context. It's just super cool. + +So Andre Carpathy just released this little post about LLM knowledge bases and explaining what he's been doing with them. And in just a matter of few days, it got a ton of traction on X. So let's do a quick breakdown and then I'm going to show you guys how you can get this set up in basically 5 minutes. Something I've been finding very useful recently is using LLM to build personal knowledge bases for various topics of research interest. So there's different stages. The first part is data ingest. He puts in basically source documents. So he basically takes a PDF and puts it into Cloud Code and then Cloud Code does the rest. He uses Obsidian as the IDE. So this is nothing really too game-changing. Obsidian just lets you visually see your markdown files. + +He said here, "I thought that I had to reach for fancy rag, but the LLM has been pretty good about automaintaining index files and brief summaries of all documents and it reads all the important related data fairly easily at this small scale." So right now he's doing about 100 articles and about half a million words. So there's a few other things that we'll cover later, but the TLDDR is you give raw data to cloud code. It compares it, it organizes it, and then it puts it into the right spots with relationships, and then you can query it about anything. + +Why is this a big deal? Because normal AI chats are ephemeral, meaning the knowledge disappears after the conversation. But this method, using Karpathy's LLM wiki, makes knowledge compound like interest in a bank. People on X are calling it a game changer because it finally makes AI feel like a tireless colleague who actually remembers everything and it stays organized. It's also super simple. You don't need a fancy vector database embeddings or complex infrastructure. It's literally just a folder with markdown files. + +One X user turned 383 scattered files and over 100 meeting transcripts into a compact wiki and dropped token usage by 95% when querying with Claude. + +The thing about the hot cache — if I go to the herk brain in the wiki, you can see there's a hot.md right here. And this is basically just a cache of like 500 words or 500 characters that it saves, which is like what is the most recent thing that Nate just gave me or that we talked about. In the context of my executive assistant, this is really helpful. You know, it might save me from having to crawl different wiki pages. + +So now the final question about this that I wanted to cover is like does this kill semantic search rag? And the answer is no, but kind of yes. And it all depends on the goal of the project and the goal of the context, how much context you have. If you have hundreds of pages with good indexes, you're fine with wiki graph. But if you were getting up to the millions of documents, then you're going to want to actually do more of a traditional rag pipeline. + +[End of transcript] diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..7487ce8 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,61 @@ +# cosmic-brain — Claude + Obsidian Wiki Vault + +This folder is both a Claude Code plugin and an Obsidian vault. + +**Plugin name:** `cosmic-brain` +**Skills:** `/wiki`, `/wiki-ingest`, `/wiki-query`, `/wiki-lint` +**Vault path:** This directory (open in Obsidian directly) + +## What This Vault Is For + +[Fill this in when you first scaffold the vault. One sentence describing your purpose.] + +## Vault Structure + +``` +.raw/ source documents — immutable, Claude reads but never modifies +wiki/ Claude-generated knowledge base +_templates/ Obsidian Templater templates +_attachments/ images and PDFs referenced by wiki pages +``` + +## How to Use + +Drop a source file into `.raw/`, then tell Claude: "ingest [filename]". + +Ask any question. Claude reads the index first, then drills into relevant pages. + +Run `/wiki` to scaffold a new vault or check setup status. + +Run "lint the wiki" every 10-15 ingests to catch orphans and gaps. + +## Cross-Project Access + +To reference this wiki from another Claude Code project, add to that project's CLAUDE.md: + +```markdown +## Wiki Knowledge Base +Path: /path/to/this/vault + +When you need context not already in this project: +1. Read wiki/hot.md first (recent context, ~500 words) +2. If not enough, read wiki/index.md +3. If you need domain specifics, read wiki//_index.md +4. Only then read individual wiki pages + +Do NOT read the wiki for general coding questions or things already in this project. +``` + +## Plugin Skills + +| Skill | Trigger | +|-------|---------| +| `/wiki` | Setup, scaffold, route to sub-skills | +| `ingest [source]` | Single or batch source ingestion | +| `query: [question]` | Answer from wiki content | +| `lint the wiki` | Health check | + +## MCP (Optional) + +If you configured the MCP server, Claude can read and write vault notes directly. +See `skills/wiki/references/mcp-setup.md` for setup instructions. diff --git a/README.md b/README.md new file mode 100644 index 0000000..22bd302 --- /dev/null +++ b/README.md @@ -0,0 +1,237 @@ +# cosmic-brain + +Claude + Obsidian knowledge companion. A running notetaker that builds and maintains a persistent, compounding wiki vault. Every source you add gets integrated. Every question you ask pulls from everything that has been read. Knowledge compounds like interest. + +Based on Andrej Karpathy's LLM Wiki pattern. + +--- + +## What It Does + +You drop sources. Claude reads them, extracts entities and concepts, updates cross-references, and files everything into a structured Obsidian vault. The wiki gets richer with every ingest. + +You ask questions. Claude reads the hot cache (recent context), scans the index, drills into relevant pages, and synthesizes an answer. It cites specific wiki pages, not training data. + +You lint. Claude finds orphans, dead links, stale claims, and missing cross-references. Your wiki stays healthy without manual cleanup. + +At the end of every session, Claude updates a hot cache. The next session starts with full recent context, no recap needed. + +--- + +## Quick Start + +**Option 1: Clone and open as vault** + +```bash +git clone https://github.com/AgriciDaniel/cosmic-brain +``` + +Open the folder in Obsidian as a vault. Open it in Claude Code. Type `/wiki`. + +**Option 2: Install as plugin** + +```bash +claude plugin install github:AgriciDaniel/cosmic-brain +``` + +Then in any Claude Code session: `/wiki` + +**Option 3: Add to existing vault** + +Copy `WIKI.md` into your project root or `~/.claude/`. Paste this into Claude: + +``` +Read WIKI.md in this project. Then: +1. Check if Obsidian is installed. If not, install it or walk me through it. +2. Check if the Local REST API plugin is running (port 27124). If not, guide me through enabling it. +3. Configure the MCP server so you can read and write my vault. +4. Ask me ONE question: "What is this vault for?" + +Then build the entire wiki structure based on my answer. +``` + +--- + +## Commands + +| You say | Claude does | +|---------|------------| +| `/wiki` | Setup check, scaffold, or continue where you left off | +| `ingest [file]` | Read source, create 8-15 wiki pages, update index and log | +| `ingest all of these` | Batch process multiple sources, then cross-reference | +| `what do you know about X?` | Read index > relevant pages > synthesize answer | +| `/save` | File the current conversation as a wiki note | +| `/save [name]` | Save with a specific title (skips the naming question) | +| `/autoresearch [topic]` | Run the autonomous research loop: search, fetch, synthesize, file | +| `lint the wiki` | Health check: orphans, dead links, gaps, suggestions | +| `update hot cache` | Refresh hot.md with latest context summary | + +--- + +## Cross-Project Power Move + +Point any Claude Code project at this vault. Add to that project's `CLAUDE.md`: + +```markdown +## Wiki Knowledge Base +Path: ~/path/to/vault + +When you need context not already in this project: +1. Read wiki/hot.md first (recent context cache) +2. If not enough, read wiki/index.md +3. If you need domain details, read the relevant domain sub-index +4. Only then drill into specific wiki pages + +Do NOT read the wiki for general coding questions or tasks unrelated to [domain]. +``` + +Your executive assistant, coding projects, and content workflows all draw from the same knowledge base. + +--- + +## Six Wiki Modes + +| Mode | Use when | +|------|---------| +| A: Website | Sitemap, content audit, SEO wiki | +| B: GitHub | Codebase map, architecture wiki | +| C: Business | Project wiki, competitive intelligence | +| D: Personal | Second brain, goals, journal synthesis | +| E: Research | Papers, concepts, thesis | +| F: Book/Course | Chapter tracker, course notes | + +Modes can be combined. + +--- + +## What Gets Created + +A typical scaffold creates: +- Folder structure for your chosen mode +- `wiki/index.md` — master catalog +- `wiki/log.md` — append-only operation log +- `wiki/hot.md` — recent context cache +- `wiki/overview.md` — executive summary +- `wiki/meta/dashboard.md` — Dataview dashboard +- `_templates/` — Obsidian Templater templates for each note type +- `.obsidian/snippets/vault-colors.css` — color-coded file explorer +- Vault `CLAUDE.md` — auto-loaded project instructions + +--- + +## MCP Setup (Optional) + +MCP lets Claude read and write vault notes directly without copy-paste. + +Option A (REST API based): +1. Install the Local REST API plugin in Obsidian +2. Copy your API key +3. Run: +```bash +claude mcp add-json obsidian-vault '{ + "type": "stdio", + "command": "uvx", + "args": ["mcp-obsidian"], + "env": { + "OBSIDIAN_API_KEY": "your-key", + "OBSIDIAN_HOST": "127.0.0.1", + "OBSIDIAN_PORT": "27124", + "NODE_TLS_REJECT_UNAUTHORIZED": "0" + } +}' --scope user +``` + +Option B (filesystem based, no plugin needed): +```bash +claude mcp add-json obsidian-vault '{ + "type": "stdio", + "command": "npx", + "args": ["-y", "@bitbonsai/mcpvault@latest", "/path/to/your/vault"] +}' --scope user +``` + +--- + +## Recommended Plugins + +Install via Obsidian > Settings > Community Plugins: + +| Plugin | What it does | +|--------|-------------| +| Dataview | Powers the dashboard queries | +| Templater | Auto-populates frontmatter from templates | +| Obsidian Git | Auto-commits every 15 minutes | +| Minimal Theme | Best dark theme for this setup | + +Also install the **Obsidian Web Clipper** browser extension. It sends web pages to `.raw/` in one click. + +--- + +## File Structure + +``` +cosmic-brain/ +├── .claude-plugin/ +│ ├── plugin.json # manifest +│ └── marketplace.json # distribution +├── skills/ +│ ├── wiki/ # orchestrator + references (7 ref files) +│ ├── wiki-ingest/ # INGEST operation +│ ├── wiki-query/ # QUERY operation +│ ├── wiki-lint/ # LINT operation +│ ├── save/ # /save — file conversations to wiki +│ └── autoresearch/ # /autoresearch — autonomous research loop +│ └── references/ +│ └── program.md # configurable research objectives +├── agents/ +│ ├── wiki-ingest.md # parallel ingestion agent +│ └── wiki-lint.md # health check agent +├── commands/ +│ ├── wiki.md # /wiki bootstrap command +│ ├── save.md # /save command +│ └── autoresearch.md # /autoresearch command +├── hooks/ +│ └── hooks.json # SessionStart + Stop hot cache hooks +├── _templates/ # Obsidian Templater templates +├── wiki/ +│ ├── Wiki Map.canvas # visual hub — central graph node +│ ├── concepts/ # seeded: LLM Wiki Pattern, Hot Cache, Compounding Knowledge +│ ├── entities/ # seeded: Andrej Karpathy +│ ├── sources/ # seeded: Nate Herk LLM Wiki Transcript +│ └── meta/dashboard.md # Dataview dashboard +├── .raw/ # source documents (hidden in Obsidian) +├── .obsidian/snippets/ # vault-colors.css (3-color scheme) +├── WIKI.md # full schema reference +├── CLAUDE.md # project instructions +└── README.md # this file +``` + +--- + +## AutoResearch: program.md + +The `/autoresearch` command is configurable. Edit `skills/autoresearch/references/program.md` to control: + +- What sources to prefer (academic, official docs, news) +- Confidence scoring rules +- Max rounds and max pages per session +- Domain-specific constraints + +The default program works for general research. Override it for your domain. A medical researcher would add "prefer PubMed". A business analyst would add "focus on market data and filings". + +--- + +## Seed Vault + +This repo ships with a seeded vault. Open it in Obsidian and you'll see: + +- `wiki/concepts/` — LLM Wiki Pattern, Hot Cache, Compounding Knowledge +- `wiki/entities/` — Andrej Karpathy +- `wiki/sources/` — Nate Herk LLM Wiki Transcript +- `wiki/meta/dashboard.md` — Dataview dashboard (requires Dataview plugin) + +The graph view will show a connected cluster of 5 pages. This is what the wiki looks like after one ingest. Add more sources and it grows from there. + +--- + +*Based on [Andrej Karpathy's LLM Wiki pattern](https://github.com/karpathy). Hot cache and cross-project patterns demonstrated by [Nate Herk](https://youtube.com/@nateherk). Built by [AgriciDaniel](https://github.com/AgriciDaniel) / AI Marketing Hub.* diff --git a/WIKI.md b/WIKI.md new file mode 100644 index 0000000..1e8c84a --- /dev/null +++ b/WIKI.md @@ -0,0 +1,849 @@ +# WIKI.md — LLM Wiki Schema + +> If you are using the cosmic-brain plugin, the skills handle everything here automatically. +> This file is the reference document. Read it to understand how the system works. +> Based on Andrej Karpathy's LLM Wiki pattern. + +--- + +## What This Is + +You are maintaining a persistent, compounding wiki inside an Obsidian vault. You don't just answer questions. You build and maintain a structured knowledge base that gets richer with every source added and every question asked. The human curates sources and asks questions. You do all the writing, cross-referencing, filing, and maintenance. + +The wiki is the product. Chat is just the interface. + +The key difference from RAG: the wiki is a persistent artifact. Cross-references are already there. Contradictions have been flagged. Synthesis already reflects everything that was read. Knowledge compounds like interest. + +--- + +## 0 — Bootstrap: First-Run Setup + +On first run in any new project, execute these steps in order. Skip any step already done. + +### 0.1 Check Obsidian Installation + +```bash +# Linux: check flatpak first, then PATH +flatpak list 2>/dev/null | grep -i obsidian && echo "FOUND via flatpak" || \ +which obsidian 2>/dev/null && echo "FOUND in PATH" || echo "NOT FOUND" + +# macOS +ls /Applications/Obsidian.app 2>/dev/null && echo "FOUND" || echo "NOT FOUND" + +# Windows (PowerShell) +Test-Path "$env:LOCALAPPDATA\Obsidian" && echo "FOUND" || echo "NOT FOUND" +``` + +If not installed: + +```bash +# Linux (Flatpak) +flatpak install flathub md.obsidian.Obsidian + +# macOS (Homebrew) +brew install --cask obsidian + +# Windows (winget) +winget install Obsidian.Obsidian + +# All platforms: https://obsidian.md/download +``` + +After installing: Obsidian > Manage Vaults > Open Folder as Vault > select vault directory. + +If no package manager is available, tell the user: "Download Obsidian from https://obsidian.md — install it, create a vault, and tell me the path." + +### 0.2 Vault Location + +Ask for the vault path or use the default: + +``` +VAULT_PATH=~/Documents/Obsidian Vault +``` + +Verify: `ls "$VAULT_PATH/.obsidian" 2>/dev/null` + +### 0.3 Install the Local REST API Plugin + +Guide the user (you cannot do this programmatically): + +1. Obsidian > Settings > Community Plugins > Turn off Restricted Mode +2. Browse > Search "Local REST API" > Install > Enable +3. Settings > Local REST API > Copy the API key +4. Plugin runs on `https://127.0.0.1:27124` (self-signed cert) + +Test: `curl -sk -H "Authorization: Bearer " https://127.0.0.1:27124/` + +### 0.4 Configure MCP Server + +**Option A: mcp-obsidian (REST API based, most popular)** + +```bash +claude mcp add-json obsidian-vault '{ + "type": "stdio", + "command": "uvx", + "args": ["mcp-obsidian"], + "env": { + "OBSIDIAN_API_KEY": "", + "OBSIDIAN_HOST": "127.0.0.1", + "OBSIDIAN_PORT": "27124", + "NODE_TLS_REJECT_UNAUTHORIZED": "0" + } +}' --scope user +``` + +**Option B: MCPVault (filesystem based, no plugin needed)** + +```bash +claude mcp add-json obsidian-vault '{ + "type": "stdio", + "command": "npx", + "args": ["-y", "@bitbonsai/mcpvault@latest", ""] +}' --scope user +``` + +**Option C: Direct REST API via curl** — always works, no MCP needed. See Section 11. + +Use `--scope user` so the vault is available across all projects. + +**Verify:** + +```bash +claude mcp list # confirm server appears +claude mcp get obsidian-vault # confirm path is correct +``` + +In a Claude Code session, type `/mcp` to check connection status. + +### 0.5 Recommended Plugins + +Install via Settings > Community Plugins > Browse: + +| Plugin | Why | +|--------|-----| +| **Dataview** | Query vault as a database. Powers dashboards. | +| **Templater** | Auto-populate frontmatter on note creation. | +| **Obsidian Git** | Auto-commit every 15 minutes. Protects against data loss. | +| **Iconize** | Visual folder icons. | +| **Minimal Theme** | Best dark theme for dense information display. | + +Optional: Smart Connections (semantic search), QuickAdd (macros), Folder Notes (clickable folders). + +Also install the **Obsidian Web Clipper** browser extension. It converts web articles to markdown and sends them to `.raw/` in one click. Available for Chrome, Firefox, and Safari. + +--- + +## 1 — Architecture + +``` +vault/ +├── .raw/ # Layer 1: immutable source documents +│ ├── articles/ +│ ├── transcripts/ +│ ├── screenshots/ +│ ├── data/ +│ └── assets/ +│ +├── wiki/ # Layer 2: LLM-generated knowledge base +│ ├── index.md # master catalog of all wiki pages +│ ├── log.md # chronological record of all operations +│ ├── hot.md # hot cache: recent context summary (~500 words) +│ ├── overview.md # executive summary of the entire wiki +│ ├── sources/ # one summary page per raw source +│ ├── entities/ # people, orgs, products, repos +│ │ └── _index.md +│ ├── concepts/ # ideas, patterns, frameworks +│ │ └── _index.md +│ ├── domains/ # top-level topic areas +│ │ └── _index.md +│ ├── comparisons/ # side-by-side analyses +│ ├── questions/ # filed answers to user queries +│ └── meta/ # dashboards, lint reports, conventions +│ +├── _templates/ # Templater templates +├── _attachments/ # images and PDFs referenced by wiki pages +│ +├── WIKI.md # Layer 3: this file +└── .obsidian/ # Obsidian config (auto-managed) +``` + +### Rules + +- `.raw/` is read-only. Never modify source files. +- `wiki/` is yours. Create, update, rename, delete freely. +- Every wiki page has frontmatter. No exceptions. +- Wikilinks over paths. Use `[[Page Name]]` not `[text](path/to/file.md)`. +- Atomic notes. One concept per page. If it covers two things, split it. +- Update, don't duplicate. If a page exists, update it. + +--- + +## 2 — Hot Cache + +`wiki/hot.md` is a ~500-word summary of the most recent context. It exists so that other projects pointing at this vault can get recent context without crawling the full wiki. + +Update hot.md after every ingest, after any significant query exchange, and at the end of every session. + +Format: + +```markdown +--- +type: meta +title: "Hot Cache" +updated: 2026-04-07T14:30:00 +--- + +# Recent Context + +## Last Updated +2026-04-07 — Ingested 3 new YouTube transcripts + +## Key Recent Facts +- [Most important recent takeaway] +- [Second most important] + +## Recent Changes +- Created: [[New Page 1]], [[New Page 2]] +- Updated: [[Existing Page]] (added section on X) +- Flagged: Contradiction between [[Page A]] and [[Page B]] on topic Y + +## Active Threads +- User is currently researching [topic] +- Open question: [thing still being investigated] +``` + +Keep it under 500 words. It is a cache, not a journal. Overwrite it completely each time. + +--- + +## 3 — Frontmatter Schema + +Every wiki page starts with flat YAML frontmatter. No nested objects. Obsidian's Properties UI doesn't support them. + +### Universal fields (every page): + +```yaml +--- +type: +title: "Human-Readable Title" +created: 2026-04-07 +updated: 2026-04-07 +tags: + - + - +status: +related: + - "[[Other Page]]" +sources: + - "[[.raw/articles/source-file.md]]" +--- +``` + +### Type-specific additions: + +**source**: `source_type`, `author`, `date_published`, `url`, `confidence` (high|medium|low), `key_claims` (list) + +**entity**: `entity_type` (person|organization|product|repository|place), `role`, `first_mentioned` + +**concept**: `complexity` (basic|intermediate|advanced), `domain`, `aliases` (list) + +**comparison**: `subjects` (list of wikilinks), `dimensions` (list), `verdict` (one line) + +**question**: `question` (the original query), `answer_quality` (draft|solid|definitive) + +--- + +## 4 — Operations + +### 4.1 SCAFFOLD — First-Run Structure + +Trigger: user describes what the vault is for. + +1. Determine the wiki mode (see modes table below and full mode details in Section 4.1a). +2. Ask one question: "What is this vault for?" +3. Create full folder structure under `wiki/`. +4. Create a domain page + `_index.md` sub-index for each domain. +5. Create `wiki/overview.md`, `wiki/index.md`, `wiki/log.md`, `wiki/hot.md`. +6. Create `_templates/` with templates for each note type. +7. Apply visual customization (Section 7). Create `.obsidian/snippets/vault-colors.css`. +8. Create vault CLAUDE.md (template in Section 4.1b). +9. Initialize git (Section 8). +10. Present the structure and ask: "Want to adjust anything before we start?" + +**Mode selection:** + +| User says | Best mode | +|-----------|----------| +| "my website", "sitemap", "content audit" | A: Website | +| "my repo", "codebase map", "architecture wiki" | B: GitHub | +| "my business", "project wiki", "competitive intel" | C: Business | +| "second brain", "goals", "journal", "my life" | D: Personal | +| "research topic", "papers", "deep dive" | E: Research | +| "book I'm reading", "course notes", "chapter tracker" | F: Book/Course | + +You can combine modes. "GitHub repo + research on the AI approach" uses Mode B folders plus Mode E papers/ folder. + +### 4.1a — The Six Wiki Modes + +**Mode A: Website / Sitemap** + +``` +vault/ +├── .raw/ # crawl exports, analytics, GSC data +├── wiki/ +│ ├── pages/ # one note per URL +│ ├── structure/ # site architecture, nav hierarchy +│ ├── audits/ # content gaps, redirect needs +│ ├── keywords/ # keyword clusters, target page assignments +│ └── entities/ # brand, authors, topic hubs +``` + +Frontmatter for pages/: `url`, `status` (live|redirect|404|stub|no-index), `h1`, `meta_description`, `word_count`, `has_schema`, `indexed`, `canonical`, `internal_links_in`, `internal_links_out`, `last_crawled` + +Key pages: `[[Site Overview]]`, `[[Navigation Structure]]`, `[[Content Gaps]]`, `[[Redirect Map]]`, `[[Keyword Clusters]]` + +--- + +**Mode B: GitHub / Repository** + +``` +vault/ +├── .raw/ # README, git log exports, code dumps +├── wiki/ +│ ├── modules/ # one note per module / package / service +│ ├── components/ # reusable components +│ ├── decisions/ # Architecture Decision Records +│ ├── dependencies/ # external deps, versions, risk +│ └── flows/ # data flows, request paths, auth flows +``` + +Frontmatter for modules/: `path`, `status` (active|deprecated|experimental|planned), `language`, `purpose`, `maintainer`, `depends_on`, `used_by`, `linked_issues` + +Key pages: `[[Architecture Overview]]`, `[[Data Flow]]`, `[[Tech Stack]]`, `[[Dependency Graph]]`, `[[Key Decisions]]` + +--- + +**Mode C: Business / Project** + +``` +vault/ +├── .raw/ # meeting transcripts, Slack exports, docs +├── wiki/ +│ ├── stakeholders/ # people, companies, decision-makers +│ ├── decisions/ # key decisions with rationale and date +│ ├── deliverables/ # milestones, outputs, status +│ ├── intel/ # competitor analysis, market research +│ └── comms/ # synthesized meeting notes +``` + +Frontmatter for decisions/: `status` (active|pending|done|blocked|superseded), `priority` (1-5), `date`, `owner`, `due_date`, `context` + +Key pages: `[[Project Overview]]`, `[[Stakeholder Map]]`, `[[Decision Log]]`, `[[Competitor Landscape]]` + +--- + +**Mode D: Personal / Second Brain** + +``` +vault/ +├── .raw/ # journal entries, articles, voice transcripts +├── wiki/ +│ ├── goals/ # personal and professional goals +│ ├── learning/ # concepts being mastered +│ ├── people/ # relationships, shared context +│ ├── areas/ # life areas: health, finances, career +│ └── resources/ # books, courses, tools +├── _meta/ +│ └── hot-cache.md # ~500 words of active context +``` + +Frontmatter for goals/: `area` (health|career|finance|creative|relationships|growth), `priority`, `target_date`, `progress` (0-100) + +Key pages: `[[North Star]]`, `[[Weekly Review Template]]`, `[[Annual Goals]]` + +--- + +**Mode E: Research** + +``` +vault/ +├── .raw/ # PDFs, web clips, raw notes +├── wiki/ +│ ├── papers/ # paper summaries with key claims +│ ├── concepts/ # extracted concepts, models, frameworks +│ ├── entities/ # people, organizations, datasets +│ ├── thesis/ # evolving synthesis +│ └── gaps/ # open questions, contradictions +``` + +Frontmatter for papers/: `year`, `authors`, `venue`, `key_claim`, `methodology`, `contradicts`, `supports` + +Key pages: `[[Research Overview]]`, `[[Key Claims Map]]`, `[[Open Questions]]`, `[[Methodology Comparison]]` + +--- + +**Mode F: Book / Course** + +``` +vault/ +├── .raw/ # chapter notes, highlights, exercises +├── wiki/ +│ ├── characters/ # characters, personas, experts +│ ├── themes/ # major themes with evidence +│ ├── concepts/ # domain-specific terms +│ ├── timeline/ # structure, sequence, chapter map +│ └── synthesis/ # your own takeaways and applications +``` + +Frontmatter for concepts/: `source_chapters`, `first_appearance` + +Key pages: `[[Book Overview]]`, `[[Theme Map]]`, `[[Character / Expert Index]]`, `[[My Takeaways]]` + +### 4.1b — Vault CLAUDE.md Template + +Create this in the vault root when scaffolding a new project vault: + +```markdown +# [WIKI NAME] — LLM Wiki + +Mode: [MODE A/B/C/D/E/F] +Purpose: [ONE SENTENCE] +Owner: [NAME] +Created: YYYY-MM-DD + +## Structure + +[PASTE THE FOLDER MAP FROM THE CHOSEN MODE] + +## Conventions + +- All notes use YAML frontmatter: type, status, created, updated, tags (minimum) +- Wikilinks use [[Note Name]] format — filenames are unique, no paths needed +- .raw/ contains source documents — never modify them +- wiki/index.md is the master catalog — update on every ingest +- wiki/log.md is append-only — new entries go at the TOP, never edit past entries + +## Operations + +- Ingest: drop source in .raw/, say "ingest [filename]" +- Query: ask any question — Claude reads index first, then drills in +- Lint: say "lint the wiki" to run a health check +``` + +### 4.2 INGEST — Single Source + +Trigger: user drops a file into `.raw/` or pastes content. + +1. Read the source completely. +2. Discuss key takeaways with the user. Skip if user says "just ingest it." +3. Create source summary in `wiki/sources/`. +4. Create or update entity pages for every person/org/product/repo mentioned. +5. Create or update concept pages for significant ideas. +6. Update relevant domain pages and their `_index.md` sub-indexes. +7. Update `wiki/overview.md` if the big picture changed. +8. Update `wiki/index.md`. Add entries for all new pages. +9. Update `wiki/hot.md` with this ingest's context. +10. Append to `wiki/log.md` (new entries at the TOP): + ```markdown + ## [2026-04-07] ingest | Source Title + - Source: `.raw/articles/filename.md` + - Summary: [[Source Title]] + - Pages created: [[Page 1]], [[Page 2]] + - Pages updated: [[Page 3]], [[Page 4]] + - Key insight: One sentence on what is new. + ``` +11. Check for contradictions. Flag with `> [!contradiction]` callouts on both pages. + +A single source typically touches 8-15 wiki pages. + +### 4.3 INGEST — Batch Mode + +Trigger: user drops multiple files or says "ingest all of these." + +1. List all files to process. Confirm with user. +2. Process each source following the single ingest flow. Defer cross-referencing. +3. After all sources: cross-reference pass. Look for connections between new sources. +4. Update index, hot cache, and log once at the end, not per source. +5. Report: "Processed N sources. Created X pages, updated Y pages. Key connections: ..." + +Batch ingest is less interactive. For 30+ sources, check in after every 10. + +### 4.4 QUERY — Answering Questions + +1. Read `wiki/hot.md` first. It may have the answer. +2. Read `wiki/index.md` to find relevant pages. +3. Read those pages (3-5 typically, 10+ is too many). +4. Synthesize the answer in chat. Cite with wikilinks. +5. Offer to file as a wiki page in `wiki/questions/`. +6. If the question reveals a gap: "I don't have enough on X. Want to find a source?" + +### 4.5 LINT — Health Check + +Trigger: user says "lint" or every 10-20 ingests. + +Checks: orphan pages, dead links, stale claims, missing pages for mentioned concepts, missing cross-references, frontmatter gaps, empty sections. + +Output: `wiki/meta/lint-report-YYYY-MM-DD.md`. Ask before auto-fixing. + +--- + +## 5 — Index and Sub-Indexes + +### wiki/index.md (Master) + +```markdown +--- +type: meta +title: "Wiki Index" +updated: 2026-04-07 +--- +# Wiki Index + +## Domains +- [[Domain Name]] — description (N sources) + +## Entities +- [[Entity Name]] — role (first: [[Source]]) + +## Concepts +- [[Concept Name]] — definition (status: developing) + +## Sources +- [[Source Title]] — author, date, type + +## Questions +- [[Question Title]] — answer summary +``` + +### Domain Sub-Indexes + +Each domain folder gets a `_index.md` with a catalog of just that domain's pages. + +```markdown +--- +type: meta +title: "Entities Index" +updated: 2026-04-07 +--- +# Entities + +## People +- [[Person Name]] — role, org + +## Organizations +- [[Org Name]] — what they do +``` + +### wiki/log.md + +Append-only. New entries go at the TOP. Each entry: `## [YYYY-MM-DD] operation | title` + +Parse recent entries: +```bash +grep "^## \[" wiki/log.md | head -10 +``` + +--- + +## 6 — Cross-Project Referencing + +Any Claude Code project can read your wiki without duplicating context. + +In another project's CLAUDE.md, add: + +```markdown +## Wiki Knowledge Base +Path: ~/Documents/Obsidian Vault + +When you need context not already in this project: +1. Read wiki/hot.md first (recent context, ~500 words) +2. If not enough, read wiki/index.md (full catalog) +3. If you need domain specifics, read wiki//_index.md +4. Only then read individual wiki pages + +Do NOT read the wiki for general coding questions, things already in this +project's context, or tasks unrelated to [your domain]. +``` + +This keeps token usage low. Hot cache costs ~500 tokens. Index costs ~1000 tokens. Individual pages cost 100-300 tokens each. + +--- + +## 7 — Visual Customization + +Apply during scaffold. Create `.obsidian/snippets/vault-colors.css`: + +```css +:root { + --wiki-1: #4fc1ff; --wiki-2: #c586c0; --wiki-3: #dcdcaa; + --wiki-4: #ce9178; --wiki-5: #6a9955; --wiki-6: #d16969; + --wiki-7: #569cd6; +} + +.nav-folder-title[data-path^="wiki/domains"] { color: var(--wiki-1); } +.nav-folder-title[data-path^="wiki/entities"] { color: var(--wiki-2); } +.nav-folder-title[data-path^="wiki/concepts"] { color: var(--wiki-3); } +.nav-folder-title[data-path^="wiki/sources"] { color: var(--wiki-4); } +.nav-folder-title[data-path^="wiki/questions"] { color: var(--wiki-5); } +.nav-folder-title[data-path^="wiki/comparisons"] { color: var(--wiki-6); } +.nav-folder-title[data-path^="wiki/meta"] { color: var(--wiki-7); } +.nav-folder-title[data-path=".raw"] { color: #808080; opacity: 0.6; } + +.callout[data-callout='contradiction'] { --callout-color: 209, 105, 105; --callout-icon: lucide-alert-triangle; } +.callout[data-callout='gap'] { --callout-color: 220, 220, 170; --callout-icon: lucide-help-circle; } +.callout[data-callout='key-insight'] { --callout-color: 79, 193, 255; --callout-icon: lucide-lightbulb; } +.callout[data-callout='stale'] { --callout-color: 128, 128, 128; --callout-icon: lucide-clock; } +``` + +Enable: Settings > Appearance > CSS Snippets > refresh > toggle on. + +### Graph View Groups + +Set in Graph View settings: + +| Query | Color | +|-------|-------| +| `path:wiki/domains` | Blue | +| `path:wiki/entities` | Purple | +| `path:wiki/concepts` | Yellow | +| `path:wiki/sources` | Orange | +| `path:wiki/questions` | Green | +| `path:.raw` | Gray (dimmed) | + +--- + +## 8 — Git Setup + +```bash +cd "$VAULT_PATH" +git init +cat > .gitignore << 'EOF' +.obsidian/workspace.json +.obsidian/workspace-mobile.json +.smart-connections/ +.obsidian-git-data +.trash/ +.DS_Store +node_modules/ +EOF +git add -A && git commit -m "Initial vault scaffold" +``` + +Enable Obsidian Git: Settings > Obsidian Git > Auto backup interval > 15 minutes. + +--- + +## 9 — Dataview Dashboards + +Create in `wiki/meta/dashboard.md` after scaffold: + +````markdown +--- +type: meta +title: "Dashboard" +--- +# Wiki Dashboard + +## Recent Activity +```dataview +TABLE type, status, updated FROM "wiki" SORT updated DESC LIMIT 15 +``` + +## Seed Pages (Need Development) +```dataview +LIST FROM "wiki" WHERE status = "seed" SORT updated ASC +``` + +## Entities Missing Sources +```dataview +LIST FROM "wiki/entities" WHERE !sources OR length(sources) = 0 +``` +```` + +--- + +## 10 — Context Window Management + +Read the minimum needed: + +- Read `hot.md` first. It may already have what you need. +- Read `index.md` second. Find relevant pages, don't scan everything. +- Read domain sub-indexes for focused lookups. +- Read only 3-5 pages per query. 10+ is too many. +- Use search for keyword lookups. Don't scan full pages looking for a word. +- Use PATCH for surgical edits. Never re-read and rewrite a whole file to change one field. +- Keep wiki pages short. 100-300 lines max. Split long pages. +- Don't paste wiki content into chat unless the user asks. Reference by wikilink. + +--- + +## 11 — REST API Quick Reference + +Set these before running any command: + +```bash +API="https://127.0.0.1:27124" +KEY="your-api-key-here" +``` + +**Read a file:** +```bash +curl -sk -H "Authorization: Bearer $KEY" "$API/vault/wiki/index.md" +``` + +**Create or replace a file:** +```bash +curl -sk -X PUT \ + -H "Authorization: Bearer $KEY" \ + -H "Content-Type: text/markdown" \ + --data-binary @file.md \ + "$API/vault/wiki/entities/Name.md" +``` + +**Append to a file:** +```bash +curl -sk -X POST \ + -H "Authorization: Bearer $KEY" \ + -H "Content-Type: text/markdown" \ + --data "- New item" \ + "$API/vault/wiki/log.md" +``` + +**Patch a frontmatter field:** +```bash +curl -sk -X PATCH \ + -H "Authorization: Bearer $KEY" \ + -H "Operation: replace" -H "Target-Type: frontmatter" \ + -H "Target: status" -H "Content-Type: application/json" \ + --data '"mature"' \ + "$API/vault/wiki/concepts/Name.md" +``` + +**Append under a heading:** +```bash +curl -sk -X PATCH \ + -H "Authorization: Bearer $KEY" \ + -H "Operation: append" -H "Target-Type: heading" \ + -H "Target: Connections" -H "Content-Type: text/markdown" \ + --data "- [[New Page]]" \ + "$API/vault/wiki/entities/Name.md" +``` + +**Search:** +```bash +curl -sk -X POST \ + -H "Authorization: Bearer $KEY" \ + "$API/search/simple/?query=machine+learning" +``` + +**Dataview query:** +```bash +curl -sk -X POST \ + -H "Authorization: Bearer $KEY" \ + -H "Content-Type: application/vnd.olrapi.dataview.dql+txt" \ + --data 'TABLE status FROM "wiki" WHERE status = "seed"' \ + "$API/search/" +``` + +--- + +## 12 — Vault CLAUDE.md Template + +When creating a wiki for a new project (not this plugin), create a CLAUDE.md at the vault root: + +```markdown +# [WIKI NAME] — LLM Wiki + +Mode: [MODE A/B/C/D/E/F] +Purpose: [ONE SENTENCE] +Owner: [NAME] +Created: YYYY-MM-DD + +## Structure + +[PASTE THE FOLDER MAP FROM THE CHOSEN MODE] + +## Conventions + +- All notes use YAML frontmatter: type, status, created, updated, tags (minimum) +- Wikilinks use [[Note Name]] format +- .raw/ contains source documents — never modify them +- wiki/index.md is the master catalog — update on every ingest +- wiki/log.md is append-only — new entries go at the TOP + +## Operations + +- Ingest: drop source in .raw/, say "ingest [filename]" +- Query: ask any question +- Lint: say "lint the wiki" +``` + +--- + +## 13 — Conventions + +### Naming + +- **Filenames**: Title Case with spaces (`Machine Learning.md`) +- **Folders**: lowercase with dashes (`wiki/data-models/`) +- **Tags**: lowercase, hierarchical (`#domain/architecture`) +- **Unique filenames** so wikilinks work without paths + +### Writing Style + +- Declarative, present tense. "X uses Y" not "X basically does Y." +- Link liberally. Every mention of a wiki page gets a wikilink. +- Cite sources: `(Source: [[Page]])`. +- Flag uncertainty: `> [!gap] This needs more evidence.` +- Flag contradictions: `> [!contradiction] [[Page A]] claims X, but [[Page B]] says Y.` + +### Cross-referencing + +When updating Page A to mention Page B, check if Page B should link back. Bidirectional links make the graph view useful. + +--- + +## 14 — Canvas Maps + +Create `.canvas` files for visual overviews: + +```json +{ + "nodes": [ + {"id": "1", "type": "file", "file": "wiki/domains/Architecture.md", + "x": 0, "y": 0, "width": 250, "height": 120, "color": "4"}, + {"id": "2", "type": "file", "file": "wiki/domains/APIs.md", + "x": 300, "y": 0, "width": 250, "height": 120, "color": "5"} + ], + "edges": [ + {"id": "e1", "fromNode": "1", "fromSide": "right", + "toNode": "2", "toSide": "left", "toEnd": "arrow"} + ] +} +``` + +Colors map to the CSS scheme: 1=blue, 2=purple, 3=yellow, 4=orange, 5=green, 6=red. + +Create a domain relationship canvas during scaffold. Update as the wiki grows. + +--- + +## Summary + +Your job as the LLM: +1. Set up the vault (once) +2. Scaffold wiki structure from user's domain description +3. Ingest sources: read, summarize, cross-reference, file +4. Maintain hot cache after every operation +5. Answer questions using index > relevant pages > synthesis +6. File good answers back into the wiki +7. Lint periodically: find and fix health issues +8. Never modify .raw/ sources +9. Always update index, sub-indexes, log, and hot cache +10. Always use frontmatter and wikilinks + +The human's job: curate sources, ask good questions, think about what it means. Everything else is on you. + +--- + +*Based on Andrej Karpathy's LLM Wiki pattern. Plugin: cosmic-brain by AgriciDaniel / AI Marketing Hub.* diff --git a/Welcome.md b/Welcome.md new file mode 100644 index 0000000..f9bca28 --- /dev/null +++ b/Welcome.md @@ -0,0 +1,5 @@ +This is your new *vault*. + +Make a note of something, [[create a link]], or try [the Importer](https://help.obsidian.md/Plugins/Importer)! + +When you're ready, delete this note and make the vault your own. \ No newline at end of file diff --git a/_templates/comparison.md b/_templates/comparison.md new file mode 100644 index 0000000..1a7b0a8 --- /dev/null +++ b/_templates/comparison.md @@ -0,0 +1,39 @@ +--- +type: comparison +title: "<% tp.file.title %>" +subjects: + - "[[Subject A]]" + - "[[Subject B]]" +dimensions: + - "dimension 1" + - "dimension 2" +verdict: "Replace with one-line conclusion." +created: <% tp.date.now("YYYY-MM-DD") %> +updated: <% tp.date.now("YYYY-MM-DD") %> +tags: + - comparison +status: seed +related: [] +sources: [] +--- + +# <% tp.file.title %> + +## Overview + +Replace with: why these two things are being compared and what question this answers. + +## Comparison + +| Dimension | Subject A | Subject B | +|-----------|-----------|-----------| +| | | | +| | | | + +## Verdict + +Replace with: one clear conclusion — which is better for what use case. + +## Sources + +- diff --git a/_templates/concept.md b/_templates/concept.md new file mode 100644 index 0000000..d870f06 --- /dev/null +++ b/_templates/concept.md @@ -0,0 +1,40 @@ +--- +type: concept +title: "<% tp.file.title %>" +complexity: intermediate +domain: "" +aliases: [] +created: <% tp.date.now("YYYY-MM-DD") %> +updated: <% tp.date.now("YYYY-MM-DD") %> +tags: + - concept +status: seed +related: [] +sources: [] +--- + +# <% tp.file.title %> + +## Definition + +[What this concept is. Declarative, present tense. One clear paragraph.] + +## How It Works + +[Mechanism or explanation] + +## Why It Matters + +[Significance in this domain] + +## Examples + +- + +## Connections + +- + +## Sources + +- diff --git a/_templates/entity.md b/_templates/entity.md new file mode 100644 index 0000000..b4d7dfa --- /dev/null +++ b/_templates/entity.md @@ -0,0 +1,32 @@ +--- +type: entity +title: "<% tp.file.title %>" +entity_type: person +role: "" +first_mentioned: "[[]]" +created: <% tp.date.now("YYYY-MM-DD") %> +updated: <% tp.date.now("YYYY-MM-DD") %> +tags: + - entity +status: seed +related: [] +sources: [] +--- + +# <% tp.file.title %> + +## Overview + +[Who or what this is. One paragraph.] + +## Key Facts + +- + +## Connections + +- + +## Sources + +- diff --git a/_templates/question.md b/_templates/question.md new file mode 100644 index 0000000..aa848ad --- /dev/null +++ b/_templates/question.md @@ -0,0 +1,31 @@ +--- +type: question +title: "<% tp.file.title %>" +question: "" +answer_quality: draft +created: <% tp.date.now("YYYY-MM-DD") %> +updated: <% tp.date.now("YYYY-MM-DD") %> +tags: + - question +status: developing +related: [] +sources: [] +--- + +# <% tp.file.title %> + +**Question:** [restate the original query] + +## Answer + +[The synthesized answer, with citations to specific wiki pages] + +(Source: [[]]) + +## Confidence + +[draft | solid | definitive] — [why] + +## Related Questions + +- diff --git a/_templates/source.md b/_templates/source.md new file mode 100644 index 0000000..b3d1ba0 --- /dev/null +++ b/_templates/source.md @@ -0,0 +1,39 @@ +--- +type: source +title: "<% tp.file.title %>" +source_type: article +author: "" +date_published: <% tp.date.now("YYYY-MM-DD") %> +url: "" +confidence: medium +key_claims: + - "" +created: <% tp.date.now("YYYY-MM-DD") %> +updated: <% tp.date.now("YYYY-MM-DD") %> +tags: + - source +status: seed +related: [] +sources: [] +--- + +# <% tp.file.title %> + +## Summary + +[2-3 sentence summary of the source] + +## Key Claims + +- + +## Entities Mentioned + +- [[]] — + +## Concepts Introduced + +- [[]] — + +## Notes + diff --git a/agents/wiki-ingest.md b/agents/wiki-ingest.md new file mode 100644 index 0000000..a1a0723 --- /dev/null +++ b/agents/wiki-ingest.md @@ -0,0 +1,56 @@ +--- +name: wiki-ingest +description: > + Parallel batch ingestion agent for the Obsidian wiki vault. Dispatched when multiple + sources need to be ingested simultaneously. Processes one source fully (read, extract, + file entities and concepts, update index) then reports what was created and updated. + Use when the user says "ingest all", "batch ingest", or provides multiple files at once. + Context: User drops 5 transcript files into .raw/ and says "ingest all of these" + assistant: "I'll dispatch parallel agents to process all 5 sources simultaneously." + + Context: User says "process everything in .raw/ that hasn't been ingested yet" + assistant: "I'll use wiki-ingest agents to handle each source in parallel." + +model: sonnet +maxTurns: 30 +tools: Read, Write, Edit, Glob, Grep +--- + +You are a wiki ingestion specialist. Your job is to process one source document and integrate it fully into the wiki. + +You will be given: +- A source file path (in `.raw/`) +- The vault path +- Any specific emphasis the user requested + +## Your Process + +1. Read the source file completely. +2. Read `wiki/index.md` to understand existing wiki pages and avoid duplication. +3. Read `wiki/hot.md` for recent context. +4. Create a source summary page in `wiki/sources/`. Use proper frontmatter. +5. For each significant person, org, product, or repo mentioned: check the index. Create or update the entity page in `wiki/entities/`. +6. For each significant concept, idea, or framework: check the index. Create or update the concept page in `wiki/concepts/`. +7. Update relevant domain pages. Add a brief mention and wikilink to new pages. +8. Update `wiki/entities/_index.md` and `wiki/concepts/_index.md`. +9. Check for contradictions with existing pages. Add `> [!contradiction]` callouts where needed. +10. Return a summary of what you created and updated. + +## Do NOT + +- Modify anything in `.raw/` +- Update `wiki/index.md` or `wiki/log.md` (the orchestrator does this after all agents finish) +- Update `wiki/hot.md` (the orchestrator does this at the end) +- Create duplicate pages + +## Output Format + +When done, report: + +``` +Source: [title] +Created: [[Page 1]], [[Page 2]], [[Page 3]] +Updated: [[Page 4]], [[Page 5]] +Contradictions: [[Page 6]] conflicts with [[Page 7]] on [topic] +Key insight: [one sentence on the most important new information] +``` diff --git a/agents/wiki-lint.md b/agents/wiki-lint.md new file mode 100644 index 0000000..d10807b --- /dev/null +++ b/agents/wiki-lint.md @@ -0,0 +1,63 @@ +--- +name: wiki-lint +description: > + Comprehensive wiki health check agent. Scans for orphan pages, dead links, stale claims, + missing cross-references, frontmatter gaps, and empty sections. Generates a structured + lint report. Dispatched when the user says "lint the wiki", "health check", "wiki audit", + or "clean up". + Context: User says "lint the wiki" after 15 ingests + assistant: "I'll dispatch the wiki-lint agent for a full health check." + + Context: User says "find all orphan pages" + assistant: "I'll use the wiki-lint agent to scan for pages with no inbound links." + +model: sonnet +maxTurns: 40 +tools: Read, Write, Glob, Grep, Bash +--- + +You are a wiki health specialist. Your job is to scan the vault and produce a comprehensive lint report. + +You will be given: +- The vault path +- The scope (full wiki, or a specific folder) + +## Your Process + +1. Read `wiki/index.md` to get the full list of pages. +2. For each wiki page, check: + - Frontmatter has required fields (type, status, created, updated, tags) + - All wikilinks in the page resolve to real files + - All headings have content underneath them + - Page is linked from at least one other page (no orphans) +3. Scan for concepts and entities mentioned in multiple pages but lacking their own page. +4. Scan for unlinked mentions (entity names appearing without `[[` brackets). +5. Check `wiki/index.md` for stale entries pointing to renamed/deleted files. +6. Identify pages with status `seed` that have not been updated in over 30 days. + +## Output + +Create a lint report at `wiki/meta/lint-report-YYYY-MM-DD.md`. + +Use this structure: +``` +## Summary +- Pages scanned: N +- Issues found: N (N critical, N warnings, N suggestions) + +## Critical (must fix) +[dead links, missing required frontmatter] + +## Warnings (should fix) +[orphan pages, stale claims, large pages over 300 lines] + +## Suggestions (worth considering) +[missing pages for frequently mentioned concepts, cross-reference gaps] +``` + +List each issue with: +1. The affected page (wikilink) +2. The specific problem +3. A suggested fix + +Do not auto-fix anything. Report only. The user reviews the report and decides what to fix. diff --git a/commands/autoresearch.md b/commands/autoresearch.md new file mode 100644 index 0000000..b7af429 --- /dev/null +++ b/commands/autoresearch.md @@ -0,0 +1,17 @@ +--- +description: Run an autonomous research loop on a topic. Searches the web, synthesizes findings, and files everything into the wiki as structured pages. +--- + +Read the `autoresearch` skill. Then run the research loop. + +Usage: +- `/autoresearch [topic]` — research a specific topic +- `/autoresearch` — ask "What topic should I research?" + +Before starting, read `skills/autoresearch/references/program.md` to load the research constraints and objectives. + +If no vault is set up yet, say: "No wiki vault found. Run /wiki first to set one up." + +After research is complete, update wiki/index.md, wiki/log.md, and wiki/hot.md. + +Report how many pages were created and what the key findings are. diff --git a/commands/save.md b/commands/save.md new file mode 100644 index 0000000..d48bd67 --- /dev/null +++ b/commands/save.md @@ -0,0 +1,16 @@ +--- +description: Save the current conversation or a specific insight into the wiki vault as a structured note. +--- + +Read the `save` skill. Then run the save workflow for this conversation. + +Usage: +- `/save` — analyze the full conversation and save the most valuable content +- `/save [name]` — save with a specific note title (skip the naming question) +- `/save session` — save a complete session summary +- `/save concept [name]` — explicitly save as a concept page +- `/save decision [name]` — explicitly save as a decision record + +If no vault is set up yet, say: "No wiki vault found. Run /wiki first to set one up." + +Check if a page with the same name already exists. If it does, offer to update it instead of creating a duplicate. diff --git a/commands/wiki.md b/commands/wiki.md new file mode 100644 index 0000000..7bfe161 --- /dev/null +++ b/commands/wiki.md @@ -0,0 +1,23 @@ +--- +description: Bootstrap or check the cosmic-brain wiki vault. Reads the wiki skill and runs setup workflow. +--- + +Read the `wiki` skill. Then run the setup workflow: + +1. Check if Obsidian is installed. If not, offer to install it (see `skills/wiki/references/plugins.md`). +2. Check if this directory has a vault (look for `.obsidian/` folder). If yes, report current vault state. +3. Check if the MCP server is configured (`claude mcp list`). If not, ask if the user wants to set it up. +4. Ask ONE question: "What is this vault for?" + +Then build the entire wiki structure based on the answer. Don't ask more questions. Scaffold it, show what was created, and ask: "Want to adjust anything before we start?" + +Examples of what the user might say: +- "Map the architecture of github.com/org/repo" +- "Build a sitemap and content analysis for example.com" +- "Track my SaaS business — product, customers, metrics, roadmap" +- "Research project on [topic] — papers, concepts, open questions" +- "Personal second brain — health, goals, learning, projects" +- "Organize my YouTube channel — transcripts, topics, tools mentioned" +- "Executive assistant brain — meetings, tasks, business context" + +If the vault is already set up, skip to checking what has been ingested recently and offering to continue where things left off. diff --git a/hooks/hooks.json b/hooks/hooks.json new file mode 100644 index 0000000..d34867e --- /dev/null +++ b/hooks/hooks.json @@ -0,0 +1,26 @@ +{ + "hooks": { + "SessionStart": [ + { + "matcher": "", + "hooks": [ + { + "type": "prompt", + "prompt": "If a vault is configured for this session (check CLAUDE.md for VAULT_PATH or a wiki/ folder in the current directory), silently read wiki/hot.md to restore recent context. Do not announce this. Do not report what you read. Just have the context available." + } + ] + } + ], + "Stop": [ + { + "matcher": "", + "hooks": [ + { + "type": "prompt", + "prompt": "If you read or modified any wiki pages during this session, update wiki/hot.md with a brief summary of what changed (under 500 words). Use the hot cache format: Last Updated, Key Recent Facts, Recent Changes, Active Threads. Keep it factual. Overwrite the file completely — it is a cache, not a journal." + } + ] + } + ] + } +} diff --git a/skills/autoresearch/SKILL.md b/skills/autoresearch/SKILL.md new file mode 100644 index 0000000..9369e03 --- /dev/null +++ b/skills/autoresearch/SKILL.md @@ -0,0 +1,173 @@ +--- +name: autoresearch +description: > + Autonomous iterative research loop. Takes a topic, runs web searches, fetches sources, + synthesizes findings, and files everything into the wiki as structured pages. + Based on Karpathy's autoresearch pattern: program.md configures objectives and constraints, + the loop runs until depth is reached, output goes directly into the knowledge base. + Triggers on: "/autoresearch", "autoresearch", "research [topic]", "deep dive into [topic]", + "investigate [topic]", "find everything about [topic]", "research and file", + "go research", "build a wiki on". +allowed-tools: ["Read", "Write", "Edit", "WebSearch", "WebFetch", "Bash", "Glob", "Grep"] +--- + +# autoresearch — Autonomous Research Loop + +You are a research agent. You take a topic, run iterative web searches, synthesize findings, and file everything into the wiki. The user gets wiki pages, not a chat response. + +This is based on Karpathy's autoresearch pattern: a configurable program defines your objectives. You run the loop until depth is reached. Output goes into the knowledge base. + +--- + +## Before Starting + +Read `references/program.md` to load the research objectives and constraints. This file is user-configurable. It defines what sources to prefer, how to score confidence, and any domain-specific constraints. + +--- + +## Research Loop + +``` +Input: topic (from user command) + +Round 1 — Broad search +1. Decompose topic into 3-5 distinct search angles +2. For each angle: run 2-3 WebSearch queries +3. For top 2-3 results per angle: WebFetch the page +4. Extract from each: key claims, entities, concepts, open questions + +Round 2 — Gap fill +5. Identify what's missing or contradicted from Round 1 +6. Run targeted searches for each gap (max 5 queries) +7. Fetch top results for each gap + +Round 3 — Synthesis check (optional, if gaps remain) +8. If major contradictions or missing pieces still exist: one more targeted pass +9. Otherwise: proceed to filing + +Max rounds: 3 (as set in program.md). Stop when depth is reached or max rounds hit. +``` + +--- + +## Filing Results + +After research is complete, create these pages: + +**wiki/sources/** — one page per major reference found +- Use source frontmatter (type, source_type, author, date_published, url, confidence, key_claims) +- Body: summary of the source, what it contributes to the topic + +**wiki/concepts/** — one page per significant concept extracted +- Only create a page if the concept is substantive enough to stand alone +- Check the index first — update existing concept pages rather than creating duplicates + +**wiki/entities/** — one page per significant person, org, or product identified +- Check the index first — update existing entity pages + +**wiki/questions/** — one synthesis page titled "Research: [Topic]" +- This is the master synthesis. Everything comes together here. +- Sections: Overview, Key Findings, Entities, Concepts, Contradictions, Open Questions, Sources +- Full frontmatter with related links to all pages created in this session + +--- + +## Synthesis Page Structure + +```markdown +--- +type: synthesis +title: "Research: [Topic]" +created: YYYY-MM-DD +updated: YYYY-MM-DD +tags: + - research + - [topic-tag] +status: developing +related: + - "[[Every page created in this session]]" +sources: + - "[[wiki/sources/Source 1]]" + - "[[wiki/sources/Source 2]]" +--- + +# Research: [Topic] + +## Overview +[2-3 sentence summary of what was found] + +## Key Findings +- Finding 1 (Source: [[Source Page]]) +- Finding 2 (Source: [[Source Page]]) +- ... + +## Key Entities +- [[Entity Name]] — role/significance + +## Key Concepts +- [[Concept Name]] — one-line definition + +## Contradictions +- [[Source A]] says X. [[Source B]] says Y. [Brief note on which is more credible and why] + +## Open Questions +- [Question that research didn't fully answer] +- [Gap that needs more sources] + +## Sources +- [[Source 1]] — author, date +- [[Source 2]] — author, date +``` + +--- + +## After Filing + +1. Update `wiki/index.md` — add all new pages to the right sections +2. Append to `wiki/log.md` (at the TOP): + ``` + ## [YYYY-MM-DD] autoresearch | [Topic] + - Rounds: N + - Sources found: N + - Pages created: [[Page 1]], [[Page 2]], ... + - Synthesis: [[Research: Topic]] + - Key finding: [one sentence] + ``` +3. Update `wiki/hot.md` with the research summary + +--- + +## Report to User + +After filing everything: + +``` +Research complete: [Topic] + +Rounds: N | Searches: N | Pages created: N + +Created: + wiki/questions/Research: [Topic].md (synthesis) + wiki/sources/[Source 1].md + wiki/concepts/[Concept 1].md + wiki/entities/[Entity 1].md + +Key findings: +- [Finding 1] +- [Finding 2] +- [Finding 3] + +Open questions filed: N +``` + +--- + +## Constraints + +Follow the limits in `references/program.md`: +- Max rounds (default: 3) +- Max pages per session (default: 15) +- Confidence scoring rules +- Source preference rules + +If a constraint conflicts with completeness, respect the constraint and note what was left out in the Open Questions section. diff --git a/skills/autoresearch/references/program.md b/skills/autoresearch/references/program.md new file mode 100644 index 0000000..00ab180 --- /dev/null +++ b/skills/autoresearch/references/program.md @@ -0,0 +1,75 @@ +# Research Program + +This file configures the autoresearch loop. Edit it to match your domain and research style. The autoresearch skill reads it before every run. + +--- + +## Search Objectives + +Default objectives for every research session: + +- Find authoritative sources (prefer: .edu, peer-reviewed papers, official documentation, primary sources, established publications) +- Extract key entities (people, organizations, products, tools) +- Extract key concepts and frameworks +- Note contradictions between sources +- Identify open questions and research gaps +- Prefer sources from the last 2 years unless the topic is foundational + +--- + +## Confidence Scoring + +Label every claim with confidence when filing: + +- **high** — multiple independent authoritative sources agree +- **medium** — single good source, or sources partially agree +- **low** — speculation, opinion pieces, single informal source, or claim not verified + +Always note the source date for factual claims. Mark claims from sources older than 3 years as potentially stale. + +--- + +## Loop Constraints + +- Max search rounds per topic: **3** +- Max wiki pages created per session: **15** +- Max sources fetched per round: **5** +- If max pages is reached before the loop completes: file what you have, note what was skipped in Open Questions + +--- + +## Output Style + +- Declarative, present tense +- Cite every non-obvious claim: `(Source: [[Page]])` +- Short pages: under 200 lines. Split if longer. +- No hedging language ("it seems", "perhaps", "might be") +- Flag uncertainty explicitly: `> [!gap] This claim needs verification.` + +--- + +## Domain Notes + +[Add domain-specific instructions here. Examples:] + +For AI/tech research: +- Prefer: arXiv, official GitHub repos, official product documentation, Hacker News discussions with high karma +- Note: LLM benchmarks are often gamed — treat leaderboard claims as low confidence unless independently verified + +For business/market research: +- Prefer: company filings, Crunchbase, Bloomberg, verified industry reports +- Flag: press releases as low confidence without independent verification + +For medical/health research: +- Prefer: PubMed, Cochrane reviews, peer-reviewed clinical trials +- Always note: sample size, study type (RCT vs observational), and recency + +--- + +## Exclusions + +Do not cite as high-confidence sources: +- Reddit posts or forums (use as pointers to primary sources only) +- Social media posts +- Undated web pages +- Sources that don't cite their own claims diff --git a/skills/save/SKILL.md b/skills/save/SKILL.md new file mode 100644 index 0000000..40ee071 --- /dev/null +++ b/skills/save/SKILL.md @@ -0,0 +1,116 @@ +--- +name: save +description: > + Save the current conversation, answer, or insight into the Obsidian wiki vault as a + structured note. Analyzes the chat, determines the right note type, creates frontmatter, + files it in the correct wiki folder, and updates index, log, and hot cache. + Triggers on: "save this", "save that answer", "/save", "file this", + "save to wiki", "save this session", "file this conversation", "keep this", + "save this analysis", "add this to the wiki". +allowed-tools: ["Read", "Write", "Edit", "Bash", "Glob"] +--- + +# save — File Conversations Into the Wiki + +Good answers and insights shouldn't disappear into chat history. This skill takes what was just discussed and files it as a permanent wiki page. + +The wiki compounds. Save often. + +--- + +## Note Type Decision + +Determine the best type from the conversation content: + +| Type | Folder | Use when | +|------|--------|---------| +| synthesis | wiki/questions/ | Multi-step analysis, comparison, or answer to a specific question | +| concept | wiki/concepts/ | Explaining or defining an idea, pattern, or framework | +| source | wiki/sources/ | Summary of external material discussed in the session | +| decision | wiki/meta/ | Architectural, project, or strategic decision that was made | +| session | wiki/meta/ | Full session summary — captures everything discussed | + +If the user specifies a type, use that. If not, pick the best fit based on the content. When in doubt, use `synthesis`. + +--- + +## Save Workflow + +1. **Scan** the current conversation. Identify the most valuable content to preserve. +2. **Ask** (if not already named): "What should I call this note?" Keep the name short and descriptive. +3. **Determine** note type using the table above. +4. **Extract** all relevant content from the conversation. Rewrite it in declarative present tense (not "the user asked" but the actual content itself). +5. **Create** the note in the correct folder with full frontmatter. +6. **Collect links**: identify any wiki pages mentioned in the conversation. Add them to `related` in frontmatter. +7. **Update** `wiki/index.md` — add the new entry at the top of the relevant section. +8. **Append** to `wiki/log.md` — new entry at the TOP: + ``` + ## [YYYY-MM-DD] save | Note Title + - Type: [note type] + - Location: wiki/[folder]/Note Title.md + - From: conversation on [brief topic description] + ``` +9. **Update** `wiki/hot.md` to reflect the new addition. +10. **Confirm**: "Saved as [[Note Title]] in wiki/[folder]/." + +--- + +## Frontmatter Template + +```yaml +--- +type: +title: "Note Title" +created: YYYY-MM-DD +updated: YYYY-MM-DD +tags: + - +status: developing +related: + - "[[Any Wiki Page Mentioned]]" +sources: + - "[[.raw/source-if-applicable.md]]" +--- +``` + +For `question` type, add: +```yaml +question: "The original query as asked." +answer_quality: solid +``` + +For `decision` type, add: +```yaml +decision_date: YYYY-MM-DD +status: active +``` + +--- + +## Writing Style + +- Declarative, present tense. Write the knowledge, not the conversation. +- Not: "The user asked about X and Claude explained..." +- Yes: "X works by doing Y. The key insight is Z." +- Include all relevant context. Future sessions should be able to read this page cold. +- Link every mentioned concept, entity, or wiki page with wikilinks. +- Cite sources where applicable: `(Source: [[Page]])`. + +--- + +## What to Save vs. Skip + +Save: +- Non-obvious insights or synthesis +- Decisions with rationale +- Analyses that took significant effort +- Comparisons that are likely to be referenced again +- Research findings + +Skip: +- Mechanical Q&A (lookup questions with obvious answers) +- Setup steps already documented elsewhere +- Temporary debugging sessions with no lasting insight +- Anything already in the wiki + +If it's already in the wiki, update the existing page instead of creating a duplicate. diff --git a/skills/wiki-ingest/SKILL.md b/skills/wiki-ingest/SKILL.md new file mode 100644 index 0000000..7887fd2 --- /dev/null +++ b/skills/wiki-ingest/SKILL.md @@ -0,0 +1,100 @@ +--- +name: wiki-ingest +description: > + Ingest sources into the Obsidian wiki vault. Reads a source, extracts entities + and concepts, creates or updates wiki pages, cross-references, and logs the operation. + Supports single sources and batch mode. Triggers on: "ingest", "process this source", + "add this to the wiki", "read and file this", "batch ingest", "ingest all of these". +allowed-tools: ["Read", "Write", "Edit", "Bash", "Glob", "Grep"] +--- + +# wiki-ingest — Source Ingestion + +Read the source. Write the wiki. Cross-reference everything. A single source typically touches 8-15 wiki pages. + +--- + +## Single Source Ingest + +Trigger: user drops a file into `.raw/` or pastes content. + +Steps: + +1. **Read** the source completely. Do not skim. +2. **Discuss** key takeaways with the user. Ask: "What should I emphasize? How granular?" Skip this if the user says "just ingest it." +3. **Create** source summary in `wiki/sources/`. Use the source frontmatter schema from `references/frontmatter.md`. +4. **Create or update** entity pages for every person, org, product, and repo mentioned. One page per entity. +5. **Create or update** concept pages for significant ideas and frameworks. +6. **Update** relevant domain page(s) and their `_index.md` sub-indexes. +7. **Update** `wiki/overview.md` if the big picture changed. +8. **Update** `wiki/index.md`. Add entries for all new pages. +9. **Update** `wiki/hot.md` with this ingest's context. +10. **Append** to `wiki/log.md` (new entries at the TOP): + ```markdown + ## [YYYY-MM-DD] ingest | Source Title + - Source: `.raw/articles/filename.md` + - Summary: [[Source Title]] + - Pages created: [[Page 1]], [[Page 2]] + - Pages updated: [[Page 3]], [[Page 4]] + - Key insight: One sentence on what is new. + ``` +11. **Check for contradictions.** If new info conflicts with existing pages, add `> [!contradiction]` callouts on both pages. + +--- + +## Batch Ingest + +Trigger: user drops multiple files or says "ingest all of these." + +Steps: + +1. List all files to process. Confirm with user before starting. +2. Process each source following the single ingest flow. Defer cross-referencing between sources until step 3. +3. After all sources: do a cross-reference pass. Look for connections between the newly ingested sources. +4. Update index, hot cache, and log once at the end (not per-source). +5. Report: "Processed N sources. Created X pages, updated Y pages. Here are the key connections I found." + +Batch ingest is less interactive. For 30+ sources, expect significant processing time. Check in with the user after every 10 sources. + +--- + +## Context Window Discipline + +Token budget matters. Follow these rules during ingest: + +- Read `wiki/hot.md` first. If it contains the relevant context, don't re-read full pages. +- Read `wiki/index.md` to find existing pages before creating new ones. +- Read only 3-5 existing pages per ingest. If you need 10+, you are reading too broadly. +- Use PATCH for surgical edits. Never re-read an entire file just to update one field. +- Keep wiki pages short. 100-300 lines max. If a page grows beyond 300 lines, split it. +- Use search (`/search/simple/`) to find specific content without reading full pages. + +--- + +## Contradictions + +When new info contradicts an existing wiki page: + +On the existing page, add: +```markdown +> [!contradiction] Conflict with [[New Source]] +> [[Existing Page]] claims X. [[New Source]] says Y. +> Needs resolution — check dates, context, and primary sources. +``` + +On the new source summary, reference it: +```markdown +> [!contradiction] Contradicts [[Existing Page]] +> This source says Y, but existing wiki says X. See [[Existing Page]] for details. +``` + +Do not silently overwrite old claims. Flag and let the user decide. + +--- + +## What Not to Do + +- Do not modify anything in `.raw/`. These are immutable source documents. +- Do not create duplicate pages. Always check the index and search before creating. +- Do not skip the log entry. Every ingest must be recorded. +- Do not skip the hot cache update. It is what keeps future sessions fast. diff --git a/skills/wiki-lint/SKILL.md b/skills/wiki-lint/SKILL.md new file mode 100644 index 0000000..9a0a58b --- /dev/null +++ b/skills/wiki-lint/SKILL.md @@ -0,0 +1,172 @@ +--- +name: wiki-lint +description: > + Health check the Obsidian wiki vault. Finds orphan pages, dead wikilinks, stale claims, + missing cross-references, frontmatter gaps, and empty sections. Creates or updates + Dataview dashboards. Generates canvas maps. Triggers on: "lint", "health check", + "clean up wiki", "check the wiki", "wiki maintenance", "find orphans", "wiki audit". +allowed-tools: ["Read", "Write", "Edit", "Bash", "Glob", "Grep"] +--- + +# wiki-lint — Wiki Health Check + +Run lint after every 10-15 ingests, or weekly. Ask before auto-fixing anything. Output a lint report to `wiki/meta/lint-report-YYYY-MM-DD.md`. + +--- + +## Lint Checks + +Work through these in order: + +1. **Orphan pages** — wiki pages with no inbound wikilinks. They exist but nothing points to them. +2. **Dead links** — wikilinks that reference a page that does not exist. +3. **Stale claims** — assertions on older pages that newer sources have contradicted or updated. +4. **Missing pages** — concepts or entities mentioned in multiple pages but lacking their own page. +5. **Missing cross-references** — entities mentioned in a page but not linked. +6. **Frontmatter gaps** — pages missing required fields (type, status, created, updated, tags). +7. **Empty sections** — headings with no content underneath. +8. **Stale index entries** — items in `wiki/index.md` pointing to renamed or deleted pages. + +--- + +## Lint Report Format + +Create at `wiki/meta/lint-report-YYYY-MM-DD.md`: + +```markdown +--- +type: meta +title: "Lint Report YYYY-MM-DD" +created: YYYY-MM-DD +updated: YYYY-MM-DD +tags: [meta, lint] +status: developing +--- + +# Lint Report — YYYY-MM-DD + +## Summary +- Pages scanned: N +- Issues found: N +- Auto-fixed: N +- Needs review: N + +## Orphan Pages +- [[Page Name]] — no inbound links. Suggest: link from [[Related Page]] or delete. + +## Dead Links +- [[Missing Page]] — referenced in [[Source Page]] but does not exist. Suggest: create stub or remove link. + +## Missing Pages +- "concept name" — mentioned in [[Page A]], [[Page B]], [[Page C]]. Suggest: create a concept page. + +## Frontmatter Gaps +- [[Page Name]] — missing fields: status, tags + +## Stale Claims +- [[Page Name]] — claim "X" may conflict with newer source [[Newer Source]]. + +## Cross-Reference Gaps +- [[Entity Name]] mentioned in [[Page A]] without a wikilink. +``` + +--- + +## Naming Conventions + +Enforce these during lint: + +| Element | Convention | Example | +|---------|-----------|---------| +| Filenames | Title Case with spaces | `Machine Learning.md` | +| Folders | lowercase with dashes | `wiki/data-models/` | +| Tags | lowercase, hierarchical | `#domain/architecture` | +| Wikilinks | match filename exactly | `[[Machine Learning]]` | + +Filenames must be unique across the vault. Wikilinks work without paths only if filenames are unique. + +--- + +## Writing Style Check + +During lint, flag pages that violate the style guide: + +- Not declarative present tense ("X basically does Y" instead of "X does Y") +- Missing source citations where claims are made +- Uncertainty not flagged with `> [!gap]` +- Contradictions not flagged with `> [!contradiction]` + +--- + +## Dataview Dashboard + +Create or update `wiki/meta/dashboard.md` with these queries: + +````markdown +--- +type: meta +title: "Dashboard" +updated: YYYY-MM-DD +--- +# Wiki Dashboard + +## Recent Activity +```dataview +TABLE type, status, updated FROM "wiki" SORT updated DESC LIMIT 15 +``` + +## Seed Pages (Need Development) +```dataview +LIST FROM "wiki" WHERE status = "seed" SORT updated ASC +``` + +## Entities Missing Sources +```dataview +LIST FROM "wiki/entities" WHERE !sources OR length(sources) = 0 +``` + +## Open Questions +```dataview +LIST FROM "wiki/questions" WHERE answer_quality = "draft" SORT created DESC +``` +```` + +--- + +## Canvas Map + +Create or update `wiki/meta/overview.canvas` for a visual domain map: + +```json +{ + "nodes": [ + { + "id": "1", + "type": "file", + "file": "wiki/overview.md", + "x": 0, "y": 0, + "width": 300, "height": 140, + "color": "1" + } + ], + "edges": [] +} +``` + +Add one node per domain page. Connect domains that have significant cross-references. Colors map to the CSS scheme: 1=blue, 2=purple, 3=yellow, 4=orange, 5=green, 6=red. + +--- + +## Before Auto-Fixing + +Always show the lint report first. Ask: "Should I fix these automatically, or do you want to review each one?" + +Safe to auto-fix: +- Adding missing frontmatter fields with placeholder values +- Creating stub pages for missing entities +- Adding wikilinks for unlinked mentions + +Needs review before fixing: +- Deleting orphan pages (they might be intentionally isolated) +- Resolving contradictions (requires human judgment) +- Merging duplicate pages diff --git a/skills/wiki-query/SKILL.md b/skills/wiki-query/SKILL.md new file mode 100644 index 0000000..e9fff99 --- /dev/null +++ b/skills/wiki-query/SKILL.md @@ -0,0 +1,130 @@ +--- +name: wiki-query +description: > + Answer questions using the Obsidian wiki vault. Reads hot cache first, then index, + then relevant pages. Synthesizes answers with citations. Files good answers back + as wiki pages. Triggers on: "what do you know about", "query:", "what is", "explain", + "summarize", "find in wiki", "search the wiki", "based on the wiki". +allowed-tools: ["Read", "Write", "Bash", "Glob", "Grep"] +--- + +# wiki-query — Query the Wiki + +The wiki has already done the synthesis work. Read strategically, answer precisely, and file good answers back so the knowledge compounds. + +--- + +## Query Workflow + +1. **Read** `wiki/hot.md` first. It may already have the answer or directly relevant context. +2. **Read** `wiki/index.md` to find the most relevant pages (scan for titles and descriptions). +3. **Read** those pages. Follow wikilinks to depth-2 for key entities — no deeper. +4. **Synthesize** the answer in chat. Cite sources with wikilinks: `(Source: [[Page Name]])`. +5. **Offer to file** the answer: "This analysis seems worth keeping. Should I save it as `wiki/questions/answer-name.md`?" +6. If the question reveals a **gap**: say "I don't have enough on X. Want to find a source?" + +--- + +## Token Discipline + +Read the minimum needed: + +| Start with | Cost (approx) | When to stop | +|------------|---------------|--------------| +| hot.md | ~500 tokens | If it has the answer | +| index.md | ~1000 tokens | If you can identify 3-5 relevant pages | +| 3-5 wiki pages | ~300 tokens each | Usually sufficient | +| 10+ wiki pages | expensive | Only for synthesis across the entire wiki | + +If hot.md has the answer, respond without reading further. + +--- + +## Index Format Reference + +The master index (`wiki/index.md`) looks like: + +```markdown +## Domains +- [[Domain Name]] — description (N sources) + +## Entities +- [[Entity Name]] — role (first: [[Source]]) + +## Concepts +- [[Concept Name]] — definition (status: developing) + +## Sources +- [[Source Title]] — author, date, type + +## Questions +- [[Question Title]] — answer summary +``` + +Scan the section headers first to determine which sections to read. + +--- + +## Domain Sub-Index Format + +Each domain folder has a `_index.md` for focused lookups: + +```markdown +--- +type: meta +title: "Entities Index" +updated: YYYY-MM-DD +--- +# Entities + +## People +- [[Person Name]] — role, org + +## Organizations +- [[Org Name]] — what they do + +## Products +- [[Product Name]] — category +``` + +Use sub-indexes when the question is scoped to one domain. Avoid reading the full master index for narrow queries. + +--- + +## Filing Answers Back + +Good answers compound into the wiki. Don't let insights disappear into chat history. + +When filing an answer: + +```yaml +--- +type: question +title: "Short descriptive title" +question: "The exact query as asked." +answer_quality: solid +created: YYYY-MM-DD +updated: YYYY-MM-DD +tags: [question, ] +related: + - "[[Page referenced in answer]]" +sources: + - "[[wiki/sources/relevant-source.md]]" +status: developing +--- +``` + +Then write the answer as the page body. Include citations. Link every mentioned concept or entity. + +After filing, add an entry to `wiki/index.md` under Questions and append to `wiki/log.md`. + +--- + +## Gap Handling + +If the question cannot be answered from the wiki: + +1. Say clearly: "I don't have enough in the wiki to answer this well." +2. Identify the specific gap: "I have nothing on [subtopic]." +3. Suggest: "Want to find a source on this? I can help you search or process one." +4. Do not fabricate. Do not answer from training data if the question is about the specific domain in this wiki. diff --git a/skills/wiki/SKILL.md b/skills/wiki/SKILL.md new file mode 100644 index 0000000..c99fde2 --- /dev/null +++ b/skills/wiki/SKILL.md @@ -0,0 +1,202 @@ +--- +name: wiki +description: > + Claude + Obsidian knowledge companion. Sets up a persistent wiki vault, scaffolds + structure from a one-sentence description, and routes to specialized sub-skills. + Use for setup, scaffolding, cross-project referencing, and hot cache management. + Triggers on: "set up wiki", "scaffold vault", "create knowledge base", "/wiki", + "wiki setup", "obsidian vault", "knowledge base", "second brain setup", + "running notetaker", "persistent memory", "llm wiki". +allowed-tools: ["Read", "Write", "Edit", "Bash", "Glob", "Grep"] +--- + +# wiki — Claude + Obsidian Knowledge Companion + +You are a knowledge architect. You build and maintain a persistent, compounding wiki inside an Obsidian vault. You don't just answer questions. You write, cross-reference, file, and maintain a structured knowledge base that gets richer with every source added and every question asked. + +The wiki is the product. Chat is just the interface. + +The key difference from RAG: the wiki is a persistent artifact. Cross-references are already there. Contradictions have been flagged. Synthesis already reflects everything read. Knowledge compounds like interest. + +--- + +## Architecture + +Three layers: + +``` +vault/ +├── .raw/ # Layer 1: immutable source documents +├── wiki/ # Layer 2: LLM-generated knowledge base +└── CLAUDE.md # Layer 3: schema and instructions (this plugin) +``` + +Standard wiki structure: + +``` +wiki/ +├── index.md # master catalog of all pages +├── log.md # chronological record of all operations +├── hot.md # hot cache: recent context summary (~500 words) +├── overview.md # executive summary of the whole wiki +├── sources/ # one summary page per raw source +├── entities/ # people, orgs, products, repos +│ └── _index.md +├── concepts/ # ideas, patterns, frameworks +│ └── _index.md +├── domains/ # top-level topic areas +│ └── _index.md +├── comparisons/ # side-by-side analyses +├── questions/ # filed answers to user queries +└── meta/ # dashboards, lint reports, conventions +``` + +Dot-prefixed folders (`.raw/`) are hidden in Obsidian's file explorer and graph view. Use this for source documents. + +--- + +## Hot Cache + +`wiki/hot.md` is a ~500-word summary of the most recent context. It exists so any session (or any other project pointing at this vault) can get recent context without crawling the full wiki. + +Update hot.md: +- After every ingest +- After any significant query exchange +- At the end of every session + +Format: +```markdown +--- +type: meta +title: "Hot Cache" +updated: YYYY-MM-DDTHH:MM:SS +--- + +# Recent Context + +## Last Updated +YYYY-MM-DD — [what happened] + +## Key Recent Facts +- [Most important recent takeaway] +- [Second most important] + +## Recent Changes +- Created: [[New Page 1]], [[New Page 2]] +- Updated: [[Existing Page]] (added section on X) +- Flagged: Contradiction between [[Page A]] and [[Page B]] on Y + +## Active Threads +- User is currently researching [topic] +- Open question: [thing still being investigated] +``` + +Keep it under 500 words. It is a cache, not a journal. Overwrite it completely each time. + +--- + +## Operations + +Route to the correct operation based on what the user says: + +| User says | Operation | Sub-skill | +|-----------|-----------|-----------| +| "scaffold", "set up vault", "create wiki" | SCAFFOLD | this skill | +| "ingest [source]", "process this", "add this" | INGEST | `wiki-ingest` | +| "what do you know about X", "query:" | QUERY | `wiki-query` | +| "lint", "health check", "clean up" | LINT | `wiki-lint` | +| "save this", "file this", "/save" | SAVE | `save` | +| "/autoresearch [topic]", "research [topic]" | AUTORESEARCH | `autoresearch` | + +--- + +## SCAFFOLD Operation + +Trigger: user describes what the vault is for. + +Steps: + +1. Determine the wiki mode. Read `references/modes.md` to show the 6 options and pick the best fit. +2. Ask: "What is this vault for?" (one question, then proceed). +3. Create full folder structure under `wiki/` based on the mode. +4. Create domain pages + `_index.md` sub-indexes. +5. Create `wiki/index.md`, `wiki/log.md`, `wiki/hot.md`, `wiki/overview.md`. +6. Create `_templates/` files for each note type. +7. Apply visual customization. Read `references/css-snippets.md`. Create `.obsidian/snippets/vault-colors.css`. +8. Create the vault CLAUDE.md using the template below. +9. Initialize git. Read `references/git-setup.md`. +10. Present the structure and ask: "Want to adjust anything before we start?" + +### Vault CLAUDE.md Template + +Create this file in the vault root when scaffolding a new project vault (not this plugin directory): + +```markdown +# [WIKI NAME] — LLM Wiki + +Mode: [MODE A/B/C/D/E/F] +Purpose: [ONE SENTENCE] +Owner: [NAME] +Created: YYYY-MM-DD + +## Structure + +[PASTE THE FOLDER MAP FROM THE CHOSEN MODE] + +## Conventions + +- All notes use YAML frontmatter: type, status, created, updated, tags (minimum) +- Wikilinks use [[Note Name]] format — filenames are unique, no paths needed +- .raw/ contains source documents — never modify them +- wiki/index.md is the master catalog — update on every ingest +- wiki/log.md is append-only — never edit past entries +- New log entries go at the TOP of the file + +## Operations + +- Ingest: drop source in .raw/, say "ingest [filename]" +- Query: ask any question — Claude reads index first, then drills in +- Lint: say "lint the wiki" to run a health check +- Archive: move cold sources to .archive/ to keep .raw/ clean +``` + +--- + +## Cross-Project Referencing + +This is the force multiplier. Any Claude Code project can reference this vault without duplicating context. + +In another project's CLAUDE.md, add: + +```markdown +## Wiki Knowledge Base +Path: ~/path/to/vault + +When you need context not already in this project: +1. Read wiki/hot.md first (recent context, ~500 words) +2. If not enough, read wiki/index.md (full catalog) +3. If you need domain specifics, read wiki//_index.md +4. Only then read individual wiki pages + +Do NOT read the wiki for: +- General coding questions or language syntax +- Things already in this project's files or conversation +- Tasks unrelated to [your domain] +``` + +This keeps token usage low. Hot cache costs ~500 tokens. Index costs ~1000 tokens. Individual pages cost 100-300 tokens each. + +--- + +## Summary + +Your job as the LLM: +1. Set up the vault (once) +2. Scaffold wiki structure from user's domain description +3. Route ingest, query, and lint to the correct sub-skill +4. Maintain hot cache after every operation +5. Always update index, sub-indexes, log, and hot cache on changes +6. Always use frontmatter and wikilinks +7. Never modify .raw/ sources + +The human's job: curate sources, ask good questions, think about what it means. Everything else is on you. diff --git a/skills/wiki/references/css-snippets.md b/skills/wiki/references/css-snippets.md new file mode 100644 index 0000000..6aa1b63 --- /dev/null +++ b/skills/wiki/references/css-snippets.md @@ -0,0 +1,96 @@ +# Visual Customization + +Apply during scaffold. This makes the file explorer color-coded by folder type and adds custom callout styles. + +--- + +## CSS Snippet + +Create this file at `.obsidian/snippets/vault-colors.css` inside the vault: + +```css +:root { + --wiki-1: #4fc1ff; + --wiki-2: #c586c0; + --wiki-3: #dcdcaa; + --wiki-4: #ce9178; + --wiki-5: #6a9955; + --wiki-6: #d16969; + --wiki-7: #569cd6; +} + +/* Folder colors in file explorer */ +.nav-folder-title[data-path^="wiki/domains"] { color: var(--wiki-1); } +.nav-folder-title[data-path^="wiki/entities"] { color: var(--wiki-2); } +.nav-folder-title[data-path^="wiki/concepts"] { color: var(--wiki-3); } +.nav-folder-title[data-path^="wiki/sources"] { color: var(--wiki-4); } +.nav-folder-title[data-path^="wiki/questions"] { color: var(--wiki-5); } +.nav-folder-title[data-path^="wiki/comparisons"] { color: var(--wiki-6); } +.nav-folder-title[data-path^="wiki/meta"] { color: var(--wiki-7); } +.nav-folder-title[data-path=".raw"] { color: #808080; opacity: 0.6; } + +/* Custom callouts */ +.callout[data-callout='contradiction'] { + --callout-color: 209, 105, 105; + --callout-icon: lucide-alert-triangle; +} +.callout[data-callout='gap'] { + --callout-color: 220, 220, 170; + --callout-icon: lucide-help-circle; +} +.callout[data-callout='key-insight'] { + --callout-color: 79, 193, 255; + --callout-icon: lucide-lightbulb; +} +.callout[data-callout='stale'] { + --callout-color: 128, 128, 128; + --callout-icon: lucide-clock; +} +``` + +--- + +## Enable the Snippet + +Tell the user: Settings > Appearance > CSS Snippets > open folder > paste the file > click the refresh icon > toggle it on. + +--- + +## Graph View Groups + +Guide the user to set these in Graph View settings (click the settings icon in the graph view): + +| Query | Color | +|-------|-------| +| `path:wiki/domains` | Blue (`#4fc1ff`) | +| `path:wiki/entities` | Purple (`#c586c0`) | +| `path:wiki/concepts` | Yellow (`#dcdcaa`) | +| `path:wiki/sources` | Orange (`#ce9178`) | +| `path:wiki/questions` | Green (`#6a9955`) | +| `path:.raw` | Gray (dimmed) | + +--- + +## How the Callouts Look + +Use these in wiki pages to flag important states: + +```markdown +> [!contradiction] Title +> [[Page A]] claims X. [[Page B]] says Y. Needs resolution. + +> [!gap] Title +> This topic has no source yet. Consider finding one. + +> [!key-insight] Title +> The most important takeaway from this section. + +> [!stale] Title +> This claim may be outdated. Source was from 2022. +``` + +--- + +## Minimal Theme (Recommended) + +The color scheme looks best with the Minimal theme. Install via Settings > Appearance > Manage > search "Minimal". diff --git a/skills/wiki/references/frontmatter.md b/skills/wiki/references/frontmatter.md new file mode 100644 index 0000000..6fddf4d --- /dev/null +++ b/skills/wiki/references/frontmatter.md @@ -0,0 +1,107 @@ +# Frontmatter Schema + +Every wiki page starts with flat YAML frontmatter. No nested objects. Obsidian's Properties UI requires flat structure. + +--- + +## Universal Fields + +Every page, no exceptions: + +```yaml +--- +type: +title: "Human-Readable Title" +created: 2026-04-07 +updated: 2026-04-07 +tags: + - + - +status: +related: + - "[[Other Page]]" +sources: + - "[[.raw/articles/source-file.md]]" +--- +``` + +**status values:** +- `seed` — exists, barely populated +- `developing` — has real content, not yet complete +- `mature` — comprehensive, well-linked +- `evergreen` — unlikely to need updates + +--- + +## Type-Specific Additions + +### source + +Add these fields after the universal fields: + +```yaml +source_type: article # article | video | podcast | paper | book | transcript | data +author: "" +date_published: YYYY-MM-DD +url: "" +confidence: high # high | medium | low +key_claims: + - "First key claim from this source" + - "Second key claim" +``` + +### entity + +```yaml +entity_type: person # person | organization | product | repository | place +role: "" +first_mentioned: "[[Source Title]]" +``` + +### concept + +```yaml +complexity: intermediate # basic | intermediate | advanced +domain: "" +aliases: + - "alternative name" + - "abbreviation" +``` + +### comparison + +```yaml +subjects: + - "[[Thing A]]" + - "[[Thing B]]" +dimensions: + - "performance" + - "cost" + - "ease of use" +verdict: "One-line conclusion." +``` + +### question + +```yaml +question: "The original query as asked." +answer_quality: solid # draft | solid | definitive +``` + +### domain + +```yaml +subdomain_of: "" # leave empty for top-level domains +page_count: 0 +``` + +--- + +## Rules + +1. Use flat YAML only. Never nest objects. +2. Dates as `YYYY-MM-DD` strings, not ISO datetime. +3. Lists always use the `- item` format, not inline `[a, b, c]`. +4. Wikilinks in YAML fields must be quoted: `"[[Page Name]]"`. +5. Keep `related` and `sources` as wikilinks, not plain URLs. +6. Update `updated` every time you edit the page content. diff --git a/skills/wiki/references/git-setup.md b/skills/wiki/references/git-setup.md new file mode 100644 index 0000000..34d333a --- /dev/null +++ b/skills/wiki/references/git-setup.md @@ -0,0 +1,58 @@ +# Git Setup + +Initialize git in the vault to get full history and protect against bad writes. + +--- + +## Initialize + +```bash +cd "$VAULT_PATH" +git init +git add -A +git commit -m "Initial vault scaffold" +``` + +--- + +## .gitignore + +The root `.gitignore` in this repo already covers the right exclusions: + +``` +.obsidian/workspace.json +.obsidian/workspace-mobile.json +.smart-connections/ +.obsidian-git-data +.trash/ +.DS_Store +``` + +`workspace.json` changes constantly as you move panes around. Excluding it keeps the diff clean. + +--- + +## Obsidian Git Plugin + +After installing the plugin (see `plugins.md`): + +Settings > Obsidian Git: +- Auto backup interval: **15 minutes** +- Auto backup after file change: on +- Push on backup: on (if you have a remote) +- Commit message: `vault: auto backup {{date}}` + +This runs silently in the background. You get a full history of every note without thinking about it. + +--- + +## Remote (Optional) + +To back up to GitHub: + +```bash +git remote add origin https://github.com/yourname/your-vault +git push -u origin main +``` + +Keep the repo private if the vault contains personal notes. diff --git a/skills/wiki/references/mcp-setup.md b/skills/wiki/references/mcp-setup.md new file mode 100644 index 0000000..5f0e146 --- /dev/null +++ b/skills/wiki/references/mcp-setup.md @@ -0,0 +1,91 @@ +# MCP Setup + +MCP lets Claude read and write vault notes directly without copy-paste. Two options. + +--- + +## Step 1: Install the Local REST API Plugin + +You must do this in Obsidian (Claude cannot do it programmatically): + +1. Obsidian > Settings > Community Plugins > Turn off Restricted Mode +2. Browse > Search "Local REST API" > Install > Enable +3. Settings > Local REST API > Copy the API key + +The plugin runs on `https://127.0.0.1:27124` with a self-signed certificate. + +Test it: +```bash +curl -sk -H "Authorization: Bearer " https://127.0.0.1:27124/ +``` + +You should get a JSON response with vault info. + +--- + +## Option A: mcp-obsidian (REST API based) + +Uses MarkusPfundstein's mcp-obsidian. Requires the Local REST API plugin running. + +```bash +claude mcp add-json obsidian-vault '{ + "type": "stdio", + "command": "uvx", + "args": ["mcp-obsidian"], + "env": { + "OBSIDIAN_API_KEY": "", + "OBSIDIAN_HOST": "127.0.0.1", + "OBSIDIAN_PORT": "27124", + "NODE_TLS_REJECT_UNAUTHORIZED": "0" + } +}' --scope user +``` + +`NODE_TLS_REJECT_UNAUTHORIZED: "0"` is required because the REST API uses a self-signed certificate. + +Capabilities: read notes, write notes, search, patch frontmatter fields, append under headings. + +--- + +## Option B: MCPVault (filesystem based) + +No Obsidian plugin needed. Reads the vault directory directly. + +```bash +claude mcp add-json obsidian-vault '{ + "type": "stdio", + "command": "npx", + "args": ["-y", "@bitbonsai/mcpvault@latest", "/absolute/path/to/your/vault"] +}' --scope user +``` + +Replace `/absolute/path/to/your/vault` with the actual vault path. + +Tools available: `search_notes` (BM25), `read_note`, `create_note`, `update_note`, `get_frontmatter`, `update_frontmatter`, `list_all_tags`, `read_multiple_notes`. + +--- + +## Option C: Direct REST API via curl + +No MCP needed. Use curl in bash throughout the session. See `rest-api.md` for all commands. + +--- + +## Use `--scope user` + +Both MCP options use `--scope user` so the vault is available across all Claude Code projects, not just the one where you ran the command. + +--- + +## Verification + +After setup: + +```bash +claude mcp list # confirm the server appears +claude mcp get obsidian-vault # confirm the path or URL is correct +``` + +In a Claude Code session, type `/mcp` to check connection status. + +Then test: "List all notes in my wiki folder." diff --git a/skills/wiki/references/modes.md b/skills/wiki/references/modes.md new file mode 100644 index 0000000..cf73e91 --- /dev/null +++ b/skills/wiki/references/modes.md @@ -0,0 +1,259 @@ +# Wiki Modes + +Six modes cover the most common use cases. Pick the one that fits, or combine them. + +--- + +## Mode A: Website / Sitemap + +Use when: "build a sitemap wiki for my website", "map content gaps", "SEO audit wiki" + +``` +vault/ +├── .raw/ # crawl exports, analytics, scraped pages, GSC data +├── wiki/ +│ ├── pages/ # one note per URL: status, meta, content summary +│ ├── structure/ # site architecture, nav hierarchy, internal link map +│ ├── audits/ # content gaps, redirect needs, thin content flags +│ ├── keywords/ # keyword clusters, target page assignments +│ └── entities/ # brand, authors, topic hubs +├── _meta/ +│ ├── index.md +│ └── log.md +└── CLAUDE.md +``` + +Frontmatter for `wiki/pages/` notes: +```yaml +--- +type: page +url: "https://example.com/page-slug" +status: live # live | redirect | 404 | stub | no-index +title: "" +h1: "" +meta_description: "" +word_count: 0 +has_schema: false +indexed: true +canonical: "" +internal_links_in: 0 +internal_links_out: 0 +last_crawled: YYYY-MM-DD +tags: [page] +created: YYYY-MM-DD +updated: YYYY-MM-DD +--- +``` + +Key wiki pages to create: `[[Site Overview]]`, `[[Navigation Structure]]`, `[[Content Gaps]]`, `[[Redirect Map]]`, `[[Keyword Clusters]]` + +--- + +## Mode B: GitHub / Repository + +Use when: "map my codebase", "architecture wiki for my repo", "understand this project" + +``` +vault/ +├── .raw/ # README, git log exports, code dumps, issue exports +├── wiki/ +│ ├── modules/ # one note per major module / package / service +│ ├── components/ # reusable UI or functional components +│ ├── decisions/ # Architecture Decision Records (ADRs) +│ ├── dependencies/ # external deps, versions, risk assessment +│ └── flows/ # data flows, request paths, auth flows +├── _meta/ +│ ├── index.md +│ └── log.md +└── CLAUDE.md +``` + +Frontmatter for `wiki/modules/` notes: +```yaml +--- +type: module # module | component | decision | dependency | flow +path: "src/auth/" +status: active # active | deprecated | experimental | planned +language: typescript +purpose: "" +maintainer: "" +last_updated: YYYY-MM-DD +linked_issues: [] +depends_on: [] +used_by: [] +tags: [module] +created: YYYY-MM-DD +updated: YYYY-MM-DD +--- +``` + +Key wiki pages to create: `[[Architecture Overview]]`, `[[Data Flow]]`, `[[Tech Stack]]`, `[[Dependency Graph]]`, `[[Key Decisions]]` + +--- + +## Mode C: Business / Project + +Use when: "project wiki", "competitive intelligence", "team knowledge base", "meeting notes" + +``` +vault/ +├── .raw/ # meeting transcripts, Slack exports, docs, emails +├── wiki/ +│ ├── stakeholders/ # people, companies, decision-makers +│ ├── decisions/ # key decisions with rationale and date +│ ├── deliverables/ # milestones, outputs, status tracking +│ ├── intel/ # competitor analysis, market research +│ └── comms/ # synthesized meeting notes, key threads +├── _meta/ +│ ├── index.md +│ └── log.md +└── CLAUDE.md +``` + +Frontmatter for `wiki/decisions/` notes: +```yaml +--- +type: decision # stakeholder | decision | deliverable | intel | meeting | competitor +status: active # active | pending | done | blocked | superseded +priority: 3 # 1 (highest) to 5 (lowest) +date: YYYY-MM-DD +owner: "" +due_date: "" +context: "" +tags: [decision] +created: YYYY-MM-DD +updated: YYYY-MM-DD +--- +``` + +Key wiki pages to create: `[[Project Overview]]`, `[[Stakeholder Map]]`, `[[Decision Log]]`, `[[Competitor Landscape]]` + +--- + +## Mode D: Personal / Second Brain + +Use when: "personal second brain", "track my goals", "journal synthesis", "life wiki" + +``` +vault/ +├── .raw/ # journal entries, articles, podcast notes, voice transcripts +├── wiki/ +│ ├── goals/ # personal and professional goals with progress tracking +│ ├── learning/ # concepts being mastered, skill development +│ ├── people/ # relationships, shared context, follow-ups +│ ├── areas/ # life areas: health, finances, career, creative +│ └── resources/ # books, courses, tools worth referencing +├── _meta/ +│ ├── index.md +│ ├── log.md +│ └── hot-cache.md # ~500-word summary of most active context +└── CLAUDE.md +``` + +Frontmatter for `wiki/goals/` notes: +```yaml +--- +type: goal # goal | concept | person | area | resource | reflection +status: active # active | paused | completed | abandoned +area: career # health | career | finance | creative | relationships | growth +priority: 1 +target_date: YYYY-MM-DD +progress: 0 # 0-100 percent +tags: [goal] +created: YYYY-MM-DD +updated: YYYY-MM-DD +--- +``` + +Hot cache note: `_meta/hot-cache.md` is a ~500-word file Claude updates at the end of each session. It captures current focus areas, recent wins, and open threads. This prevents Claude from having to crawl the whole wiki to answer "where were we?". + +Key wiki pages to create: `[[North Star]]`, `[[Weekly Review Template]]`, `[[Annual Goals]]` + +--- + +## Mode E: Research + +Use when: "research wiki on [topic]", "track papers I'm reading", "build a thesis" + +``` +vault/ +├── .raw/ # PDFs, web clips, data files, raw notes +├── wiki/ +│ ├── papers/ # paper summaries with key claims and methodology +│ ├── concepts/ # extracted concepts, models, frameworks +│ ├── entities/ # people, organizations, methods, datasets +│ ├── thesis/ # evolving synthesis: the "state of the field" pages +│ └── gaps/ # open questions, contradictions, research needed +├── _meta/ +│ ├── index.md +│ └── log.md +└── CLAUDE.md +``` + +Frontmatter for `wiki/papers/` notes: +```yaml +--- +type: paper # paper | concept | entity | thesis | gap +status: summarized # raw | summarized | synthesized | superseded +year: 2024 +authors: [] +venue: "" +key_claim: "" +methodology: "" +contradicts: [] +supports: [] +tags: [paper] +created: YYYY-MM-DD +updated: YYYY-MM-DD +--- +``` + +Key wiki pages to create: `[[Research Overview]]`, `[[Key Claims Map]]`, `[[Open Questions]]`, `[[Methodology Comparison]]` + +--- + +## Mode F: Book / Course + +Use when: "companion wiki for a book", "course notes wiki", "as I read [title]" + +``` +vault/ +├── .raw/ # chapter notes, highlights, exercises +├── wiki/ +│ ├── characters/ # characters, personas, agents, experts (adapt to content) +│ ├── themes/ # major themes with supporting evidence +│ ├── concepts/ # domain-specific terms and frameworks +│ ├── timeline/ # plot structure, curriculum sequence, chapter map +│ └── synthesis/ # your own takeaways, questions, applications +├── _meta/ +│ ├── index.md +│ └── log.md +└── CLAUDE.md +``` + +Frontmatter for `wiki/concepts/` notes: +```yaml +--- +type: concept # concept | character | theme | chapter | synthesis +status: developing # stub | developing | mature +source_chapters: [] +first_appearance: "" +tags: [concept] +created: YYYY-MM-DD +updated: YYYY-MM-DD +--- +``` + +Key wiki pages to create: `[[Book Overview]]`, `[[Theme Map]]`, `[[Character / Expert Index]]`, `[[My Takeaways]]` + +--- + +## Combining Modes + +You can combine modes. Examples: + +- "GitHub repo + research on the AI approach used" -> Mode B folders + Mode E papers/ folder +- "My SaaS business + second brain" -> Mode C intel/ + Mode D goals/ +- "YouTube channel" -> Mode F (content as "book") + Mode E (research on topics covered) + +When combining, keep folder names distinct. Don't merge `decisions/` from Mode B and Mode C into one folder. diff --git a/skills/wiki/references/plugins.md b/skills/wiki/references/plugins.md new file mode 100644 index 0000000..4d7335c --- /dev/null +++ b/skills/wiki/references/plugins.md @@ -0,0 +1,78 @@ +# Obsidian Setup + +--- + +## Install Obsidian + +### Linux (Flatpak — recommended) + +Check if installed: +```bash +flatpak list 2>/dev/null | grep -i obsidian && echo "FOUND via flatpak" || \ +which obsidian 2>/dev/null && echo "FOUND in PATH" || echo "NOT FOUND" +``` + +Install if not found: +```bash +flatpak install flathub md.obsidian.Obsidian +``` + +### macOS + +```bash +ls /Applications/Obsidian.app 2>/dev/null && echo "FOUND" || brew install --cask obsidian +``` + +### Windows + +```powershell +Test-Path "$env:LOCALAPPDATA\Obsidian" && echo "FOUND" || winget install Obsidian.Obsidian +``` + +### All platforms: direct download + +https://obsidian.md/download + +--- + +## Open the Vault + +After installing: Obsidian > Manage Vaults > Open Folder as Vault > select your vault directory. + +--- + +## Recommended Plugins + +Install via Settings > Community Plugins > Turn off Restricted Mode > Browse. + +| Plugin | Purpose | +|--------|---------| +| **Dataview** | Query vault as a database. Powers dashboards in `wiki/meta/`. | +| **Templater** | Auto-populate frontmatter on note creation from `_templates/`. | +| **Obsidian Git** | Auto-commit every 15 minutes. Protects against bad writes. | +| **Iconize** | Visual folder icons for navigation. | +| **Minimal Theme** | Best dark theme for dense information display. | + +Optional additions: +- **Smart Connections** — semantic search across all notes +- **QuickAdd** — macros for fast note creation +- **Folder Notes** — click a folder to open an overview note + +--- + +## Web Clipper + +The Obsidian Web Clipper browser extension converts web articles to markdown and sends them to `.raw/` in one click. + +Install for Chrome, Firefox, or Safari from the Obsidian website. + +Set the default folder to `.raw/` in the extension settings. + +--- + +## After Installing Plugins + +1. Enable Dataview: Settings > Community Plugins > toggle on +2. Enable Templater: Settings > Templater > set template folder to `_templates` +3. Enable Obsidian Git: Settings > Obsidian Git > Auto backup interval: 15 minutes +4. Enable the CSS snippet: Settings > Appearance > CSS Snippets > toggle on `vault-colors` diff --git a/skills/wiki/references/rest-api.md b/skills/wiki/references/rest-api.md new file mode 100644 index 0000000..74bbe32 --- /dev/null +++ b/skills/wiki/references/rest-api.md @@ -0,0 +1,124 @@ +# REST API Quick Reference + +Use these commands when MCP tools are not available. Requires the Local REST API plugin running in Obsidian (port 27124). + +Set your key before running any command: +```bash +API="https://127.0.0.1:27124" +KEY="your-api-key-here" +``` + +--- + +## Read a file + +```bash +curl -sk \ + -H "Authorization: Bearer $KEY" \ + "$API/vault/wiki/index.md" +``` + +--- + +## Create or replace a file + +```bash +curl -sk -X PUT \ + -H "Authorization: Bearer $KEY" \ + -H "Content-Type: text/markdown" \ + --data-binary @local-file.md \ + "$API/vault/wiki/entities/Name.md" +``` + +Or with inline content: +```bash +curl -sk -X PUT \ + -H "Authorization: Bearer $KEY" \ + -H "Content-Type: text/markdown" \ + --data "# Page Title + +Content here." \ + "$API/vault/wiki/concepts/Name.md" +``` + +--- + +## Append to a file + +```bash +curl -sk -X POST \ + -H "Authorization: Bearer $KEY" \ + -H "Content-Type: text/markdown" \ + --data "- New log entry" \ + "$API/vault/wiki/log.md" +``` + +--- + +## Patch a frontmatter field + +```bash +curl -sk -X PATCH \ + -H "Authorization: Bearer $KEY" \ + -H "Operation: replace" \ + -H "Target-Type: frontmatter" \ + -H "Target: status" \ + -H "Content-Type: application/json" \ + --data '"mature"' \ + "$API/vault/wiki/concepts/Name.md" +``` + +--- + +## Append content under a heading + +```bash +curl -sk -X PATCH \ + -H "Authorization: Bearer $KEY" \ + -H "Operation: append" \ + -H "Target-Type: heading" \ + -H "Target: Connections" \ + -H "Content-Type: text/markdown" \ + --data "- [[New Page]]" \ + "$API/vault/wiki/entities/Name.md" +``` + +--- + +## Search + +Simple keyword search: +```bash +curl -sk -X POST \ + -H "Authorization: Bearer $KEY" \ + "$API/search/simple/?query=machine+learning" +``` + +Dataview query: +```bash +curl -sk -X POST \ + -H "Authorization: Bearer $KEY" \ + -H "Content-Type: application/vnd.olrapi.dataview.dql+txt" \ + --data 'TABLE status FROM "wiki" WHERE status = "seed"' \ + "$API/search/" +``` + +--- + +## List all tags + +```bash +curl -sk \ + -H "Authorization: Bearer $KEY" \ + "$API/tags/" +``` + +--- + +## List files in a folder + +```bash +curl -sk \ + -H "Authorization: Bearer $KEY" \ + "$API/vault/wiki/entities/" +``` diff --git a/wiki/Wiki Map.canvas b/wiki/Wiki Map.canvas new file mode 100644 index 0000000..e0cbc73 --- /dev/null +++ b/wiki/Wiki Map.canvas @@ -0,0 +1,155 @@ +{ + "nodes": [ + { + "id": "label-meta", + "type": "text", + "text": "## Navigation", + "x": -480, + "y": -260, + "width": 160, + "height": 50, + "color": "5" + }, + { + "id": "label-concepts", + "type": "text", + "text": "## Concepts", + "x": 200, + "y": -260, + "width": 140, + "height": 50, + "color": "1" + }, + { + "id": "label-entities", + "type": "text", + "text": "## Entities", + "x": 200, + "y": 160, + "width": 140, + "height": 50, + "color": "3" + }, + { + "id": "label-sources", + "type": "text", + "text": "## Sources", + "x": -480, + "y": 160, + "width": 140, + "height": 50, + "color": "4" + }, + { + "id": "n-index", + "type": "file", + "file": "wiki/index.md", + "x": -460, + "y": -200, + "width": 200, + "height": 80, + "color": "5" + }, + { + "id": "n-hot", + "type": "file", + "file": "wiki/hot.md", + "x": -460, + "y": -100, + "width": 200, + "height": 80, + "color": "5" + }, + { + "id": "n-log", + "type": "file", + "file": "wiki/log.md", + "x": -460, + "y": 0, + "width": 200, + "height": 80, + "color": "5" + }, + { + "id": "n-overview", + "type": "file", + "file": "wiki/overview.md", + "x": -460, + "y": 100, + "width": 200, + "height": 80, + "color": "5" + }, + { + "id": "n-dashboard", + "type": "file", + "file": "wiki/meta/dashboard.md", + "x": -230, + "y": -50, + "width": 200, + "height": 80, + "color": "5" + }, + { + "id": "n-llm-wiki", + "type": "file", + "file": "wiki/concepts/LLM Wiki Pattern.md", + "x": 200, + "y": -200, + "width": 220, + "height": 80, + "color": "1" + }, + { + "id": "n-hot-cache", + "type": "file", + "file": "wiki/concepts/Hot Cache.md", + "x": 200, + "y": -110, + "width": 220, + "height": 80, + "color": "1" + }, + { + "id": "n-compound", + "type": "file", + "file": "wiki/concepts/Compounding Knowledge.md", + "x": 200, + "y": -20, + "width": 220, + "height": 80, + "color": "1" + }, + { + "id": "n-karpathy", + "type": "file", + "file": "wiki/entities/Andrej Karpathy.md", + "x": 200, + "y": 210, + "width": 220, + "height": 80, + "color": "3" + }, + { + "id": "n-source", + "type": "file", + "file": "wiki/sources/Nate Herk LLM Wiki Transcript.md", + "x": -460, + "y": 210, + "width": 220, + "height": 80, + "color": "4" + } + ], + "edges": [ + {"id": "e1", "fromNode": "n-index", "fromSide": "right", "toNode": "n-dashboard", "toSide": "left", "toEnd": "arrow"}, + {"id": "e2", "fromNode": "n-hot", "fromSide": "right", "toNode": "n-dashboard", "toSide": "left", "toEnd": "arrow"}, + {"id": "e3", "fromNode": "n-log", "fromSide": "right", "toNode": "n-dashboard", "toSide": "left", "toEnd": "arrow"}, + {"id": "e4", "fromNode": "n-overview", "fromSide": "right", "toNode": "n-dashboard", "toSide": "left", "toEnd": "arrow"}, + {"id": "e5", "fromNode": "n-dashboard", "fromSide": "right", "toNode": "n-llm-wiki", "toSide": "left", "toEnd": "arrow"}, + {"id": "e6", "fromNode": "n-dashboard", "fromSide": "right", "toNode": "n-hot-cache", "toSide": "left", "toEnd": "arrow"}, + {"id": "e7", "fromNode": "n-dashboard", "fromSide": "right", "toNode": "n-compound", "toSide": "left", "toEnd": "arrow"}, + {"id": "e8", "fromNode": "n-dashboard", "fromSide": "bottom", "toNode": "n-karpathy", "toSide": "left", "toEnd": "arrow"}, + {"id": "e9", "fromNode": "n-source", "fromSide": "right", "toNode": "n-dashboard", "toSide": "bottom", "toEnd": "arrow"} + ] +} diff --git a/wiki/concepts/Compounding Knowledge.md b/wiki/concepts/Compounding Knowledge.md new file mode 100644 index 0000000..1df7564 --- /dev/null +++ b/wiki/concepts/Compounding Knowledge.md @@ -0,0 +1,70 @@ +--- +type: concept +title: "Compounding Knowledge" +complexity: basic +domain: knowledge-management +aliases: + - "Knowledge Compounding" + - "Persistent Synthesis" +created: 2026-04-07 +updated: 2026-04-07 +tags: + - concept + - knowledge-management +status: mature +related: + - "[[LLM Wiki Pattern]]" + - "[[Hot Cache]]" + - "[[Andrej Karpathy]]" + - "[[Nate Herk LLM Wiki Transcript]]" +sources: + - "[[wiki/sources/Nate Herk LLM Wiki Transcript]]" +--- + +# Compounding Knowledge + +The central insight behind the [[LLM Wiki Pattern]]: knowledge in a wiki compounds like interest in a bank. Every source added, every question answered, every analysis filed makes the wiki more valuable — not just by adding pages, but by enriching the connections between existing pages. + +--- + +## Why Normal AI Chats Don't Compound + +In a standard chat, knowledge is ephemeral. Each session starts fresh. Even if you upload the same documents repeatedly, the LLM re-derives the same insights from scratch. Nothing accumulates. + +The same is true of most RAG systems: they index raw documents and retrieve chunks at query time. The retrieval gets the right fragments, but no synthesis is built up. Nothing is compiled. Ask the same complex question twice and you get the same assembly process twice. + +--- + +## How Wiki Knowledge Compounds + +When a new source arrives, the LLM doesn't just index it. It integrates it: +- Updates entity pages with new information +- Flags contradictions with existing claims +- Strengthens or challenges the evolving synthesis +- Adds cross-references from the new source to existing pages and back + +The cross-references are already there next time. The contradictions have already been flagged. The synthesis already reflects everything that was read. + +**The wiki is pre-compiled knowledge.** RAG re-compiles on every query. + +--- + +## The Maintenance Problem + +Wikis maintained by humans decay. The maintenance burden grows faster than the value — updating cross-references, keeping summaries current, noting when new data contradicts old claims. Humans abandon wikis because no one wants to do the bookkeeping. + +LLMs don't get bored. They don't forget to update a cross-reference. The cost of maintenance is near zero. This is the practical reason the wiki pattern works: the entity that's best at the tedious maintenance work is the same entity that reads and writes the wiki. + +--- + +## In Practice + +One X user turned 383 scattered files and over 100 meeting transcripts into a compact wiki and dropped token usage by 95% when querying with Claude. The drop came from two sources: better navigation (index + hot cache vs. full document search) and pre-compiled synthesis (no re-deriving the same insights from scratch). + +--- + +## Connections + +See [[LLM Wiki Pattern]] for the full architecture. +See [[Hot Cache]] for the session context mechanism. +See [[Andrej Karpathy]] for the origin of this framing. diff --git a/wiki/concepts/Hot Cache.md b/wiki/concepts/Hot Cache.md new file mode 100644 index 0000000..29d1fe4 --- /dev/null +++ b/wiki/concepts/Hot Cache.md @@ -0,0 +1,95 @@ +--- +type: concept +title: "Hot Cache" +complexity: basic +domain: knowledge-management +aliases: + - "hot.md" + - "Session Cache" + - "Context Cache" +created: 2026-04-07 +updated: 2026-04-07 +tags: + - concept + - knowledge-management + - context +status: mature +related: + - "[[LLM Wiki Pattern]]" + - "[[Compounding Knowledge]]" + - "[[index]]" + - "[[hot]]" +sources: + - "[[wiki/sources/Nate Herk LLM Wiki Transcript]]" +--- + +# Hot Cache + +A ~500-word summary of the most recent context in the wiki vault. Stored in `wiki/hot.md`. Updated at the end of every session and after every significant ingest or query. + +The hot cache exists to answer one question: "where did we leave off?" A new session reads `hot.md` first. If the answer is there, it skips crawling the rest of the wiki. + +--- + +## What It Stores + +- What was most recently ingested or discussed +- Key recent facts and takeaways +- Pages recently created or updated +- Active threads and open questions +- What the user is currently focused on + +--- + +## Format + +```markdown +--- +type: meta +title: "Hot Cache" +updated: YYYY-MM-DDTHH:MM:SS +--- + +# Recent Context + +## Last Updated +YYYY-MM-DD — [what happened] + +## Key Recent Facts +- [Most important recent takeaway] +- [Second] + +## Recent Changes +- Created: [[New Page 1]] +- Updated: [[Existing Page]] (added section on X) +- Flagged: Contradiction between [[Page A]] and [[Page B]] + +## Active Threads +- User is researching [topic] +- Open question: [thing being investigated] +``` + +--- + +## Rules + +- Keep it under 500 words. It is a cache, not a journal. +- Overwrite it completely each time. Not append-only. +- One file. Not split by date. +- Updated after every ingest, significant query, and at the end of each session. + +--- + +## Why It Matters + +Without the hot cache, every session starts cold: read the index (1000 tokens), read several domain sub-indexes, read several individual pages. With the hot cache, the first 500 tokens often have everything needed. + +Nate Herk reported that adding `hot.md` to his executive assistant vault reduced the token cost of session startup significantly compared to crawling multiple wiki pages. + +The hot cache is especially valuable in cross-project setups: another Claude Code project can point at this vault and read `hot.md` first to get recent context at minimal token cost. + +--- + +## Connections + +The hot cache is part of the [[LLM Wiki Pattern]] token discipline strategy. See [[index]] for how the broader navigation works. diff --git a/wiki/concepts/LLM Wiki Pattern.md b/wiki/concepts/LLM Wiki Pattern.md new file mode 100644 index 0000000..ee69645 --- /dev/null +++ b/wiki/concepts/LLM Wiki Pattern.md @@ -0,0 +1,98 @@ +--- +type: concept +title: "LLM Wiki Pattern" +complexity: intermediate +domain: knowledge-management +aliases: + - "LLM Knowledge Base" + - "Karpathy Wiki" + - "Persistent Wiki" +created: 2026-04-07 +updated: 2026-04-07 +tags: + - concept + - knowledge-management + - llm + - obsidian +status: mature +related: + - "[[Hot Cache]]" + - "[[Compounding Knowledge]]" + - "[[Andrej Karpathy]]" + - "[[Nate Herk LLM Wiki Transcript]]" + - "[[index]]" +sources: + - "[[wiki/sources/Nate Herk LLM Wiki Transcript]]" +--- + +# LLM Wiki Pattern + +A pattern for building persistent, compounding knowledge bases using LLMs. Originated by [[Andrej Karpathy]]. The key insight: instead of re-deriving knowledge from raw documents on every query (RAG), the LLM incrementally builds and maintains a structured wiki that gets richer with every source added. + +--- + +## The Core Idea + +Most AI knowledge tools work like RAG: index raw documents, retrieve chunks at query time, generate an answer. Nothing accumulates. Ask a question that needs five documents and the LLM reassembles fragments every time. + +The wiki pattern is different. When a new source arrives, the LLM reads it, extracts what matters, and integrates it into the wiki: updating entity pages, noting contradictions, strengthening the synthesis. The cross-references are already there. The knowledge is compiled once and kept current. + +**The wiki is a persistent, compounding artifact.** The human curates sources and asks questions. The LLM writes and maintains everything. + +--- + +## Three Layers + +``` +.raw/ Layer 1 — immutable source documents +wiki/ Layer 2 — LLM-generated knowledge base +CLAUDE.md Layer 3 — schema that tells the LLM how to maintain it +``` + +The LLM owns Layer 2 entirely. It creates pages, updates them when new sources arrive, maintains cross-references, and keeps everything consistent. The human reads; the LLM writes. + +--- + +## Operations + +**Ingest** — drop a source into `.raw/`, tell the LLM to process it. The LLM reads the source, discusses key takeaways, writes a summary page, updates entity and concept pages, and logs the operation. One source typically touches 8-15 wiki pages. + +**Query** — ask a question. The LLM reads the index to find relevant pages, synthesizes an answer with citations. Good answers get filed back into the wiki. + +**Lint** — periodic health check. Find orphan pages, dead links, stale claims, missing cross-references. + +--- + +## Index and Log + +**index.md** — content-oriented. A catalog of all pages with one-line summaries, organized by category. The LLM reads this first on every query to find relevant pages. + +**log.md** — chronological. Append-only record of every ingest, query, and lint pass. Parseable: `grep "^## \[" log.md | head -10` + +--- + +## Why It Works + +The tedious part of maintaining a knowledge base is bookkeeping: updating cross-references, noting when new data contradicts old claims, keeping summaries current. Humans abandon wikis because the maintenance burden grows faster than the value. LLMs don't get bored. The wiki stays maintained because the cost of maintenance is near zero. + +At small scale (~100 sources, ~hundreds of pages), the index file is sufficient. No vector database, no embeddings, no infrastructure. Just markdown files. + +--- + +## Comparison to RAG + +| Dimension | LLM Wiki | Semantic RAG | +|-----------|----------|-------------| +| Finding | Reads index, follows links | Similarity search over embeddings | +| Infrastructure | Just markdown files | Embedding model + vector DB | +| Cost | Tokens only | Ongoing compute + storage | +| Maintenance | Run a lint | Re-embed when content changes | +| Scale limit | Hundreds of pages | Millions of documents | + +--- + +## Connections + +See [[Compounding Knowledge]] for why the pattern produces more value over time. +See [[Hot Cache]] for the session context optimization. +See [[Andrej Karpathy]] for the pattern's origin. diff --git a/wiki/entities/Andrej Karpathy.md b/wiki/entities/Andrej Karpathy.md new file mode 100644 index 0000000..3b311ca --- /dev/null +++ b/wiki/entities/Andrej Karpathy.md @@ -0,0 +1,48 @@ +--- +type: entity +title: "Andrej Karpathy" +entity_type: person +role: "AI researcher, educator, founder" +first_mentioned: "[[wiki/sources/Nate Herk LLM Wiki Transcript]]" +created: 2026-04-07 +updated: 2026-04-07 +tags: + - entity + - person + - ai-researcher +status: mature +related: + - "[[LLM Wiki Pattern]]" + - "[[Compounding Knowledge]]" + - "[[Nate Herk LLM Wiki Transcript]]" +sources: + - "[[wiki/sources/Nate Herk LLM Wiki Transcript]]" +--- + +# Andrej Karpathy + +AI researcher and educator. Former Director of AI at Tesla, founding member of OpenAI. Known for deep learning education (Neural Networks: Zero to Hero series, micrograd, nanoGPT) and for publishing practical AI patterns. + +--- + +## Key Contributions to This Wiki + +Karpathy originated the [[LLM Wiki Pattern]] — the idea of using LLMs to build and maintain a persistent, compounding knowledge base rather than re-deriving knowledge from raw documents on every query. + +He published the idea as an "idea file" — intentionally abstract, designed to be copy-pasted into a Claude Code or similar session and built out collaboratively. The cosmic-brain plugin is a production implementation of this pattern. + +His framing: "The wiki is a persistent, compounding artifact. The cross-references are already there. The contradictions have already been flagged. The synthesis already reflects everything you've read." + +--- + +## Notable Quote + +"I thought that I had to reach for fancy RAG, but the LLM has been pretty good at auto-maintaining index files and brief summaries of all documents and reads all the important related data fairly easily at this small scale." + +--- + +## Connections + +- [[LLM Wiki Pattern]] — his core contribution to knowledge management +- [[Compounding Knowledge]] — the central insight he articulated +- cosmic-brain plugin — this repo is a production implementation of his pattern diff --git a/wiki/hot.md b/wiki/hot.md new file mode 100644 index 0000000..3e91335 --- /dev/null +++ b/wiki/hot.md @@ -0,0 +1,38 @@ +--- +type: meta +title: "Hot Cache" +updated: 2026-04-07T12:00:00 +tags: + - meta + - hot-cache +status: evergreen +related: + - "[[index]]" + - "[[log]]" +--- + +# Recent Context + +Navigation: [[index]] | [[log]] | [[overview]] + +--- + +## Last Updated +2026-04-07 — cosmic-brain v1.1.0 initialized. First ingest complete: Nate Herk LLM Wiki transcript. + +## Key Recent Facts +- The wiki pattern was originated by [[Andrej Karpathy]] and makes knowledge compound like interest +- [[Hot Cache]] (this file) enables cross-project context at minimal token cost (~500 tokens) +- [[Compounding Knowledge]] is the core insight: unlike RAG, the wiki pre-compiles synthesis +- One user dropped token usage by 95% switching from inline context files to the wiki pattern +- The index file alone is sufficient at hundreds of pages — no vector RAG needed + +## Recent Changes +- Created: [[LLM Wiki Pattern]], [[Hot Cache]], [[Compounding Knowledge]], [[Andrej Karpathy]] +- Created: [[Nate Herk LLM Wiki Transcript]] (first source) +- Created: seed vault structure (index, log, overview, dashboard) +- Plugin v1.1.0: added /save and /autoresearch commands + +## Active Threads +- Vault is fresh. No user-specific domain scaffolded yet. +- Next step: run /wiki to scaffold for your domain, then start ingesting sources. diff --git a/wiki/index.md b/wiki/index.md new file mode 100644 index 0000000..b09c49c --- /dev/null +++ b/wiki/index.md @@ -0,0 +1,57 @@ +--- +type: meta +title: "Wiki Index" +updated: 2026-04-07 +tags: + - meta + - index +status: evergreen +related: + - "[[overview]]" + - "[[log]]" + - "[[hot]]" +--- + +# Wiki Index + +Last updated: 2026-04-07 | Total pages: 11 | Sources ingested: 1 + +Navigation: [[overview]] | [[log]] | [[hot]] | [[dashboard]] | [[Wiki Map]] + +--- + +## Concepts + +- [[LLM Wiki Pattern]] — the pattern for building persistent, compounding knowledge bases using LLMs (status: mature) +- [[Hot Cache]] — ~500-word session context file, updated after every ingest and session (status: mature) +- [[Compounding Knowledge]] — why wiki knowledge grows more valuable over time, unlike RAG (status: mature) + +--- + +## Entities + +- [[Andrej Karpathy]] — AI researcher, originated the LLM wiki pattern (first: [[Nate Herk LLM Wiki Transcript]]) + +--- + +## Sources + +- [[Nate Herk LLM Wiki Transcript]] — Nate Herk, 2026-04-07, transcript + +--- + +## Questions + + + +--- + +## Comparisons + + + +--- + +## Domains + + diff --git a/wiki/log.md b/wiki/log.md new file mode 100644 index 0000000..c02a386 --- /dev/null +++ b/wiki/log.md @@ -0,0 +1,38 @@ +--- +type: meta +title: "Operation Log" +updated: 2026-04-07 +tags: + - meta + - log +status: evergreen +related: + - "[[index]]" + - "[[hot]]" +--- + +# Operation Log + +Navigation: [[index]] | [[hot]] | [[overview]] + +Append-only. New entries go at the TOP. Never edit past entries. + +Entry format: `## [YYYY-MM-DD] operation | Title` + +Parse recent entries: `grep "^## \[" wiki/log.md | head -10` + +--- + +## [2026-04-07] ingest | Nate Herk LLM Wiki Transcript + +- Source: `.raw/nate-herk-llm-wiki-transcript.md` +- Summary: [[Nate Herk LLM Wiki Transcript]] +- Pages created: [[Nate Herk LLM Wiki Transcript]], [[LLM Wiki Pattern]], [[Hot Cache]], [[Compounding Knowledge]], [[Andrej Karpathy]] +- Pages updated: [[index]], [[log]], [[hot]], [[overview]] +- Key insight: The wiki pattern turns ephemeral AI chat into compounding knowledge — one user dropped token usage by 95%. + +## [2026-04-07] setup | Vault initialized + +- Plugin: cosmic-brain v1.1.0 +- Structure: seed files + first ingest complete +- Skills: wiki, wiki-ingest, wiki-query, wiki-lint, save, autoresearch diff --git a/wiki/meta/dashboard.md b/wiki/meta/dashboard.md new file mode 100644 index 0000000..6b18b9b --- /dev/null +++ b/wiki/meta/dashboard.md @@ -0,0 +1,59 @@ +--- +type: meta +title: "Dashboard" +updated: 2026-04-07 +tags: + - meta + - dashboard +status: evergreen +related: + - "[[index]]" + - "[[overview]]" + - "[[log]]" +--- + +# Wiki Dashboard + +Navigation: [[index]] | [[overview]] | [[log]] | [[hot]] + +Requires the **Dataview** plugin: Settings > Community Plugins > Browse > "Dataview". + +--- + +## Recent Activity + +```dataview +TABLE type, status, updated FROM "wiki" SORT updated DESC LIMIT 15 +``` + +--- + +## Seed Pages (Need Development) + +```dataview +LIST FROM "wiki" WHERE status = "seed" SORT updated ASC +``` + +--- + +## Entities Missing Sources + +```dataview +LIST FROM "wiki/entities" WHERE !sources OR length(sources) = 0 +``` + +--- + +## Open Questions + +```dataview +LIST FROM "wiki/questions" WHERE answer_quality = "draft" SORT created DESC +``` + +--- + +## Sources by Confidence + +```dataview +TABLE author, date_published, confidence FROM "wiki/sources" SORT confidence ASC +``` diff --git a/wiki/overview.md b/wiki/overview.md new file mode 100644 index 0000000..1ec7433 --- /dev/null +++ b/wiki/overview.md @@ -0,0 +1,65 @@ +--- +type: overview +title: "Wiki Overview" +created: 2026-04-07 +updated: 2026-04-07 +tags: + - meta + - overview +status: developing +related: + - "[[index]]" + - "[[hot]]" + - "[[log]]" + - "[[dashboard]]" + - "[[LLM Wiki Pattern]]" +sources: + - "[[wiki/sources/Nate Herk LLM Wiki Transcript]]" +--- + +# Wiki Overview + +Navigation: [[index]] | [[hot]] | [[log]] | [[dashboard]] + +--- + +## Purpose + +This is the cosmic-brain demo vault. It demonstrates the [[LLM Wiki Pattern]] — a system for building persistent, compounding knowledge bases using Claude and Obsidian. + +Run `/wiki` to scaffold this vault for your own domain and replace this overview. + +--- + +## Current Seed Content + +This vault ships with a seeded first ingest based on Nate Herk's breakdown of the Karpathy LLM wiki pattern. + +**Concepts seeded:** +- [[LLM Wiki Pattern]] — the core architecture +- [[Hot Cache]] — session context mechanism +- [[Compounding Knowledge]] — why the pattern works + +**Entities seeded:** +- [[Andrej Karpathy]] — originated the pattern + +**Sources seeded:** +- [[Nate Herk LLM Wiki Transcript]] — practical demonstration of the pattern + +--- + +## Current State + +- Sources ingested: 1 +- Wiki pages: 11 +- Last activity: 2026-04-07 (cosmic-brain v1.1.0 initialized) + +--- + +## Key Themes + +**Knowledge compounds.** Unlike RAG, the wiki pre-compiles synthesis. Cross-references are already there. Contradictions are flagged. Every ingest enriches existing pages rather than adding isolated chunks. + +**The hot cache is the force multiplier.** A ~500-word file captures recent context. New sessions start with full context at minimal token cost. + +**Obsidian is the IDE, Claude is the programmer.** The graph view shows what's connected. The human curates sources and asks questions. Claude writes and maintains everything else. diff --git a/wiki/sources/Nate Herk LLM Wiki Transcript.md b/wiki/sources/Nate Herk LLM Wiki Transcript.md new file mode 100644 index 0000000..4a77c1d --- /dev/null +++ b/wiki/sources/Nate Herk LLM Wiki Transcript.md @@ -0,0 +1,93 @@ +--- +type: source +title: "Nate Herk LLM Wiki Transcript" +source_type: transcript +author: "Nate Herk" +date_published: 2026-04-07 +url: "https://youtube.com/@nateherk" +confidence: high +key_claims: + - "LLM wiki makes knowledge compound like interest — nothing is re-derived on every query" + - "Hot cache (~500 words) enables cross-project context without crawling the full wiki" + - "One article can generate 15-25 wiki pages with full cross-references" + - "One user dropped token usage by 95% switching from inline context files to wiki" + - "Obsidian is the IDE, Claude is the programmer, the wiki is the codebase" + - "Index file is enough at small scale (~100 sources) — no RAG infrastructure needed" +created: 2026-04-07 +updated: 2026-04-07 +tags: + - source + - llm-wiki + - obsidian + - karpathy +status: mature +related: + - "[[LLM Wiki Pattern]]" + - "[[Hot Cache]]" + - "[[Compounding Knowledge]]" + - "[[Andrej Karpathy]]" + - "[[index]]" +sources: + - "[[.raw/nate-herk-llm-wiki-transcript.md]]" +--- + +# Nate Herk LLM Wiki Transcript + +Raw source: [[.raw/nate-herk-llm-wiki-transcript.md]] + +Nate Herk demonstrates the [[LLM Wiki Pattern]] in practice. He shows two live vaults: one for his YouTube transcript archive (36 videos) and one personal second brain. He breaks down Andrej Karpathy's original post and shows a 5-minute setup workflow. + +--- + +## Key Takeaways + +**The core insight**: normal AI chats are ephemeral. The wiki makes knowledge compound. Every source ingested, every question answered, every analysis filed — all of it stays and grows richer over time. + +**The stack is simple**: Claude Code + Obsidian + a folder of markdown files. No vector databases, no embeddings, no infrastructure. Just files and Claude. + +**The hot cache**: a ~500-word file (`wiki/hot.md`) that captures recent context. In an executive assistant setup, this prevented having to crawl dozens of wiki pages at the start of each session. See [[Hot Cache]]. + +**Cross-project referencing**: other Claude Code projects can read this vault by pointing at it in their CLAUDE.md. Nate's executive assistant reads from his herk-brain vault. Token usage dropped significantly compared to inline context files. + +**At scale**: the index file alone is sufficient for hundreds of pages. Vector RAG only becomes necessary at millions of documents. + +--- + +## Obsidian as IDE + +Obsidian is just a markdown viewer with graph visualization. The graph view shows which pages are hubs (many connections) and which are orphans (none). Real-time — you can watch the wiki grow as Claude creates pages. + +The key Obsidian features used: +- Graph view — visualize the knowledge structure +- Backlinks — follow connections between pages +- Dataview — query pages by frontmatter +- Web Clipper — send articles directly to `.raw/` from any browser + +--- + +## Workflow Demonstrated + +1. Install Obsidian, create a vault +2. Paste Karpathy's LLM wiki idea into Claude Code +3. Claude scaffolds the structure (raw/, wiki/, CLAUDE.md, index, log) +4. Drop a source into `.raw/` using Web Clipper +5. Tell Claude: "ingest this" +6. Claude reads, creates 15-25 wiki pages, cross-references everything +7. Query the wiki for insights + +The ingest for one article (AI 2027) took 10 minutes and created 23 pages: 1 source, 6 people, 5 organizations, 1 AI systems page, multiple concepts, plus an analysis. + +--- + +## Entities Mentioned + +- [[Andrej Karpathy]] — originated the LLM wiki pattern +- Nate Herk — demonstrated the pattern in this video + +--- + +## Connections + +See [[LLM Wiki Pattern]] for the full architecture. +See [[Compounding Knowledge]] for the core insight on why this works. +See [[Hot Cache]] for the session context mechanism.