claude-second-brain 0.6.0 → 1.0.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 +48 -32
- package/bin/create.js +588 -67
- package/package.json +3 -2
- package/template/.claude/skills/brain-ingest/SKILL.md +21 -4
- package/template/.claude/skills/brain-rebuild/SKILL.md +9 -9
- package/template/.claude/skills/brain-refresh/SKILL.md +18 -5
- package/template/.claude/skills/brain-search/SKILL.md +17 -5
- package/template/CLAUDE.md +7 -7
- package/template/README.md +17 -19
- package/template/scripts/qmd/reindex.ts +31 -19
- package/template/scripts/qmd/setup.ts +45 -36
- package/template/.claude/skills/qmd-cli/SKILL.md +0 -168
- package/template/.claude/skills/setup/SKILL.md +0 -66
package/README.md
CHANGED
|
@@ -58,26 +58,27 @@ Everything is pre-configured. You bring the sources.
|
|
|
58
58
|
npx claude-second-brain
|
|
59
59
|
```
|
|
60
60
|
|
|
61
|
+
Or install globally — `csb` is a shorter alias:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
npm i -g claude-second-brain
|
|
65
|
+
csb
|
|
66
|
+
```
|
|
67
|
+
|
|
61
68
|
The CLI will ask:
|
|
62
|
-
- **
|
|
63
|
-
- **qmd index path** — where to store the local search index (default: `~/.cache/qmd/index.sqlite`)
|
|
69
|
+
- **Brain name** — what to call this brain (default: `my-brain`)
|
|
64
70
|
- **GitHub repo** — optionally create a private repo and push automatically (requires `gh` CLI)
|
|
65
71
|
|
|
66
|
-
|
|
72
|
+
Creates the brain at `~/.claude-second-brain/my-brain/`, registers it in `~/.claude-second-brain/config.toml`, installs `mise` + `node` + `pnpm`, runs `pnpm install`, and `git init`.
|
|
67
73
|
|
|
68
|
-
**Step 2 —
|
|
74
|
+
**Step 2 — Generate vector embeddings**
|
|
69
75
|
|
|
70
76
|
```bash
|
|
71
|
-
cd my-brain
|
|
77
|
+
cd ~/.claude-second-brain/my-brain
|
|
78
|
+
pnpm qmd:reindex
|
|
72
79
|
```
|
|
73
80
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
```
|
|
77
|
-
/setup
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
Registers the qmd collections and generates local vector embeddings. First run downloads ~2GB of GGUF models — once.
|
|
81
|
+
First run downloads ~2GB of GGUF models — once per machine. qmd collections are already registered by the CLI during scaffolding.
|
|
81
82
|
|
|
82
83
|
**Step 3 — Open in Obsidian (and push to GitHub if not done)**
|
|
83
84
|
|
|
@@ -90,7 +91,7 @@ git remote add origin https://github.com/you/my-brain.git
|
|
|
90
91
|
git push -u origin main
|
|
91
92
|
```
|
|
92
93
|
|
|
93
|
-
Open
|
|
94
|
+
Open `~/.claude-second-brain/my-brain/` as a vault in Obsidian — the folder is already a valid Obsidian vault. The Git plugin is pre-configured — enable it and sync is automatic.
|
|
94
95
|
|
|
95
96
|
---
|
|
96
97
|
|
|
@@ -112,10 +113,6 @@ The wiki ships with a set of slash commands that cover the full workflow. No man
|
|
|
112
113
|
|
|
113
114
|
**`/brain-rebuild`** — **Destructive.** Redesigns the qmd schema: analyzes the wiki, proposes new collections and contexts, waits for your approval, then patches `scripts/qmd/setup.ts`, drops the old index, and rebuilds embeddings from scratch. Use only when the current structure no longer fits how you search.
|
|
114
115
|
|
|
115
|
-
### Setup
|
|
116
|
-
|
|
117
|
-
**`/setup`** — First-time initialization. Registers the qmd collections and generates local vector embeddings. Run once after scaffolding.
|
|
118
|
-
|
|
119
116
|
---
|
|
120
117
|
|
|
121
118
|
## Access from anywhere
|
|
@@ -223,34 +220,53 @@ All pages cross-link with Obsidian `[[wikilinks]]`. Contradictions are flagged w
|
|
|
223
220
|
|
|
224
221
|
## Directory layout
|
|
225
222
|
|
|
223
|
+
All brains live under `~/.claude-second-brain/`. A central `config.toml` tracks them.
|
|
224
|
+
|
|
226
225
|
```
|
|
227
|
-
|
|
228
|
-
├──
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
│
|
|
233
|
-
├──
|
|
234
|
-
│
|
|
235
|
-
|
|
236
|
-
│ ├──
|
|
237
|
-
│ ├──
|
|
238
|
-
│
|
|
239
|
-
|
|
226
|
+
~/.claude-second-brain/
|
|
227
|
+
├── config.toml ← Brain registry (default brain, paths, git remotes)
|
|
228
|
+
└── my-brain/
|
|
229
|
+
├── CLAUDE.md ← The schema. Claude reads this every session.
|
|
230
|
+
├── raw-sources/ ← Your raw inputs. Claude never modifies these.
|
|
231
|
+
│ ├── articles/
|
|
232
|
+
│ ├── pdfs/
|
|
233
|
+
│ └── personal/
|
|
234
|
+
├── wiki/ ← Claude owns this entirely.
|
|
235
|
+
│ ├── index.md
|
|
236
|
+
│ ├── log.md
|
|
237
|
+
│ ├── overview.md
|
|
238
|
+
│ ├── sources/
|
|
239
|
+
│ └── qa/
|
|
240
|
+
├── scripts/qmd/ ← Semantic search setup and re-indexing
|
|
241
|
+
└── .qmd/ ← qmd index (gitignored)
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
## Multiple brains
|
|
245
|
+
|
|
246
|
+
Run `npx claude-second-brain` again to create additional brains. Each gets its own folder, its own qmd index, and its own git remote — fully isolated. The global skills (`/brain-ingest`, `/brain-search`, `/brain-refresh`) always operate on the **default brain** declared in `config.toml`. The first brain you create is set as the default automatically.
|
|
247
|
+
|
|
248
|
+
Manage brains from the CLI:
|
|
249
|
+
|
|
250
|
+
```bash
|
|
251
|
+
npx claude-second-brain ls # list all brains (default marked with *)
|
|
252
|
+
npx claude-second-brain rm <name> # remove a brain (deletes its folder + config entry)
|
|
253
|
+
npx claude-second-brain path # print the default brain's directory
|
|
254
|
+
npx claude-second-brain path --qmd # print the default brain's qmd index path
|
|
255
|
+
npx claude-second-brain qmd -- query -c wiki "<terms>" # run qmd against the default brain
|
|
240
256
|
```
|
|
241
257
|
|
|
242
258
|
---
|
|
243
259
|
|
|
244
260
|
## Installing and updating skills
|
|
245
261
|
|
|
246
|
-
Skills are slash commands Claude Code loads from `.claude/skills/[name]/SKILL.md`. `/brain-ingest`, `/brain-search`, and `/brain-refresh` install globally to `~/.claude/skills/` during setup so they work in any Claude Code session. `/brain-rebuild
|
|
262
|
+
Skills are slash commands Claude Code loads from `.claude/skills/[name]/SKILL.md`. `/brain-ingest`, `/brain-search`, and `/brain-refresh` install globally to `~/.claude/skills/` during setup so they work in any Claude Code session. `/brain-rebuild` and `/lint` live inside the vault at `.claude/skills/`.
|
|
247
263
|
|
|
248
264
|
### Update the built-in wiki skills
|
|
249
265
|
|
|
250
266
|
The wiki's own skills are scaffolded at creation time. To pull in improvements, use `npx skills` pointing to the template skills directory in this repo:
|
|
251
267
|
|
|
252
268
|
```bash
|
|
253
|
-
# Install or update all
|
|
269
|
+
# Install or update all 5 wiki skills from the latest template
|
|
254
270
|
npx skills add https://github.com/jessepinkman9900/claude-second-brain/tree/main/template/.claude/skills -a claude-code -y
|
|
255
271
|
|
|
256
272
|
# Or update a specific skill
|