当前位置: 首页 > Skill >

Obsidian Wiki

Obsidian Wiki

1.2.2 2026.11.14 浏览:935
获取Skill文件查看使用说明
作者:林景许可证:
本文目录展开

Obsidian Wiki

Implements Karpathy's LLM Wiki pattern inside an Obsidian vault. The agent is the compiler; Obsidian is the IDE; the wiki is the codebase.

Prerequisites

  • bash — required by all scripts; python3 — required by wiki-lint.sh, wiki-manifest.sh, and all Python scripts
  • pdftotext — optional, for extract-book-digests.sh (install via poppler)
  • markdownlint-cli2 — optional, for markdown structure checks (auto-installed via npx)

Vault Resolution

Resolve the vault path at runtime. Store it in $VAULT for all operations.

Preferred methods (in order):

  1. If the user specifies a vault path, use it directly
  2. Read the Obsidian config file to find the open vault:
python3 -c "
import json, pathlib, os
# Obsidian stores vault config in a platform-dependent location
for p in [
    'Library/Application Support/obsidian/obsidian.json',
    '.config/obsidian/obsidian.json',
    '.var/app/md.obsidian.Obsidian/config/obsidian/obsidian.json',
]:
    f = pathlib.Path.home() / p
    if f.exists():
        for v in json.loads(f.read_text()).get('vaults',{}).values():
            if v.get('open'): print(v['path']); break
        break
"
  1. Use obsidian-cli print-default --path-only if available
  2. Before any write, print the resolved $VAULT path. If it was inferred via Obsidian config or obsidian-cli, get user confirmation before continuing.

The skill and scripts make no assumptions about the vault location. All paths are relative to $VAULT. Scripts require Bash and python3; they use BSD-compatible grep/sed/awk and are tested on macOS and Linux.

Vault Layout

<vault>/
├── raw/                    # Immutable source documents
│   ├── articles/           # Web clips, blog posts
│   ├── papers/             # arXiv, IEEE, ACM papers
│   ├── specifications/     # Standards, RFCs, W3C/ECMA/ISO specs, protocol docs
│   ├── projects/           # Project notes, meeting transcripts
│   ├── books/              # Book chapters, excerpts
│   └── assets/             # Images, diagrams (downloaded locally)
├── wiki/                   # LLM-compiled pages (agent-owned)
│   ├── entities/           # People, systems, projects, orgs
│   ├── concepts/           # Ideas, patterns, technologies, methods
│   ├── syntheses/          # Cross-cutting summaries, comparisons
│   ├── sources/            # One summary page per ingested source
│   ├── reports/            # Agent-generated dashboards (agent creates during maintain workflow)
│   ├── index.md            # Auto-generated TOC
│   └── log.md              # Append-only chronological record
├── _meta/
│   ├── schema.md           # Wiki conventions (co-evolves with user)
│   └── taxonomy.md         # Canonical tag vocabulary
├── .wiki-meta/             # Machine state (not for humans)
│   └── manifest.json       # Delta tracking: ingested files + SHA-256 hashes
├── AGENTS.md               # Agent instructions for this vault
└── .obsidian/              # Obsidian config (don't touch)

Ownership rules

  • raw/ — immutable. The agent reads but never modifies.
  • wiki/ — agent-owned. The agent creates, updates, and maintains all pages.
  • _meta/ — co-owned. The agent proposes changes; the user approves.
  • .wiki-meta/ — machine-only. Delta tracking, caches.
  • Everything else in the vault is untouched.

Page Format

See _meta/schema.md (initialized from references/schema-template.md) for full conventions.

Essential reminders:

  • Filenames: kebab-case.md, ASCII only
  • Wikilinks: [[filename|Display Title]] — in tables: [[filename|Display Title]]
  • Provenance: %%from: raw/path%% or %%inferred%%

Workflows

1. Setup

Initialize the vault structure. Create dirs, then:

  • Copy references/schema-template.md → _meta/schema.md
  • Copy references/taxonomy-template.md → _meta/taxonomy.md
  • Copy references/agents-template.md → AGENTS.md
  • Customize AGENTS.md for the vault's domain
  • Propose changes to _meta/schema.md and _meta/taxonomy.md; edit them only after user approval
  • Create wiki/index.md, wiki/log.md

