second-brain-template
Claude Code knowledge-base / second-brain template: Obsidian-style vault + management skills + guided onboarding
Knowledge Base Template
A second brain for agents and humans — built on Karpathy's LLM Wiki idea, portable via the OKF standard.
RAG searches raw documents on every query. An LLM Wiki flips it: a Claude
Code agent incrementally builds and maintains a living markdown vault —
cross-linked, indexed, synthesized. Knowledge compounds instead of piling
up. Because it's plain markdown with type frontmatter (the OKF minimum), the
base stays portable — git clone and it's yours — and readable by agent and
human alike.
The trick that makes it scale without embeddings or a vector DB: index-first reads. The agent starts from a navigation map and opens only the relevant notes, keeping context up to ~28× smaller per query — good for ~500 sources on plain markdown alone.
Live instance: brain.lipowczan.pl.
This template is about managing knowledge, not publishing it — the Quartz / GitHub Pages pipeline is intentionally not included (see Adding publishing later). What you get is an Obsidian-style vault plus the skills that ingest sources, compile articles, answer questions, lint for quality, and keep navigation indexes current.
What you get
content/— your vault. Topic folders hold notes;_raw/is the ingest drop zone;_indexes/holds auto-maintained navigation files;_outputs/holds generated answers and reports;templates/holds note templates..claude/skills/+.claude/commands/— the management skills below.
Quickstart
- Open this folder in Claude Code.
- Install script prerequisites:
pip install -r requirements.txt. - Run
/b:onboard— it interviews you (KB name, owner, topics, language, voice) and then personalizes the brain (CLAUDE.md,AGENTS.md,content/WRITING_STYLE.md), creates your topic folders, and builds the navigation indexes. - Start using the vault:
- Drop a file in
content/_raw/inbox/and run/b:ingest. - Ask
/b:qa what does this vault say about …. - Run
/b:lintfor a health check.
- Drop a file in
Prefer to set things up by hand? You can skip
/b:onboard, rename the*.template.mdfiles yourself, and edit the{{PLACEHOLDERS}}directly.
Works beyond Claude Code
The template is plain markdown files plus instructions for an agent. Drive it in any tool where an AI assistant can reach your files: Claude Code, Claude Desktop (the Code tab), GitHub Copilot (VS Code), Codex, Cursor, or Antigravity.
- Commands go in the agent's chat. In Claude Code / Claude Desktop (Code)
they run directly as
/b:onboard,/b:ingest. In other tools, ask in a sentence: "follow the instructions in.claude/commands/b/ingest.md." - No terminal needed. Git without commands: tell the agent "save my changes," use the panel buttons (VS Code–based tools), or use a cloud mode where the agent opens the pull request itself.
- Don't want git at all? Download a ZIP: the Code button → Download ZIP → unzip, and open the folder in your tool.
See ENVIRONMENTS.md for the full tool-by-tool matrix.
Skills
| Command | What it does |
|---|---|
/b:onboard | Interview + scaffold a fresh knowledge base from the template (personalizes the brain, creates topics, builds indexes). |
/b:ingest | Turn raw sources (files in _raw/inbox/, or YouTube URLs) into wiki notes; updates indexes. |
/b:compile | Synthesize a new article from existing notes on a topic. |
/b:enhance | Improve a single note: fill gaps, add wikilinks, mark reviewed. |
/b:qa | Answer a question from the vault, citing notes. |
/b:lint | Audit vault health: frontmatter, broken links, orphans, stubs, stale notes. |
/b:output | Generate a report/summary (reading list, topic map, timeline). |
/b:reindex | Rebuild vault-map.md, catalog.md, graph.md from all notes. |
/b:refactor | Rename/move/merge/split notes with automatic wikilink repair. |
/b:gaps | Coverage analysis: weakly-connected notes, missing topics, thin areas. |
/b:curate | Staleness hygiene: score notes (age, isolation, dead links, duplication), propose archive/merge/refresh, retire confirmed notes to _graveyard/ (reversible). |
(skill) excalidraw-diagram | Generate Excalidraw diagram JSON to embed in notes. |
(skill) research, research-deep, … | Structured multi-item web research into the vault (best-effort; depends on your Claude Code web tools). |
Prerequisites
- Python 3 with PyYAML — required for the reindex and lint scripts
(
pip install -r requirements.txt). - Node — optional, only for
npm run format(Prettier). - yt-dlp (+ ffmpeg) on PATH — optional, only for ingesting YouTube URLs.
Adding publishing later
This template omits the Quartz static-site pipeline and the optional brain-mcp
server on purpose. Either can be layered on top of content/ later without
changing how the skills work.
License
MIT — use it, fork it, make it yours. The example notes under
content/ are scaffolding meant to be replaced; they carry the same license.
How to Install
- Download the ZIP or clone the repository
- Open the folder as a vault in Obsidian (File → Open Vault)
- Obsidian will prompt you to install required plugins
Stats
Stars
2
Forks
1
License
MIT
Last updated 21d ago