second-brain
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese/second-brain — Karpathy LLM Wiki workflow
/second-brain — Karpathy LLM Wiki工作流
Wraps an existing Second Brain in Obsidian (or any markdown-based vault). The wiki vault's CLAUDE.md is the authoritative schema — the skill orchestrates the operations the user has been doing manually.
本工具封装了Obsidian(或任何基于markdown的笔记库)中的现有第二大脑。笔记库中的CLAUDE.md是权威架构文件——本技能将用户手动执行的操作进行编排。
Mental model
心智模型
Three layers, each with a clear role:
raw/ → wiki/ → outputs/
sources compiled generated
artifacts- raw/ — unprocessed source material. Articles, highlights, ideas, braindumps, tweets. Type-prefixed (,
article-,idea-,highlights-,braindump-,note-,resource-). Never deleted — source of truth.tweet- - wiki/ — AI-compiled topic pages. One page per concept, not per source. Interlinked via .
[[wikilinks]]at root.INDEX.md - outputs/ — generated artifacts from queries: research summaries, analyses, slide decks. Named descriptively.
Folders to leave alone during wiki ops: , , , , , , , .
Projects/Daily/Templates/Inbox/Notes/Tasks.mdKanban.mdHome.md分为三层,每层职责明确:
raw/ → wiki/ → outputs/
原始源文件 编译后页面 生成的产物- raw/ — 未处理的源素材。包括文章、高亮内容、想法、头脑风暴记录、推文。文件以类型前缀命名(、
article-、idea-、highlights-、braindump-、note-、resource-)。永不删除——是事实来源。tweet- - wiki/ — AI编译的主题页面。每个概念对应一个页面,而非每个源文件对应一个页面。通过实现相互关联。根目录下的
[[wikilinks]]为索引文件。INDEX.md - outputs/ — 查询生成的产物:研究摘要、分析报告、幻灯片。命名需清晰描述内容。
在wiki操作过程中,请勿修改以下文件夹:、、、、、、、。
Projects/Daily/Templates/Inbox/Notes/Tasks.mdKanban.mdHome.mdStep 1 — Load vault config + schema
步骤1 — 加载笔记库配置与架构
- Read for the vault path (default:
references/vault-config.md)${SECOND_BRAIN_VAULT:-$HOME/Documents/SecondBrain}/ - Read for the authoritative schema. If present, trust it over
<vault>/CLAUDE.md— the user's vault is the source of truth.references/schema.md - If no , fall back to
<vault>/CLAUDE.md.references/schema.md
- 读取获取笔记库路径(默认:
references/vault-config.md)${SECOND_BRAIN_VAULT:-$HOME/Documents/SecondBrain}/ - 读取获取权威架构。如果存在该文件,则优先信任它而非
<vault>/CLAUDE.md——用户的笔记库是事实来源。references/schema.md - 如果不存在,则回退使用
<vault>/CLAUDE.md。references/schema.md
Step 2 — Parse mode
步骤2 — 解析模式
| Invocation | Mode |
|---|---|
| capture |
| compile |
| query |
| lint |
| connect |
| search |
| 触发指令 | 模式 |
|---|---|
| 捕获 |
| 编译 |
| 查询 |
| 检查 |
| 关联 |
| 搜索 |
Step 3 — Run the mode
步骤3 — 运行对应模式
capture
捕获
Inputs: URL, pasted text, file path, or screenshot.
- Detect type from content:
- URL →
article- - Pasted text with quoted highlights →
highlights- - User's own thoughts / brainstorm → or
braindump-idea- - Single tweet / X post →
tweet- - PDF, video, podcast →
resource- - Quick reference (recipe, command, fact) →
note- - If ambiguous, ask.
- URL →
- Generate a descriptive filename: (e.g.,
<type>-<kebab-case-topic>.md). Use the source title or topic — not the URL slug.article-andrew-wilkinson-tiny-manual.md - Add metadata to the top:
markdown
source: <URL if applicable> captured: YYYY-MM-DD - Save to .
<vault>/raw/ - If the source is a URL, fetch the article content (via WebFetch or agent-browser for auth-walled) and save the readable text — not just the URL.
- Report path + a one-line summary of what was saved.
Don't compile into the wiki here — capture is fast intake. Compilation is a separate, deliberate pass.
输入:URL、粘贴的文本、文件路径或截图。
- 根据内容检测类型:
- URL →
article- - 带引用高亮的粘贴文本 →
highlights- - 用户自身想法/头脑风暴内容 → 或
braindump-idea- - 单条推文/X帖子 →
tweet- - PDF、视频、播客 →
resource- - 快速参考内容(食谱、命令、事实) →
note- - 若类型不明确,则询问用户。
- URL →
- 生成描述性文件名:(例如:
<type>-<kebab-case-topic>.md)。使用源标题或主题命名——而非URL后缀。article-andrew-wilkinson-tiny-manual.md - 在顶部添加元数据:
markdown
source: <URL(若适用)> captured: YYYY-MM-DD - 保存至。
<vault>/raw/ - 如果源是URL,则获取文章内容(通过WebFetch或agent-browser处理需要权限访问的内容)并保存可读文本——而非仅保存URL。
- 反馈保存路径及内容的一行摘要。
请勿在此阶段将内容编译至wiki中——捕获是快速收录操作,编译是单独的、需主动触发的步骤。
compile
编译
The expensive but valuable operation. Process unprocessed raw files into wiki pages.
- Find unprocessed raw files: grep for
wiki/*.mdsections; the raw files NOT listed are unprocessed.Sources - Read each unprocessed raw file + the existing .
wiki/INDEX.md - For each raw file:
- Extract key concepts, facts, insights
- Default: merge into an existing wiki page if the topic overlaps. Only create a new page if the concept doesn't fit anywhere.
- One page per concept, not per source.
- Use for every related concept
[[wikilinks]] - Add the raw file under the wiki page's section with a one-line note on what was drawn from it
## Sources
- Update :
wiki/INDEX.md- Add new pages under their category (Creative / Health & Longevity / Faith & Personal Growth / Business / Personal Growth / Tech / Hobbies / Sci-Fi / Pets — or new category if needed)
- One line per entry:
- [[Page Name]] — brief description
- Connections section is mandatory on every wiki page. If a new page has no connections, find one before saving.
- Quality > quantity. If a page would be <100 words, hold the raw file for now and ask the user if it should be merged into an adjacent page.
Output: list of pages created/updated, what merged where, anything held for clarification.
这是耗时但有价值的操作。将未处理的raw文件转换为wiki页面。
- 查找未处理的raw文件:在的
wiki/*.md章节中搜索;未被列出的raw文件即为未处理文件。Sources - 读取每个未处理的raw文件 + 现有。
wiki/INDEX.md - 针对每个raw文件:
- 提取关键概念、事实、见解
- 默认规则:若主题重叠,则合并至现有wiki页面。仅当概念无法适配任何现有页面时,才创建新页面。
- 每个概念对应一个页面,而非每个源文件对应一个页面。
- 对每个相关概念使用
[[wikilinks]] - 将raw文件添加至wiki页面的章节下,并附上一行说明从中提取的内容
## Sources
- 更新:
wiki/INDEX.md- 将新页面添加至对应分类下(创意 / 健康与长寿 / 信仰与个人成长 / 商业 / 个人成长 / 科技 / 爱好 / 科幻 / 宠物 —— 若需要可新增分类)
- 每条条目一行:
- [[Page Name]] — 简短描述
- 每个wiki页面必须包含关联章节。如果新页面没有关联内容,在保存前需找到至少一个关联页面。
- 质量优先于数量。如果页面内容不足100字,暂时保留raw文件,并询问用户是否应将其合并至相邻页面。
输出:创建/更新的页面列表、合并情况、需澄清的内容。
query
查询
Answer a question using ONLY the wiki/raw corpus. Different from (which goes external).
deep-research- Read to identify potentially relevant pages
wiki/INDEX.md - Read those pages + traverse 1–2 hops
[[wikilinks]] - Compose the answer:
- Cite wiki pages by name: "Per [[Microplastics Detox]]..."
- If the wiki contradicts itself, surface both sides
- If the wiki doesn't contain the answer, say so and offer to run to expand
/deep-research
- Save to with:
outputs/<YYYY-MM-DD>-<question-slug>.md- The original question
- The answer
- List of wiki pages consulted
- Show the answer in chat + path to the saved output
- Optional render: if or
--render pdfwas passed, pipe the output through pandoc using the shared stylesheet. See--render html→ "Publishing alternatives" for the commands.references/schema.md
仅使用wiki/raw语料库回答问题。与(调用外部资源)不同。
deep-research- **读取**以识别潜在相关页面
wiki/INDEX.md - 读取这些页面 + 遍历1–2层关联页面
[[wikilinks]] - 撰写答案:
- 通过页面名称引用:"根据[[Microplastics Detox]]..."
- 如果wiki内容存在矛盾,需同时呈现双方观点
- 如果wiki中没有答案,需告知用户并提议运行来补充内容
/deep-research
- 保存至,包含:
outputs/<YYYY-MM-DD>-<question-slug>.md- 原始问题
- 答案
- 参考的wiki页面列表
- 在聊天中展示答案 + 保存的输出文件路径
- 可选渲染:如果传入了或
--render pdf参数,使用共享样式表通过pandoc处理输出内容。详见--render html→ "发布替代方案"中的命令。references/schema.md
lint
检查
Health check the wiki.
Check:
- Orphan pages — wiki/*.md that aren't in INDEX.md
- Connection orphans — pages with no to other pages
[[wikilinks]] - Unprocessed raw — raw files not listed under any wiki page's Sources
- Stale pages — most recent source >6 months old AND topic is volatile (AI, marketing, finance, health protocols)
- Topic gaps — concepts mentioned in 3+ pages without their own dedicated page
- Contradictions — wiki pages making opposing claims without flagging it
- Missing connections — pages on clearly related topics with no between them (suggest
[[wikilink]])/sb connect
Output: prioritized list. Most important first (broken structure beats stale content).
对wiki进行健康校验。
检查项:
- 孤立页面 — 中未出现在INDEX.md中的页面
wiki/*.md - 关联孤立页面 — 未链接到其他页面的页面(无)
[[wikilinks]] - 未处理的raw文件 — 未被任何wiki页面的Sources章节列出的raw文件
- 过时页面 — 最新源文件已超过6个月且主题属于易变领域(AI、营销、金融、健康方案)
- 主题缺口 — 在3个及以上页面中被提及但无专属页面的概念
- 矛盾内容 — wiki页面中存在对立观点但未标注的情况
- 缺失关联 — 主题明显相关但未通过连接的页面(建议运行
[[wikilink]])/sb connect
输出:按优先级排序的列表。最重要的问题排在最前面(结构问题优先于过时内容)。
connect
关联
Find pages that should be linked but aren't.
- Build a topic map from INDEX.md + page summaries
- For each page, find 2–5 other pages with thematic overlap
- Check whether each candidate is already linked
- Suggest the missing links — and if the user approves, edit the pages to add them to their sections
## Connections
查找应该链接但未链接的页面。
- 根据INDEX.md和页面摘要构建主题图谱
- 为每个页面找到2–5个主题重叠的其他页面
- 检查每个候选页面是否已链接
- 建议缺失的链接——如果用户同意,编辑页面将链接添加至其章节
## Connections
search
搜索
Quick grep across + for a term. Return matching files with a 2-line excerpt around the match. Faster than when the user knows what page they're looking for.
wiki/raw/query在 + 中快速搜索指定术语。返回匹配文件及匹配位置前后2行的摘录。当用户明确知道要找的页面时,此操作比更快。
wiki/raw/queryComposes with
可组合使用的技能
- — when
deep-researchfinds gaps in the wiki, route to deep-research to expand from external sources. Deep-research output can be captured back intoqueryfor future compilation.raw/ - — capture content cleanly into
paste(especially for terminal/CLI captures).raw/ - — checks
business-brainstormandPortfolio of Businesseswiki pages for relevant context before brainstorming.Entrepreneurship & Startups - — pull from
decide/Personal Philosophywiki for principles when scoring Q34 ("what principles are we bending"). New: aProductivity & Systemswiki page accumulates the narrative form of decisions over time (theDecision Logarchive is the structured form; the wiki page is the story).decide - — a
jab-hookwiki page hoppers hooks, frameworks, and stories.Content Ideasdrafts pull candidates from there./jab-hook - — content drafted in
slide-deckbecomes deck source; speaker notes can reference relevant wiki pages.outputs/ - — Projects/ folder in the vault is off-limits to second-brain; pm owns it. But a
pmwiki page captures operational patterns that show up across multiple projects.Workflow Docs
- — 当
deep-research发现wiki存在内容缺口时,可调用deep-research从外部资源补充内容。deep-research的输出可被捕获回query,用于后续编译。raw/ - — 将内容干净地捕获至
paste(尤其适用于终端/CLI场景下的捕获)。raw/ - — 在头脑风暴前,检查wiki中的
business-brainstorm和Portfolio of Businesses页面获取相关背景信息。Entrepreneurship & Startups - — 在评分Q34("我们正在违背哪些原则")时,从wiki的
decide/Personal Philosophy页面提取原则。新增功能:Productivity & Systemswiki页面会逐步积累决策的叙事形式(Decision Log的存档是结构化形式;wiki页面是故事形式)。decide - —
jab-hookwiki页面存储钩子、框架和故事。Content Ideas草稿会从中选取候选内容。/jab-hook - — 在
slide-deck中起草的内容可作为幻灯片源;演讲备注可参考相关wiki页面。outputs/ - — 笔记库中的Projects/文件夹属于second-brain的操作禁区;由pm技能管理。但
pmwiki页面会记录多个项目中出现的操作模式。Workflow Docs
Sibling implementations (reference)
同类实现方案(参考)
Two other systems following the same raw → wiki → outputs pattern. Both are worth watching as upgrade paths.
- Hermes' skill — off-the-shelf implementation of the 3-folder pattern. Pre-built workflows for compile / query / lint. Useful for comparing schema decisions.
llm-wiki - Gbrain by Garry Tan — much more sophisticated. Treats the brain as a database (Postgres or PGLite) with synthesis, graph traversal, gap analysis, scheduled cron maintenance, and MCP integration. Powers a 146K-page deployment with 24K people entities. If the user's vault outgrows the markdown-only pattern, Gbrain is the upgrade direction. Borrows worth adopting today even without migrating: people-as-entities (the raw type +
person-wiki page) and scheduled maintenance (wirePeopleandcompileto fire on a recurring schedule via thelintorloopskill).compound-engineering:schedule
另外两个遵循raw → wiki → outputs模式的系统。两者都可作为升级方向参考。
- Hermes的技能 — 开箱即用的三文件夹模式实现。预构建了编译/查询/检查工作流。有助于对比架构决策。
llm-wiki - Gbrain(Garry Tan开发) — 功能更复杂。将第二大脑视为数据库(Postgres或PGLite),支持合成、图谱遍历、缺口分析、定时cron维护和MCP集成。支撑着拥有14.6万页面、2.4万人物实体的部署。如果用户的笔记库超出纯markdown模式的承载能力,Gbrain是升级方向。即使不迁移,也可借鉴其现有功能:人物实体化(类型的raw文件 +
person-wiki页面)和定时维护(通过People或loop技能定期触发compound-engineering:schedule和compile)。lint
Notes on quality
质量注意事项
Notes on quality
—
- Quality over quantity. Fewer well-connected wiki pages beat many thin ones. Hold raw files for clarification if compilation would produce a thin page.
- Don't flatten nuance. If two raw sources contradict, the wiki page should note the disagreement, not pick a side silently.
- Connections section is mandatory — every wiki page must link to at least one other page.
- Never delete raw files after compilation. They're the source of truth.
- Never modify files in ,
Projects/,Daily/,Templates/,Notes/,Tasks.md,Kanban.md, orHome.mdduring second-brain operations. Those belong to other workflows.Inbox/
- 质量优先于数量。少量关联良好的wiki页面优于大量内容单薄的页面。如果编译会产生内容单薄的页面,暂时保留raw文件并向用户确认。
- 不要弱化细节差异。如果两个raw源内容矛盾,wiki页面应标注分歧,而非默认选择某一方观点。
- 必须包含关联章节 — 每个wiki页面至少链接到一个其他页面。
- 编译后永不删除raw文件。它们是事实来源。
- 在second-brain操作期间,绝不修改、
Projects/、Daily/、Templates/、Notes/、Tasks.md、Kanban.md或Home.md中的文件。这些属于其他工作流的范畴。Inbox/