claude-second-brain 0.4.1 → 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 +3 -3
- package/package.json +2 -2
- package/template/.claude/skills/brain-ingest/SKILL.md +3 -3
- package/template/.claude/skills/brain-rebuild/SKILL.md +3 -3
- package/template/.claude/skills/brain-refresh/SKILL.md +1 -1
- package/template/CLAUDE.md +3 -3
- package/template/README.md +3 -3
- package/template/scripts/qmd/setup.ts +2 -2
- /package/template/{sources → raw-sources}/README.md +0 -0
- /package/template/{sources → raw-sources}/articles/.gitkeep +0 -0
- /package/template/{sources → raw-sources}/pdfs/.gitkeep +0 -0
- /package/template/{sources → raw-sources}/personal/.gitkeep +0 -0
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
|
|
|
@@ -137,7 +137,7 @@ Sources flow in on the left, Claude synthesizes them into the wiki, qmd indexes
|
|
|
137
137
|
|
|
138
138
|
```mermaid
|
|
139
139
|
flowchart TB
|
|
140
|
-
subgraph Sources["sources/ — raw, immutable"]
|
|
140
|
+
subgraph Sources["raw-sources/ — raw, immutable"]
|
|
141
141
|
direction LR
|
|
142
142
|
S1[articles/]
|
|
143
143
|
S2[pdfs/]
|
|
@@ -226,7 +226,7 @@ All pages cross-link with Obsidian `[[wikilinks]]`. Contradictions are flagged w
|
|
|
226
226
|
```
|
|
227
227
|
my-brain/
|
|
228
228
|
├── CLAUDE.md ← The schema. Claude reads this every session.
|
|
229
|
-
├── sources/
|
|
229
|
+
├── raw-sources/ ← Your raw inputs. Claude never modifies these.
|
|
230
230
|
│ ├── articles/
|
|
231
231
|
│ ├── pdfs/
|
|
232
232
|
│ └── personal/
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-second-brain",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
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
|
|
package/template/CLAUDE.md
CHANGED
|
@@ -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/
|
|
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.
|
package/template/README.md
CHANGED
|
@@ -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
|
|
|
@@ -60,7 +60,7 @@ Sources flow in on the left, Claude synthesizes them into the wiki, qmd indexes
|
|
|
60
60
|
|
|
61
61
|
```mermaid
|
|
62
62
|
flowchart TB
|
|
63
|
-
subgraph Sources["sources/ — raw, immutable"]
|
|
63
|
+
subgraph Sources["raw-sources/ — raw, immutable"]
|
|
64
64
|
direction LR
|
|
65
65
|
S1[articles/]
|
|
66
66
|
S2[pdfs/]
|
|
@@ -138,7 +138,7 @@ All pages cross-link with Obsidian `[[wikilinks]]`. Contradictions are flagged w
|
|
|
138
138
|
```
|
|
139
139
|
claude-second-brain/
|
|
140
140
|
├── CLAUDE.md ← The schema. Claude reads this every session.
|
|
141
|
-
├── sources/
|
|
141
|
+
├── raw-sources/ ← Your raw inputs. Claude never modifies these.
|
|
142
142
|
│ ├── articles/ ← Web articles saved as markdown
|
|
143
143
|
│ ├── pdfs/ ← PDFs or extracted text
|
|
144
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",
|
|
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
|
|
File without changes
|
|
File without changes
|