claude-second-brain 1.2.1 → 1.2.3
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 +7 -7
- package/bin/create.js +23 -7
- package/package.json +24 -3
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ One command gives you a fully wired knowledge system:
|
|
|
19
19
|
- The scaffolded folder **is your Obsidian vault** — open it directly in [Obsidian](https://obsidian.md), with [obsidian-git](https://github.com/Vinzent03/obsidian-git) pre-configured for seamless sync
|
|
20
20
|
- A git ([GitHub](https://github.com), [Cloudflare Artifacts](https://developers.cloudflare.com/artifacts/), or any remote) is the source of truth — version history, anywhere access, and a backup you control
|
|
21
21
|
|
|
22
|
-
You've been reading papers, articles, and books for years. Drop a source in, run `/brain-ingest
|
|
22
|
+
You've been reading papers, articles, and books for years. Drop a source in, run [`/brain-ingest`](https://jessepinkman9900.github.io/claude-second-brain/skills/brain-ingest), and your agent reads it — extracts what matters, cross-links it to everything you already know, and files it. Ask a question six months later and get cited answers, not a list of files to re-read.
|
|
23
23
|
|
|
24
24
|
> **Inspired by [Andrej Karpathy's approach to LLM-powered knowledge management](https://x.com/karpathy/status/2040470801506541998?s=20)** — share an "idea file" with an LLM agent and let it build and maintain your knowledge base.
|
|
25
25
|
|
|
@@ -103,23 +103,23 @@ The wiki ships with a set of slash commands that cover the full workflow. No man
|
|
|
103
103
|
|
|
104
104
|
### Daily workflow
|
|
105
105
|
|
|
106
|
-
|
|
106
|
+
**[`/brain-ingest`](https://jessepinkman9900.github.io/claude-second-brain/skills/brain-ingest)** — Drop a file into `raw-sources/articles/`, `raw-sources/pdfs/`, or `raw-sources/personal/`. Run `/brain-ingest`. Your agent 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.
|
|
107
107
|
|
|
108
|
-
|
|
108
|
+
**[`/brain-search`](https://jessepinkman9900.github.io/claude-second-brain/skills/brain-search)** — Ask anything about what you know. Your agent 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.
|
|
109
109
|
|
|
110
|
-
|
|
110
|
+
**[`/lint`](https://jessepinkman9900.github.io/claude-second-brain/skills/lint)** — Health-check the wiki. Surfaces orphan pages, broken links, unresolved contradictions, and data gaps. Reports findings and applies fixes where possible.
|
|
111
111
|
|
|
112
112
|
### Maintenance
|
|
113
113
|
|
|
114
|
-
|
|
114
|
+
**[`/brain-refresh`](https://jessepinkman9900.github.io/claude-second-brain/skills/brain-refresh)** — Re-scan the vault for new or changed files and regenerate vector embeddings. Run after a bulk ingest session or manual edits. Pass `force` to re-embed every chunk (e.g. after changing the embedding model).
|
|
115
115
|
|
|
116
|
-
|
|
116
|
+
**[`/brain-rebuild`](https://jessepinkman9900.github.io/claude-second-brain/skills/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.
|
|
117
117
|
|
|
118
118
|
---
|
|
119
119
|
|
|
120
120
|
## Works with any agent
|
|
121
121
|
|
|
122
|
-
The wiki skills follow the open [Agent Skills](https://agentskills.io/specification) format, so the same `/brain-ingest
|
|
122
|
+
The wiki skills follow the open [Agent Skills](https://agentskills.io/specification) format, so the same [`/brain-ingest`](https://jessepinkman9900.github.io/claude-second-brain/skills/brain-ingest), [`/brain-search`](https://jessepinkman9900.github.io/claude-second-brain/skills/brain-search), [`/brain-refresh`](https://jessepinkman9900.github.io/claude-second-brain/skills/brain-refresh), [`/brain-rebuild`](https://jessepinkman9900.github.io/claude-second-brain/skills/brain-rebuild) and [`/lint`](https://jessepinkman9900.github.io/claude-second-brain/skills/lint) work in every agent that supports skills. The CLI installs them for the agents you pick:
|
|
123
123
|
|
|
124
124
|
| Agent | Global skills dir | Vault skills dir |
|
|
125
125
|
|---|---|---|
|
package/bin/create.js
CHANGED
|
@@ -748,7 +748,7 @@ async function cmdGitToken(args) {
|
|
|
748
748
|
let printOnly = false
|
|
749
749
|
for (let i = 0; i < args.length; i++) {
|
|
750
750
|
const a = args[i]
|
|
751
|
-
if (a === "--brain") brainName = args
|
|
751
|
+
if (a === "--brain") { brainName = brainFlagValue(args, i); i++ }
|
|
752
752
|
else if (a === "--ttl") ttl = parseTtl(args[++i])
|
|
753
753
|
else if (a.startsWith("--ttl=")) ttl = parseTtl(a.slice(6))
|
|
754
754
|
else if (a === "--read") scope = "read"
|
|
@@ -806,7 +806,7 @@ async function cmdSkills(args) {
|
|
|
806
806
|
|
|
807
807
|
let brainName = null
|
|
808
808
|
for (let i = 0; i < rest.length; i++) {
|
|
809
|
-
if (rest[i] === "--brain") brainName = rest
|
|
809
|
+
if (rest[i] === "--brain") { brainName = brainFlagValue(rest, i); i++ }
|
|
810
810
|
}
|
|
811
811
|
|
|
812
812
|
const isInteractive = Boolean(process.stdin.isTTY)
|
|
@@ -861,8 +861,10 @@ function parseConfig(content) {
|
|
|
861
861
|
return { defaultBrain: defaultMatch ? defaultMatch[1] : null, brains, header }
|
|
862
862
|
}
|
|
863
863
|
|
|
864
|
-
function hasHelpFlag(args) {
|
|
865
|
-
|
|
864
|
+
function hasHelpFlag(args, forwardAfterSeparator = false) {
|
|
865
|
+
const separator = forwardAfterSeparator ? args.indexOf("--") : -1
|
|
866
|
+
const ownArgs = separator === -1 ? args : args.slice(0, separator)
|
|
867
|
+
return ownArgs.some(a => a === "--help" || a === "-h")
|
|
866
868
|
}
|
|
867
869
|
|
|
868
870
|
async function readConfigStatus() {
|
|
@@ -1108,6 +1110,14 @@ async function cmdUse(args) {
|
|
|
1108
1110
|
}
|
|
1109
1111
|
}
|
|
1110
1112
|
|
|
1113
|
+
function brainFlagValue(args, index) {
|
|
1114
|
+
const value = args[index + 1]
|
|
1115
|
+
if (!value || value.startsWith("-")) {
|
|
1116
|
+
throw new Error("--brain requires a brain name.")
|
|
1117
|
+
}
|
|
1118
|
+
return value
|
|
1119
|
+
}
|
|
1120
|
+
|
|
1111
1121
|
async function cmdPath(args) {
|
|
1112
1122
|
// Canonical: csb path [qmd|config|root] [--brain <name>]
|
|
1113
1123
|
// Deprecated: csb path --qmd | --config | --root
|
|
@@ -1116,7 +1126,7 @@ async function cmdPath(args) {
|
|
|
1116
1126
|
let sawLegacyFlag = false
|
|
1117
1127
|
for (let i = 0; i < args.length; i++) {
|
|
1118
1128
|
const a = args[i]
|
|
1119
|
-
if (a === "--brain") { name = args
|
|
1129
|
+
if (a === "--brain") { name = brainFlagValue(args, i); i++; continue }
|
|
1120
1130
|
if (a === "--root") { mode = "root"; sawLegacyFlag = true; continue }
|
|
1121
1131
|
if (a === "--qmd") { mode = "qmd"; sawLegacyFlag = true; continue }
|
|
1122
1132
|
if (a === "--config") { mode = "config"; sawLegacyFlag = true; continue }
|
|
@@ -1143,7 +1153,7 @@ function parseBrainAndRest(args) {
|
|
|
1143
1153
|
const rest = []
|
|
1144
1154
|
for (let i = 0; i < args.length; i++) {
|
|
1145
1155
|
const a = args[i]
|
|
1146
|
-
if (a === "--brain") { name = args
|
|
1156
|
+
if (a === "--brain") { name = brainFlagValue(args, i); i++; continue }
|
|
1147
1157
|
if (a === "--") { rest.push(...args.slice(i + 1)); break }
|
|
1148
1158
|
rest.push(a)
|
|
1149
1159
|
}
|
|
@@ -1541,6 +1551,12 @@ async function createBrain(initialName, { agents: explicitAgents = null, copy =
|
|
|
1541
1551
|
p.log.step(`Name of the brain?\n${pc.dim(targetName)}`)
|
|
1542
1552
|
}
|
|
1543
1553
|
|
|
1554
|
+
// The name is both a directory component and a TOML string. Reject path
|
|
1555
|
+
// separators, traversal components and characters that corrupt the config.
|
|
1556
|
+
if (!targetName.trim() || targetName === "." || targetName === ".." || /[/\\"\x00-\x1f\x7f]/.test(targetName)) {
|
|
1557
|
+
throw new Error("Brain name must be a single directory name without quotes or control characters.")
|
|
1558
|
+
}
|
|
1559
|
+
|
|
1544
1560
|
const toDisplayPath = p => p.startsWith(homedir()) ? "~" + p.slice(homedir().length) : p
|
|
1545
1561
|
const qmdPath = join(CSB_ROOT, targetName, ".qmd", "index.sqlite")
|
|
1546
1562
|
|
|
@@ -1833,7 +1849,7 @@ async function main() {
|
|
|
1833
1849
|
}
|
|
1834
1850
|
|
|
1835
1851
|
// Per-subcommand --help / -h — intercept before any prompts run.
|
|
1836
|
-
if (SUBCOMMANDS.has(cmd) && hasHelpFlag(rest)) {
|
|
1852
|
+
if (SUBCOMMANDS.has(cmd) && hasHelpFlag(rest, cmd === "exec" || cmd === "qmd")) {
|
|
1837
1853
|
const topicMap = { list: "ls", remove: "rm", default: "use", switch: "use" }
|
|
1838
1854
|
await printHelp(topicMap[cmd] || cmd)
|
|
1839
1855
|
return
|
package/package.json
CHANGED
|
@@ -1,7 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-second-brain",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.3",
|
|
4
4
|
"description": "The fastest way to start your personal knowledge base powered by Obsidian, any AI coding agent (Claude Code, Codex, Cursor, Copilot, …), qmd, and git.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"ai",
|
|
7
|
+
"amp",
|
|
8
|
+
"claude-code",
|
|
9
|
+
"codex",
|
|
10
|
+
"cursor",
|
|
11
|
+
"github",
|
|
12
|
+
"knowledge-base",
|
|
13
|
+
"knowledge-graph",
|
|
14
|
+
"knowledge-management",
|
|
15
|
+
"llm",
|
|
16
|
+
"obsidian",
|
|
17
|
+
"obsidian-vault",
|
|
18
|
+
"qmd",
|
|
19
|
+
"second-brain"
|
|
20
|
+
],
|
|
5
21
|
"type": "module",
|
|
6
22
|
"bin": {
|
|
7
23
|
"claude-second-brain": "./bin/create.js",
|
|
@@ -10,7 +26,8 @@
|
|
|
10
26
|
"scripts": {
|
|
11
27
|
"docs:dev": "vocs dev",
|
|
12
28
|
"docs:build": "vocs build",
|
|
13
|
-
"docs:preview": "vocs preview"
|
|
29
|
+
"docs:preview": "vocs preview",
|
|
30
|
+
"test": "node --test tests/*.test.js"
|
|
14
31
|
},
|
|
15
32
|
"files": [
|
|
16
33
|
"bin/",
|
|
@@ -26,9 +43,13 @@
|
|
|
26
43
|
"picocolors": "^1.1.1"
|
|
27
44
|
},
|
|
28
45
|
"license": "MIT",
|
|
46
|
+
"homepage": "https://jessepinkman9900.github.io/claude-second-brain",
|
|
29
47
|
"repository": {
|
|
30
48
|
"type": "git",
|
|
31
|
-
"url": "https://github.com/jessepinkman9900/claude-second-brain"
|
|
49
|
+
"url": "git+https://github.com/jessepinkman9900/claude-second-brain.git"
|
|
50
|
+
},
|
|
51
|
+
"bugs": {
|
|
52
|
+
"url": "https://github.com/jessepinkman9900/claude-second-brain/issues"
|
|
32
53
|
},
|
|
33
54
|
"devDependencies": {
|
|
34
55
|
"@types/react": "^19.3.3",
|