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-
    ,
    tweet-
    ). Never deleted — source of truth.
  • wiki/ — AI-compiled topic pages. One page per concept, not per source. Interlinked via
    [[wikilinks]]
    .
    INDEX.md
    at root.
  • 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.md
,
Kanban.md
,
Home.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.md
Kanban.md
Home.md

Step 1 — Load vault config + schema

步骤1 — 加载笔记库配置与架构

  1. Read
    references/vault-config.md
    for the vault path (default:
    ${SECOND_BRAIN_VAULT:-$HOME/Documents/SecondBrain}/
    )
  2. Read
    <vault>/CLAUDE.md
    for the authoritative schema. If present, trust it over
    references/schema.md
    — the user's vault is the source of truth.
  3. If no
    <vault>/CLAUDE.md
    , fall back to
    references/schema.md
    .
  1. 读取
    references/vault-config.md
    获取笔记库路径(默认:
    ${SECOND_BRAIN_VAULT:-$HOME/Documents/SecondBrain}/
  2. 读取
    <vault>/CLAUDE.md
    获取权威架构。如果存在该文件,则优先信任它而非
    references/schema.md
    ——用户的笔记库是事实来源。
  3. 如果不存在
    <vault>/CLAUDE.md
    ,则回退使用
    references/schema.md

Step 2 — Parse mode

步骤2 — 解析模式

InvocationMode
/sb capture
/
/second-brain capture
/ "capture this" / "save this to my brain"
capture
/sb compile
/ "compile the wiki" / "process raw notes"
compile
/sb query <question>
/ "ask my brain X" / "what does my brain say about Y"
query
/sb lint
/ "lint the wiki" / "health check my brain"
lint
/sb connect
/ "find connections" / "suggest wikilinks"
connect
/sb search <term>
/ "search my notes for X"
search
触发指令模式
/sb capture
/
/second-brain capture
/ "capture this" / "save this to my brain"
捕获
/sb compile
/ "compile the wiki" / "process raw notes"
编译
/sb query <question>
/ "ask my brain X" / "what does my brain say about Y"
查询
/sb lint
/ "lint the wiki" / "health check my brain"
检查
/sb connect
/ "find connections" / "suggest wikilinks"
关联
/sb search <term>
/ "search my notes for X"
搜索

Step 3 — Run the mode

步骤3 — 运行对应模式

capture

捕获

Inputs: URL, pasted text, file path, or screenshot.
  1. Detect type from content:
    • URL →
      article-
    • Pasted text with quoted highlights →
      highlights-
    • User's own thoughts / brainstorm →
      braindump-
      or
      idea-
    • Single tweet / X post →
      tweet-
    • PDF, video, podcast →
      resource-
    • Quick reference (recipe, command, fact) →
      note-
    • If ambiguous, ask.
  2. Generate a descriptive filename:
    <type>-<kebab-case-topic>.md
    (e.g.,
    article-andrew-wilkinson-tiny-manual.md
    ). Use the source title or topic — not the URL slug.
  3. Add metadata to the top:
    markdown
    source: <URL if applicable>
    captured: YYYY-MM-DD
  4. Save to
    <vault>/raw/
    .
  5. 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.
  6. 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、粘贴的文本、文件路径或截图。
  1. 根据内容检测类型
    • URL →
      article-
    • 带引用高亮的粘贴文本 →
      highlights-
    • 用户自身想法/头脑风暴内容 →
      braindump-
      idea-
    • 单条推文/X帖子 →
      tweet-
    • PDF、视频、播客 →
      resource-
    • 快速参考内容(食谱、命令、事实) →
      note-
    • 若类型不明确,则询问用户。
  2. 生成描述性文件名
    <type>-<kebab-case-topic>.md
    (例如:
    article-andrew-wilkinson-tiny-manual.md
    )。使用源标题或主题命名——而非URL后缀。
  3. 在顶部添加元数据
    markdown
    source: <URL(若适用)>
    captured: YYYY-MM-DD
  4. 保存至
    <vault>/raw/
  5. 如果源是URL,则获取文章内容(通过WebFetch或agent-browser处理需要权限访问的内容)并保存可读文本——而非仅保存URL。
  6. 反馈保存路径及内容的一行摘要。
请勿在此阶段将内容编译至wiki中——捕获是快速收录操作,编译是单独的、需主动触发的步骤。

compile

编译

The expensive but valuable operation. Process unprocessed raw files into wiki pages.
  1. Find unprocessed raw files: grep
    wiki/*.md
    for
    Sources
    sections; the raw files NOT listed are unprocessed.
  2. Read each unprocessed raw file + the existing
    wiki/INDEX.md
    .
  3. 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
      [[wikilinks]]
      for every related concept
    • Add the raw file under the wiki page's
      ## Sources
      section with a one-line note on what was drawn from it
  4. 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
  5. Connections section is mandatory on every wiki page. If a new page has no connections, find one before saving.
  6. 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页面。
  1. 查找未处理的raw文件:在
    wiki/*.md
    Sources
    章节中搜索;未被列出的raw文件即为未处理文件。
  2. 读取每个未处理的raw文件 + 现有
    wiki/INDEX.md
  3. 针对每个raw文件
    • 提取关键概念、事实、见解
    • 默认规则:若主题重叠,则合并至现有wiki页面。仅当概念无法适配任何现有页面时,才创建新页面。
    • 每个概念对应一个页面,而非每个源文件对应一个页面。
    • 对每个相关概念使用
      [[wikilinks]]
    • 将raw文件添加至wiki页面的
      ## Sources
      章节下,并附上一行说明从中提取的内容
  4. 更新
    wiki/INDEX.md
    • 将新页面添加至对应分类下(创意 / 健康与长寿 / 信仰与个人成长 / 商业 / 个人成长 / 科技 / 爱好 / 科幻 / 宠物 —— 若需要可新增分类)
    • 每条条目一行:
      - [[Page Name]] — 简短描述
  5. 每个wiki页面必须包含关联章节。如果新页面没有关联内容,在保存前需找到至少一个关联页面。
  6. 质量优先于数量。如果页面内容不足100字,暂时保留raw文件,并询问用户是否应将其合并至相邻页面。
输出:创建/更新的页面列表、合并情况、需澄清的内容。

query

查询

Answer a question using ONLY the wiki/raw corpus. Different from
deep-research
(which goes external).
  1. Read
    wiki/INDEX.md
    to identify potentially relevant pages
  2. Read those pages + traverse
    [[wikilinks]]
    1–2 hops
  3. 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
      /deep-research
      to expand
  4. Save to
    outputs/<YYYY-MM-DD>-<question-slug>.md
    with:
    • The original question
    • The answer
    • List of wiki pages consulted
  5. Show the answer in chat + path to the saved output
  6. Optional render: if
    --render pdf
    or
    --render html
    was passed, pipe the output through pandoc using the shared stylesheet. See
    references/schema.md
    → "Publishing alternatives" for the commands.
仅使用wiki/raw语料库回答问题。与
deep-research
(调用外部资源)不同。
  1. **读取
    wiki/INDEX.md
    **以识别潜在相关页面
  2. 读取这些页面 + 遍历1–2层
    [[wikilinks]]
    关联页面
  3. 撰写答案
    • 通过页面名称引用:"根据[[Microplastics Detox]]..."
    • 如果wiki内容存在矛盾,需同时呈现双方观点
    • 如果wiki中没有答案,需告知用户并提议运行
      /deep-research
      来补充内容
  4. 保存至
    outputs/<YYYY-MM-DD>-<question-slug>.md
    ,包含:
    • 原始问题
    • 答案
    • 参考的wiki页面列表
  5. 在聊天中展示答案 + 保存的输出文件路径
  6. 可选渲染:如果传入了
    --render pdf
    --render html
    参数,使用共享样式表通过pandoc处理输出内容。详见
    references/schema.md
    → "发布替代方案"中的命令。

lint

检查

Health check the wiki.
Check:
  1. Orphan pages — wiki/*.md that aren't in INDEX.md
  2. Connection orphans — pages with no
    [[wikilinks]]
    to other pages
  3. Unprocessed raw — raw files not listed under any wiki page's Sources
  4. Stale pages — most recent source >6 months old AND topic is volatile (AI, marketing, finance, health protocols)
  5. Topic gaps — concepts mentioned in 3+ pages without their own dedicated page
  6. Contradictions — wiki pages making opposing claims without flagging it
  7. Missing connections — pages on clearly related topics with no
    [[wikilink]]
    between them (suggest
    /sb connect
    )
Output: prioritized list. Most important first (broken structure beats stale content).
对wiki进行健康校验。
检查项:
  1. 孤立页面
    wiki/*.md
    中未出现在INDEX.md中的页面
  2. 关联孤立页面 — 未链接到其他页面的页面(无
    [[wikilinks]]
  3. 未处理的raw文件 — 未被任何wiki页面的Sources章节列出的raw文件
  4. 过时页面 — 最新源文件已超过6个月且主题属于易变领域(AI、营销、金融、健康方案)
  5. 主题缺口 — 在3个及以上页面中被提及但无专属页面的概念
  6. 矛盾内容 — wiki页面中存在对立观点但未标注的情况
  7. 缺失关联 — 主题明显相关但未通过
    [[wikilink]]
    连接的页面(建议运行
    /sb connect
输出:按优先级排序的列表。最重要的问题排在最前面(结构问题优先于过时内容)。

connect

关联

Find pages that should be linked but aren't.
  1. Build a topic map from INDEX.md + page summaries
  2. For each page, find 2–5 other pages with thematic overlap
  3. Check whether each candidate is already linked
  4. Suggest the missing links — and if the user approves, edit the pages to add them to their
    ## Connections
    sections
查找应该链接但未链接的页面。
  1. 根据INDEX.md和页面摘要构建主题图谱
  2. 为每个页面找到2–5个主题重叠的其他页面
  3. 检查每个候选页面是否已链接
  4. 建议缺失的链接——如果用户同意,编辑页面将链接添加至其
    ## Connections
    章节

search

搜索

Quick grep across
wiki/
+
raw/
for a term. Return matching files with a 2-line excerpt around the match. Faster than
query
when the user knows what page they're looking for.
wiki/
+
raw/
中快速搜索指定术语。返回匹配文件及匹配位置前后2行的摘录。当用户明确知道要找的页面时,此操作比
query
更快。

Composes with

可组合使用的技能

  • deep-research
    — when
    query
    finds gaps in the wiki, route to deep-research to expand from external sources. Deep-research output can be captured back into
    raw/
    for future compilation.
  • paste
    — capture content cleanly into
    raw/
    (especially for terminal/CLI captures).
  • business-brainstorm
    — checks
    Portfolio of Businesses
    and
    Entrepreneurship & Startups
    wiki pages for relevant context before brainstorming.
  • decide
    — pull from
    Personal Philosophy
    /
    Productivity & Systems
    wiki for principles when scoring Q34 ("what principles are we bending"). New: a
    Decision Log
    wiki page accumulates the narrative form of decisions over time (the
    decide
    archive is the structured form; the wiki page is the story).
  • jab-hook
    — a
    Content Ideas
    wiki page hoppers hooks, frameworks, and stories.
    /jab-hook
    drafts pull candidates from there.
  • slide-deck
    — content drafted in
    outputs/
    becomes deck source; speaker notes can reference relevant wiki pages.
  • pm
    — Projects/ folder in the vault is off-limits to second-brain; pm owns it. But a
    Workflow Docs
    wiki page captures operational patterns that show up across multiple projects.
  • deep-research
    — 当
    query
    发现wiki存在内容缺口时,可调用deep-research从外部资源补充内容。deep-research的输出可被捕获回
    raw/
    ,用于后续编译。
  • paste
    — 将内容干净地捕获至
    raw/
    (尤其适用于终端/CLI场景下的捕获)。
  • business-brainstorm
    — 在头脑风暴前,检查wiki中的
    Portfolio of Businesses
    Entrepreneurship & Startups
    页面获取相关背景信息。
  • decide
    — 在评分Q34("我们正在违背哪些原则")时,从wiki的
    Personal Philosophy
    /
    Productivity & Systems
    页面提取原则。新增功能:
    Decision Log
    wiki页面会逐步积累决策的叙事形式(
    decide
    的存档是结构化形式;wiki页面是故事形式)。
  • jab-hook
    Content Ideas
    wiki页面存储钩子、框架和故事。
    /jab-hook
    草稿会从中选取候选内容。
  • slide-deck
    — 在
    outputs/
    中起草的内容可作为幻灯片源;演讲备注可参考相关wiki页面。
  • pm
    — 笔记库中的Projects/文件夹属于second-brain的操作禁区;由pm技能管理。但
    Workflow Docs
    wiki页面会记录多个项目中出现的操作模式。

Sibling implementations (reference)

同类实现方案(参考)

Two other systems following the same raw → wiki → outputs pattern. Both are worth watching as upgrade paths.
  • Hermes'
    llm-wiki
    skill
    — off-the-shelf implementation of the 3-folder pattern. Pre-built workflows for compile / query / lint. Useful for comparing schema decisions.
  • 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
    person-
    raw type +
    People
    wiki page) and scheduled maintenance (wire
    compile
    and
    lint
    to fire on a recurring schedule via the
    loop
    or
    compound-engineering:schedule
    skill).
另外两个遵循raw → wiki → outputs模式的系统。两者都可作为升级方向参考。
  • Hermes的
    llm-wiki
    技能
    — 开箱即用的三文件夹模式实现。预构建了编译/查询/检查工作流。有助于对比架构决策。
  • Gbrain(Garry Tan开发) — 功能更复杂。将第二大脑视为数据库(Postgres或PGLite),支持合成、图谱遍历、缺口分析、定时cron维护和MCP集成。支撑着拥有14.6万页面、2.4万人物实体的部署。如果用户的笔记库超出纯markdown模式的承载能力,Gbrain是升级方向。即使不迁移,也可借鉴其现有功能:人物实体化
    person-
    类型的raw文件 +
    People
    wiki页面)和定时维护(通过
    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
    ,
    Home.md
    , or
    Inbox/
    during second-brain operations. Those belong to other workflows.
  • 质量优先于数量。少量关联良好的wiki页面优于大量内容单薄的页面。如果编译会产生内容单薄的页面,暂时保留raw文件并向用户确认。
  • 不要弱化细节差异。如果两个raw源内容矛盾,wiki页面应标注分歧,而非默认选择某一方观点。
  • 必须包含关联章节 — 每个wiki页面至少链接到一个其他页面。
  • 编译后永不删除raw文件。它们是事实来源。
  • 在second-brain操作期间,绝不修改
    Projects/
    Daily/
    Templates/
    Notes/
    Tasks.md
    Kanban.md
    Home.md
    Inbox/
    中的文件。这些属于其他工作流的范畴。