Source of truth: once copied, _meta/ and AGENTS.md are the live instances. references/ are generic starter templates — they do not stay in sync.

2. Ingest

  1. Run scripts/wiki-manifest.sh "$VAULT" diff to see pending sources
  2. For each pending file:
    • Read the source, identify entities, concepts, claims, relationships
    • Create a source summary in wiki/sources/
    • Create or update entity/concept pages with [[wikilinks]]
    • Track provenance in frontmatter sources: field
  3. Mark ingested: scripts/wiki-manifest.sh "$VAULT" mark <file>
  4. Regenerate index: scripts/wiki-index.sh "$VAULT"
  5. Append to wiki/log.md:
    ## [YYYY-MM-DD] ingest | <Source Title>
    - Source: raw/<path>
    - Pages created: <list>
    - Pages updated: <list>
    

Source types:

  • .md / .txt — read directly with read tool
  • .pdf — use pdf tool to extract content (copy to workspace first if the file is outside it, then clean up)
  • .epub / .html — convert to text or extract content before ingesting
  • URL — use web_fetch to save as .md in the appropriate raw/ subfolder (articles/ for blog posts, specifications/ for specs, etc.), then ingest the .md
  • Images in raw/assets/ — referenced by pages, not ingested independently (the manifest tracks only ingestable document sources)

Choosing the right raw/ subfolder:

Subfolder What goes here Examples
articles/ Web clips, blog posts, news Blog post, HN discussion, newsletter
papers/ Academic & research papers arXiv, IEEE, ACM, NeurIPS papers
specifications/ Standards & technical specs RFCs, W3C specs, ECMA standards, ISO/IEEE standards, OpenAPI specs, protocol docs, language specifications
projects/ Project notes, meeting transcripts Sprint retro, design doc, ADR
books/ Book chapters, excerpts Textbook PDF, epub chapter
assets/ Images, diagrams (not ingested) Screenshots, architecture diagrams

3. Query

  1. Read wiki/index.md to find relevant pages
  2. Read relevant pages, synthesize an answer with [[wikilink]] citations
  3. Offer to save valuable answers as new pages in wiki/syntheses/

4. Lint

Run scripts/wiki-lint.sh "$VAULT" for automated checks (frontmatter, broken wikilinks, orphans, stale pages, tag drift, wikilink format, markdown structure, unlinked mentions). Requires python3; markdown structure checks additionally require npx. Use --fix to auto-correct fixable issues. Then manually review for:

  • Contradictions between pages
  • Missing pages: concepts mentioned in text but lacking their own page
  • Weak cross-references that should be strengthened

5. Maintain

Periodic (heartbeat or manual):

  1. Run lint
  2. Scan for unlinked mentions of entity/concept names → add [[wikilinks]]
  3. If new tags emerged, propose an update to _meta/taxonomy.md; edit it only after user approval
  4. Populate wiki/reports/ with dashboards (open questions, contradictions, stale)
  5. Review stale pages, flag for update or archival

6. Navigate

Use the obsidian skill (if available) for CLI operations (search, open, move/rename with wikilink refactoring). For bulk reads/writes, use read/write tools directly.

7. Search

bash scripts/wiki-search.sh "$VAULT" "query terms"

Uses qmd for semantic search when available; falls back to grep.

Scripts

Bundled shell scripts require Bash (BSD-compatible grep/sed/awk). wiki-lint.sh and wiki-manifest.sh require python3. extract-book-digests.sh additionally requires pdftotext. wiki-manifest.sh uses shasum or sha256sum when available and falls back to Python hashlib otherwise. wiki-lint.sh optionally uses markdownlint-cli2 (via npx) for markdown structure checks. Resolve <skill-dir> to the directory containing this SKILL.md.

scripts/wiki-index.sh "$VAULT"

Regenerate wiki/index.md from frontmatter of all wiki pages.

scripts/wiki-lint.sh "$VAULT" [--fix]

