llm-wiki-bootstrap

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Karpathy LLM Wiki Bootstrap

Karpathy LLM Wiki Bootstrap

Scaffold a complete LLM Wiki framework from zero: directory structure, schema (the AI instruction file), index, log, and operational workflows. The output is a ready-to-use wiki that the user and their LLM agent can immediately start populating.
Guiding principle: The wiki is a persistent, compounding artifact. The LLM writes and maintains all content. The human curates sources, directs analysis, and asks questions. This skill builds the scaffolding; the user and their LLM fill it with knowledge over time.
从零搭建完整的LLM Wiki框架:目录结构、Schema(AI指令文件)、索引、日志和操作工作流。输出结果是一个可直接使用的wiki,用户及其LLM Agent可立即开始填充内容。
指导原则:wiki是一个持久化、可不断积累的成果。所有内容由LLM编写和维护,人类负责整理来源、指导分析并提出问题。本技能仅搭建框架,用户及其LLM会随着时间推移为其填充知识。

Workflow

工作流

Six sequential phases. Each phase completes before the next begins.
六个连续阶段,需完成前一阶段后再进入下一阶段。

Phase 1: Gather Requirements

阶段1:收集需求

BLOCKING — must complete before any file creation.
Use
AskUserQuestion
with ALL questions in ONE call:
Q1 — header: "Domain", question: "What is this wiki about?"
  • Options: "Research topic", "Book / media", "Personal (goals, health, learning)", "Business / team", "Other (describe below)"
Q2 — header: "Wiki name", question: "Short name for the wiki root directory?"
  • Free text. Suggest:
    {domain}-wiki
    (e.g.
    ml-wiki
    ,
    lotr-wiki
    ,
    health-wiki
    )
Q3 — header: "Agent", question: "Which LLM agent will maintain this wiki?"
  • Options:
    • "Claude Code" — generates
      CLAUDE.md
    • "OpenAI Codex" — generates
      AGENTS.md
    • "Copilot (VS Code)" — generates
      .github/copilot-instructions.md
    • "Other / generic" — generates
      SCHEMA.md
Q4 — header: "Editor", question: "Primary editor for browsing the wiki?"
  • Options: "Obsidian (recommended)", "VS Code", "Other / plain files"
Q5 — header: "Source types", question: "What kind of sources will you add?"
  • Multi-select. Options: "Web articles", "PDFs / papers", "Books (chapter by chapter)", "Meeting notes / transcripts", "Personal notes / journals", "Images / diagrams", "Data files (CSV, JSON)", "Other"
Q6 — header: "Output location", question: "Where to create the wiki?"
  • Options:
    • "Current directory" — create
      {wiki-name}/
      here
    • "Custom path" — user types absolute path
Store all answers as session variables for subsequent phases.
阻塞性任务——必须完成此阶段才能创建任何文件。
通过一次调用
AskUserQuestion
提出所有问题:
Q1 — 标题:“领域”,问题:“此wiki的主题是什么?”
  • 选项:“研究课题”、“书籍/媒体”、“个人(目标、健康、学习)”、“商务/团队”、“其他(请在下方描述)”
