npm package: @jiawenwu/secondbrain
Description: 第二大脑 - 基于 Claude Code + Obsidian 的跨平台知识管理和任务追踪系统
Author: Jiawen.Wu
Latest version: 2.2.0

# ObsidianNoteBook - Second Brain System

> A cross-project knowledge management and task tracking system powered by Claude Code + Obsidian
> Version: 2.2 | npm: `@jiawenwu/secondbrain`

---

## What is This?

A personal second brain that works **across all your projects**. Whether you're working on a web app, a document, or a data analysis project, Claude Code always remembers:

- Your past decisions and the reasoning behind them
- Ongoing tasks and their priorities
- Technical knowledge and learnings accumulated over time
- Project context that would otherwise be lost

---

## Core Features

| Feature | Description |
|---------|-------------|
| **Long-term Memory** | Conversation history, decisions, and technical summaries persist across projects |
| **Auto-routing** | Automatically detects current project from working directory, tags memories accordingly |
| **Task Tracking** | Unified task list with priority levels (🔴 Urgent / 🟡 Important / 🟢 Daily) |
| **Knowledge Accumulation** | Semantic memory extracts reusable patterns and learnings |

---

## Quick Start

```bash
# 1. Install the CLI tool
npm install -g @jiawenwu/secondbrain

# 2. Initialize your second brain
sb init

# 3. Open in Obsidian (optional, for visual browsing)
#    Open Obsidian → Open Folder → select your memory bank folder

# 4. Start using in any project
#    Launch Claude Code in any project directory and say "启动第二大脑"
```

### Custom Memory Bank Location

If you want to use a custom location for your memory bank:

```bash
# Linux/macOS (Git Bash)
export SECONDBRAIN_PATH="/path/to/your/memory-bank"

# Windows (PowerShell)
$env:SECONDBRAIN_PATH = "C:\path\to\your\memory-bank"

# Then initialize
sb init
```

---

## Usage in Claude Code

### Activate Second Brain

Tell Claude Code naturally:

```
启动第二大脑
```

Claude will automatically:
1. Scan your memory bank to discover existing projects
2. Match current working directory to a project
3. Load task list and project memories
4. Show today's overview

### Common Commands

| What you say | What happens |
|-------------|--------------|
| `启动第二大脑` | Read task list, show today's overview |
| `必须做XX` | Add to 🔴 Urgent & Important |
| `明天要做XX` | Add to 🟡 Important, Not Urgent |
| `有空时做XX` | Add to 🟢 Daily Tasks |
| `记录这个决策` | Save to episodic memory (auto-tagged by project) |
| `总结成经验` | Save to semantic memory (auto-tagged by project) |
| `这是通用知识` | Save to `通用/` (no project tag, shared across all projects) |
| `看看这篇文章+链接` | Start 6-step knowledge absorption flow |
| `完成了XX` | Move task to ✅ Completed |
| `/secondbrain` | View this usage guide |

### Query Memories

| What you say | What happens |
|-------------|--------------|
| `查看#科研智能体的记忆` | Show all memories tagged with #科研智能体 |
| `看看有什么任务` | Display full task list with priorities |

---

## Memory Bank Structure

```
memory-bank/
├── README.md                      ← This file (user-facing guide)
├── 任务清单.md                    ← Unified task list
├── 第二大脑搭建指南.md            ← Setup tutorial
├── 第二大脑源文.md               ← System design document
├── 情景记忆/                     ← Episodic memory (conversations, decisions)
│   └── YYYY-MM/                  ←   Organized by year-month
├── 语义记忆/                     ← Semantic memory (knowledge, learnings)
│   ├── <项目名>/                ←   Project-specific knowledge
│   ├── 通用/                    ←   Cross-project general knowledge
│   └── 第二大脑/                ←   About the second brain system itself
└── 强制规则/                     ← Mandatory AI behavior rules
```

---

## How Auto-routing Works

The system automatically discovers projects by scanning `语义记忆/` subdirectories:

```
语义记忆/
├── 科研智能体/      → Project #科研智能体
├── 第二大脑/        → Project #第二大脑
├── FreelanceWork/  → Project #FreelanceWork
└── 通用/            → General knowledge (shared across projects)
```

When you activate second brain in a project directory, it matches your working directory path to determine the current project.

---

## CLI Reference

| Command | Description |
|---------|-------------|
| `sb init` | Initialize: creates memory bank, deploys SKILL.md |
| `sb upgrade` | Upgrade SKILL.md to latest version |
| `sb uninstall` | Remove SKILL.md (keeps your memory bank) |
| `sb status` | Show installation status |
| `sb doctor` | Check Node.js, npm, Git, Claude Code availability |

---

## GitHub Integration

**Repository**: https://github.com/jarvanlove/ObsidianNoteBook

**Note**: Git only tracks the `记忆库/` directory and root files. Your memory bank stays private unless you choose to commit it.

---

## Command Triggers (No Auto-actions)

Git commits require your explicit instruction:
- Say `commit` / `提交` / `/commit` to trigger a commit
- Second Brain never commits automatically (FATAL-005)

---

## System Requirements

- Node.js >= 16.0.0
- Claude Code
- Obsidian (optional, for visual memory browsing)