obsidian-organizer
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseObsidian Organizer
Obsidian 库整理工具
Keep a large Obsidian vault tidy over time by (1) filing new notes into the
best-fit folder and (2) auditing/reorganizing existing structure. Both modes lean
on one shared idea: a plain-markdown map of "what goes where" that lives inside
the vault so it never drifts out of sync with reality.
This skill drives the CLI (from the separate skill),
which talks to the live, running Obsidian desktop app. The app must be open.
If a command fails with a connection/vault error, tell the user to open Obsidian
rather than guessing.
obsidianobsidian-cli通过以下两种方式长期保持大型Obsidian库整洁:(1) 将新笔记归档到最适合的文件夹;(2) 审核/重组现有结构。两种模式都基于同一个核心思路:一份存放在库内的纯Markdown格式“内容归属映射”,确保它永远不会与实际库结构脱节。
此功能依赖 CLI(来自独立的技能),该CLI与运行中的Obsidian桌面应用通信。应用必须处于打开状态。如果命令因连接/库错误失败,请告知用户打开Obsidian,而非自行猜测。
obsidianobsidian-cliWhy the map lives in the vault (read this first)
为何映射文件要存放在库内(请先阅读此部分)
Deciding a folder for every new note by re-listing ~650 folders is expensive and
guesses drift. Copying the folder taxonomy into Claude's private memory creates a
worse problem: a stale copy that silently disagrees with the real vault.
The fix is one file, , checked into the vault itself. It
is the single source of truth for filing decisions. Read it with one cheap call
before you file or reorganize — do not re-run a full
traversal unless the map is missing or the user asks you to rebuild it.
00_Index/Folder_Map.mdobsidian foldersbash
obsidian read path="00_Index/Folder_Map.md"It is deliberately plain markdown (headers + bullets, no required frontmatter) so
both you and the human can append to it by hand as new categories emerge. When you
create a new folder/category, add a line to this file so the next filing decision
remembers it.
If the map does not exist (deleted, or a fresh vault), rebuild it from the live
vault, not from a copy stashed in this skill — a bundled copy would drift from
reality, which is the whole failure this file exists to prevent. List the real
structure with (and
for depth), draft a plain-markdown map grouped by top-level PARA folder with a
short "what goes here" note per folder plus a filing rule-of-thumb, confirm the
groupings with the user, then create it:
.
obsidian vault="MyVault" foldersfolders folder=...obsidian vault="MyVault" create path="00_Index/Folder_Map.md" content="..."为每条新笔记决定文件夹时,重新列出约650个文件夹成本很高,且猜测结果会逐渐偏离实际。将文件夹分类体系复制到Claude的私有内存中会引发更严重的问题:出现与真实库结构不一致的过期副本。
解决方案是使用库内的单个文件,它是归档决策的唯一事实来源。在执行归档或重组操作前,只需通过一次简单调用读取该文件——除非映射文件缺失或用户要求重建,否则不要重新执行完整的遍历。
00_Index/Folder_Map.mdobsidian foldersbash
obsidian read path="00_Index/Folder_Map.md"它特意采用纯Markdown格式(标题+项目符号,无必填前置元数据),以便你和用户都能手动添加新分类。当你创建新文件夹/分类时,需在该文件中添加一行描述,以便后续归档决策能识别它。
如果映射文件不存在(已删除或为全新库),请从运行中的库重建,而非使用此技能中存储的副本——捆绑的副本会与实际情况脱节,而这正是该文件要避免的核心问题。使用(以及指定深度)列出真实结构,草拟一份按顶级PARA文件夹分组的纯Markdown映射,每个文件夹附带简短的“内容归属说明”及归档经验法则,与用户确认分组后再创建该文件:。
obsidian vault="MyVault" foldersfolders folder=...obsidian vault="MyVault" create path="00_Index/Folder_Map.md" content="..."Vault targeting
库定位
MyVaultbash
obsidian vault="MyVault" read path="00_Index/Folder_Map.md"vault=Folder_Map.md上述是占位符——请在所有位置替换为用户的实际库名称。如果用户有多个库,请在每个命令中明确指定目标库,避免因“最近聚焦的库”默认设置错误归档笔记:
MyVaultbash
obsidian vault="MyVault" read path="00_Index/Folder_Map.md"vault=Folder_Map.mdThe one hard safety rule: never touch vault files with raw shell
唯一硬性安全规则:永远不要用原生Shell操作库文件
When you relocate or rename a file, always use the CLI's own /
commands. These go through Obsidian's API, so Obsidian's built-in "automatically
update internal links" behavior rewrites every wikilink and backlink across the
vault to follow the moved file. A raw , , , or on a
path inside the vault skips that repair and silently leaves broken links pointing
at the old location.
moverenamemvrmrmdirfind -deleteSo, for anything under the vault directory:
- Move/rename → or
obsidian move ...obsidian rename ... - Delete → (sends to trash unless
obsidian delete ...)permanent - Never use Bash /
mv/rm/rmdiron vault-internal paths.find -delete
Reading a file's bytes with a non-mutating tool is fine; mutating vault files is
CLI-only.
当你移动或重命名文件时,务必使用CLI自带的/命令。这些命令通过Obsidian的API执行,因此Obsidian内置的“自动更新内部链接”功能会重写库中所有维基链接和反向链接,使其指向移动后的文件。直接使用原生Shell的、、或操作库内路径会跳过此修复步骤,导致链接静默指向旧位置并失效。
moverenamemvrmrmdirfind -delete因此,对于库目录下的所有操作:
- 移动/重命名 → 使用或
obsidian move ...obsidian rename ... - 删除 → 使用(除非指定
obsidian delete ...,否则会移至回收站)permanent - 绝对不要对库内路径使用Bash的/
mv/rm/rmdir命令。find -delete
使用非修改工具读取文件内容是允许的;修改库文件必须通过CLI执行。
Mode 1 — File a note
模式1 — 归档笔记
Goal: given a note (an existing path, or a title + content you're about to
write), put it in the single best-fit folder.
- Read the map once: .
obsidian vault="MyVault" read path="00_Index/Folder_Map.md" - Match the note's topic to a destination using the map's filing rules. Favor
an existing specific subfolder over a general one (e.g. a Seurat how-to goes to
, not a generic bucket).
03_Research_Knowledge/Bioinformatics/seurat/ - Act on the best fit:
- A clearly matching folder exists → file it there.
- New note:
obsidian vault="MyVault" create path="03_Research_Knowledge/Bioinformatics/seurat/My Note.md" content="..." silent - Existing note to relocate: (
obsidian vault="MyVault" move path="00_Inbox/My Note.md" to="03_Research_Knowledge/Bioinformatics/seurat"may be a folder or a full path).to
- New note:
- A rough-but-imperfect fit exists (e.g. a tool with no dedicated subfolder) →
use the map's catch-all convention (e.g. ) and tell the user where it went.
Bioinformatics/misc/ - No category fits well → stop and ask the user before inventing a folder. Propose a name and location; don't silently create new taxonomy.
- A clearly matching folder exists → file it there.
- Remember new categories. When the user approves a new folder, append a line
describing it under the right section of (
00_Index/Folder_Map.md) so future filing decisions know about it.obsidian append path="00_Index/Folder_Map.md" content="..." - Briefly report the final path.
Notes on the CLI: makes intermediate folders as needed; add so
it doesn't steal focus by opening the note. 's accepts a destination
folder or a full path; use to change a title in place.
createsilentmovetorename name="New Title"目标:给定一条笔记(现有路径,或你即将写入的标题+内容),将其放入唯一最合适的文件夹。
- 读取映射文件一次:。
obsidian vault="MyVault" read path="00_Index/Folder_Map.md" - 匹配笔记主题与映射文件中的归档规则对应的目标文件夹。优先选择现有的特定子文件夹而非通用文件夹(例如,Seurat操作指南应放入,而非通用分类)。
03_Research_Knowledge/Bioinformatics/seurat/ - 根据最佳匹配执行操作:
- 存在明确匹配的文件夹 → 将笔记归档至该文件夹。
- 新笔记:
obsidian vault="MyVault" create path="03_Research_Knowledge/Bioinformatics/seurat/My Note.md" content="..." silent - 需迁移的现有笔记:(
obsidian vault="MyVault" move path="00_Inbox/My Note.md" to="03_Research_Knowledge/Bioinformatics/seurat"可以是文件夹路径或完整文件路径)。to
- 新笔记:
- 存在大致匹配但不够精准的文件夹(例如,某工具无专用子文件夹) → 使用映射文件中的兜底规则(例如),并告知用户笔记存放位置。
Bioinformatics/misc/ - 无合适分类 → 停止操作并询问用户,不要自行创建文件夹。建议文件夹名称和位置;不要静默创建新分类体系。
- 存在明确匹配的文件夹 → 将笔记归档至该文件夹。
- 记录新分类。当用户批准新文件夹后,在的对应章节添加一行描述(
00_Index/Folder_Map.md),以便后续归档决策能识别它。obsidian append path="00_Index/Folder_Map.md" content="..." - 简要报告最终路径。
CLI使用说明:命令会自动创建所需的中间文件夹;添加参数可避免打开笔记而占用焦点。命令的参数接受目标文件夹或完整路径;使用可原地修改标题。
createsilentmovetorename name="New Title"Mode 2 — Audit / reorganize
模式2 — 审核/重组
Goal: given a scope (a folder path, "recent inbox notes", or an explicit request
like "clean up the cellchat notes"), find problems, propose a plan, get explicit
confirmation, then execute. Never move, merge, or delete in bulk silently.
目标:给定范围(文件夹路径、“最近的收件箱笔记”或明确请求如“整理CellChat相关笔记”),找出问题,提出计划,获取明确确认后再执行。永远不要静默批量移动、合并或删除文件。
Step 1 — Gather signals for the scope
步骤1 — 收集范围内的信号
Read the map first for context, then use the structural commands. Scope every list
to the folder in question where the command supports it.
- — inventory + spot near-duplicate titles (e.g. "CellChat analysis" vs "CellChat Analysis v2").
obsidian vault="MyVault" files folder="<scope>" - — notes with no incoming links (nothing links to them; candidates for filing/merging/archiving).
obsidian vault="MyVault" orphans - — notes with no outgoing links (often stubs or captures that were never developed).
obsidian vault="MyVault" deadends - — compare content of suspected near-duplicates before proposing a merge.
obsidian vault="MyVault" search:context query="<topic>" path="<scope>" - — before merging or deleting a note, see what links to it so you don't strand references.
obsidian vault="MyVault" backlinks path="<file>"
There is no dedicated "duplicates" command; detect duplicates by comparing the
titles from and confirming with / .
filessearch:contextread先读取映射文件获取上下文,再使用结构命令。在命令支持的情况下,将所有列表限定在指定范围内。
- — 列出文件清单并识别标题近似重复的笔记(例如“CellChat analysis”与“CellChat Analysis v2”)。
obsidian vault="MyVault" files folder="<scope>" - — 无 incoming链接的笔记(没有任何内容链接到它们;可作为归档/合并/存档的候选对象)。
obsidian vault="MyVault" orphans - — 无 outgoing链接的笔记(通常是未完善的草稿或临时记录)。
obsidian vault="MyVault" deadends - — 在提出合并建议前,对比疑似近似重复笔记的内容。
obsidian vault="MyVault" search:context query="<topic>" path="<scope>" - — 在合并或删除笔记前,查看哪些内容链接到它,避免失效引用。
obsidian vault="MyVault" backlinks path="<file>"
没有专门的“重复项”检测命令;需通过命令获取标题并结合/命令确认来检测重复项。
filessearch:contextreadStep 2 — Propose a plan (and wait)
步骤2 — 提出计划(等待确认)
Present a concrete, itemized plan and stop for confirmation. Group by action:
Proposed reorganization for Bioinformatics/cellchat/ (7 notes):
MERGE
- "CellChat analysis.md" + "CellChat analysis (1).md" → keep "CellChat analysis.md",
fold unique content from the duplicate in, then delete the duplicate.
MOVE
- "Spatial CellChat.md" → Single_Cell/Spatial_Omics/ (topic is spatial, not the tool)
RENAME
- "untitled cellchat.md" → "CellChat LR database notes.md"
No change: 3 notes look fine.
Proceed? I won't move/merge/delete anything until you confirm.Keep the plan honest about uncertainty — flag guesses so the user can veto them.
呈现具体的分项计划并等待确认。按操作类型分组:
针对Bioinformatics/cellchat/的重组建议(共7条笔记):
合并
- "CellChat analysis.md" + "CellChat analysis (1).md" → 保留"CellChat analysis.md",将重复笔记中的独特内容合并进去,然后删除重复笔记。
移动
- "Spatial CellChat.md" → Single_Cell/Spatial_Omics/(主题是空间组学,而非工具本身)
重命名
- "untitled cellchat.md" → "CellChat LR数据库笔记.md"
无变动:3条笔记状态良好。
是否执行?在你确认前,我不会进行任何移动/合并/删除操作。如实说明计划中的不确定之处——标记猜测内容,以便用户可以否决。
Step 3 — Execute only after "yes"
步骤3 — 仅在用户确认“是”后执行
On confirmation, run the moves/renames/deletes through the CLI in the order
that keeps links intact (usually: merge content first, then delete the emptied
duplicate; move before rename if both apply). Use , , ,
/ for merges — never raw shell. Report what changed, and append any
new folders/categories you created to .
moverenamedeleteappendread00_Index/Folder_Map.md获得确认后,通过CLI按保持链接有效的顺序执行移动/重命名/删除操作(通常:先合并内容,再删除已清空的重复笔记;若同时需要移动和重命名,先移动后重命名)。使用、、、/命令执行合并操作——永远不要使用原生Shell。报告已更改的内容,并将创建的任何新文件夹/分类添加到中。
moverenamedeleteappendread00_Index/Folder_Map.mdKnown standing reorg candidates
已知待重组候选对象
If the vault's calls out known problem areas (legacy folders
that overlap a newer one, a subfolder with accumulated near-duplicate titles,
etc.), surface them when they're in scope — but still propose-and-confirm
before touching anything.
Folder_Map.md如果库的指出了已知问题区域(与新分类重叠的旧文件夹、积累了大量近似重复标题的子文件夹等),当这些区域在范围内时需指出——但仍需先提出计划并获得确认,再进行任何操作。
Folder_Map.mdCommand quick reference
命令速查
| Need | Command |
|---|---|
| Read the map | |
| Create/file a new note | |
| Move/relocate a note | |
| Rename in place | |
| Delete (to trash) | |
| List files in a folder | |
| Orphans / dead-ends | |
| Search with context | |
| Backlinks to a note | |
| Append to the map | |
Run to confirm exact params — the CLI is the ground truth.
obsidian help <command>| 需求 | 命令 |
|---|---|
| 读取映射文件 | |
| 创建/归档新笔记 | |
| 移动/迁移笔记 | |
| 原地重命名 | |
| 删除(移至回收站) | |
| 列出文件夹内的文件 | |
| 孤立笔记/无后续链接笔记 | |
| 带上下文的搜索 | |
| 笔记的反向链接 | |
| 追加内容到映射文件 | |
运行确认准确参数——CLI是最终依据。
obsidian help <command>