All-in-one wiki linter. Runs all checks by default. --fix auto-corrects fixable issues (wikilink format, markdown structure, and unlinked mentions via crosslink). Internally calls wiki-lint-links.py for wikilink resolution, markdownlint-cli2 (via npx) for markdown structure, and wiki-crosslink.py for unlinked mention detection.

scripts/wiki-manifest.sh "$VAULT" <command>

Delta tracking via SHA-256 hashes in .wiki-meta/manifest.json.

wiki-manifest.sh "$VAULT" status        # raw vs ingested vs pending counts
wiki-manifest.sh "$VAULT" diff          # list files needing ingest
wiki-manifest.sh "$VAULT" mark <file>   # mark a file as ingested

scripts/extract-book-digests.sh <books-dir> <output-dir>

Extract first 12 pages of each PDF as text via pdftotext. Used for cross-validating wiki source pages against actual book content. Writes .txt outputs to <output-dir>; prefer a directory under $VAULT/.wiki-meta/ unless the user explicitly asks for another location.

scripts/wiki_lib.py

Shared Python library. Not a standalone script. Used internally by wiki-lint-links.py, wiki-crosslink.py, and wiki-graph.py. Exports: WikiMap, read_md, parse_link_target, and shared regexes.

scripts/wiki-crosslink.py "$VAULT" [--fix]

Find page titles and aliases mentioned in wiki text that are not already wrapped in [[wikilinks]]. Reports UNLINKED:<file>t<mention>t<target> lines and a STATS:scanned=N unlinked=N fixed=N errors=N summary. --fix auto-adds the wikilinks in-place.

scripts/wiki-graph.py "$VAULT" [--format json|graphml] [--stats]

Export the wiki's wikilink graph. Default output: .wiki-meta/graph.json. --format graphml writes .wiki-meta/graph.graphml instead. --stats prints hub, articulation point, and orphan analysis to stdout.

scripts/wiki-search.sh "$VAULT" "<query>"

Search the wiki. Uses qmd search if qmd is in PATH; otherwise falls back to grep + title/summary display.

Multi-Agent Setup

The vault root supports agent instructions files for coding agents:

  • Copy references/agents-template.md as AGENTS.md at vault root.
  • For Claude Code: symlink ln -s AGENTS.md CLAUDE.md so both agents read the same file.
  • For other agents (Cursor, Windsurf, Gemini): symlink or copy to their expected filename.

Customize the copied file for your vault's domain. The references/ copy is a read-only template — it does not stay in sync with the live instance.

Tips

  • Ingest one source at a time for best quality. Stay involved.
  • Good answers → wiki pages. Don't let syntheses disappear into chat history.
  • Graph view in Obsidian shows wiki shape: hubs, orphans, clusters.
  • Dataview plugin queries frontmatter if installed.
  • Git the vault for version history (recommended).
  • Web Clipper browser extension gets articles into raw/ fastest.

推荐文章

更多
PHP时间戳与日期字符串相互转换方法详解

本文介绍PHP中时间数值(Unix时间戳)与日期字符串之间的相互转换方法。通过strtotime和date函数,实现将当前时间、指定日期转换为时间戳,以及将时间戳格式化为可读的日期时间字符串,并提供相关在线计算工具推荐。

2025.11.30 1,033
PHP日期转时间戳时区偏差怎么解决

在 PHP 中将日期字符串转换为时间戳时,若未显式指定时区,默认使用脚本配置的 date.timezone 或系统时区。当服务器时区与业务逻辑预期(如 UTC )不一致时,会产生偏差。解决核心是确保输入字符串携带明确时区信息,或在转换前统一设置时区上下文。

2026.10.24 1,031
PHP跨域配置:怎么安全地允许指定域名而非使用通配符

在 PHP 中安全地允许指定域名跨域,核心是解析请求头中的 Origin ,验证其是否在白名单内,然后动态设置 Access-Control-Allow-Origin 响应头。不要使用通配符 * ,也不要硬编码单一域名。

2025.03.29 1,018
JavaScript中利用replace结合正则实现replaceAll效果

