1---2name: obsidian-vault-manager3description: Manage local Obsidian vaults and markdown notes. Use when Codex needs to connect to local Obsidian vaults, register vault paths, or create/edit/refactor/search notes, frontmatter, links, tags, and attachments within a vault.4---56# Obsidian Vault Manager78## Quick start9- Register or discover vaults with Obsidian CLI first:10 - `python3 scripts/vault_registry.py discover --merge`11 - `python3 scripts/vault_registry.py list`12- Add a vault manually when needed:13 - `python3 scripts/vault_registry.py add --path "/path/to/Vault" --name "Vault"`14- Manage active workspace:15 - `python3 scripts/vault_registry.py set-active --name "Vault"`16 - `python3 scripts/vault_registry.py set-workdir --name "Vault" --workdir "path/inside/vault"`17 - `python3 scripts/vault_registry.py active`18- Run full Obsidian CLI command surface via `obsidian` subcommand (machine-first by default):19 - `python3 scripts/vault_registry.py obsidian --vault "Vault" search query="meeting notes"`20 - `python3 scripts/vault_registry.py obsidian --raw --vault "Vault" read file="Project.md"`21- Enable destructive commands with `--force-delete`:22 - `python3 scripts/vault_registry.py obsidian --force-delete --vault "Vault" delete file="Old.md" permanent`23- Pick a vault and confirm its path contains `.obsidian/` for manual adds.2425## Local data and env26- If <skill-root>/.. is `skills`, project_root is two levels above the `skills` folder (<skill-root>/../../..). Confirm with the user if unsure.27- Store all mutable state under <project_root>/.skills-data/obsidian-vault-manager/.28- Keep the vault registry at .skills-data/obsidian-vault-manager/vaults.json.29- Use .skills-data/obsidian-vault-manager/.env for SKILL_ROOT, SKILL_DATA_DIR, and per-skill env keys.30- Install local tools into .skills-data/obsidian-vault-manager/bin and prepend it to PATH when needed.31- Install dependencies under .skills-data/obsidian-vault-manager/venv (python/node/go/php).32- Write logs/cache/tmp under .skills-data/obsidian-vault-manager/logs, .skills-data/obsidian-vault-manager/cache, .skills-data/obsidian-vault-manager/tmp.33- Keep automation in <skill-root>/scripts and do not write outside <skill-root> and <project_root>/.skills-data/obsidian-vault-manager/ unless the user requests it.3435## Vault connection workflow361. Attempt CLI-first discovery with `scripts/vault_registry.py discover`; keep `.skills-data/obsidian-vault-manager/vaults.json` as the skill-owned state.372. Register or confirm vault entries in `vaults.json`.383. Set active vault with `scripts/vault_registry.py set-active --name <name>`.394. Ask the user for default working folder (relative path), defaulting to vault root (`.`).405. Save it with `scripts/vault_registry.py set-workdir --name <name> --workdir <relative/path>`.416. Confirm the chosen vault name, vault path, and working folder before edits.4243## Working rules44- Use the configured working folder as the default root for searches and edits (do not roam the entire vault unless requested).45- Edit only note content and attachments unless the user asks to change `.obsidian` settings.46- Preserve existing frontmatter keys; add new keys without reordering unless requested.47- Keep internal links valid after rename/move; update `[[Wiki Links]]` and markdown links.48- For `obsidian` passthrough commands, destructive actions require explicit `--force-delete` when supported by the command.49- Confirm before delete, rename, or bulk changes.5051## Common tasks52### Search and review53- Use `rg --glob '*.md' <pattern> <vault_path>` to find notes and references.54- Summarize matching files before edits.5556### Create a note57- Choose a filename that matches the main title.58- Add YAML frontmatter when needed (tags, aliases, status).59- Save as UTF-8 with a trailing newline.6061### Edit or refactor62- Keep headings and block IDs stable unless requested.63- When moving sections across notes, update inbound links and mentions.6465### Rename or move66- Rename the file and update links across the vault.67- For wiki links, update `[[Old Name]]` and `[[path/Old Name|alias]]`.6869### Attachments70- Keep attachment paths relative when possible.71- Update embeds and markdown links if a file is moved.7273## Scripts74- `scripts/vault_registry.py`: list, add, remove, set active, set default working folder, show active, discover vaults, and full CLI passthrough via `obsidian` subcommand; writes registry to `.skills-data/obsidian-vault-manager/vaults.json` (override with `--project-root` or `--data-root`).75- `scripts/obsidian_cli.py`: machine-first wrapper used for structured command execution and CLI discovery.7677## References78- `references/obsidian-vaults.md`: config locations and vault discovery details.79- `references/obsidian-markdown-skill.md`: upstream Obsidian markdown skill content (format rules, links, tasks).80- `references/obsidian-json-canvas-skill.md`: upstream JSON canvas skill content.81- `references/obsidian-bases-skill.md`: upstream Bases skill content.