Second Brain Skill

The /wiki skill turns notes and PDFs into a linked wiki: the model writes summaries, cross links and checks itself.

  • 80 ★ on the repository
  • Last commit
  • MIT
Skill

Extended access

Why this level

  • The skill writes and rewrites many pages in your knowledge base and the model reads the materials.
All reasons and checks

chavesliu/second-brain-skill

Install

In your terminal, with SkillFoxx CLI

npx skillfoxx add skills/second-brain-skill

Detects the agents on your machine, shows the access level and pins the version.

Other ways to install

Access and checks

How we review

Extended accessThe tool runs code or makes network calls and only reads external data.

  • The skill writes and rewrites many pages in your knowledge base and the model reads the materials.

This is third-party code. Review the repository files before installing.

What it does

Second Brain Skill is an open implementation of Andrej Karpathy's LLM Wiki idea. Instead of searching raw documents at every question as RAG does, the skill uses a model to gradually build a structured wiki from materials and maintain links between materials, entities and concepts. You pick sources and ask questions, the model writes summaries, cross references, archiving and consistency checks. The structure has three layers: a `raw/` folder with your materials, a `wiki/` folder with summaries, entities, concepts and analysis, and the skill itself with schema, workflows and scripts. Commands: `/wiki init` creates a base, `/wiki ingest` processes Markdown, PDF and image materials, `/wiki query` answers from accumulated knowledge and `/wiki lint` checks base health. One ingestion creates or updates 10–15 linked pages.

Who it is for. Researchers, students and writers who accumulate papers and notes and want a linked knowledge base maintained by an LLM.

Good fit when

  • Articles and PDFs piled up in a folder and a wiki with summaries and concepts must be built from them.
  • You want to ask what Memex is and get an answer from your own materials.
  • Before important work the base must be checked for broken links with `/wiki lint`.
  • You want to deploy your own knowledge base and fork the skill for your workflows.
  • A reset must be undone: deleted pages sit in `wiki/.trash/`.

Not a fit when

  • You need quick search over a huge document corpus: the skill builds a wiki with no index search.
  • Material contents must not be shown to a model provider.
  • You need a base in a language other than Chinese or English: the init workflow knows `zh` and `en`.

Example request

/wiki ingest process the new articles in raw/ and then /wiki query: how the LLM Wiki approach differs from RAG.

Limitations

The wiki content language at initialization can be chosen only from `zh` and `en`, and README translations do not change that. The model reads materials in full so they go to the model provider. Each ingestion changes many pages at once, so keep the base in Git. The `/wiki wipe` command moves pages to `wiki/.trash/` and the `raw/` folder stays in place. The `/wiki wipe empty-trash` command deletes pages irreversibly, and then only copies in Git history remain. The skill is described as a base framework for forking and customization. Python and `pip install -r requirements.txt` from the scripts folder are required.

How to disable. Delete the `~/.claude/skills/wiki` folder. The knowledge base itself (`raw/` and `wiki/`) sits in your chosen directory and is deleted by hand, while `/wiki wipe` clears pages only.

FAQ

How do I install Second Brain Skill?

Clone the repository, then `cp -r second-brain-skill/skills/wiki ~/.claude/skills/wiki` and `pip install -r ~/.claude/skills/wiki/scripts/requirements.txt`. `/wiki init` creates the first base.

Which commands exist?

`/wiki help`, `init`, `ingest`, `query <question>`, `lint`, `wipe` and `test`. All commands also work from plain phrases, for example compare RAG and the wiki approach.

How does this differ from RAG?

RAG retrieves from raw documents at question time. The skill builds summaries, entities and concepts with links beforehand like a compiler, so knowledge accumulates between questions.

What sits in the raw and wiki folders?

`raw/` holds your materials: papers, notes, PDFs, images, and you write there. `wiki/` holds pages maintained by the model: summaries, entities, concepts, analysis and cross references.

How do I recover deleted pages?

With `/wiki wipe restore`: reset wiki pages sit in `wiki/.trash/` until you run `/wiki wipe empty-trash`.

Discussion

No questions or reviews yet.

Skills

Four skills for a personal Obsidian knowledge base: an agent compiles articles and notes into a linked wiki, answers from it and health-checks it

SkillExtended access775Repository stars

LLM Wiki Manager keeps a personal Markdown wiki through an agent: it ingests sources, links pages and answers with citations

PluginExtended access73Repository stars

Claude Code plugin for a personal wiki per Karpathy's pattern: the agent grows pages from sources and answers with citations.

PluginMinimal access189Repository stars

A skill that lets an agent read the LLM Wiki desktop app's knowledge base over its local HTTP API: search, pages and graph

SkillExtended access155Repository stars

Karpathy LLM Wiki

karpathy-llm-wiki

A skill for a personal knowledge base the model maintains: ingest sources, compile cited articles, lint integrity

SkillExtended access2.7KRepository stars

CLI for a personal Markdown knowledge base: the agent writes, searches and lints pages with wiki commands; the tool calls no model

CLIExtended access104Repository stars

README in short

Three layers split roles: materials, wiki and a schema with workflows. Documentation is available in six languages: Chinese, English, Japanese, Spanish, French and Korean.

README badge

Original SKILL.md

---
name: wiki
version: v1.0.0
author: ChavesLiu
description: |
  知识库管理工具。收录素材、查询知识、健康检查、重置删除。
  TRIGGER when: 用户提到「收录」「加到知识库」「ingest」,或提出知识库中可能有答案的问题(如「XX 是什么」「对比 XX 和 YY」「整理 XX 的信息」),或要求「检查知识库」「lint」,或要求「清空」「删除」「重置」知识库内容,或给出对知识库操作方式的反馈/偏好。
  DO NOT TRIGGER when: 问题与知识库无关(纯代码任务、文件操作、通用对话),或用户明确说不需要查知识库。
user-invocable: true
---

# Second Brain Skill

知识库的统一管理入口。支持命令式调用(`/wiki <cmd>`)和自然语言触发。

## 自然语言路由

当 skill 被自然语言触发(非 `/wiki` 命令格式)时,先判断意图再映射子命令:

| 用户意图 | 映射子命令 | 示例 |
|---------|-----------|------|
| 收录/添加素材 | `ingest` | "收录这篇文章"、"把 raw 里的新文件加到知识库" |
| 提问/查询/对比/整理 | `query` | "Memex 是什么"、"对比 RAG 和 Wiki 模式"、"整理一下 XX 的信息" |
| 反馈/偏好/纠正 | `query`(走反馈分支) | "回答要标注来源"、"你上次说错了" |
| 检查/审计 | `lint` | "检查下知识库有没有问题" |
| 删除/清空/重置 | `wipe` | "删掉 XX 相关的页面"、"重置知识库" |
| 初始化 | `init` | "创建一个新的知识库" |

确定子命令后,将用户原始输入作为 `args`,进入下方执行步骤。

## 执行步骤

### 1. 运行路由脚本

运行 `python <skill-dir>/scripts/router.py <子命令> [参数]` 获取路由结果(JSON)。

`<skill-dir>` 为本文件所在目录的绝对路径。对于自然语言触发,先按上表映射出子命令再调用。

### 2. 根据路由结果执行

根据 JSON 中的 `status` 字段分支:

#### `status: "ok"` — 正常执行

```

Report a problem