Fastest way to scaffold your LLM powered personal knowledge base - Obsidian, Claude Code, qmd, Github
JavaScript aiampclaude-codecodexcursorgithubknowledge-baseknowledge-graphknowledge-managementllmobsidianobsidian-vaultqmdsecond-brain
refactor: rename sources/ to raw-sources/ to eliminate naming collision with wiki/sources/
jessepinkman9900e8c877b5b61d
diff --git a/.claude/skills/pack-test/SKILL.md b/.claude/skills/pack-test/SKILL.mdindex b7faa16..a7255a7 100644--- a/.claude/skills/pack-test/SKILL.md+++ b/.claude/skills/pack-test/SKILL.md@@ -42,8 +42,8 @@ cat test-vault/.gitignore# Wiki stubsls test-vault/wiki/-# Sources dirs-ls test-vault/sources/+# Raw sources dirs+ls test-vault/raw-sources/# Claude Code skills (expect: brain-ingest, brain-search, brain-refresh, brain-rebuild, lint, qmd-cli, setup)ls test-vault/.claude/skills/@@ -74,7 +74,7 @@ Report results against this checklist:| `.gitignore` | Present (not `.gitignore.template`) | || `wiki/index.md`, `log.md`, `overview.md` | All present | || `wiki/sources/` and `wiki/qa/` | Present | |-| `sources/articles/`, `pdfs/`, `personal/` | Present | |+| `raw-sources/articles/`, `pdfs/`, `personal/` | Present | || `.claude/skills/` — 7 subdirs | brain-ingest, brain-search, brain-refresh, brain-rebuild, lint, qmd-cli, setup | || `scripts/qmd/setup.ts`, `reindex.ts`, `package.json` | All present | || `CLAUDE.md`, `mise.toml` | Present | |diff --git a/.github/workflows/pack-test.yml b/.github/workflows/pack-test.ymlindex c8d6cff..587d017 100644--- a/.github/workflows/pack-test.yml+++ b/.github/workflows/pack-test.yml@@ -52,9 +52,9 @@ jobs:check "wiki/overview.md" test-vault/wiki/overview.mdcheck "wiki/sources/" test-vault/wiki/sourcescheck "wiki/qa/" test-vault/wiki/qa- check "sources/articles/" test-vault/sources/articles- check "sources/pdfs/" test-vault/sources/pdfs- check "sources/personal/" test-vault/sources/personal+ check "raw-sources/articles/" test-vault/raw-sources/articles+ check "raw-sources/pdfs/" test-vault/raw-sources/pdfs+ check "raw-sources/personal/" test-vault/raw-sources/personalcheck ".claude/skills/setup" test-vault/.claude/skills/setupcheck ".claude/skills/brain-ingest" test-vault/.claude/skills/brain-ingestcheck ".claude/skills/brain-search" test-vault/.claude/skills/brain-searchdiff --git a/CLAUDE.md b/CLAUDE.mdindex b864378..480fb48 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -18,7 +18,7 @@ Claude is responsible for: summarizing, cross-referencing, filing, and maintaini```claude-second-brain/├── CLAUDE.md ← This file. The schema.-├── sources/ ← Raw source material. IMMUTABLE — Claude never modifies these.+├── raw-sources/ ← Raw source material. IMMUTABLE — Claude never modifies these.│ ├── articles/ ← Web articles saved as markdown│ ├── pdfs/ ← PDF files or extracted text│ └── personal/ ← Personal notes flagged for ingestion@@ -95,7 +95,7 @@ Run this workflow whenever the user adds a new source. Do not skip steps.**Step 1 — Read the source**- If URL: fetch and read the full content.-- If file in `sources/`: read it with the Read tool.+- If file in `raw-sources/`: read it with the Read tool.- If pasted text: treat as the source.**Step 2 — Discuss with the user**@@ -199,7 +199,7 @@ N issues found, N fixed. [Brief summary of notable findings.]## Hard Rules-1. **Never modify anything in `sources/`**. These are immutable raw inputs.+1. **Never modify anything in `raw-sources/`**. These are immutable raw inputs.2. **Never touch existing vault files** (daily-notes, misc, ideas, root-level .md files, .obsidian/). The wiki lives only in `wiki/`.3. **Always append to `wiki/log.md`** — never overwrite it.4. **One source summary per ingested source** in `wiki/sources/`. Never merge two sources into one summary page.diff --git a/README.md b/README.mdindex 752ce53..49f8e28 100644--- a/README.md+++ b/README.md@@ -100,7 +100,7 @@ The wiki ships with a set of slash commands that cover the full workflow. No man### Daily workflow-**`/brain-ingest`** — Drop a file into `sources/articles/`, `sources/pdfs/`, or `sources/personal/`. Run `/brain-ingest`. Claude summarizes the source, asks what matters most to you, creates a `wiki/sources/` page, updates or creates related topic pages, flags any contradictions with existing knowledge, and logs everything.+**`/brain-ingest`** — Drop a file into `raw-sources/articles/`, `raw-sources/pdfs/`, or `raw-sources/personal/`. Run `/brain-ingest`. Claude summarizes the source, asks what matters most to you, creates a `wiki/sources/` page, updates or creates related topic pages, flags any contradictions with existing knowledge, and logs everything.**`/brain-search`** — Ask anything about what you know. Claude runs hybrid semantic search across the wiki, reads the most relevant pages, and writes an answer with inline `[[wiki/page]]` citations. If the answer synthesizes multiple pages in a novel way, it offers to file it as a permanent `wiki/qa/` entry.@@ -137,7 +137,7 @@ Sources flow in on the left, Claude synthesizes them into the wiki, qmd indexes```mermaidflowchart TB- subgraph Sources["sources/ — raw, immutable"]+ subgraph Sources["raw-sources/ — raw, immutable"]direction LRS1[articles/]S2[pdfs/]@@ -226,7 +226,7 @@ All pages cross-link with Obsidian `[[wikilinks]]`. Contradictions are flagged w```my-brain/├── CLAUDE.md ← The schema. Claude reads this every session.-├── sources/ ← Your raw inputs. Claude never modifies these.+├── raw-sources/ ← Your raw inputs. Claude never modifies these.│ ├── articles/│ ├── pdfs/│ └── personal/diff --git a/template/.claude/skills/brain-ingest/SKILL.md b/template/.claude/skills/brain-ingest/SKILL.mdindex 89d3ee5..a77f493 100644--- a/template/.claude/skills/brain-ingest/SKILL.md+++ b/template/.claude/skills/brain-ingest/SKILL.md@@ -1,7 +1,7 @@---name: brain-ingestdescription: "Ingest a new source into the wiki. Reads the source, summarizes it, creates a wiki/sources/ page, updates affected topic and entity pages, flags contradictions, and logs the activity. Trigger phrases: /brain-ingest, ingest [file or URL], add this source, read and file this, process this article/paper/note."-argument-hint: "File path (e.g. sources/articles/my-article.md), URL, or leave blank if source is pasted in chat"+argument-hint: "File path (e.g. raw-sources/articles/my-article.md), URL, or leave blank if source is pasted in chat"---# Brain Ingest@@ -10,7 +10,7 @@ Runs the full 9-step ingest workflow defined in CLAUDE.md. Do not skip steps.## Inputs-- **File path** — a file in `sources/articles/`, `sources/pdfs/`, or `sources/personal/`+- **File path** — a file in `raw-sources/articles/`, `raw-sources/pdfs/`, or `raw-sources/personal/`- **URL** — fetch and read the full content directly- **Pasted text** — treat whatever the user has shared as the source@@ -63,6 +63,6 @@ Runs the full 9-step ingest workflow defined in CLAUDE.md. Do not skip steps.## Hard Rules-- Never modify anything in `sources/` — immutable raw inputs+- Never modify anything in `raw-sources/` — immutable raw inputs- Every wiki page must have frontmatter with at least `type` and `updated`- One source summary page per source — never merge two sources into onediff --git a/template/.claude/skills/brain-rebuild/SKILL.md b/template/.claude/skills/brain-rebuild/SKILL.mdindex 19a48bb..515df84 100644--- a/template/.claude/skills/brain-rebuild/SKILL.md+++ b/template/.claude/skills/brain-rebuild/SKILL.md@@ -12,7 +12,7 @@ Redesigns the qmd schema based on what the wiki actually contains today, then re- The wiki has grown and the current single `wiki` collection no longer matches how the user searches- The user wants finer-grained contexts (e.g. distinct context descriptions per sub-folder)-- After significant reorganization of `wiki/` or `sources/` folder structure+- After significant reorganization of `wiki/` or `raw-sources/` folder structure- Never as a routine refresh — for that, use `/brain-refresh`## Procedure@@ -32,7 +32,7 @@ All commands run from the vault root.### Step 2 — Analyze the wiki-- Glob `wiki/**/*.md` and `sources/**/*.md`+- Glob `wiki/**/*.md` and `raw-sources/**/*.md`- Read enough pages (especially `wiki/index.md` and `wiki/overview.md`) to understand actual topic clusters, page-type distribution, and folder structure- Identify natural groupings: by domain (e.g. ml, distributed-systems, finance), by page type (topics vs entities vs qa), by source provenance, etc.@@ -116,4 +116,4 @@ Confirm the new collections appear, contexts match the plan, and document/embedd- Never apply schema changes without explicit user approval at Step 4- Never delete a collection without first showing the user what will be dropped- Always update `CLAUDE.md` and skill files in lockstep with collection renames — stale `-c <name>` references will silently break `/brain-search`-- Do not touch `wiki/`, `sources/`, or any user content — this skill changes the index schema, not the data+- Do not touch `wiki/`, `raw-sources/`, or any user content — this skill changes the index schema, not the datadiff --git a/template/.claude/skills/brain-refresh/SKILL.md b/template/.claude/skills/brain-refresh/SKILL.mdindex 7689dea..ceaec3d 100644--- a/template/.claude/skills/brain-refresh/SKILL.md+++ b/template/.claude/skills/brain-refresh/SKILL.md@@ -11,7 +11,7 @@ Refreshes the qmd index so search reflects the current state of the vault. Wraps## When to Use- After a `/brain-ingest` session (or several) — batch the refresh, don't run after every file edit-- After manual edits to `wiki/` or `sources/` files+- After manual edits to `wiki/` or `raw-sources/` files- When `/brain-search` results feel stale or miss recently added content- After upgrading `@tobilu/qmd` or changing the embedding model — use `force` modediff --git a/template/CLAUDE.md b/template/CLAUDE.mdindex 606b58e..3410ee1 100644--- a/template/CLAUDE.md+++ b/template/CLAUDE.md@@ -18,7 +18,7 @@ Claude is responsible for: summarizing, cross-referencing, filing, and maintaini```claude-second-brain/├── CLAUDE.md ← This file. The schema.-├── sources/ ← Raw source material. IMMUTABLE — Claude never modifies these.+├── raw-sources/ ← Raw source material. IMMUTABLE — Claude never modifies these.│ ├── articles/ ← Web articles saved as markdown│ ├── pdfs/ ← PDF files or extracted text│ └── personal/ ← Personal notes flagged for ingestion@@ -95,7 +95,7 @@ Run this workflow whenever the user adds a new source. Do not skip steps.**Step 1 — Read the source**- If URL: fetch and read the full content.-- If file in `sources/`: read it with the Read tool.+- If file in `raw-sources/`: read it with the Read tool.- If pasted text: treat as the source.**Step 2 — Discuss with the user**@@ -199,7 +199,7 @@ N issues found, N fixed. [Brief summary of notable findings.]## Hard Rules-1. **Never modify anything in `sources/`**. These are immutable raw inputs.+1. **Never modify anything in `raw-sources/`**. These are immutable raw inputs.2. **Never touch existing vault files** (daily-notes, misc, ideas, root-level .md files, .obsidian/). The wiki lives only in `wiki/`.3. **Always append to `wiki/log.md`** — never overwrite it.4. **One source summary per ingested source** in `wiki/sources/`. Never merge two sources into one summary page.diff --git a/template/README.md b/template/README.mdindex d80bd5e..029e1e7 100644--- a/template/README.md+++ b/template/README.md@@ -36,7 +36,7 @@ Registers the qmd collections and generates local vector embeddings. First run d### Daily workflow-**`/brain-ingest`** — Add a file to `sources/articles/`, `sources/pdfs/`, or `sources/personal/`, then run `/brain-ingest`. Claude summarizes the source, asks what aspects matter most, updates related wiki pages, flags contradictions, and logs everything.+**`/brain-ingest`** — Add a file to `raw-sources/articles/`, `raw-sources/pdfs/`, or `raw-sources/personal/`, then run `/brain-ingest`. Claude summarizes the source, asks what aspects matter most, updates related wiki pages, flags contradictions, and logs everything.**`/brain-search`** — Ask anything: `what do I know about [topic]?` Claude searches the wiki semantically and returns a cited answer. If it synthesizes multiple pages in a useful way, it offers to file it as a permanent `wiki/qa/` entry.@@ -60,7 +60,7 @@ Sources flow in on the left, Claude synthesizes them into the wiki, qmd indexes```mermaidflowchart TB- subgraph Sources["sources/ — raw, immutable"]+ subgraph Sources["raw-sources/ — raw, immutable"]direction LRS1[articles/]S2[pdfs/]@@ -138,7 +138,7 @@ All pages cross-link with Obsidian `[[wikilinks]]`. Contradictions are flagged w```claude-second-brain/├── CLAUDE.md ← The schema. Claude reads this every session.-├── sources/ ← Your raw inputs. Claude never modifies these.+├── raw-sources/ ← Your raw inputs. Claude never modifies these.│ ├── articles/ ← Web articles saved as markdown│ ├── pdfs/ ← PDFs or extracted text│ └── personal/ ← Brain dumps, rough notesdiff --git a/template/sources/README.md b/template/raw-sources/README.mdsimilarity index 100%rename from template/sources/README.mdrename to template/raw-sources/README.mddiff --git a/template/sources/articles/.gitkeep b/template/raw-sources/articles/.gitkeepsimilarity index 100%rename from template/sources/articles/.gitkeeprename to template/raw-sources/articles/.gitkeepdiff --git a/template/sources/pdfs/.gitkeep b/template/raw-sources/pdfs/.gitkeepsimilarity index 100%rename from template/sources/pdfs/.gitkeeprename to template/raw-sources/pdfs/.gitkeepdiff --git a/template/sources/personal/.gitkeep b/template/raw-sources/personal/.gitkeepsimilarity index 100%rename from template/sources/personal/.gitkeeprename to template/raw-sources/personal/.gitkeepdiff --git a/template/scripts/qmd/setup.ts b/template/scripts/qmd/setup.tsindex 6eb29cb..f00f618 100644--- a/template/scripts/qmd/setup.ts+++ b/template/scripts/qmd/setup.ts@@ -32,7 +32,7 @@ async function ensureCollection(name: string, relPath: string, pattern: string)console.log("Collections:")await ensureCollection("wiki", "wiki", "**/*.md")-await ensureCollection("raw-sources", "sources", "**/*.md")+await ensureCollection("raw-sources", "raw-sources", "**/*.md")// --- Global context ---console.log("\nContexts:")@@ -47,7 +47,7 @@ await store.addContext("wiki", "", "LLM-maintained synthesized knowledgeawait store.addContext("wiki", "/sources", "Source summaries — one page per ingested source, with abstract, key claims, and synthesis notes")await store.addContext("wiki", "/qa", "Filed Q&A answers that synthesize multiple wiki pages around a notable question")-// sources/+// raw-sources/await store.addContext("raw-sources", "", "Raw source material — immutable originals, never modified after ingestion")await store.addContext("raw-sources", "/articles", "Web articles saved as markdown")await store.addContext("raw-sources", "/pdfs", "PDF files or their extracted text")