claude-second-brain 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -100,7 +100,7 @@ The wiki ships with a set of slash commands that cover the full workflow. No man
100
100
 
101
101
  ### Daily workflow
102
102
 
103
- **`/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.
103
+ **`/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.
104
104
 
105
105
  **`/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.
106
106
 
@@ -133,6 +133,61 @@ It's a plain GitHub repo. View and edit files directly in the browser at any tim
133
133
 
134
134
  ## How it works
135
135
 
136
+ Sources flow in on the left, Claude synthesizes them into the wiki, qmd indexes every page into a local hybrid search index, and GitHub makes the whole vault editable from Obsidian and Claude Code on any device.
137
+
138
+ ```mermaid
139
+ flowchart TB
140
+ subgraph Sources["raw-sources/ — raw, immutable"]
141
+ direction LR
142
+ S1[articles/]
143
+ S2[pdfs/]
144
+ S3[personal/]
145
+ end
146
+
147
+ subgraph Skills["Claude Code skills"]
148
+ direction LR
149
+ I["/brain-ingest"]
150
+ Q["/brain-search"]
151
+ R["/brain-refresh"]
152
+ end
153
+
154
+ subgraph Wiki["wiki/ — cross-linked synthesis"]
155
+ direction LR
156
+ W1[overview.md]
157
+ W2[topic / entity pages]
158
+ W3[sources/]
159
+ W4[qa/]
160
+ end
161
+
162
+ QMD[("qmd.sqlite<br/>vector + BM25<br/>hybrid index")]
163
+
164
+ subgraph Remote["GitHub — source of truth"]
165
+ GH[private repo]
166
+ end
167
+
168
+ subgraph Read["Read / edit anywhere"]
169
+ direction LR
170
+ OB["Obsidian<br/>graph · backlinks · mobile"]
171
+ CC["Claude Code<br/>desktop + mobile"]
172
+ end
173
+
174
+ User((you))
175
+
176
+ Sources -->|read| I
177
+ I -->|write pages, cross-link,<br/>flag contradictions| Wiki
178
+ R -.->|chunk + embed<br/>changed files| QMD
179
+ Wiki -.->|indexed by| QMD
180
+ User -->|ask a question| Q
181
+ Q -->|hybrid search| QMD
182
+ QMD -->|top-k pages| Q
183
+ Q -->|cited answer| User
184
+ Wiki <-->|"obsidian-git<br/>auto commit / pull"| GH
185
+ GH --> OB
186
+ GH --> CC
187
+ ```
188
+
189
+ ### The ingest loop, zoomed in
190
+
136
191
  ```
137
192
  ┌─────────────────────┐ ┌─────────────────────┐ ┌─────────────────────┐
138
193
  │ Drop in a source │ │ /brain-ingest │ │ Wiki grows │