Q2 — 标题:“Wiki名称”,问题:“wiki根目录的简短名称?”
  • 自由文本输入。建议格式:
    {domain}-wiki
    (例如:
    ml-wiki
    lotr-wiki
    health-wiki
Q3 — 标题:“Agent”,问题:“将维护此wiki的LLM Agent是哪一个?”
  • 选项:
    • "Claude Code" — 生成
      CLAUDE.md
    • "OpenAI Codex" — 生成
      AGENTS.md
    • "Copilot (VS Code)" — 生成
      .github/copilot-instructions.md
    • "其他/通用" — 生成
      SCHEMA.md
Q4 — 标题:“编辑器”,问题:“浏览wiki的主要编辑器?”
  • 选项:“Obsidian(推荐)”、“VS Code”、“其他/纯文本文件”
Q5 — 标题:“来源类型”,问题:“你将添加哪些类型的来源?”
  • 多选。选项:“网页文章”、“PDF/论文”、“书籍(按章节)”、“会议记录/转录稿”、“个人笔记/日志”、“图片/图表”、“数据文件(CSV、JSON)”、“其他”
Q6 — 标题:“输出位置”,问题:“在哪里创建wiki?”
  • 选项:
    • "当前目录" — 在此处创建
      {wiki-name}/
    • "自定义路径" — 用户输入绝对路径
将所有答案存储为会话变量,供后续阶段使用。

Phase 2: Create Directory Structure

阶段2:创建目录结构

Based on Phase 1 answers, create the directory tree:
{wiki-root}/
├── raw/                    # Immutable source documents
│   └── assets/             # Images, attachments (if image sources selected)
├── wiki/                   # LLM-maintained markdown pages
│   ├── index.md            # Content catalog
│   ├── log.md              # Chronological operation log
│   └── overview.md         # High-level synthesis (starts empty)
├── {schema-file}           # AI instruction file (name from Q3)
└── .gitignore              # Ignore OS files, keep everything else
Conditional directories:
ConditionAdd
Q5 includes images/diagrams
raw/assets/
Q4 = Obsidian
.obsidian/
is NOT created (Obsidian auto-creates it)
Any source type selected
raw/
with a
.gitkeep
根据阶段1的答案,创建目录树:
{wiki-root}/
├── raw/                    # 不可变的源文档
│   └── assets/             # 图片、附件(若选择了图片来源)
├── wiki/                   # LLM维护的Markdown页面
│   ├── index.md            # 内容目录
│   ├── log.md              # 按时间顺序的操作日志
│   └── overview.md         # 高层级综述(初始为空)
├── {schema-file}           # AI指令文件(名称来自Q3)
└── .gitignore              # 忽略系统文件,保留其他所有内容
条件目录
条件添加内容
Q5包含图片/图表
raw/assets/
Q4 = Obsidian不创建
.obsidian/
(Obsidian会自动创建)
选择了任何来源类型带有
.gitkeep
文件的
raw/
目录

Phase 3: Generate Schema File

阶段3:生成Schema文件

The schema is the most critical output. It instructs the LLM agent how to operate on the wiki. Generate it using the template at references/templates/schema.md.
Customization rules:
VariableSource
{WIKI_NAME}
Q2 answer
{DOMAIN_DESCRIPTION}
Q1 answer (expanded to 1-2 sentences)
{SOURCE_TYPES}
Q5 answers, comma-separated
{SCHEMA_FILENAME}
Determined by Q3
{EDITOR}
Q4 answer
{DATE}
Current date in YYYY-MM-DD
After generating, adapt section details:
  • If domain is "Book / media" → add character, timeline, and plot-thread page types
  • If domain is "Research" → add paper-summary and claim-tracking page types
  • If domain is "Personal" → add journal-entry and goal-tracking page types
  • If domain is "Business / team" → add decision-log and meeting-summary page types
Schema是最重要的输出,它指导LLM Agent如何操作wiki。使用references/templates/schema.md中的模板生成。
自定义规则
变量来源
{WIKI_NAME}
Q2的答案
{DOMAIN_DESCRIPTION}
Q1的答案(扩展为1-2句话)
{SOURCE_TYPES}
Q5的答案,用逗号分隔
{SCHEMA_FILENAME}
由Q3决定
{EDITOR}
Q4的答案
{DATE}
当前日期(格式:YYYY-MM-DD)
生成后,调整章节细节:
  • 如果领域是“书籍/媒体”→添加角色、时间线和情节线页面类型
  • 如果领域是“研究”→添加论文摘要和主张追踪页面类型
  • 如果领域是“个人”→添加日志条目和目标追踪页面类型
  • 如果领域是“商务/团队”→添加决策日志和会议摘要页面类型

Phase 4: Generate Initial Wiki Files

阶段4:生成初始Wiki文件

Create three seed files using templates in
references/templates/
:
4.1 index.md — from references/templates/index.md
  • Start with the universal sections (Sources, Entities, Concepts, Comparisons, Synthesis)
  • Add domain-specific sections matching the page types injected in Phase 3:
    • Research → Papers, Claims, Methods, Datasets
    • Book / media → Characters, Timelines, Themes, Locations
    • Personal → Journal, Goals, Habits, Lessons
    • Business → Decision Logs, Meetings, Projects, Stakeholders
  • Leave content sections empty with placeholder comments
4.2 log.md — from references/templates/log.md
  • Write the first entry: wiki creation event with current date
4.3 overview.md — from references/templates/overview.md
  • Minimal stub that explains the wiki's purpose and domain
使用
references/templates/
中的模板创建三个初始文件:
4.1 index.md — 来自references/templates/index.md
  • 从通用章节开始(来源、实体、概念、对比、综述)
  • 添加与阶段3中注入的页面类型匹配的领域特定章节:
    • 研究→论文、主张、方法、数据集
    • 书籍/媒体→角色、时间线、主题、地点
    • 个人→日志、目标、习惯、经验教训
    • 商务→决策日志、会议、项目、利益相关者
  • 内容部分留空,添加占位符注释
4.2 log.md — 来自references/templates/log.md
  • 写入第一条记录:包含当前日期的wiki创建事件
4.3 overview.md — 来自references/templates/overview.md
  • 极简 stub,说明wiki的用途和领域

Phase 5: Editor Configuration

阶段5:编辑器配置

If Q4 = Obsidian:
Do NOT create
.obsidian/
or modify Obsidian settings. Instead, append a
## Obsidian Setup
section to the schema file with recommendations:
  • Set "Attachment folder path" to
    raw/assets/
    in Settings → Files and links
  • Install recommended plugins: Dataview (frontmatter queries), Marp (slide decks if needed)
  • Use graph view to inspect wiki structure
  • Bind "Download attachments" hotkey if using Web Clipper
If Q4 = VS Code:
Create
.vscode/settings.json
with markdown-friendly defaults:
json
{
  "files.exclude": { "**/.DS_Store": true },
  "editor.wordWrap": "on",
  "markdown.preview.breaks": true
}
Do NOT append an Obsidian section to the schema file.
If Q4 = Other / plain files:
Skip editor configuration entirely. Do NOT append any editor-specific section to the schema file. Do NOT create
.vscode/
.
如果Q4 = Obsidian
不要创建
.obsidian/
或修改Obsidian设置。而是在Schema文件末尾添加
## Obsidian 设置
章节,提供建议:
  • 在设置→文件与链接中,将“附件文件夹路径”设置为
    raw/assets/
  • 安装推荐插件:Dataview(前置元数据查询)、Marp(如需幻灯片)
  • 使用图谱视图检查wiki结构
  • 如果使用Web Clipper,绑定“下载附件”快捷键
如果Q4 = VS Code
创建
.vscode/settings.json
,配置Markdown友好的默认设置:
json
{
  "files.exclude": { "**/.DS_Store": true },
  "editor.wordWrap": "on",
  "markdown.preview.breaks": true
}
不要在Schema文件中添加Obsidian章节。
如果Q4 = 其他/纯文本文件
完全跳过编辑器配置。不要在Schema文件中添加任何编辑器特定章节,也不要创建
.vscode/
目录。

Phase 6: Summary and Next Steps

阶段6:总结与后续步骤

After all files are created, output a brief summary:
Wiki scaffolded at {wiki-root}/

Structure:
  raw/          → Drop source documents here
  wiki/         → LLM-maintained pages (index, log, overview)
  {schema-file} → AI instructions for wiki operations

Next steps:
  1. Open {wiki-root}/ in {editor}
  2. Add your first source to raw/
  3. Tell your LLM agent: "Read {schema-file}, then ingest raw/{filename}"
所有文件创建完成后,输出简短总结:
Wiki已搭建在 {wiki-root}/

结构说明:
  raw/          → 在此处放入源文档
  wiki/         → LLM维护的页面(索引、日志、综述)
  {schema-file} → wiki操作的AI指令

后续步骤:
  1. 在{editor}中打开{wiki-root}/
  2. 向raw/中添加你的第一个源文档
  3. 告诉你的LLM Agent:“阅读{schema-file},然后处理raw/{filename}”

Post-Bootstrap Operations

搭建后操作

The schema file generated in Phase 3 defines three core operations. These are documented in detail in:
  • references/workflows/ingest.md — source ingestion protocol
  • references/workflows/query.md — query and answer-filing protocol
  • references/workflows/lint.md — wiki health-check protocol
The schema file embeds condensed versions of these workflows. The reference files here contain the full rationale and edge cases for skill maintainers.
阶段3生成的Schema文件定义了三个核心操作,详细文档位于:
  • references/workflows/ingest.md — 源文档处理协议
  • references/workflows/query.md — 查询与答案归档协议
  • references/workflows/lint.md — wiki健康检查协议
Schema文件中嵌入了这些工作流的精简版本,此处的参考文件包含了技能维护者所需的完整原理和边缘情况说明。

Design Principles

设计原则

These inform all generated content:
  1. LLM-native — all instructions are written as executable protocols for language models, not prose for humans
  2. Source of truth separation — raw sources are immutable; the wiki is derived and regenerable
  3. Incremental compilation — each source is integrated once; knowledge compounds, not re-derived
  4. Convention over configuration — sensible defaults, minimal required decisions
  5. Editor-agnostic core — markdown files work everywhere; editor-specific features are optional layers
  6. Git-friendly — plain text, no binary blobs in wiki/, version history for free
这些原则指导所有生成内容:
  1. LLM原生 — 所有指令均为语言模型可执行的协议,而非面向人类的散文
  2. 真相源分离 — 原始源文档不可变;wiki是派生且可重新生成的
  3. 增量编译 — 每个源文档仅集成一次;知识不断积累,无需重新推导
  4. 约定优于配置 — 合理的默认设置,最小化必要决策
  5. 编辑器无关核心 — Markdown文件可在任何地方使用;编辑器特定功能为可选层
  6. Git友好 — 纯文本,wiki/目录中无二进制大对象,免费获得版本历史",