# jessepinkman9900/claude-second-brain architecture

> Architecture diagram of the GitHub repository jessepinkman9900/claude-second-brain, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jessepinkman9900/claude-second-brain
- Repository: https://github.com/jessepinkman9900/claude-second-brain

## Overview

claude-second-brain is a CLI scaffold generator for an Obsidian- and Claude Code-based personal knowledge wiki. The user creates a brain, adds source material, runs ingestion to synthesize linked wiki pages, and later searches the indexed wiki for cited answers. Refresh, rebuild, lint, and Git-backed access are additional product capabilities. The workflow is documented in the README; sampled code shows CLI and qmd setup/reindex behavior, but not the skill implementations, so those relationships rely on README evidence.

Main entry points: [`template/scripts/qmd/reindex.ts`](https://github.com/jessepinkman9900/claude-second-brain/blob/main/template/scripts/qmd/reindex.ts) (Local QMD Index), [`template/wiki`](https://github.com/jessepinkman9900/claude-second-brain/tree/main/template/wiki) (Cross-linked Wiki), [`template/.claude/skills/brain-search/SKILL.md`](https://github.com/jessepinkman9900/claude-second-brain/blob/main/template/.claude/skills/brain-search/SKILL.md) (Search Skill), [`bin/create.js`](https://github.com/jessepinkman9900/claude-second-brain/blob/main/bin/create.js) (Scaffold CLI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_setup["Brain Setup"]
  node_cli["Scaffold CLI<br/>[create.js]"]
  node_vault["Brain Vault"]
end

subgraph group_knowledge["Knowledge Workflow"]
  node_sources["Raw Sources"]
  node_ingest["Ingest Skill<br/>[SKILL.md]"]
  node_wiki["Cross-linked Wiki"]
  node_search["Search Skill<br/>[SKILL.md]"]
  node_lint["Wiki Lint<br/>[SKILL.md]"]
end

subgraph group_indexing["Search Index"]
  node_refresh["Index Refresh<br/>[SKILL.md]"]
  node_rebuild["Index Rebuild<br/>[SKILL.md]"]
  node_qmd_setup["Collection Setup<br/>[setup.ts]"]
  node_qmd_reindex["Index Reindex<br/>[reindex.ts]"]
  node_qmd[("Local QMD Index<br/>[reindex.ts]")]
end

subgraph group_access["Vault Access"]
  node_obsidian["Obsidian Vault<br/>[.obsidian]"]
  node_github["GitHub Remote"]
  node_claude["Claude Code"]
end

node_user(("User"))

node_user -->|"creates brain"| node_cli
node_cli -->|"scaffolds files"| node_vault
node_cli -->|"registers collections"| node_qmd_setup
node_user -->|"adds material"| node_sources
node_ingest -->|"reads sources"| node_sources
node_ingest -->|"writes synthesis"| node_wiki
node_user -->|"asks question"| node_search
node_search -->|"hybrid searches"| node_qmd
node_qmd -->|"returns pages"| node_search
node_search -->|"answers with citations"| node_user
node_user -->|"checks wiki"| node_lint
node_user -->|"refreshes index"| node_refresh
node_refresh -->|"updates embeddings"| node_qmd
node_user -->|"redesigns index"| node_rebuild
node_rebuild -->|"patches schema"| node_qmd_setup
node_qmd_setup -->|"configures collections"| node_qmd
node_qmd_reindex -->|"updates and embeds"| node_qmd
node_wiki -->|"indexed for search"| node_qmd
node_sources -->|"registered collection"| node_qmd
node_wiki -->|"opened as vault"| node_obsidian
node_wiki -->|"syncs through Git"| node_github
node_github -->|"enables remote work"| node_claude
node_github -->|"syncs vault"| node_obsidian

click node_cli "https://github.com/jessepinkman9900/claude-second-brain/blob/main/bin/create.js"
click node_vault "https://github.com/jessepinkman9900/claude-second-brain/tree/main/template"
click node_sources "https://github.com/jessepinkman9900/claude-second-brain/tree/main/template/raw-sources"
click node_ingest "https://github.com/jessepinkman9900/claude-second-brain/blob/main/template/.claude/skills/brain-ingest/SKILL.md"
click node_wiki "https://github.com/jessepinkman9900/claude-second-brain/tree/main/template/wiki"
click node_search "https://github.com/jessepinkman9900/claude-second-brain/blob/main/template/.claude/skills/brain-search/SKILL.md"
click node_lint "https://github.com/jessepinkman9900/claude-second-brain/blob/main/template/.claude/skills/lint/SKILL.md"
click node_refresh "https://github.com/jessepinkman9900/claude-second-brain/blob/main/template/.claude/skills/brain-refresh/SKILL.md"
click node_rebuild "https://github.com/jessepinkman9900/claude-second-brain/blob/main/template/.claude/skills/brain-rebuild/SKILL.md"
click node_qmd_setup "https://github.com/jessepinkman9900/claude-second-brain/blob/main/template/scripts/qmd/setup.ts"
click node_qmd_reindex "https://github.com/jessepinkman9900/claude-second-brain/blob/main/template/scripts/qmd/reindex.ts"
click node_qmd "https://github.com/jessepinkman9900/claude-second-brain/blob/main/template/scripts/qmd/reindex.ts"
click node_obsidian "https://github.com/jessepinkman9900/claude-second-brain/tree/main/template/.obsidian"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_vault,node_user toneBlue
class node_sources,node_ingest,node_wiki,node_search,node_lint toneAmber
class node_refresh,node_rebuild,node_qmd_setup,node_qmd_reindex,node_qmd toneMint
class node_obsidian,node_github,node_claude toneRose
```

## Components

### Brain Setup

- [Scaffold CLI](https://github.com/jessepinkman9900/claude-second-brain/blob/main/bin/create.js): `bin/create.js`
- [Brain Vault](https://github.com/jessepinkman9900/claude-second-brain/tree/main/template): `template`

### Knowledge Workflow

- [Raw Sources](https://github.com/jessepinkman9900/claude-second-brain/tree/main/template/raw-sources): `template/raw-sources`
- [Ingest Skill](https://github.com/jessepinkman9900/claude-second-brain/blob/main/template/.claude/skills/brain-ingest/SKILL.md): `template/.claude/skills/brain-ingest/SKILL.md`
- [Cross-linked Wiki](https://github.com/jessepinkman9900/claude-second-brain/tree/main/template/wiki): `template/wiki`
- [Search Skill](https://github.com/jessepinkman9900/claude-second-brain/blob/main/template/.claude/skills/brain-search/SKILL.md): `template/.claude/skills/brain-search/SKILL.md`
- [Wiki Lint](https://github.com/jessepinkman9900/claude-second-brain/blob/main/template/.claude/skills/lint/SKILL.md): `template/.claude/skills/lint/SKILL.md`

### Search Index

- [Index Refresh](https://github.com/jessepinkman9900/claude-second-brain/blob/main/template/.claude/skills/brain-refresh/SKILL.md): `template/.claude/skills/brain-refresh/SKILL.md`
- [Index Rebuild](https://github.com/jessepinkman9900/claude-second-brain/blob/main/template/.claude/skills/brain-rebuild/SKILL.md): `template/.claude/skills/brain-rebuild/SKILL.md`
- [Collection Setup](https://github.com/jessepinkman9900/claude-second-brain/blob/main/template/scripts/qmd/setup.ts): `template/scripts/qmd/setup.ts`
- [Index Reindex](https://github.com/jessepinkman9900/claude-second-brain/blob/main/template/scripts/qmd/reindex.ts): `template/scripts/qmd/reindex.ts`
- [Local QMD Index](https://github.com/jessepinkman9900/claude-second-brain/blob/main/template/scripts/qmd/reindex.ts): `template/scripts/qmd/reindex.ts`

### Vault Access

- [Obsidian Vault](https://github.com/jessepinkman9900/claude-second-brain/tree/main/template/.obsidian): `template/.obsidian`
- **GitHub Remote**
- **Claude Code**

### Other components

- **User**

## Connections

- User → Scaffold CLI: creates brain (evidence: `README.md`)
- Scaffold CLI → Brain Vault: scaffolds files (evidence: `bin/create.js`)
- Scaffold CLI → Collection Setup: registers collections (evidence: `README.md`)
- User → Raw Sources: adds material (evidence: `README.md`)
- Ingest Skill → Raw Sources: reads sources (evidence: `README.md`)
- Ingest Skill → Cross-linked Wiki: writes synthesis (evidence: `README.md`)
- User → Search Skill: asks question (evidence: `README.md`)
- Search Skill → Local QMD Index: hybrid searches (evidence: `README.md`)
- Local QMD Index → Search Skill: returns pages (evidence: `README.md`)
- Search Skill → User: answers with citations (evidence: `README.md`)
- User → Wiki Lint: checks wiki (evidence: `README.md`)
- User → Index Refresh: refreshes index (evidence: `README.md`)
- Index Refresh → Local QMD Index: updates embeddings (evidence: `README.md`)
- User → Index Rebuild: redesigns index (evidence: `README.md`)
- Index Rebuild → Collection Setup: patches schema (evidence: `README.md`)
- Collection Setup → Local QMD Index: configures collections (evidence: `template/scripts/qmd/setup.ts`)
- Index Reindex → Local QMD Index: updates and embeds (evidence: `template/scripts/qmd/reindex.ts`)
- Cross-linked Wiki → Local QMD Index: indexed for search (evidence: `README.md`)
- Raw Sources → Local QMD Index: registered collection
- Cross-linked Wiki → Obsidian Vault: opened as vault (evidence: `README.md`)
- Cross-linked Wiki → GitHub Remote: syncs through Git (evidence: `README.md`)
- GitHub Remote → Claude Code: enables remote work (evidence: `README.md`)
- GitHub Remote → Obsidian Vault: syncs vault (evidence: `README.md`)