@@ -171,7 +226,7 @@ All pages cross-link with Obsidian `[[wikilinks]]`. Contradictions are flagged w
171
226
  ```
172
227
  my-brain/
173
228
  ├── CLAUDE.md ← The schema. Claude reads this every session.
174
- ├── sources/ ← Your raw inputs. Claude never modifies these.
229
+ ├── raw-sources/ ← Your raw inputs. Claude never modifies these.
175
230
  │ ├── articles/
176
231
  │ ├── pdfs/
177
232
  │ └── personal/
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "claude-second-brain",
3
- "version": "0.4.0",
4
- "description": "Scaffold an LLM-maintained Obsidian knowledge wiki",
3
+ "version": "0.5.0",
4
+ "description": "The fastest way to start your personal knowledge base powered by Obsidian, Claude Code, qmd, and GitHub.",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "claude-second-brain": "./bin/create.js"
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: brain-ingest
3
3
  description: "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."
4
- argument-hint: "File path (e.g. sources/articles/my-article.md), URL, or leave blank if source is pasted in chat"
4
+ argument-hint: "File path (e.g. raw-sources/articles/my-article.md), URL, or leave blank if source is pasted in chat"
5
5
  ---
6
6
 
7
7
  # Brain Ingest
@@ -10,7 +10,7 @@ Runs the full 9-step ingest workflow defined in CLAUDE.md. Do not skip steps.
10
10
 
11
11
  ## Inputs
12
12
 
13
- - **File path** — a file in `sources/articles/`, `sources/pdfs/`, or `sources/personal/`
13
+ - **File path** — a file in `raw-sources/articles/`, `raw-sources/pdfs/`, or `raw-sources/personal/`
14
14
  - **URL** — fetch and read the full content directly
15
15
  - **Pasted text** — treat whatever the user has shared as the source
16
16
 
@@ -63,6 +63,6 @@ Runs the full 9-step ingest workflow defined in CLAUDE.md. Do not skip steps.
63
63
 
64
64
  ## Hard Rules
65
65
 
66
- - Never modify anything in `sources/` — immutable raw inputs
66
+ - Never modify anything in `raw-sources/` — immutable raw inputs
67
67
  - Every wiki page must have frontmatter with at least `type` and `updated`
68
68
  - One source summary page per source — never merge two sources into one
@@ -12,7 +12,7 @@ Redesigns the qmd schema based on what the wiki actually contains today, then re
12
12
 
13
13
  - The wiki has grown and the current single `wiki` collection no longer matches how the user searches
14
14
  - The user wants finer-grained contexts (e.g. distinct context descriptions per sub-folder)
15
- - After significant reorganization of `wiki/` or `sources/` folder structure
15
+ - After significant reorganization of `wiki/` or `raw-sources/` folder structure
16
16
  - Never as a routine refresh — for that, use `/brain-refresh`
17
17
 
18
18
  ## Procedure
@@ -32,7 +32,7 @@ All commands run from the vault root.
32
32
 
33
33
  ### Step 2 — Analyze the wiki
34
34
 
35
- - Glob `wiki/**/*.md` and `sources/**/*.md`
35
+ - Glob `wiki/**/*.md` and `raw-sources/**/*.md`
36
36
  - Read enough pages (especially `wiki/index.md` and `wiki/overview.md`) to understand actual topic clusters, page-type distribution, and folder structure
37
37
  - Identify natural groupings: by domain (e.g. ml, distributed-systems, finance), by page type (topics vs entities vs qa), by source provenance, etc.
38
38
 
@@ -116,4 +116,4 @@ Confirm the new collections appear, contexts match the plan, and document/embedd
116
116
  - Never apply schema changes without explicit user approval at Step 4
117
117
  - Never delete a collection without first showing the user what will be dropped
118
118
  - Always update `CLAUDE.md` and skill files in lockstep with collection renames — stale `-c <name>` references will silently break `/brain-search`
119
- - Do not touch `wiki/`, `sources/`, or any user content — this skill changes the index schema, not the data
119
+ - Do not touch `wiki/`, `raw-sources/`, or any user content — this skill changes the index schema, not the data
@@ -11,7 +11,7 @@ Refreshes the qmd index so search reflects the current state of the vault. Wraps
11
11
  ## When to Use
12
12
 
13
13
  - After a `/brain-ingest` session (or several) — batch the refresh, don't run after every file edit
14
- - After manual edits to `wiki/` or `sources/` files
14
+ - After manual edits to `wiki/` or `raw-sources/` files
15
15
  - When `/brain-search` results feel stale or miss recently added content
16
16
  - After upgrading `@tobilu/qmd` or changing the embedding model — use `force` mode
17
17
 
@@ -18,7 +18,7 @@ Claude is responsible for: summarizing, cross-referencing, filing, and maintaini
18
18
  ```
19
19
  claude-second-brain/
20
20
  ├── CLAUDE.md ← This file. The schema.
21
- ├── sources/ ← Raw source material. IMMUTABLE — Claude never modifies these.
21
+ ├── raw-sources/ ← Raw source material. IMMUTABLE — Claude never modifies these.
22
22
  │ ├── articles/ ← Web articles saved as markdown
23
23
  │ ├── pdfs/ ← PDF files or extracted text
24
24
  │ └── personal/ ← Personal notes flagged for ingestion
@@ -95,7 +95,7 @@ Run this workflow whenever the user adds a new source. Do not skip steps.
95
95
 
96
96
  **Step 1 — Read the source**
97
97
  - If URL: fetch and read the full content.
98
- - If file in `sources/`: read it with the Read tool.
98
+ - If file in `raw-sources/`: read it with the Read tool.
99
99
  - If pasted text: treat as the source.
100
100
 
101
101
  **Step 2 — Discuss with the user**
@@ -199,7 +199,7 @@ N issues found, N fixed. [Brief summary of notable findings.]
199
199
 
200
200
  ## Hard Rules
201
201
 
202
- 1. **Never modify anything in `sources/`**. These are immutable raw inputs.
202
+ 1. **Never modify anything in `raw-sources/`**. These are immutable raw inputs.
203
203
  2. **Never touch existing vault files** (daily-notes, misc, ideas, root-level .md files, .obsidian/). The wiki lives only in `wiki/`.
204
204
  3. **Always append to `wiki/log.md`** — never overwrite it.
205
205
  4. **One source summary per ingested source** in `wiki/sources/`. Never merge two sources into one summary page.