JavaScript原生仅支持replace()进行单次或全局替换,缺乏类似Java的replaceAll()便捷方法。本文总结四种在JS中实现全量替换的方案:使用带g标志的正则、带gm标志的正则、扩展String原型以及split后join。通过对比代码示例,展示各方法的实现细节与适用场景,帮助开发者根据需求选择最优解。

2025.04.29 1,016
OpenAI的Jalapeno芯片未落地,教你分辨300兆瓦算力消息

OpenAI计划在SB Energy租赁的数据中心部署约300兆瓦自研Jalapeno推理芯片,但目前双方仍处于洽谈阶段,交易细节与上线时间表均未公布。本文带你按报道原文核实项目所处阶段,厘清芯片发布、电力功率与实际推理算力的边界,并将融资意向与签约、开工、投运节点分开追踪,避免误将规划容量计入现有算力。

2026.12.02 1,012
PHP实现基础文件上传:HTML表单与$_FILES处理流程

在 HTML 表单中设置 enctype="multipart/form-data" ,并在 PHP 后端通过 $_FILES 数组接收文件,调用 move_uploaded_file() 将临时文件移动到目标目录即可完成上传。

2026.09.07 1,012
Skill 文件
  • SKILL.md
    • Obsidian Wiki
    • Prerequisites
    • Vault Resolution
    • Vault Layout
      • Ownership rules
    • Page Format
    • Workflows
      • 1. Setup
      • 2. Ingest
      • 3. Query
      • 4. Lint
      • 5. Maintain
      • 6. Navigate
      • 7. Search
    • Scripts
      • scripts/wiki-index.sh "$VAULT"
      • scripts/wiki-lint.sh "$VAULT" [--fix]
      • scripts/wiki-manifest.sh "$VAULT" <command>
      • scripts/extract-book-digests.sh <books-dir> <output-dir>
      • scripts/wiki_lib.py
      • scripts/wiki-crosslink.py "$VAULT" [--fix]
      • scripts/wiki-graph.py "$VAULT" [--format json|graphml] [--stats]
      • scripts/wiki-search.sh "$VAULT" "<query>"
    • Multi-Agent Setup
    • Tips
  • 项目或源文件

相关 Skill

更多
obsidian-wiki obsidian-wiki 使用 LLM Wiki 模式构建并维护个人知识 Wiki,采用 OpenClaw 优化的分步执行,并通过子代理实现并行处理。
LLM-WIKI(龙虾联动OB建立) LLM-WIKI(龙虾联动OB建立) LLM Wiki 知识库系统 — Skill 安装使用说明 这个 Skill 是什么? LLM Wiki 是一个让 AI 帮你打理 Obsidian 知识库的 WorkBuddy Skill(龙虾技能)。 如果是workbuddy还可以联动生成腾讯文档空间!!! 核心理念很简单: 你负责收集素材(文章、PDF、网页剪藏) AI 负责读取素材 → 提炼知识 → 写入 Obsidian Wiki 页面 → 维护索引 最终你会得到一个结构化、可查询、有图谱的 Obsidian 知识库,而不是一堆散乱的收藏文章。 能达到什么效果? 安装并运行后,你的 Obsidian vault 会变成这样: 你的Vault/ ├── SCHEMA.md ← AI 的"操作手册"(自动生成) ├── raw/sources/ ← 你丢进来的原始文章(AI 只读不改) └── wiki/ ├── index.md ← 知识目录(AI 自动维护) ├── log.md ← 变更记录(AI 自动追加) ├── 实体/
Obsidian Search Obsidian Search 使用 AI 向量嵌入在 Obsidian 笔记中进行语义搜索,按含义查找笔记、发现关联、按标签/日期/文件夹筛选,并获取完整内容
Article Fetcher(文章抓取+Notion/Obsidian知识库存档) Article Fetcher(文章抓取+Notion/Obsidian知识库存档) 抓取微信公众号、小红书、豆瓣、知乎文章,自动上传OSS图片,LLM智能提取关键词,一键存档至Obsidian本地库(可选Notion)
LLM Wiki LLM Wiki 创建并维护一个持久化的、由大语言模型(LLM)维护的知识库(wiki),遵循Andrej Karpathy的模式。LLM主动构建并维护相互连接的内容...