Goal & Principles
- Default to dry-run: generate
Report.md + Plan.md without making changes.
- Never do irreversible deletes by default.
- Single source of truth for execution:
Plan.md only.
- Apply is allowed even if
risk: high exists, as long as the user confirms.
- Rollback strategy B: always backup before apply, rollback by restoring backups.
- Conservative Inbox: if type cannot be reliably determined, keep note in
00_Inbox (no move).
Vault Conventions (Zettelkasten / folder-first)
Top folders (fixed)
00_Inbox/
01_Daily/
10_Literature/
20_Permanent/
30_Maps/
40_Projects/
90_Archive/
99_Plugconfig/
Attachments
- Per-top-folder assets subfolder name is fixed:
_assets/
00_Inbox/_assets/
10_Literature/_assets/
20_Permanent/_assets/
40_Projects/_assets/
01_Daily/_assets/ (optional)
Backup / rollback (strategy B)
- Backup root directory (fixed):
90_Archive/_organizer_backups/
- Each apply creates a timestamped backup folder:
90_Archive/_organizer_backups/YYYYMMDD-HHMMSS/
- Backup all impacted notes and any assets that may change/move.
- Rollback restores backed up files to their original vault-relative paths (overwrite current).
Naming Rules
Note filename pattern
Title normalization:
- trim leading/trailing spaces
- collapse multiple spaces into one
- replace invalid filename chars
/:\\*?"<>| with -
- optionally replace
: with :
Conflict strategy:
- If target exists, use incremental suffix:
(2) (3) ...
Frontmatter Rules (merge, preserve unknown)
Supported schema (recommended order)
type: inbox|daily|literature|permanent|map|project|archive
status: seed|draft|evergreen|archived
created: YYYY-MM-DD
updated: YYYY-MM-DD
tags: []
aliases: []
source: ""
Rules:
mode = merge: only fill missing keys; do not delete unknown keys.
created: set only if missing.
updated: set when this skill changes the note content/metadata.
source: recommended for literature; if missing, report and plan patch (MED by default).
Default status by type:
- inbox: seed
- daily: seed
- literature: draft
- permanent: draft
- project: draft
- map: evergreen
- archive: archived
Type → Folder Mapping
- inbox →
00_Inbox/
- daily →
01_Daily/
- literature →
10_Literature/
- permanent →
20_Permanent/
- map →
30_Maps/
- project →
40_Projects/
- archive →
90_Archive/
Inbox Conservative Policy (MUST)
When scanning/organizing notes under 00_Inbox/:
- If type cannot be reliably determined:
- do NOT generate move ops
- allowed ops:
frontmatter, rename, link fixes caused by rename
- If classification is reliable (e.g. has
source/url/doi/isbn → literature; has project frontmatter → project):
- generate
frontmatter + move (cross-top => HIGH)
Links Policy
For any rename/move:
- fix wikilinks
[[...]]
- fix markdown links
[](...)
Prefer to inline link fix flags inside the rename/move op (fixLinks) instead of separate linkFix ops (v1).
Non-Markdown Filetypes (.canvas / .base / .excalidraw.md)
Goals
- Treat
.excalidraw.md as Markdown notes (allowed to rename/move/merge frontmatter).
- Treat
.canvas and .base as non-Markdown artifacts: do not rewrite by default.
Rules
*.excalidraw.md:
- Allowed: frontmatter merge, rename, move.
- Fix inbound references in other notes like normal
.md.
*.canvas:
*.base:
Reporting additions (Report.md)
Add these codes in Findings when applicable:
- CANVAS-BROKEN-REF (best-effort)
- BASE-BROKEN-REF (best-effort)
- EXCALIDRAW-BROKEN-REF (if detectable)
- NONMD-SKIPPED (INFO transparency)
Outputs Overview (MUST)
This skill produces (at minimum):
Report.md (v1, human-readable + machine-parseable)
Plan.md (v1, executable; single source of truth for apply)
Default scan scope:
- include: all except excluded folders
- exclude by default:
90_Archive/, 99_Plugconfig/
High risk threshold:
- backlinks/occurrences >= 20 => HIGH impact
Orphan definition (v1):
- orphan = 0 backlinks AND not linked from any Map
- Map set = all
.md files under 30_Maps/
Report.md v1 Specification (MUST)
Header (MUST)
Report begins with an HTML comment containing YAML under root key report: including:
- version (1), generatedAt (ISO-8601 + timezone), timezone, vaultRoot, configPath
- scope include/exclude
- thresholds.highRiskBacklinks = 20
- definitions.orphan = { backlinks: 0, notInAnyMap: true }
- notesScanned, assetsScanned
Summary (MUST)
Include a fixed metric summary (table preferred), including at least:
- Notes scanned
- Notes with changes suggested
- High risk items
- Missing frontmatter
- Type missing/unknown
- Status invalid/missing
- Filename nonconforming
- Duplicate title candidates
- Broken wikilinks
- Broken markdown links
- Orphan notes (0 backlinks AND not in any Map)
- Assets scanned
- Unreferenced assets
- Missing assets (referenced but not found)
Findings (MUST): machine-parseable line format
Each finding MUST be a single line:
- [SEVERITY][CODE] | path= | refs= | extra=<k=v;...>
Where:
- SEVERITY ∈ HIGH|MED|LOW|INFO
- refs = backlinks count (for note impact) OR occurrences count (for link/asset issues)
- Always include path=. Include refs= when it matters (esp for high risk).
Severity rules (v1)
Hard rules:
- MOVE-CROSS-TOP => HIGH
- RENAME-CONFLICT => HIGH
- ASSET-MIGRATION => HIGH
- BROKEN-WIKILINK or BROKEN-MD-LINK with refs>=20 => HIGH
Default suggestions:
- missing/invalid frontmatter keys => MED
- filename nonconform => MED
- orphan => INFO
CODE table (v1 fixed)
Frontmatter / Schema
- FRONTMATTER-MISSING
- FRONTMATTER-MISSING-KEYS
- FRONTMATTER-INVALID-VALUE
- TYPE-MISSING
- TYPE-UNKNOWN
- STATUS-MISSING
- STATUS-INVALID
- SOURCE-MISSING
Naming / Location
- FILENAME-NONCONFORM
- RENAME-CONFLICT
- WRONG-FOLDER-BY-TYPE
- MOVE-CROSS-TOP
Links
- BROKEN-WIKILINK
- BROKEN-MD-LINK
- LINK-AMBIGUOUS
Assets
- ASSET-UNREFERENCED
- ASSET-MISSING
- ASSET-MIGRATION
- CANVAS-BROKEN-REF
- BASE-BROKEN-REF
- EXCALIDRAW-BROKEN-REF
- NONMD-SKIPPED
Graph / Maps
Duplicates (heuristic)
- DUPLICATE-TITLE-CANDIDATE
- DUPLICATE-CONTENT-CANDIDATE
Plan.md v1 Specification (MUST)
Header (MUST)
Plan begins with an HTML comment containing YAML under root key plan: including:
- version (1), generatedAt, timezone, vaultRoot, configPath
- dryRun (default true)
- backup.strategy = B
- backup.dir =
90_Archive/_organizer_backups/YYYYMMDD-HHMMSS
Executable ops (MUST): organizer-op blocks only
Plan execution MUST only read fenced code blocks with language tag organizer-op.
These blocks contain YAML and are the only source for machine actions.
Each op MUST include:
- id: op_0001...
- kind: frontmatter | rename | move (v1 core)
- risk: normal | high
Op ordering (MUST):
- frontmatter
- rename
- move
- optional asset/link ops
- optional maps update
Core op shapes:
frontmatter:
- path
- mode: merge
- set (optional)
- setIfMissing (optional)
- setAlways (optional)
rename:
- from
- to
- fixLinks: { wikilinks: true, markdownLinks: true }
move:
- from
- to
- assets (required if moving referenced assets across top folders):
- moveReferenced: true
- fromDir: /_assets
- toDir: /_assets
- fixLinks: { wikilinks: true, markdownLinks: true }
Report → Plan generation rules (v1: generate all ops)
- For every actionable issue detected in Report, generate corresponding
organizer-op in Plan.
- HIGH risk items are still generated; they are only marked as
risk: high.
- Conservative Inbox: no move op unless classification is reliable.
Mapping examples:
- FRONTMATTER-/ TYPE- / STATUS-* / SOURCE-MISSING => frontmatter op
- FILENAME-NONCONFORM / RENAME-CONFLICT => rename op
- WRONG-FOLDER-BY-TYPE / MOVE-CROSS-TOP => move op (cross-top => HIGH)
- BROKEN-* => preferably handled via fixLinks inside rename/move; otherwise separate linkFix (optional)
Apply & Rollback (v1)
Apply prerequisites (MUST):
- Create backup dir under
90_Archive/_organizer_backups/YYYYMMDD-HHMMSS/
- Backup all impacted files (notes + assets). Preserve vault-relative paths in backup.
- Validate Plan.md: all organizer-op blocks parse successfully; otherwise stop.
- Execute ops in order; stop on first failure and report op id.
Rollback (MUST):
- Restore from backup directory by copying backed-up files back to their original vault-relative paths (overwrite).
Trigger phrases / intents (examples)
Use this skill when the user asks to scan/organize an Obsidian vault, especially:
- “帮我整理一下 Obsidian vault / 笔记库”
- “扫描 Obsidian,输出 Report.md + 可执行 Plan.md(先别改)”
- “把文件名统一成 YYYYMMDD 标题”
- “批量补全/规范 frontmatter(type/status/created/updated/tags/aliases/source)”
- “找孤儿笔记(0入链且不在任何 Map)、断链、重复标题、未引用附件”
- “重命名/移动后修复 wikilinks / markdown links”
- “按 Zettelkasten(Inbox/Literature/Permanent/Maps/Projects)整理”
- “附件放到每个顶层文件夹的 _assets 并修复引用”
- “生成整理计划并可回滚(90_Archive/_organizer_backups)”
Keywords that strongly indicate this skill:
- Zettelkasten, folder-first, 00_Inbox/10_Literature/20_Permanent, _assets, dry-run, Plan.md executable, backup rollback
1---2name: obsidian-organizer3description: Organize and normalize an Obsidian vault in a Zettelkasten, folder-first style. Use when asked to scan/analyze an Obsidian vault, generate Report.md and an executable Plan.md, normalize filenames (YYYYMMDD Title), merge YAML frontmatter (type/status/created/updated/tags/aliases/source), plan moves between top folders (00_Inbox/10_Literature/20_Permanent/30_Maps/40_Projects/90_Archive), fix wikilinks and markdown links after renames/moves, manage attachments in per-top-folder _assets, and apply changes with rollback via backups in 90_Archive/_organizer_backups.4---5
6# Goal & Principles
7
8- Default to **dry-run**: generate `Report.md` + `Plan.md` without making changes.
9- Never do irreversible deletes by default.
10- **Single source of truth for execution**: `Plan.md` only.
11- Apply is allowed even if `risk: high` exists, as long as the user confirms.
12- Rollback strategy **B**: always backup before apply, rollback by restoring backups.
13- Conservative Inbox: if type cannot be reliably determined, keep note in `00_Inbox` (no move).
14
15# Vault Conventions (Zettelkasten / folder-first)
16
17## Top folders (fixed)
18
19- `00_Inbox/`
20- `01_Daily/`
21- `10_Literature/`
22- `20_Permanent/`
23- `30_Maps/`
24- `40_Projects/`
25- `90_Archive/`
26- `99_Plugconfig/`
27
28## Attachments
29
30- Per-top-folder assets subfolder name is fixed: `_assets/`
31 - `00_Inbox/_assets/`
32 - `10_Literature/_assets/`
33 - `20_Permanent/_assets/`
34 - `40_Projects/_assets/`
35 - `01_Daily/_assets/` (optional)
36
37## Backup / rollback (strategy B)
38
39- Backup root directory (fixed): `90_Archive/_organizer_backups/`
40- Each apply creates a timestamped backup folder:
41 - `90_Archive/_organizer_backups/YYYYMMDD-HHMMSS/`
42- Backup all impacted notes and any assets that may change/move.
43- Rollback restores backed up files to their original vault-relative paths (overwrite current).
44
45# Naming Rules
46
47## Note filename pattern
48
49- `YYYYMMDD_{title}.md`
50
51Title normalization:
52
53- trim leading/trailing spaces
54- collapse multiple spaces into one
55- replace invalid filename chars `/:\\*?"<>|` with `-`
56- optionally replace `:` with `:`
57
58Conflict strategy:
59
60- If target exists, use incremental suffix: `(2) (3) ...`
61
62# Frontmatter Rules (merge, preserve unknown)
63
64## Supported schema (recommended order)
65
66```yaml
67type: inbox|daily|literature|permanent|map|project|archive
68status: seed|draft|evergreen|archived
69created: YYYY-MM-DD
70updated: YYYY-MM-DD
71tags: []
72aliases: []
73source: ""
74```
75
76Rules:
77
78- `mode = merge`: only fill missing keys; do not delete unknown keys.
79- `created`: set only if missing.
80- `updated`: set when this skill changes the note content/metadata.
81- `source`: recommended for literature; if missing, report and plan patch (MED by default).
82
83Default status by type:
84
85- inbox: seed
86- daily: seed
87- literature: draft
88- permanent: draft
89- project: draft
90- map: evergreen
91- archive: archived
92
93# Type → Folder Mapping
94
95- inbox → `00_Inbox/`
96- daily → `01_Daily/`
97- literature → `10_Literature/`
98- permanent → `20_Permanent/`
99- map → `30_Maps/`
100- project → `40_Projects/`
101- archive → `90_Archive/`
102
103# Inbox Conservative Policy (MUST)
104
105When scanning/organizing notes under `00_Inbox/`:
106
107- If type cannot be reliably determined:
108 - do NOT generate move ops
109 - allowed ops: `frontmatter`, `rename`, link fixes caused by rename
110- If classification is reliable (e.g. has `source/url/doi/isbn` → literature; has `project` frontmatter → project):
111 - generate `frontmatter` + `move` (cross-top => HIGH)
112
113# Links Policy
114
115For any rename/move:
116
117- fix wikilinks `[[...]]`
118- fix markdown links `[](...)`
119 Prefer to inline link fix flags inside the rename/move op (`fixLinks`) instead of separate linkFix ops (v1).
120
121# Non-Markdown Filetypes (.canvas / .base / .excalidraw.md)
122
123## Goals
124
125- Treat `.excalidraw.md` as Markdown notes (allowed to rename/move/merge frontmatter).
126- Treat `.canvas` and `.base` as non-Markdown artifacts: **do not rewrite by default**.
127
128## Rules
129
130- `*.excalidraw.md`:
131 - Allowed: frontmatter merge, rename, move.
132 - Fix inbound references in other notes like normal `.md`.
133
134- `*.canvas`:
135 - Allowed: rename, move.
136
137- `*.base`:
138 - Allowed: rename, move.
139
140## Reporting additions (Report.md)
141
142Add these codes in Findings when applicable:
143
144- CANVAS-BROKEN-REF (best-effort)
145- BASE-BROKEN-REF (best-effort)
146- EXCALIDRAW-BROKEN-REF (if detectable)
147- NONMD-SKIPPED (INFO transparency)
148
149# Outputs Overview (MUST)
150
151This skill produces (at minimum):
152
153- `Report.md` (v1, human-readable + machine-parseable)
154- `Plan.md` (v1, executable; single source of truth for apply)
155
156Default scan scope:
157
158- include: all except excluded folders
159- exclude by default: `90_Archive/`, `99_Plugconfig/`
160
161High risk threshold:
162
163- backlinks/occurrences >= 20 => HIGH impact
164
165Orphan definition (v1):
166
167- orphan = 0 backlinks AND not linked from any Map
168- Map set = all `.md` files under `30_Maps/`
169
170# Report.md v1 Specification (MUST)
171
172## Header (MUST)
173
174Report begins with an HTML comment containing YAML under root key `report:` including:
175
176- version (1), generatedAt (ISO-8601 + timezone), timezone, vaultRoot, configPath
177- scope include/exclude
178- thresholds.highRiskBacklinks = 20
179- definitions.orphan = { backlinks: 0, notInAnyMap: true }
180- notesScanned, assetsScanned
181
182## Summary (MUST)
183
184Include a fixed metric summary (table preferred), including at least:
185
186- Notes scanned
187- Notes with changes suggested
188- High risk items
189- Missing frontmatter
190- Type missing/unknown
191- Status invalid/missing
192- Filename nonconforming
193- Duplicate title candidates
194- Broken wikilinks
195- Broken markdown links
196- Orphan notes (0 backlinks AND not in any Map)
197- Assets scanned
198- Unreferenced assets
199- Missing assets (referenced but not found)
200
201## Findings (MUST): machine-parseable line format
202
203Each finding MUST be a single line:
204
205- [SEVERITY][CODE] <message> | path=<vault-relative-path> | refs=<n> | extra=<k=v;...>
206
207Where:
208
209- SEVERITY ∈ HIGH|MED|LOW|INFO
210- refs = backlinks count (for note impact) OR occurrences count (for link/asset issues)
211- Always include path=. Include refs= when it matters (esp for high risk).
212
213### Severity rules (v1)
214
215Hard rules:
216
217- MOVE-CROSS-TOP => HIGH
218- RENAME-CONFLICT => HIGH
219- ASSET-MIGRATION => HIGH
220- BROKEN-WIKILINK or BROKEN-MD-LINK with refs>=20 => HIGH
221
222Default suggestions:
223
224- missing/invalid frontmatter keys => MED
225- filename nonconform => MED
226- orphan => INFO
227
228### CODE table (v1 fixed)
229
230Frontmatter / Schema
231
232- FRONTMATTER-MISSING
233- FRONTMATTER-MISSING-KEYS
234- FRONTMATTER-INVALID-VALUE
235- TYPE-MISSING
236- TYPE-UNKNOWN
237- STATUS-MISSING
238- STATUS-INVALID
239- SOURCE-MISSING
240
241Naming / Location
242
243- FILENAME-NONCONFORM
244- RENAME-CONFLICT
245- WRONG-FOLDER-BY-TYPE
246- MOVE-CROSS-TOP
247
248Links
249
250- BROKEN-WIKILINK
251- BROKEN-MD-LINK
252- LINK-AMBIGUOUS
253
254Assets
255
256- ASSET-UNREFERENCED
257- ASSET-MISSING
258- ASSET-MIGRATION
259- CANVAS-BROKEN-REF
260- BASE-BROKEN-REF
261- EXCALIDRAW-BROKEN-REF
262- NONMD-SKIPPED
263
264Graph / Maps
265
266- ORPHAN
267- MAP-COVERAGE
268
269Duplicates (heuristic)
270
271- DUPLICATE-TITLE-CANDIDATE
272- DUPLICATE-CONTENT-CANDIDATE
273
274# Plan.md v1 Specification (MUST)
275
276## Header (MUST)
277
278Plan begins with an HTML comment containing YAML under root key `plan:` including:
279
280- version (1), generatedAt, timezone, vaultRoot, configPath
281- dryRun (default true)
282- backup.strategy = B
283- backup.dir = `90_Archive/_organizer_backups/YYYYMMDD-HHMMSS`
284
285## Executable ops (MUST): organizer-op blocks only
286
287Plan execution MUST only read fenced code blocks with language tag `organizer-op`.
288These blocks contain YAML and are the only source for machine actions.
289
290Each op MUST include:
291
292- id: op_0001...
293- kind: frontmatter | rename | move (v1 core)
294- risk: normal | high
295
296Op ordering (MUST):
297
2981. frontmatter
2992. rename
3003. move
3014. optional asset/link ops
3025. optional maps update
303
304Core op shapes:
305
306frontmatter:
307
308- path
309- mode: merge
310- set (optional)
311- setIfMissing (optional)
312- setAlways (optional)
313
314rename:
315
316- from
317- to
318- fixLinks: { wikilinks: true, markdownLinks: true }
319
320move:
321
322- from
323- to
324- assets (required if moving referenced assets across top folders):
325 - moveReferenced: true
326 - fromDir: <top>/\_assets
327 - toDir: <top>/\_assets
328- fixLinks: { wikilinks: true, markdownLinks: true }
329
330# Report → Plan generation rules (v1: generate all ops)
331
332- For every actionable issue detected in Report, generate corresponding `organizer-op` in Plan.
333- HIGH risk items are still generated; they are only marked as `risk: high`.
334- Conservative Inbox: no move op unless classification is reliable.
335
336Mapping examples:
337
338- FRONTMATTER-_/ TYPE-_ / STATUS-\* / SOURCE-MISSING => frontmatter op
339- FILENAME-NONCONFORM / RENAME-CONFLICT => rename op
340- WRONG-FOLDER-BY-TYPE / MOVE-CROSS-TOP => move op (cross-top => HIGH)
341- BROKEN-\* => preferably handled via fixLinks inside rename/move; otherwise separate linkFix (optional)
342
343# Apply & Rollback (v1)
344
345Apply prerequisites (MUST):
346
3471. Create backup dir under `90_Archive/_organizer_backups/YYYYMMDD-HHMMSS/`
3482. Backup all impacted files (notes + assets). Preserve vault-relative paths in backup.
3493. Validate Plan.md: all organizer-op blocks parse successfully; otherwise stop.
3504. Execute ops in order; stop on first failure and report op id.
351
352Rollback (MUST):
353
354- Restore from backup directory by copying backed-up files back to their original vault-relative paths (overwrite).
355
356# Trigger phrases / intents (examples)
357
358Use this skill when the user asks to scan/organize an Obsidian vault, especially:
359
360- “帮我整理一下 Obsidian vault / 笔记库”
361- “扫描 Obsidian,输出 Report.md + 可执行 Plan.md(先别改)”
362- “把文件名统一成 YYYYMMDD 标题”
363- “批量补全/规范 frontmatter(type/status/created/updated/tags/aliases/source)”
364- “找孤儿笔记(0入链且不在任何 Map)、断链、重复标题、未引用附件”
365- “重命名/移动后修复 wikilinks / markdown links”
366- “按 Zettelkasten(Inbox/Literature/Permanent/Maps/Projects)整理”
367- “附件放到每个顶层文件夹的 \_assets 并修复引用”
368- “生成整理计划并可回滚(90_Archive/\_organizer_backups)”
369
370Keywords that strongly indicate this skill:
371
372- Zettelkasten, folder-first, 00_Inbox/10_Literature/20_Permanent, \_assets, dry-run, Plan.md executable, backup rollback