@@ -36,7 +36,7 @@ Registers the qmd collections and generates local vector embeddings. First run d
36
36
 
37
37
  ### Daily workflow
38
38
 
39
- **`/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.
39
+ **`/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.
40
40
 
41
41
  **`/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.
42
42
 
@@ -54,6 +54,63 @@ Registers the qmd collections and generates local vector embeddings. First run d
54
54
 
55
55
  ---
56
56
 
57
+ ## How it works
58
+
59
+ Sources flow in on the left, Claude synthesizes them into the wiki, qmd indexes every page into a local hybrid search index, and GitHub makes the whole vault editable from Obsidian and Claude Code on any device.
60
+
61
+ ```mermaid
62
+ flowchart TB
63
+ subgraph Sources["raw-sources/ — raw, immutable"]
64
+ direction LR
65
+ S1[articles/]
66
+ S2[pdfs/]
67
+ S3[personal/]
68
+ end
69
+
70
+ subgraph Skills["Claude Code skills"]
71
+ direction LR
72
+ I["/brain-ingest"]
73
+ Q["/brain-search"]
74
+ R["/brain-refresh"]
75
+ end
76
+
77
+ subgraph Wiki["wiki/ — cross-linked synthesis"]
78
+ direction LR
79
+ W1[overview.md]
80
+ W2[topic / entity pages]
81
+ W3[sources/]
82
+ W4[qa/]
83
+ end
84
+
85
+ QMD[("qmd.sqlite<br/>vector + BM25<br/>hybrid index")]
86
+
87
+ subgraph Remote["GitHub — source of truth"]
88
+ GH[private repo]
89
+ end
90
+
91
+ subgraph Read["Read / edit anywhere"]
92
+ direction LR
93
+ OB["Obsidian<br/>graph · backlinks · mobile"]
94
+ CC["Claude Code<br/>desktop + mobile"]
95
+ end
96
+
97
+ User((you))
98
+
99
+ Sources -->|read| I
100
+ I -->|write pages, cross-link,<br/>flag contradictions| Wiki
101
+ R -.->|chunk + embed<br/>changed files| QMD
102
+ Wiki -.->|indexed by| QMD
103
+ User -->|ask a question| Q
104
+ Q -->|hybrid search| QMD
105
+ QMD -->|top-k pages| Q
106
+ Q -->|cited answer| User
107
+ Wiki <-->|"obsidian-git<br/>auto commit / pull"| GH
108
+ GH --> OB
109
+ GH --> CC
110
+ ```
111
+
112
+ ---
113
+
57
114
  ## Obsidian Mobile
58
115
 
59
116
  If this repo lives inside your iCloud Drive folder, Obsidian Mobile reads it with no extra setup. Graph view, backlinks, offline access — all working. The Git plugin handles sync automatically when you commit and push.
@@ -81,7 +138,7 @@ All pages cross-link with Obsidian `[[wikilinks]]`. Contradictions are flagged w
81
138
  ```
82
139
  claude-second-brain/
83
140
  ├── CLAUDE.md ← The schema. Claude reads this every session.
84
- ├── sources/ ← Your raw inputs. Claude never modifies these.
141
+ ├── raw-sources/ ← Your raw inputs. Claude never modifies these.
85
142
  │ ├── articles/ ← Web articles saved as markdown
86
143
  │ ├── pdfs/ ← PDFs or extracted text
87
144
  │ └── personal/ ← Brain dumps, rough notes
@@ -32,7 +32,7 @@ async function ensureCollection(name: string, relPath: string, pattern: string)
32
32
 
33
33
  console.log("Collections:")
34
34
  await ensureCollection("wiki", "wiki", "**/*.md")
35
- await ensureCollection("raw-sources", "sources", "**/*.md")
35
+ await ensureCollection("raw-sources", "raw-sources", "**/*.md")
36
36
 
37
37
  // --- Global context ---
38
38
  console.log("\nContexts:")
@@ -47,7 +47,7 @@ await store.addContext("wiki", "", "LLM-maintained synthesized knowledge
47
47
  await store.addContext("wiki", "/sources", "Source summaries — one page per ingested source, with abstract, key claims, and synthesis notes")
48
48
  await store.addContext("wiki", "/qa", "Filed Q&A answers that synthesize multiple wiki pages around a notable question")
49
49
 
50
- // sources/
50
+ // raw-sources/
51
51
  await store.addContext("raw-sources", "", "Raw source material — immutable originals, never modified after ingestion")
52
52
  await store.addContext("raw-sources", "/articles", "Web articles saved as markdown")
53
53
  await store.addContext("raw-sources", "/pdfs", "PDF files or their extracted text")
File without changes
File without changes